@nuasite/cms-studio 0.68.0 → 0.68.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,121 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function u(e){return e==null||e===``}function d(e,t=()=>new Date){if(e.defaultValue!==void 0)return e.defaultValue;switch(e.type){case`boolean`:return!1;case`number`:return 0;case`array`:return[];case`date`:return t().toISOString().split(`T`)[0];default:return``}}function f(e){if(e.defaultValue!==void 0)return e.defaultValue;switch(e.type){case`boolean`:return!1;case`array`:return[];case`object`:return{};case`date`:case`datetime`:case`time`:case`month`:case`number`:case`year`:case`select`:case`reference`:return;default:return``}}function p(e,t){let n={};for(let r of e)r.required&&!r.hidden&&(n[r.name]=d(r,t));return n}function m(e){return e.derivedDeclared===!0||e.layout?.derivedFrom!==void 0}var h=new Set([`array`,`object`,`reference`,`image`,`file`,`video`,`boolean`,`number`,`date`,`datetime`]);function g(e){return e.name===`slug`&&(e.type===void 0||!h.has(e.type))}function _(e,t,n){if(n===``)return t;let r=e.find(g);return!r||m(r)||!u(t[r.name])?t:{...t,[r.name]:n}}var v=`en`;function y(e){let t=[];try{e!==void 0&&(t=Intl.Collator.supportedLocalesOf(e))}catch{}return new Intl.Collator(t.length>0?t:v,{numeric:!0})}function b(e,t){let n=y(t.locale),r=e.filter(e=>!e.hidden).sort((e,t)=>{let r=e.order??1/0,i=t.order??1/0;return r===i?n.compare(e.label,t.label)||(e.name<t.name?-1:+(e.name>t.name)):r<i?-1:1}),i=new Map(r.map(e=>[e.name,e])),a=e=>e.parentCollection===void 0?void 0:i.get(e.parentCollection),o=new Map,s=[],c=new Map,l=[];for(let e of r){let t=a(e);if(t&&!a(t)){l.push([t,e]);continue}let n={collection:e,children:[]};if(o.set(e.name,n),!e.group){s.push(n);continue}let r=c.get(e.group);r?r.push(n):c.set(e.group,[n])}for(let[e,t]of l)o.get(e.name)?.children.push(t);let u=s.length>0?[{items:s}]:[];for(let[e,t]of c)u.push({group:e,items:t});return u}function x(e){return e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().trim().replace(/[^\w\s\-/]/g,``).replace(/[\s_]+/g,`-`).replace(/^[-/]+|[-/]+$/g,``)}var S=new Set([`image/svg+xml`,`image/x-icon`,`image/vnd.microsoft.icon`]);function C(e){let t=e.indexOf(`;`);return(t===-1?e:e.slice(0,t)).trim().toLowerCase()}function w(e,t){if(t===`all`)return!0;let n=C(e);return t===`photo`?n.startsWith(`image/`)&&!S.has(n):t===`graphic`?S.has(n):t===`video`?n.startsWith(`video/`):n===`application/pdf`}function T(e,t){return t===`all`?e:e.filter(e=>w(e.contentType,t))}var E=`video/mp4,video/webm`,ee=409,D=class extends Error{status;code;constructor(e,t,n){super(n),this.status=e,this.code=t,this.name=`CmsClientError`}get isUnauthorized(){return this.code===`unauthorized`||this.status===401}get isForbidden(){return this.code===`forbidden`||this.status===403}get isNotFound(){return this.code===`not_found`||this.status===404}};function te(e){return ne(e)&&typeof e.error==`string`&&typeof e.code==`string`}function ne(e){return typeof e==`object`&&!!e}function re(e){return ne(e)?e.code===`conflict`&&typeof e.serverHash==`string`&&ne(e.serverFrontmatter):!1}var ie=[`not_found`,`conflict`,`validation`,`parse_error`,`io_error`,`unsupported`,`unauthorized`];function O(e){return ie.includes(e)}function k(e){return e instanceof D&&(e.status===501||e.code===`unsupported`)}function ae(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;async function n(e){let n=await fetch(`${t}${e}`,{method:`GET`,credentials:`include`,headers:{accept:`application/json`}});if(!n.ok)throw await r(n);return await n.json()}async function r(e){let t=await e.json().catch(()=>null);return a(e.status,t)}function i(e,t){if(te(e))return e.error;if(ne(e)){let t=e.error;if(ne(t)&&typeof t.message==`string`)return t.message}return t}function a(e,t){return e===403?new D(403,`forbidden`,i(t,`You do not have access to this project.`)):te(t)&&O(t.code)?new D(e,t.code,t.error):e===401?new D(401,`unauthorized`,`Your session has expired. Please reload.`):new D(e,`unknown`,i(t,`Request failed (${e})`))}function o(e,t){let n={method:e,credentials:`include`,headers:{accept:`application/json`}};return t!==void 0&&(n.body=JSON.stringify(t),n.headers={accept:`application/json`,"content-type":`application/json`}),n}async function s(e,n,i){let a=await fetch(`${t}${e}`,o(n,i));if(!a.ok)throw await r(a);return await a.json()}function c(e,t){return`/collections/${encodeURIComponent(e)}/entries/${encodeURIComponent(t)}`}return{getProject(){return n(`/project`)},getConfig(){return n(`/config`)},getCollections(){return n(`/collections`)},getComponents(){return n(`/components`)},getEntries(e,t={}){let r=new URLSearchParams;t.fields!==void 0&&r.set(`fields`,t.fields),t.draft!==void 0&&r.set(`draft`,t.draft),t.cursor!==void 0&&r.set(`cursor`,t.cursor),t.limit!==void 0&&r.set(`limit`,String(t.limit));let i=r.toString(),a=i===``?``:`?${i}`;return n(`/collections/${encodeURIComponent(e)}/entries${a}`)},getEntry(e,t){return n(c(e,t))},async updateEntry(e,n,i){let s=await fetch(`${t}${c(e,n)}`,o(`PATCH`,i));if(s.status===ee){let e=await s.json().catch(()=>null);if(re(e))return{status:`conflict`,conflict:e};throw a(s.status,e)}if(!s.ok)throw await r(s);return{status:`ok`,result:await s.json()}},createEntry(e,t){return s(`/collections/${encodeURIComponent(e)}/entries`,`POST`,t)},deleteEntry(e,t){return s(c(e,t),`DELETE`)},renameEntry(e,t,n){return s(`${c(e,t)}/rename`,`POST`,{to:n})},addArrayItem(e,t,n,r,i){let a=i===void 0?{field:n,value:r}:{field:n,value:r,index:i};return s(`${c(e,t)}/array`,`POST`,a)},removeArrayItem(e,t,n,r){return s(`${c(e,t)}/array`,`DELETE`,{field:n,index:r})},listMedia(e={}){let t=new URLSearchParams;e.folder!==void 0&&t.set(`folder`,e.folder),e.cursor!==void 0&&t.set(`cursor`,e.cursor),e.limit!==void 0&&t.set(`limit`,String(e.limit)),e.type!==void 0&&e.type!==`all`&&t.set(`type`,e.type),e.includeProjectImages&&t.set(`includeProjectImages`,`true`);let r=t.toString();return n(`/media${r===``?``:`?${r}`}`)},async uploadMedia(e,n={}){let i=new URLSearchParams;n.collection!==void 0&&i.set(`collection`,n.collection),n.entry!==void 0&&i.set(`entry`,n.entry),n.field!==void 0&&i.set(`field`,n.field),n.folder!==void 0&&i.set(`folder`,n.folder);let a=i.toString(),o=new FormData;o.append(`file`,e);let s=await fetch(`${t}/media${a===``?``:`?${a}`}`,{method:`POST`,credentials:`include`,headers:{accept:`application/json`},body:o});if(!s.ok)throw await r(s);return await s.json()},mediaFileUrl(e,n,r){return`${t}${c(e,n)}/asset?path=${encodeURIComponent(r)}`},mediaAssetUrl(e){return`${t}/asset?path=${encodeURIComponent(e)}`},deleteMedia(e){return s(`/media/${encodeURIComponent(e)}`,`DELETE`)},createFolder(e){return s(`/media`,`POST`,{folder:e})},updateMediaAnnotation(e,t){return s(`/media/${encodeURIComponent(e)}`,`PATCH`,{annotation:t})}}}var oe=1e3;async function se(e,t,n,r,i){let a=[],o,s=!0;for(;s;){let c=await e.getEntries(t,{fields:n,draft:`all`,limit:oe,cursor:o});s=c.hasMore;let l=r===void 0?c.entries.length:Math.max(0,r-a.length),u=c.entries.length<=l?c.entries:c.entries.slice(0,l);a.push(...u);let d=r!==void 0&&a.length>=r;if(i?.(u,s&&!d),d)return{entries:a,truncated:s||c.entries.length>u.length};if(s){if(c.cursor===void 0)throw Error(`The CMS entries response is missing a pagination cursor.`);o=c.cursor}}return{entries:a,truncated:!1}}function ce(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function le(e,t){switch(e){case`boolean`:return t===`true`||t===`1`||t.toLowerCase()===`yes`;case`number`:case`year`:case`month`:{let e=Number(t);return t.trim()===``||Number.isNaN(e)?t:e}case`date`:case`datetime`:case`time`:return ue(t);case`array`:case`object`:return ue(t);default:return t}}function ue(e){let t=e.trim();if(t!==``){if(!(t.startsWith(`{`)||t.startsWith(`[`)||t.startsWith(`"`)))return e;try{return JSON.parse(t)}catch{return e}}}function de(e,t){let n=new Map(t.map(e=>[e.name,e])),r={};for(let[t,i]of Object.entries(e.frontmatter)){let e=n.get(t);r[t]=e?le(e.type,i.value):i.value}return{frontmatter:r,body:e.body}}function fe(e){let t={};for(let n of e)n.hidden||(t[n.name]=f(n));return{frontmatter:t,body:``}}function pe(e){return f({name:``,type:e})}function me(e,t,n){let r=new Map(n.map(e=>[e.name,e])),i={};for(let[t,n]of Object.entries(e)){let e=r.get(t);i[t]=e&&typeof n==`string`?le(e.type,n):n}return{frontmatter:i,body:t??``}}function he(e,t){switch(e){case`boolean`:return t===`true`;case`number`:{if(t.trim()===``)return;let e=Number(t);return Number.isNaN(e)?t:e}case`year`:case`month`:{if(t.trim()===``)return;let e=Number(t);return Number.isNaN(e)?t:e}case`date`:case`datetime`:case`time`:return t.trim()===``?void 0:t;case`select`:case`reference`:return t===``?void 0:t;default:return t}}function ge(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e)}function _e(e,t){if(e==null||e===``)return``;if(typeof e==`string`){let n=e.trim().match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2}))?/);if(n){let[,e,r,i,a,o]=n;switch(t){case`datetime`:return`${e}-${r}-${i}T${a??`00`}:${o??`00`}`;case`time`:return a?`${a}:${o}`:``;case`month`:return`${e}-${r}`;default:return`${e}-${r}-${i}`}}if(t===`time`){let t=e.trim().match(/^(\d{2}):(\d{2})/);if(t)return`${t[1]}:${t[2]}`}}let n=e instanceof Date?e:new Date(String(e));if(Number.isNaN(n.getTime()))return``;let r=e=>String(e).padStart(2,`0`),i=n.getFullYear(),a=r(n.getMonth()+1),o=r(n.getDate()),s=r(n.getHours()),c=r(n.getMinutes());switch(t){case`datetime`:return`${i}-${a}-${o}T${s}:${c}`;case`time`:return`${s}:${c}`;case`month`:return`${i}-${a}`;default:return`${i}-${a}-${o}`}}function ve(e){return typeof e==`boolean`?e:typeof e==`string`?e===`true`||e===`1`||e.toLowerCase()===`yes`:!!e}function ye(e){return Array.isArray(e)?e:[]}function be(e){return ce(e)?e:{}}function xe(e,t,n){return{...e,frontmatter:{...e.frontmatter,[t]:n}}}function Se(e){return e==null||e===``}function Ce(e,t){return e.filter(e=>e.required&&!e.hidden&&!e.derivedDeclared&&Se(t[e.name])).map(e=>e.name)}function we(e){return e.length===1?`“${e[0]}” is required.`:`Required fields are empty: ${e.join(`, `)}.`}function Te(e,t,n){let r;async function i(i,a){try{let o=await e.updateEntry(t,n,{frontmatter:i.frontmatter,body:i.body,baseHash:a});return o.status===`conflict`?{status:`conflict`,conflict:o.conflict}:(o.result.sourceHash!==void 0&&(r=o.result.sourceHash),{status:`saved`,result:o.result})}catch(e){return{status:`error`,message:e instanceof D?e.message:`Save failed`,cause:e}}}return{get baseHash(){return r},save:e=>i(e,r),overwrite:(e,t)=>i(e,t.serverHash),adoptServer:(e,t)=>(r=e.serverHash,me(e.serverFrontmatter,e.serverBody,t)),reset:()=>{r=void 0}}}var Ee=4,De=[`title`,`name`,`heading`,`headline`];function Oe(e){return e.toLowerCase().replace(/[_-]/g,``)}function ke(e){let t=e.filter(e=>e.type===`text`||e.type===`textarea`);for(let e of De){let n=t.find(t=>Oe(t.name)===e);if(n)return n}}function Ae(e){return e.label??e.name}function je(e){let t=e.replace(/[_-]+/g,` `).trim();return t.charAt(0).toUpperCase()+t.slice(1)}function Me(e){return e.role===`publish-toggle`?0:e.role===`publish-date`?1:2}function Ne(e){return e.map((e,t)=>[e,t]).sort((e,t)=>(e[0].order??0)-(t[0].order??0)||e[1]-t[1]).map(([e])=>e)}function Pe(e){let t=[],n=new Map,r=[];for(let i of e)if(i.type===`object`||i.type===`array`)r.push({title:i.label??je(i.name),fields:[i],collapsed:!0});else{let e=i.group??``,r=n.get(e);r||(r={title:i.group,fields:[]},n.set(e,r),t.push(r)),r.fields.push(i)}return[...t,...r]}function Fe(e){let t=new Set;for(let n of e?.sections??[])for(let e of n.fields)t.add(e);return t}function Ie(e,t){return new Set([...e?.sidebar??[],...t])}function Le(e,t){let n=Ne(e.filter(e=>!e.hidden)),r=new Map(n.map(e=>[e.name,e])),i=Fe(t),a=Ie(t,i),o=ke(n),s=o&&!a.has(o.name)&&!o.positionDeclared&&o.position!==`header`?o:void 0,c=n.filter(e=>e!==s&&e.position===`header`),l=[],u=new Set;for(let e of t?.sidebar??[]){let t=r.get(e);t&&t!==s&&t.position!==`header`&&!u.has(e)&&(l.push(t),u.add(e))}for(let e of n)e===s||e.position===`header`||u.has(e.name)||i.has(e.name)||(e.position===`sidebar`||e.role!==void 0)&&(l.push(e),u.add(e.name));l.sort((e,t)=>Me(e)-Me(t));let d=n.filter(e=>e!==s&&e.position!==`header`&&!u.has(e.name)),f;if(t?.sections&&t.sections.length>0){let e=new Set;f=t.sections.map(t=>{let n=A(t.fields,r,d,e);return{title:t.title,fields:n,collapsed:t.collapsed}}).filter(e=>e.fields.length>0);let n=d.filter(t=>!e.has(t.name));n.length>0&&f.push({title:`Other`,fields:n})}else f=Pe(d);let p=t?.display??(f.length>Ee?`tabs`:`sections`);return{title:s,header:c,sidebar:l,sections:f,display:p}}function A(e,t,n,r){let i=[];for(let a of e){let e=t.get(a);e&&!r.has(a)&&n.includes(e)&&(r.add(a),i.push(e))}return i}var Re=/^(https?:)?\/\/|^data:/i,ze=/\.(png|jpe?g|gif|webp|avif|svg|ico|bmp)(\?|#|$)/i,Be=/\.(mp4|webm)(\?|#|$)/i;function Ve(e,t,n,r){return t===``?``:Re.test(t)?t:t.startsWith(`/`)?e.mediaAssetUrl(t):r===void 0?``:e.mediaFileUrl(n,r,t)}function He(e){return e.startsWith(`data:image/`)||ze.test(e)}function Ue(e){return e.startsWith(`data:video/`)||Be.test(e)}var We=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function te(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ne=/\/+/g;function re(e,t){return typeof e==`object`&&e&&e.key!=null?te(``+e.key):t.toString(36)}function ie(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function O(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,O(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+re(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ne,`$&/`)+`/`),O(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ne,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+re(a,u),c+=O(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+re(a,u++),c+=O(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return O(ie(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function k(e,t,n){if(e==null)return e;var r=[],i=0;return O(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ae(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var oe=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},se={map:k,forEach:function(e,t,n){k(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return k(e,function(){t++}),t},toArray:function(e){return k(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=se,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ae}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,oe)}catch(e){oe(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),Ge=o(((e,t)=>{t.exports=We()})),Ke=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),qe=o(((e,t)=>{t.exports=Ke()})),j=Ge(),M=qe();function N(e){let t={};for(let n of e.props)t[n.name]=n.defaultValue??``;return t}var Je={position:`fixed`,inset:0,background:`rgba(0,0,0,0.35)`,display:`flex`,alignItems:`flex-start`,justifyContent:`center`,paddingTop:`12vh`,zIndex:1e3},Ye={width:`min(440px, 92vw)`,maxHeight:`70vh`,display:`flex`,flexDirection:`column`,background:`#fff`,border:`1px solid #d4d4d8`,borderRadius:10,boxShadow:`0 12px 32px rgba(0,0,0,0.18)`,overflow:`hidden`,fontSize:13},Xe={border:`none`,borderBottom:`1px solid #ececed`,padding:`10px 12px`,font:`inherit`,outline:`none`},Ze={textAlign:`left`,border:`none`,background:`transparent`,padding:`8px 12px`,cursor:`pointer`,borderRadius:0};function Qe({open:e,components:t,onInsert:n,onClose:r}){let[i,a]=(0,j.useState)(``),o=(0,j.useMemo)(()=>{let e=i.trim().toLowerCase();return t.filter(t=>e===``||t.name.toLowerCase().includes(e)||(t.description??``).toLowerCase().includes(e))},[t,i]);return e?(0,M.jsx)(`div`,{style:Je,onMouseDown:r,children:(0,M.jsxs)(`div`,{style:Ye,onMouseDown:e=>e.stopPropagation(),children:[(0,M.jsx)(`input`,{style:Xe,placeholder:`Search components…`,autoFocus:!0,value:i,onChange:e=>a(e.target.value)}),(0,M.jsxs)(`div`,{style:{overflowY:`auto`},children:[o.length===0?(0,M.jsx)(`div`,{style:{padding:12,color:`#a1a1aa`},children:`No components`}):null,o.map(e=>(0,M.jsxs)(`button`,{type:`button`,style:Ze,onClick:()=>{n(e.name,N(e)),r()},children:[(0,M.jsx)(`div`,{style:{fontWeight:600,fontFamily:`ui-monospace, monospace`,color:`#3f3f46`},children:e.name}),e.description?(0,M.jsx)(`div`,{style:{color:`#71717a`,fontSize:12},children:e.description}):null]},e.name))]})]})}):null}var $e=function(e){return e.docTypeError=`docTypeError`,e.contextNotFound=`contextNotFound`,e.timerNotFound=`timerNotFound`,e.ctxCallOutOfScope=`ctxCallOutOfScope`,e.createNodeInParserFail=`createNodeInParserFail`,e.stackOverFlow=`stackOverFlow`,e.parserMatchError=`parserMatchError`,e.serializerMatchError=`serializerMatchError`,e.getAtomFromSchemaFail=`getAtomFromSchemaFail`,e.expectDomTypeError=`expectDomTypeError`,e.callCommandBeforeEditorView=`callCommandBeforeEditorView`,e.missingRootElement=`missingRootElement`,e.missingNodeInSchema=`missingNodeInSchema`,e.missingMarkInSchema=`missingMarkInSchema`,e.ctxNotBind=`ctxNotBind`,e.missingYjsDoc=`missingYjsDoc`,e}({}),et=class extends Error{constructor(e,t){super(t),this.name=`MilkdownError`,this.code=e}},tt=(e,t)=>typeof t==`function`?`[Function]`:t,nt=e=>JSON.stringify(e,tt);function rt(e){return new et($e.docTypeError,`Doc type error, unsupported type: ${nt(e)}`)}function it(e){return new et($e.contextNotFound,`Context "${e}" not found, do you forget to inject it?`)}function at(e){return new et($e.timerNotFound,`Timer "${e}" not found, do you forget to record it?`)}function ot(){return new et($e.ctxCallOutOfScope,`Should not call a context out of the plugin.`)}function st(e,t,n){let r=`Cannot create node for ${`name`in e?e.name:e}`,i=e=>{if(e==null)return`null`;if(Array.isArray(e))return`[${e.map(i).join(`, `)}]`;if(typeof e==`object`)return`toJSON`in e&&typeof e.toJSON==`function`?JSON.stringify(e.toJSON()):`spec`in e?JSON.stringify(e.spec):JSON.stringify(e);if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return JSON.stringify(e);if(typeof e==`function`)return`[Function: ${e.name||`anonymous`}]`;try{return String(e)}catch{return`[Unserializable]`}},a=[[`[Description]`,r],[`[Attributes]`,t],[`[Content]`,(n??[]).map(e=>e?typeof e==`object`&&`type`in e?`${e}`:i(e):`null`)]].reduce((e,[t,n])=>{let r=`${t}: ${i(n)}.`;return e.concat(r)},[]);return new et($e.createNodeInParserFail,a.join(`
2
+ `))}function ct(){return new et($e.stackOverFlow,`Stack over flow, cannot pop on an empty stack.`)}function lt(e){return new et($e.parserMatchError,`Cannot match target parser for node: ${nt(e)}.`)}function ut(e){return new et($e.serializerMatchError,`Cannot match target serializer for node: ${nt(e)}.`)}function dt(e){return new et($e.expectDomTypeError,`Expect to be a dom, but get: ${nt(e)}.`)}function ft(){return new et($e.callCommandBeforeEditorView,`You're trying to call a command before editor view initialized, make sure to get commandManager from ctx after editor view has been initialized`)}function pt(e){return new et($e.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${e}" in schema.`)}function mt(e){return new et($e.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${e}" in schema.`)}var ht=class{constructor(){this.sliceMap=new Map,this.get=e=>{let t=typeof e==`string`?[...this.sliceMap.values()].find(t=>t.type.name===e):this.sliceMap.get(e.id);if(!t)throw it(typeof e==`string`?e:e.name);return t},this.remove=e=>{let t=typeof e==`string`?[...this.sliceMap.values()].find(t=>t.type.name===e):this.sliceMap.get(e.id);t&&this.sliceMap.delete(t.type.id)},this.has=e=>typeof e==`string`?[...this.sliceMap.values()].some(t=>t.type.name===e):this.sliceMap.has(e.id)}},gt=class{#e=[];#t;#n=()=>{this.#e.forEach(e=>e(this.#t))};constructor(e,t,n){this.set=e=>{this.#t=e,this.#n()},this.get=()=>this.#t,this.update=e=>{this.#t=e(this.#t),this.#n()},this.type=n,this.#t=t,e.set(n.id,this)}on(e){return this.#e.push(e),()=>{this.#e=this.#e.filter(t=>t!==e)}}once(e){let t=this.on(n=>{e(n),t()});return t}off(e){this.#e=this.#e.filter(t=>t!==e)}offAll(){this.#e=[]}},_t=class{constructor(e,t){this.id=Symbol(`Context-${t}`),this.name=t,this._defaultValue=e,this._typeInfo=()=>{throw ot()}}create(e,t=this._defaultValue){return new gt(e,t,this)}},P=(e,t)=>new _t(e,t),vt=class{#e;#t;#n;#r=new Set;#i=new Set;#a=new Map;#o=new Map;constructor(e,t,n){this.read=()=>({metadata:this.#e,injectedSlices:[...this.#r].map(e=>({name:typeof e==`string`?e:e.name,value:this.#s(e)})),consumedSlices:[...this.#i].map(e=>({name:typeof e==`string`?e:e.name,value:this.#s(e)})),recordedTimers:[...this.#a].map(([e,{duration:t}])=>({name:e.name,duration:t,status:this.#c(e)})),waitTimers:[...this.#o].map(([e,{duration:t}])=>({name:e.name,duration:t,status:this.#c(e)}))}),this.onRecord=e=>{this.#a.set(e,{start:Date.now(),duration:0})},this.onClear=e=>{this.#a.delete(e)},this.onDone=e=>{let t=this.#a.get(e);t&&(t.duration=Date.now()-t.start)},this.onWait=(e,t)=>{let n=Date.now();t.finally(()=>{this.#o.set(e,{duration:Date.now()-n})}).catch(console.error)},this.onInject=e=>{this.#r.add(e)},this.onRemove=e=>{this.#r.delete(e)},this.onUse=e=>{this.#i.add(e)},this.#t=e,this.#n=t,this.#e=n}#s=e=>this.#t.get(e).get();#c=e=>this.#n.get(e).status},yt=class e{#e;#t;#n;#r;constructor(t,n,r){this.produce=t=>t&&Object.keys(t).length?new e(this.#e,this.#t,{...t}):this,this.inject=(e,t)=>{let n=e.create(this.#e.sliceMap);return t!=null&&n.set(t),this.#r?.onInject(e),this},this.remove=e=>(this.#e.remove(e),this.#r?.onRemove(e),this),this.record=e=>(e.create(this.#t.store),this.#r?.onRecord(e),this),this.clearTimer=e=>(this.#t.remove(e),this.#r?.onClear(e),this),this.isInjected=e=>this.#e.has(e),this.isRecorded=e=>this.#t.has(e),this.use=e=>(this.#r?.onUse(e),this.#e.get(e)),this.get=e=>this.use(e).get(),this.set=(e,t)=>this.use(e).set(t),this.update=(e,t)=>this.use(e).update(t),this.timer=e=>this.#t.get(e),this.done=e=>{this.timer(e).done(),this.#r?.onDone(e)},this.wait=e=>{let t=this.timer(e).start();return this.#r?.onWait(e,t),t},this.waitTimers=async e=>{await Promise.all(this.get(e).map(e=>this.wait(e)))},this.#e=t,this.#t=n,this.#n=r,r&&(this.#r=new vt(t,n,r))}get meta(){return this.#n}get inspector(){return this.#r}},bt=class{constructor(){this.store=new Map,this.get=e=>{let t=this.store.get(e.id);if(!t)throw at(e.name);return t},this.remove=e=>{this.store.delete(e.id)},this.has=e=>this.store.has(e.id)}},xt=class{#e=null;#t=null;#n;#r=`pending`;constructor(e,t){this.start=()=>(this.#e??=new Promise((e,t)=>{this.#t=t=>{t instanceof CustomEvent&&t.detail.id===this.#n&&(this.#r=`resolved`,this.#i(),t.stopImmediatePropagation(),e())},this.#a(()=>{this.#r===`pending`&&(this.#r=`rejected`),this.#i(),t(Error(`Timing ${this.type.name} timeout.`))}),this.#r=`pending`,addEventListener(this.type.name,this.#t)}),this.#e),this.done=()=>{let e=new CustomEvent(this.type.name,{detail:{id:this.#n}});dispatchEvent(e)},this.#n=Symbol(t.name),this.type=t,e.set(t.id,this)}get status(){return this.#r}#i=()=>{this.#t&&removeEventListener(this.type.name,this.#t)};#a=e=>{setTimeout(()=>{e()},this.type.timeout)}},F=class{constructor(e,t=3e3){this.create=e=>new xt(e,this),this.id=Symbol(`Timer-${e}`),this.name=e,this.timeout=t}},St=(e,t=3e3)=>new F(e,t),Ct={};function wt(e,t){let n=t||Ct;return Tt(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Tt(e,t,n){if(Dt(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Et(e.children,t,n)}return Array.isArray(e)?Et(e,t,n):``}function Et(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Tt(e[i],t,n);return r.join(``)}function Dt(e){return!!(e&&typeof e==`object`)}var Ot=document.createElement(`i`);function kt(e){let t=`&`+e+`;`;Ot.innerHTML=t;let n=Ot.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function At(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function jt(e,t){return e.length>0?(At(e,e.length,0,t),e):t}var Mt={}.hasOwnProperty;function Nt(e){let t={},n=-1;for(;++n<e.length;)Pt(t,e[n]);return t}function Pt(e,t){let n;for(n in t){let r=(Mt.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Mt.call(r,a)||(r[a]=[]);let e=i[a];Ft(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Ft(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);At(e,0,0,r)}function It(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function Lt(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Rt=qt(/[A-Za-z]/),zt=qt(/[\dA-Za-z]/),Bt=qt(/[#-'*+\--9=?A-Z^-~]/);function Vt(e){return e!==null&&(e<32||e===127)}var Ht=qt(/\d/),Ut=qt(/[\dA-Fa-f]/),Wt=qt(/[!-/:-@[-`{-~]/);function I(e){return e!==null&&e<-2}function L(e){return e!==null&&(e<0||e===32)}function R(e){return e===-2||e===-1||e===32}var Gt=qt(/\p{P}|\p{S}/u),Kt=qt(/\s/);function qt(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function z(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return R(r)?(e.enter(n),s(r)):t(r)}function s(r){return R(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Jt={tokenize:Yt};function Yt(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),z(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return I(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Xt={tokenize:Qt},Zt={tokenize:$t};function Qt(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return At(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Zt,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Zt,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return I(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;At(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function $t(e,t,n){return z(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function en(e){if(e===null||L(e)||Kt(e))return 1;if(Gt(e))return 2}function tn(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var nn={name:`attention`,resolveAll:rn,tokenize:an};function rn(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};on(d,-c),on(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=jt(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=jt(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=jt(l,tn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=jt(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=jt(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,At(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function an(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=en(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=en(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function on(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var sn={name:`autolink`,tokenize:cn};function cn(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Rt(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||zt(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||zt(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Vt(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Bt(t)?(e.consume(t),l):n(t)}function u(e){return zt(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||zt(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var ln={partial:!0,tokenize:un};function un(e,t,n){return r;function r(t){return R(t)?z(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||I(e)?t(e):n(e)}}var dn={continuation:{tokenize:pn},exit:mn,name:`blockQuote`,tokenize:fn};function fn(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return R(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function pn(e,t,n){let r=this;return i;function i(t){return R(t)?z(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(dn,t,n)(r)}}function mn(e){e.exit(`blockQuote`)}var hn={name:`characterEscape`,tokenize:gn};function gn(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Wt(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var _n={name:`characterReference`,tokenize:vn};function vn(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=zt,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Ut,u):(e.enter(`characterReferenceValue`),a=7,o=Ht,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===zt&&!kt(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var yn={partial:!0,tokenize:Sn},bn={concrete:!0,name:`codeFenced`,tokenize:xn};function xn(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),R(t)?z(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||I(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(yn,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||I(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):R(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),z(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||I(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||I(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&R(t)?z(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||I(t)?e.check(yn,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||I(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),R(t)?z(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),R(t)?z(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||I(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Sn(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Cn={name:`codeIndented`,tokenize:Tn},wn={partial:!0,tokenize:En};function Tn(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),z(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):I(t)?e.attempt(wn,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||I(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function En(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):I(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):z(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):I(e)?i(e):n(e)}}var Dn={name:`codeText`,previous:kn,resolve:On,tokenize:An};function On(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function kn(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function An(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):I(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||I(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var jn=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Mn(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Mn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Mn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Mn(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Mn(this.left,t.reverse())}}}};function Mn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Nn(e){let t={},n=-1,r,i,a,o,s,c,l,u=new jn(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Pn(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return At(e,0,1/0,u.slice(0)),!l}function Pn(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Fn={resolve:Ln,tokenize:Rn},In={partial:!0,tokenize:zn};function Ln(e){return Nn(e),e}function Rn(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):I(t)?e.check(In,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function zn(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),z(e,a,`linePrefix`)}function a(i){if(i===null||I(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Bn(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Vt(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||I(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||L(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Vt(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Vn(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):I(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||I(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!R(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Hn(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):I(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),z(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||I(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Un(e,t){let n;return r;function r(i){return I(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):R(i)?z(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Wn={name:`definition`,tokenize:Kn},Gn={partial:!0,tokenize:qn};function Kn(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Vn.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Lt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return L(t)?Un(e,l)(t):l(t)}function l(t){return Bn(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Gn,d,d)(t)}function d(t){return R(t)?z(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||I(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function qn(e,t,n){return r;function r(t){return L(t)?Un(e,i)(t):n(t)}function i(t){return Hn(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return R(t)?z(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||I(e)?t(e):n(e)}}var Jn={name:`hardBreakEscape`,tokenize:Yn};function Yn(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return I(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Xn={name:`headingAtx`,resolve:Zn,tokenize:Qn};function Zn(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},At(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Qn(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||L(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||I(n)?(e.exit(`atxHeading`),t(n)):R(n)?z(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||L(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var $n=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),er=[`pre`,`script`,`style`,`textarea`],tr={concrete:!0,name:`htmlFlow`,resolveTo:ir,tokenize:ar},nr={partial:!0,tokenize:sr},rr={partial:!0,tokenize:or};function ir(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function ar(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:oe):Rt(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Rt(a)?(e.consume(a),i=4,r.interrupt?t:oe):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:oe):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return Rt(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||L(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&er.includes(l)?(i=1,r.interrupt?t(s):D(s)):$n.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||zt(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return R(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Rt(t)?(e.consume(t),b):R(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||zt(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):R(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):R(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||I(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||L(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||R(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||I(t)?D(t):R(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),ie):t===60&&i===1?(e.consume(t),O):t===62&&i===4?(e.consume(t),se):t===63&&i===3?(e.consume(t),oe):t===93&&i===5?(e.consume(t),ae):I(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(nr,ce,te)(t)):t===null||I(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),D)}function te(t){return e.check(rr,ne,ce)(t)}function ne(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return t===null||I(t)?te(t):(e.enter(`htmlFlowData`),D(t))}function ie(t){return t===45?(e.consume(t),oe):D(t)}function O(t){return t===47?(e.consume(t),o=``,k):D(t)}function k(t){if(t===62){let n=o.toLowerCase();return er.includes(n)?(e.consume(t),se):D(t)}return Rt(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),k):D(t)}function ae(t){return t===93?(e.consume(t),oe):D(t)}function oe(t){return t===62?(e.consume(t),se):t===45&&i===2?(e.consume(t),oe):D(t)}function se(t){return t===null||I(t)?(e.exit(`htmlFlowData`),ce(t)):(e.consume(t),se)}function ce(n){return e.exit(`htmlFlow`),t(n)}}function or(e,t,n){let r=this;return i;function i(t){return I(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function sr(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(ln,t,n)}}var cr={name:`htmlText`,tokenize:lr};function lr(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Rt(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Rt(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):I(t)?(o=d,O(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ie(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):I(t)?(o=h,O(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ie(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ie(t):I(t)?(o=v,O(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):I(t)?(o=y,O(t)):(e.consume(t),y)}function b(e){return e===62?ie(e):y(e)}function x(t){return Rt(t)?(e.consume(t),S):n(t)}function S(t){return t===45||zt(t)?(e.consume(t),S):C(t)}function C(t){return I(t)?(o=C,O(t)):R(t)?(e.consume(t),C):ie(t)}function w(t){return t===45||zt(t)?(e.consume(t),w):t===47||t===62||L(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ie):t===58||t===95||Rt(t)?(e.consume(t),E):I(t)?(o=T,O(t)):R(t)?(e.consume(t),T):ie(t)}function E(t){return t===45||t===46||t===58||t===95||zt(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):I(t)?(o=ee,O(t)):R(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):I(t)?(o=D,O(t)):R(t)?(e.consume(t),D):(e.consume(t),ne)}function te(t){return t===i?(e.consume(t),i=void 0,re):t===null?n(t):I(t)?(o=te,O(t)):(e.consume(t),te)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||L(t)?T(t):(e.consume(t),ne)}function re(e){return e===47||e===62||L(e)?T(e):n(e)}function ie(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function O(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),k}function k(t){return R(t)?z(e,ae,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ae(t)}function ae(t){return e.enter(`htmlTextData`),o(t)}}var ur={name:`labelEnd`,resolveAll:mr,resolveTo:hr,tokenize:gr},dr={tokenize:_r},fr={tokenize:vr},pr={tokenize:yr};function mr(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&At(e,0,e.length,n),e}function hr(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=jt(s,e.slice(a+1,a+r+3)),s=jt(s,[[`enter`,u,t]]),s=jt(s,tn(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=jt(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=jt(s,e.slice(o+1)),s=jt(s,[[`exit`,c,t]]),At(e,a,e.length,s),e}function gr(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Lt(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(dr,u,o?u:d)(t):t===91?e.attempt(fr,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(pr,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function _r(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return L(t)?Un(e,a)(t):a(t)}function a(t){return t===41?u(t):Bn(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return L(t)?Un(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Hn(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return L(t)?Un(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function vr(e,t,n){let r=this;return i;function i(t){return Vn.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Lt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function yr(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var br={name:`labelStartImage`,resolveAll:ur.resolveAll,tokenize:xr};function xr(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Sr={name:`labelStartLink`,resolveAll:ur.resolveAll,tokenize:Cr};function Cr(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var wr={name:`lineEnding`,tokenize:Tr};function Tr(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),z(e,t,`linePrefix`)}}var Er={name:`thematicBreak`,tokenize:Dr};function Dr(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||I(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),R(t)?z(e,s,`whitespace`)(t):s(t))}}var Or={continuation:{tokenize:Mr},exit:Pr,name:`list`,tokenize:jr},kr={partial:!0,tokenize:Fr},Ar={partial:!0,tokenize:Nr};function jr(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Ht(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Er,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Ht(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(ln,r.interrupt?n:u,e.attempt(kr,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return R(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Mr(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ln,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,z(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!R(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ar,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,z(e,e.attempt(Or,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Nr(e,t,n){let r=this;return z(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Pr(e){e.exit(this.containerState.type)}function Fr(e,t,n){let r=this;return z(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!R(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Ir={name:`setextUnderline`,resolveTo:Lr,tokenize:Rr};function Lr(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Rr(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),R(t)?z(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||I(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var zr={tokenize:Br};function Br(e){let t=this,n=e.attempt(ln,r,e.attempt(this.parser.constructs.flowInitial,i,z(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Fn,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Vr={resolveAll:Gr()},Hr=Wr(`string`),Ur=Wr(`text`);function Wr(e){return{resolveAll:Gr(e===`text`?Kr:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Gr(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Kr(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var qr=s({attentionMarkers:()=>ti,contentInitial:()=>Yr,disable:()=>ni,document:()=>Jr,flow:()=>Zr,flowInitial:()=>Xr,insideSpan:()=>ei,string:()=>Qr,text:()=>$r}),Jr={42:Or,43:Or,45:Or,48:Or,49:Or,50:Or,51:Or,52:Or,53:Or,54:Or,55:Or,56:Or,57:Or,62:dn},Yr={91:Wn},Xr={[-2]:Cn,[-1]:Cn,32:Cn},Zr={35:Xn,42:Er,45:[Ir,Er],60:tr,61:Ir,95:Er,96:bn,126:bn},Qr={38:_n,92:hn},$r={[-5]:wr,[-4]:wr,[-3]:wr,33:br,38:_n,42:nn,60:[sn,cr],91:Sr,92:[Jn,hn],93:ur,95:nn,96:Dn},ei={null:[nn,Vr]},ti={null:[42,95]},ni={null:[]};function ri(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=jt(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=tn(a,l.events,l),l.events):[]}function f(e,t){return ai(p(e),t)}function p(e){return ii(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){I(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&At(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function ii(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function ai(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
3
+ `;break;case-3:o=`\r
4
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function oi(e){let t={constructs:Nt([qr,...(e||{}).extensions||[]]),content:n(Jt),defined:[],document:n(Xt),flow:n(zr),lazy:{},string:n(Hr),text:n(Ur)};return t;function n(e){return n;function n(n){return ri(t,e,n)}}}function si(e){for(;!Nn(e););return e}var ci=/[\0\t\n\r]/g;function li(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(ci.lastIndex=u,c=ci.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var ui=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function di(e){return e.replace(ui,fi)}function fi(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return It(n.slice(t?2:1),t?16:10)}return kt(n)||e}function pi(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?hi(e.position):`start`in e||`end`in e?hi(e):`line`in e||`column`in e?mi(e):``}function mi(e){return gi(e&&e.line)+`:`+gi(e&&e.column)}function hi(e){return mi(e&&e.start)+`-`+mi(e&&e.end)}function gi(e){return e&&typeof e==`number`?e:1}var _i={}.hasOwnProperty;function vi(e,t,n){return typeof t!=`string`&&(n=t,t=void 0),yi(n)(si(oi(n).document().write(li()(e,t,!0))))}function yi(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Te),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(xe),blockQuote:a(ge),characterEscape:T,characterReference:T,codeFenced:a(_e),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(_e,o),codeText:a(ve,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ye),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(be),hardBreakEscape:a(Se),hardBreakTrailing:a(Se),htmlFlow:a(Ce,o),htmlFlowData:T,htmlText:a(Ce,o),htmlTextData:T,image:a(we),label:o,link:a(Te),listItem:a(De),listItemValue:f,listOrdered:a(Ee,d),listUnordered:a(Ee),paragraph:a(Oe),reference:le,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(xe),strong:a(ke),thematicBreak:a(je)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:he,autolinkProtocol:me,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:fe,characterReference:pe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(re),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(te),htmlFlowData:E,htmlText:c(ne),htmlTextData:E,image:c(O),label:ae,labelText:k,lineEnding:ee,link:c(ie),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ue,resourceDestinationString:oe,resourceTitleString:se,resource:ce,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};xi(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];_i.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Ci).call(a,void 0,e[0])}for(r.position={start:bi(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:bi(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:bi(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Ci).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+pi({start:e.start,end:e.end})+`): it’s not open`);n.position.end=bi(e.end)}function u(){return wt(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Lt(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=Ae(),n.position={start:bi(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=bi(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=bi(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function D(){this.data.atHardBreak=!0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ie(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function O(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function k(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=di(t),n.identifier=Lt(t).toLowerCase()}function ae(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function oe(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function se(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ce(){this.data.inReference=void 0}function le(){this.data.referenceType=`collapsed`}function ue(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Lt(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function de(e){this.data.characterReferenceType=e.type}function fe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=It(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=kt(t);let i=this.stack[this.stack.length-1];i.value+=r}function pe(e){let t=this.stack.pop();t.position.end=bi(e.end)}function me(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function he(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ge(){return{type:`blockquote`,children:[]}}function _e(){return{type:`code`,lang:null,meta:null,value:``}}function ve(){return{type:`inlineCode`,value:``}}function ye(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function be(){return{type:`emphasis`,children:[]}}function xe(){return{type:`heading`,depth:0,children:[]}}function Se(){return{type:`break`}}function Ce(){return{type:`html`,value:``}}function we(){return{type:`image`,title:null,url:``,alt:null}}function Te(){return{type:`link`,title:null,url:``,children:[]}}function Ee(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function De(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Oe(){return{type:`paragraph`,children:[]}}function ke(){return{type:`strong`,children:[]}}function Ae(){return{type:`text`,value:``}}function je(){return{type:`thematicBreak`}}}function bi(e){return{line:e.line,column:e.column,offset:e.offset}}function xi(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?xi(e,r):Si(e,r)}}function Si(e,t){let n;for(n in t)if(_i.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Ci(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+pi({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+pi({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+pi({start:t.start,end:t.end})+`) is still open`)}function wi(e){let t=this;t.parser=n;function n(n){return vi(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}var Ti={}.hasOwnProperty;function Ei(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Ti.call(t,e)){let n=String(t[e]);i=Ti.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Di={}.hasOwnProperty;function Oi(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)Oi(e,t.extensions[n]);for(r in t)if(Di.call(t,r))switch(r){case`extensions`:break;case`unsafe`:ki(e[r],t[r]);break;case`join`:ki(e[r],t[r]);break;case`handlers`:Ai(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function ki(e,t){t&&e.push(...t)}function Ai(e,t){t&&Object.assign(e,t)}function ji(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Mi);return i(),o}function Mi(e,t,n){return`>`+(n?``:` `)+e}function Ni(e,t){return Pi(e,t.inConstruct,!0)&&!Pi(e,t.notInConstruct,!1)}function Pi(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Fi(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
5
+ `&&Ni(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
6
+ `}function Ii(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Li(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^ \r\n]/.test(e.value)||/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Ri(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function zi(e,t,n,r){let i=Ri(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Li(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Bi);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Ii(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
7
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
8
+ `),a&&(u+=s.move(a+`
9
+ `)),u+=s.move(c),l(),u}function Bi(e,t,n){return(n?``:` `)+e}function Vi(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Hi(e,t,n,r){let i=Vi(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
10
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Ui(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Wi(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Gi(e,t,n){let r=en(e),i=en(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ki.peek=qi;function Ki(e,t,n,r){let i=Ui(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Gi(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Wi(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Gi(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Wi(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function qi(e,t,n){return n.options.emphasis||`*`}var Ji=(function(e){if(e==null)return $i;if(typeof e==`function`)return Qi(e);if(typeof e==`object`)return Array.isArray(e)?Yi(e):Xi(e);if(typeof e==`string`)return Zi(e);throw Error(`Expected function, string, or object as test`)});function Yi(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Ji(e[n]);return Qi(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Xi(e){let t=e;return Qi(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Zi(e){return Qi(t);function t(t){return t&&t.type===e}}function Qi(e){return t;function t(t,n,r){return!!(ea(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function $i(){return!0}function ea(e){return typeof e==`object`&&!!e&&`type`in e}function ta(e){return e}var na=[],ra=`skip`;function ia(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Ji(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+ta(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=na,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=aa(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function aa(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?na:[e]}function oa(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),ia(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}function sa(e,t){let n=!1;return oa(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&wt(e)&&(t.options.setext||n))}function ca(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(sa(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
11
+ `,after:`
12
+ `});return r(),t(),o+`
13
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
14
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
15
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=Wi(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}la.peek=ua;function la(e){return e.value||``}function ua(){return`<`}da.peek=fa;function da(e,t,n,r){let i=Vi(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function fa(){return`!`}pa.peek=ma;function pa(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function ma(){return`!`}ha.peek=ga;function ha(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function ga(){return"`"}function _a(e,t){let n=wt(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][a-z+.-]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}va.peek=ya;function va(e,t,n,r){let i=Vi(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(_a(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function ya(e,t,n){return _a(e,n)?`<`:`[`}ba.peek=xa;function ba(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function xa(){return`[`}function Sa(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Ca(e){let t=Sa(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function wa(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Ta(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Ea(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?wa(n):Sa(n),s=e.ordered?o===`.`?`)`:`.`:Ca(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if(o!==`*`&&o!==`-`||!t||t.children&&t.children[0]||n.stack[n.stack.length-1]!==`list`||n.stack[n.stack.length-2]!==`listItem`||n.stack[n.stack.length-3]!==`list`||n.stack[n.stack.length-4]!==`listItem`||n.indexStack[n.indexStack.length-1]!==0||n.indexStack[n.indexStack.length-2]!==0||n.indexStack[n.indexStack.length-3]!==0||(c=!0),Ta(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Da(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Oa(e,t,n,r){let i=Da(n),a=n.bulletCurrent||Sa(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function ka(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Aa=Ji([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function ja(e,t,n,r){return(e.children.some(function(e){return Aa(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Ma(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Na.peek=Pa;function Na(e,t,n,r){let i=Ma(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Gi(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Wi(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Gi(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Wi(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Pa(e,t,n){return n.options.strong||`*`}function Fa(e,t,n,r){return n.safe(e.value,r)}function Ia(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function La(e,t,n){let r=(Ta(n)+(n.options.ruleSpaces?` `:``)).repeat(Ia(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Ra={blockquote:ji,break:Fi,code:zi,definition:Hi,emphasis:Ki,hardBreak:Fi,heading:ca,html:la,image:da,imageReference:pa,inlineCode:ha,link:va,linkReference:ba,list:Ea,listItem:Oa,paragraph:ka,root:ja,strong:Na,text:Fa,thematicBreak:La},za=[Ba];function Ba(e,t,n,r){if(t.type===`code`&&Li(t,r)&&(e.type===`list`||e.type===t.type&&Li(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&sa(t,r))?void 0:+!!n.spread}var Va=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],Ha=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
16
+ `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:Va},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
17
+ ]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:Va},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
18
+ *])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:Va},{atBreak:!0,character:`+`,after:`(?:[ \r
19
+ ])`},{atBreak:!0,character:`-`,after:`(?:[ \r
20
+ -])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
21
+ ]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:Va},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:Va},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:Va},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:Va},{atBreak:!0,character:`~`}];function Ua(e){return e.label||!e.identifier?e.label||``:di(e.identifier)}function Wa(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function Ga(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
22
+ `)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=Wi(c.charCodeAt(0))+f.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,p&&(a.length>0&&p.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+Wi(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function Ka(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
23
+ `,after:`
24
+ `,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(qa(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function qa(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
25
+ `.repeat(1+a);if(a===!1)return`
26
+
27
+ <!---->
28
+
29
+ `}return`
30
+
31
+ `}var Ja=/\r?\n|\r/g;function Ya(e,t){let n=[],r=0,i=0,a;for(;a=Ja.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function Xa(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!Ni(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(Za);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(Qa(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(Wi(r.charCodeAt(e))),c++))}return a.push(Qa(r.slice(c,l),n.after)),a.join(``)}function Za(e,t){return e-t}function Qa(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function $a(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function eo(e,t){let n=t||{},r={associationId:Ua,containerPhrasing:io,containerFlow:ao,createTracker:$a,compilePattern:Wa,enter:a,handlers:{...Ra},handle:void 0,indentLines:Ya,indexStack:[],join:[...za],options:{},safe:oo,stack:[],unsafe:[...Ha]};Oi(r,n),r.options.tightDefinitions&&r.join.push(ro),r.handle=Ei(`type`,{invalid:to,unknown:no,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
32
+ `,after:`
33
+ `,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
34
+ `),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function to(e){throw Error("Cannot handle value `"+e+"`, expected node")}function no(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function ro(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function io(e,t){return Ga(e,this,t)}function ao(e,t){return Ka(e,this,t)}function oo(e,t){return Xa(this,e,t)}function so(e){let t=this;t.compiler=n;function n(n){return eo(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}function co(e){if(e)throw e}var lo=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function uo(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function B(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?fo(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function fo(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var V=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=pi(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};V.prototype.file=``,V.prototype.name=``,V.prototype.reason=``,V.prototype.message=``,V.prototype.stack=``,V.prototype.column=void 0,V.prototype.line=void 0,V.prototype.ancestors=void 0,V.prototype.cause=void 0,V.prototype.fatal=void 0,V.prototype.place=void 0,V.prototype.ruleId=void 0,V.prototype.source=void 0;var po={basename:mo,dirname:ho,extname:go,join:_o,sep:`/`};function mo(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);bo(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function ho(e){if(bo(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function go(e){bo(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function _o(...e){let t=-1,n;for(;++t<e.length;)bo(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:vo(n)}function vo(e){bo(e);let t=e.codePointAt(0)===47,n=yo(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function yo(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function bo(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var xo={cwd:So};function So(){return`/`}function Co(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function wo(e){if(typeof e==`string`)e=new URL(e);else if(!Co(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return To(e)}function To(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Eo=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Do=class{constructor(e){let t;t=e?Co(e)?{path:e}:typeof e==`string`||jo(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:xo.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Eo.length;){let e=Eo[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Eo.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?po.basename(this.path):void 0}set basename(e){ko(e,`basename`),Oo(e,`basename`),this.path=po.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?po.dirname(this.path):void 0}set dirname(e){Ao(this.basename,`dirname`),this.path=po.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?po.extname(this.path):void 0}set extname(e){if(Oo(e,`extname`),Ao(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=po.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Co(e)&&(e=wo(e)),ko(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?po.basename(this.path,this.extname):void 0}set stem(e){ko(e,`stem`),Oo(e,`stem`),this.path=po.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new V(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Oo(e,t){if(e&&e.includes(po.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+po.sep+"`")}function ko(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Ao(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function jo(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Mo=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),No=l(lo(),1),Po={}.hasOwnProperty,Fo=new class e extends Mo{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=B()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,No.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Ro(`data`,this.frozen),this.namespace[e]=t,this):Po.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Ro(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Vo(e),n=this.parser||this.Parser;return Io(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Io(`process`,this.parser||this.Parser),Lo(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Vo(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Uo(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Io(`processSync`,this.parser||this.Parser),Lo(`processSync`,this.compiler||this.Compiler),this.process(e,r),Bo(`processSync`,`process`,t),n;function r(e,r){t=!0,co(e),n=r}}run(e,t,n){zo(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Vo(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Bo(`runSync`,`run`,n),r;function i(e,t){co(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Vo(t),r=this.compiler||this.Compiler;return Lo(`stringify`,r),zo(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Ro(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,No.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];uo(o)&&uo(r)&&(r=(0,No.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Io(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Lo(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Ro(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zo(e){if(!uo(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Bo(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Vo(e){return Ho(e)?e:new Do(e)}function Ho(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Uo(e){return typeof e==`string`||Wo(e)}function Wo(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function Go(e){this.content=e}Go.prototype={constructor:Go,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new Go(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Go(n)},addToStart:function(e,t){return new Go([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Go(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new Go(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Go.from(e),e.size?new Go(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Go.from(e),e.size?new Go(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Go.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Go.from=function(e){if(e instanceof Go)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Go(t)};function Ko(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a)n+=i.nodeSize;else{if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=Ko(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}}function qo(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s)n-=c,r-=c;else{if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=qo(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}}var H=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Ko(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return qo(this,e,t,n)}findIndex(e){if(e==0)return Yo(0,e);if(e==this.size)return Yo(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Yo(t+1,i):Yo(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};H.empty=new H([],0);var Jo={index:0,offset:0};function Yo(e,t){return Jo.index=e,Jo.offset=t,Jo}function Xo(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Xo(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Xo(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var Zo=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Xo(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};Zo.none=[];var Qo=class extends Error{},U=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=es(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e($o(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(H.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};U.empty=new U(H.empty,0,0);function $o(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy($o(a.content,t-i-1,n-i-1)))}function es(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=es(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function ts(e,t,n){if(n.openStart>e.depth)throw new Qo(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Qo(`Inconsistent open depths`);return ns(e,t,n,0)}function ns(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=ns(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return cs(a,us(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return cs(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=ds(n,e);return cs(a,ls(e,i,o,t,r))}}function rs(e,t){if(!t.type.compatibleContent(e.type))throw new Qo(`Cannot join `+t.type.name+` onto `+e.type.name)}function is(e,t,n){let r=e.node(n);return rs(r,t.node(n)),r}function as(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function ss(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(as(e.nodeAfter,r),a++));for(let e=a;e<o;e++)as(i.child(e),r);t&&t.depth==n&&t.textOffset&&as(t.nodeBefore,r)}function cs(e,t){return e.type.checkContent(t),e.copy(t)}function ls(e,t,n,r,i){let a=e.depth>i&&is(e,t,i+1),o=r.depth>i&&is(n,r,i+1),s=[];return ss(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(rs(a,o),as(cs(a,ls(e,t,n,r,i+1)),s)):(a&&as(cs(a,us(e,t,i+1)),s),ss(t,n,i,s),o&&as(cs(o,us(n,r,i+1)),s)),ss(r,null,i,s),new H(s)}function us(e,t,n){let r=[];return ss(null,e,n,r),e.depth>n&&as(cs(is(e,t,n+1),us(e,t,n+1)),r),ss(t,null,n,r),new H(r)}function ds(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(H.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var fs=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Zo.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive!==!1||r&&i[a].isInSet(r.marks)||(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive!==!1||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new gs(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=hs.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else hs.set(t,r=new ps);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%ms,i}},ps=class{constructor(){this.elts=[],this.i=0}},ms=12,hs=new WeakMap,gs=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},_s=Object.create(null),vs=class e{constructor(e,t,n,r=Zo.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||H.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Xo(this.attrs,t||e.defaultAttrs||_s)&&Zo.sameSet(this.marks,n||Zo.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return U.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new U(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return ts(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return fs.resolveCached(this,e)}resolveNoCache(e){return fs.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),bs(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=H.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Zo.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Zo.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=H.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};vs.prototype.text=void 0;var ys=class e extends vs{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):bs(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function bs(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var xs=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Ss(t,n);if(r.next==null)return e.empty;let i=Cs(r);r.next&&r.err(`Unexpected trailing text`);let a=Ns(As(i));return Ps(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return H.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];a.isLeaf||a.hasRequiredAttrs()||a.name in t||r.type&&!o.validEnd||(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
35
+ `)}};xs.empty=new xs(!0);var Ss=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Cs(e){let t=[];do t.push(ws(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function ws(e){let t=[];do t.push(Ts(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Ts(e){let t=ks(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Ds(e,t);else break;return t}function Es(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Ds(e,t){let n=Es(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Es(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Os(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function ks(e){if(e.eat(`(`)){let t=Cs(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Os(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function As(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function js(e,t){return t-e}function Ms(e,t){let n=[];return r(t),n.sort(js);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Ns(e){let t=Object.create(null);return n(Ms(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Ms(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new xs(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(js);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Ps(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Fs(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Is(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function Ls(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function Rs(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Vs(e,r,t[r]);return n}var zs=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=Rs(e,n.attrs),this.defaultAttrs=Fs(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==xs.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:Is(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new vs(this,this.computeAttrs(e),H.from(t),Zo.setFrom(n))}createChecked(e=null,t,n){return t=H.from(t),this.checkContent(t),new vs(this,this.computeAttrs(e),t,Zo.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=H.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(H.empty,!0);return i?new vs(this,e,t.append(i),Zo.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Ls(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:Zo.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function Bs(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var Vs=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Bs(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},Hs=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Rs(e,r.attrs),this.excluded=null;let i=Fs(this.attrs);this.instance=i?new Zo(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Zo(this,Is(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Ls(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},Us=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=Go.from(e.nodes),t.marks=Go.from(e.marks||{}),this.nodes=zs.compile(this.spec.nodes,this),this.marks=Hs.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=xs.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?Ws(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:Ws(this,n.split(` `))}this.nodeFromJSON=e=>vs.fromJSON(this,e),this.markFromJSON=e=>Zo.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof zs))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new ys(n,n.defaultAttrs,e,Zo.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function Ws(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function Gs(e){return e.tag!=null}function Ks(e){return e.style!=null}var qs=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Gs(e))this.tags.push(e);else if(Ks(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new nc(this,t,!1);return n.addAll(e,Zo.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new nc(this,t,!0);return n.addAll(e,Zo.none,t.from,t.to),U.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(ic(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=ac(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=ac(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},Js={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Ys={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Xs={ol:!0,ul:!0},Zs=1,Qs=2,$s=4;function ec(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?Zs:0)|(t===`full`?Qs:0)}var tc=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=Zo.none,this.match=i||(a&$s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(H.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Zs)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=H.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(H.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Js.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},nc=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=ec(null,t.preserveWhitespace,0)|(n?$s:0);i=r?new tc(r.type,r.attrs,Zo.none,!0,t.topMatch||r.type.contentMatch,a):n?new tc(null,null,Zo.none,!0,null,a):new tc(e.schema.topNodeType,null,Zo.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&Qs?`full`:this.localPreserveWS||(r.options&Zs)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
36
+ `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;Xs.hasOwnProperty(a)&&this.parser.normalizeLists&&rc(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:Ys.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(Js.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
37
+ `),t)}ignoreFallback(e,t){e.nodeName!=`BR`||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=Zo.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):oc(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=ec(e,i,a.options);a.options&$s&&a.content.length==0&&(o|=$s);let s=Zo.none;return n=n.filter(t=>!(a.type?a.type.allowsMarkType(t.type):oc(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new tc(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=Zs);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function rc(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Xs.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function ic(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ac(e){let t={};for(let n in e)t[n]=e[n];return t}function oc(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var sc=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=lc(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name])a++;else{if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=pc(lc(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&pc(lc(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return pc(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=cc(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return cc(e.marks)}};function cc(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function lc(e){return e.document||window.document}var uc=new WeakMap;function dc(e){let t=uc.get(e);return t===void 0&&uc.set(e,t=fc(e)),t}function fc(e){let t=null;function n(e){if(e&&typeof e==`object`){if(Array.isArray(e)){if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t])}else for(let t in e)n(e[t])}}return n(e),t}function pc(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=dc(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}{let{dom:t,contentDOM:i}=pc(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var mc=65535,hc=2**16;function gc(e,t){return e+t*hc}function _c(e){return e&mc}function vc(e){return(e-(e&mc))/hc}var yc=1,bc=2,xc=4,Sc=8,Cc=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Sc)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&xc)>0}},wc=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=_c(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+vc(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:gc(o/3,e-s),f=e==s?bc:e==u?yc:xc;return(t<0?e!=s:e!=u)&&(f|=Sc),new Cc(a,f,d)}r+=l-c}return n?e+r:new Cc(e+r,0,null)}touches(e,t){let n=0,r=_c(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};wc.empty=new wc([]);var Tc=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Cc(e,r,null)}},Ec=Object.create(null),Dc=class{getMap(){return wc.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Ec[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Ec)throw RangeError(`Duplicate use of step JSON ID `+e);return Ec[e]=t,t.prototype.jsonID=e,t}},Oc=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof Qo)return e.fail(t.message);throw t}}};function kc(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(kc(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return H.fromArray(r)}var Ac=class e extends Dc{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new U(kc(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Oc.fromReplace(e,this.from,this.to,i)}invert(){return new jc(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Dc.jsonID(`addMark`,Ac);var jc=class e extends Dc{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new U(kc(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Oc.fromReplace(e,this.from,this.to,n)}invert(){return new Ac(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Dc.jsonID(`removeMark`,jc);var Mc=class e extends Dc{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Oc.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Oc.fromReplace(e,this.pos,this.pos+1,new U(H.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Nc(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Dc.jsonID(`addNodeMark`,Mc);var Nc=class e extends Dc{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Oc.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Oc.fromReplace(e,this.pos,this.pos+1,new U(H.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Mc(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Dc.jsonID(`removeNodeMark`,Nc);var Pc=class e extends Dc{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Ic(e,this.from,this.to)?Oc.fail(`Structure replace would overwrite content`):Oc.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new wc([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?U.empty:new U(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?U.empty:new U(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,U.fromJSON(t,n.slice),!!n.structure)}};Pc.MAP_BIAS=1,Dc.jsonID(`replace`,Pc);var Fc=class e extends Dc{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Ic(e,this.from,this.gapFrom)||Ic(e,this.gapTo,this.to)))return Oc.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Oc.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Oc.fromReplace(e,this.from,this.to,n):Oc.fail(`Content does not fit in gap`)}getMap(){return new wc([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,U.fromJSON(t,n.slice),n.insert,!!n.structure)}};Dc.jsonID(`replaceAround`,Fc);function Ic(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Lc(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new jc(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new Ac(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Rc(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof Hs){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new jc(t.from,t.to,t.style)))}function zc(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Pc(s,l,U.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new jc(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new U(H.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new Pc(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(H.empty,!0);e.replace(s,s,new U(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Bc(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Vc(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Bc(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function Hc(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=H.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=H.from(r.node(e).copy(u)),d++):c--;let f=H.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=H.from(i.node(e).copy(f)),p++):l++;e.step(new Fc(c,l,o,s,new U(u.append(f),d,p),u.size-d,!0))}function Uc(e,t,n=null,r=e){let i=Gc(e,t),a=i&&Kc(r,t);return a?i.map(Wc).concat({type:t,attrs:n}).concat(a.map(Wc)):null}function Wc(e){return{type:e,attrs:null}}function Gc(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function Kc(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function qc(e,t,n){let r=H.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=H.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new Fc(i,a,i,a,new U(r,0,0),n.length,!0))}function Jc(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&Zc(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&Xc(e,t,n,a),zc(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Fc(c,l,c+1,l-1,new U(H.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Yc(e,t,n,a),!1}})}function Yc(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function Xc(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
38
+ `))}})}function Zc(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Qc(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new Fc(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new U(H.from(o),0,0),1,!0))}function $c(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function el(e,t,n=1,r){let i=e.doc.resolve(t),a=H.empty,o=H.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=H.from(i.node(e).copy(a));let t=r&&r[s];o=H.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new Pc(t,t,new U(a.append(o),n,n),!0))}function tl(e,t){let n=e.resolve(t),r=n.index();return rl(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function nl(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function rl(e,t){return!!(e&&t&&!e.isLeaf&&nl(e,t))}function il(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);Xc(e,r.node(),r.before(),s)}o.inlineContent&&zc(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new Pc(l,c.map(t+n,-1),U.empty,!0)),r===!0){let t=e.doc.resolve(l);Yc(e,t.node(),t.before(),e.steps.length)}return e}function al(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function ol(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function sl(e,t,n=t,r=U.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return cl(i,a,r)?new Pc(t,n,r):new ll(i,a,r).fit()}function cl(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var ll=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=H.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=H.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new U(i,a,o);return e>-1?new Fc(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Pc(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=fl(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(H.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=fl(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new U(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=fl(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new U(ul(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new U(ul(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(pl(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=dl(this.placed,t,H.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?U.empty:new U(ul(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new U(ul(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!ml(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=ml(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=ml(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=dl(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=dl(this.placed,this.depth,H.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(H.empty,!0);e.childCount&&(this.placed=dl(this.placed,this.frontier.length,e))}};function ul(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(ul(e.firstChild.content,t-1,n)))}function dl(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(dl(e.lastChild.content,t-1,n)))}function fl(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function pl(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,pl(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(H.empty,!0)))),e.copy(r)}function ml(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!hl(n,a.content,o)?s:null}function hl(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function gl(e){return e.spec.defining||e.spec.definingForContent}function _l(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(cl(i,a,r))return e.step(new Pc(t,n,r));let o=xl(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=gl(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new U(vl(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function vl(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(vl(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(H.empty,!0))}return e}function yl(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=al(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new U(H.from(r),0,0))}function bl(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=xl(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function xl(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var Sl=class e extends Dc{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Oc.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Oc.fromReplace(e,this.pos,this.pos+1,new U(H.from(r),0,+!t.isLeaf))}getMap(){return wc.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};Dc.jsonID(`attr`,Sl);var Cl=class e extends Dc{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Oc.ok(n)}getMap(){return wc.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};Dc.jsonID(`docAttr`,Cl);var wl=class extends Error{};wl=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},wl.prototype=Object.create(Error.prototype),wl.prototype.constructor=wl,wl.prototype.name=`TransformError`;var Tl=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Tc}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new wl(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=U.empty){let r=sl(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new U(H.from(n),0,0))}delete(e,t){return this.replace(e,t,U.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return _l(this,e,t,n),this}replaceRangeWith(e,t,n){return yl(this,e,t,n),this}deleteRange(e,t){return bl(this,e,t),this}lift(e,t){return Hc(this,e,t),this}join(e,t=1){return il(this,e,t),this}wrap(e,t){return qc(this,e,t),this}setBlockType(e,t=e,n,r=null){return Jc(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return Qc(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Sl(e,t,n)),this}setDocAttribute(e,t){return this.step(new Cl(e,t)),this}addNodeMark(e,t){return this.step(new Mc(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof Zo)t.isInSet(n.marks)&&this.step(new Nc(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new Nc(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return el(this,e,t,n),this}addMark(e,t,n){return Lc(this,e,t,n),this}removeMark(e,t,n){return Rc(this,e,t,n),this}clearIncompatible(e,t,n){return zc(this,e,t,n),this}},El=Object.create(null),W=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Dl(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=U.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?U.empty:t),o==0&&Fl(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),Fl(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new G(e):Pl(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?Pl(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Pl(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Ml(e.node(0))}static atStart(e){return Pl(e,e,0,0,1)||new Ml(e)}static atEnd(e){return Pl(e,e,e.content.size,e.childCount,-1)||new Ml(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=El[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in El)throw RangeError(`Duplicate use of selection JSON ID `+e);return El[e]=t,t.prototype.jsonID=e,t}getBookmark(){return G.between(this.$anchor,this.$head).getBookmark()}};W.prototype.visible=!0;var Dl=class{constructor(e,t){this.$from=e,this.$to=t}},Ol=!1;function kl(e){!Ol&&!e.parent.inlineContent&&(Ol=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var G=class e extends W{constructor(e,t=e){kl(e),kl(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return W.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=U.empty){if(super.replace(e,t),t==U.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Al(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=W.findFrom(n,r,!0)||W.findFrom(n,-r,!0);if(e)n=e.$head;else return W.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(W.findFrom(t,-r,!0)||W.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};W.jsonID(`text`,G);var Al=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return G.between(e.resolve(this.anchor),e.resolve(this.head))}},K=class e extends W{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?W.near(a):new e(a)}content(){return new U(H.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new jl(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};K.prototype.visible=!1,W.jsonID(`node`,K);var jl=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Al(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&K.isSelectable(n)?new K(t):W.near(t)}},Ml=class e extends W{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=U.empty){if(t==U.empty){e.delete(0,e.doc.content.size);let t=W.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return Nl}};W.jsonID(`all`,Ml);var Nl={map(){return this},resolve(e){return new Ml(e)}};function Pl(e,t,n,r,i,a=!1){if(t.inlineContent)return G.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=Pl(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&K.isSelectable(r))return K.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function Fl(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Pc||i instanceof Fc))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(W.near(e.doc.resolve(o),n))}var Il=1,Ll=2,Rl=4,zl=class extends Tl{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Il)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Il)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ll,this}ensureMarks(e){return Zo.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&Ll)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Zo.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(W.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Rl,this}get scrolledIntoView(){return(this.updated&Rl)>0}};function Bl(e,t){return!t||!e?e:e.bind(t)}var Vl=class{constructor(e,t,n){this.name=e,this.init=Bl(t.init,n),this.apply=Bl(t.apply,n)}},Hl=[new Vl(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Vl(`selection`,{init(e,t){return e.selection||W.atStart(t.doc)},apply(e){return e.selection}}),new Vl(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Vl(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],Ul=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Hl.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Vl(e.key,e.spec.state,e))})}},Wl=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new zl(this)}static create(t){let n=new Ul(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new Ul(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new Ul(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=vs.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=W.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function Gl(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=Gl(i,t,{})),n[r]=i}return n}var Kl=class{constructor(e){this.spec=e,this.props={},e.props&&Gl(e.props,this,this.props),this.key=e.key?e.key.key:Jl(`plugin`)}getState(e){return e[this.key]}},ql=Object.create(null);function Jl(e){return e in ql?e+`$`+ ++ql[e]:(ql[e]=0,e+`$`)}var Yl=class{constructor(e=`key`){this.key=Jl(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},Xl=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Zl(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var Ql=(e,t,n)=>{let r=Zl(e,n);if(!r)return!1;let i=ru(r);if(!i){let n=r.blockRange(),i=n&&Vc(n);return i!=null&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(_u(e,i,t,-1))return!0;if(r.parent.content.size==0&&(tu(a,`end`)||K.isSelectable(a)))for(let n=r.depth;;n--){let o=sl(e.doc,r.before(n),r.after(n),U.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(tu(a,`end`)?W.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):K.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},$l=(e,t,n)=>{let r=Zl(e,n);if(!r)return!1;let i=ru(r);return i?eu(e,i,t):!1};function eu(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=sl(e.doc,i,o,U.empty);if(!s||s.from!=i||s instanceof Pc&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(G.create(t.doc,i)),n(t.scrollIntoView())}return!0}function tu(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var nu=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=ru(r)}let o=a&&a.nodeBefore;return!o||!K.isSelectable(o)?!1:(t&&t(e.tr.setSelection(K.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function ru(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function iu(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var au=(e,t,n)=>{let r=iu(e,n);if(!r)return!1;let i=su(r);if(!i)return!1;let a=i.nodeAfter;if(_u(e,i,t,1))return!0;if(r.parent.content.size==0&&(tu(a,`start`)||K.isSelectable(a))){let n=sl(e.doc,r.before(),r.after(),U.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(tu(a,`start`)?W.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):K.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},ou=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=su(r)}let o=a&&a.nodeAfter;return!o||!K.isSelectable(o)?!1:(t&&t(e.tr.setSelection(K.create(e.doc,a.pos)).scrollIntoView()),!0)};function su(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var cu=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
39
+ `).scrollIntoView()),!0)};function lu(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var uu=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=lu(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(W.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},du=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Ml||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=lu(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(G.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},fu=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if($c(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Vc(r);return i!=null&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function pu(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof K&&t.selection.node.isBlock)return!r.parentOffset||!$c(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=lu(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof G||t.selection instanceof Ml)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=$c(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,$c(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}var mu=pu(),hu=(e,t)=>(t&&t(e.tr.setSelection(new Ml(e.doc))),!0);function gu(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||tl(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function _u(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&gu(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=H.empty;for(let e=o.length-1;e>=0;e--)s=H.from(o[e].create(null,s));s=H.from(i.copy(s));let c=e.tr.step(new Fc(t.pos-1,r,t.pos,r,new U(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&tl(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:W.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&Vc(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&tu(a,`start`,!0)&&tu(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=H.empty;for(let e=o.length-1;e>=0;e--)r=H.from(o[e].copy(r));n(e.tr.step(new Fc(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new U(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function vu(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(G.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var yu=vu(-1),bu=vu(1);function xu(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&Uc(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function Su(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(e,t)){if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function Cu(e,t,n,r){for(let i=0;i<t.length;i++){let{$from:a,$to:o}=t[i],s=a.depth==0&&e.inlineContent&&e.type.allowsMarkType(n);if(e.nodesBetween(a.pos,o.pos,(e,t)=>{if(s||!r&&e.isAtom&&e.isInline&&t>=a.pos&&t+e.nodeSize<=o.pos)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)}),s)return!0}return!1}function wu(e){let t=[];for(let n=0;n<e.length;n++){let{$from:r,$to:i}=e[n];r.doc.nodesBetween(r.pos,i.pos,(e,n)=>{if(e.isAtom&&e.content.size&&e.isInline&&n>=r.pos&&n+e.nodeSize<=i.pos)return n+1>r.pos&&t.push(new Dl(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+e.content.size),!1}),r.pos<i.pos&&t.push(new Dl(r,i))}return t}function Tu(e,t=null,n){let r=(n&&n.removeWhenPresent)!==!1,i=(n&&n.enterInlineAtoms)!==!1,a=!(n&&n.includeWhitespace);return function(n,o){let{empty:s,$cursor:c,ranges:l}=n.selection;if(s&&!c||!Cu(n.doc,l,e,i))return!1;if(o){if(c)e.isInSet(n.storedMarks||c.marks())?o(n.tr.removeStoredMark(e)):o(n.tr.addStoredMark(e.create(t)));else{let s,c=n.tr;i||(l=wu(l)),s=r?!l.some(t=>n.doc.rangeHasMark(t.$from.pos,t.$to.pos,e)):!l.every(t=>{let n=!1;return c.doc.nodesBetween(t.$from.pos,t.$to.pos,(r,i,a)=>{if(n)return!1;n=!e.isInSet(r.marks)&&!!a&&a.type.allowsMarkType(e)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,t.$from.pos-i),Math.min(r.nodeSize,t.$to.pos-i))))}),!n});for(let n=0;n<l.length;n++){let{$from:r,$to:i}=l[n];if(!s)c.removeMark(r.pos,i.pos,e);else{let n=r.pos,o=i.pos,s=r.nodeAfter,l=i.nodeBefore,u=a&&s&&s.isText?/^\s*/.exec(s.text)[0].length:0,d=a&&l&&l.isText?/\s*$/.exec(l.text)[0].length:0;n+u<o&&(n+=u,o-=d),c.addMark(n,o,e.create(t))}}o(c.scrollIntoView())}}return!0}}function Eu(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var Du=Eu(Xl,Ql,nu),Ou=Eu(Xl,au,ou),ku={Enter:Eu(cu,du,fu,mu),"Mod-Enter":uu,Backspace:Du,"Mod-Backspace":Du,"Shift-Backspace":Du,Delete:Ou,"Mod-Delete":Ou,"Mod-a":hu},Au={"Ctrl-h":ku.Backspace,"Alt-Backspace":ku[`Mod-Backspace`],"Ctrl-d":ku.Delete,"Ctrl-Alt-Backspace":ku[`Mod-Delete`],"Alt-Delete":ku[`Mod-Delete`],"Alt-d":ku[`Mod-Delete`],"Ctrl-a":yu,"Ctrl-e":bu};for(let e in ku)Au[e]=ku[e];var ju=(typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform()==`darwin`)?Au:ku,Mu=class{constructor(e,t,n={}){this.match=e,this.match=e,this.handler=typeof t==`string`?Nu(t):t,this.undoable=n.undoable!==!1,this.inCode=n.inCode||!1,this.inCodeMark=n.inCodeMark!==!1}};function Nu(e){return function(t,n,r,i){let a=e;if(n[1]){let e=n[0].lastIndexOf(n[1]);a+=n[0].slice(e+n[1].length),r+=e;let t=r-i;t>0&&(a=n[0].slice(e-t,e)+a,r=i)}return t.tr.insertText(a,r,i)}}var Pu=(e,t)=>{let n=e.plugins;for(let r=0;r<n.length;r++){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let n=e.tr,r=a.transform;for(let e=r.steps.length-1;e>=0;e--)n.step(r.steps[e].invert(r.docs[e]));if(a.text){let t=n.doc.resolve(a.from).marks();n.replaceWith(a.from,a.to,e.schema.text(a.text,t))}else n.delete(a.from,a.to);t(n)}return!0}}return!1};new Mu(/--$/,`—`,{inCodeMark:!1}),new Mu(/\.\.\.$/,`…`,{inCodeMark:!1}),new Mu(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,`“`,{inCodeMark:!1}),new Mu(/"$/,`”`,{inCodeMark:!1}),new Mu(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,`‘`,{inCodeMark:!1}),new Mu(/'$/,`’`,{inCodeMark:!1});function Fu(e,t,n=null,r){return new Mu(e,(e,i,a,o)=>{let s=n instanceof Function?n(i):n,c=e.tr.delete(a,o),l=c.doc.resolve(a).blockRange(),u=l&&Uc(l,t,s);if(!u)return null;c.wrap(l,u);let d=c.doc.resolve(a-1).nodeBefore;return d&&d.type==t&&tl(c.doc,a-1)&&(!r||r(i,d))&&c.join(a-1),c})}function Iu(e,t,n=null){return new Mu(e,(e,r,i,a)=>{let o=e.doc.resolve(i),s=n instanceof Function?n(r):n;return o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t)?e.tr.delete(i,a).setBlockType(i,i,t,s):null})}var Lu=typeof navigator<`u`?navigator:null,Ru=typeof document<`u`?document:null,zu=Lu&&Lu.userAgent||``,Bu=/Edge\/(\d+)/.exec(zu),Vu=/MSIE \d/.exec(zu),Hu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zu),Uu=!!(Vu||Hu||Bu);Vu?document.documentMode:Hu?+Hu[1]:Bu&&+Bu[1],!Uu&&/gecko\/(\d+)/i.test(zu)&&+(/Firefox\/(\d+)/.exec(zu)||[0,0])[1];var Wu=!Uu&&/Chrome\/(\d+)/.exec(zu),Gu=!!Wu;Wu&&+Wu[1],!Uu&&Lu&&/Apple Computer/.test(Lu.vendor)&&(/Mobile\/\w+/.test(zu)||Lu&&Lu.maxTouchPoints>2)||Lu&&/Mac/.test(Lu.platform);var Ku=/Android \d/.test(zu);Ru&&`webkitFontSmoothing`in Ru.documentElement.style&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];function qu(e,t,n,r,i,a){if(e.composing)return!1;let o=e.state,s=o.doc.resolve(t);if(s.parent.type.spec.code)return!1;let c=s.parent.textBetween(Math.max(0,s.parentOffset-500),s.parentOffset,void 0,``)+r;for(let s of i){let i=s,l=i.match.exec(c),u=l&&l[0]&&i.handler(o,l,t-(l[0].length-r.length),n);if(u)return i.undoable!==!1&&u.setMeta(a,{transform:u,from:t,to:n,text:r}),e.dispatch(u),!0}return!1}var Ju=new Yl(`MILKDOWN_CUSTOM_INPUTRULES`);function Yu({rules:e}){let t=new Kl({key:Ju,isInputRules:!0,state:{init(){return null},apply(e,t){return e.getMeta(this)||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput(n,r,i,a){return qu(n,r,i,a,e,t)},handleDOMEvents:{compositionend:n=>(setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&qu(n,r.pos,r.pos,``,e,t)}),!1),keydown:(e,t)=>!(Ku&&Gu&&t.key===`Enter`)||e.composing?!1:e.someProp(`handleKeyDown`,n=>n(e,t))?(t.preventDefault(),!0):!1},handleKeyDown(n,r){if(r.key!==`Enter`)return!1;let{$cursor:i}=n.state.selection;return i?qu(n,i.pos,i.pos,`
40
+ `,e,t):!1}}});return t}function Xu(e,t,n={}){return new Mu(e,(e,r,i,a)=>{var o;let{tr:s}=e,c=r[r.length-1],l=r[0],u=[],d,f={group:c,fullMatch:l,start:i,end:a},p=n.updateCaptured?.call(n,f);if(Object.assign(f,p),{group:c,fullMatch:l,start:i,end:a}=f,l===null||c?.trim()===``)return null;if(c){let e=l.search(/\S/),f=i+l.indexOf(c),p=f+c.length;u=s.storedMarks??[],p<a&&s.delete(p,a),f>i&&s.delete(i+e,f),d=i+e+c.length;let m=n.getAttr?.call(n,r);s.addMark(i,d,t.create(m)),s.setStoredMarks(u),(o=n.beforeDispatch)==null||o.call(n,{match:r,start:i,end:a,tr:s})}return s})}function Zu(e){return Object.assign(Object.create(e),e).setTime(Date.now())}function Qu(e,t){return Array.isArray(e)&&e.includes(t.type)||t.type===e}function $u(e){return t=>{for(let n=t.depth;n>0;--n){let r=t.node(n);if(e(r))return{from:t.before(n),to:t.after(n),node:r}}}}function ed(e,t){return $u(e=>e.type===t)(e)}function td(e){return t=>{for(let n=t.depth;n>0;n--){let r=t.node(n);if(e(r))return{pos:t.before(n),start:t.start(n),depth:n,node:r}}}}function nd(e,t){if(!(e instanceof K))return;let{node:n,$from:r}=e;if(Qu(t,n))return{node:n,pos:r.pos,start:r.start(r.depth),depth:r.depth}}for(var rd=(e,t)=>{let{selection:n,doc:r}=e;if(n instanceof K)return{hasNode:n.node.type===t,pos:n.from,target:n.node};let{from:i,to:a}=n,o=!1,s=-1,c=null;return r.nodesBetween(i,a,(e,n)=>c?!1:e.type!==t||(o=!0,s=n,c=e,!1)),{hasNode:o,pos:s,target:c}},id={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:`'`},ad={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},od=typeof navigator<`u`&&/Mac/.test(navigator.platform),sd=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),cd=0;cd<10;cd++)id[48+cd]=id[96+cd]=String(cd);for(var cd=1;cd<=24;cd++)id[cd+111]=`F`+cd;for(var cd=65;cd<=90;cd++)id[cd]=String.fromCharCode(cd+32),ad[cd]=String.fromCharCode(cd);for(var ld in id)ad.hasOwnProperty(ld)||(ad[ld]=id[ld]);function ud(e){var t=!(od&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||sd&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?ad:id)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var dd=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),fd=typeof navigator<`u`&&/Win/.test(navigator.platform);function pd(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))dd?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function md(e){let t=Object.create(null);for(let n in e)t[pd(n)]=e[n];return t}function hd(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function gd(e){return new Kl({props:{handleKeyDown:_d(e)}})}function _d(e){let t=md(e);return function(e,n){let r=ud(n),i,a=t[hd(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[hd(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(fd&&n.ctrlKey&&n.altKey)&&(i=id[n.keyCode])&&i!=r){let r=t[hd(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var vd=class{},yd=class{constructor(){this.elements=[],this.size=()=>this.elements.length,this.top=()=>this.elements.at(-1),this.push=e=>{this.top()?.push(e)},this.open=e=>{this.elements.push(e)},this.close=()=>{let e=this.elements.pop();if(!e)throw ct();return e}}},bd=class e extends vd{constructor(e,t,n){super(),this.type=e,this.content=t,this.attrs=n}push(e,...t){this.content.push(e,...t)}pop(){return this.content.pop()}static create(t,n,r){return new e(t,n,r)}},xd=class extends yd{#e=Zo.none;static{this.create=(e,t)=>{let n=new this(e);return e=>(n.run(t,e),n.toDoc())}}constructor(e){super(),this.injectRoot=(e,t,n)=>(this.openNode(t,n),this.next(e.children),this),this.openNode=(e,t)=>(this.open(bd.create(e,[],t)),this),this.closeNode=()=>{try{this.#a()}catch(e){console.error(e)}return this},this.addNode=(e,t,n)=>{try{this.#o(e,t,n)}catch(e){console.error(e)}return this},this.openMark=(e,t)=>(this.#e=e.create(t).addToSet(this.#e),this),this.closeMark=e=>(this.#e=e.removeFromSet(this.#e),this),this.addText=e=>{try{let t=this.top();if(!t)throw ct();let n=t.pop(),r=this.schema.text(e,this.#e);if(!n)return t.push(r),this;let i=this.#n(n,r);return i?(t.push(i),this):(t.push(n,r),this)}catch(e){return console.error(e),this}},this.build=()=>{let e;do e=this.#a();while(this.size());return e},this.next=(e=[])=>([e].flat().forEach(e=>this.#i(e)),this),this.toDoc=()=>this.build(),this.run=(e,t)=>{let n=e.runSync(e.parse(t),t);return this.next(n),this},this.schema=e}#t=e=>e.isText;#n=(e,t)=>{if(this.#t(e)&&this.#t(t)&&Zo.sameSet(e.marks,t.marks))return this.schema.text(e.text+t.text,e.marks)};#r=e=>{let t=Object.values({...this.schema.nodes,...this.schema.marks}).find(t=>t.spec.parseMarkdown.match(e));if(!t)throw lt(e);return t};#i=e=>{let t=this.#r(e);t.spec.parseMarkdown.runner(this,e,t)};#a=()=>{this.#e=Zo.none;let e=this.close();return this.#o(e.type,e.attrs,e.content)};#o=(e,t,n)=>{let r=e.createAndFill(t,n,this.#e);if(!r)throw st(e,t,n);return this.push(r),r}},Sd=class e extends vd{constructor(e,t,n,r={}){super(),this.type=e,this.children=t,this.value=n,this.props=r,this.push=(e,...t)=>{this.children||=[],this.children.push(e,...t)},this.pop=()=>this.children?.pop()}static{this.create=(t,n,r,i={})=>new e(t,n,r,i)}},Cd=e=>Object.prototype.hasOwnProperty.call(e,`size`),wd=class extends yd{#e=Zo.none;static{this.create=(e,t)=>{let n=new this(e);return e=>(n.run(e),n.toString(t))}}constructor(e){super(),this.openNode=(e,t,n)=>(this.open(Sd.create(e,void 0,t,n)),this),this.closeNode=()=>(this.#l(),this),this.addNode=(e,t,n,r)=>(this.#u(e,t,n,r),this),this.withMark=(e,t,n,r)=>(this.#d(e,t,n,r),this),this.closeMark=e=>(this.#f(e),this),this.build=()=>{let e=null;do e=this.#l();while(this.size());return e},this.next=e=>Cd(e)?(e.forEach(e=>{this.#i(e)}),this):(this.#i(e),this),this.toString=e=>e.stringify(this.build()),this.run=e=>(this.next(e),this),this.schema=e}#t=e=>{let t=Object.values({...this.schema.nodes,...this.schema.marks}).find(t=>t.spec.toMarkdown.match(e));if(!t)throw ut(e.type);return t};#n=e=>this.#t(e).spec.toMarkdown.runner(this,e);#r=(e,t)=>this.#t(e).spec.toMarkdown.runner(this,e,t);#i=e=>{let{marks:t}=e,n=e=>e.type.spec.priority??50;[...t].sort((e,t)=>n(e)-n(t)).every(t=>!this.#r(t,e))&&this.#n(e),t.forEach(e=>this.#f(e))};#a=(e,t)=>{if(e.type===t||e.children?.length!==1)return e;let n=e=>{if(e.type===t)return e.value==null?e:null;if(e.children?.length!==1)return null;let[r]=e.children;return r?n(r):null},r=n(e);if(!r)return e;let i=r.children?[...r.children]:void 0,a={...e,children:i};return a.children=i,r.children=[a],r};#o=e=>{let{children:t}=e;return t&&(e.children=t.reduce((e,t,n)=>{if(n===0)return[t];let r=e.at(-1);if(r&&r.isMark&&t.isMark){t=this.#a(t,r.type);let{children:n,...i}=t,{children:a,...o}=r;if(t.type===r.type&&n&&a&&JSON.stringify(i)===JSON.stringify(o)){let t={...o,children:[...a,...n]};return e.slice(0,-1).concat(this.#o(t))}}return e.concat(t)},[])),e};#s=e=>{let t={...e.props,type:e.type};return e.children&&(t.children=e.children),e.value&&(t.value=e.value),t};#c=(e,t)=>{let n=``,r=``,i=e.children,a=-1,o=-1,s=e=>{e&&e.forEach((e,t)=>{e.type===`text`&&e.value&&(a<0&&(a=t),o=t)})};if(i){s(i);let e=i?.[o],t=i?.[a];if(e&&e.value.endsWith(` `)){let t=e.value,n=t.trimEnd();r=t.slice(n.length),e.value=n}if(t&&t.value.startsWith(` `)){let e=t.value,r=e.trimStart();n=e.slice(0,e.length-r.length),t.value=r}}n.length&&this.#u(`text`,void 0,n);let c=t();return r.length&&this.#u(`text`,void 0,r),c};#l=(e=!1)=>{let t=this.close(),n=()=>this.#u(t.type,t.children,t.value,t.props);return e?this.#c(t,n):n()};#u=(e,t,n,r)=>{let i=Sd.create(e,t,n,r),a=this.#o(this.#s(i));return this.push(a),a};#d=(e,t,n,r)=>e.isInSet(this.#e)?this:(this.#e=e.addToSet(this.#e),this.openNode(t,n,{...r,isMark:!0}));#f=e=>{e.isInSet(this.#e)&&(this.#e=e.type.removeFromSet(this.#e),this.#l(!0))}},Td=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Ed=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},Dd=null,Od=function(e,t,n){let r=Dd||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},kd=function(){Dd=null},Ad=function(e,t,n,r){return n&&(Md(e,t,n,r,-1)||Md(e,t,n,r,1))},jd=/^(img|br|input|textarea|hr)$/i;function Md(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Nd(e))){let n=e.parentNode;if(!n||n.nodeType!=1||Ld(e)||jd.test(e.nodeName)||e.contentEditable==`false`)return!1;t=Td(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`){if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1}else e=n,t=i<0?Nd(e):0}else return!1}}function Nd(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Pd(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=Nd(e)}else if(e.parentNode&&!Ld(e))t=Td(e),e=e.parentNode;else return null}}function Fd(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!Ld(e))t=Td(e)+1,e=e.parentNode;else return null}}function Id(e,t,n){for(let r=t==0,i=t==Nd(e);r||i;){if(e==n)return!0;let t=Td(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==Nd(e)}}function Ld(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var Rd=function(e){return e.focusNode&&Ad(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function zd(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function Bd(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Vd(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Nd(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Nd(r.startContainer),r.startOffset)}}}var Hd=typeof navigator<`u`?navigator:null,Ud=typeof document<`u`?document:null,Wd=Hd&&Hd.userAgent||``,Gd=/Edge\/(\d+)/.exec(Wd),Kd=/MSIE \d/.exec(Wd),qd=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Wd),Jd=!!(Kd||qd||Gd),Yd=Kd?document.documentMode:qd?+qd[1]:Gd?+Gd[1]:0,Xd=!Jd&&/gecko\/(\d+)/i.test(Wd);Xd&&+(/Firefox\/(\d+)/.exec(Wd)||[0,0])[1];var Zd=!Jd&&/Chrome\/(\d+)/.exec(Wd),Qd=!!Zd,$d=Zd?+Zd[1]:0,ef=!Jd&&!!Hd&&/Apple Computer/.test(Hd.vendor),tf=ef&&(/Mobile\/\w+/.test(Wd)||!!Hd&&Hd.maxTouchPoints>2),nf=tf||(Hd?/Mac/.test(Hd.platform):!1),rf=Hd?/Win/.test(Hd.platform):!1,af=/Android \d/.test(Wd),of=!!Ud&&`webkitFontSmoothing`in Ud.documentElement.style,sf=of?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function cf(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function lf(e,t){return typeof e==`number`?e:e[t]}function uf(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function df(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=Ed(o);continue}let e=o,n=e==a.body,s=n?cf(a):uf(e),c=0,l=0;if(t.top<s.top+lf(r,`top`)?l=-(s.top-t.top+lf(i,`top`)):t.bottom>s.bottom-lf(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+lf(i,`top`)-s.top:t.bottom-s.bottom+lf(i,`bottom`)),t.left<s.left+lf(r,`left`)?c=-(s.left-t.left+lf(i,`left`)):t.right>s.right-lf(r,`right`)&&(c=t.right-s.right+lf(i,`right`)),c||l){if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:Ed(o)}}function ff(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:pf(e.dom)}}function pf(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Ed(r));return t}function mf({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;hf(n,r==0?0:r-t)}function hf(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var gf=null;function _f(e){if(e.setActive)return e.setActive();if(gf)return e.focus(gf);let t=pf(e);e.focus(gf==null?{get preventScroll(){return gf={preventScroll:!0},!0}}:void 0),gf||(gf=!1,hf(t,0))}function vf(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=Od(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?yf(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:vf(n,i)}function yf(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=Df(r,1);if(n.top!=n.bottom&&bf(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function bf(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function xf(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function Sf(e,t,n){let{node:r,offset:i}=vf(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function Cf(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function wf(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(bf(t,i))return wf(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function Tf(e,t){let n=e.dom.ownerDocument,r,i=0,a=Vd(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!bf(t,n)||(o=wf(e.dom,t,n),!o))return null}if(ef)for(let e=o;r&&e;e=Ed(e))e.draggable&&(r=void 0);if(o=xf(o,t),r){if(Xd&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;of&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=Cf(e,r,i,t))}s??=Sf(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function Ef(e){return e.top<e.bottom||e.left<e.right}function Df(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(Ef(e))return e}return Array.prototype.find.call(n,Ef)||e.getBoundingClientRect()}var Of=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function kf(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=of||Xd;if(r.nodeType==3){if(o&&(Of.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=Df(Od(r,i,i),n);if(Xd&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=Df(Od(r,i-1,i-1),-1);if(t.top==e.top){let n=Df(Od(r,i,i+1),-1);if(n.top!=e.top)return Af(n,n.left<t.left)}}return e}{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,Af(Df(Od(r,e,t),a),a<0)}}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==Nd(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return jf(e.getBoundingClientRect(),!1)}if(a==null&&i<Nd(r)){let e=r.childNodes[i];if(e.nodeType==1)return jf(e.getBoundingClientRect(),!0)}return jf(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==Nd(r))){let e=r.childNodes[i-1],t=e.nodeType==3?Od(e,Nd(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return Af(Df(t,1),!1)}if(a==null&&i<Nd(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?Od(e,0,+!o):e.nodeType==1?e:null:null;if(t)return Af(Df(t,-1),!0)}return Af(Df(r.nodeType==3?Od(r):r,-n),n>=0)}function Af(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function jf(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Mf(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function Nf(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return Mf(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=kf(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=Od(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var Pf=/[\u0590-\u08ac]/;function Ff(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!Pf.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:Mf(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var If=null,Lf=null,Rf=!1;function zf(e,t,n){return If==t&&Lf==n?Rf:(If=t,Lf=n,Rf=n==`up`||n==`down`?Nf(e,t,n):Ff(e,t,n))}var Bf=0,Vf=1,Hf=2,Uf=3,Wf=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=Bf,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>Td(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node)){if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof Zf){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof Gf&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?Td(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?Td(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Td(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=Td(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((Xd||ef)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
41
+ `),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:Td(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(Xd&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&ef)&&Ad(o.node,o.offset,l.anchorNode,l.anchorOffset)&&Ad(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&Xd)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?Hf:Vf,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Uf:i.markDirty(e-r,t-r);return}i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Hf:Uf}n=a}this.dirty=Hf}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?Hf:Vf;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},Gf=class extends Wf{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==Bf&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},Kf=class extends Wf{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},qf=class e extends Wf{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return o&&o.dom||(o=sc.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Uf||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Uf&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Bf){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=Bf}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=mp(a,n,o,r)),t>0&&(a=mp(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},Jf=class e extends Wf{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=sc.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=ap(u,r,n),l?c=new Qf(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new Xf(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>H.empty)}return e}matchesNode(e,t,n){return this.dirty==Bf&&e.eq(this.node)&&op(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new cp(this,a&&a.node,e);dp(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?Zo.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==Hf)&&(a&&this.protectLocalComposition(e,a),$f(this.contentDOM,this.children,e),tf&&fp(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof G)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=pp(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let a=new Kf(this,i,t,r);e.input.compositionNodes.push(a),this.children=mp(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==Uf||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Bf}updateOuterDeco(e){if(op(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=rp(this.dom,this.nodeDOM,np(this.outerDeco,this.node,t),np(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function Yf(e,t,n,r,i){ap(r,t,e);let a=new Jf(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var Xf=class e extends Jf{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==Uf||this.dirty!=Bf&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Bf||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=Bf,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Uf)}get domAtom(){return!1}isText(e){return this.node.text==e}},Zf=class extends Wf{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Bf&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},Qf=class extends Jf{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==Uf)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function $f(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=sp(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof qf){let t=r?r.previousSibling:e.lastChild;$f(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=sp(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var ep=function(e){e&&(this.nodeName=e)};ep.prototype=Object.create(null);var tp=[new ep];function np(e,t,n){if(e.length==0)return tp;let r=n?tp[0]:new ep,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new ep(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new ep(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function rp(e,t,n,r){if(n==tp&&r==tp)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName||(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=tp[0]),i=t}ip(i,o||tp[0],a)}return i}function ip(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function ap(e,t,n){return rp(e,e,tp,np(t,n,e.nodeType!=1))}function op(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function sp(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var cp=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=lp(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=Bf,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=qf.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==Uf&&a.dom==a.contentDOM&&(a.dirty=Hf),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof Jf){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=Uf&&op(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=Hf,u.updateChildren(r,a+1),u.dirty=Bf),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!op(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=Jf.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=Jf.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new Gf(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof qf;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Xf)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((ef||Qd)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new Zf(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function lp(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof qf)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function up(e,t){return e.type.side-t.type.side}function dp(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u){if(d){d.sort(up);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c)}let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function fp(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function pp(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function mp(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function hp(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(Rd(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&K.isSelectable(e)&&i.parent&&!(e.isInline&&Id(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new K(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=Ep(e,u,s,n)}return l}function gp(e){return e.editable?e.hasFocus():Op(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function _p(e,t=!1){let n=e.state.selection;if(wp(e,n),gp(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Qd){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Ad(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Cp(e);else{let{anchor:r,head:i}=n,a,o;vp&&!(n instanceof G)&&(n.$from.parent.inlineContent||(a=yp(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=yp(e,n.to))),e.docView.setSelection(r,i,e,t),vp&&(a&&xp(a),o&&xp(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&Sp(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var vp=ef||Qd&&$d<63;function yp(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(ef&&i&&i.contentEditable==`false`)return bp(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return bp(i);if(a)return bp(a)}}function bp(e){return e.contentEditable=`true`,ef&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function xp(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function Sp(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!gp(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function Cp(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,Td(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Jd&&Yd<=11&&(n.disabled=!0,n.disabled=!1)}function wp(e,t){if(t instanceof K){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Tp(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Tp(e)}function Tp(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function Ep(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||G.between(t,n,r)}function Dp(e){return e.editable&&!e.hasFocus()?!1:Op(e)}function Op(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function kp(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Ad(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Ap(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&W.findFrom(a,t)}function jp(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Mp(e,t,n){let r=e.state.selection;if(r instanceof G){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return jp(e,new G(r.$anchor,a))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=Ap(e.state,t);return n&&n instanceof K?jp(e,n):!1}if(!(nf&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?K.isSelectable(i)?jp(e,new K(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):of?jp(e,new G(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof K&&r.node.isInline)return jp(e,new G(t>0?r.$to:r.$from));else{let n=Ap(e.state,t);return n?jp(e,n):!1}}function Np(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Pp(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function Fp(e,t){return t<0?Ip(e):Lp(e)}function Ip(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(Xd&&n.nodeType==1&&r<Np(n)&&Pp(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(Pp(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(Rp(n))break;else{let t=n.previousSibling;for(;t&&Pp(t,-1);)i=n.parentNode,a=Td(t),t=t.previousSibling;if(t)n=t,r=Np(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?Vp(e,n,r):i&&Vp(e,i,a)}function Lp(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Np(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(Pp(e,1))a=n,o=++r;else break}else if(Rp(n))break;else{let t=n.nextSibling;for(;t&&Pp(t,1);)a=t.parentNode,o=Td(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=Np(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&Vp(e,a,o)}function Rp(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function zp(e,t){for(;e&&t==e.childNodes.length&&!Ld(e);)t=Td(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function Bp(e,t){for(;e&&!t&&!Ld(e);)t=Td(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function Vp(e,t,n){if(t.nodeType!=3){let e,r;(r=zp(t,n))?(t=r,n=0):(e=Bp(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Rd(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&_p(e)},50)}function Hp(e,t){let n=e.state.doc.resolve(t);if(!(Qd||rf)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function Up(e,t,n){let r=e.state.selection;if(r instanceof G&&!r.empty||n.indexOf(`s`)>-1||nf&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=Ap(e.state,t);if(n&&n instanceof K)return jp(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof Ml?W.near(n,t):W.findFrom(n,t);return o?jp(e,o):!1}return!1}function Wp(e,t){if(!(e.state.selection instanceof G))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function Gp(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Kp(e){if(!ef||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;Gp(e,n,`true`),setTimeout(()=>Gp(e,n,`false`),20)}return!1}function qp(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function Jp(e,t){let n=t.keyCode,r=qp(t);if(n==8||nf&&n==72&&r==`c`)return Wp(e,-1)||Fp(e,-1);if(n==46&&!t.shiftKey||nf&&n==68&&r==`c`)return Wp(e,1)||Fp(e,1);if(n==13||n==27)return!0;if(n==37||nf&&n==66&&r==`c`){let t=n==37?Hp(e,e.state.selection.from)==`ltr`?-1:1:-1;return Mp(e,t,r)||Fp(e,t)}if(n==39||nf&&n==70&&r==`c`){let t=n==39?Hp(e,e.state.selection.from)==`ltr`?1:-1:1;return Mp(e,t,r)||Fp(e,t)}return n==38||nf&&n==80&&r==`c`?Up(e,-1,r)||Fp(e,-1):n==40||nf&&n==78&&r==`c`?Kp(e)||Up(e,1,r)||Fp(e,1):!(r!=(nf?`m`:`c`)||n!=66&&n!=73&&n!=89&&n!=90)}function Yp(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||sc.fromSchema(e.state.schema),s=om(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=im[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
42
+
43
+ `),slice:t}}function Xp(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new U(H.from(e.state.schema.text(t.replace(/\r\n?/g,`
44
+ `))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=sc.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=lm(n),of&&um(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||qs.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!Zp.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=dm(rm(s,+u[1],+u[2]),u[4]);else if(s=U.maxOpen(Qp(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=rm(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var Zp=/^(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 Qp(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&em(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=tm(a[a.length-1],i.length));let n=$p(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return H.from(a)}return e}function $p(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,H.from(e));return e}function em(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=em(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(H.from($p(n,e,i+1))))}}function tm(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,tm(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(H.empty,!0);return e.copy(n.append(r))}function nm(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=nm(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(H.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function rm(e,t,n){return t<e.openStart&&(e=new U(nm(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new U(nm(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var im={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},am=null;function om(){return am||=document.implementation.createHTMLDocument(`title`)}var sm=null;function cm(e){let t=window.trustedTypes;return t?(sm||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),sm.createHTML(e)):e}function lm(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=om().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&im[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=cm(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function um(e){let t=e.querySelectorAll(Qd?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function dm(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=H.from(t.create(r[e+1],i)),a++,o++}return new U(i,a,o)}var fm={},pm={},mm={touchstart:!0,touchmove:!0},hm=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function gm(e){for(let t in fm){let n=fm[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{xm(e,t)&&!bm(e,t)&&(e.editable||!(t.type in pm))&&n(e,t)},mm[t]?{passive:!0}:void 0)}ef&&e.dom.addEventListener(`input`,()=>null),ym(e)}function _m(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function vm(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function ym(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>bm(e,t))})}function bm(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function xm(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Sm(e,t){!bm(e,t)&&fm[t.type]&&(e.editable||!(t.type in pm))&&fm[t.type](e,t)}pm.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Im(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(af&&Qd&&n.keyCode==13))){if(n.keyCode!=229&&e.domObserver.forceFlush(),tf&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,zd(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||Jp(e,n)?n.preventDefault():_m(e,`key`)}},pm.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},pm.keypress=(e,t)=>{let n=t;if(Im(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||nf&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof G)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function Cm(e){return{left:e.clientX,top:e.clientY}}function wm(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function Tm(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function Em(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function Dm(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&K.isSelectable(r)?(Em(e,new K(n),`pointer`),!0):!1}function Om(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof K&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(K.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i!=null&&(Em(e,K.create(e.state.doc,i),`pointer`),!0)}function km(e,t,n,r,i){return Tm(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?Om(e,n):Dm(e,n))}function Am(e,t,n,r){return Tm(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function jm(e,t,n,r){return Tm(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||Mm(e,n,r)}function Mm(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Em(e,G.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)Em(e,G.create(r,a+1,a+1+n.content.size),`pointer`);else if(K.isSelectable(n))Em(e,K.create(r,a),`pointer`);else continue;return!0}}function Nm(e){return Um(e)}var Pm=nf?`metaKey`:`ctrlKey`;fm.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Nm(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&wm(n,e.input.lastClick)&&!n[Pm]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(Cm(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Fm(e,o,n,!!r)):(a==`doubleClick`?Am:jm)(e,o.pos,o.inside,n)?n.preventDefault():_m(e,`pointer`))};var Fm=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Pm],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;(n.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof K&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!!(this.target&&Xd&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this)),_m(e,`pointer`)}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>_p(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Cm(e))),this.updateAllowDefault(e),this.allowDefault||!t?_m(this.view,`pointer`):km(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ef&&this.mightDrag&&!this.mightDrag.node.isAtom||Qd&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Em(this.view,W.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):_m(this.view,`pointer`)}move(e){this.updateAllowDefault(e),_m(this.view,`pointer`),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};fm.touchstart=e=>{e.input.lastTouch=Date.now(),Nm(e),_m(e,`pointer`)},fm.touchmove=e=>{e.input.lastTouch=Date.now(),_m(e,`pointer`)},fm.contextmenu=e=>Nm(e);function Im(e,t){return e.composing?!0:ef&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var Lm=af?5e3:-1;pm.compositionstart=pm.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof G&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||Qd&&rf&&Rm(e)))e.markCursor=e.state.storedMarks||n.marks(),Um(e,!0),e.markCursor=null;else if(Um(e,!t.selection.empty),Xd&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}zm(e,Lm)};function Rm(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}pm.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,zm(e,20))};function zm(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Um(e),t))}function Bm(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Hm());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Vm(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Pd(t.focusNode,t.focusOffset),r=Fd(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return r}}return n||r}function Hm(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function Um(e,t=!1){if(!(af&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Bm(e),t||e.docView&&e.docView.dirty){let n=hp(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Wm(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var Gm=Jd&&Yd<15||tf&&sf<604;fm.copy=pm.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=Gm?null:n.clipboardData,{dom:o,text:s}=Yp(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):Wm(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function Km(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function qm(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Jm(e,r.value,null,i,t):Jm(e,r.textContent,r.innerHTML,i,t)},50)}function Jm(e,t,n,r,i){let a=Xp(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||U.empty)))return!0;if(!a)return!1;let o=Km(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function Ym(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}pm.paste=(e,t)=>{let n=t;if(e.composing&&!af)return;let r=Gm?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Jm(e,Ym(r),r.getData(`text/html`),i,n)?n.preventDefault():qm(e,n)};var Xm=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},Zm=nf?`altKey`:`ctrlKey`;function Qm(e,t){return e.someProp(`dragCopies`,e=>!e(t))??!t[Zm]}fm.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(Cm(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof K?i.to-1:i.to))){if(r&&r.mightDrag)o=K.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=K.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=Yp(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!Qd||$d>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Gm?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,Gm||n.dataTransfer.setData(`text/plain`,c),e.dragging=new Xm(l,Qm(e,n),o)},fm.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},pm.dragover=pm.dragenter=(e,t)=>t.preventDefault(),pm.drop=(e,t)=>{try{$m(e,t,e.dragging)}finally{e.dragging=null}};function $m(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Cm(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=Xp(e,Ym(t.dataTransfer),Gm?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&Qm(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||U.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?ol(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&K.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new K(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(Ep(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}fm.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&_p(e)},20))},fm.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},fm.beforeinput=(e,t)=>{if(Qd&&af&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,zd(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in pm)fm[e]=pm[e];function eh(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var th=class e{constructor(e,t){this.toDOM=e,this.spec=t||oh,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new ih(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&eh(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},nh=class e{constructor(e,t){this.attrs=e,this.spec=t||oh}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new ih(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&eh(this.attrs,t.attrs)&&eh(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},rh=class e{constructor(e,t){this.attrs=e,this.spec=t||oh}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new ih(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&eh(this.attrs,t.attrs)&&eh(this.spec,t.spec)}destroy(){}},ih=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new th(n,r))}static inline(t,n,r,i){return new e(t,n,new nh(r,i))}static node(t,n,r,i){return new e(t,n,new rh(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof nh}get widget(){return this.type instanceof th}},ah=[],oh={},sh=class e{constructor(e,t){this.local=e.length?e:ah,this.children=t.length?t:ah}static create(e,t){return t.length?hh(t,e,0,oh):ch}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==ch||e.maps.length==0?this:this.mapInner(e,t,0,0,n||oh)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?uh(this.children,o||[],t,n,r,i,a):o?new e(o.sort(gh),ah):ch}add(t,n){return n.length?this==ch?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=ph(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,hh(s,e,o+1,oh)),a+=3}});let o=dh(a?mh(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(gh):this.local,i||this.children)}remove(e){return e.length==0||this==ch?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==ch?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):ch}forChild(t,n){if(this==ch)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof nh){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(gh),ah);return r?new lh([t,r]):t}return r||ch}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return _h(this.localsInner(e))}localsInner(e){if(this==ch)return ah;if(e.inlineContent||!this.local.some(nh.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof nh||t.push(this.local[e]);return t}forEachSet(e){e(this)}};sh.empty=new sh([],[]),sh.removeOverlap=_h;var ch=sh.empty,lh=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,oh));return e.from(r)}forChild(t,n){if(n.isLeaf)return sh.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=ch&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length){if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}}return t?_h(n?t:t.sort(gh)):ah}static from(t){switch(t.length){case 0:return ch;case 1:return t[0];default:return new e(t.every(e=>e instanceof sh)?t:t.reduce((e,t)=>e.concat(t instanceof sh?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function uh(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==ch?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=hh(fh(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new sh(t.sort(gh),s)}function dh(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new ih(i.from+t,i.to+t,i.type))}return n}function fh(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function ph(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function mh(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function hh(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=ph(e,t,o+n);if(s){a=!0;let e=hh(s,t,n+o+1,r);e!=ch&&i.push(o,o+t.nodeSize,e)}});let o=dh(a?mh(e):e,-n).sort(gh);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new sh(o,i):ch}function gh(e,t){return e.from-t.from||e.to-t.to}function _h(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from)a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),vh(t,i+1,a.copy(r.to,a.to)));else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),vh(t,i,r.copy(a.from,r.to)));break}}}return t}function vh(e,t,n){for(;t<e.length&&gh(n,e[t])>0;)t++;e.splice(t,0,n)}function yh(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=ch&&t.push(r)}),e.cursorWrapper&&t.push(sh.create(e.state.doc,[e.cursorWrapper.deco])),lh.from(t)}var bh={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},xh=Jd&&Yd<=11,Sh=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},Ch=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Sh,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);Jd&&Yd<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():ef&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),xh&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,bh)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Dp(this.view)){if(this.suppressingSelectionUpdates)return _p(this.view);if(Jd&&Yd<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Ad(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=Ed(n))t.add(n);for(let r=e.anchorNode;r;r=Ed(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Dp(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(Xd&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||kh(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Rd(n)&&(c=hp(e))&&c.eq(W.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,_p(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),Eh(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Ah(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||_p(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(Jd&&Yd<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?Td(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?Td(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}return e.type==`attributes`?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}},wh=new WeakMap,Th=!1;function Eh(e){if(!wh.has(e)&&(wh.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Xd,Th)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.`),Th=!0}}function Dh(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return Ad(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Oh(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Dh(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?Dh(e,n):null}function kh(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function Ah(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function jh(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],Rd(c)||l.push({node:c.focusNode,offset:c.focusOffset})),Qd&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||qs.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace!=`pre`||`full`,findPositions:l,ruleFromNode:Mh,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function Mh(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(ef&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}if(e.parentNode.lastChild==e||ef&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}var Nh=/^(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 Ph(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=hp(e,t);if(n&&!e.state.selection.eq(n)){if(Qd&&af&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,zd(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=jh(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=zh(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(tf&&e.input.lastIOSEnter>Date.now()-225||af)&&i.some(e=>e.nodeType==1&&!Nh.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,zd(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m){if(r&&c instanceof G&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=Fh(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof G&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),Jd&&Yd<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((tf&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,zd(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&Lh(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,zd(8,`Backspace`)))){af&&Qd&&e.domObserver.suppressSelectionUpdates();return}Qd&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),af&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,zd(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=Fh(e,n.doc,l.sel);t&&!(Qd&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||Jd&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v){if(h.pos==g.pos){Jd&&Yd<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>_p(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=Ih(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x())}else e.dispatch(x())}function Fh(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Ep(e,t.resolve(n.anchor),t.resolve(n.head))}function Ih(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(H.from(l).eq(e))return{mark:s,type:o}}function Lh(e,t,n,r,i){if(n-t<=i.pos-r.pos||Rh(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(Rh(a,!0,!0));return!o.parent.isTextblock||o.pos>n||Rh(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Rh(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function zh(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&Bh(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&Bh(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function Bh(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}var Vh=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new hm,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Jh),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=Wh(this),Uh(this),this.nodeViews=Kh(this),this.docView=Yf(this.state.doc,Hh(this),yh(this),this.dom,this),this.domObserver=new Ch(this,(e,t,n,r)=>Ph(this,e,t,n,r)),this.domObserver.start(),gm(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&ym(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Jh),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(Bm(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Kh(this);qh(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&ym(this),this.editable=Wh(this),Uh(this);let o=yh(this),s=Hh(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&ff(this);if(i){this.domObserver.stop();let t=l&&(Jd||Qd)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&Gh(n.selection,e.selection);if(l){let n=Qd?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Vm(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=Yf(e.doc,s,o,this.dom,this)),!n||this.trackWrites&&this.dom.contains(this.trackWrites)||(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&kp(this))?_p(this,t):(wp(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&mf(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(e.nodeType==1?e:e.parentNode)&&!this.someProp(`handleScrollToSelection`,e=>e(this))){if(this.state.selection instanceof K){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&df(this,t.getBoundingClientRect(),e)}else df(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new Xm(e.slice,e.move,r<0?void 0:K.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(Jd){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&&_f(this.dom),_p(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Tf(this,e)}coordsAtPos(e,t=1){return kf(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return zf(this,t||this.state,e)}pasteHTML(e,t){return Jm(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return Jm(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return Yp(this,e)}destroy(){this.docView&&(vm(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],yh(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,kd())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Sm(this,e)}domSelectionRange(){let e=this.domSelection();return e?ef&&this.root.nodeType===11&&Bd(this.dom.ownerDocument)==this.dom&&Oh(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};Vh.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function Hh(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[ih.node(0,e.state.doc.content.size,t)]}function Uh(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:ih.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Wh(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function Gh(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function Kh(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function qh(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function Jh(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}function Yh(e,t){return e.meta={package:`@milkdown/core`,group:`System`,...t},e}var Xh={text:(e,t,n,r)=>{let i=e.value;return/^[^*_\\]*\s+$/.test(i)?i:n.safe(i,{...r,encode:[]})},strong:(e,t,n,r)=>{let i=e.marker||n.options.strong||`*`,a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i);return s+=o.move(n.containerPhrasing(e,{before:s,after:i,...o.current()})),s+=o.move(i+i),a(),s},emphasis:(e,t,n,r)=>{let i=e.marker||n.options.emphasis||`*`,a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i);return s+=o.move(n.containerPhrasing(e,{before:s,after:i,...o.current()})),s+=o.move(i),a(),s}},Zh=P({},`editorView`),Qh=P({},`editorState`),$h=P([],`initTimer`),eg=P({},`editor`),tg=P([],`inputRules`),ng=P([],`prosePlugins`),rg=P([],`remarkPlugins`),ig=P([],`nodeView`),ag=P([],`markView`),og=P(Fo().use(wi).use(so),`remark`),sg=P({handlers:Xh,encode:[]},`remarkStringifyOptions`),cg=St(`ConfigReady`);function lg(e){let t=t=>(t.record(cg),async()=>(await e(t),t.done(cg),()=>{t.clearTimer(cg)}));return Yh(t,{displayName:`Config`}),t}var ug=St(`InitReady`);function dg(e){let t=t=>(t.inject(eg,e).inject(ng,[]).inject(rg,[]).inject(tg,[]).inject(ig,[]).inject(ag,[]).inject(sg,{handlers:Xh,encode:[]}).inject(og,Fo().use(wi).use(so)).inject($h,[cg]).record(ug),async()=>{await t.waitTimers($h);let e=t.get(sg);return t.set(og,Fo().use(wi).use(so,e)),t.done(ug),()=>{t.remove(eg).remove(ng).remove(rg).remove(tg).remove(ig).remove(ag).remove(sg).remove(og).remove($h).clearTimer(ug)}});return Yh(t,{displayName:`Init`}),t}var fg=St(`SchemaReady`),pg=P([],`schemaTimer`),mg=P({},`schema`),hg=P([],`nodes`),gg=P([],`marks`);function _g(e){return{...e,parseDOM:e.parseDOM?.map(t=>({priority:e.priority,...t}))}}var vg=e=>(e.inject(mg,{}).inject(hg,[]).inject(gg,[]).inject(pg,[ug]).record(fg),async()=>{await e.waitTimers(pg);let t=e.get(og),n=e.get(rg).reduce((e,t)=>e.use(t.plugin,t.options),t);e.set(og,n);let r=new Us({nodes:Object.fromEntries(e.get(hg).map(([e,t])=>[e,_g(t)])),marks:Object.fromEntries(e.get(gg).map(([e,t])=>[e,_g(t)]))});return e.set(mg,r),e.done(fg),()=>{e.remove(mg).remove(hg).remove(gg).remove(pg).clearTimer(fg)}});Yh(vg,{displayName:`Schema`});var yg=class{constructor(){this.setCtx=e=>{this.#t=e},this.chain=()=>{if(this.#t==null)throw ft();let e=this.#t,t=[],n=this.get.bind(this),r={run:()=>{let n=Eu(...t),r=e.get(Zh);return n(r.state,r.dispatch,r)},inline:e=>(t.push(e),r),pipe:i.bind(this)};function i(e,i){let a=n(e);return t.push(a(i)),r}return r}}#e=new ht;#t=null;get ctx(){return this.#t}create(e,t){let n=e.create(this.#e.sliceMap);return n.set(t),n}get(e){return this.#e.get(e).get()}remove(e){return this.#e.remove(e)}call(e,t){if(this.#t==null)throw ft();let n=this.get(e)(t),r=this.#t.get(Zh);return n(r.state,r.dispatch,r)}inline(e){if(this.#t==null)throw ft();let t=this.#t.get(Zh);return e(t.state,t.dispatch,t)}};function bg(e=`cmdKey`){return P((()=>()=>!1),e)}var xg=P(new yg,`commands`),Sg=P([fg],`commandsTimer`),Cg=St(`CommandsReady`),wg=e=>{let t=new yg;return t.setCtx(e),e.inject(xg,t).inject(Sg,[fg]).record(Cg),async()=>(await e.waitTimers(Sg),e.done(Cg),()=>{e.remove(xg).remove(Sg).clearTimer(Cg)})};Yh(wg,{displayName:`Commands`});function Tg(e){return e.Backspace=Eu(Pu,Xl,$l,nu),e}var Eg=class{constructor(){this.setCtx=e=>{this.#e=e},this.add=e=>(this.#t.push(e),()=>{this.#t=this.#t.filter(t=>t!==e)}),this.addObjectKeymap=e=>{let t=[];return Object.entries(e).forEach(([e,n])=>{if(typeof n==`function`){let r={key:e,onRun:()=>n};this.#t.push(r),t.push(()=>{this.#t=this.#t.filter(e=>e!==r)})}else this.#t.push(n),t.push(()=>{this.#t=this.#t.filter(e=>e!==n)})}),()=>{t.forEach(e=>e())}},this.addBaseKeymap=()=>{let e=Tg(ju);return this.addObjectKeymap(e)},this.build=()=>{let e={};return this.#t.forEach(t=>{e[t.key]=[...e[t.key]||[],t]}),Object.fromEntries(Object.entries(e).map(([e,t])=>{let n=t.sort((e,t)=>(t.priority??50)-(e.priority??50));return[e,(e,t,r)=>{let i=this.#e;if(i==null)throw ot();return Eu(...n.map(e=>e.onRun(i)))(e,t,r)}]}))}}#e=null;#t=[];get ctx(){return this.#e}},Dg=P(new Eg,`keymap`),Og=P([fg],`keymapTimer`),kg=St(`KeymapReady`),Ag=e=>{let t=new Eg;return t.setCtx(e),e.inject(Dg,t).inject(Og,[fg]).record(kg),async()=>(await e.waitTimers(Og),e.done(kg),()=>{e.remove(Dg).remove(Og).clearTimer(kg)})},jg=St(`ParserReady`),Mg=(()=>{throw ot()}),Ng=P(Mg,`parser`),Pg=P([],`parserTimer`),Fg=e=>(e.inject(Ng,Mg).inject(Pg,[fg]).record(jg),async()=>{await e.waitTimers(Pg);let t=e.get(og),n=e.get(mg);return e.set(Ng,xd.create(n,t)),e.done(jg),()=>{e.remove(Ng).remove(Pg).clearTimer(jg)}});Yh(Fg,{displayName:`Parser`});var Ig=St(`SerializerReady`),Lg=P([],`serializerTimer`),Rg=(()=>{throw ot()}),zg=P(Rg,`serializer`),Bg=e=>(e.inject(zg,Rg).inject(Lg,[fg]).record(Ig),async()=>{await e.waitTimers(Lg);let t=e.get(og),n=e.get(mg);return e.set(zg,wd.create(n,t)),e.done(Ig),()=>{e.remove(zg).remove(Lg).clearTimer(Ig)}});Yh(Bg,{displayName:`Serializer`});var Vg=P(``,`defaultValue`),Hg=P(e=>e,`stateOptions`),Ug=P([],`editorStateTimer`),Wg=St(`EditorStateReady`);function Gg(e,t,n){if(typeof e==`string`)return t(e);if(e.type===`html`)return qs.fromSchema(n).parse(e.dom);if(e.type===`json`)return vs.fromJSON(n,e.value);throw rt(e)}var Kg=new Yl(`MILKDOWN_STATE_TRACKER`),qg=e=>(e.inject(Vg,``).inject(Qh,{}).inject(Hg,e=>e).inject(Ug,[jg,Ig,Cg,kg]).record(Wg),async()=>{await e.waitTimers(Ug);let t=e.get(mg),n=e.get(Ng),r=e.get(tg),i=e.get(Hg),a=e.get(ng),o=Gg(e.get(Vg),n,t),s=e.get(Dg),c=s.addBaseKeymap(),l=[...a,new Kl({key:Kg,state:{init:()=>{},apply:(t,n,r,i)=>{e.set(Qh,i)}}}),Yu({rules:r}),gd(s.build())];e.set(ng,l);let u=i({schema:t,doc:o,plugins:l}),d=Wl.create(u);return e.set(Qh,d),e.done(Wg),()=>{c(),e.remove(Vg).remove(Qh).remove(Hg).remove(Ug).clearTimer(Wg)}});Yh(qg,{displayName:`EditorState`});var Jg=P([],`pasteRule`),Yg=P([fg],`pasteRuleTimer`),Xg=St(`PasteRuleReady`),Zg=e=>(e.inject(Jg,[]).inject(Yg,[fg]).record(Xg),async()=>(await e.waitTimers(Yg),e.done(Xg),()=>{e.remove(Jg).remove(Yg).clearTimer(Xg)}));Yh(Zg,{displayName:`PasteRule`});var Qg=St(`EditorViewReady`),$g=P([],`editorViewTimer`),e_=P({},`editorViewOptions`),t_=P(null,`root`),n_=P(null,`rootDOM`),r_=P({},`rootAttrs`);function i_(e,t){let n=document.createElement(`div`);n.className=`milkdown`,e.appendChild(n),t.set(n_,n);let r=t.get(r_);return Object.entries(r).forEach(([e,t])=>n.setAttribute(e,t)),n}function a_(e){e.classList.add(`editor`),e.setAttribute(`role`,`textbox`)}var o_=new Yl(`MILKDOWN_VIEW_CLEAR`),s_=e=>(e.inject(t_,document.body).inject(Zh,{}).inject(e_,{}).inject(n_,null).inject(r_,{}).inject($g,[Wg,Xg]).record(Qg),async()=>{await e.wait(ug);let t=e.get(t_)||document.body,n=typeof t==`string`?document.querySelector(t):t;e.update(ng,t=>[new Kl({key:o_,view:t=>{let r=n?i_(n,e):void 0;return(()=>{if(r&&n){let e=t.dom;n.replaceChild(r,e),r.appendChild(e)}})(),{destroy:()=>{r?.parentNode&&r?.parentNode.replaceChild(t.dom,r),r?.remove()}}}}),...t]),await e.waitTimers($g);let r=e.get(Qh),i=e.get(e_),a=new Vh(n,{state:r,nodeViews:Object.fromEntries(e.get(ig)),markViews:Object.fromEntries(e.get(ag)),transformPasted:(t,n,r)=>(e.get(Jg).sort((e,t)=>(t.priority??50)-(e.priority??50)).map(e=>e.run).forEach(e=>{t=e(t,n,r)}),t),...i});return a_(a.dom),e.set(Zh,a),e.done(Qg),()=>{a?.destroy(),e.remove(t_).remove(Zh).remove(e_).remove(n_).remove(r_).remove($g).clearTimer(Qg)}});Yh(s_,{displayName:`EditorView`});var c_=function(e){return e.Idle=`Idle`,e.OnCreate=`OnCreate`,e.Created=`Created`,e.OnDestroy=`OnDestroy`,e.Destroyed=`Destroyed`,e}({}),l_=class e{constructor(){this.enableInspector=(e=!0)=>(this.#e=e,this),this.onStatusChange=e=>(this.#r=e,this),this.config=e=>(this.#n.push(e),this),this.removeConfig=e=>(this.#n=this.#n.filter(t=>t!==e),this),this.use=e=>{let t=[e].flat();return t.flat().forEach(e=>{this.#o.set(e,{ctx:void 0,handler:void 0,cleanup:void 0})}),this.#t===c_.Created&&this.#u(t,this.#o),this},this.remove=async e=>this.#t===c_.OnCreate?(console.warn(`[Milkdown]: You are trying to remove plugins when the editor is creating, this is not recommended, please check your code.`),new Promise(t=>{setTimeout(()=>{t(this.remove(e))},50)})):(await this.#d([e].flat(),!0),this),this.create=async()=>(this.#t===c_.OnCreate||(this.#t===c_.Created&&await this.destroy(),this.#p(c_.OnCreate),this.#l(),this.#u([...this.#o.keys()],this.#o),await Promise.all([this.#m(this.#s),this.#m(this.#o)].flat()),this.#p(c_.Created)),this),this.destroy=async(e=!1)=>this.#t===c_.Destroyed||this.#t===c_.OnDestroy?this:this.#t===c_.OnCreate?new Promise(t=>{setTimeout(()=>{t(this.destroy(e))},50)}):(e&&(this.#n=[]),this.#p(c_.OnDestroy),await this.#d([...this.#o.keys()],e),await this.#f(),this.#p(c_.Destroyed),this),this.action=e=>e(this.#c),this.inspect=()=>this.#e?[...this.#s.values(),...this.#o.values()].map(({ctx:e})=>e?.inspector?.read()).filter(e=>!!e):(console.warn("[Milkdown]: You are trying to collect inspection when inspector is disabled, please enable inspector by `editor.enableInspector()` first."),[])}static make(){return new e}#e=!1;#t=c_.Idle;#n=[];#r=()=>void 0;#i=new ht;#a=new bt;#o=new Map;#s=new Map;#c=new yt(this.#i,this.#a);#l=()=>{let e=lg(async e=>{await Promise.all(this.#n.map(t=>Promise.resolve(t(e))))}),t=[vg,Fg,Bg,wg,Ag,Zg,qg,s_,dg(this),e];this.#u(t,this.#s)};#u=(e,t)=>{e.forEach(e=>{let n=this.#c.produce(this.#e?e.meta:void 0),r=e(n);t.set(e,{ctx:n,handler:r,cleanup:void 0})})};#d=(e,t=!1)=>Promise.all([e].flat().map(async e=>{let n=this.#o.get(e)?.cleanup;return t?this.#o.delete(e):this.#o.set(e,{ctx:void 0,handler:void 0,cleanup:void 0}),typeof n==`function`?n():n}));#f=async()=>{await Promise.all([...this.#s.entries()].map(async([e,{cleanup:t}])=>typeof t==`function`?t():t)),this.#s.clear()};#p=e=>{this.#t=e,this.#r(e)};#m=e=>[...e.entries()].map(async([t,n])=>{let{ctx:r,handler:i}=n;if(!i)return;let a=await i();e.set(t,{ctx:r,handler:i,cleanup:a})});get ctx(){return this.#c}get status(){return this.#t}},u_=e=>crypto.getRandomValues(new Uint8Array(e)),d_=(e,t,n)=>{let r=(2<<Math.log2(e.length-1))-1,i=-~(1.6*r*t/e.length);return(a=t)=>{let o=``;for(;;){let t=n(i),s=i|0;for(;s--;)if(o+=e[t[s]&r]||``,o.length>=a)return o}}};((e,t=21)=>d_(e,t|0,u_))(`abcedfghicklmn`,10);function q(e,t){let n=bg(e),r=i=>async()=>{r.key=n,await i.wait(Cg);let a=t(i);return i.get(xg).create(n,a),r.run=t=>i.get(xg).call(e,t),()=>{i.get(xg).remove(n)}};return r}function f_(e){let t=n=>async()=>{await n.wait(fg);let r=e(n);return n.update(tg,e=>[...e,r]),t.inputRule=r,()=>{n.update(tg,e=>e.filter(e=>e!==r))}};return t}function p_(e){let t=n=>async()=>{await n.wait(fg);let r=e(n);return n.update(Jg,e=>[...e,r]),t.pasteRule=r,()=>{n.update(Jg,e=>e.filter(e=>e!==r))}};return t}function m_(e,t){let n=r=>async()=>{let i=t(r);return r.update(gg,t=>[...t.filter(t=>t[0]!==e),[e,i]]),n.id=e,n.schema=i,()=>{r.update(gg,t=>t.filter(([t])=>t!==e))}};return n.type=t=>{let n=t.get(mg).marks[e];if(!n)throw mt(e);return n},n}function h_(e,t){let n=r=>async()=>{let i=t(r);return r.update(hg,t=>[...t.filter(t=>t[0]!==e),[e,i]]),n.id=e,n.schema=i,()=>{r.update(hg,t=>t.filter(([t])=>t!==e))}};return n.type=t=>{let n=t.get(mg).nodes[e];if(!n)throw pt(e);return n},n}function g_(e){let t,n=n=>async()=>(await n.wait(fg),t=e(n),n.update(ng,e=>[...e,t]),()=>{n.update(ng,e=>e.filter(e=>e!==t))});return n.plugin=()=>t,n.key=()=>t.spec.key,n}function __(e){let t=n=>async()=>{await n.wait(kg);let r=n.get(Dg),i=e(n),a=r.addObjectKeymap(i);return t.keymap=i,()=>{a()}};return t}function v_(e,t){let n=r=>async()=>{await r.wait(fg);let i=t(r);return e.type(r)instanceof zs?r.update(ig,t=>[...t,[e.id,i]]):r.update(ag,t=>[...t,[e.id,i]]),n.view=i,n.type=e,()=>{e.type(r)instanceof zs?r.update(ig,t=>t.filter(t=>t[0]!==e.id)):r.update(ag,t=>t.filter(t=>t[0]!==e.id))}};return n}function y_(e,t){let n=P(e,t),r=e=>(e.inject(n),()=>()=>{e.remove(n)});return r.key=n,r}function b_(e,t){let n=y_(t,e),r=h_(e,e=>e.get(n.key)(e)),i=[n,r];return i.id=r.id,i.node=r,i.type=e=>r.type(e),i.ctx=n,i.key=n.key,i.extendSchema=n=>b_(e,n(t)),i}function x_(e,t){let n=y_(t,e),r=m_(e,e=>e.get(n.key)(e)),i=[n,r];return i.id=r.id,i.mark=r,i.type=e=>r.type(e),i.ctx=n,i.key=n.key,i.extendSchema=n=>x_(e,n(t)),i}function S_(e,t){let n=y_(Object.fromEntries(Object.entries(t).map(([e,{shortcuts:t,priority:n}])=>[e,{shortcuts:t,priority:n}])),`${e}Keymap`),r=__(e=>{let r=e.get(n.key),i=Object.entries(t).flatMap(([e,{command:t}])=>{let n=r[e],i=[n.shortcuts].flat(),a=n.priority;return i.map(e=>[e,{key:e,onRun:t,priority:a}])});return Object.fromEntries(i)}),i=[n,r];return i.ctx=n,i.shortcuts=r,i.key=n.key,i.keymap=r.keymap,i}var C_=(e,t=()=>({}))=>y_(t,`${e}Attr`),w_=(e,t=()=>({}))=>y_(t,`${e}Attr`);function T_(e,t,n){let r=y_(n??{},e),i=e=>async()=>{await e.wait(ug);let n={plugin:t(e),options:e.get(r.key)};return e.update(rg,e=>[...e,n]),()=>{e.update(rg,e=>e.filter(e=>e!==n))}},a=[r,i];return a.id=e,a.plugin=i,a.options=r,a}function E_(e,t){return n=>n.get(xg).call(e,t)}function D_(e){return t=>{let n=t.get(Zh),r=t.get(mg),i=t.get(zg);if(!e)return i(n.state.doc);let a=n.state.doc.slice(e.from,e.to,!0),o=r.topNodeType.createAndFill(null,a.content);return o?i(o):(console.error(`No document found`),``)}}function O_(e,t=!1){return n=>{let r=n.get(Zh),i=n.get(Ng)(e);if(!i)return;if(!t){let{state:e}=r;return r.dispatch(e.tr.replace(0,e.doc.content.size,new U(i.content,0,0)))}let a=n.get(mg),o=n.get(Hg)({schema:a,doc:i,plugins:n.get(ng)}),s=Wl.create(o);r.updateState(s)}}function k_(e,t){return function(n,r){let{$from:i,$to:a,node:o}=n.selection;if(o&&o.isBlock||i.depth<2||!i.sameParent(a))return!1;let s=i.node(-1);if(s.type!=e)return!1;if(i.parent.content.size==0&&i.node(-1).childCount==i.indexAfter(-1)){if(i.depth==3||i.node(-3).type!=e||i.index(-2)!=i.node(-2).childCount-1)return!1;if(r){let t=H.empty,a=i.index(-1)?1:i.index(-2)?2:3;for(let e=i.depth-a;e>=i.depth-3;e--)t=H.from(i.node(e).copy(t));let o=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3;t=t.append(H.from(e.createAndFill()));let s=i.before(i.depth-(a-1)),c=n.tr.replace(s,i.after(-o),new U(t,4-a,0)),l=-1;c.doc.nodesBetween(s,c.doc.content.size,(e,t)=>{if(l>-1)return!1;e.isTextblock&&e.content.size==0&&(l=t+1)}),l>-1&&c.setSelection(W.near(c.doc.resolve(l))),r(c.scrollIntoView())}return!0}let c=a.pos==i.end()?s.contentMatchAt(0).defaultType:null,l=n.tr.delete(i.pos,a.pos),u=c?[t?{type:e,attrs:t}:null,{type:c}]:void 0;return $c(l.doc,i.pos,2,u)?(r&&r(l.split(i.pos,2,u).scrollIntoView()),!0):!1}}function A_(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?j_(t,n,e,a):M_(t,n,a):!0:!1}}function j_(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new Fc(a-1,o,a,o,new U(H.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new gs(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=Vc(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return tl(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function M_(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?H.empty:H.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new Fc(d-+!!s,f+ +!!c,d+1,f-1,new U((s?H.empty:H.from(i.copy(H.empty))).append(c?H.empty:H.from(i.copy(H.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function N_(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=H.from(r?e.create():null),o=new U(H.from(e.create(null,H.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new Fc(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}function P_(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),ia(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}function F_(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),ia(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}function I_(e){let t=new Map;if(!e||!e.type)throw Error(`mdast-util-definitions expected node`);return F_(e,`definition`,function(e){let n=L_(e.identifier);n&&!t.get(n)&&t.set(n,e)}),n;function n(e){let n=L_(e);return t.get(n)}}function L_(e){return String(e||``).toUpperCase()}function R_(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),ia(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}function z_(){return function(e){let t=I_(e);R_(e,function(e,n,r){if(e.type===`definition`&&r!==void 0&&typeof n==`number`)return r.children.splice(n,1),[ra,n];if(e.type===`imageReference`||e.type===`linkReference`){let i=t(e.identifier);if(i&&r&&typeof n==`number`)return r.children[n]=e.type===`imageReference`?{type:`image`,url:i.url,title:i.title,alt:e.alt}:{type:`link`,url:i.url,title:i.title,children:e.children},[ra,n]}})}}function B_(e,t){if(!(t.childCount>=1&&t.lastChild?.type.name===`hardbreak`)){e.next(t.content);return}let n=[];t.content.forEach((e,r,i)=>{i!==t.childCount-1&&n.push(e)}),e.next(H.fromArray(n))}function J(e,t){return Object.assign(e,{meta:{package:`@milkdown/preset-commonmark`,...t}}),e}var V_=w_(`emphasis`);J(V_,{displayName:`Attr<emphasis>`,group:`Emphasis`});var H_=x_(`emphasis`,e=>({attrs:{marker:{default:e.get(sg).emphasis||`*`,validate:`string`}},parseDOM:[{tag:`i`},{tag:`em`},{style:`font-style`,getAttrs:e=>e===`italic`}],toDOM:t=>[`em`,e.get(V_.key)(t)],parseMarkdown:{match:e=>e.type===`emphasis`,runner:(e,t,n)=>{e.openMark(n,{marker:t.marker}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name===`emphasis`,runner:(e,t)=>{e.withMark(t,`emphasis`,void 0,{marker:t.attrs.marker})}}}));J(H_.mark,{displayName:`MarkSchema<emphasis>`,group:`Emphasis`}),J(H_.ctx,{displayName:`MarkSchemaCtx<emphasis>`,group:`Emphasis`});var U_=q(`ToggleEmphasis`,e=>()=>Tu(H_.type(e)));J(U_,{displayName:`Command<toggleEmphasisCommand>`,group:`Emphasis`});var W_=f_(e=>Xu(/(?:^|[^*])\*([^*]+)\*$/,H_.type(e),{getAttr:()=>({marker:`*`}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith(`*`)?{}:{fullMatch:e.slice(1),start:t+1}}));J(W_,{displayName:`InputRule<emphasis>|Star`,group:`Emphasis`});var G_=f_(e=>Xu(/\b_(?![_\s])(.*?[^_\s])_\b/,H_.type(e),{getAttr:()=>({marker:`_`}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith(`_`)?{}:{fullMatch:e.slice(1),start:t+1}}));J(G_,{displayName:`InputRule<emphasis>|Underscore`,group:`Emphasis`});var K_=S_(`emphasisKeymap`,{ToggleEmphasis:{shortcuts:`Mod-i`,command:e=>{let t=e.get(xg);return()=>t.call(U_.key)}}});J(K_.ctx,{displayName:`KeymapCtx<emphasis>`,group:`Emphasis`}),J(K_.shortcuts,{displayName:`Keymap<emphasis>`,group:`Emphasis`});var q_=w_(`strong`);J(q_,{displayName:`Attr<strong>`,group:`Strong`});var J_=x_(`strong`,e=>({attrs:{marker:{default:e.get(sg).strong||`*`,validate:`string`}},parseDOM:[{tag:`b`,getAttrs:e=>e.style.fontWeight!=`normal`&&null},{tag:`strong`},{style:`font-style`,getAttrs:e=>e===`bold`},{style:`font-weight=400`,clearMark:e=>e.type.name==`strong`},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:t=>[`strong`,e.get(q_.key)(t)],parseMarkdown:{match:e=>e.type===`strong`,runner:(e,t,n)=>{e.openMark(n,{marker:t.marker}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name===`strong`,runner:(e,t)=>{e.withMark(t,`strong`,void 0,{marker:t.attrs.marker})}}}));J(J_.mark,{displayName:`MarkSchema<strong>`,group:`Strong`}),J(J_.ctx,{displayName:`MarkSchemaCtx<strong>`,group:`Strong`});var Y_=q(`ToggleStrong`,e=>()=>Tu(J_.type(e)));J(Y_,{displayName:`Command<toggleStrongCommand>`,group:`Strong`});var X_=f_(e=>Xu(/(?<![\w:/])(?:\*\*|__)([^*_]+?)(?:\*\*|__)(?![\w/])$/,J_.type(e),{getAttr:e=>({marker:e[0].startsWith(`*`)?`*`:`_`})}));J(X_,{displayName:`InputRule<strong>`,group:`Strong`});var Z_=S_(`strongKeymap`,{ToggleBold:{shortcuts:[`Mod-b`],command:e=>{let t=e.get(xg);return()=>t.call(Y_.key)}}});J(Z_.ctx,{displayName:`KeymapCtx<strong>`,group:`Strong`}),J(Z_.shortcuts,{displayName:`Keymap<strong>`,group:`Strong`});var Q_=w_(`inlineCode`);J(Q_,{displayName:`Attr<inlineCode>`,group:`InlineCode`});var $_=x_(`inlineCode`,e=>({priority:100,code:!0,parseDOM:[{tag:`code`}],toDOM:t=>[`code`,e.get(Q_.key)(t)],parseMarkdown:{match:e=>e.type===`inlineCode`,runner:(e,t,n)=>{e.openMark(n),e.addText(t.value),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name===`inlineCode`,runner:(e,t,n)=>(e.withMark(t,`inlineCode`,n.text||``),!0)}}));J($_.mark,{displayName:`MarkSchema<inlineCode>`,group:`InlineCode`}),J($_.ctx,{displayName:`MarkSchemaCtx<inlineCode>`,group:`InlineCode`});var ev=q(`ToggleInlineCode`,e=>()=>(t,n)=>{let{selection:r,tr:i}=t;if(r.empty)return!1;let{from:a,to:o}=r;return t.doc.rangeHasMark(a,o,$_.type(e))?(n?.(i.removeMark(a,o,$_.type(e))),!0):(Object.keys(t.schema.marks).filter(e=>e!==$_.type.name).map(e=>t.schema.marks[e]).forEach(e=>{i.removeMark(a,o,e)}),n?.(i.addMark(a,o,$_.type(e).create())),!0)});J(ev,{displayName:`Command<toggleInlineCodeCommand>`,group:`InlineCode`});var tv=f_(e=>Xu(/(?:`)([^`]+)(?:`)$/,$_.type(e)));J(tv,{displayName:`InputRule<inlineCodeInputRule>`,group:`InlineCode`});var nv=S_(`inlineCodeKeymap`,{ToggleInlineCode:{shortcuts:`Mod-e`,command:e=>{let t=e.get(xg);return()=>t.call(ev.key)}}});J(nv.ctx,{displayName:`KeymapCtx<inlineCode>`,group:`InlineCode`}),J(nv.shortcuts,{displayName:`Keymap<inlineCode>`,group:`InlineCode`});var rv=w_(`link`);J(rv,{displayName:`Attr<link>`,group:`Link`});var iv=x_(`link`,e=>({attrs:{href:{validate:`string`},title:{default:null,validate:`string|null`}},parseDOM:[{tag:`a[href]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw dt(e);return{href:e.getAttribute(`href`),title:e.getAttribute(`title`)}}}],toDOM:t=>[`a`,{...e.get(rv.key)(t),...t.attrs}],parseMarkdown:{match:e=>e.type===`link`,runner:(e,t,n)=>{let r=t.url,i=t.title;e.openMark(n,{href:r,title:i}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name===`link`,runner:(e,t)=>{e.withMark(t,`link`,void 0,{title:t.attrs.title,url:t.attrs.href})}}}));J(iv.mark,{displayName:`MarkSchema<link>`,group:`Link`});var av=q(`ToggleLink`,e=>(t={})=>Tu(iv.type(e),t));J(av,{displayName:`Command<toggleLinkCommand>`,group:`Link`});var ov=q(`UpdateLink`,e=>(t={})=>(n,r)=>{if(!r)return!1;let i,a=-1,{selection:o}=n,{from:s,to:c}=o;if(n.doc.nodesBetween(s,s===c?c+1:c,(t,n)=>{if(iv.type(e).isInSet(t.marks))return i=t,a=n,!1}),!i)return!1;let l=i.marks.find(({type:t})=>t===iv.type(e));if(!l)return!1;let u=a,d=a+i.nodeSize,{tr:f}=n,p=iv.type(e).create({...l.attrs,...t});return p?(r(f.removeMark(u,d,l).addMark(u,d,p).setSelection(new G(f.selection.$anchor)).scrollIntoView()),!0):!1});J(ov,{displayName:`Command<updateLinkCommand>`,group:`Link`});var sv=h_(`doc`,()=>({content:`block+`,parseMarkdown:{match:({type:e})=>e===`root`,runner:(e,t,n)=>{e.injectRoot(t,n)}},toMarkdown:{match:e=>e.type.name===`doc`,runner:(e,t)=>{e.openNode(`root`),e.next(t.content)}}}));J(sv,{displayName:`NodeSchema<doc>`,group:`Doc`});function cv(e){return ia(e,e=>e.type===`html`&&[`<br />`,`<br>`,`<br >`,`<br/>`].includes(e.value?.trim()),(e,t)=>{if(!t.length)return;let n=t[t.length-1];if(!n)return;let r=n.children.indexOf(e);r!==-1&&n.children.splice(r,1)},!0)}var lv=T_(`remark-preserve-empty-line`,()=>()=>cv);J(lv.plugin,{displayName:`Remark<remarkPreserveEmptyLine>`,group:`Remark`}),J(lv.options,{displayName:`RemarkConfig<remarkPreserveEmptyLine>`,group:`Remark`});var uv=C_(`paragraph`);J(uv,{displayName:`Attr<paragraph>`,group:`Paragraph`});var dv=b_(`paragraph`,e=>({content:`inline*`,group:`block`,parseDOM:[{tag:`p`}],toDOM:t=>[`p`,e.get(uv.key)(t),0],parseMarkdown:{match:e=>e.type===`paragraph`,runner:(e,t,n)=>{e.openNode(n),t.children?e.next(t.children):e.addText(t.value||``),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`paragraph`,runner:(t,n)=>{let r=e.get(Zh).state?.doc.lastChild;t.openNode(`paragraph`),(!n.content||n.content.size===0)&&n!==r&&fv(e)?t.addNode(`html`,void 0,`<br />`):B_(t,n),t.closeNode()}}}));function fv(e){let t=!1;try{e.get(lv.id),t=!0}catch{t=!1}return t}J(dv.node,{displayName:`NodeSchema<paragraph>`,group:`Paragraph`}),J(dv.ctx,{displayName:`NodeSchemaCtx<paragraph>`,group:`Paragraph`});var pv=q(`TurnIntoText`,e=>()=>Su(dv.type(e)));J(pv,{displayName:`Command<turnIntoTextCommand>`,group:`Paragraph`});var mv=S_(`paragraphKeymap`,{TurnIntoText:{shortcuts:`Mod-Alt-0`,command:e=>{let t=e.get(xg);return()=>t.call(pv.key)}}});J(mv.ctx,{displayName:`KeymapCtx<paragraph>`,group:`Paragraph`}),J(mv.shortcuts,{displayName:`Keymap<paragraph>`,group:`Paragraph`});var hv=[,,,,,,].fill(0).map((e,t)=>t+1);function gv(e){return e.textContent.toLowerCase().trim().replace(/\s+/g,`-`)}var _v=y_(gv,`headingIdGenerator`);J(_v,{displayName:`Ctx<HeadingIdGenerator>`,group:`Heading`});var vv=C_(`heading`);J(vv,{displayName:`Attr<heading>`,group:`Heading`});var yv=b_(`heading`,e=>{let t=e.get(_v.key);return{content:`inline*`,group:`block`,defining:!0,attrs:{id:{default:``,validate:`string`},level:{default:1,validate:`number`}},parseDOM:hv.map(e=>({tag:`h${e}`,getAttrs:t=>{if(!(t instanceof HTMLElement))throw dt(t);return{level:e,id:t.id}}})),toDOM:n=>[`h${n.attrs.level}`,{...e.get(vv.key)(n),id:n.attrs.id||t(n)},0],parseMarkdown:{match:({type:e})=>e===`heading`,runner:(e,t,n)=>{let r=t.depth;e.openNode(n,{level:r}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`heading`,runner:(e,t)=>{e.openNode(`heading`,void 0,{depth:t.attrs.level}),B_(e,t),e.closeNode()}}}});J(yv.node,{displayName:`NodeSchema<heading>`,group:`Heading`}),J(yv.ctx,{displayName:`NodeSchemaCtx<heading>`,group:`Heading`});var bv=f_(e=>Iu(/^(?<hashes>#+)\s$/,yv.type(e),t=>{let n=t.groups?.hashes?.length||0,{$from:r}=e.get(Zh).state.selection,i=r.node();if(i.type.name===`heading`){let e=Number(i.attrs.level)+Number(n);return e>6&&(e=6),{level:e}}return{level:n}}));J(bv,{displayName:`InputRule<wrapInHeadingInputRule>`,group:`Heading`});var xv=q(`WrapInHeading`,e=>t=>(t??=1,t<1?Su(dv.type(e)):Su(yv.type(e),{level:t})));J(xv,{displayName:`Command<wrapInHeadingCommand>`,group:`Heading`});var Sv=q(`DowngradeHeading`,e=>()=>(t,n,r)=>{let{$from:i}=t.selection,a=i.node();if(a.type!==yv.type(e)||!t.selection.empty||i.parentOffset!==0)return!1;let o=a.attrs.level-1;return o?(n?.(t.tr.setNodeMarkup(t.selection.$from.before(),void 0,{...a.attrs,level:o})),!0):Su(dv.type(e))(t,n,r)});J(Sv,{displayName:`Command<downgradeHeadingCommand>`,group:`Heading`});var Cv=S_(`headingKeymap`,{TurnIntoH1:{shortcuts:`Mod-Alt-1`,command:e=>{let t=e.get(xg);return()=>t.call(xv.key,1)}},TurnIntoH2:{shortcuts:`Mod-Alt-2`,command:e=>{let t=e.get(xg);return()=>t.call(xv.key,2)}},TurnIntoH3:{shortcuts:`Mod-Alt-3`,command:e=>{let t=e.get(xg);return()=>t.call(xv.key,3)}},TurnIntoH4:{shortcuts:`Mod-Alt-4`,command:e=>{let t=e.get(xg);return()=>t.call(xv.key,4)}},TurnIntoH5:{shortcuts:`Mod-Alt-5`,command:e=>{let t=e.get(xg);return()=>t.call(xv.key,5)}},TurnIntoH6:{shortcuts:`Mod-Alt-6`,command:e=>{let t=e.get(xg);return()=>t.call(xv.key,6)}},DowngradeHeading:{shortcuts:[`Delete`,`Backspace`],command:e=>{let t=e.get(xg);return()=>t.call(Sv.key)}}});J(Cv.ctx,{displayName:`KeymapCtx<heading>`,group:`Heading`}),J(Cv.shortcuts,{displayName:`Keymap<heading>`,group:`Heading`});var wv=C_(`blockquote`);J(wv,{displayName:`Attr<blockquote>`,group:`Blockquote`});var Tv=b_(`blockquote`,e=>({content:`block+`,group:`block`,defining:!0,parseDOM:[{tag:`blockquote`}],toDOM:t=>[`blockquote`,e.get(wv.key)(t),0],parseMarkdown:{match:({type:e})=>e===`blockquote`,runner:(e,t,n)=>{e.openNode(n).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===`blockquote`,runner:(e,t)=>{e.openNode(`blockquote`).next(t.content).closeNode()}}}));J(Tv.node,{displayName:`NodeSchema<blockquote>`,group:`Blockquote`}),J(Tv.ctx,{displayName:`NodeSchemaCtx<blockquote>`,group:`Blockquote`});var Ev=f_(e=>Fu(/^\s*>\s$/,Tv.type(e)));J(Ev,{displayName:`InputRule<wrapInBlockquoteInputRule>`,group:`Blockquote`});var Dv=q(`WrapInBlockquote`,e=>()=>xu(Tv.type(e)));J(Dv,{displayName:`Command<wrapInBlockquoteCommand>`,group:`Blockquote`});var Ov=S_(`blockquoteKeymap`,{WrapInBlockquote:{shortcuts:`Mod-Shift-b`,command:e=>{let t=e.get(xg);return()=>t.call(Dv.key)}}});J(Ov.ctx,{displayName:`KeymapCtx<blockquote>`,group:`Blockquote`}),J(Ov.shortcuts,{displayName:`Keymap<blockquote>`,group:`Blockquote`});var kv=C_(`codeBlock`,()=>({pre:{},code:{}}));J(kv,{displayName:`Attr<codeBlock>`,group:`CodeBlock`});var Av=b_(`code_block`,e=>({content:`text*`,group:`block`,marks:``,defining:!0,code:!0,attrs:{language:{default:``,validate:`string`}},parseDOM:[{tag:`pre`,preserveWhitespace:`full`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw dt(e);return{language:e.dataset.language}}}],toDOM:t=>{let n=e.get(kv.key)(t),r=t.attrs.language,i=r&&r.length>0?{"data-language":r}:void 0;return[`pre`,{...n.pre,...i},[`code`,n.code,0]]},parseMarkdown:{match:({type:e})=>e===`code`,runner:(e,t,n)=>{let r=t.lang??``,i=t.value;e.openNode(n,{language:r}),i&&e.addText(i),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`code_block`,runner:(e,t)=>{e.addNode(`code`,void 0,t.content.firstChild?.text||``,{lang:t.attrs.language})}}}));J(Av.node,{displayName:`NodeSchema<codeBlock>`,group:`CodeBlock`}),J(Av.ctx,{displayName:`NodeSchemaCtx<codeBlock>`,group:`CodeBlock`});var jv=f_(e=>Iu(/^```(?<language>[a-z]*)?[\s\n]$/,Av.type(e),e=>({language:e.groups?.language??``})));J(jv,{displayName:`InputRule<createCodeBlockInputRule>`,group:`CodeBlock`});var Mv=q(`CreateCodeBlock`,e=>(t=``)=>Su(Av.type(e),{language:t}));J(Mv,{displayName:`Command<createCodeBlockCommand>`,group:`CodeBlock`}),J(q(`UpdateCodeBlockLanguage`,()=>({pos:e,language:t}={pos:-1,language:``})=>(n,r)=>e>=0&&(r?.(n.tr.setNodeAttribute(e,`language`,t)),!0)),{displayName:`Command<updateCodeBlockLanguageCommand>`,group:`CodeBlock`});var Nv=S_(`codeBlockKeymap`,{CreateCodeBlock:{shortcuts:`Mod-Alt-c`,command:e=>{let t=e.get(xg);return()=>t.call(Mv.key)}}});J(Nv.ctx,{displayName:`KeymapCtx<codeBlock>`,group:`CodeBlock`}),J(Nv.shortcuts,{displayName:`Keymap<codeBlock>`,group:`CodeBlock`});var Pv=C_(`image`);J(Pv,{displayName:`Attr<image>`,group:`Image`});var Fv=b_(`image`,e=>({inline:!0,group:`inline`,selectable:!0,draggable:!0,marks:``,atom:!0,defining:!0,isolating:!0,attrs:{src:{default:``,validate:`string`},alt:{default:``,validate:`string`},title:{default:``,validate:`string`}},parseDOM:[{tag:`img[src]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw dt(e);return{src:e.getAttribute(`src`)||``,alt:e.getAttribute(`alt`)||``,title:e.getAttribute(`title`)||e.getAttribute(`alt`)||``}}}],toDOM:t=>[`img`,{...e.get(Pv.key)(t),...t.attrs}],parseMarkdown:{match:({type:e})=>e===`image`,runner:(e,t,n)=>{let r=t.url,i=t.alt,a=t.title;e.addNode(n,{src:r,alt:i,title:a})}},toMarkdown:{match:e=>e.type.name===`image`,runner:(e,t)=>{e.addNode(`image`,void 0,void 0,{title:t.attrs.title,url:t.attrs.src,alt:t.attrs.alt})}}}));J(Fv.node,{displayName:`NodeSchema<image>`,group:`Image`}),J(Fv.ctx,{displayName:`NodeSchemaCtx<image>`,group:`Image`});var Iv=q(`InsertImage`,e=>(t={})=>(n,r)=>{if(!r)return!0;let{src:i=``,alt:a=``,title:o=``}=t,s=Fv.type(e).create({src:i,alt:a,title:o});return s&&r(n.tr.replaceSelectionWith(s).scrollIntoView()),!0});J(Iv,{displayName:`Command<insertImageCommand>`,group:`Image`});var Lv=q(`UpdateImage`,e=>(t={})=>(n,r)=>{let i=nd(n.selection,Fv.type(e));if(!i)return!1;let{node:a,pos:o}=i,s={...a.attrs},{src:c,alt:l,title:u}=t;return c!==void 0&&(s.src=c),l!==void 0&&(s.alt=l),u!==void 0&&(s.title=u),r?.(n.tr.setNodeMarkup(o,void 0,s).scrollIntoView()),!0});J(Lv,{displayName:`Command<updateImageCommand>`,group:`Image`}),J(f_(e=>new Mu(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(t,n,r,i)=>{let[a,o,s=``,c]=n;return a?t.tr.replaceWith(r,i,Fv.type(e).create({src:s,alt:o,title:c})):null})),{displayName:`InputRule<insertImageInputRule>`,group:`Image`});var Rv=C_(`hardbreak`,e=>({"data-type":`hardbreak`,"data-is-inline":e.attrs.isInline}));J(Rv,{displayName:`Attr<hardbreak>`,group:`Hardbreak`});var zv=b_(`hardbreak`,e=>({inline:!0,group:`inline`,attrs:{isInline:{default:!1,validate:`boolean`}},selectable:!1,parseDOM:[{tag:`br`},{tag:`span[data-type="hardbreak"]`,getAttrs:()=>({isInline:!0})}],toDOM:t=>t.attrs.isInline?[`span`,e.get(Rv.key)(t),` `]:[`br`,e.get(Rv.key)(t)],parseMarkdown:{match:({type:e})=>e===`break`,runner:(e,t,n)=>{e.addNode(n,{isInline:!!t.data?.isInline})}},leafText:()=>`
45
+ `,toMarkdown:{match:e=>e.type.name===`hardbreak`,runner:(e,t)=>{t.attrs.isInline?e.addNode(`text`,void 0,`
46
+ `):e.addNode(`break`)}}}));J(zv.node,{displayName:`NodeSchema<hardbreak>`,group:`Hardbreak`}),J(zv.ctx,{displayName:`NodeSchemaCtx<hardbreak>`,group:`Hardbreak`});var Bv=q(`InsertHardbreak`,e=>()=>(t,n)=>{let{selection:r,tr:i}=t;if(!(r instanceof G))return!1;if(r.empty){let e=r.$from.node();if(e.childCount>0&&e.lastChild?.type.name===`hardbreak`)return n?.(i.replaceRangeWith(r.to-1,r.to,t.schema.node(`paragraph`)).setSelection(W.near(i.doc.resolve(r.to))).scrollIntoView()),!0}return n?.(i.setMeta(`hardbreak`,!0).replaceSelectionWith(zv.type(e).create()).scrollIntoView()),!0});J(Bv,{displayName:`Command<insertHardbreakCommand>`,group:`Hardbreak`});var Vv=S_(`hardbreakKeymap`,{InsertHardbreak:{shortcuts:`Shift-Enter`,command:e=>{let t=e.get(xg);return()=>t.call(Bv.key)}}});J(Vv.ctx,{displayName:`KeymapCtx<hardbreak>`,group:`Hardbreak`}),J(Vv.shortcuts,{displayName:`Keymap<hardbreak>`,group:`Hardbreak`});var Hv=C_(`hr`);J(Hv,{displayName:`Attr<hr>`,group:`Hr`});var Uv=b_(`hr`,e=>({group:`block`,parseDOM:[{tag:`hr`}],toDOM:t=>[`hr`,e.get(Hv.key)(t)],parseMarkdown:{match:({type:e})=>e===`thematicBreak`,runner:(e,t,n)=>{e.addNode(n)}},toMarkdown:{match:e=>e.type.name===`hr`,runner:e=>{e.addNode(`thematicBreak`)}}}));J(Uv.node,{displayName:`NodeSchema<hr>`,group:`Hr`}),J(Uv.ctx,{displayName:`NodeSchemaCtx<hr>`,group:`Hr`});var Wv=f_(e=>new Mu(/^(?:---|___\s|\*\*\*\s)$/,(t,n,r,i)=>{let{tr:a}=t;return n[0]&&a.replaceWith(r-1,i,Uv.type(e).create()),a}));J(Wv,{displayName:`InputRule<insertHrInputRule>`,group:`Hr`});var Gv=q(`InsertHr`,e=>()=>(t,n)=>{if(!n)return!0;let r=dv.node.type(e).create(),{tr:i,selection:a}=t,{from:o}=a,s=Uv.type(e).create();if(!s)return!0;let c=i.replaceSelectionWith(s).insert(o,r),l=W.findFrom(c.doc.resolve(o),1,!0);return l&&n(c.setSelection(l).scrollIntoView()),!0});J(Gv,{displayName:`Command<insertHrCommand>`,group:`Hr`});var Kv=C_(`bulletList`);J(Kv,{displayName:`Attr<bulletList>`,group:`BulletList`});var qv=b_(`bullet_list`,e=>({content:`listItem+`,group:`block`,attrs:{spread:{default:!1,validate:`boolean`}},parseDOM:[{tag:`ul`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw dt(e);return{spread:e.dataset.spread===`true`}}}],toDOM:t=>[`ul`,{...e.get(Kv.key)(t),"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>e===`list`&&!t,runner:(e,t,n)=>{let r=t.spread==null?`false`:`${t.spread}`;e.openNode(n,{spread:r}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===`bullet_list`,runner:(e,t)=>{e.openNode(`list`,void 0,{ordered:!1,spread:t.attrs.spread}).next(t.content).closeNode()}}}));J(qv.node,{displayName:`NodeSchema<bulletList>`,group:`BulletList`}),J(qv.ctx,{displayName:`NodeSchemaCtx<bulletList>`,group:`BulletList`});var Jv=f_(e=>Fu(/^\s*([-+*])\s$/,qv.type(e)));J(Jv,{displayName:`InputRule<wrapInBulletListInputRule>`,group:`BulletList`});var Yv=q(`WrapInBulletList`,e=>()=>xu(qv.type(e)));J(Yv,{displayName:`Command<wrapInBulletListCommand>`,group:`BulletList`});var Xv=S_(`bulletListKeymap`,{WrapInBulletList:{shortcuts:`Mod-Alt-8`,command:e=>{let t=e.get(xg);return()=>t.call(Yv.key)}}});J(Xv.ctx,{displayName:`KeymapCtx<bulletListKeymap>`,group:`BulletList`}),J(Xv.shortcuts,{displayName:`Keymap<bulletListKeymap>`,group:`BulletList`});var Zv=C_(`orderedList`);J(Zv,{displayName:`Attr<orderedList>`,group:`OrderedList`});var Qv=b_(`ordered_list`,e=>({content:`listItem+`,group:`block`,attrs:{order:{default:1,validate:`number`},spread:{default:!1,validate:`boolean`}},parseDOM:[{tag:`ol`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw dt(e);return{spread:e.dataset.spread,order:e.hasAttribute(`start`)?Number(e.getAttribute(`start`)):1}}}],toDOM:t=>[`ol`,{...e.get(Zv.key)(t),...t.attrs.order===1?{}:{start:t.attrs.order},"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>e===`list`&&!!t,runner:(e,t,n)=>{let r=t.spread==null?`true`:`${t.spread}`;e.openNode(n,{spread:r,order:t.start??1}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===`ordered_list`,runner:(e,t)=>{e.openNode(`list`,void 0,{ordered:!0,start:t.attrs.order??1,spread:t.attrs.spread===`true`}),e.next(t.content),e.closeNode()}}}));J(Qv.node,{displayName:`NodeSchema<orderedList>`,group:`OrderedList`}),J(Qv.ctx,{displayName:`NodeSchemaCtx<orderedList>`,group:`OrderedList`});var $v=f_(e=>Fu(/^\s*(\d+)\.\s$/,Qv.type(e),e=>({order:Number(e[1])}),(e,t)=>t.childCount+t.attrs.order===Number(e[1])));J($v,{displayName:`InputRule<wrapInOrderedListInputRule>`,group:`OrderedList`});var ey=q(`WrapInOrderedList`,e=>()=>xu(Qv.type(e)));J(ey,{displayName:`Command<wrapInOrderedListCommand>`,group:`OrderedList`});var ty=S_(`orderedListKeymap`,{WrapInOrderedList:{shortcuts:`Mod-Alt-7`,command:e=>{let t=e.get(xg);return()=>t.call(ey.key)}}});J(ty.ctx,{displayName:`KeymapCtx<orderedList>`,group:`OrderedList`}),J(ty.shortcuts,{displayName:`Keymap<orderedList>`,group:`OrderedList`});var ny=C_(`listItem`);J(ny,{displayName:`Attr<listItem>`,group:`ListItem`});var ry=b_(`list_item`,e=>({group:`listItem`,content:`paragraph block*`,attrs:{label:{default:`•`,validate:`string`},listType:{default:`bullet`,validate:`string`},spread:{default:!0,validate:`boolean`}},defining:!0,parseDOM:[{tag:`li`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw dt(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:e.dataset.spread===`true`}}}],toDOM:t=>[`li`,{...e.get(ny.key)(t),"data-label":t.attrs.label,"data-list-type":t.attrs.listType,"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e})=>e===`listItem`,runner:(e,t,n)=>{let r=t.label==null?`•`:`${t.label}.`,i=t.label==null?`bullet`:`ordered`,a=t.spread==null?`true`:`${t.spread}`;e.openNode(n,{label:r,listType:i,spread:a}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`list_item`,runner:(e,t)=>{e.openNode(`listItem`,void 0,{spread:t.attrs.spread}),e.next(t.content),e.closeNode()}}}));J(ry.node,{displayName:`NodeSchema<listItem>`,group:`ListItem`}),J(ry.ctx,{displayName:`NodeSchemaCtx<listItem>`,group:`ListItem`});var iy=q(`SinkListItem`,e=>()=>N_(ry.type(e)));J(iy,{displayName:`Command<sinkListItemCommand>`,group:`ListItem`});var ay=q(`LiftListItem`,e=>()=>A_(ry.type(e)));J(ay,{displayName:`Command<liftListItemCommand>`,group:`ListItem`});var oy=q(`SplitListItem`,e=>()=>k_(ry.type(e)));J(oy,{displayName:`Command<splitListItemCommand>`,group:`ListItem`});function sy(e){return(t,n,r)=>{let{selection:i}=t;if(!(i instanceof G))return!1;let{empty:a,$from:o}=i;return!a||o.parentOffset!==0||o.node(-1).type!==ry.type(e)?!1:Ql(t,n,r)}}var cy=q(`LiftFirstListItem`,e=>()=>sy(e));J(cy,{displayName:`Command<liftFirstListItemCommand>`,group:`ListItem`});var ly=S_(`listItemKeymap`,{NextListItem:{shortcuts:`Enter`,command:e=>{let t=e.get(xg);return()=>t.call(oy.key)}},SinkListItem:{shortcuts:[`Tab`,`Mod-]`],command:e=>{let t=e.get(xg);return()=>t.call(iy.key)}},LiftListItem:{shortcuts:[`Shift-Tab`,`Mod-[`],command:e=>{let t=e.get(xg);return()=>t.call(ay.key)}},LiftFirstListItem:{shortcuts:[`Backspace`,`Delete`],command:e=>{let t=e.get(xg);return()=>t.call(cy.key)}}});J(ly.ctx,{displayName:`KeymapCtx<listItem>`,group:`ListItem`}),J(ly.shortcuts,{displayName:`Keymap<listItem>`,group:`ListItem`});var uy=h_(`text`,()=>({group:`inline`,parseMarkdown:{match:({type:e})=>e===`text`,runner:(e,t)=>{e.addText(t.value)}},toMarkdown:{match:e=>e.type.name===`text`,runner:(e,t)=>{e.addNode(`text`,void 0,t.text)}}}));J(uy,{displayName:`NodeSchema<text>`,group:`Text`});var dy=C_(`html`);J(dy,{displayName:`Attr<html>`,group:`Html`});var fy=b_(`html`,e=>({atom:!0,group:`inline`,inline:!0,attrs:{value:{default:``,validate:`string`}},toDOM:t=>{let n=document.createElement(`span`),r={...e.get(dy.key)(t),"data-value":t.attrs.value,"data-type":`html`};return n.textContent=t.attrs.value,[`span`,r,t.attrs.value]},parseDOM:[{tag:`span[data-type="html"]`,getAttrs:e=>({value:e.dataset.value??``})}],parseMarkdown:{match:({type:e})=>e===`html`,runner:(e,t,n)=>{e.addNode(n,{value:t.value})}},toMarkdown:{match:e=>e.type.name===`html`,runner:(e,t)=>{e.addNode(`html`,void 0,t.attrs.value)}}}));J(fy.node,{displayName:`NodeSchema<html>`,group:`Html`}),J(fy.ctx,{displayName:`NodeSchemaCtx<html>`,group:`Html`});var py=[sv,uv,dv,_v,vv,yv,Rv,zv,wv,Tv,kv,Av,Hv,Uv,Pv,Fv,Kv,qv,Zv,Qv,ny,ry,V_,H_,q_,J_,Q_,$_,rv,iv,dy,fy,uy].flat(),my=[Ev,Jv,$v,jv,Wv,bv].flat(),hy=[W_,G_,tv,X_],gy=[pv,Dv,xv,Sv,Mv,Bv,Gv,Iv,Lv,ey,Yv,iy,oy,ay,cy,U_,ev,Y_,av,ov,q(`IsMarkSelected`,()=>e=>t=>{if(!e)return!1;let{doc:n,selection:r}=t;return n.rangeHasMark(r.from,r.to,e)}),q(`IsNoteSelected`,()=>e=>t=>e?rd(t,e).hasNode:!1),q(`ClearTextInCurrentBlock`,()=>()=>(e,t)=>{let n=e.tr,{$from:r,$to:i}=n.selection,{pos:a}=r,{pos:o}=i,s=a-r.node().content.size;return s<0?!1:(n=n.deleteRange(s,o),t?.(n),!0)}),q(`SetBlockType`,()=>e=>(t,n)=>{let{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;let a=t.tr,{from:o,to:s}=a.selection;try{a.setBlockType(o,s,r,i)}catch{return!1}return n?.(a),!0}),q(`WrapInBlockType`,()=>e=>(t,n)=>{let{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;let a=t.tr;try{let{$from:e,$to:t}=a.selection,n=e.blockRange(t),o=n&&Uc(n,r,i);if(!o)return!1;a=a.wrap(n,o)}catch{return!1}return n?.(a),!0}),q(`AddBlockType`,()=>e=>(t,n)=>{let{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;let a=t.tr;try{let e=r instanceof vs?r:r.createAndFill(i);if(!e)return!1;a.replaceSelectionWith(e)}catch{return!1}return n?.(a),!0}),q(`SelectTextNearPos`,()=>e=>(t,n)=>{let{pos:r}=e??{};if(r==null)return!1;let i=(e,t,n)=>Math.min(Math.max(e,t),n),a=t.tr;try{let e=t.doc.resolve(i(r,0,t.doc.content.size));a.setSelection(G.near(e))}catch{return!1}return n?.(a.scrollIntoView()),!0})],_y=[Ov,Nv,Vv,Cv,ly,ty,Xv,mv,K_,nv,Z_].flat(),vy=T_(`remarkAddOrderInList`,()=>()=>e=>{P_(e,`list`,e=>{if(e.ordered){let t=e.start??1;e.children.forEach((e,n)=>{e.label=n+t})}})});J(vy.plugin,{displayName:`Remark<remarkAddOrderInListPlugin>`,group:`Remark`}),J(vy.options,{displayName:`RemarkConfig<remarkAddOrderInListPlugin>`,group:`Remark`});var yy=T_(`remarkLineBreak`,()=>()=>e=>{let t=/[\t ]*(?:\r?\n|\r)/g;P_(e,`text`,(e,n,r)=>{if(!e.value||typeof e.value!=`string`)return;let i=[],a=0;t.lastIndex=0;let o=t.exec(e.value);for(;o;){let n=o.index;a!==n&&i.push({type:`text`,value:e.value.slice(a,n)}),i.push({type:`break`,data:{isInline:!0}}),a=n+o[0].length,o=t.exec(e.value)}if(i.length>0&&r&&typeof n==`number`)return a<e.value.length&&i.push({type:`text`,value:e.value.slice(a)}),r.children.splice(n,1,...i),n+i.length})});J(yy.plugin,{displayName:`Remark<remarkLineBreak>`,group:`Remark`}),J(yy.options,{displayName:`RemarkConfig<remarkLineBreak>`,group:`Remark`});var by=T_(`remarkInlineLink`,()=>z_);J(by.plugin,{displayName:`Remark<remarkInlineLinkPlugin>`,group:`Remark`}),J(by.options,{displayName:`RemarkConfig<remarkInlineLinkPlugin>`,group:`Remark`});var xy=e=>!!e.children,Sy=e=>e.type===`html`;function Cy(e,t){return n(e,0,null)[0];function n(e,r,i){if(xy(e)){let t=[];for(let r=0,i=e.children.length;r<i;r++){let i=e.children[r];if(i){let a=n(i,r,e);if(a)for(let e=0,n=a.length;e<n;e++){let n=a[e];n&&t.push(n)}}}e.children=t}return t(e,r,i)}}var wy=[`root`,`blockquote`,`listItem`],Ty=T_(`remarkHTMLTransformer`,()=>()=>e=>{Cy(e,(e,t,n)=>(Sy(e)&&n&&wy.includes(n.type)&&(e.children=[{...e}],delete e.value,e.type=`paragraph`),[e]))});J(Ty.plugin,{displayName:`Remark<remarkHtmlTransformer>`,group:`Remark`}),J(Ty.options,{displayName:`RemarkConfig<remarkHtmlTransformer>`,group:`Remark`});var Ey=T_(`remarkMarker`,()=>()=>(e,t)=>{let n=e=>t.value.charAt(e.position.start.offset);P_(e,e=>[`strong`,`emphasis`].includes(e.type),e=>{e.marker=n(e)})});J(Ey.plugin,{displayName:`Remark<remarkMarker>`,group:`Remark`}),J(Ey.options,{displayName:`RemarkConfig<remarkMarker>`,group:`Remark`});var Dy=g_(()=>{let e=!1,t=new Kl({key:new Yl(`MILKDOWN_INLINE_NODES_CURSOR`),state:{init(){return!1},apply(e){if(!e.selection.empty)return!1;let t=e.selection.$from,n=t.nodeBefore,r=t.nodeAfter;return!!(n&&r&&n.isInline&&!n.isText&&r.isInline&&!r.isText)}},props:{handleDOMEvents:{compositionend:(n,r)=>e?(e=!1,requestAnimationFrame(()=>{if(t.getState(n.state)){let e=n.state.selection.from;r.preventDefault(),n.dispatch(n.state.tr.insertText(r.data||``,e))}}),!0):!1,compositionstart:n=>(t.getState(n.state)&&(e=!0),!1),beforeinput:(n,r)=>{if(t.getState(n.state)&&r instanceof InputEvent&&r.data&&!e){let e=n.state.selection.from;return r.preventDefault(),n.dispatch(n.state.tr.insertText(r.data||``,e)),!0}return!1}},decorations(e){if(t.getState(e)){let t=e.selection.$from.pos,n=document.createElement(`span`),r=ih.widget(t,n,{side:-1}),i=document.createElement(`span`),a=ih.widget(t,i);return setTimeout(()=>{n.contentEditable=`true`,i.contentEditable=`true`}),sh.create(e.doc,[r,a])}return sh.empty}}});return t});J(Dy,{displayName:`Prose<inlineNodesCursorPlugin>`,group:`Prose`});var Oy=g_(e=>new Kl({key:new Yl(`MILKDOWN_HARDBREAK_MARKS`),appendTransaction:(t,n,r)=>{if(!t.length)return;let[i]=t;if(!i)return;let[a]=i.steps;if(i.getMeta(`hardbreak`)){if(!(a instanceof Pc))return;let{from:t}=a;return r.tr.setNodeMarkup(t,zv.type(e),void 0,[])}if(a instanceof Ac){let t=r.tr,{from:n,to:i}=a;return r.doc.nodesBetween(n,i,(n,r)=>{n.type===zv.type(e)&&(t=t.setNodeMarkup(r,zv.type(e),void 0,[]))}),t}}}));J(Oy,{displayName:`Prose<hardbreakClearMarkPlugin>`,group:`Prose`});var ky=y_([`table`,`code_block`],`hardbreakFilterNodes`);J(ky,{displayName:`Ctx<hardbreakFilterNodes>`,group:`Prose`});var Ay=g_(e=>{let t=e.get(ky.key);return new Kl({key:new Yl(`MILKDOWN_HARDBREAK_FILTER`),filterTransaction:(e,n)=>{let r=e.getMeta(`hardbreak`),[i]=e.steps;if(r&&i){let{from:e}=i,r=n.doc.resolve(e),a=r.depth,o=!0;for(;a>0;)t.includes(r.node(a).type.name)&&(o=!1),a--;return o}return!0}})});J(Ay,{displayName:`Prose<hardbreakFilterPlugin>`,group:`Prose`});var jy=g_(e=>{let t=new Yl(`MILKDOWN_HEADING_ID`),n=n=>{if(n.composing)return;let r=e.get(_v.key),i=n.state.tr.setMeta(`addToHistory`,!1),a=!1,o={};n.state.doc.descendants((n,s)=>{if(n.type===yv.type(e)){if(n.textContent.trim().length===0)return;let e=n.attrs,c=r(n);o[c]?(o[c]+=1,c+=`-#${o[c]}`):o[c]=1,e.id!==c&&(a=!0,i.setMeta(t,!0).setNodeMarkup(s,void 0,{...e,id:c}))}}),a&&n.dispatch(i)};return new Kl({key:t,view:e=>(n(e),{update:(e,t)=>{e.state.doc.eq(t.doc)||n(e)}})})});J(jy,{displayName:`Prose<syncHeadingIdPlugin>`,group:`Prose`});var My=g_(e=>new Kl({key:new Yl(`MILKDOWN_KEEP_LIST_ORDER`),appendTransaction:(t,n,r)=>{if(!r.selection||t.some(e=>e.getMeta(`addToHistory`)===!1||!e.isGeneric))return null;let i=Qv.type(e),a=qv.type(e),o=ry.type(e),s=(e,t,n=1)=>{let r=!1,i=`${t+n}.`;return e.label!==i&&(e.label=i,r=!0),r},c=r.tr,l=!1;return r.doc.descendants((e,t,n,r)=>{if(e.type===a){let n=e.maybeChild(0);n?.type===o&&n.attrs.listType===`ordered`&&(l=!0,c.setNodeMarkup(t,i,{spread:`true`}),e.descendants((e,t,n,r)=>{if(e.type===o){let n={...e.attrs};s(n,r)&&(c=c.setNodeMarkup(t,void 0,n))}return!1}))}else if(e.type===o&&n?.type===i){let i={...e.attrs},a=!1;i.listType!==`ordered`&&(i.listType=`ordered`,a=!0),n?.maybeChild(0)&&(a=s(i,r,n?.attrs.order??1)),a&&(c=c.setNodeMarkup(t,void 0,i),l=!0)}}),l?c.setMeta(`addToHistory`,!1):null}}));J(My,{displayName:`Prose<syncListOrderPlugin>`,group:`Prose`});var Ny=[py,my,hy,gy,_y,[Oy,ky,Ay,Dy,vy,by,yy,Ty,Ey,lv,jy,My].flat()].flat(),Py,Fy;if(typeof WeakMap<`u`){let e=new WeakMap;Py=t=>e.get(t),Fy=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;Py=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},Fy=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var Iy=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return Py(e)||Fy(e,Ly(e))}};function Ly(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=Ry(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new Iy(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&zy(s,o,e),s}function Ry(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function zy(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r==null||c.colwidth&&c.colwidth[n]==r||((s||=By(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function By(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function Vy(e,t){if(typeof e==`string`)return{};let n=e.getAttribute(`data-colwidth`),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(`,`).map(e=>Number(e)):null,i=Number(e.getAttribute(`colspan`)||1),a={colspan:i,rowspan:Number(e.getAttribute(`rowspan`)||1),colwidth:r&&r.length==i?r:null};for(let n in t){let r=t[n].getFromDOM,i=r&&r(e);i!=null&&(a[n]=i)}return a}function Hy(e,t){let n={};e.attrs.colspan!=1&&(n.colspan=e.attrs.colspan),e.attrs.rowspan!=1&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n[`data-colwidth`]=e.attrs.colwidth.join(`,`));for(let r in t){let i=t[r].setDOMAttr;i&&i(e.attrs[r],n)}return n}function Uy(e){if(e!==null){if(!Array.isArray(e))throw TypeError(`colwidth must be null or an array`);for(let t of e)if(typeof t!=`number`)throw TypeError(`colwidth must be null or an array of numbers`)}}function Wy(e){let t=e.cellAttributes||{},n={colspan:{default:1,validate:`number`},rowspan:{default:1,validate:`number`},colwidth:{default:null,validate:Uy}};for(let e in t)n[e]={default:t[e].default,validate:t[e].validate};return{table:{content:`table_row+`,tableRole:`table`,isolating:!0,group:e.tableGroup,parseDOM:[{tag:`table`}],toDOM(){return[`table`,[`tbody`,0]]}},table_row:{content:`(table_cell | table_header)*`,tableRole:`row`,parseDOM:[{tag:`tr`}],toDOM(){return[`tr`,0]}},table_cell:{content:e.cellContent,attrs:n,tableRole:`cell`,isolating:!0,parseDOM:[{tag:`td`,getAttrs:e=>Vy(e,t)}],toDOM(e){return[`td`,Hy(e,t),0]}},table_header:{content:e.cellContent,attrs:n,tableRole:`header_cell`,isolating:!0,parseDOM:[{tag:`th`,getAttrs:e=>Vy(e,t)}],toDOM(e){return[`th`,Hy(e,t),0]}}}}function Gy(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var Ky=new Yl(`selectingCells`);function qy(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function Jy(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function Yy(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=qy(t.$head)||Xy(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function Xy(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function Zy(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function Qy(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function $y(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function eb(e,t,n){let r=e.node(-1),i=Iy.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function tb(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function nb(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function rb(e,t,n){let r=Gy(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var ib=class e extends W{constructor(e,t=e){let n=e.node(-1),r=Iy.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new Dl(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(Zy(r)&&Zy(i)&&$y(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return G.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=Iy.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=tb(e,0,l)),u>0&&(e=tb(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(H.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new U(H.from(o),1,1)}replace(e,t=U.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?U.empty:t)}let i=W.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new U(H.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=Iy.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=Iy.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=Iy.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=Iy.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new ab(this.$anchorCell.pos,this.$headCell.pos)}};ib.prototype.visible=!1,W.jsonID(`cell`,ib);var ab=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&$y(t,n)?new ib(t,n):W.near(n,1)}};function ob(e){if(!(e.selection instanceof ib))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(ih.node(n,n+e.nodeSize,{class:`selectedCell`}))}),sh.create(e.doc,t)}function sb({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function cb({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function lb(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof K&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=ib.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=ib.rowSelection(e,e)}else if(!n){let e=Iy.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=ib.create(i,t+1,n)}}else r instanceof G&&sb(r)?a=G.create(i,r.from):r instanceof G&&cb(r)&&(a=G.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var ub=new Yl(`fix-tables`);function db(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?db(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function fb(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=pb(e,t,r,n))};return t?t.doc!=e.doc&&db(t.doc,e.doc,0,r):e.doc.descendants(r),n}function pb(e,t,n,r){let i=Iy.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,tb(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=Gy(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(ub,{fixTables:!0})}function mb(e){let t=Iy.get(e),n=[],r=t.height,i=t.width;for(let a=0;a<r;a++){let r=[];for(let n=0;n<i;n++){let o=a*i+n,s=t.map[o];if(a>0){let e=o-i;if(s===t.map[e]){r.push(null);continue}}if(n>0){let e=o-1;if(s===t.map[e]){r.push(null);continue}}r.push(e.nodeAt(s))}n.push(r)}return n}function hb(e,t){let n=[],r=Iy.get(e),i=r.height,a=r.width;for(let o=0;o<i;o++){let i=e.child(o),s=[];for(let n=0;n<a;n++){let i=t[o][n];if(!i)continue;let a=r.map[o*r.width+n],c=e.nodeAt(a);if(!c)continue;let l=c.type.createChecked(i.attrs,i.content,i.marks);s.push(l)}let c=i.type.createChecked(i.attrs,s,i.marks);n.push(c)}return e.type.createChecked(e.attrs,n,e.marks)}function gb(e,t,n,r){let i=t[0]>n[0]?-1:1,a=e.splice(t[0],t.length),o=+(a.length%2==0),s;return s=r===-1&&i===1?n[0]-1:r===1&&i===-1?n[n.length-1]-o+1:i===-1?n[0]:n[n.length-1]-o,e.splice(s,0,...a),e}function _b(e){return vb(e=>e.type.spec.tableRole===`table`,e)}function vb(e,t){for(let n=t.depth;n>=0;--n){let r=t.node(n);if(e(r))return{node:r,pos:n===0?0:t.before(n),start:t.start(n),depth:n}}return null}function yb(e,t){let n=_b(t.$from);if(!n)return;let r=Iy.get(n.node);if(!(e<0||e>r.width-1))return r.cellsInRect({left:e,right:e+1,top:0,bottom:r.height}).map(e=>{let t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t,depth:n.depth+2}})}function bb(e,t){let n=_b(t.$from);if(!n)return;let r=Iy.get(n.node);if(!(e<0||e>r.height-1))return r.cellsInRect({left:0,right:r.width,top:e,bottom:e+1}).map(e=>{let t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t,depth:n.depth+2}})}function xb(e,t,n=t){let r=t,i=n;for(let n=t;n>=0;n--){let t=yb(n,e.selection);t&&t.forEach(e=>{let t=e.node.attrs.colspan+n-1;t>=r&&(r=n),t>i&&(i=t)})}for(let n=t;n<=i;n++){let t=yb(n,e.selection);t&&t.forEach(e=>{let t=e.node.attrs.colspan+n-1;e.node.attrs.colspan>1&&t>i&&(i=t)})}let a=[];for(let t=r;t<=i;t++){let n=yb(t,e.selection);n&&n.length>0&&a.push(t)}r=a[0],i=a[a.length-1];let o=yb(r,e.selection),s=bb(0,e.selection);if(!o||!s)return;let c=e.doc.resolve(o[o.length-1].pos),l;for(let t=i;t>=r;t--){let n=yb(t,e.selection);if(n&&n.length>0){for(let e=s.length-1;e>=0;e--)if(s[e].pos===n[0].pos){l=n[0];break}if(l)break}}if(l)return{$anchor:c,$head:e.doc.resolve(l.pos),indexes:a}}function Sb(e,t,n=t){let r=t,i=n;for(let n=t;n>=0;n--){let t=bb(n,e.selection);t&&t.forEach(e=>{let t=e.node.attrs.rowspan+n-1;t>=r&&(r=n),t>i&&(i=t)})}for(let n=t;n<=i;n++){let t=bb(n,e.selection);t&&t.forEach(e=>{let t=e.node.attrs.rowspan+n-1;e.node.attrs.rowspan>1&&t>i&&(i=t)})}let a=[];for(let t=r;t<=i;t++){let n=bb(t,e.selection);n&&n.length>0&&a.push(t)}r=a[0],i=a[a.length-1];let o=bb(r,e.selection),s=yb(0,e.selection);if(!o||!s)return;let c=e.doc.resolve(o[o.length-1].pos),l;for(let t=i;t>=r;t--){let n=bb(t,e.selection);if(n&&n.length>0){for(let e=s.length-1;e>=0;e--)if(s[e].pos===n[0].pos){l=n[0];break}if(l)break}}if(l)return{$anchor:c,$head:e.doc.resolve(l.pos),indexes:a}}function Cb(e){return e[0].map((t,n)=>e.map(e=>e[n]))}function wb(e){let{tr:t,originIndex:n,targetIndex:r,select:i,pos:a}=e,o=_b(t.doc.resolve(a));if(!o)return!1;let s=xb(t,n)?.indexes,c=xb(t,r)?.indexes;if(!s||!c||s.includes(r))return!1;let l=Tb(o.node,s,c,0);if(t.replaceWith(o.pos,o.pos+o.node.nodeSize,l),!i)return!0;let u=Iy.get(l),d=o.start,f=r,p=u.positionAt(u.height-1,f,l),m=t.doc.resolve(d+p),h=u.positionAt(0,f,l),g=t.doc.resolve(d+h);return t.setSelection(ib.colSelection(m,g)),!0}function Tb(e,t,n,r){let i=Cb(mb(e));return i=gb(i,t,n,r),i=Cb(i),hb(e,i)}function Eb(e){let{tr:t,originIndex:n,targetIndex:r,select:i,pos:a}=e,o=_b(t.doc.resolve(a));if(!o)return!1;let s=Sb(t,n)?.indexes,c=Sb(t,r)?.indexes;if(!s||!c||s.includes(r))return!1;let l=Db(o.node,s,c,0);if(t.replaceWith(o.pos,o.pos+o.node.nodeSize,l),!i)return!0;let u=Iy.get(l),d=o.start,f=r,p=u.positionAt(f,u.width-1,l),m=t.doc.resolve(d+p),h=u.positionAt(f,0,l),g=t.doc.resolve(d+h);return t.setSelection(ib.rowSelection(m,g)),!0}function Db(e,t,n,r){let i=mb(e);return i=gb(i,t,n,r),hb(e,i)}function Ob(e){let t=e.selection,n=Yy(e),r=n.node(-1),i=n.start(-1),a=Iy.get(r);return{...t instanceof ib?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function kb(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;rb(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,nb(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?Gy(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function Ab(e,t){if(!Jy(e))return!1;if(t){let n=Ob(e);t(kb(e.tr,n,n.left))}return!0}function jb(e,t){if(!Jy(e))return!1;if(t){let n=Ob(e);t(kb(e.tr,n,n.right))}return!0}function Mb(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,tb(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function Nb(e,t){if(!Jy(e))return!1;if(t){let n=Ob(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;Mb(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=Iy.get(e)}t(r)}return!0}function Pb(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function Fb(e,t){if(!Jy(e))return!1;if(t){let n=Ob(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;Pb(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=Iy.get(n.table)}t(r)}return!0}function Ib(e,t){return function(n,r){if(!Jy(n))return!1;let i=Yy(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof ib?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function Lb(e){return function(t,n){if(!Jy(t))return!1;if(n){let r=Gy(t.schema),i=Ob(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function Rb(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function zb(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?Lb(e):function(t,n){if(!Jy(t))return!1;if(n){let r=Gy(t.schema),i=Ob(t),a=t.tr,o=Rb(`row`,i,r),s=Rb(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}zb(`row`,{useDeprecatedLogic:!0}),zb(`column`,{useDeprecatedLogic:!0}),zb(`cell`,{useDeprecatedLogic:!0});function Bb(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function Vb(e){return function(t,n){if(!Jy(t))return!1;let r=Bb(Yy(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(G.between(e,Qy(e))).scrollIntoView())}return!0}}function Hb(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Ub(e,t){let n=e.selection;if(!(n instanceof ib))return!1;if(t){let r=e.tr,i=Gy(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new U(i,0,0))}),r.docChanged&&t(r)}return!0}function Wb(e){return(t,n)=>{let{from:r,to:i,select:a=!0,pos:o=t.selection.from}=e,s=t.tr;return Eb({tr:s,originIndex:r,targetIndex:i,select:a,pos:o})?(n?.(s),!0):!1}}function Gb(e){return(t,n)=>{let{from:r,to:i,select:a=!0,pos:o=t.selection.from}=e,s=t.tr;return wb({tr:s,originIndex:r,targetIndex:i,select:a,pos:o})?(n?.(s),!0):!1}}function Kb(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=Jb(Gy(o).row,new U(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?Jb(Gy(o).row,new U(t,n,r)).content:t);else return null;return qb(o,s)}function qb(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(H.empty),n[i]<r){let a=Gy(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(H.from(o))}return{height:t.length,width:r,rows:t}}function Jb(e,t){let n=e.createAndFill();return new Tl(n).replace(0,n.content.size,t).doc}function Yb({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(tb(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(H.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(H.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function Xb(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=Gy(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,H.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function Zb(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function Qb(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,tb(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(tb(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function $b(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=Iy.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=Iy.get(a),f=d.mapping.maps.length}Xb(d,o,a,n,l,u,f)&&p(),Zb(d,o,a,n,c,l,s,f)&&p(),Zb(d,o,a,n,c,l,u,f)&&p(),Qb(d,o,a,n,s,u,c,f)&&p(),Qb(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new U(i.rows[e-s],0,0))}p(),d.setSelection(new ib(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var ex=_d({ArrowLeft:nx(`horiz`,-1),ArrowRight:nx(`horiz`,1),ArrowUp:nx(`vert`,-1),ArrowDown:nx(`vert`,1),"Shift-ArrowLeft":rx(`horiz`,-1),"Shift-ArrowRight":rx(`horiz`,1),"Shift-ArrowUp":rx(`vert`,-1),"Shift-ArrowDown":rx(`vert`,1),Backspace:Ub,"Mod-Backspace":Ub,Delete:Ub,"Mod-Delete":Ub});function tx(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function nx(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof ib)return tx(n,r,W.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=sx(i,e,t);if(o==null)return!1;if(e==`horiz`)return tx(n,r,W.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=eb(i,e,t),s;return s=a?W.near(a,1):t<0?W.near(n.doc.resolve(i.before(-1)),-1):W.near(n.doc.resolve(i.after(-1)),1),tx(n,r,s)}}}function rx(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof ib)o=a;else{let r=sx(i,e,t);if(r==null)return!1;o=new ib(n.doc.resolve(r))}let s=eb(o.$headCell,e,t);return s?tx(n,r,new ib(o.$anchorCell,s)):!1}}function ix(e,t){let n=e.state.doc,r=qy(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new ib(r))),!0):!1}function ax(e,t,n){if(!Jy(e.state))return!1;let r=Kb(n),i=e.state.selection;if(i instanceof ib){r||={width:1,height:1,rows:[H.from(Jb(Gy(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=Iy.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=Yb(r,o.right-o.left,o.bottom-o.top),$b(e.state,e.dispatch,a,o,r),!0}if(r){let t=Yy(e.state),n=t.start(-1);return $b(e.state,e.dispatch,n,Iy.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function ox(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=cx(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof ib)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=qy(e.state.selection.$anchor))!=null&&lx(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=lx(e,n),i=Ky.getState(e.state)==null;if(!r||!$y(t,r)){if(i)r=t;else return}let a=new ib(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(Ky,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),Ky.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(Ky,-1))}function o(r){let o=r,s=Ky.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(cx(e,o.target)!=n&&(c=lx(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function sx(e,t,n){if(!(e.state.selection instanceof G))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function cx(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function lx(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&qy(e.state.doc.resolve(r))||qy(e.state.doc.resolve(i))}var ux=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),dx(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type&&(this.node=e,dx(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function dx(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var fx=new Yl(`tableColumnResizing`);function px({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=ux,lastColumnResizable:i=!0}={}){let a=new Kl({key:fx,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=Gy(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new mx(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=fx.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{hx(t,n,e,i)},mouseleave:e=>{gx(e)},mousedown:(e,r)=>{_x(e,r,t,n)}},decorations:e=>{let t=fx.getState(e);if(t&&t.activeHandle>-1)return Ex(e,t.activeHandle)},nodeViews:{}}});return a}var mx=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(fx);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return Zy(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function hx(e,t,n,r){if(!e.editable)return;let i=fx.getState(e.state);if(i&&!i.dragging){let a=yx(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=bx(e,t,`left`,n):i-t.clientX<=n&&(o=bx(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=Iy.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}Sx(e,o)}}}function gx(e){if(!e.editable)return;let t=fx.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&Sx(e,-1)}function _x(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=fx.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=vx(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(fx,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=fx.getState(e.state);r?.dragging&&(Cx(e,r.activeHandle,xx(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(fx,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=fx.getState(e.state);if(i&&i.dragging){let a=xx(i.dragging,t,n);wx(e,i.activeHandle,a,r)}}return wx(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function vx(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function yx(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function bx(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=qy(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=Iy.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function xx(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function Sx(e,t){e.dispatch(e.state.tr.setMeta(fx,{setHandle:t}))}function Cx(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=Iy.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():Tx(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function wx(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=Iy.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&dx(a,c.firstChild,c,r,s,n)}function Tx(e){return Array(e).fill(0)}function Ex(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return sh.empty;let a=Iy.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,fx.getState(e)?.dragging&&n.push(ih.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(ih.widget(s,c))}}return sh.create(e.doc,n)}function Dx({allowTableNodeSelection:e=!1}={}){return new Kl({key:Ky,state:{init(){return null},apply(e,t){let n=e.getMeta(Ky);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:ob,handleDOMEvents:{mousedown:ox},createSelectionBetween(e){return Ky.getState(e.state)==null?null:e.state.selection},handleTripleClick:ix,handleKeyDown:ex,handlePaste:ax},appendTransaction(t,n,r){return lb(r,fb(r,n),e)}})}var Ox=typeof navigator<`u`?navigator:null,kx=Ox&&Ox.userAgent||``,Ax=/Edge\/(\d+)/.exec(kx),jx=/MSIE \d/.exec(kx),Mx=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(kx),Nx=!(jx||Mx||Ax)&&!!Ox&&/Apple Computer/.test(Ox.vendor),Px=new Yl(`safari-ime-span`),Fx=!1,Ix={key:Px,props:{decorations:Lx,handleDOMEvents:{compositionstart:()=>{Fx=!0},compositionend:()=>{Fx=!1}}}};function Lx(e){let{$from:t,$to:n,to:r}=e.selection;if(Fx&&t.sameParent(n)){let t=ih.widget(r,Rx,{ignoreSelection:!0,key:`safari-ime-span`});return sh.create(e.doc,[t])}}function Rx(e){let t=e.dom.ownerDocument.createElement(`span`);return t.className=`ProseMirror-safari-ime-span`,t}var zx=new Kl(Nx?Ix:{key:Px});function Bx(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Vx(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Hx(e,t,n){let r=Ji((n||{}).ignore||[]),i=Ux(t),a=-1;for(;++a<i.length;)ia(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Ux(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Wx(e[0]),Gx(e[1])])}return t}function Wx(e){return typeof e==`string`?new RegExp(Vx(e),`g`):e}function Gx(e){return typeof e==`function`?e:function(){return e}}var Kx=`phrasing`,qx=[`autolink`,`link`,`image`,`label`];function Jx(){return{transforms:[nS],enter:{literalAutolink:Xx,literalAutolinkEmail:Zx,literalAutolinkHttp:Zx,literalAutolinkWww:Zx},exit:{literalAutolink:tS,literalAutolinkEmail:eS,literalAutolinkHttp:Qx,literalAutolinkWww:$x}}}function Yx(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Kx,notInConstruct:qx},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Kx,notInConstruct:qx},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Kx,notInConstruct:qx}]}}function Xx(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Zx(e){this.config.enter.autolinkProtocol.call(this,e)}function Qx(e){this.config.exit.autolinkProtocol.call(this,e)}function $x(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function eS(e){this.config.exit.autolinkEmail.call(this,e)}function tS(e){this.exit(e)}function nS(e){Hx(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rS],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,iS]],{ignore:[`link`,`linkReference`]})}function rS(e,t,n,r,i){let a=``;if(!sS(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!aS(n)))return!1;let o=oS(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function iS(e,t,n,r){return!sS(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function aS(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function oS(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Bx(e,`(`),a=Bx(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function sS(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Kt(n)||Gt(n))&&(!t||n!==47)}_S.peek=gS;function cS(){this.buffer()}function lS(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function uS(){this.buffer()}function dS(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function fS(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Lt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function pS(e){this.exit(e)}function mS(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Lt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hS(e){this.exit(e)}function gS(){return`[`}function _S(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function vS(){return{enter:{gfmFootnoteCallString:cS,gfmFootnoteCall:lS,gfmFootnoteDefinitionLabelString:uS,gfmFootnoteDefinition:dS},exit:{gfmFootnoteCallString:fS,gfmFootnoteCall:pS,gfmFootnoteDefinitionLabelString:mS,gfmFootnoteDefinition:hS}}}function yS(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:_S},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
47
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?xS:bS))),s(),o}}function bS(e,t,n){return t===0?e:xS(e,t,n)}function xS(e,t,n){return(n?``:` `)+e}var SS=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];DS.peek=OS;function CS(){return{canContainEols:[`delete`],enter:{strikethrough:TS},exit:{strikethrough:ES}}}function wS(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:SS}],handlers:{delete:DS}}}function TS(e){this.enter({type:`delete`,children:[]},e)}function ES(e){this.exit(e)}function DS(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function OS(){return`~`}function kS(e){return e.length}function AS(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||kS,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=jS(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=MS(r[d]);else{let e=MS(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding===!1||n.alignDelimiters===!1&&i===``||n.delimiterStart===!1&&!d||r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
48
+ `)}function jS(e){return e==null?``:String(e)}function MS(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function NS(){return{enter:{table:PS,tableData:RS,tableHeader:RS,tableRow:IS},exit:{codeText:zS,table:FS,tableData:LS,tableHeader:LS,tableRow:LS}}}function PS(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function FS(e){this.exit(e),this.data.inTable=void 0}function IS(e){this.enter({type:`tableRow`,children:[]},e)}function LS(e){this.exit(e)}function RS(e){this.enter({type:`tableCell`,children:[]},e)}function zS(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,BS));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function BS(e,t){return t===`|`?t:e}function VS(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
49
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
50
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return AS(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Ra.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function HS(){return{exit:{taskListCheckValueChecked:WS,taskListCheckValueUnchecked:WS,paragraph:GS}}}function US(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:KS}}}function WS(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function GS(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function KS(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Ra.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function qS(){return[Jx(),vS(),CS(),NS(),HS()]}function JS(e){return{extensions:[Yx(),yS(e),wS(),VS(e),US()]}}var YS={tokenize:lC,partial:!0},XS={tokenize:uC,partial:!0},ZS={tokenize:dC,partial:!0},QS={tokenize:fC,partial:!0},$S={tokenize:pC,partial:!0},eC={name:`wwwAutolink`,tokenize:sC,previous:mC},tC={name:`protocolAutolink`,tokenize:cC,previous:hC},nC={name:`emailAutolink`,tokenize:oC,previous:gC},rC={};function iC(){return{text:rC}}for(var aC=48;aC<123;)rC[aC]=nC,aC++,aC===58?aC=65:aC===91&&(aC=97);rC[43]=nC,rC[45]=nC,rC[46]=nC,rC[95]=nC,rC[72]=[nC,tC],rC[104]=[nC,tC],rC[87]=[nC,eC],rC[119]=[nC,eC];function oC(e,t,n){let r=this,i,a;return o;function o(t){return!_C(t)||!gC.call(r,r.previous)||vC(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return _C(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check($S,u,l)(t):t===45||t===95||zt(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Rt(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function sC(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!mC.call(r,r.previous)||vC(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(YS,e.attempt(XS,e.attempt(ZS,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function cC(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&hC.call(r,r.previous)&&!vC(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Rt(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Vt(t)||L(t)||Kt(t)||Gt(t)?n(t):e.attempt(XS,e.attempt(ZS,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function lC(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function uC(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(QS,c,s)(t):t===null||L(t)||Kt(t)||t!==45&&Gt(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function dC(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(QS,t,a)(o):o===null||L(o)||Kt(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function fC(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||L(o)||Kt(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||L(e)||Kt(e)?t(e):r(e)}function a(e){return Rt(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Rt(t)?(e.consume(t),o):n(t)}}function pC(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return zt(e)?n(e):t(e)}}function mC(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||L(e)}function hC(e){return!Rt(e)}function gC(e){return!(e===47||_C(e))}function _C(e){return e===43||e===45||e===46||e===95||zt(e)}function vC(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var yC={tokenize:DC,partial:!0};function bC(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:wC,continuation:{tokenize:TC},exit:EC}},text:{91:{name:`gfmFootnoteCall`,tokenize:CC},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:xC,resolveTo:SC}}}}function xC(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Lt(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function SC(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function CC(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||L(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Lt(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return L(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function wC(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||L(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Lt(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return L(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),z(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function TC(e,t,n){return e.check(ln,t,e.attempt(yC,t,n))}function EC(e){e.exit(`gfmFootnoteDefinition`)}function DC(e,t,n){let r=this;return z(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function OC(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&At(o,o.length,0,tn(s,e.slice(r+1,n),t)),At(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),At(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=en(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=en(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var kC=class{constructor(){this.map=[]}add(e,t,n){AC(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function AC(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function jC(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function MC(){return{flow:{null:{name:`table`,tokenize:NC,resolveAll:PC}}}}function NC(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):I(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):R(t)?z(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||L(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,R(t)?z(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return R(t)?z(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||I(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return R(t)?z(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||I(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||I(n)?(e.exit(`tableRow`),t(n)):R(n)?z(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||L(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function PC(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new kC;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(IC(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=FC(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=FC(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=FC(f,t,o,i,n,d)):(o[0]=o[1],d=FC(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&IC(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=jC(t.events,n))}return e}function FC(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},LC(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=LC(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=LC(t.events,n[2]),a=LC(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},LC(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function IC(e,t,n,r,i){let a=[],o=LC(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function LC(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var RC={name:`tasklistCheck`,tokenize:BC};function zC(){return{text:{91:RC}}}function BC(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return L(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return I(r)?t(r):R(r)?e.check({tokenize:VC},t,n)(r):n(r)}}function VC(e,t,n){return z(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function HC(e){return Nt([iC(),bC(),OC(e),MC(),zC()])}var UC={};function WC(e){let t=this,n=e||UC,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(HC(n)),a.push(qS()),o.push(JS(n))}function Y(e,t){return Object.assign(e,{meta:{package:`@milkdown/preset-gfm`,...t}}),e}var GC=w_(`strike_through`);Y(GC,{displayName:`Attr<strikethrough>`,group:`Strikethrough`});var KC=x_(`strike_through`,e=>({parseDOM:[{tag:`del`},{style:`text-decoration`,getAttrs:e=>e===`line-through`}],toDOM:t=>[`del`,e.get(GC.key)(t)],parseMarkdown:{match:e=>e.type===`delete`,runner:(e,t,n)=>{e.openMark(n),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name===`strike_through`,runner:(e,t)=>{e.withMark(t,`delete`)}}}));Y(KC.mark,{displayName:`MarkSchema<strikethrough>`,group:`Strikethrough`}),Y(KC.ctx,{displayName:`MarkSchemaCtx<strikethrough>`,group:`Strikethrough`});var qC=q(`ToggleStrikeThrough`,e=>()=>Tu(KC.type(e)));Y(qC,{displayName:`Command<ToggleStrikethrough>`,group:`Strikethrough`});var JC=f_(e=>Xu(/(?<![\w:/])(~{1,2})(.+?)\1(?!\w|\/)/,KC.type(e)));Y(JC,{displayName:`InputRule<strikethrough>`,group:`Strikethrough`});var YC=S_(`strikeThroughKeymap`,{ToggleStrikethrough:{shortcuts:`Mod-Alt-x`,command:e=>{let t=e.get(xg);return()=>t.call(qC.key)}}});Y(YC.ctx,{displayName:`KeymapCtx<strikethrough>`,group:`Strikethrough`}),Y(YC.shortcuts,{displayName:`Keymap<strikethrough>`,group:`Strikethrough`});var XC=Wy({tableGroup:`block`,cellContent:`paragraph`,cellAttributes:{alignment:{default:`left`,getFromDOM:e=>e.style.textAlign||`left`,setDOMAttr:(e,t)=>{t.style=`text-align: ${e||`left`}`}}}}),ZC=b_(`table`,()=>({...XC.table,content:`table_header_row table_row+`,disableDropCursor:!0,parseMarkdown:{match:e=>e.type===`table`,runner:(e,t,n)=>{let r=t.align,i=t.children.map((e,t)=>({...e,align:r,isHeader:t===0}));e.openNode(n),e.next(i),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`table`,runner:(e,t)=>{let n=t.content.firstChild?.content;if(!n)return;let r=[];n.forEach(e=>{r.push(e.attrs.alignment)}),e.openNode(`table`,void 0,{align:r}),e.next(t.content),e.closeNode()}}}));Y(ZC.node,{displayName:`NodeSchema<table>`,group:`Table`}),Y(ZC.ctx,{displayName:`NodeSchemaCtx<table>`,group:`Table`});var QC=b_(`table_header_row`,()=>({...XC.table_row,disableDropCursor:!0,content:`(table_header)*`,parseDOM:[{tag:`tr[data-is-header]`},{tag:`tr`,getAttrs:e=>e instanceof HTMLElement&&e.querySelector(`th`)?{}:!1}],toDOM(){return[`tr`,{"data-is-header":!0},0]},parseMarkdown:{match:e=>!!(e.type===`tableRow`&&e.isHeader),runner:(e,t,n)=>{let r=t.align,i=t.children.map((e,n)=>({...e,align:r[n],isHeader:t.isHeader}));e.openNode(n),e.next(i),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`table_header_row`,runner:(e,t)=>{t.content.size!==0&&(e.openNode(`tableRow`,void 0,{isHeader:!0}),e.next(t.content),e.closeNode())}}}));Y(QC.node,{displayName:`NodeSchema<tableHeaderRow>`,group:`Table`}),Y(QC.ctx,{displayName:`NodeSchemaCtx<tableHeaderRow>`,group:`Table`});var $C=b_(`table_row`,()=>({...XC.table_row,disableDropCursor:!0,content:`(table_cell)*`,parseMarkdown:{match:e=>e.type===`tableRow`,runner:(e,t,n)=>{let r=t.align,i=t.children.map((e,t)=>({...e,align:r[t]}));e.openNode(n),e.next(i),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`table_row`,runner:(e,t)=>{t.content.size!==0&&(e.openNode(`tableRow`),e.next(t.content),e.closeNode())}}}));Y($C.node,{displayName:`NodeSchema<tableRow>`,group:`Table`}),Y($C.ctx,{displayName:`NodeSchemaCtx<tableRow>`,group:`Table`});var ew=b_(`table_cell`,()=>({...XC.table_cell,disableDropCursor:!0,parseMarkdown:{match:e=>e.type===`tableCell`&&!e.isHeader,runner:(e,t,n)=>{let r=t.align;e.openNode(n,{alignment:r}).openNode(e.schema.nodes.paragraph).next(t.children).closeNode().closeNode()}},toMarkdown:{match:e=>e.type.name===`table_cell`,runner:(e,t)=>{e.openNode(`tableCell`).next(t.content).closeNode()}}}));Y(ew.node,{displayName:`NodeSchema<tableCell>`,group:`Table`}),Y(ew.ctx,{displayName:`NodeSchemaCtx<tableCell>`,group:`Table`});var tw=b_(`table_header`,()=>({...XC.table_header,disableDropCursor:!0,parseMarkdown:{match:e=>e.type===`tableCell`&&!!e.isHeader,runner:(e,t,n)=>{let r=t.align;e.openNode(n,{alignment:r}),e.openNode(e.schema.nodes.paragraph),e.next(t.children),e.closeNode(),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`table_header`,runner:(e,t)=>{e.openNode(`tableCell`),e.next(t.content),e.closeNode()}}}));Y(tw.node,{displayName:`NodeSchema<tableHeader>`,group:`Table`}),Y(tw.ctx,{displayName:`NodeSchemaCtx<tableHeader>`,group:`Table`});function nw(e,t=3,n=3){let r=Array(n).fill(0).map(()=>ew.type(e).createAndFill()),i=Array(n).fill(0).map(()=>tw.type(e).createAndFill()),a=Array(t).fill(0).map((t,n)=>n===0?QC.type(e).create(null,i):$C.type(e).create(null,r));return ZC.type(e).create(null,a)}function rw(e){return(t,n)=>r=>{n??=r.selection.from;let i=r.doc.resolve(n),a=td(e=>e.type.name===`table`)(i),o=a?{node:a.node,from:a.start}:void 0,s=e===`row`;if(o){let e=Iy.get(o.node);if(t>=0&&t<(s?e.height:e.width)){let n=e.positionAt(s?t:e.height-1,s?e.width-1:t,o.node),i=r.doc.resolve(o.from+n),a=s?ib.rowSelection:ib.colSelection,c=e.positionAt(s?t:0,s?0:t,o.node),l=r.doc.resolve(o.from+c);return Zu(r.setSelection(a(i,l)))}}return r}}var iw=rw(`row`),aw=rw(`col`);function ow(e,t,{map:n,tableStart:r,table:i},a){let o=Array(a).fill(0).reduce((e,t,n)=>e+i.child(n).nodeSize,r),s=Array(n.width).fill(0).map((t,r)=>{let a=i.nodeAt(n.map[r]);return ew.type(e).createAndFill({alignment:a?.attrs.alignment})});return t.insert(o,$C.type(e).create(null,s)),t}function sw(e){let t=_b(e.$from);if(!t)return;let n=Iy.get(t.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map(e=>{let n=t.node.nodeAt(e),r=e+t.start;return{pos:r,start:r+1,node:n}})}function cw(e){let t=sw(e.selection);if(t&&t[0]){let n=e.doc.resolve(t[0].pos),r=t[t.length-1];if(r){let t=e.doc.resolve(r.pos);return Zu(e.setSelection(new ib(t,n)))}}return e}var lw=q(`GoToPrevTableCell`,()=>()=>Vb(-1));Y(lw,{displayName:`Command<goToPrevTableCellCommand>`,group:`Table`});var uw=q(`GoToNextTableCell`,()=>()=>Vb(1));Y(uw,{displayName:`Command<goToNextTableCellCommand>`,group:`Table`});var dw=q(`ExitTable`,e=>()=>(t,n)=>{if(!Jy(t))return!1;let{$head:r}=t.selection,i=ed(r,ZC.type(e));if(!i)return!1;let{to:a}=i,o=t.tr.replaceWith(a,a,dv.type(e).createAndFill());return o.setSelection(W.near(o.doc.resolve(a),1)).scrollIntoView(),n?.(o),!0});Y(dw,{displayName:`Command<breakTableCommand>`,group:`Table`});var fw=q(`InsertTable`,e=>({row:t,col:n}={})=>(r,i)=>{let{selection:a,tr:o}=r,{from:s}=a,c=nw(e,t,n),l=o.replaceSelectionWith(c),u=W.findFrom(l.doc.resolve(s),1,!0);return u&&l.setSelection(u),i?.(l),!0});Y(fw,{displayName:`Command<insertTableCommand>`,group:`Table`});var pw=q(`MoveRow`,()=>({from:e,to:t,pos:n}={})=>Wb({from:e??0,to:t??0,pos:n}));Y(pw,{displayName:`Command<moveRowCommand>`,group:`Table`});var mw=q(`MoveCol`,()=>({from:e,to:t,pos:n}={})=>Gb({from:e??0,to:t??0,pos:n}));Y(mw,{displayName:`Command<moveColCommand>`,group:`Table`});var hw=q(`SelectRow`,()=>(e={index:0})=>(t,n)=>{let{tr:r}=t;return!!n?.(iw(e.index,e.pos)(r))});Y(hw,{displayName:`Command<selectRowCommand>`,group:`Table`});var gw=q(`SelectCol`,()=>(e={index:0})=>(t,n)=>{let{tr:r}=t;return!!n?.(aw(e.index,e.pos)(r))});Y(gw,{displayName:`Command<selectColCommand>`,group:`Table`});var _w=q(`SelectTable`,()=>()=>(e,t)=>{let{tr:n}=e;return!!t?.(cw(n))});Y(_w,{displayName:`Command<selectTableCommand>`,group:`Table`});var vw=q(`DeleteSelectedCells`,()=>()=>(e,t)=>{let{selection:n}=e;if(!(n instanceof ib))return!1;let r=n.isRowSelection(),i=n.isColSelection();return r&&i?Hb(e,t):i?Nb(e,t):Fb(e,t)});Y(vw,{displayName:`Command<deleteSelectedCellsCommand>`,group:`Table`});var yw=q(`AddColBefore`,()=>()=>Ab);Y(yw,{displayName:`Command<addColBeforeCommand>`,group:`Table`});var bw=q(`AddColAfter`,()=>()=>jb);Y(bw,{displayName:`Command<addColAfterCommand>`,group:`Table`});var xw=q(`AddRowBefore`,e=>()=>(t,n)=>{if(!Jy(t))return!1;if(n){let r=Ob(t);n(ow(e,t.tr,r,r.top))}return!0});Y(xw,{displayName:`Command<addRowBeforeCommand>`,group:`Table`});var Sw=q(`AddRowAfter`,e=>()=>(t,n)=>{if(!Jy(t))return!1;if(n){let r=Ob(t);n(ow(e,t.tr,r,r.bottom))}return!0});Y(Sw,{displayName:`Command<addRowAfterCommand>`,group:`Table`});var Cw=q(`SetAlign`,()=>(e=`left`)=>Ib(`alignment`,e));Y(Cw,{displayName:`Command<setAlignCommand>`,group:`Table`});var ww=f_(e=>new Mu(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,(t,n,r,i)=>{let a=t.doc.resolve(r);if(!a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),ZC.type(e)))return null;let o=nw(e,Math.max(Number(n.groups?.row??0),2),Number(n.groups?.col)),s=t.tr.replaceRangeWith(r,i,o);return s.setSelection(G.create(s.doc,r+3)).scrollIntoView()}));Y(ww,{displayName:`InputRule<insertTableInputRule>`,group:`Table`});var Tw=p_(e=>({run:(t,n,r)=>{if(r)return t;function i(t){let n=t.childCount,r=t.lastChild?.childCount??0;if(n===0||r===0)return dv.type(e).create();let i=t.firstChild;if(!(r>0&&i&&i.childCount===0))return t;if(n>=3){let r=t.child(1),a=[];for(let t=0;t<r.childCount;t++){let n=r.child(t);a.push(tw.type(e).create(n.attrs,n.content,n.marks))}let o=i.type.create(i.attrs,a),s=[];for(let e=2;e<n;e++)s.push(t.child(e));return t.type.create(t.attrs,[o,...s])}let a=Array(r).fill(0).map(()=>tw.type(e).createAndFill()),o=new U(H.from(a),0,0),s=i.replace(0,0,o);return t.replace(0,i.nodeSize,new U(H.from(s),0,0))}function a(t){let n=$C.type(e),r=[],a=[],o=!1;function s(){if(a.length===0)return;let t=QC.type(e).createAndFill(),n=ZC.type(e).create(null,[t,...a]);r.push(i(n)),a=[]}return t.forEach(e=>{e.type===n?(o=!0,a.push(e)):(s(),r.push(e))}),s(),o?H.from(r):t}function o(t){let n=a(t),r=n!==t,s=[];return n.forEach(t=>{if(t.type===ZC.type(e)){let e=i(t);e!==t&&(r=!0),s.push(e)}else if(t.childCount>0){let e=o(t.content);e===t.content?s.push(t):(r=!0,s.push(t.copy(e)))}else s.push(t)}),r?H.from(s):t}function s(t){let n=[],r=[];t.forEach(e=>r.push(e));for(let t=0;t<r.length;t++){let i=r[t],a=r[t+1];i.type===dv.type(e)&&i.content.size===0&&a&&a.type===ZC.type(e)||n.push(i)}return n.length<r.length?H.from(n):t}let c=o(t.content);return c=s(c),new U(H.from(c),t.openStart,t.openEnd)}}));Y(Tw,{displayName:`PasteRule<table>`,group:`Table`});var Ew=S_(`tableKeymap`,{NextCell:{priority:100,shortcuts:[`Mod-]`,`Tab`],command:e=>{let t=e.get(xg);return()=>t.call(uw.key)}},PrevCell:{shortcuts:[`Mod-[`,`Shift-Tab`],command:e=>{let t=e.get(xg);return()=>t.call(lw.key)}},ExitTable:{shortcuts:[`Mod-Enter`,`Enter`],command:e=>{let t=e.get(xg);return()=>t.call(dw.key)}}});Y(Ew.ctx,{displayName:`KeymapCtx<table>`,group:`Table`}),Y(Ew.shortcuts,{displayName:`Keymap<table>`,group:`Table`});var Dw=`footnote_definition`,Ow=`footnoteDefinition`,kw=b_(`footnote_definition`,()=>({group:`block`,content:`block+`,defining:!0,attrs:{label:{default:``,validate:`string`}},parseDOM:[{tag:`dl[data-type="${Dw}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw dt(e);return{label:e.dataset.label}},contentElement:`dd`}],toDOM:e=>{let t=e.attrs.label;return[`dl`,{"data-label":t,"data-type":Dw},[`dt`,t],[`dd`,0]]},parseMarkdown:{match:({type:e})=>e===Ow,runner:(e,t,n)=>{e.openNode(n,{label:t.label}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===Dw,runner:(e,t)=>{e.openNode(Ow,void 0,{label:t.attrs.label,identifier:t.attrs.label}).next(t.content).closeNode()}}}));Y(kw.ctx,{displayName:`NodeSchemaCtx<footnodeDef>`,group:`footnote`}),Y(kw.node,{displayName:`NodeSchema<footnodeDef>`,group:`footnote`});var Aw=`footnote_reference`,jw=b_(`footnote_reference`,()=>({group:`inline`,inline:!0,atom:!0,attrs:{label:{default:``,validate:`string`}},parseDOM:[{tag:`sup[data-type="${Aw}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw dt(e);return{label:e.dataset.label}}}],toDOM:e=>{let t=e.attrs.label;return[`sup`,{"data-label":t,"data-type":Aw},t]},parseMarkdown:{match:({type:e})=>e===`footnoteReference`,runner:(e,t,n)=>{e.addNode(n,{label:t.label})}},toMarkdown:{match:e=>e.type.name===Aw,runner:(e,t)=>{e.addNode(`footnoteReference`,void 0,void 0,{label:t.attrs.label,identifier:t.attrs.label})}}}));Y(jw.ctx,{displayName:`NodeSchemaCtx<footnodeRef>`,group:`footnote`}),Y(jw.node,{displayName:`NodeSchema<footnodeRef>`,group:`footnote`});var Mw=ry.extendSchema(e=>t=>{let n=e(t);return{...n,attrs:{...n.attrs,checked:{default:null,validate:`boolean|null`}},parseDOM:[{tag:`li[data-item-type="task"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw dt(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:e.dataset.spread,checked:e.dataset.checked?e.dataset.checked===`true`:null}}},...n?.parseDOM||[]],toDOM:e=>n.toDOM&&e.attrs.checked==null?n.toDOM(e):[`li`,{"data-item-type":`task`,"data-label":e.attrs.label,"data-list-type":e.attrs.listType,"data-spread":e.attrs.spread,"data-checked":e.attrs.checked},0],parseMarkdown:{match:({type:e})=>e===`listItem`,runner:(e,t,r)=>{if(t.checked==null){n.parseMarkdown.runner(e,t,r);return}let i=t.label==null?`•`:`${t.label}.`,a=t.checked==null?null:!!t.checked,o=t.label==null?`bullet`:`ordered`,s=t.spread==null?`true`:`${t.spread}`;e.openNode(r,{label:i,listType:o,spread:s,checked:a}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`list_item`,runner:(e,t)=>{if(t.attrs.checked==null){n.toMarkdown.runner(e,t);return}let r=t.attrs.label,i=t.attrs.listType,a=t.attrs.spread===`true`,o=t.attrs.checked;e.openNode(`listItem`,void 0,{label:r,listType:i,spread:a,checked:o}),e.next(t.content),e.closeNode()}}}});Y(Mw.node,{displayName:`NodeSchema<taskListItem>`,group:`ListItem`}),Y(Mw.ctx,{displayName:`NodeSchemaCtx<taskListItem>`,group:`ListItem`});var Nw=f_(()=>new Mu(/^\[(?<checked>\s|x)\]\s$/,(e,t,n,r)=>{let i=e.doc.resolve(n),a=0,o=i.node(a);for(;o&&o.type.name!==`list_item`;)a--,o=i.node(a);if(!o||o.attrs.checked!=null)return null;let s=t.groups?.checked===`x`,c=i.before(a),l=e.tr;return l.deleteRange(n,r).setNodeMarkup(c,void 0,{...o.attrs,checked:s}),l}));Y(Nw,{displayName:`InputRule<wrapInTaskListInputRule>`,group:`ListItem`});var Pw=[YC,Ew].flat(),Fw=[ww,Nw],Iw=[JC],Lw=[Tw],Rw=g_(()=>zx);Y(Rw,{displayName:`Prose<autoInsertSpanPlugin>`,group:`Prose`}),Y(g_(()=>px({})),{displayName:`Prose<columnResizingPlugin>`,group:`Prose`});var zw=g_(()=>Dx({allowTableNodeSelection:!0}));Y(zw,{displayName:`Prose<tableEditingPlugin>`,group:`Prose`});var Bw=T_(`remarkGFM`,()=>WC);Y(Bw.plugin,{displayName:`Remark<remarkGFMPlugin>`,group:`Remark`}),Y(Bw.options,{displayName:`RemarkConfig<remarkGFMPlugin>`,group:`Remark`});var Vw=new Yl(`MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN`);function Hw(e,t){let n=0;return t.forEach((t,r,i)=>{t===e&&(n=i)}),n}var Uw=g_(()=>new Kl({key:Vw,appendTransaction:(e,t,n)=>{let r;return t.doc!==n.doc&&n.doc.descendants((e,t)=>{if(r||=n.tr,e.type.name!==`table_cell`)return;let i=n.doc.resolve(t),a=i.node(i.depth),o=i.node(i.depth-1).firstChild;if(!o)return;let s=Hw(e,a),c=o.maybeChild(s);if(!c)return;let l=c.attrs.alignment;l!==e.attrs.alignment&&r.setNodeMarkup(t,void 0,{...e.attrs,alignment:l})}),r}}));Y(Uw,{displayName:`Prose<keepTableAlignPlugin>`,group:`Prose`});var Ww=[Uw,Rw,Bw,zw].flat(),Gw=[[Mw,ZC,QC,$C,tw,ew,kw,jw,GC,KC].flat(),Fw,Lw,Iw,Pw,[uw,lw,dw,fw,pw,mw,hw,gw,_w,vw,xw,Sw,yw,bw,Cw,qC],Ww].flat(),Kw=200,qw=function(){};qw.prototype.append=function(e){return e.length?(e=qw.from(e),!this.length&&e||e.length<Kw&&this.leafAppend(e)||this.length<Kw&&e.leafPrepend(this)||this.appendInner(e)):this},qw.prototype.prepend=function(e){return e.length?qw.from(e).append(this):this},qw.prototype.appendInner=function(e){return new Yw(this,e)},qw.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?qw.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},qw.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},qw.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},qw.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},qw.from=function(e){return e instanceof qw?e:e&&e.length?new Jw(e):qw.empty};var Jw=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Kw)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Kw)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(qw);qw.empty=new Jw([]);var Yw=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(qw),Xw=500,Zw=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step)i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);else{if(i){u.push(new $w(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new $w(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1}},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new $w(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>tT&&(s=Qw(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Tc;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new $w(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new $w(i,o,l))}else r.push(new $w(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new $w(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>Xw&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new $w(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(qw.from(i.reverse()),a)}};Zw.empty=new Zw(qw.empty,0);function Qw(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var $w=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},eT=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},tT=20;function nT(e,t,n,r){let i=n.getMeta(uT),a;if(i)return i.historyState;n.getMeta(dT)&&(e=new eT(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(uT))return o.getMeta(uT).redo?new eT(e.done.addTransform(n,void 0,r,lT(t)),e.undone,iT(n.mapping.maps),e.prevTime,e.prevComposition):new eT(e.done,e.undone.addTransform(n,void 0,r,lT(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!rT(n,e.prevRanges)),s=o?aT(e.prevRanges,n.mapping):iT(n.mapping.maps);return new eT(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,lT(t)),Zw.empty,s,n.time,i??e.prevComposition)}return(a=n.getMeta(`rebased`))?new eT(e.done.rebased(n,a),e.undone.rebased(n,a),aT(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new eT(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),aT(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function rT(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function iT(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function aT(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function oT(e,t,n){let r=lT(t),i=uT.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new eT(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(uT,{redo:n,historyState:c})}var sT=!1,cT=null;function lT(e){let t=e.plugins;if(cT!=t){sT=!1,cT=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){sT=!0;break}}return sT}var uT=new Yl(`history`),dT=new Yl(`closeHistory`);function fT(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Kl({key:uT,state:{init(){return new eT(Zw.empty,Zw.empty,null,0,-1)},apply(t,n,r){return nT(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?mT:n==`historyRedo`?hT:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function pT(e,t){return(n,r)=>{let i=uT.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=oT(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var mT=pT(!1,!0),hT=pT(!0,!0),gT=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),_T=new WeakSet,vT=g_(()=>{let e=fT();return _T.add(e),e}),yT=g_(()=>gd({"Mod-z":mT,"Mod-Shift-z":hT,...gT?{}:{"Mod-y":hT}}));function bT(e){let{plugins:t}=e.state,n=t.filter(e=>!_T.has(e));n.length!==t.length&&e.updateState(e.state.reconfigure({plugins:n}).reconfigure({plugins:t}))}var xT={display:`flex`,gap:6,alignItems:`center`,padding:6,border:`1px solid #d4d4d8`,borderRadius:6,background:`#fff`,boxShadow:`0 4px 16px rgba(0,0,0,0.12)`,marginTop:6},ST={flex:1,border:`1px solid #d4d4d8`,borderRadius:4,padding:`4px 8px`,font:`inherit`,outline:`none`,minWidth:0},CT={border:`1px solid #d4d4d8`,background:`#fff`,borderRadius:4,padding:`4px 8px`,font:`inherit`,fontSize:12,cursor:`pointer`,color:`#3f3f46`,whiteSpace:`nowrap`},wT=xT,TT=ST,ET=CT;function DT({initialUrl:e,isEdit:t,onApply:n,onRemove:r,onClose:i}){let[a,o]=(0,j.useState)(e),s=()=>{let e=a.trim();e!==``&&n(e)};return(0,M.jsxs)(`div`,{style:wT,"data-mdx-action":`link`,onMouseDown:e=>e.stopPropagation(),children:[(0,M.jsx)(`input`,{style:TT,autoFocus:!0,placeholder:`https://…`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),s()),e.key===`Escape`&&i()}}),(0,M.jsx)(`button`,{type:`button`,style:{...ET,background:`#2563eb`,borderColor:`#2563eb`,color:`#fff`},onMouseDown:e=>e.preventDefault(),onClick:s,children:t?`Update`:`Add`}),t&&r?(0,M.jsx)(`button`,{type:`button`,style:{...ET,color:`#dc2626`},onMouseDown:e=>e.preventDefault(),onClick:r,children:`Remove`}):null,(0,M.jsx)(`button`,{type:`button`,style:ET,onMouseDown:e=>e.preventDefault(),onClick:i,children:`Cancel`})]})}var OT={...xT,flexWrap:`wrap`},kT={display:`flex`,alignItems:`center`,gap:6,flex:`1 1 180px`,minWidth:0},AT={fontSize:11,color:`#71717a`,whiteSpace:`nowrap`},jT={display:`flex`,gap:6,marginLeft:`auto`},MT={width:48,height:48,objectFit:`contain`,border:`1px solid #e4e4e7`,borderRadius:4,background:`#fafafa`,flexShrink:0};function NT({mode:e,initialAlt:t,initialCaption:n,previewSrc:r,onReplace:i,onApply:a,onClose:o}){let[s,c]=(0,j.useState)(t),[l,u]=(0,j.useState)(n),d=()=>a(s.trim(),l.trim()),f=e=>{e.key===`Enter`&&(e.preventDefault(),d()),e.key===`Escape`&&o()};return(0,M.jsxs)(`div`,{style:OT,"data-mdx-action":`image`,onMouseDown:e=>e.stopPropagation(),children:[r===``?null:(0,M.jsx)(`img`,{src:r,alt:``,style:MT,"data-mdx-image-preview":``}),i?(0,M.jsx)(`button`,{type:`button`,style:CT,onMouseDown:e=>e.preventDefault(),onClick:i,children:`Replace image`}):null,(0,M.jsxs)(`label`,{style:kT,children:[(0,M.jsx)(`span`,{style:AT,children:`Alt`}),(0,M.jsx)(`input`,{style:ST,autoFocus:!0,placeholder:`Alt text for screen readers`,value:s,onChange:e=>c(e.currentTarget.value),onKeyDown:f})]}),(0,M.jsxs)(`label`,{style:kT,children:[(0,M.jsx)(`span`,{style:AT,children:`Caption`}),(0,M.jsx)(`input`,{style:ST,placeholder:`Caption / source (optional)`,value:l,onChange:e=>u(e.currentTarget.value),onKeyDown:f})]}),(0,M.jsxs)(`div`,{style:jT,children:[(0,M.jsx)(`button`,{type:`button`,style:{...CT,background:`#2563eb`,borderColor:`#2563eb`,color:`#fff`},onMouseDown:e=>e.preventDefault(),onClick:d,children:e===`insert`?`Insert`:`Save`}),(0,M.jsx)(`button`,{type:`button`,style:CT,onMouseDown:e=>e.preventDefault(),onClick:o,children:`Cancel`})]})]})}var PT={display:`flex`,gap:16,padding:16,overflowY:`auto`},FT={width:220,height:220,flexShrink:0,objectFit:`contain`,border:`1px solid #e4e4e7`,borderRadius:8,background:`#fafafa`},IT={display:`flex`,flexDirection:`column`,gap:8,flex:1,minWidth:0},LT={border:`1px solid #d4d4d8`,borderRadius:6,padding:`6px 10px`,font:`inherit`,outline:`none`},RT={border:`1px solid #d4d4d8`,background:`#fff`,borderRadius:6,padding:`6px 12px`,font:`inherit`,cursor:`pointer`,color:`#3f3f46`},zT={...RT,background:`#2563eb`,border:`1px solid #2563eb`,color:`#fff`};function BT({item:e,save:t,onSaved:n,onCancel:r}){let[i,a]=(0,j.useState)(e.annotation??``),[o,s]=(0,j.useState)(!1),[c,l]=(0,j.useState)(null),u=async()=>{if(o)return;let e=i.trim();s(!0),l(null);try{let r=await t(e);if(r.success){n(e);return}l(r.error??`Failed to save the alt text`)}catch(e){l(e instanceof Error?e.message:`Failed to save the alt text`)}s(!1)};return(0,M.jsxs)(`div`,{style:PT,"data-cms-media-annotation":e.id,children:[(0,M.jsx)(`img`,{src:e.thumbnailUrl??e.url,alt:``,style:FT}),(0,M.jsxs)(`div`,{style:IT,children:[(0,M.jsx)(`strong`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},title:e.filename,children:e.filename}),(0,M.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4,fontSize:12,color:`#52525b`},children:[`Default alt text`,(0,M.jsx)(`input`,{style:LT,autoFocus:!0,placeholder:`Describe the image for screen readers`,value:i,disabled:o,onChange:e=>a(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),u()),e.key===`Escape`&&r()}})]}),(0,M.jsx)(`div`,{style:{fontSize:12,color:`#71717a`},children:`Prefilled as the alt text when this image is inserted. Images already in the content keep their own.`}),c?(0,M.jsx)(`div`,{style:{fontSize:12,color:`#dc2626`},children:c}):null,(0,M.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,M.jsx)(`button`,{type:`button`,style:zT,disabled:o,onClick:()=>void u(),children:o?`Saving…`:`Save`}),(0,M.jsx)(`button`,{type:`button`,style:RT,disabled:o,onClick:r,children:`Cancel`})]})]})]})}function VT(e){return typeof e!=`object`||!e?!1:`status`in e&&e.status===501||`code`in e&&e.code===`unsupported`}var HT=60,UT=200,WT=200;function GT(e,t){return{folder:e,type:t,cursor:void 0,seen:new Set,pages:0,busy:!1,failed:!1}}function KT(e,t){if(!e.hasMore)return{cursor:void 0,stalled:!1};let n=e.cursor;return n===void 0||t.seen.has(n)||t.pages>=WT?{cursor:void 0,stalled:!0}:(t.seen.add(n),{cursor:n,stalled:!1})}function qT(e,t){if(t.length===0)return e;let n=new Map(e.map(e=>[e.path,e])),r=!1;for(let e of t)n.has(e.path)||(n.set(e.path,e),r=!0);return r?[...n.values()].sort((e,t)=>e.name.localeCompare(t.name)):e}var JT=[{value:`all`,label:`All`},{value:`photo`,label:`Photos`},{value:`graphic`,label:`Graphics`},{value:`video`,label:`Videos`},{value:`document`,label:`Documents`}],YT={position:`fixed`,inset:0,background:`rgba(0,0,0,0.45)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1100},XT={width:`min(760px, 94vw)`,maxHeight:`82vh`,display:`flex`,flexDirection:`column`,background:`#fff`,border:`1px solid #d4d4d8`,borderRadius:12,boxShadow:`0 16px 48px rgba(0,0,0,0.28)`,overflow:`hidden`,fontSize:13,color:`#27272a`},ZT={display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`12px 16px`,borderBottom:`1px solid #ececed`},QT={display:`flex`,flexDirection:`column`,gap:10,padding:`12px 16px`,borderBottom:`1px solid #ececed`},$T={display:`flex`,alignItems:`center`,gap:8},eE={flex:1,border:`1px solid #d4d4d8`,borderRadius:6,padding:`6px 10px`,font:`inherit`,outline:`none`},tE={border:`1px solid #d4d4d8`,background:`#fff`,borderRadius:6,padding:`6px 12px`,font:`inherit`,cursor:`pointer`,color:`#3f3f46`,whiteSpace:`nowrap`},nE={...tE,background:`#2563eb`,borderColor:`#2563eb`,color:`#fff`},rE={display:`grid`,gridTemplateColumns:`repeat(4, 1fr)`,gridAutoRows:`max-content`,gap:10,padding:16,overflowY:`auto`},iE={position:`relative`},aE={position:`relative`,width:`100%`,aspectRatio:`1 / 1`,border:`1px solid #e4e4e7`,borderRadius:8,overflow:`hidden`,cursor:`pointer`,background:`#fafafa`,padding:0,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:6},oE={position:`absolute`,top:6,right:6,border:`1px solid #d4d4d8`,background:`rgba(255,255,255,0.92)`,borderRadius:4,padding:`1px 6px`,font:`inherit`,fontSize:11,color:`#3f3f46`,cursor:`pointer`},sE={padding:32,textAlign:`center`,color:`#a1a1aa`},cE={display:`flex`,alignItems:`center`,justifyContent:`center`,gap:8,padding:`8px 16px`,borderTop:`1px solid #ececed`,fontSize:12,color:`#71717a`},lE={position:`absolute`,left:0,right:0,bottom:0,padding:`4px 6px`,fontSize:11,color:`#fff`,background:`linear-gradient(to top, rgba(0,0,0,0.65), transparent)`,textAlign:`left`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`};function uE({media:e,context:t,field:n,accept:r=`image/*,application/pdf,${E}`,onSelect:i,onClose:a}){let[o,s]=(0,j.useState)([]),[c,l]=(0,j.useState)([]),[u,d]=(0,j.useState)(``),[f,p]=(0,j.useState)(``),[m,h]=(0,j.useState)(`all`),[g,_]=(0,j.useState)(!1),[v,y]=(0,j.useState)(!1),[b,x]=(0,j.useState)(!1),[S,C]=(0,j.useState)(!1),[w,ee]=(0,j.useState)(!1),[D,te]=(0,j.useState)(0),[ne,re]=(0,j.useState)(!1),[ie,O]=(0,j.useState)(!1),[k,ae]=(0,j.useState)(null),[oe,se]=(0,j.useState)(!1),[ce,le]=(0,j.useState)(``),[ue,de]=(0,j.useState)(null),fe=(0,j.useRef)(null),pe=(0,j.useRef)(GT(``,`all`)),me=(0,j.useRef)(!0);(0,j.useEffect)(()=>(me.current=!0,()=>{me.current=!1}),[]);let he=(0,j.useCallback)(async(t,n=HT)=>{if(t.busy||pe.current!==t)return;let r=t.pages===0;t.busy=!0,t.failed=!1,r?_(!0):y(!0),ae(null);try{let i=await e.listMedia({folder:t.folder||void 0,limit:n,cursor:t.cursor,type:t.type});if(!me.current||pe.current!==t)return;t.pages+=1,te(e=>e+1),C(i.appliedType===t.type),ee(i.appliedType===t.type&&i.items.length<n),l(e=>qT(e,i.folders)),s(e=>r?i.items:[...e,...i.items]);let a=KT(i,t);t.cursor=a.cursor,x(a.cursor!==void 0),a.stalled&&ae(`Stopped loading this folder early — some files are not shown.`)}catch(e){if(!me.current||pe.current!==t)return;t.failed=!0,VT(e)?(re(!0),x(!1)):ae(e instanceof Error?e.message:`Failed to load media`)}finally{t.busy=!1,me.current&&pe.current===t&&(_(!1),y(!1))}},[e]);(0,j.useEffect)(()=>{let e=GT(u,m);pe.current=e,s([]),l([]),x(!1),C(!1),ee(!1),he(e)},[u,m,he]);let ge=f.trim().toLowerCase(),_e=ge!==``||m!==`all`,ve=_e&&(ge!==``||m!==`all`&&!S);(0,j.useEffect)(()=>{if(!ve&&!w)return;let e=pe.current;e.busy||e.failed||e.cursor===void 0||he(e,ve?UT:HT)},[ve,w,D,he]);let ye=e=>{p(``),d(e)},be=async r=>{O(!0),ae(null);try{let a=await e.uploadMedia(r,{...t,field:n,folder:u||void 0});if(a.success&&a.url){if(a.url.startsWith(`./`)){i(a.url,a.annotation??``,a.annotation);return}let e={id:a.id??a.url,url:a.url,filename:a.filename??r.name,annotation:a.annotation,annotationEditable:a.annotationEditable,contentType:r.type||`application/octet-stream`,folder:u||void 0};s(t=>[e,...t])}else ae(a.error??`Upload failed`)}catch(e){VT(e)?re(!0):ae(e instanceof Error?e.message:`Upload failed`)}finally{O(!1)}},xe=async()=>{let t=ce.trim();if(!t||!e.createFolder)return;if(/[/\\:*?"<>|]/.test(t)){ae(`Invalid folder name`);return}let n=u?`${u}/${t}`:t;try{let r=await e.createFolder(n);r.success?l(e=>[...e,{name:t,path:n}].sort((e,t)=>e.name.localeCompare(t.name))):ae(r.error??`Failed to create folder`)}catch(e){ae(e instanceof Error?e.message:`Failed to create folder`)}le(``),se(!1)},Se=e.updateMediaAnnotation?.bind(e),Ce=(e,t)=>{s(n=>n.map(n=>n.id===e?{...n,annotation:t}:n)),de(null)},we=(0,j.useMemo)(()=>{let e=T(o,m);return ge===``?e:e.filter(e=>e.filename.toLowerCase().includes(ge))},[o,m,ge]),Te=(0,j.useMemo)(()=>{if(!u)return[];let e=u.split(`/`);return e.map((t,n)=>({name:t,path:e.slice(0,n+1).join(`/`)}))},[u]),Ee=_e?[]:c;return(0,M.jsx)(`div`,{style:YT,onMouseDown:a,"data-cms-ui":``,children:(0,M.jsxs)(`div`,{style:XT,onMouseDown:e=>e.stopPropagation(),onDrop:e=>{e.preventDefault();let t=e.dataTransfer.files[0];t&&be(t)},onDragOver:e=>e.preventDefault(),children:[(0,M.jsxs)(`div`,{style:ZT,children:[(0,M.jsx)(`strong`,{style:{fontSize:15},children:`Media Library`}),(0,M.jsx)(`button`,{type:`button`,style:{...tE,border:`none`,fontSize:18,lineHeight:1,padding:2},onClick:a,"aria-label":`Close`,children:`×`})]}),(0,M.jsxs)(`div`,{style:QT,children:[Te.length>0?(0,M.jsxs)(`div`,{style:{...$T,gap:4,fontSize:12,color:`#71717a`},children:[(0,M.jsx)(`button`,{type:`button`,style:{...tE,border:`none`,padding:`0 2px`},onClick:()=>ye(``),children:`root`}),Te.map((e,t)=>(0,M.jsxs)(`span`,{style:$T,children:[(0,M.jsx)(`span`,{children:`/`}),t===Te.length-1?(0,M.jsx)(`span`,{style:{color:`#27272a`,fontWeight:600},children:e.name}):(0,M.jsx)(`button`,{type:`button`,style:{...tE,border:`none`,padding:`0 2px`},onClick:()=>ye(e.path),children:e.name})]},e.path))]}):null,(0,M.jsxs)(`div`,{style:$T,children:[(0,M.jsx)(`input`,{style:eE,placeholder:`Search files…`,value:f,onChange:e=>p(e.target.value)}),e.createFolder?(0,M.jsx)(`button`,{type:`button`,style:tE,onClick:()=>se(e=>!e),children:`New folder`}):null,(0,M.jsx)(`button`,{type:`button`,style:nE,disabled:ne||ie,onClick:()=>fe.current?.click(),children:ie?`Uploading…`:`Upload`}),(0,M.jsx)(`input`,{ref:fe,type:`file`,accept:r,style:{display:`none`},onChange:e=>{let t=e.target.files?.[0];t&&be(t),e.target.value=``}})]}),(0,M.jsx)(`div`,{style:{...$T,gap:4},children:JT.map(e=>(0,M.jsx)(`button`,{type:`button`,style:{...tE,padding:`3px 10px`,fontSize:12,...m===e.value?{background:`#2563eb`,border:`1px solid #2563eb`,color:`#fff`}:{}},onClick:()=>h(e.value),children:e.label},e.value))}),oe&&e.createFolder?(0,M.jsxs)(`div`,{style:$T,children:[(0,M.jsx)(`input`,{style:eE,autoFocus:!0,placeholder:`Folder name…`,value:ce,onChange:e=>le(e.target.value),onKeyDown:e=>{e.key===`Enter`&&xe(),e.key===`Escape`&&(se(!1),le(``))}}),(0,M.jsx)(`button`,{type:`button`,style:nE,onClick:()=>void xe(),children:`Create`})]}):null,ne?(0,M.jsx)(`div`,{style:{fontSize:12,color:`#a16207`},children:`Media uploads are not configured for this project.`}):null,k?(0,M.jsx)(`div`,{style:{fontSize:12,color:`#dc2626`},children:k}):null]}),ue&&Se?(0,M.jsx)(BT,{item:ue,save:e=>Se(ue.id,e),onSaved:e=>Ce(ue.id,e),onCancel:()=>de(null)}):g?(0,M.jsx)(`div`,{style:sE,children:`Loading…`}):Ee.length===0&&we.length===0?(0,M.jsx)(`div`,{style:sE,children:v?_e?`Searching…`:`Loading…`:_e&&b?`No matches loaded yet.`:_e?`No matching files.`:`No files yet. Upload one to get started.`}):(0,M.jsxs)(`div`,{style:rE,children:[Ee.map(e=>(0,M.jsxs)(`button`,{type:`button`,style:aE,onClick:()=>ye(e.path),title:e.name,"data-cms-media-folder":e.path,children:[(0,M.jsx)(`span`,{style:{fontSize:30},children:`📁`}),(0,M.jsx)(`span`,{style:{fontSize:12,color:`#52525b`,maxWidth:`90%`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.name})]},e.path)),we.map(e=>(0,M.jsxs)(`div`,{style:iE,children:[(0,M.jsxs)(`button`,{type:`button`,style:aE,title:e.filename,"data-cms-media-item":e.id,onClick:()=>i(e.url,e.annotation??(e.filename||`Image`),e.annotation),children:[e.contentType.startsWith(`image/`)?(0,M.jsx)(`img`,{src:e.thumbnailUrl??e.url,alt:e.annotation||e.filename,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):e.contentType.startsWith(`video/`)?(0,M.jsx)(`video`,{src:e.thumbnailUrl??e.url,muted:!0,playsInline:!0,preload:`metadata`,style:{width:`100%`,height:`100%`,objectFit:`contain`,background:`#000`}}):(0,M.jsx)(`span`,{style:{fontSize:30},children:e.contentType===`application/pdf`?`📄`:`📎`}),(0,M.jsx)(`span`,{style:lE,children:e.filename})]}),e.annotationEditable&&Se&&e.contentType.startsWith(`image/`)?(0,M.jsx)(`button`,{type:`button`,style:oE,title:`Edit the default alt text`,"data-cms-media-alt":e.id,onClick:()=>de(e),children:`Alt`}):null]},e.id))]}),!g&&!ue&&b?(0,M.jsx)(`div`,{style:cE,children:v?(0,M.jsx)(`span`,{children:ve?`Searching the whole folder… ${o.length} files scanned`:_e?`Searching…`:`Loading…`}):(0,M.jsx)(`button`,{type:`button`,style:tE,onClick:()=>void he(pe.current),children:`Load more`})}):null,(0,M.jsxs)(`div`,{style:{padding:`10px 16px`,borderTop:`1px solid #ececed`,fontSize:12,color:`#a1a1aa`,textAlign:`center`},children:[`Drag and drop a file here to upload`,u?` to ${u}`:``,`.`]})]})})}var dE=/^(https?:)?\/\/|^data:/i;function fE(e,t,n){if(t===``)return``;if(dE.test(t))return t;if(t.startsWith(`/`))return e?.mediaAssetUrl?.(t)??t;let r=n?.collection,i=n?.entry;return r===void 0||i===void 0?``:e?.mediaFileUrl?.(r,i,t)??``}var pE={bold:!1,italic:!1,strikethrough:!1,link:!1,linkHref:null,bulletList:!1,orderedList:!1,listStyle:null,blockquote:!1,heading:null,image:null};function mE(e){let{state:t}=e,{$from:n,from:r,to:i}=t.selection,a=!1,o=!1,s=!1,c=!1,l=null,u=t.storedMarks||n.marks();for(let e of u)e.type.name===`strong`&&(a=!0),e.type.name===`emphasis`&&(o=!0),e.type.name===`strike_through`&&(s=!0),e.type.name===`link`&&(c=!0,l=typeof e.attrs.href==`string`?e.attrs.href:null);r!==i&&t.doc.nodesBetween(r,i,e=>{for(let t of e.marks)t.type.name===`strong`&&(a=!0),t.type.name===`emphasis`&&(o=!0),t.type.name===`strike_through`&&(s=!0),t.type.name===`link`&&(c=!0,l=typeof t.attrs.href==`string`?t.attrs.href:null)});let d=!1,f=!1,p=null,m=!1,h=null;for(let e=n.depth;e>0;e--){let t=n.node(e);(t.type.name===`bullet_list`||t.type.name===`ordered_list`)&&(t.type.name===`bullet_list`&&(d=!0),t.type.name===`ordered_list`&&(f=!0),p===null&&(p=typeof t.attrs.listStyle==`string`?t.attrs.listStyle:null)),t.type.name===`blockquote`&&(m=!0)}if(n.parent.type.name===`heading`){let e=n.parent.attrs.level;h=typeof e==`number`?e:null}return{bold:a,italic:o,strikethrough:s,link:c,linkHref:l,bulletList:d,orderedList:f,listStyle:p,blockquote:m,heading:h,image:hE(e)}}function hE(e){let{doc:t,selection:n}=e.state,r=t.nodeAt(n.from);return r===null||r.type.name!==`image`||n.to-n.from!==r.nodeSize?null:{pos:n.from,src:gE(r.attrs.src),alt:gE(r.attrs.alt),title:gE(r.attrs.title)}}function gE(e){return typeof e==`string`?e:``}function _E(e,t,n){let r=e.state.doc.nodeAt(t.pos);if(r===null||r.type.name!==`image`||gE(r.attrs.src)!==t.src)return!1;let i=e.state.tr.setNodeAttribute(t.pos,`src`,n.src).setNodeAttribute(t.pos,`alt`,n.alt).setNodeAttribute(t.pos,`title`,n.title);return e.dispatch(i),!0}function vE(e,t){return e===null||t===null?e===t:e.pos===t.pos&&e.src===t.src&&e.alt===t.alt&&e.title===t.title}function yE(e,t){let{$from:n}=e.state.selection;for(let e=n.depth;e>0;e--)if(n.node(e).type.name===t)return!0;return!1}function bE(e,t){let{state:n}=e,r=n.schema.nodes.heading,i=n.schema.nodes.paragraph;if(!r||!i)return;let{$from:a}=n.selection,o=a.parent.type.name===`heading`&&a.parent.attrs.level===t,s=o?i:r,c=o?void 0:{level:t},l=a.before(a.depth),u=n.selection.$to.after(n.selection.$to.depth);e.dispatch(n.tr.setBlockType(l,u,s,c)),e.focus()}function xE(e){let{state:t}=e,{$from:n,$to:r}=t.selection,i=n.depth;for(;i>0&&n.node(i).type.name!==`blockquote`;)i--;if(i===0)return!1;let a=r.pos>n.end(i)?t.doc.resolve(n.end(i)):r,o=n.blockRange(a,e=>e===n.node(i)),s=o?Vc(o):null;return o&&s!==null&&e.dispatch(t.tr.lift(o,s).scrollIntoView()),e.focus(),!0}function SE(e){let{state:t}=e,{from:n,to:r}=t.selection,i=t.schema.marks.link;if(!i)return;let a=n,o=r;t.doc.nodesBetween(n,n===r?r+1:r,(e,t)=>{if(i.isInSet(e.marks))return a=t,o=t+e.nodeSize,!1}),e.dispatch(t.tr.removeMark(a,o,i))}function CE(e,t){return e.bold===t.bold&&e.italic===t.italic&&e.strikethrough===t.strikethrough&&e.link===t.link&&e.linkHref===t.linkHref&&e.bulletList===t.bulletList&&e.orderedList===t.orderedList&&e.listStyle===t.listStyle&&e.blockquote===t.blockquote&&e.heading===t.heading&&vE(e.image,t.image)}function wE(e,t){let n=0,r=pE,i=()=>{let n=mE(e.ctx.get(Zh));CE(n,r)||(r=n,t(n))},a=e.ctx.get(Zh),o=a.dispatch.bind(a);return a.dispatch=e=>{o(e),(e.selectionSet||e.docChanged)&&(cancelAnimationFrame(n),n=requestAnimationFrame(i))},i(),()=>{cancelAnimationFrame(n)}}var TE=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),EE={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function DE(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function OE(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function kE(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function AE(e){return kE(e)||DE(e)}var jE=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function ME(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?AE:u===`decimal`?DE:OE;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&TE.includes(y)&&(_=y,v=kt(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&kt(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(x||n.nonTerminated!==!1){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):AE(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(NE(e))h(7,S),C=`�`;else if(e in EE)h(6,S),C=EE[e];else{let t=``;PE(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,jE[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function NE(e){return e>=55296&&e<=57343||e>1114111}function PE(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var FE=/["&'<>`]/g,IE=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,LE=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,RE=/[|\\{}()[\]^$+*?.]/g,zE=new WeakMap;function BE(e,t){return e=e.replace(t.subset?VE(t.subset):FE,r),t.subset||t.escapeOnly?e:e.replace(IE,n).replace(LE,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function VE(e){let t=zE.get(e);return t||(t=HE(e),zE.set(e,t)),t}function HE(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(RE,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}function UE(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function WE(e,t){return BE(e,Object.assign({format:UE},t))}({}).hasOwnProperty;function GE(){return{canContainEols:[`textDirective`],enter:{directiveContainer:KE,directiveContainerAttributes:$E,directiveContainerLabel:ZE,directiveLeaf:qE,directiveLeafAttributes:$E,directiveText:JE,directiveTextAttributes:$E},exit:{directiveContainer:aD,directiveContainerAttributeClassValue:tD,directiveContainerAttributeIdValue:eD,directiveContainerAttributeName:rD,directiveContainerAttributeValue:nD,directiveContainerAttributes:iD,directiveContainerLabel:QE,directiveContainerName:XE,directiveLeaf:aD,directiveLeafAttributeClassValue:tD,directiveLeafAttributeIdValue:eD,directiveLeafAttributeName:rD,directiveLeafAttributeValue:nD,directiveLeafAttributes:iD,directiveLeafName:XE,directiveText:aD,directiveTextAttributeClassValue:tD,directiveTextAttributeIdValue:eD,directiveTextAttributeName:rD,directiveTextAttributeValue:nD,directiveTextAttributes:iD,directiveTextName:XE}}}function KE(e){YE.call(this,`containerDirective`,e)}function qE(e){YE.call(this,`leafDirective`,e)}function JE(e){YE.call(this,`textDirective`,e)}function YE(e,t){this.enter({type:e,name:``,attributes:{},children:[]},t)}function XE(e){let t=this.stack[this.stack.length-1];t.type===`containerDirective`||t.type===`leafDirective`||t.type,t.name=this.sliceSerialize(e)}function ZE(e){this.enter({type:`paragraph`,data:{directiveLabel:!0},children:[]},e)}function QE(e){this.exit(e)}function $E(){this.data.directiveAttributes=[],this.buffer()}function eD(e){this.data.directiveAttributes.push([`id`,ME(this.sliceSerialize(e),{attribute:!0})])}function tD(e){this.data.directiveAttributes.push([`class`,ME(this.sliceSerialize(e),{attribute:!0})])}function nD(e){let t=this.data.directiveAttributes;t[t.length-1][1]=ME(this.sliceSerialize(e),{attribute:!0})}function rD(e){this.data.directiveAttributes.push([this.sliceSerialize(e),``])}function iD(){let e=this.data.directiveAttributes,t={},n=-1;for(;++n<e.length;){let r=e[n];r[0]===`class`&&t.class?t.class+=` `+r[1]:t[r[0]]=r[1]}this.data.directiveAttributes=void 0,this.resume();let r=this.stack[this.stack.length-1];r.type===`containerDirective`||r.type===`leafDirective`||r.type,r.attributes=t}function aD(e){this.exit(e)}function oD(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h,g;return _;function _(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),v}function v(t){return t===35?(h=o,y(t)):t===46?(h=s,y(t)):t===58||t===95||Rt(t)?(e.enter(a),e.enter(c),e.consume(t),S):m&&R(t)?z(e,v,`whitespace`)(t):!m&&L(t)?Un(e,v)(t):ne(t)}function y(t){let n=h+`Marker`;return e.enter(a),e.enter(h),e.enter(n),e.consume(t),e.exit(n),b}function b(t){if(t===null||t===34||t===35||t===39||t===46||t===60||t===61||t===62||t===96||t===125||L(t))return n(t);let r=h+`Value`;return e.enter(r),e.consume(t),x}function x(t){if(t===null||t===34||t===39||t===60||t===61||t===62||t===96)return n(t);if(t===35||t===46||t===125||L(t)){let n=h+`Value`;return e.exit(n),e.exit(h),e.exit(a),v(t)}return e.consume(t),x}function S(t){return t===45||t===46||t===58||t===95||zt(t)?(e.consume(t),S):(e.exit(c),m&&R(t)?z(e,C,`whitespace`)(t):!m&&L(t)?Un(e,C)(t):C(t))}function C(t){return t===61?(e.enter(l),e.consume(t),e.exit(l),w):(e.exit(a),v(t))}function w(t){return t===null||t===60||t===61||t===62||t===96||t===125||m&&I(t)?n(t):t===34||t===39?(e.enter(u),e.enter(f),e.consume(t),e.exit(f),g=t,E):m&&R(t)?z(e,w,`whitespace`)(t):!m&&L(t)?Un(e,w)(t):(e.enter(d),e.enter(p),e.consume(t),g=void 0,T)}function T(t){return t===null||t===34||t===39||t===60||t===61||t===62||t===96?n(t):t===125||L(t)?(e.exit(p),e.exit(d),e.exit(a),v(t)):(e.consume(t),T)}function E(t){return t===g?(e.enter(f),e.consume(t),e.exit(f),e.exit(u),e.exit(a),te):(e.enter(d),ee(t))}function ee(t){return t===g?(e.exit(d),E(t)):t===null?n(t):I(t)?m?n(t):Un(e,ee)(t):(e.enter(p),e.consume(t),D)}function D(t){return t===g||t===null||I(t)?(e.exit(p),ee(t)):(e.consume(t),D)}function te(e){return e===125||L(e)?v(e):ne(e)}function ne(a){return a===125?(e.enter(i),e.consume(a),e.exit(i),e.exit(r),t):n(a)}}function sD(e,t,n,r,i,a,o){let s=0,c=0,l;return u;function u(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),d}function d(n){return n===93?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),f(n))}function f(t){if(t===93&&!c)return h(t);let n=e.enter(`chunkText`,{contentType:`text`,previous:l});return l&&(l.next=n),l=n,p(t)}function p(t){return t===null||s>999||t===91&&++c>32?n(t):t===93&&!c--?(e.exit(`chunkText`),h(t)):I(t)?o?n(t):(e.consume(t),e.exit(`chunkText`),f):(e.consume(t),t===92?m:p)}function m(t){return t===91||t===92||t===93?(e.consume(t),s++,p):p(t)}function h(n){return e.exit(a),e.enter(i),e.consume(n),e.exit(i),e.exit(r),t}}function cD(e,t,n,r){let i=this;return a;function a(t){return Rt(t)?(e.enter(r),e.consume(t),o):n(t)}function o(a){return a===45||a===95||zt(a)?(e.consume(a),o):(e.exit(r),i.previous===45||i.previous===95?n(a):t(a))}}var lD={tokenize:pD,concrete:!0},uD={tokenize:mD,partial:!0},dD={tokenize:hD,partial:!0},fD={tokenize:gD,partial:!0};function pD(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0,s;return c;function c(t){return e.enter(`directiveContainer`),e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),l(t)}function l(t){return t===58?(e.consume(t),o++,l):o<3?n(t):(e.exit(`directiveContainerSequence`),cD.call(r,e,u,n,`directiveContainerName`)(t))}function u(t){return t===91?e.attempt(uD,d,d)(t):d(t)}function d(t){return t===123?e.attempt(dD,f,f)(t):f(t)}function f(t){return z(e,p,`whitespace`)(t)}function p(i){return e.exit(`directiveContainerFence`),i===null?C(i):I(i)?r.interrupt?t(i):e.attempt(fD,m,C)(i):n(i)}function m(t){return t===null?C(t):I(t)?e.check(fD,y,C)(t):(e.enter(`directiveContainerContent`),h(t))}function h(t){return e.attempt({tokenize:w,partial:!0},S,a?z(e,g,`linePrefix`,a+1):g)(t)}function g(t){return t===null?S(t):I(t)?e.check(fD,v,S)(t):v(t)}function _(t){if(t===null){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}return I(t)?e.check(fD,b,x)(t):(e.consume(t),_)}function v(t){let n=e.enter(`chunkDocument`,{contentType:`document`,previous:s});return s&&(s.next=n),s=n,_(t)}function y(t){return e.enter(`directiveContainerContent`),h(t)}function b(t){e.consume(t);let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,h}function x(t){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}function S(t){return e.exit(`directiveContainerContent`),C(t)}function C(n){return e.exit(`directiveContainer`),t(n)}function w(e,t,n){let i=0;return z(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),s(t)}function s(t){return t===58?(e.consume(t),i++,s):i<o?n(t):(e.exit(`directiveContainerSequence`),z(e,c,`whitespace`)(t))}function c(r){return r===null||I(r)?(e.exit(`directiveContainerFence`),t(r)):n(r)}}}function mD(e,t,n){return sD(e,t,n,`directiveContainerLabel`,`directiveContainerLabelMarker`,`directiveContainerLabelString`,!0)}function hD(e,t,n){return oD(e,t,n,`directiveContainerAttributes`,`directiveContainerAttributesMarker`,`directiveContainerAttribute`,`directiveContainerAttributeId`,`directiveContainerAttributeClass`,`directiveContainerAttributeName`,`directiveContainerAttributeInitializerMarker`,`directiveContainerAttributeValueLiteral`,`directiveContainerAttributeValue`,`directiveContainerAttributeValueMarker`,`directiveContainerAttributeValueData`,!0)}function gD(e,t,n){let r=this;return i;function i(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var _D={tokenize:bD},vD={tokenize:xD,partial:!0},yD={tokenize:SD,partial:!0};function bD(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveLeaf`),e.enter(`directiveLeafSequence`),e.consume(t),a}function a(t){return t===58?(e.consume(t),e.exit(`directiveLeafSequence`),cD.call(r,e,o,n,`directiveLeafName`)):n(t)}function o(t){return t===91?e.attempt(vD,s,s)(t):s(t)}function s(t){return t===123?e.attempt(yD,c,c)(t):c(t)}function c(t){return z(e,l,`whitespace`)(t)}function l(r){return r===null||I(r)?(e.exit(`directiveLeaf`),t(r)):n(r)}}function xD(e,t,n){return sD(e,t,n,`directiveLeafLabel`,`directiveLeafLabelMarker`,`directiveLeafLabelString`,!0)}function SD(e,t,n){return oD(e,t,n,`directiveLeafAttributes`,`directiveLeafAttributesMarker`,`directiveLeafAttribute`,`directiveLeafAttributeId`,`directiveLeafAttributeClass`,`directiveLeafAttributeName`,`directiveLeafAttributeInitializerMarker`,`directiveLeafAttributeValueLiteral`,`directiveLeafAttributeValue`,`directiveLeafAttributeValueMarker`,`directiveLeafAttributeValueData`,!0)}var CD={tokenize:DD,previous:ED},wD={tokenize:OD,partial:!0},TD={tokenize:kD,partial:!0};function ED(e){return e!==58||this.events[this.events.length-1][1].type===`characterEscape`}function DD(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveText`),e.enter(`directiveTextMarker`),e.consume(t),e.exit(`directiveTextMarker`),cD.call(r,e,a,n,`directiveTextName`)}function a(t){return t===58?n(t):t===91?e.attempt(wD,o,o)(t):o(t)}function o(t){return t===123?e.attempt(TD,s,s)(t):s(t)}function s(n){return e.exit(`directiveText`),t(n)}}function OD(e,t,n){return sD(e,t,n,`directiveTextLabel`,`directiveTextLabelMarker`,`directiveTextLabelString`)}function kD(e,t,n){return oD(e,t,n,`directiveTextAttributes`,`directiveTextAttributesMarker`,`directiveTextAttribute`,`directiveTextAttributeId`,`directiveTextAttributeClass`,`directiveTextAttributeName`,`directiveTextAttributeInitializerMarker`,`directiveTextAttributeValueLiteral`,`directiveTextAttributeValue`,`directiveTextAttributeValueMarker`,`directiveTextAttributeValueData`)}function AD(){return{text:{58:CD},flow:{58:[lD,_D]}}}var jD=`youtube`;function MD(e){if(!e||typeof e!=`object`)return``;let t=Object.entries(e),n=e.id;if(typeof n==`string`&&n)return n;for(let[e,n]of t)if(n===``||n==null)return e;return``}var ND=h_(`youtube`,()=>({group:`block`,atom:!0,isolating:!0,selectable:!0,draggable:!1,attrs:{videoId:{default:``}},toDOM:e=>[`div`,{"data-youtube":e.attrs.videoId,class:`youtube-block`}],parseDOM:[{tag:`div[data-youtube]`,getAttrs:e=>({videoId:e.getAttribute(`data-youtube`)||``})}],parseMarkdown:{match:e=>(e.type===`leafDirective`||e.type===`containerDirective`||e.type===`textDirective`)&&e.name===`youtube`,runner:(e,t,n)=>{let r=MD(t.attributes);e.addNode(n,{videoId:r})}},toMarkdown:{match:e=>e.type.name===`youtube`,runner:(e,t)=>{e.addNode(`leafDirective`,void 0,void 0,{name:jD,attributes:{id:t.attrs.videoId}})}}}));function PD(e){let t=e.attributes;return`::${jD}{#${t&&typeof t==`object`?String(t.id??``):``}}`}var FD=function(){let e=this.data(`toMarkdownExtensions`)??[],t={handlers:{leafDirective:PD}};e.push(t),this.data(`toMarkdownExtensions`,e)},ID=T_(`remarkYoutubeDirective`,()=>FD),LD=q(`insertYoutube`,()=>e=>(t,n)=>{if(!e)return!1;let r=t.schema.nodes.youtube;if(!r)return!1;let i=r.create({videoId:e});return n&&n(t.tr.replaceSelectionWith(i).scrollIntoView()),!0}),RD=`list`,zD=/^[A-Za-z0-9_-]+$/,BD=new Set([`textDirective`,`leafDirective`,`containerDirective`]);function VD(e){if(typeof e!=`string`)return null;let[t]=e.trim().split(/\s+/);return!t||!zD.test(t)?null:t}function HD(e){return Array.isArray(e?.children)?e.children:null}function UD(e){let t=HD(e);return t&&t.length>0?t[t.length-1]:void 0}function WD(e){return!e.attributes||typeof e.attributes!=`object`||Array.isArray(e.attributes)?null:e.attributes}function GD(e){return VD(WD(e)?.class)}function KD(e,t){let n=HD(e);if(e?.type!==`paragraph`||n?.length!==1)return!1;let r=n[0];return r?.type!==`text`||typeof r.value!=`string`?!1:t===void 0||r.value===t}function qD(e){if(!KD(e))return null;let t=HD(e)?.[0];return typeof t?.value==`string`?/^:::list\{\.([A-Za-z0-9_-]+)\}$/.exec(t.value)?.[1]??null:null}function JD(e){return e?.type===`list`}function YD(e,t,n){if(KD(t[n],`:::`))return t.splice(n,1),!0;let r=UD(e),i=UD(r);if(!i||i.type!==`paragraph`)return!1;let a=HD(i),o=UD(i);if(!a||o?.type!==`text`||typeof o.value!=`string`)return!1;if(o.value===`:::`)a.pop();else if(o.value.endsWith(`
51
+ :::`))o.value=o.value.slice(0,-4);else return!1;return a.length===0&&HD(r)?.pop(),!0}function XD(e){return e===`containerDirective`?`:::`:e===`leafDirective`?`::`:`:`}function ZD(e){if(!e||typeof e!=`object`||Array.isArray(e))return``;let t=[];for(let[n,r]of Object.entries(e))if(n===`class`&&typeof r==`string`)for(let e of r.split(/\s+/).filter(Boolean))t.push(`.${e}`);else n===`id`&&typeof r==`string`?t.push(`#${r}`):r===``||r==null?t.push(n):t.push(`${n}="${String(r)}"`);return t.length>0?`{${t.join(` `)}}`:``}function QD(e){return{type:`text`,value:e}}function $D(e){let t=XD(e.type),n=typeof e.name==`string`?e.name:``,r=HD(e)??[],i=ZD(e.attributes);if(e.type===`textDirective`){let e=[QD(`${t}${n}`)];return r.length>0&&e.push(QD(`[`),...r,QD(`]`)),i&&e.push(QD(i)),e}return[{type:`paragraph`,children:[QD(`${t}${n}${i}`)]},...r]}function eO(e){let t=HD(e);if(t)for(let e=0;e<t.length;e++){let n=t[e];if(!n)continue;if(n.type===`containerDirective`){let r=n,i=r.name===RD?GD(r):null,a=HD(r),o=a?.length===1?a[0]:void 0;if(i&&JD(o)){t[e]={...o,listStyle:i};continue}}let r=qD(n),i=t[e+1];if(r&&JD(i)&&YD(i,t,e+2))t.splice(e,1),t[e]={...i,listStyle:r};else if(eO(n),BD.has(n.type)){if(n.name===`youtube`)continue;let r=n.type===`containerDirective`&&n.name===RD?HD(n)??[]:$D(n);t.splice(e,1,...r),e+=r.length-1}}}function tO(e){return!!(e&&typeof e==`object`&&`containerFlow`in e&&typeof e.containerFlow==`function`)}var nO=(e,t,n,r)=>{if(!tO(n))return``;let i=VD(WD(e)?.class),a=n.containerFlow(e,r);return`:::list${i?`{.${i}}`:``}\n${a}\n:::`},rO=function(){let e=this.data(`toMarkdownExtensions`)??[],t={handlers:{containerDirective:nO}};return e.push(t),this.data(`toMarkdownExtensions`,e),e=>{eO(e)}},iO=T_(`remarkListDirective`,()=>rO),aO=function(){let e=this.data(`micromarkExtensions`)??[];e.push(AD()),this.data(`micromarkExtensions`,e);let t=this.data(`fromMarkdownExtensions`)??[];t.push(GE()),this.data(`fromMarkdownExtensions`,t)},oO=T_(`remarkDirective`,()=>aO);function sO(e){return e&&typeof e==`object`?e:{}}function cO(e){if(e)return{name:RD,attributes:{class:e}}}function lO(e,t,n){let r=cO(VD(t.attrs.listStyle));r&&e.openNode(`containerDirective`,void 0,r),e.openNode(`list`,void 0,n).next(t.content).closeNode(),r&&e.closeNode()}var uO=qv.extendSchema(e=>t=>{let n=e(t);return{...n,attrs:{...n.attrs,listStyle:{default:null,validate:`string|null`}},parseDOM:[{tag:`ul`,getAttrs:e=>{let t=sO(n.parseDOM?.[0]?.getAttrs?.(e)),r=e instanceof HTMLElement?VD(e.className):null;return{...t,listStyle:r}}}],toDOM:e=>{let n=VD(e.attrs.listStyle);return[`ul`,{...t.get(Kv.key)(e),...n?{class:n}:{},"data-spread":e.attrs.spread},0]},parseMarkdown:{match:({type:e,ordered:t})=>e===`list`&&!t,runner:(e,t,n)=>{e.openNode(n,{spread:t.spread===!0,listStyle:VD(t.listStyle)}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===`bullet_list`,runner:(e,t)=>{lO(e,t,{ordered:!1,spread:t.attrs.spread===!0})}}}}),dO=Qv.extendSchema(e=>t=>{let n=e(t);return{...n,attrs:{...n.attrs,listStyle:{default:null,validate:`string|null`}},parseDOM:[{tag:`ol`,getAttrs:e=>{let t=sO(n.parseDOM?.[0]?.getAttrs?.(e)),r=e instanceof HTMLElement?VD(e.className):null;return{...t,listStyle:r}}}],toDOM:e=>{let n=VD(e.attrs.listStyle);return[`ol`,{...t.get(Zv.key)(e),...e.attrs.order===1?{}:{start:e.attrs.order},...n?{class:n}:{},"data-spread":e.attrs.spread},0]},parseMarkdown:{match:({type:e,ordered:t})=>e===`list`&&!!t,runner:(e,t,n)=>{e.openNode(n,{order:typeof t.start==`number`?t.start:1,spread:t.spread===!0,listStyle:VD(t.listStyle)}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===`ordered_list`,runner:(e,t)=>{lO(e,t,{ordered:!0,start:typeof t.attrs.order==`number`?t.attrs.order:1,spread:t.attrs.spread===!0})}}}}),fO=q(`SetListStyle`,()=>e=>(t,n)=>{let r=new Set([t.schema.nodes.bullet_list,t.schema.nodes.ordered_list].filter(Boolean));if(r.size===0)return!1;let i=VD(e),a=new Map,{from:o,to:s,$from:c}=t.selection;for(let e=c.depth;e>0;e--){let t=c.node(e);if(r.has(t.type)){a.set(c.before(e),t);break}}if(t.doc.nodesBetween(o,s,(e,t)=>{r.has(e.type)&&a.set(t,e)}),a.size===0)return!1;if(n){let e=t.tr;for(let[t,n]of a)e=e.setNodeMarkup(t,void 0,{...n.attrs,listStyle:i});n(e.scrollIntoView())}return!0}),pO=[oO,iO,uO,dO,fO].flat(),mO=/^[A-Za-z0-9_-]{11}$/,hO=/(?:youtu\.be\/|\/(?:embed|shorts|v)\/)([A-Za-z0-9_-]{11})/;function gO(e){let t=e.trim();if(!t)return null;if(mO.test(t))return t;let n=/[?&]v=([A-Za-z0-9_-]{11})/.exec(t);if(n)return n[1]??null;let r=hO.exec(t);return r?r[1]??null:null}var _O={fontSize:11,color:`#dc2626`,whiteSpace:`nowrap`};function vO({onApply:e,onClose:t}){let[n,r]=(0,j.useState)(``),[i,a]=(0,j.useState)(!1),o=()=>{let t=gO(n);t?e(t):a(!0)};return(0,M.jsxs)(`div`,{style:xT,"data-mdx-action":`youtube`,onMouseDown:e=>e.stopPropagation(),children:[(0,M.jsx)(`input`,{style:ST,autoFocus:!0,placeholder:`YouTube URL or ID`,value:n,onChange:e=>{r(e.currentTarget.value),i&&a(!1)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o()),e.key===`Escape`&&t()}}),i?(0,M.jsx)(`span`,{style:_O,children:`No video id found`}):null,(0,M.jsx)(`button`,{type:`button`,style:{...CT,background:`#2563eb`,borderColor:`#2563eb`,color:`#fff`},onMouseDown:e=>e.preventDefault(),onClick:o,children:`Insert`}),(0,M.jsx)(`button`,{type:`button`,style:CT,onMouseDown:e=>e.preventDefault(),onClick:t,children:`Cancel`})]})}function yO(e){let[t,n]=(0,j.useState)(pE);return(0,j.useEffect)(()=>{if(!e)n(pE);else return wE(e,n)},[e]),t}function bO(e,t){bE(e.ctx.get(Zh),t)}function xO(e){xE(e.ctx.get(Zh))||e.action(E_(Dv.key))}function SO(e,t){let n=e.ctx.get(Zh);n.focus(),t(n.state,n.dispatch)}var CO=gT?`Undo (⌘Z)`:`Undo (Ctrl+Z)`,wO=gT?`Redo (⌘⇧Z)`:`Redo (Ctrl+Y)`;function TO(e,t){yE(e.ctx.get(Zh),t===`bullet`?`bullet_list`:`ordered_list`)?e.action(E_(ay.key)):e.action(E_(t===`bullet`?Yv.key:ey.key))}function EO(e,t){e.ctx.get(Zh).focus(),e.action(E_(fO.key,t))}function DO(e,t,n,r){e.action(e=>{let i=e.get(Zh),a=i.state.schema.nodes.image;a&&(i.focus(),i.dispatch(i.state.tr.replaceSelectionWith(a.create({src:t,alt:n,title:r})).scrollIntoView()))})}function OO(e,t){e.action(E_(LD.key,t))}var kO={flexShrink:0,position:`sticky`,top:0,zIndex:1},AO={display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:3,padding:`4px 6px`,borderBottom:`1px solid #ececed`,background:`#fafafa`},jO={width:1,height:18,background:`#e4e4e7`,margin:`0 3px`},MO={border:`1px solid transparent`,background:`transparent`,borderRadius:4,padding:`2px 7px`,font:`inherit`,fontSize:12,lineHeight:1.4,cursor:`pointer`,color:`#52525b`},NO={...MO,background:`#2563eb`,borderColor:`#2563eb`,color:`#fff`},PO={border:`1px solid #d4d4d8`,borderRadius:4,background:`#fff`,color:`#3f3f46`,font:`inherit`,fontSize:12,lineHeight:1.4,padding:`2px 6px`,maxWidth:150};function FO({active:e,title:t,onClick:n,style:r,children:i}){return(0,M.jsx)(`button`,{type:`button`,title:t,"data-mdx-action":`format`,onMouseDown:e=>e.preventDefault(),onClick:n,style:{...e?NO:MO,...r},children:i})}function IO({editor:e,listStyles:t,media:n,mediaContext:r,field:i,allowImageInsert:a=!0,onInsertComponent:o}){let s=yO(e),[c,l]=(0,j.useState)(!1),[u,d]=(0,j.useState)(null),[f,p]=(0,j.useState)(!1),[m,h]=(0,j.useState)(null),[g,_]=(0,j.useState)(null),v=e===null,y=(t?.length??0)>0,b=s.bulletList||s.orderedList,x=s.listStyle&&t?.some(e=>e.class===s.listStyle)?s.listStyle:``,S=t=>{l(!1),e&&(e.ctx.get(Zh).focus(),e.action(E_(s.link?ov.key:av.key,{href:t})))},C=s.image,w=g?.image??null;(0,j.useEffect)(()=>{w!==null&&(C===null||C.pos!==w.pos||C.src!==w.src)&&_(null)},[w,C]);let T=(t,n)=>{let r=g;if(_(null),!e||!r)return;let i=e.ctx.get(Zh);_E(i,r.image,{src:r.src,alt:t,title:n}),i.focus()},E=()=>{_(null),e?.ctx.get(Zh).focus()},ee=()=>{if(l(!1),!e)return;let t=e.ctx.get(Zh);t.focus(),SE(t)};return(0,M.jsxs)(`div`,{style:kO,children:[(0,M.jsxs)(`div`,{style:AO,children:[(0,M.jsx)(FO,{title:CO,onClick:()=>e&&SO(e,mT),children:`↶`}),(0,M.jsx)(FO,{title:wO,onClick:()=>e&&SO(e,hT),children:`↷`}),(0,M.jsx)(`span`,{style:jO}),(0,M.jsx)(FO,{active:s.bold,title:`Bold`,onClick:()=>e?.action(E_(Y_.key)),style:{fontWeight:700},children:`B`}),(0,M.jsx)(FO,{active:s.italic,title:`Italic`,onClick:()=>e?.action(E_(U_.key)),style:{fontStyle:`italic`},children:`I`}),(0,M.jsx)(FO,{active:s.strikethrough,title:`Strikethrough`,onClick:()=>e?.action(E_(qC.key)),style:{textDecoration:`line-through`},children:`S`}),(0,M.jsx)(`span`,{style:jO}),(0,M.jsx)(FO,{active:s.heading===2,title:`Heading 2`,onClick:()=>e&&bO(e,2),children:`H2`}),(0,M.jsx)(FO,{active:s.heading===3,title:`Heading 3`,onClick:()=>e&&bO(e,3),children:`H3`}),(0,M.jsx)(FO,{active:s.heading===4,title:`Heading 4`,onClick:()=>e&&bO(e,4),children:`H4`}),(0,M.jsx)(`span`,{style:jO}),(0,M.jsx)(FO,{active:s.bulletList,title:`Bullet list`,onClick:()=>e&&TO(e,`bullet`),children:`• List`}),(0,M.jsx)(FO,{active:s.orderedList,title:`Numbered list`,onClick:()=>e&&TO(e,`ordered`),children:`1. List`}),y?(0,M.jsxs)(`select`,{title:`List style`,"aria-label":`List style`,disabled:v||!b,value:x,onChange:t=>{e&&EO(e,t.currentTarget.value||null)},style:{...PO,opacity:v||!b?.55:1,cursor:v||!b?`not-allowed`:`default`},children:[(0,M.jsx)(`option`,{value:``,children:`Default`}),t?.map(e=>(0,M.jsx)(`option`,{value:e.class,children:e.label},e.class))]}):null,(0,M.jsx)(FO,{active:s.blockquote,title:`Quote`,onClick:()=>e&&xO(e),children:`❝`}),(0,M.jsx)(FO,{title:`Insert table`,onClick:()=>e?.action(E_(fw.key,{row:3,col:3})),children:`▦ Table`}),(0,M.jsx)(FO,{active:f,title:`Insert YouTube`,onClick:()=>!v&&p(e=>!e),children:`YouTube`}),(0,M.jsx)(`span`,{style:jO}),(0,M.jsx)(FO,{active:s.link||c,title:`Link`,onClick:()=>!v&&l(e=>!e),children:`🔗 Link`}),n&&a?(0,M.jsx)(FO,{title:`Insert image`,onClick:()=>!v&&d(`insert`),children:`🖼 Image`}):null,C?(0,M.jsx)(FO,{active:g!==null,title:`Edit the alt text, caption or file of the selected image`,onClick:()=>_({image:C,src:C.src}),children:`Edit image`}):null,o?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{style:{flex:1}}),(0,M.jsx)(FO,{title:`Insert component block`,onClick:()=>!v&&o(),style:{border:`1px solid #d4d4d8`,color:`#3f3f46`},children:`+ Component`})]}):null]}),c?(0,M.jsx)(`div`,{style:{padding:`0 6px`},children:(0,M.jsx)(DT,{initialUrl:s.linkHref??`https://`,isEdit:s.link,onApply:S,onRemove:s.link?ee:void 0,onClose:()=>l(!1)})}):null,f?(0,M.jsx)(`div`,{style:{padding:`0 6px`},children:(0,M.jsx)(vO,{onApply:t=>{p(!1),e&&OO(e,t)},onClose:()=>p(!1)})}):null,g?(0,M.jsx)(`div`,{style:{padding:`0 6px`},children:(0,M.jsx)(NT,{mode:`edit`,initialAlt:g.image.alt,initialCaption:g.image.title,previewSrc:fE(n,g.src,r),onReplace:n?()=>d(`replace`):void 0,onApply:T,onClose:E},g.image.pos)}):null,m?(0,M.jsx)(`div`,{style:{padding:`0 6px`},children:(0,M.jsx)(NT,{mode:`insert`,initialAlt:m.alt,initialCaption:``,previewSrc:fE(n,m.url,r),onApply:(t,n)=>{let{url:r}=m;h(null),e&&DO(e,r,t,n)},onClose:()=>h(null)})}):null,u&&n?(0,M.jsx)(uE,{media:n,context:r,field:i,accept:`image/*`,onSelect:(t,n)=>{d(null),u===`replace`?_(e=>e&&{...e,src:t}):e&&h({url:t,alt:n??``})},onClose:()=>d(null)}):null]})}function LO(){return{enter:{mdxFlowExpression:zO,mdxTextExpression:BO},exit:{mdxFlowExpression:VO,mdxFlowExpressionChunk:HO,mdxTextExpression:VO,mdxTextExpressionChunk:HO}}}function RO(){return{handlers:{mdxFlowExpression:UO,mdxTextExpression:UO},unsafe:[{character:`{`,inConstruct:[`phrasing`]},{atBreak:!0,character:`{`}]}}function zO(e){this.enter({type:`mdxFlowExpression`,value:``},e),this.buffer()}function BO(e){this.enter({type:`mdxTextExpression`,value:``},e),this.buffer()}function VO(e){let t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];r.type===`mdxFlowExpression`||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function HO(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function UO(e,t,n){let r=e.value||``;return`{`+n.indentLines(r,function(e,t,n){return(t===0||n?``:` `)+e})+`}`}var WO=` `;function GO(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new V("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new V(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new V("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=ME(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new V("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+pi(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new V("Expected a closing tag for `"+S(r)+"` ("+pi({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new V("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+pi(t.end)+") or another opening tag after the start of `"+t.type+"` ("+pi(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function KO(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=XO,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=YO(JO(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null){if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&Bx(e,n)>Bx(e,o)?o:n;s=t+WE(e,{subset:[t]})+t}}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+WO+m[e];b+=y.move(`
52
+ `+m.join(`
53
+ `)+`
54
+ `+d)}else v&&(b+=y.move(` `+v));return u&&(b+=y.move((i||_?``:` `)+`/`)),b+=y.move(`>`),e.children&&e.children.length>0&&(e.type===`mdxJsxTextElement`?b+=y.move(s.containerPhrasing(e,{...y.current(),before:`>`,after:`<`})):(y.shift(2),b+=y.move(`
55
+ `),b+=y.move(qO(e,s,y.current())),b+=y.move(`
56
+ `))),u||(b+=y.move((l?d:``)+`</`+(e.name||``)+`>`)),g(),b}}function qO(e,t,n){let r=t.indexStack,i=e.children,a=t.createTracker(n),o=YO(JO(t)),s=[],c=-1;for(r.push(-1);++c<i.length;){let n=i[c];r[r.length-1]=c;let l={before:`
57
+ `,after:`
58
+ `,...a.current()},u=t.handle(n,e,t,l),d=n.type===`mdxJsxFlowElement`?u:t.indentLines(u,function(e,t,n){return(n?``:o)+e});s.push(a.move(d)),n.type!==`list`&&(t.bulletLastUsed=void 0),c<i.length-1&&s.push(a.move(`
59
+
60
+ `))}return r.pop(),s.join(``)}function JO(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function YO(e){return WO.repeat(e)}function XO(){return`<`}function ZO(){return{enter:{mdxjsEsm:$O},exit:{mdxjsEsm:ek,mdxjsEsmData:tk}}}function QO(){return{handlers:{mdxjsEsm:nk}}}function $O(e){this.enter({type:`mdxjsEsm`,value:``},e),this.buffer()}function ek(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e);let r=e.estree;n.value=t,r&&(n.data={estree:r})}function tk(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function nk(e){return e.value||``}function rk(){return[LO(),GO(),ZO()]}function ik(e){return{extensions:[RO(),KO(e),QO()]}}var ak=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],ok=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],sk=`‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`,ck=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,lk={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},uk=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,dk={5:uk,"5module":uk+` export import`,6:uk+` const class extends export import super`},fk=/^in(stanceof)?$/,pk=RegExp(`[`+ck+`]`),mk=RegExp(`[`+ck+sk+`]`);function hk(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function gk(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&pk.test(String.fromCharCode(e)):t!==!1&&hk(e,ok)}function _k(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&mk.test(String.fromCharCode(e)):t===!1?!1:hk(e,ok)||hk(e,ak)}var vk=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function yk(e,t){return new vk(e,{beforeExpr:!0,binop:t})}var bk={beforeExpr:!0},xk={startsExpr:!0},Sk={};function Ck(e,t){return t===void 0&&(t={}),t.keyword=e,Sk[e]=new vk(e,t)}var X={num:new vk(`num`,xk),regexp:new vk(`regexp`,xk),string:new vk(`string`,xk),name:new vk(`name`,xk),privateId:new vk(`privateId`,xk),eof:new vk(`eof`),bracketL:new vk(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new vk(`]`),braceL:new vk(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new vk(`}`),parenL:new vk(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new vk(`)`),comma:new vk(`,`,bk),semi:new vk(`;`,bk),colon:new vk(`:`,bk),dot:new vk(`.`),question:new vk(`?`,bk),questionDot:new vk(`?.`),arrow:new vk(`=>`,bk),template:new vk(`template`),invalidTemplate:new vk(`invalidTemplate`),ellipsis:new vk(`...`,bk),backQuote:new vk("`",xk),dollarBraceL:new vk("${",{beforeExpr:!0,startsExpr:!0}),eq:new vk(`=`,{beforeExpr:!0,isAssign:!0}),assign:new vk(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new vk(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new vk(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:yk(`||`,1),logicalAND:yk(`&&`,2),bitwiseOR:yk(`|`,3),bitwiseXOR:yk(`^`,4),bitwiseAND:yk(`&`,5),equality:yk(`==/!=/===/!==`,6),relational:yk(`</>/<=/>=`,7),bitShift:yk(`<</>>/>>>`,8),plusMin:new vk(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:yk(`%`,10),star:yk(`*`,10),slash:yk(`/`,10),starstar:new vk(`**`,{beforeExpr:!0}),coalesce:yk(`??`,1),_break:Ck(`break`),_case:Ck(`case`,bk),_catch:Ck(`catch`),_continue:Ck(`continue`),_debugger:Ck(`debugger`),_default:Ck(`default`,bk),_do:Ck(`do`,{isLoop:!0,beforeExpr:!0}),_else:Ck(`else`,bk),_finally:Ck(`finally`),_for:Ck(`for`,{isLoop:!0}),_function:Ck(`function`,xk),_if:Ck(`if`),_return:Ck(`return`,bk),_switch:Ck(`switch`),_throw:Ck(`throw`,bk),_try:Ck(`try`),_var:Ck(`var`),_const:Ck(`const`),_while:Ck(`while`,{isLoop:!0}),_with:Ck(`with`),_new:Ck(`new`,{beforeExpr:!0,startsExpr:!0}),_this:Ck(`this`,xk),_super:Ck(`super`,xk),_class:Ck(`class`,xk),_extends:Ck(`extends`,bk),_export:Ck(`export`),_import:Ck(`import`,xk),_null:Ck(`null`,xk),_true:Ck(`true`,xk),_false:Ck(`false`,xk),_in:Ck(`in`,{beforeExpr:!0,binop:7}),_instanceof:Ck(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:Ck(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Ck(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Ck(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},wk=/\r\n?|\n|\u2028|\u2029/,Tk=new RegExp(wk.source,`g`);function Ek(e){return e===10||e===13||e===8232||e===8233}function Dk(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(Ek(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var Ok=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,kk=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ak=Object.prototype,jk=Ak.hasOwnProperty,Mk=Ak.toString,Nk=Object.hasOwn||(function(e,t){return jk.call(e,t)}),Pk=Array.isArray||(function(e){return Mk.call(e)===`[object Array]`}),Fk=Object.create(null);function Ik(e){return Fk[e]||(Fk[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function Lk(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var Rk=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,zk=function(e,t){this.line=e,this.column=t};zk.prototype.offset=function(e){return new zk(this.line,this.column+e)};var Bk=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function Vk(e,t){for(var n=1,r=0;;){var i=Dk(e,r,t);if(i<0)return new zk(n,t-r);++n,r=i}}var Hk={ecmaVersion:null,sourceType:`script`,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Uk=!1;function Wk(e){var t={};for(var n in Hk)t[n]=e&&Nk(e,n)?e[n]:Hk[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Uk&&typeof console==`object`&&console.warn&&(Uk=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
61
+ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,e&&e.allowHashBang!=null||(t.allowHashBang=t.ecmaVersion>=14),Pk(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}return Pk(t.onComment)&&(t.onComment=Gk(t,t.onComment)),t}function Gk(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new Bk(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var Kk=1,qk=2,Jk=4,Yk=8,Xk=16,Zk=32,Qk=64,$k=128,eA=256,tA=512,nA=Kk|qk|eA;function rA(e,t){return qk|(e?Jk:0)|(t?Yk:0)}var iA=0,aA=1,oA=2,sA=3,cA=4,lA=5,uA=function(e,t,n){this.options=e=Wk(e),this.sourceFile=e.sourceFile,this.keywords=Ik(dk[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=lk[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=Ik(r);var i=(r?r+` `:``)+lk.strict;this.reservedWordsStrict=Ik(i),this.reservedWordsStrictBind=Ik(i+` `+lk.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(`
62
+ `,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(wk).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=X.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Kk),this.regexpState=null,this.privateNameStack=[]},dA={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};uA.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},dA.inFunction.get=function(){return(this.currentVarScope().flags&qk)>0},dA.inGenerator.get=function(){return(this.currentVarScope().flags&Yk)>0},dA.inAsync.get=function(){return(this.currentVarScope().flags&Jk)>0},dA.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(eA|tA))return!1;if(t&qk)return(t&Jk)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},dA.allowSuper.get=function(){return(this.currentThisScope().flags&Qk)>0||this.options.allowSuperOutsideMethod},dA.allowDirectSuper.get=function(){return(this.currentThisScope().flags&$k)>0},dA.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},dA.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(eA|tA)||t&qk&&!(t&Xk))return!0}return!1},dA.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&eA)>0},uA.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},uA.parse=function(e,t){return new this(t,e).parse()},uA.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},uA.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(uA.prototype,dA);var fA=uA.prototype,pA=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;fA.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){kk.lastIndex=e,e+=kk.exec(this.input)[0].length;var t=pA.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){kk.lastIndex=e+t[0].length;var n=kk.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||wk.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`)}e+=t[0].length,kk.lastIndex=e,e+=kk.exec(this.input)[0].length,this.input[e]===`;`&&e++}},fA.eat=function(e){return this.type===e&&(this.next(),!0)},fA.isContextual=function(e){return this.type===X.name&&this.value===e&&!this.containsEsc},fA.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},fA.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},fA.canInsertSemicolon=function(){return this.type===X.eof||this.type===X.braceR||wk.test(this.input.slice(this.lastTokEnd,this.start))},fA.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},fA.semicolon=function(){!this.eat(X.semi)&&!this.insertSemicolon()&&this.unexpected()},fA.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},fA.expect=function(e){this.eat(e)||this.unexpected()},fA.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var mA=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};fA.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},fA.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},fA.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},fA.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var Z=uA.prototype;Z.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==X.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,`Program`)};var hA={kind:`loop`},gA={kind:`switch`};Z.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;kk.lastIndex=this.pos;var t=kk.exec(this.input),n=this.pos+t[0].length,r=this.input.charCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(gk(r,!0)){for(var i=n+1;_k(r=this.input.charCodeAt(i),!0);)++i;if(r===92||r>55295&&r<56320)return!0;var a=this.input.slice(n,i);if(!fk.test(a))return!0}return!1},Z.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;kk.lastIndex=this.pos;var e=kk.exec(this.input),t=this.pos+e[0].length,n;return!wk.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(_k(n=this.input.charCodeAt(t+8))||n>55295&&n<56320))},Z.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?`await`:`using`))return!1;kk.lastIndex=this.pos;var n=kk.exec(this.input),r=this.pos+n[0].length;if(wk.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,a;if(this.input.slice(r,i)!==`using`||i===this.input.length||_k(a=this.input.charCodeAt(i))||a>55295&&a<56320)return!1;kk.lastIndex=i;var o=kk.exec(this.input);if(o&&wk.test(this.input.slice(i,i+o[0].length)))return!1}if(t){var s=r+2,c;if(this.input.slice(r,s)===`of`&&(s===this.input.length||!_k(c=this.input.charCodeAt(s))&&!(c>55295&&c<56320)))return!1}var l=this.input.charCodeAt(r);return gk(l,!0)||l===92},Z.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},Z.isUsing=function(e){return this.isUsingKeyword(!1,e)},Z.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=X._var,a=`let`),r){case X._break:case X._continue:return this.parseBreakContinueStatement(i,r.keyword);case X._debugger:return this.parseDebuggerStatement(i);case X._do:return this.parseDoStatement(i);case X._for:return this.parseForStatement(i);case X._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case X._class:return e&&this.unexpected(),this.parseClass(i,!0);case X._if:return this.parseIfStatement(i);case X._return:return this.parseReturnStatement(i);case X._switch:return this.parseSwitchStatement(i);case X._throw:return this.parseThrowStatement(i);case X._try:return this.parseTryStatement(i);case X._const:case X._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case X._while:return this.parseWhileStatement(i);case X._with:return this.parseWithStatement(i);case X.braceL:return this.parseBlock(!0,i);case X.semi:return this.parseEmptyStatement(i);case X._export:case X._import:if(this.options.ecmaVersion>10&&r===X._import){kk.lastIndex=this.pos;var o=kk.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===X._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.isAwaitUsing(!1)?`await using`:this.isUsing(!1)?`using`:null;if(l)return t&&this.options.sourceType===`script`&&this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script`"),l===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.next(),this.parseVar(i,!1,l),this.semicolon(),this.finishNode(i,`VariableDeclaration`);var u=this.value,d=this.parseExpression();return r===X.name&&d.type===`Identifier`&&this.eat(X.colon)?this.parseLabeledStatement(i,u,d,e):this.parseExpressionStatement(i,d)}},Z.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(X.semi)||this.insertSemicolon()?e.label=null:this.type===X.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},Z.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},Z.parseDoStatement=function(e){return this.next(),this.labels.push(hA),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(X._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(X.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},Z.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(hA),this.enterScope(0),this.expect(X.parenL),this.type===X.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===X._var||this.type===X._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),this.parseForAfterInit(e,r,t)}var a=this.isContextual(`let`),o=!1,s=this.isUsing(!0)?`using`:this.isAwaitUsing(!0)?`await using`:null;if(s){var c=this.startNode();return this.next(),s===`await using`&&this.next(),this.parseVar(c,!0,s),this.finishNode(c,`VariableDeclaration`),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,u=new mA,d=this.start,f=t>-1?this.parseExprSubscripts(u,`await`):this.parseExpression(!0,u);return this.type===X._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===X._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!l&&f.type===`Identifier`&&f.name===`async`?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&o&&this.raise(f.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(f,!1,u),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},Z.parseForAfterInit=function(e,t,n){return(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===X._in?n>-1&&this.unexpected(n):e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},Z.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,vA|(n?0:yA),!1,t)},Z.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(X._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},Z.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,`'return' outside of function`),this.next(),this.eat(X.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},Z.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(X.braceL),this.labels.push(gA),this.enterScope(0);for(var t,n=!1;this.type!==X.braceR;)if(this.type===X._case||this.type===X._default){var r=this.type===X._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(X.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},Z.parseThrowStatement=function(e){return this.next(),wk.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var _A=[];Z.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?Zk:0),this.checkLValPattern(e,t?cA:oA),this.expect(X.parenR),e},Z.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===X._catch){var t=this.startNode();this.next(),this.eat(X.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(X._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},Z.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},Z.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(hA),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},Z.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},Z.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},Z.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===X._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},Z.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},Z.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(X.braceL),e&&this.enterScope(0);this.type!==X.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},Z.parseFor=function(e,t){return e.init=t,this.expect(X.semi),e.test=this.type===X.semi?null:this.parseExpression(),this.expect(X.semi),e.update=this.type===X.parenR?null:this.parseExpression(),this.expect(X.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},Z.parseForIn=function(e,t){var n=this.type===X._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(X.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},Z.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(X.eq)?i.init=this.parseMaybeAssign(t):!r&&n===`const`&&!(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():!r&&(n===`using`||n===`await using`)&&this.options.ecmaVersion>=17&&this.type!==X._in&&!this.isContextual(`of`)?this.raise(this.lastTokEnd,`Missing initializer in `+n+` declaration`):!r&&i.id.type!==`Identifier`&&(!t||this.type!==X._in&&!this.isContextual(`of`))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):i.init=null,e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(X.comma))break}return e},Z.parseVarId=function(e,t){e.id=t===`using`||t===`await using`?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?aA:oA,!1)};var vA=1,yA=2,bA=4;Z.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===X.star&&t&yA&&this.unexpected(),e.generator=this.eat(X.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&vA&&(e.id=t&bA&&this.type!==X.name?null:this.parseIdent(),e.id&&!(t&yA)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?aA:oA:sA));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(rA(e.async,e.generator)),t&vA||(e.id=this.type===X.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&vA?`FunctionDeclaration`:`FunctionExpression`)},Z.parseFunctionParams=function(e){this.expect(X.parenL),e.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},Z.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(X.braceL);this.type!==X.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&xA(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},Z.parseClassElement=function(e){if(this.eat(X.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(X.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===X.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===X.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(X.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===X.parenL||o!==`method`||i||a){var l=!n.static&&SA(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},Z.isClassElementNameStart=function(){return this.type===X.name||this.type===X.privateId||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword},Z.parseClassElementName=function(e){this.type===X.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},Z.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&SA(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},Z.parseClassField=function(e){return SA(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&SA(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(X.eq)?(this.enterScope(tA|Qk),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,`PropertyDefinition`)},Z.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(eA|Qk);this.type!==X.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},Z.parseClassId=function(e,t){this.type===X.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,oA,!1)):(t===!0&&this.unexpected(),e.id=null)},Z.parseClassSuper=function(e){e.superClass=this.eat(X._extends)?this.parseExprSubscripts(null,!1):null},Z.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},Z.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];Nk(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function xA(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function SA(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}Z.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==X.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},Z.parseExport=function(e,t){if(this.next(),this.eat(X.star))return this.parseExportAllDeclaration(e,t);if(this.eat(X._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==X.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},Z.parseExportDeclaration=function(e){return this.parseStatement(null)},Z.parseExportDefaultDeclaration=function(){var e;if(this.type===X._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,vA|bA,!1,e)}if(this.type===X._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}var r=this.parseMaybeAssign();return this.semicolon(),r},Z.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),Nk(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},Z.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},Z.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},Z.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},Z.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,`ExportSpecifier`)},Z.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(X.braceL);!this.eat(X.braceR);){if(n)n=!1;else if(this.expect(X.comma),this.afterTrailingComma(X.braceR))break;t.push(this.parseExportSpecifier(e))}return t},Z.parseImport=function(e){return this.next(),this.type===X.string?(e.specifiers=_A,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===X.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},Z.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,oA),this.finishNode(e,`ImportSpecifier`)},Z.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,oA),this.finishNode(e,`ImportDefaultSpecifier`)},Z.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,oA),this.finishNode(e,`ImportNamespaceSpecifier`)},Z.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===X.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(X.comma)))return e;if(this.type===X.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(X.braceL);!this.eat(X.braceR);){if(t)t=!1;else if(this.expect(X.comma),this.afterTrailingComma(X.braceR))break;e.push(this.parseImportSpecifier())}return e},Z.parseWithClause=function(){var e=[];if(!this.eat(X._with))return e;this.expect(X.braceL);for(var t={},n=!0;!this.eat(X.braceR);){if(n)n=!1;else if(this.expect(X.comma),this.afterTrailingComma(X.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;Nk(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},Z.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===X.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(X.colon),this.type!==X.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},Z.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===X.string){var e=this.parseLiteral(this.value);return Rk.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},Z.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},Z.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var CA=uA.prototype;CA.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},CA.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},CA.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},CA.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==X.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},CA.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case X.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(X.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case X.braceL:return this.parseObj(!0)}return this.parseIdent()},CA.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(X.comma),t&&this.type===X.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===X.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===X.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else i.push(this.parseAssignableListItem(r));return i},CA.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},CA.parseBindingListItem=function(e){return e},CA.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(X.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},CA.checkLValSimple=function(e,t,n){t===void 0&&(t=iA);var r=t!==iA;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===oA&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(Nk(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==lA&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},CA.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=iA),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},CA.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=iA),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var wA=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},TA={b_stat:new wA(`{`,!1),b_expr:new wA(`{`,!0),b_tmpl:new wA("${",!1),p_stat:new wA(`(`,!1),p_expr:new wA(`(`,!0),q_tmpl:new wA("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new wA(`function`,!1),f_expr:new wA(`function`,!0),f_expr_gen:new wA(`function`,!0,!1,null,!0),f_gen:new wA(`function`,!1,!1,null,!0)},EA=uA.prototype;EA.initialContext=function(){return[TA.b_stat]},EA.curContext=function(){return this.context[this.context.length-1]},EA.braceIsBlock=function(e){var t=this.curContext();return t===TA.f_expr||t===TA.f_stat?!0:e===X.colon&&(t===TA.b_stat||t===TA.b_expr)?!t.isExpr:e===X._return||e===X.name&&this.exprAllowed?wk.test(this.input.slice(this.lastTokEnd,this.start)):e===X._else||e===X.semi||e===X.eof||e===X.parenR||e===X.arrow?!0:e===X.braceL?t===TA.b_stat:e===X._var||e===X._const||e===X.name?!1:!this.exprAllowed},EA.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},EA.updateContext=function(e){var t,n=this.type;n.keyword&&e===X.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},EA.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},X.parenR.updateContext=X.braceR.updateContext=function(){if(this.context.length===1)this.exprAllowed=!0;else{var e=this.context.pop();e===TA.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}},X.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?TA.b_stat:TA.b_expr),this.exprAllowed=!0},X.dollarBraceL.updateContext=function(){this.context.push(TA.b_tmpl),this.exprAllowed=!0},X.parenL.updateContext=function(e){var t=e===X._if||e===X._for||e===X._with||e===X._while;this.context.push(t?TA.p_stat:TA.p_expr),this.exprAllowed=!0},X.incDec.updateContext=function(){},X._function.updateContext=X._class.updateContext=function(e){e.beforeExpr&&e!==X._else&&(e!==X.semi||this.curContext()===TA.p_stat)&&!(e===X._return&&wk.test(this.input.slice(this.lastTokEnd,this.start)))&&(e!==X.colon&&e!==X.braceL||this.curContext()!==TA.b_stat)?this.context.push(TA.f_expr):this.context.push(TA.f_stat),this.exprAllowed=!1},X.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},X.backQuote.updateContext=function(){this.curContext()===TA.q_tmpl?this.context.pop():this.context.push(TA.q_tmpl),this.exprAllowed=!1},X.star.updateContext=function(e){if(e===X._function){var t=this.context.length-1;this.context[t]===TA.f_expr?this.context[t]=TA.f_expr_gen:this.context[t]=TA.f_gen}this.exprAllowed=!0},X.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==X.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var Q=uA.prototype;Q.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6)i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);else{i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}}},Q.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===X.comma){var a=this.startNodeAt(n,r);for(a.expressions=[i];this.eat(X.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,`SequenceExpression`)}return i},Q.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new mA,r=!0);var s=this.start,c=this.startLoc;(this.type===X.parenL||this.type===X.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===X.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===X.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},Q.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(X.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(X.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},Q.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},Q.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==X._in)&&a>r){var o=this.type===X.logicalOR||this.type===X.logicalAND,s=this.type===X.coalesce;s&&(a=X.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===X.coalesce||s&&(this.type===X.logicalOR||this.type===X.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},Q.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},Q.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===X.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&DA(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&OA(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===X.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==X._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&this.eat(X.starstar)){if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1)}else return o};function DA(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&DA(e.expression)}function OA(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&OA(e.expression)||e.type===`ParenthesizedExpression`&&OA(e.expression)}Q.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprAtom(e,t);if(i.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return i;var a=this.parseSubscripts(i,n,r,!1,t);return e&&a.type===`MemberExpression`&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a},Q.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s===e||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s}},Q.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(X.arrow)},Q.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},Q.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(X.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(X.bracketL);if(l||c&&this.type!==X.parenL&&this.type!==X.backQuote||this.eat(X.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(X.bracketR)):u.property=this.type===X.privateId&&e.type!==`Super`?this.parsePrivateIdent():this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(X.parenL)){var d=new mA,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(X.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,h,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===X.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},Q.parseExprAtom=function(e,t,n){this.type===X.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case X._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type===X.parenL&&!this.allowDirectSuper&&this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==X.dot&&this.type!==X.bracketL&&this.type!==X.parenL&&this.unexpected(),this.finishNode(r,`Super`);case X._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case X.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(X._function))return this.overrideContext(TA.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(X.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===X.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(X.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case X.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case X.num:case X.string:return this.parseLiteral(this.value);case X._null:case X._true:case X._false:return r=this.startNode(),r.value=this.type===X._null?null:this.type===X._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case X.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case X.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(X.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case X.braceL:return this.overrideContext(TA.b_expr),this.parseObj(!1,e);case X._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case X._class:return this.parseClass(this.startNode(),!1);case X._new:return this.parseNew();case X.backQuote:return this.parseTemplate();case X._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},Q.parseExprAtomDefault=function(){this.unexpected()},Q.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===X.parenL&&!e)return this.parseDynamicImport(t);if(this.type===X.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}this.unexpected()},Q.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(X.parenR)?e.options=null:(this.expect(X.comma),this.afterTrailingComma(X.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(X.parenR)||(this.expect(X.comma),this.afterTrailingComma(X.parenR)||this.unexpected())));else if(!this.eat(X.parenR)){var t=this.start;this.eat(X.comma)&&this.eat(X.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},Q.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},Q.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value==null?t.raw.slice(0,-1).replace(/_/g,``):t.value.toString()),this.next(),this.finishNode(t,`Literal`)},Q.parseParenExpression=function(){this.expect(X.parenL);var e=this.parseExpression();return this.expect(X.parenR),e},Q.shouldParseArrow=function(e){return!this.canInsertSemicolon()},Q.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new mA,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==X.parenR;){if(l?l=!1:this.expect(X.comma),a&&this.afterTrailingComma(X.parenR,!0)){u=!0;break}if(this.type===X.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===X.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}c.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(X.parenR),e&&this.shouldParseArrow(c)&&this.eat(X.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}return i},Q.parseParenItem=function(e){return e},Q.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var kA=[];Q.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===X.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),e.arguments=this.eat(X.parenL)?this.parseExprList(X.parenR,this.options.ecmaVersion>=8,!1):kA,this.finishNode(e,`NewExpression`)},Q.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===X.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,`
63
+ `),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
64
+ `),cooked:this.value},this.next(),n.tail=this.type===X.backQuote,this.finishNode(n,`TemplateElement`)},Q.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===X.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(X.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(X.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},Q.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===X.name||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===X.star)&&!wk.test(this.input.slice(this.lastTokEnd,this.start))},Q.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(X.braceR);){if(r)r=!1;else if(this.expect(X.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(X.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},Q.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(X.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===X.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===X.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(X.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(X.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},Q.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind===`get`?0:1;if(e.value.params.length!==n){var r=e.value.start;e.kind===`get`?this.raiseRecoverable(r,`getter should have no params`):this.raiseRecoverable(r,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)},Q.parsePropertyValue=function(e,t,n,r,i,a,o,s){(n||r)&&this.type===X.colon&&this.unexpected(),this.eat(X.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`):this.options.ecmaVersion>=6&&this.type===X.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,r),e.kind=`init`):!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==X.comma&&this.type!==X.braceR&&this.type!==X.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===X.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind=`init`,e.shorthand=!0):this.unexpected()},Q.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(X.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(X.bracketR),e.key;e.computed=!1}return e.key=this.type===X.num||this.type===X.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},Q.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Q.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(rA(t,r.generator)|Qk|(n?$k:0)),this.expect(X.parenL),r.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},Q.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(rA(n,!1)|Xk),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},Q.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==X.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,lA),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},Q.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},Q.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,aA,t?null:n)}},Q.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(X.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===X.comma?o=null:this.type===X.ellipsis?(o=this.parseSpread(r),r&&this.type===X.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},Q.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),!(this.currentThisScope().flags&nA)&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},Q.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},Q.parseIdentNode=function(){var e=this.startNode();return this.type===X.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,e.name!==`class`&&e.name!==`function`||this.lastTokEnd===this.lastTokStart+1&&this.input.charCodeAt(this.lastTokStart)===46||this.context.pop(),this.type=X.name):this.unexpected(),e},Q.parsePrivateIdent=function(){var e=this.startNode();return this.type===X.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},Q.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===X.semi||this.canInsertSemicolon()||this.type!==X.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(X.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},Q.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var AA=uA.prototype;AA.raise=function(e,t){var n=Vk(this.input,e);t+=` (`+n.line+`:`+n.column+`)`,this.sourceFile&&(t+=` in `+this.sourceFile);var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},AA.raiseRecoverable=AA.raise,AA.curPosition=function(){if(this.options.locations)return new zk(this.curLine,this.pos-this.lineStart)};var jA=uA.prototype,MA=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};jA.enterScope=function(e){this.scopeStack.push(new MA(e))},jA.exitScope=function(){this.scopeStack.pop()},jA.treatFunctionsAsVarInScope=function(e){return e.flags&qk||!this.inModule&&e.flags&Kk},jA.declareName=function(e,t,n){var r=!1;if(t===oA){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&Kk&&delete this.undefinedExports[e]}else if(t===cA)this.currentScope().lexical.push(e);else if(t===sA){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&Zk&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&Kk&&delete this.undefinedExports[e],s.flags&nA)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},jA.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},jA.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},jA.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(nA|tA|eA))return t}},jA.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(nA|tA|eA)&&!(t.flags&Xk))return t}};var NA=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new Bk(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},PA=uA.prototype;PA.startNode=function(){return new NA(this,this.start,this.startLoc)},PA.startNodeAt=function(e,t){return new NA(this,e,t)};function FA(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}PA.finishNode=function(e,t){return FA.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},PA.finishNodeAt=function(e,t,n,r){return FA.call(this,e,t,n,r)},PA.copyNode=function(e){var t=new NA(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var IA=`Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz`,LA=`ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`,RA=LA+` Extended_Pictographic`,zA=RA,BA=zA+` EBase EComp EMod EPres ExtPict`,VA=BA,HA={9:LA,10:RA,11:zA,12:BA,13:VA,14:VA},UA={9:``,10:``,11:``,12:``,13:``,14:`Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji`},WA=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,GA=`Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,KA=GA+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,qA=KA+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,JA=qA+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,YA=JA+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,XA={9:GA,10:KA,11:qA,12:JA,13:YA,14:YA+` `+IA},ZA={};function QA(e){var t=ZA[e]={binary:Ik(HA[e]+` `+WA),binaryOfStrings:Ik(UA[e]),nonBinary:{General_Category:Ik(WA),Script:Ik(XA[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var $A=0,ej=[9,10,11,12,13,14];$A<ej.length;$A+=1){var tj=ej[$A];QA(tj)}var $=uA.prototype,nj=function(e,t){this.parent=e,this.base=t||this};nj.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},nj.prototype.sibling=function(){return new nj(this.parent,this.base)};var rj=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``)+(e.options.ecmaVersion>=15?`v`:``),this.unicodeProperties=ZA[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};rj.prototype.reset=function(e,t,n){var r=n.indexOf(`v`)!==-1,i=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},rj.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},rj.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},rj.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},rj.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},rj.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},rj.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},rj.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},rj.prototype.eatChars=function(e,t){t===void 0&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var a=i[r],o=this.at(n,t);if(o===-1||o!==a)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},$.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,a=0;a<n.length;a++){var o=n.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(o,a+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`),o===`u`&&(r=!0),o===`v`&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,`Invalid regular expression flag`)};function ij(e){for(var t in e)return!0;return!1}$.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&ij(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},$.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise(`Invalid named capture referenced`)}},$.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new nj(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},$.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},$.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},$.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},$.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},$.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},$.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},$.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},$.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},$.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);n.indexOf(a,i+1)>-1&&e.raise(`Duplicate regular expression modifiers`)}if(r){var o=this.regexp_eatModifiers(e);!n&&!o&&e.current()===58&&e.raise(`Invalid regular expression modifiers`);for(var s=0;s<o.length;s++){var c=o.charAt(s);(o.indexOf(c,s+1)>-1||n.indexOf(c)>-1)&&e.raise(`Duplicate regular expression modifiers`)}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}}e.pos=t}return!1},$.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},$.regexp_eatModifiers=function(e){for(var t=``,n=0;(n=e.current())!==-1&&aj(n);)t+=Lk(n),e.advance();return t};function aj(e){return e===105||e===109||e===115}$.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},$.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},$.regexp_eatSyntaxCharacter=function(e){var t=e.current();return oj(t)?(e.lastIntValue=t,e.advance(),!0):!1};function oj(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}$.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!oj(n);)e.advance();return e.pos!==t},$.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124&&(e.advance(),!0)},$.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise(`Invalid group`);var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n){if(t)for(var r=0,i=n;r<i.length;r+=1)i[r].separatedFrom(e.branchID)||e.raise(`Duplicate capture group name`);else e.raise(`Duplicate capture group name`)}t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},$.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},$.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Lk(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Lk(e.lastIntValue);return!0}return!1},$.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),sj(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function sj(e){return gk(e,!0)||e===36||e===95}$.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),cj(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function cj(e){return _k(e,!0)||e===36||e===95||e===8204||e===8205}$.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},$.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},$.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},$.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},$.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},$.regexp_eatZero=function(e){return e.current()===48&&!bj(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},$.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114&&(e.lastIntValue=13,e.advance(),!0)},$.regexp_eatControlLetter=function(e){var t=e.current();return lj(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function lj(e){return e>=65&&e<=90||e>=97&&e<=122}$.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&uj(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function uj(e){return e>=0&&e<=1114111}$.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)&&(e.lastIntValue=t,e.advance(),!0)},$.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var dj=0,fj=1,pj=2;$.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(mj(t))return e.lastIntValue=-1,e.advance(),fj;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===pj&&e.raise(`Invalid property name`),r;e.raise(`Invalid property name`)}return dj};function mj(e){return e===100||e===68||e===115||e===83||e===119||e===87}$.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),fj}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return dj},$.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){Nk(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},$.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return fj;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return pj;e.raise(`Invalid property name`)},$.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;hj(t=e.current());)e.lastStringValue+=Lk(t),e.advance();return e.lastStringValue!==``};function hj(e){return lj(e)||e===95}$.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;gj(t=e.current());)e.lastStringValue+=Lk(t),e.advance();return e.lastStringValue!==``};function gj(e){return hj(e)||bj(e)}$.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},$.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise(`Unterminated character class`),t&&n===pj&&e.raise(`Negated character class may contain strings`),!0}return!1},$.regexp_classContents=function(e){return e.current()===93?fj:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),fj)},$.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},$.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||Cj(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r!==93&&(e.lastIntValue=r,e.advance(),!0)},$.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},$.regexp_classSetExpression=function(e){var t=fj,n;if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e)){n===pj&&(t=pj);for(var r=e.pos;e.eatChars([38,38]);)e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))?n!==pj&&(t=fj):e.raise(`Invalid character in character class`);if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise(`Invalid character in character class`);if(r!==e.pos)return t}else e.raise(`Invalid character in character class`)}for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===pj&&(t=pj)}},$.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise(`Range out of order in character class`),!0}e.pos=t}return!1},$.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?fj:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},$.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===pj&&e.raise(`Negated character class may contain strings`),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},$.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise(`Invalid escape`);e.pos=t}return null},$.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===pj&&(t=pj);return t},$.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?fj:pj},$.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&_j(n)||vj(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function _j(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function vj(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}$.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return yj(t)?(e.lastIntValue=t,e.advance(),!0):!1};function yj(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}$.regexp_eatClassControlLetter=function(e){var t=e.current();return bj(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},$.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},$.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;bj(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function bj(e){return e>=48&&e<=57}$.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;xj(n=e.current());)e.lastIntValue=16*e.lastIntValue+Sj(n),e.advance();return e.pos!==t};function xj(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Sj(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}$.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;e.lastIntValue=t<=3&&this.regexp_eatOctalDigit(e)?t*64+n*8+e.lastIntValue:t*8+n}else e.lastIntValue=t;return!0}return!1},$.regexp_eatOctalDigit=function(e){var t=e.current();return Cj(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Cj(e){return e>=48&&e<=55}$.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!xj(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+Sj(i),e.advance()}return!0};var wj=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new Bk(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Tj=uA.prototype;Tj.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new wj(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Tj.getToken=function(){return this.next(),new wj(this)},typeof Symbol<`u`&&(Tj[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===X.eof,value:t}}}}),Tj.nextToken=function(){var e=this.curContext();if(e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(X.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},Tj.readToken=function(e){return gk(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},Tj.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},Tj.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=Dk(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},Tj.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!Ek(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},Tj.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&Ok.test(String.fromCharCode(e)))++this.pos;else break loop}}},Tj.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Tj.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(X.ellipsis)):(++this.pos,this.finishToken(X.dot))},Tj.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(X.assign,2):this.finishOp(X.slash,1)},Tj.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?X.star:X.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=X.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(X.assign,n+1):this.finishOp(r,n)},Tj.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(X.assign,3):this.finishOp(e===124?X.logicalOR:X.logicalAND,2):t===61?this.finishOp(X.assign,2):this.finishOp(e===124?X.bitwiseOR:X.bitwiseAND,1)},Tj.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(X.assign,2):this.finishOp(X.bitwiseXOR,1)},Tj.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||wk.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(X.incDec,2):t===61?this.finishOp(X.assign,2):this.finishOp(X.plusMin,1)},Tj.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(X.assign,n+1):this.finishOp(X.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(X.relational,n))},Tj.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(X.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(X.arrow)):this.finishOp(e===61?X.eq:X.prefix,1)},Tj.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(X.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(X.assign,3):this.finishOp(X.coalesce,2)}return this.finishOp(X.question,1)},Tj.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),gk(t,!0)||t===92))return this.finishToken(X.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+Lk(t)+`'`)},Tj.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(X.parenL);case 41:return++this.pos,this.finishToken(X.parenR);case 59:return++this.pos,this.finishToken(X.semi);case 44:return++this.pos,this.finishToken(X.comma);case 91:return++this.pos,this.finishToken(X.bracketL);case 93:return++this.pos,this.finishToken(X.bracketR);case 123:return++this.pos,this.finishToken(X.braceL);case 125:return++this.pos,this.finishToken(X.braceR);case 58:return++this.pos,this.finishToken(X.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(X.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(X.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+Lk(e)+`'`)},Tj.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Tj.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(wk.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new rj(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(X.regexp,{pattern:i,flags:o,value:c})},Tj.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95)i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;else{if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function Ej(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function Dj(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}Tj.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=Dj(this.input.slice(t,this.pos)),++this.pos):gk(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(X.num,n)},Tj.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=Dj(this.input.slice(t,this.pos));return++this.pos,gk(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(X.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),r!==69&&r!==101||n||(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),gk(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=Ej(this.input.slice(t,this.pos),n);return this.finishToken(X.num,a)},Tj.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},Tj.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Ek(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(X.string,t)};var Oj={};Tj.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Oj)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},Tj.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Oj;this.raise(e,t)},Tj.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===X.template||this.type===X.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(X.dollarBraceL)):(++this.pos,this.finishToken(X.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(X.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Ek(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
65
+ `;break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Tj.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(X.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
66
+ `&&++this.pos;case`
67
+ `:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,`Unterminated template`)},Tj.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
68
+ `;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Lk(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return Ek(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},Tj.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},Tj.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(_k(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?gk:_k)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=Lk(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},Tj.readWord=function(){var e=this.readWord1(),t=X.name;return this.keywords.test(e)&&(t=Sk[e]),this.finishToken(t,e)},uA.acorn={Parser:uA,version:`8.15.0`,defaultOptions:Hk,Position:zk,SourceLocation:Bk,getLineInfo:Vk,Node:NA,TokenType:vk,tokTypes:X,keywordTypes:Sk,TokContext:wA,tokContexts:TA,isIdentifierChar:_k,isIdentifierStart:gk,Token:wj,isNewLine:Ek,lineBreak:wk,lineBreakG:Tk,nonASCIIwhitespace:Ok};var kj=o(((e,t)=>{t.exports={quot:`"`,amp:`&`,apos:`'`,lt:`<`,gt:`>`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,fnof:`ƒ`,circ:`ˆ`,tilde:`˜`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,bull:`•`,hellip:`…`,permil:`‰`,prime:`′`,Prime:`″`,lsaquo:`‹`,rsaquo:`›`,oline:`‾`,frasl:`⁄`,euro:`€`,image:`ℑ`,weierp:`℘`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`}})),Aj=o(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.acorn={}))})(n,(function(e){var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,31,4,33,15,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,7,0,259,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,481,1,61,4,4,5,9,7,3,6,31,3,149,2,12,2,9,1,3,0,33,1,1357,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,13,65,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,18,21,18,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,18,0,182,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,22,0,239,18,16,0,2,12,2,33,125,0,80,921,103,111,6,206,13,310,2314,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7386,37,33,96,114,14,913,15,50,7710,3,2,6,2,1,2,296,10,0,30,2,3,0,15,4,8,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,340,2,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,129,15,6,55,50,49,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4382,2,5773,3,7472,16,621,2467,541,1507,4938,6,8489,39815,11327],r=`‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄ-׉ؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୓-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫰ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`,i=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆ՘ՙՠ-ֈ֋֌א-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿ₏-₟ℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-꟝꟢꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩ꭬꭭ꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,a={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},o=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,s={5:o,"5module":o+` export import`,6:o+` const class extends export import super`},c=/^in(stanceof)?$/,l=RegExp(`[`+i+`]`),u=RegExp(`[`+i+r+`]`);function d(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function f(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&l.test(String.fromCharCode(e)):t!==!1&&d(e,n)}function p(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&u.test(String.fromCharCode(e)):r===!1?!1:d(e,n)||d(e,t)}var m=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function h(e,t){return new m(e,{beforeExpr:!0,binop:t})}var g={beforeExpr:!0},_={startsExpr:!0},v={};function y(e,t){return t===void 0&&(t={}),t.keyword=e,v[e]=new m(e,t)}var b={num:new m(`num`,_),regexp:new m(`regexp`,_),string:new m(`string`,_),name:new m(`name`,_),privateId:new m(`privateId`,_),eof:new m(`eof`),bracketL:new m(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new m(`]`),braceL:new m(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new m(`}`),parenL:new m(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new m(`)`),comma:new m(`,`,g),semi:new m(`;`,g),colon:new m(`:`,g),dot:new m(`.`),question:new m(`?`,g),questionDot:new m(`?.`),arrow:new m(`=>`,g),template:new m(`template`),invalidTemplate:new m(`invalidTemplate`),ellipsis:new m(`...`,g),backQuote:new m("`",_),dollarBraceL:new m("${",{beforeExpr:!0,startsExpr:!0}),eq:new m(`=`,{beforeExpr:!0,isAssign:!0}),assign:new m(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new m(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new m(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:h(`||`,1),logicalAND:h(`&&`,2),bitwiseOR:h(`|`,3),bitwiseXOR:h(`^`,4),bitwiseAND:h(`&`,5),equality:h(`==/!=/===/!==`,6),relational:h(`</>/<=/>=`,7),bitShift:h(`<</>>/>>>`,8),plusMin:new m(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:h(`%`,10),star:h(`*`,10),slash:h(`/`,10),starstar:new m(`**`,{beforeExpr:!0}),coalesce:h(`??`,1),_break:y(`break`),_case:y(`case`,g),_catch:y(`catch`),_continue:y(`continue`),_debugger:y(`debugger`),_default:y(`default`,g),_do:y(`do`,{isLoop:!0,beforeExpr:!0}),_else:y(`else`,g),_finally:y(`finally`),_for:y(`for`,{isLoop:!0}),_function:y(`function`,_),_if:y(`if`),_return:y(`return`,g),_switch:y(`switch`),_throw:y(`throw`,g),_try:y(`try`),_var:y(`var`),_const:y(`const`),_while:y(`while`,{isLoop:!0}),_with:y(`with`),_new:y(`new`,{beforeExpr:!0,startsExpr:!0}),_this:y(`this`,_),_super:y(`super`,_),_class:y(`class`,_),_extends:y(`extends`,g),_export:y(`export`),_import:y(`import`,_),_null:y(`null`,_),_true:y(`true`,_),_false:y(`false`,_),_in:y(`in`,{beforeExpr:!0,binop:7}),_instanceof:y(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:y(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:y(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:y(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},x=/\r\n?|\n|\u2028|\u2029/,S=new RegExp(x.source,`g`);function C(e){return e===10||e===13||e===8232||e===8233}function w(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(C(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var T=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,E=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ee=Object.prototype,D=ee.hasOwnProperty,te=ee.toString,ne=Object.hasOwn||(function(e,t){return D.call(e,t)}),re=Array.isArray||(function(e){return te.call(e)===`[object Array]`}),ie=Object.create(null);function O(e){return ie[e]||(ie[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function k(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var ae=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,oe=function(e,t){this.line=e,this.column=t};oe.prototype.offset=function(e){return new oe(this.line,this.column+e)};var se=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function ce(e,t){for(var n=1,r=0;;){var i=w(e,r,t);if(i<0)return new oe(n,t-r);++n,r=i}}var le={ecmaVersion:null,sourceType:`script`,strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},ue=!1;function de(e){var t={};for(var n in le)t[n]=e&&ne(e,n)?e[n]:le[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!ue&&typeof console==`object`&&console.warn&&(ue=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
69
+ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,e&&e.allowHashBang!=null||(t.allowHashBang=t.ecmaVersion>=14),re(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}if(re(t.onComment)&&(t.onComment=fe(t,t.onComment)),t.sourceType===`commonjs`&&t.allowAwaitOutsideFunction)throw Error(`Cannot use allowAwaitOutsideFunction with sourceType: commonjs`);return t}function fe(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new se(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var pe=1,me=2,he=4,ge=8,_e=16,ve=32,ye=64,be=128,xe=256,Se=512,Ce=1024,we=pe|me|xe;function Te(e,t){return me|(e?he:0)|(t?ge:0)}var Ee=0,De=1,Oe=2,ke=3,Ae=4,je=5,Me=function(e,t,n){this.options=e=de(e),this.sourceFile=e.sourceFile,this.keywords=O(s[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=a[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=O(r);var i=(r?r+` `:``)+a.strict;this.reservedWordsStrict=O(i),this.reservedWordsStrictBind=O(i+` `+a.strictBind),this.input=String(t),this.containsEsc=!1,this.pos=n||0,this.curLine=1,e.startLocation?(this.lineStart=this.pos-e.startLocation.column,this.curLine=e.startLocation.line):n?(this.lineStart=this.input.lastIndexOf(`
70
+ `,n-1)+1,this.options.locations&&(this.curLine=this.input.slice(0,this.lineStart).split(x).length)):this.lineStart=0,this.type=b.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||e.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType===`commonjs`?me:pe),this.regexpState=null,this.privateNameStack=[]},Ne={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};Me.prototype.parse=function(){var e=this,t=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return e.parseTopLevel(t)})},Ne.inFunction.get=function(){return(this.currentVarScope().flags&me)>0},Ne.inGenerator.get=function(){return(this.currentVarScope().flags&ge)>0},Ne.inAsync.get=function(){return(this.currentVarScope().flags&he)>0},Ne.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(xe|Se))return!1;if(t&me)return(t&he)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Ne.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&pe)},Ne.allowSuper.get=function(){return(this.currentThisScope().flags&ye)>0||this.options.allowSuperOutsideMethod},Ne.allowDirectSuper.get=function(){return(this.currentThisScope().flags&be)>0},Ne.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Ne.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(xe|Se)||t&me&&!(t&_e))return!0}return!1},Ne.allowUsing.get=function(){var e=this.currentScope().flags;return!(e&Ce||!this.inModule&&e&pe)},Ne.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&xe)>0},Me.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},Me.parse=function(e,t){return new this(t,e).parse()},Me.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},Me.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(Me.prototype,Ne);var Pe=Me.prototype,Fe=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Pe.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){E.lastIndex=e,e+=E.exec(this.input)[0].length;var t=Fe.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){E.lastIndex=e+t[0].length;var n=E.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||x.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`||i===`i`&&Ie(this,r))}e+=t[0].length,E.lastIndex=e,e+=E.exec(this.input)[0].length,this.input[e]===`;`&&e++}};function Ie(e,t){for(var n=t+1,r=Math.min(e.input.length,t+11);n<r;){var i=e.fullCharCodeAt(n);if(!p(i,!0))break;n+=i<=65535?1:2}return n===t+2&&e.input.slice(t,n)===`in`||n===t+10&&e.input.slice(t,n)===`instanceof`}Pe.eat=function(e){return this.type===e&&(this.next(),!0)},Pe.isContextual=function(e){return this.type===b.name&&this.value===e&&!this.containsEsc},Pe.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},Pe.catchStackOverflow=function(e){try{return e()}catch(e){if(e instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message)||/\btoo much recursion\b/i.test(e.message)))this.raise(this.start,`Not enough stack space to parse input`);else throw e}},Pe.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},Pe.canInsertSemicolon=function(){return this.type===b.eof||this.type===b.braceR||x.test(this.input.slice(this.lastTokEnd,this.start))},Pe.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Pe.semicolon=function(){!this.eat(b.semi)&&!this.insertSemicolon()&&this.unexpected()},Pe.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},Pe.expect=function(e){this.eat(e)||this.unexpected()},Pe.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var Le=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Pe.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},Pe.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},Pe.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},Pe.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var A=Me.prototype;A.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==b.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType===`commonjs`?`script`:this.options.sourceType,this.finishNode(e,`Program`)};var Re={kind:`loop`},ze={kind:`switch`};A.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;E.lastIndex=this.pos;var t=E.exec(this.input),n=this.pos+t[0].length,r=this.fullCharCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(f(r)){var i=n;do n+=r<=65535?1:2;while(p(r=this.fullCharCodeAt(n)));if(r===92)return!0;var a=this.input.slice(i,n);if(!c.test(a))return!0}return!1},A.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;E.lastIndex=this.pos;var e=E.exec(this.input),t=this.pos+e[0].length,n;return!x.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(p(n=this.fullCharCodeAt(t+8))||n===92))},A.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?`await`:`using`))return!1;E.lastIndex=this.pos;var n=E.exec(this.input),r=this.pos+n[0].length;if(x.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,a;if(this.input.slice(r,i)!==`using`||i===this.input.length||p(a=this.fullCharCodeAt(i))||a===92)return!1;E.lastIndex=i;var o=E.exec(this.input);if(r=i+o[0].length,o&&x.test(this.input.slice(i,r)))return!1}var s=this.fullCharCodeAt(r);if(!f(s)&&s!==92)return!1;var l=r;do r+=s<=65535?1:2;while(p(s=this.fullCharCodeAt(r)));if(s===92)return!0;var u=this.input.slice(l,r);if(c.test(u))return!1;if(t&&!e&&u===`of`){E.lastIndex=r;var d=E.exec(this.input);if(r+=d[0].length,this.input.charCodeAt(r)!==61||(s=this.input.charCodeAt(r+1))===61||s===62)return!1}return!0},A.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},A.isUsing=function(e){return this.isUsingKeyword(!1,e)},A.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=b._var,a=`let`),r){case b._break:case b._continue:return this.parseBreakContinueStatement(i,r.keyword);case b._debugger:return this.parseDebuggerStatement(i);case b._do:return this.parseDoStatement(i);case b._for:return this.parseForStatement(i);case b._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case b._class:return e&&this.unexpected(),this.parseClass(i,!0);case b._if:return this.parseIfStatement(i);case b._return:return this.parseReturnStatement(i);case b._switch:return this.parseSwitchStatement(i);case b._throw:return this.parseThrowStatement(i);case b._try:return this.parseTryStatement(i);case b._const:case b._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case b._while:return this.parseWhileStatement(i);case b._with:return this.parseWithStatement(i);case b.braceL:return this.parseBlock(!0,i);case b.semi:return this.parseEmptyStatement(i);case b._export:case b._import:if(this.options.ecmaVersion>10&&r===b._import){E.lastIndex=this.pos;var o=E.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===b._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.isAwaitUsing(!1)?`await using`:this.isUsing(!1)?`using`:null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),e&&this.raise(this.start,`Using declaration is not allowed in single-statement positions`),l===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.next(),this.parseVar(i,!1,l),this.semicolon(),this.finishNode(i,`VariableDeclaration`);var u=this.value,d=this.parseExpression();return r===b.name&&d.type===`Identifier`&&this.eat(b.colon)?this.parseLabeledStatement(i,u,d,e):this.parseExpressionStatement(i,d)}},A.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(b.semi)||this.insertSemicolon()?e.label=null:this.type===b.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},A.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},A.parseDoStatement=function(e){return this.next(),this.labels.push(Re),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(b._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(b.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},A.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(Re),this.enterScope(0),this.expect(b.parenL),this.type===b.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===b._var||this.type===b._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),this.parseForAfterInit(e,r,t)}var a=this.isContextual(`let`),o=!1,s=this.isUsing(!0)?`using`:this.isAwaitUsing(!0)?`await using`:null;if(s){var c=this.startNode();return this.next(),s===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.parseVar(c,!0,s),this.finishNode(c,`VariableDeclaration`),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,u=new Le,d=this.start,f=t>-1?this.parseExprSubscripts(u,`await`):this.parseExpression(!0,u);return this.type===b._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===b._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!l&&f.type===`Identifier`&&f.name===`async`?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&o&&this.raise(f.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(f,!1,u),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},A.parseForAfterInit=function(e,t,n){return(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&t.declarations.length===1?(this.type===b._in?(t.kind!==`using`&&t.kind!==`await using`||t.declarations[0].init||this.raise(this.start,`Using declaration is not allowed in for-in loops`),this.options.ecmaVersion>=9&&n>-1&&this.unexpected(n)):this.options.ecmaVersion>=9&&(e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},A.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,Ve|(n?0:He),!1,t)},A.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(b._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},A.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,`'return' outside of function`),this.next(),this.eat(b.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},A.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(b.braceL),this.labels.push(ze),this.enterScope(Ce);for(var t,n=!1;this.type!==b.braceR;)if(this.type===b._case||this.type===b._default){var r=this.type===b._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(b.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},A.parseThrowStatement=function(e){return this.next(),x.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var Be=[];A.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?ve:0),this.checkLValPattern(e,t?Ae:Oe),this.expect(b.parenR),e},A.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===b._catch){var t=this.startNode();this.next(),this.eat(b.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(b._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},A.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},A.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Re),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},A.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},A.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},A.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===b._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},A.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},A.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(b.braceL),e&&this.enterScope(0);this.type!==b.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},A.parseFor=function(e,t){return e.init=t,this.expect(b.semi),e.test=this.type===b.semi?null:this.parseExpression(),this.expect(b.semi),e.update=this.type===b.parenR?null:this.parseExpression(),this.expect(b.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},A.parseForIn=function(e,t){var n=this.type===b._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(b.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},A.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(b.eq)?i.init=this.parseMaybeAssign(t):!r&&n===`const`&&!(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():!r&&(n===`using`||n===`await using`)&&this.options.ecmaVersion>=17&&this.type!==b._in&&!this.isContextual(`of`)?this.raise(this.lastTokEnd,`Missing initializer in `+n+` declaration`):!r&&i.id.type!==`Identifier`&&(!t||this.type!==b._in&&!this.isContextual(`of`))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):i.init=null,e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(b.comma))break}return e},A.parseVarId=function(e,t){e.id=t===`using`||t===`await using`?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?De:Oe,!1)};var Ve=1,He=2,Ue=4;A.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===b.star&&t&He&&this.unexpected(),e.generator=this.eat(b.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Ve&&(e.id=t&Ue&&this.type!==b.name?null:this.parseIdent(),e.id&&!(t&He)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?De:Oe:ke));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Te(e.async,e.generator)),t&Ve||(e.id=this.type===b.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&Ve?`FunctionDeclaration`:`FunctionExpression`)},A.parseFunctionParams=function(e){this.expect(b.parenL),e.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},A.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(b.braceL);this.type!==b.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&We(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},A.parseClassElement=function(e){if(this.eat(b.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(b.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===b.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===b.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(b.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===b.parenL||o!==`method`||i||a){var l=!n.static&&Ge(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},A.isClassElementNameStart=function(){return this.type===b.name||this.type===b.privateId||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword},A.parseClassElementName=function(e){this.type===b.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},A.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&Ge(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},A.parseClassField=function(e){return Ge(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&Ge(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(b.eq)?(this.enterScope(Se|ye),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,`PropertyDefinition`)},A.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(xe|ye);this.type!==b.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},A.parseClassId=function(e,t){this.type===b.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,Oe,!1)):(t===!0&&this.unexpected(),e.id=null)},A.parseClassSuper=function(e){e.superClass=this.eat(b._extends)?this.parseExprSubscripts(null,!1):null},A.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},A.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];ne(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function We(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function Ge(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}A.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},A.parseExport=function(e,t){if(this.next(),this.eat(b.star))return this.parseExportAllDeclaration(e,t);if(this.eat(b._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},A.parseExportDeclaration=function(e){return this.parseStatement(null)},A.parseExportDefaultDeclaration=function(){var e;if(this.type===b._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Ve|Ue,!1,e)}if(this.type===b._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}var r=this.parseMaybeAssign();return this.semicolon(),r},A.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),ne(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},A.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},A.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},A.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},A.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,`ExportSpecifier`)},A.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(b.braceL);!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;t.push(this.parseExportSpecifier(e))}return t},A.parseImport=function(e){return this.next(),this.type===b.string?(e.specifiers=Be,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===b.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},A.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,Oe),this.finishNode(e,`ImportSpecifier`)},A.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,Oe),this.finishNode(e,`ImportDefaultSpecifier`)},A.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,Oe),this.finishNode(e,`ImportNamespaceSpecifier`)},A.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===b.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(b.comma)))return e;if(this.type===b.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(b.braceL);!this.eat(b.braceR);){if(t)t=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;e.push(this.parseImportSpecifier())}return e},A.parseWithClause=function(){var e=[];if(!this.eat(b._with))return e;this.expect(b.braceL);for(var t={},n=!0;!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;ne(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},A.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===b.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(b.colon),this.type!==b.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},A.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===b.string){var e=this.parseLiteral(this.value);return ae.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},A.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},A.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var Ke=Me.prototype;Ke.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},Ke.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},Ke.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},Ke.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==b.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},Ke.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case b.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(b.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case b.braceL:return this.parseObj(!0)}return this.parseIdent()},Ke.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(b.comma),t&&this.type===b.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===b.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===b.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else i.push(this.parseAssignableListItem(r));return i},Ke.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},Ke.parseBindingListItem=function(e){return e},Ke.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(b.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},Ke.checkLValSimple=function(e,t,n){t===void 0&&(t=Ee);var r=t!==Ee;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===Oe&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(ne(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==je&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},Ke.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=Ee),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},Ke.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=Ee),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var qe=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},j={b_stat:new qe(`{`,!1),b_expr:new qe(`{`,!0),b_tmpl:new qe("${",!1),p_stat:new qe(`(`,!1),p_expr:new qe(`(`,!0),q_tmpl:new qe("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new qe(`function`,!1),f_expr:new qe(`function`,!0),f_expr_gen:new qe(`function`,!0,!1,null,!0),f_gen:new qe(`function`,!1,!1,null,!0)},M=Me.prototype;M.initialContext=function(){return[j.b_stat]},M.curContext=function(){return this.context[this.context.length-1]},M.braceIsBlock=function(e){var t=this.curContext();return t===j.f_expr||t===j.f_stat?!0:e===b.colon&&(t===j.b_stat||t===j.b_expr)?!t.isExpr:e===b._return||e===b.name&&this.exprAllowed?x.test(this.input.slice(this.lastTokEnd,this.start)):e===b._else||e===b.semi||e===b.eof||e===b.parenR||e===b.arrow?!0:e===b.braceL?t===j.b_stat:e===b._var||e===b._const||e===b.name?!1:!this.exprAllowed},M.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},M.updateContext=function(e){var t,n=this.type;n.keyword&&e===b.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},M.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},b.parenR.updateContext=b.braceR.updateContext=function(){if(this.context.length===1)this.exprAllowed=!0;else{var e=this.context.pop();e===j.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}},b.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?j.b_stat:j.b_expr),this.exprAllowed=!0},b.dollarBraceL.updateContext=function(){this.context.push(j.b_tmpl),this.exprAllowed=!0},b.parenL.updateContext=function(e){var t=e===b._if||e===b._for||e===b._with||e===b._while;this.context.push(t?j.p_stat:j.p_expr),this.exprAllowed=!0},b.incDec.updateContext=function(){},b._function.updateContext=b._class.updateContext=function(e){e.beforeExpr&&e!==b._else&&(e!==b.semi||this.curContext()===j.p_stat)&&!(e===b._return&&x.test(this.input.slice(this.lastTokEnd,this.start)))&&(e!==b.colon&&e!==b.braceL||this.curContext()!==j.b_stat)?this.context.push(j.f_expr):this.context.push(j.f_stat),this.exprAllowed=!1},b.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},b.backQuote.updateContext=function(){this.curContext()===j.q_tmpl?this.context.pop():this.context.push(j.q_tmpl),this.exprAllowed=!1},b.star.updateContext=function(e){if(e===b._function){var t=this.context.length-1;this.context[t]===j.f_expr?this.context[t]=j.f_expr_gen:this.context[t]=j.f_gen}this.exprAllowed=!0},b.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==b.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var N=Me.prototype;N.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6)i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);else{i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}}},N.parseExpression=function(e,t){var n=this;return this.catchStackOverflow(function(){var r=n.start,i=n.startLoc,a=n.parseMaybeAssign(e,t);if(n.type===b.comma){var o=n.startNodeAt(r,i);for(o.expressions=[a];n.eat(b.comma);)o.expressions.push(n.parseMaybeAssign(e,t));return n.finishNode(o,`SequenceExpression`)}return a})},N.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Le,r=!0);var s=this.start,c=this.startLoc;(this.type===b.parenL||this.type===b.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===b.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=-1,t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),t.doubleProto>=l.start&&(t.doubleProto=-1)),this.type===b.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},N.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if((i.type!==`ArrowFunctionExpression`||i.start!==n)&&this.eat(b.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(b.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},N.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},N.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==b._in)&&a>r){var o=this.type===b.logicalOR||this.type===b.logicalAND,s=this.type===b.coalesce;s&&(a=b.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===b.coalesce||s&&(this.type===b.logicalOR||this.type===b.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},N.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},N.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===b.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&Je(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&Ye(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===b.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==b._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&(o.type!==`ArrowFunctionExpression`||o.start!==i)&&this.eat(b.starstar)){if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1)}else return o};function Je(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&Je(e.expression)}function Ye(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&Ye(e.expression)||e.type===`ParenthesizedExpression`&&Ye(e.expression)}N.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=-1,a=-1;e&&(i=e.doubleProto,a=e.shorthandAssign,e.doubleProto=e.shorthandAssign=-1);var o=this.parseExprAtom(e,t);if(o.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return o;var s=this.parseSubscripts(o,n,r,!1,t);return e&&(s.end>o.end&&(this.checkExpressionErrors(e,!0),e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1),e.trailingComma>=s.start&&(e.trailingComma=-1)),i>-1&&(e.doubleProto=i),a>-1&&(e.shorthandAssign=a)),s},N.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s.end===e.end||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s,a=!1}},N.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(b.arrow)},N.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},N.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(b.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(b.bracketL);if(l||c&&this.type!==b.parenL&&this.type!==b.backQuote||this.eat(b.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(b.bracketR)):u.property=this.type===b.privateId&&e.type!==`Super`?this.parsePrivateIdent():this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(b.parenL)){var d=new Le,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,h,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===b.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},N.parseExprAtom=function(e,t,n){this.type===b.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case b._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type===b.parenL&&!this.allowDirectSuper&&this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==b.dot&&this.type!==b.bracketL&&this.type!==b.parenL&&this.unexpected(),this.finishNode(r,`Super`);case b._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case b.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(b._function))return this.overrideContext(j.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(b.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===b.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(b.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case b.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case b.num:case b.string:return this.parseLiteral(this.value);case b._null:case b._true:case b._false:return r=this.startNode(),r.value=this.type===b._null?null:this.type===b._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case b.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case b.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(b.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case b.braceL:return this.overrideContext(j.b_expr),this.parseObj(!1,e);case b._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case b._class:return this.parseClass(this.startNode(),!1);case b._new:return this.parseNew();case b.backQuote:return this.parseTemplate();case b._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},N.parseExprAtomDefault=function(){this.unexpected()},N.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===b.parenL&&!e)return this.parseDynamicImport(t);if(this.type===b.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}this.unexpected()},N.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(b.parenR)?e.options=null:(this.expect(b.comma),this.afterTrailingComma(b.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(b.parenR)||(this.expect(b.comma),this.afterTrailingComma(b.parenR)||this.unexpected())));else if(!this.eat(b.parenR)){var t=this.start;this.eat(b.comma)&&this.eat(b.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},N.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},N.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value==null?t.raw.slice(0,-1).replace(/_/g,``):t.value.toString()),this.next(),this.finishNode(t,`Literal`)},N.parseParenExpression=function(){this.expect(b.parenL);var e=this.parseExpression();return this.expect(b.parenR),e},N.shouldParseArrow=function(e){return!this.canInsertSemicolon()},N.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new Le,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==b.parenR;){if(l?l=!1:this.expect(b.comma),a&&this.afterTrailingComma(b.parenR,!0)){u=!0;break}if(this.type===b.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===b.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}c.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(b.parenR),e&&this.shouldParseArrow(c)&&this.eat(b.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}return i},N.parseParenItem=function(e){return e},N.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var Xe=[];N.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===b.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),e.callee.type===`Super`&&this.raiseRecoverable(r,`Invalid use of 'super'`),e.arguments=this.eat(b.parenL)?this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1):Xe,this.finishNode(e,`NewExpression`)},N.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===b.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,`
71
+ `),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
72
+ `),cooked:this.value},this.next(),n.tail=this.type===b.backQuote,this.finishNode(n,`TemplateElement`)},N.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===b.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(b.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(b.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},N.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===b.name||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===b.star)&&!x.test(this.input.slice(this.lastTokEnd,this.start))},N.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(b.braceR);){if(r)r=!1;else if(this.expect(b.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(b.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},N.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(b.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===b.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===b.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(b.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(b.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},N.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind===`get`?0:1;if(e.value.params.length!==n){var r=e.value.start;e.kind===`get`?this.raiseRecoverable(r,`getter should have no params`):this.raiseRecoverable(r,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)},N.parsePropertyValue=function(e,t,n,r,i,a,o,s){(n||r)&&this.type===b.colon&&this.unexpected(),this.eat(b.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`):this.options.ecmaVersion>=6&&this.type===b.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,r),e.kind=`init`):!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==b.comma&&this.type!==b.braceR&&this.type!==b.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===b.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind=`init`,e.shorthand=!0):this.unexpected()},N.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(b.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(b.bracketR),e.key;e.computed=!1}return e.key=this.type===b.num||this.type===b.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},N.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},N.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Te(t,r.generator)|ye|(n?be:0)),this.expect(b.parenL),r.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},N.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(Te(n,!1)|_e),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},N.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==b.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,je),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},N.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},N.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,De,t?null:n)}},N.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(b.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===b.comma?o=null:this.type===b.ellipsis?(o=this.parseSpread(r),r&&this.type===b.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},N.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),!(this.currentThisScope().flags&we)&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},N.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},N.parseIdentNode=function(){var e=this.startNode();return this.type===b.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,e.name!==`class`&&e.name!==`function`||this.lastTokEnd===this.lastTokStart+1&&this.input.charCodeAt(this.lastTokStart)===46||this.context.pop(),this.type=b.name):this.unexpected(),e},N.parsePrivateIdent=function(){var e=this.startNode();return this.type===b.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},N.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===b.semi||this.canInsertSemicolon()||this.type!==b.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(b.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},N.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var Ze=Me.prototype;Ze.raise=function(e,t){var n=ce(this.input,e);t+=` (`+n.line+`:`+n.column+`)`,this.sourceFile&&(t+=` in `+this.sourceFile);var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},Ze.raiseRecoverable=Ze.raise,Ze.curPosition=function(){if(this.options.locations)return new oe(this.curLine,this.pos-this.lineStart)};var Qe=Me.prototype,$e=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};Qe.enterScope=function(e){this.scopeStack.push(new $e(e))},Qe.exitScope=function(){this.scopeStack.pop()},Qe.treatFunctionsAsVarInScope=function(e){return e.flags&me||!this.inModule&&e.flags&pe},Qe.declareName=function(e,t,n){var r=!1;if(t===Oe){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&pe&&delete this.undefinedExports[e]}else if(t===Ae)this.currentScope().lexical.push(e);else if(t===ke){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&ve&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&pe&&delete this.undefinedExports[e],s.flags&we)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},Qe.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},Qe.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Qe.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(we|Se|xe))return t}},Qe.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(we|Se|xe)&&!(t.flags&_e))return t}};var et=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new se(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},tt=Me.prototype;tt.startNode=function(){return new et(this,this.start,this.startLoc)},tt.startNodeAt=function(e,t){return new et(this,e,t)};function nt(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}tt.finishNode=function(e,t){return nt.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},tt.finishNodeAt=function(e,t,n,r){return nt.call(this,e,t,n,r)},tt.copyNode=function(e){var t=new et(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var rt=`Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz`,it=`ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`,at=it+` Extended_Pictographic`,ot=at,st=ot+` EBase EComp EMod EPres ExtPict`,ct=st,lt={9:it,10:at,11:ot,12:st,13:ct,14:ct},ut={9:``,10:``,11:``,12:``,13:``,14:`Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji`},dt=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,ft=`Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,pt=ft+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,mt=pt+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,ht=mt+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,gt=ht+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,_t={9:ft,10:pt,11:mt,12:ht,13:gt,14:gt+` `+rt},P={};function vt(e){var t=P[e]={binary:O(lt[e]+` `+dt),binaryOfStrings:O(ut[e]),nonBinary:{General_Category:O(dt),Script:O(_t[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var yt=0,bt=[9,10,11,12,13,14];yt<bt.length;yt+=1){var xt=bt[yt];vt(xt)}var F=Me.prototype,St=function(e,t){this.parent=e,this.base=t||this};St.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},St.prototype.sibling=function(){return new St(this.parent,this.base)};var Ct=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``)+(e.options.ecmaVersion>=15?`v`:``),this.unicodeProperties=P[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};Ct.prototype.reset=function(e,t,n){var r=n.indexOf(`v`)!==-1,i=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},Ct.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},Ct.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},Ct.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},Ct.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},Ct.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},Ct.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},Ct.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},Ct.prototype.eatChars=function(e,t){t===void 0&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var a=i[r],o=this.at(n,t);if(o===-1||o!==a)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},F.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,a=0;a<n.length;a++){var o=n.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(o,a+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`),o===`u`&&(r=!0),o===`v`&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,`Invalid regular expression flag`)};function wt(e){for(var t in e)return!0;return!1}F.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&wt(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},F.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise(`Invalid named capture referenced`)}},F.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new St(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},F.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},F.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},F.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},F.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},F.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},F.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},F.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},F.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},F.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);n.indexOf(a,i+1)>-1&&e.raise(`Duplicate regular expression modifiers`)}if(r){var o=this.regexp_eatModifiers(e);!n&&!o&&e.current()===58&&e.raise(`Invalid regular expression modifiers`);for(var s=0;s<o.length;s++){var c=o.charAt(s);(o.indexOf(c,s+1)>-1||n.indexOf(c)>-1)&&e.raise(`Duplicate regular expression modifiers`)}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}}e.pos=t}return!1},F.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},F.regexp_eatModifiers=function(e){for(var t=``,n=0;(n=e.current())!==-1&&Tt(n);)t+=k(n),e.advance();return t};function Tt(e){return e===105||e===109||e===115}F.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},F.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},F.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Et(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Et(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}F.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!Et(n);)e.advance();return e.pos!==t},F.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124&&(e.advance(),!0)},F.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise(`Invalid group`);var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n){if(t)for(var r=0,i=n;r<i.length;r+=1)i[r].separatedFrom(e.branchID)||e.raise(`Duplicate capture group name`);else e.raise(`Duplicate capture group name`)}t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},F.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},F.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=k(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=k(e.lastIntValue);return!0}return!1},F.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),Dt(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Dt(e){return f(e,!0)||e===36||e===95}F.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),Ot(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Ot(e){return p(e,!0)||e===36||e===95||e===8204||e===8205}F.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},F.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},F.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},F.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},F.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},F.regexp_eatZero=function(e){return e.current()===48&&!Bt(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},F.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114&&(e.lastIntValue=13,e.advance(),!0)},F.regexp_eatControlLetter=function(e){var t=e.current();return kt(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function kt(e){return e>=65&&e<=90||e>=97&&e<=122}F.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&At(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function At(e){return e>=0&&e<=1114111}F.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)&&(e.lastIntValue=t,e.advance(),!0)},F.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var jt=0,Mt=1,Nt=2;F.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Pt(t))return e.lastIntValue=-1,e.advance(),Mt;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===Nt&&e.raise(`Invalid property name`),r;e.raise(`Invalid property name`)}return jt};function Pt(e){return e===100||e===68||e===115||e===83||e===119||e===87}F.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),Mt}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return jt},F.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){ne(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},F.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return Mt;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return Nt;e.raise(`Invalid property name`)},F.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;Ft(t=e.current());)e.lastStringValue+=k(t),e.advance();return e.lastStringValue!==``};function Ft(e){return kt(e)||e===95}F.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;It(t=e.current());)e.lastStringValue+=k(t),e.advance();return e.lastStringValue!==``};function It(e){return Ft(e)||Bt(e)}F.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},F.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise(`Unterminated character class`),t&&n===Nt&&e.raise(`Negated character class may contain strings`),!0}return!1},F.regexp_classContents=function(e){return e.current()===93?Mt:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),Mt)},F.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},F.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||Ut(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r!==93&&(e.lastIntValue=r,e.advance(),!0)},F.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},F.regexp_classSetExpression=function(e){var t=Mt,n;if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e)){n===Nt&&(t=Nt);for(var r=e.pos;e.eatChars([38,38]);)e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))?n!==Nt&&(t=Mt):e.raise(`Invalid character in character class`);if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise(`Invalid character in character class`);if(r!==e.pos)return t}else e.raise(`Invalid character in character class`)}for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===Nt&&(t=Nt)}},F.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise(`Range out of order in character class`),!0}e.pos=t}return!1},F.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?Mt:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},F.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===Nt&&e.raise(`Negated character class may contain strings`),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},F.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise(`Invalid escape`);e.pos=t}return null},F.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===Nt&&(t=Nt);return t},F.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?Mt:Nt},F.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&Lt(n)||Rt(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function Lt(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Rt(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}F.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return zt(t)?(e.lastIntValue=t,e.advance(),!0):!1};function zt(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}F.regexp_eatClassControlLetter=function(e){var t=e.current();return Bt(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},F.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},F.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Bt(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function Bt(e){return e>=48&&e<=57}F.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Vt(n=e.current());)e.lastIntValue=16*e.lastIntValue+Ht(n),e.advance();return e.pos!==t};function Vt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ht(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}F.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;e.lastIntValue=t<=3&&this.regexp_eatOctalDigit(e)?t*64+n*8+e.lastIntValue:t*8+n}else e.lastIntValue=t;return!0}return!1},F.regexp_eatOctalDigit=function(e){var t=e.current();return Ut(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Ut(e){return e>=48&&e<=55}F.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!Vt(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+Ht(i),e.advance()}return!0};var Wt=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new se(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},I=Me.prototype;I.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new Wt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},I.getToken=function(){return this.next(),new Wt(this)},typeof Symbol<`u`&&(I[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===b.eof,value:t}}}}),I.nextToken=function(){var e=this.curContext();if(e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(b.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},I.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},I.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var n=this.input.charCodeAt(e+1);return n<=56319||n>=57344?t:(t<<10)+n-56613888},I.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},I.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=w(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},I.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!C(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},I.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&T.test(String.fromCharCode(e)))++this.pos;else break loop}}},I.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},I.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(b.ellipsis)):(++this.pos,this.finishToken(b.dot))},I.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(b.assign,2):this.finishOp(b.slash,1)},I.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?b.star:b.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=b.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(b.assign,n+1):this.finishOp(r,n)},I.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(b.assign,3):this.finishOp(e===124?b.logicalOR:b.logicalAND,2):t===61?this.finishOp(b.assign,2):this.finishOp(e===124?b.bitwiseOR:b.bitwiseAND,1)},I.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(b.assign,2):this.finishOp(b.bitwiseXOR,1)},I.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||x.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(b.incDec,2):t===61?this.finishOp(b.assign,2):this.finishOp(b.plusMin,1)},I.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(b.assign,n+1):this.finishOp(b.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(b.relational,n))},I.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(b.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(b.arrow)):this.finishOp(e===61?b.eq:b.prefix,1)},I.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(b.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(b.assign,3):this.finishOp(b.coalesce,2)}return this.finishOp(b.question,1)},I.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),f(t,!0)||t===92))return this.finishToken(b.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+k(t)+`'`)},I.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(b.parenL);case 41:return++this.pos,this.finishToken(b.parenR);case 59:return++this.pos,this.finishToken(b.semi);case 44:return++this.pos,this.finishToken(b.comma);case 91:return++this.pos,this.finishToken(b.bracketL);case 93:return++this.pos,this.finishToken(b.bracketR);case 123:return++this.pos,this.finishToken(b.braceL);case 125:return++this.pos,this.finishToken(b.braceR);case 58:return++this.pos,this.finishToken(b.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(b.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(b.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+k(e)+`'`)},I.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},I.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(x.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new Ct(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(b.regexp,{pattern:i,flags:o,value:c})},I.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95)i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;else{if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function L(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function R(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}I.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=R(this.input.slice(t,this.pos)),++this.pos):f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(b.num,n)},I.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=R(this.input.slice(t,this.pos));return++this.pos,f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(b.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),r!==69&&r!==101||n||(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=L(this.input.slice(t,this.pos),n);return this.finishToken(b.num,a)},I.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},I.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(C(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(b.string,t)};var Gt={};I.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Gt)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},I.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Gt;this.raise(e,t)},I.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===b.template||this.type===b.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(b.dollarBraceL)):(++this.pos,this.finishToken(b.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(b.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(C(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
73
+ `;break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},I.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(b.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
74
+ `&&++this.pos;case`
75
+ `:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,`Unterminated template`)},I.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
76
+ `;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return k(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return C(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},I.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},I.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(p(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?f:p)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=k(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},I.readWord=function(){var e=this.readWord1(),t=b.name;return this.keywords.test(e)&&(t=v[e]),this.finishToken(t,e)};var Kt=`8.19.0`;Me.acorn={Parser:Me,version:Kt,defaultOptions:le,Position:oe,SourceLocation:se,getLineInfo:ce,Node:et,TokenType:m,tokTypes:b,keywordTypes:v,TokContext:qe,tokContexts:j,isIdentifierChar:p,isIdentifierStart:f,Token:Wt,isNewLine:C,lineBreak:x,lineBreakG:S,nonASCIIwhitespace:T};function qt(e,t){return Me.parse(e,t)}function z(e,t,n){return Me.parseExpressionAt(e,t,n)}function Jt(e,t){return Me.tokenizer(e,t)}e.Node=et,e.Parser=Me,e.Position=oe,e.SourceLocation=se,e.TokContext=qe,e.Token=Wt,e.TokenType=m,e.defaultOptions=le,e.getLineInfo=ce,e.isIdentifierChar=p,e.isIdentifierStart=f,e.isNewLine=C,e.keywordTypes=v,e.lineBreak=x,e.lineBreakG=S,e.nonASCIIwhitespace=T,e.parse=qt,e.parseExpressionAt=z,e.tokContexts=j,e.tokTypes=b,e.tokenizer=Jt,e.version=Kt}))})),jj=o(((e,t)=>{var n=kj(),r=/^[\da-fA-F]+$/,i=/^\d+$/,a=new WeakMap;function o(e){e=e.Parser.acorn||e;let t=a.get(e);if(!t){let n=e.tokTypes,r=e.TokContext,i=e.TokenType,o=new r(`<tag`,!1),s=new r(`</tag`,!1),c=new r(`<tag>...</tag>`,!0,!0),l={tc_oTag:o,tc_cTag:s,tc_expr:c},u={jsxName:new i(`jsxName`),jsxText:new i(`jsxText`,{beforeExpr:!0}),jsxTagStart:new i(`jsxTagStart`,{startsExpr:!0}),jsxTagEnd:new i(`jsxTagEnd`)};u.jsxTagStart.updateContext=function(){this.context.push(c),this.context.push(o),this.exprAllowed=!1},u.jsxTagEnd.updateContext=function(e){let t=this.context.pop();t===o&&e===n.slash||t===s?(this.context.pop(),this.exprAllowed=this.curContext()===c):this.exprAllowed=!0},t={tokContexts:l,tokTypes:u},a.set(e,t)}return t}function s(e){if(!e)return e;if(e.type===`JSXIdentifier`)return e.name;if(e.type===`JSXNamespacedName`)return e.namespace.name+`:`+e.name.name;if(e.type===`JSXMemberExpression`)return s(e.object)+`.`+s(e.property)}t.exports=function(e){return e||={},function(t){return c({allowNamespaces:e.allowNamespaces!==!1,allowNamespacedObjects:!!e.allowNamespacedObjects},t)}},Object.defineProperty(t.exports,"tokTypes",{get:function(){return o(Aj()).tokTypes},configurable:!0,enumerable:!0});function c(e,t){let a=t.acorn||Aj(),c=o(a),l=a.tokTypes,u=c.tokTypes,d=a.tokContexts,f=c.tokContexts.tc_oTag,p=c.tokContexts.tc_cTag,m=c.tokContexts.tc_expr,h=a.isNewLine,g=a.isIdentifierStart,_=a.isIdentifierChar;return class extends t{static get acornJsx(){return c}jsx_readToken(){let e=``,t=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated JSX contents`);let n=this.input.charCodeAt(this.pos);switch(n){case 60:case 123:return this.pos===this.start?n===60&&this.exprAllowed?(++this.pos,this.finishToken(u.jsxTagStart)):this.getTokenFromCode(n):(e+=this.input.slice(t,this.pos),this.finishToken(u.jsxText,e));case 38:e+=this.input.slice(t,this.pos),e+=this.jsx_readEntity(),t=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(n===62?`&gt;`:`&rbrace;`)+'` or `{"'+this.input[this.pos]+'"}`?');default:h(n)?(e+=this.input.slice(t,this.pos),e+=this.jsx_readNewLine(!0),t=this.pos):++this.pos}}}jsx_readNewLine(e){let t=this.input.charCodeAt(this.pos),n;return++this.pos,t===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,n=e?`
77
+ `:`\r
78
+ `):n=String.fromCharCode(t),this.options.locations&&(++this.curLine,this.lineStart=this.pos),n}jsx_readString(e){let t=``,n=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);let r=this.input.charCodeAt(this.pos);if(r===e)break;r===38?(t+=this.input.slice(n,this.pos),t+=this.jsx_readEntity(),n=this.pos):h(r)?(t+=this.input.slice(n,this.pos),t+=this.jsx_readNewLine(!1),n=this.pos):++this.pos}return t+=this.input.slice(n,this.pos++),this.finishToken(l.string,t)}jsx_readEntity(){let e=``,t=0,a,o=this.input[this.pos];o!==`&`&&this.raise(this.pos,`Entity must start with an ampersand`);let s=++this.pos;for(;this.pos<this.input.length&&t++<10;){if(o=this.input[this.pos++],o===`;`){e[0]===`#`?e[1]===`x`?(e=e.substr(2),r.test(e)&&(a=String.fromCharCode(parseInt(e,16)))):(e=e.substr(1),i.test(e)&&(a=String.fromCharCode(parseInt(e,10)))):a=n[e];break}e+=o}return a||(this.pos=s,`&`)}jsx_readWord(){let e,t=this.pos;do e=this.input.charCodeAt(++this.pos);while(_(e)||e===45);return this.finishToken(u.jsxName,this.input.slice(t,this.pos))}jsx_parseIdentifier(){let e=this.startNode();return this.type===u.jsxName?e.name=this.value:this.type.keyword?e.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(e,`JSXIdentifier`)}jsx_parseNamespacedName(){let t=this.start,n=this.startLoc,r=this.jsx_parseIdentifier();if(!e.allowNamespaces||!this.eat(l.colon))return r;var i=this.startNodeAt(t,n);return i.namespace=r,i.name=this.jsx_parseIdentifier(),this.finishNode(i,`JSXNamespacedName`)}jsx_parseElementName(){if(this.type===u.jsxTagEnd)return``;let t=this.start,n=this.startLoc,r=this.jsx_parseNamespacedName();for(this.type===l.dot&&r.type===`JSXNamespacedName`&&!e.allowNamespacedObjects&&this.unexpected();this.eat(l.dot);){let e=this.startNodeAt(t,n);e.object=r,e.property=this.jsx_parseIdentifier(),r=this.finishNode(e,`JSXMemberExpression`)}return r}jsx_parseAttributeValue(){switch(this.type){case l.braceL:let e=this.jsx_parseExpressionContainer();return e.expression.type===`JSXEmptyExpression`&&this.raise(e.start,`JSX attributes must only be assigned a non-empty expression`),e;case u.jsxTagStart:case l.string:return this.parseExprAtom();default:this.raise(this.start,`JSX value should be either an expression or a quoted JSX text`)}}jsx_parseEmptyExpression(){let e=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(e,`JSXEmptyExpression`,this.start,this.startLoc)}jsx_parseExpressionContainer(){let e=this.startNode();return this.next(),e.expression=this.type===l.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(l.braceR),this.finishNode(e,`JSXExpressionContainer`)}jsx_parseAttribute(){let e=this.startNode();return this.eat(l.braceL)?(this.expect(l.ellipsis),e.argument=this.parseMaybeAssign(),this.expect(l.braceR),this.finishNode(e,`JSXSpreadAttribute`)):(e.name=this.jsx_parseNamespacedName(),e.value=this.eat(l.eq)?this.jsx_parseAttributeValue():null,this.finishNode(e,`JSXAttribute`))}jsx_parseOpeningElementAt(e,t){let n=this.startNodeAt(e,t);n.attributes=[];let r=this.jsx_parseElementName();for(r&&(n.name=r);this.type!==l.slash&&this.type!==u.jsxTagEnd;)n.attributes.push(this.jsx_parseAttribute());return n.selfClosing=this.eat(l.slash),this.expect(u.jsxTagEnd),this.finishNode(n,r?`JSXOpeningElement`:`JSXOpeningFragment`)}jsx_parseClosingElementAt(e,t){let n=this.startNodeAt(e,t),r=this.jsx_parseElementName();return r&&(n.name=r),this.expect(u.jsxTagEnd),this.finishNode(n,r?`JSXClosingElement`:`JSXClosingFragment`)}jsx_parseElementAt(e,t){let n=this.startNodeAt(e,t),r=[],i=this.jsx_parseOpeningElementAt(e,t),a=null;if(!i.selfClosing){contents:for(;;)switch(this.type){case u.jsxTagStart:if(e=this.start,t=this.startLoc,this.next(),this.eat(l.slash)){a=this.jsx_parseClosingElementAt(e,t);break contents}r.push(this.jsx_parseElementAt(e,t));break;case u.jsxText:r.push(this.parseExprAtom());break;case l.braceL:r.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}s(a.name)!==s(i.name)&&this.raise(a.start,`Expected corresponding JSX closing tag for <`+s(i.name)+`>`)}let o=i.name?`Element`:`Fragment`;return n[`opening`+o]=i,n[`closing`+o]=a,n.children=r,this.type===l.relational&&this.value===`<`&&this.raise(this.start,`Adjacent JSX elements must be wrapped in an enclosing tag`),this.finishNode(n,`JSX`+o)}jsx_parseText(){let e=this.parseLiteral(this.value);return e.type=`JSXText`,e}jsx_parseElement(){let e=this.start,t=this.startLoc;return this.next(),this.jsx_parseElementAt(e,t)}parseExprAtom(e){return this.type===u.jsxText?this.jsx_parseText():this.type===u.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(e)}readToken(e){let t=this.curContext();if(t===m)return this.jsx_readToken();if(t===f||t===p){if(g(e))return this.jsx_readWord();if(e==62)return++this.pos,this.finishToken(u.jsxTagEnd);if((e===34||e===39)&&t==f)return this.jsx_readString(e)}return e===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(u.jsxTagStart)):super.readToken(e)}updateContext(e){if(this.type==l.braceL){var t=this.curContext();t==f?this.context.push(d.b_expr):t==m?this.context.push(d.b_tmpl):super.updateContext(e),this.exprAllowed=!0}else if(this.type===l.slash&&e===u.jsxTagStart)this.context.length-=2,this.context.push(p),this.exprAllowed=!1;else return super.updateContext(e)}}}}));function Mj(e){return e}var Nj={}.hasOwnProperty,Pj=Symbol(`continue`),Fj=Symbol(`exit`),Ij=Symbol(`skip`);function Lj(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return zj(e)&&(s.displayName=`node (`+Mj(e.type)+`)`),s;function s(){let s=n?Rj(n(e,t,a,o)):[];if(s[0]===Fj)return s;if(s[0]!==Ij){let t;for(t in e)if(Nj.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(zj(r)){let e=i(r,t,a,n)();if(e[0]===Fj)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(zj(r)){let e=i(r,t,void 0,n)();if(e[0]===Fj)return e}}}return r?Rj(r(e,t,a,o)):s}}}function Rj(e){return Array.isArray(e)?e:typeof e==`number`?[Pj,e]:[e]}function zj(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function Bj(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=Hj(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&Vj(m);if(g&&!t.allowEmpty)throw new V(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g){if(Vj(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}}if(u){if(u.comments=a,Lj(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=Uj(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function Vj(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function Hj(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=Wj(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function Uj(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function Wj(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
79
+ `;break;case-3:a=`\r
80
+ `;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function Gj(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=Kj(n.start,r[0]||t.start),a=Kj(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function Kj(e,t){if(e&&typeof e==`object`){let n=`line`in e?qj(e.line):void 0,r=`column`in e?qj(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:qj(t)}}}function qj(e){return typeof e==`number`&&e>-1?e:void 0}var Jj=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,Yj=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,Xj=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,Zj=`#unexpected-type-in-code-expected-an-object-spread-spread`,Qj=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,$j=`#could-not-parse-expression-with-acorn`;function eM(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new V("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=Jj+Yj,e}if(I(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?tM.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||I(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new V("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=Jj+Xj,e}return R(t)?z(e,_,`linePrefix`,3)(t):_(t)}}function tM(e,t,n,r,i,a,o){let s=Bj(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=Gj(e),n=new V("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=Jj+Zj,n}if(e.expression.properties[1]){let t=new V(`Unexpected extra content in spread: only a single spread is supported`,{place:Gj(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=Jj+Qj,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=Gj(e.expression.properties[0]),n=new V("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=Jj+Zj,n}}if(s.error){let e=new V(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=Jj+$j,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function nM(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return eM.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return R(t)?z(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||I(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return eM.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}var rM=/[$_\p{ID_Start}]/u,iM=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,aM=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,oM={};function sM(e){return e?rM.test(String.fromCodePoint(e)):!1}function cM(e,t){let n=(t||oM).jsx?aM:iM;return e?n.test(String.fromCodePoint(e)):!1}var lM=`https://github.com/micromark/micromark-extension-mdx-jsx`;function uM(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,ee,D,te,ne,re){let ie=this,O,k;return ae;function ae(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),oe}function oe(e){return L(e)?n(e):(O=se,Ae(e))}function se(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),O=ce,Ae;if(t===62)return ke(t);if(t!==null&&t>=0&&sM(t))return e.enter(d),e.enter(f),e.consume(t),le;Ne(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function ce(t){if(t===62)return ke(t);if(t!==null&&t>=0&&sM(t))return e.enter(d),e.enter(f),e.consume(t),le;Ne(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function le(t){if(t!==null&&t>=0&&cM(t,{jsx:!0}))return e.consume(t),le;if(t===46||t===47||t===58||t===62||t===123||L(t)||Kt(t))return e.exit(f),O=ue,Ae(t);Ne(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function ue(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),O=de,Ae;if(t===58)return e.enter(h),e.consume(t),e.exit(h),O=me,Ae;if(t===47||t===62||t===123||t!==null&&t>=0&&sM(t))return e.exit(d),_e(t);Ne(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function de(t){if(t!==null&&t>=0&&sM(t))return e.enter(m),e.consume(t),fe;Ne(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function fe(t){if(t!==null&&t>=0&&cM(t,{jsx:!0}))return e.consume(t),fe;if(t===46||t===47||t===62||t===123||L(t)||Kt(t))return e.exit(m),O=pe,Ae(t);Ne(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function pe(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),O=de,Ae;if(t===47||t===62||t===123||t!==null&&t>=0&&sM(t))return e.exit(d),_e(t);Ne(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function me(t){if(t!==null&&t>=0&&sM(t))return e.enter(g),e.consume(t),he;Ne(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function he(t){if(t!==null&&t>=0&&cM(t,{jsx:!0}))return e.consume(t),he;if(t===47||t===62||t===123||L(t)||Kt(t))return e.exit(g),O=ge,Ae(t);Ne(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ge(t){if(t===47||t===62||t===123||t!==null&&t>=0&&sM(t))return e.exit(d),_e(t);Ne(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function _e(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),O=Oe,Ae;if(t===62)return ke(t);if(t===123)return eM.call(ie,e,ve,_,v,y,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&sM(t))return e.enter(b),e.enter(x),e.enter(S),e.consume(t),ye;Ne(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ve(e){return O=_e,Ae(e)}function ye(t){if(t!==null&&t>=0&&cM(t,{jsx:!0}))return e.consume(t),ye;if(t===47||t===58||t===61||t===62||t===123||L(t)||Kt(t))return e.exit(S),O=be,Ae(t);Ne(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function be(t){if(t===58)return e.enter(C),e.consume(t),e.exit(C),O=xe,Ae;if(t===61)return e.exit(x),e.enter(T),e.consume(t),e.exit(T),O=we,Ae;if(t===47||t===62||t===123||L(t)||Kt(t)||t!==null&&t>=0&&sM(t))return e.exit(x),e.exit(b),O=_e,Ae(t);Ne(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function xe(t){if(t!==null&&t>=0&&sM(t))return e.enter(w),e.consume(t),Se;Ne(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Se(t){if(t!==null&&t>=0&&cM(t,{jsx:!0}))return e.consume(t),Se;if(t===47||t===61||t===62||t===123||L(t)||Kt(t))return e.exit(w),e.exit(x),O=Ce,Ae(t);Ne(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function Ce(t){if(t===61)return e.enter(T),e.consume(t),e.exit(T),O=we,Ae;if(t===47||t===62||t===123||t!==null&&t>=0&&sM(t))return e.exit(b),_e(t);Ne(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function we(t){if(t===34||t===39)return e.enter(E),e.enter(ee),e.consume(t),e.exit(ee),k=t,Ee;if(t===123)return eM.call(ie,e,Te,te,ne,re,r,i,a,!1,!1,o)(t);Ne(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function Te(t){return e.exit(b),O=_e,Ae(t)}function Ee(t){return t===null&&Ne(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(k)+"`"),t===k?(e.enter(ee),e.consume(t),e.exit(ee),e.exit(E),e.exit(b),k=void 0,O=_e,Ae):I(t)?(O=Ee,Ae(t)):(e.enter(D),De(t))}function De(t){return t===null||t===k||I(t)?(e.exit(D),Ee(t)):(e.consume(t),De)}function Oe(e){if(e===62)return ke(e);Ne(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function ke(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function Ae(t){return I(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Me):R(t)||Kt(t)?(e.enter(`esWhitespace`),je(t)):O(t)}function je(t){return I(t)?(e.exit(`esWhitespace`),Ae(t)):R(t)||Kt(t)?(e.consume(t),je):(e.exit(`esWhitespace`),O(t))}function Me(e){if(!o&&ie.parser.lazy[ie.now().line]){let e=new V("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",ie.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=lM+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return Ae(e)}function Ne(e,t,n){let r=new V(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+dM(e)+`)`)+` `+t+`, expected `+n,ie.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=lM+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function dM(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function fM(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return uM.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function pM(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return uM.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return R(e)?z(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||I(e)?r(e):i(e)}}}function mM(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:pM(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:fM(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function hM(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}var gM={tokenize:bM,partial:!0},_M=`https://github.com/micromark/micromark-extension-mdxjs-esm`,vM=new Set([`ExportAllDeclaration`,`ExportDefaultDeclaration`,`ExportNamedDeclaration`,`ImportDeclaration`]);function yM(e){let t={tokenize:i,concrete:!0};if(!e||!e.acorn||!e.acorn.parse)throw Error("Expected an `acorn` instance passed in as `options.acorn`");let n=e.acorn,r=Object.assign({ecmaVersion:2024,sourceType:`module`},e.acornOptions,{locations:!0});return{flow:{101:t,105:t}};function i(t,i,a){let o=this,s=o.parser.definedModuleSpecifiers||(o.parser.definedModuleSpecifiers=[]),c=this.events.length+1,l=``;return o.interrupt?a:u;function u(e){return o.now().column>1?a(e):(t.enter(`mdxjsEsm`),t.enter(`mdxjsEsmData`),t.consume(e),l+=String.fromCharCode(e),d)}function d(e){return Rt(e)?(t.consume(e),l+=String.fromCharCode(e),d):(l===`import`||l===`export`)&&e===32?(t.consume(e),f):a(e)}function f(e){return e===null||I(e)?(t.exit(`mdxjsEsmData`),p(e)):(t.consume(e),f)}function p(e){return e===null?h(e):I(e)?t.check(gM,h,m)(e):(t.enter(`mdxjsEsmData`),f(e))}function m(e){return t.enter(`lineEnding`),t.consume(e),t.exit(`lineEnding`),p}function h(a){let l=Bj(o.events.slice(c),{acorn:n,acornOptions:r,tokenTypes:[`mdxjsEsmData`],prefix:s.length>0?`var `+s.join(`,`)+`
81
+ `:``});if(l.error){if(a!==null&&l.swallow)return m(a);let e=new V(`Could not parse import/exports with acorn`,{cause:l.error,place:{line:l.error.loc.line,column:l.error.loc.column+1,offset:l.error.pos},ruleId:`acorn`,source:`micromark-extension-mdxjs-esm`});throw e.url=_M+`#could-not-parse-importexports-with-acorn`,e}s.length>0&&l.estree.body.shift();let u=-1;for(;++u<l.estree.body.length;){let e=l.estree.body[u];if(!vM.has(e.type)){let t=new V("Unexpected `"+e.type+"` in code: only import/exports are supported",{place:Gj(e),ruleId:`non-esm`,source:`micromark-extension-mdxjs-esm`});throw t.url=_M+`#unexpected-type-in-code-only-importexports-are-supported`,t}if(e.type===`ImportDeclaration`&&!o.interrupt){let t=-1;for(;++t<e.specifiers.length;){let n=e.specifiers[t];s.push(n.local.name)}}}return Object.assign(t.exit(`mdxjsEsm`),e.addResult?{estree:l.estree}:void 0),i(a)}}}function bM(e,t,n){return r;function r(r){return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),e.attempt(ln,t,n)}}var xM=l(jj(),1);function SM(e){let t=Object.assign({acorn:uA.extend((0,xM.default)()),acornOptions:{ecmaVersion:2024,sourceType:`module`},addResult:!0},e);return Nt([yM(t),nM(t),mM(t),hM()])}var CM={};function wM(e){let t=this,n=e||CM,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(SM(n)),a.push(rk()),o.push(ik(n))}var TM=`__mdx_expr__:`,EM=new Set([`br`,`hr`,`img`,`input`,`meta`,`link`,`area`,`base`,`col`,`embed`,`source`,`track`,`wbr`]),DM=Fo().use(wi),OM=T_(`remarkMdx`,()=>wM);function kM(e){let t={},n=!1;if(!Array.isArray(e))return{props:t,hasExpressions:n};for(let r of e)r.type===`mdxJsxAttribute`&&r.name&&(r.value===null||r.value===void 0?t[r.name]=`true`:typeof r.value==`string`?t[r.name]=r.value:r.value?.type===`mdxJsxAttributeValueExpression`&&(t[r.name]=`${TM}${r.value.value}`,n=!0)),r.type===`mdxJsxExpressionAttribute`&&(n=!0);return{props:t,hasExpressions:n}}function AM(e){let t=[];for(let[n,r]of Object.entries(e))r.startsWith(`__mdx_expr__:`)?t.push({type:`mdxJsxAttribute`,name:n,value:{type:`mdxJsxAttributeValueExpression`,value:r.slice(13)}}):t.push({type:`mdxJsxAttribute`,name:n,value:r});return t}function jM(e){if(!e||e.length===0)return``;let t=[];for(let n of e)if(n.type===`paragraph`){let e=MM(n.children??[]);t.push(e)}else if(n.type===`text`)t.push(n.value??``);else if(n.type===`mdxJsxFlowElement`||n.type===`mdxJsxTextElement`){let e=n.name??``,r=(n.attributes??[]).map(e=>{if(e.type===`mdxJsxAttribute`&&e.name){if(typeof e.value==`string`)return`${e.name}="${e.value}"`;if(e.value?.type===`mdxJsxAttributeValueExpression`)return`${e.name}={${e.value.value}}`}return``}).filter(Boolean).join(` `),i=jM(n.children??[]);i?t.push(`<${e}${r?` `+r:``}>${i}</${e}>`):t.push(`<${e}${r?` `+r:``} />`)}else n.value&&t.push(n.value);return t.join(`
82
+
83
+ `)}function MM(e){return e.map(e=>e.type===`text`?e.value??``:e.type===`strong`?`**${MM(e.children??[])}**`:e.type===`emphasis`?`*${MM(e.children??[])}*`:e.type===`inlineCode`?`\`${e.value??``}\``:e.type===`link`?`[${MM(e.children??[])}](${e.url??``})`:e.value??``).join(``)}var NM=h_(`mdx_component`,()=>({group:`block`,atom:!0,isolating:!0,selectable:!0,draggable:!1,attrs:{componentName:{default:``},props:{default:`{}`},hasExpressions:{default:!1},children:{default:``}},toDOM:e=>{let t=document.createElement(`div`);return t.setAttribute(`data-mdx-component`,e.attrs.componentName),t.setAttribute(`data-mdx-props`,e.attrs.props),e.attrs.children&&t.setAttribute(`data-mdx-children`,e.attrs.children),e.attrs.hasExpressions&&t.setAttribute(`data-mdx-expressions`,`true`),t.className=`mdx-component-block`,t.textContent=`<${e.attrs.componentName} />`,t},parseDOM:[{tag:`div[data-mdx-component]`,getAttrs:e=>({componentName:e.getAttribute(`data-mdx-component`)||``,props:e.getAttribute(`data-mdx-props`)||`{}`,children:e.getAttribute(`data-mdx-children`)||``,hasExpressions:e.getAttribute(`data-mdx-expressions`)===`true`})}],parseMarkdown:{match:e=>e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`,runner:(e,t,n)=>{let r=t.name;if(!r||EM.has(r.toLowerCase()))return;let{props:i,hasExpressions:a}=kM(t.attributes),o=jM(t.children??[]);e.addNode(n,{componentName:r,props:JSON.stringify(i),hasExpressions:a,children:o})}},toMarkdown:{match:e=>e.type.name===`mdx_component`,runner:(e,t)=>{let n=t.attrs.componentName,r=JSON.parse(t.attrs.props),i=t.attrs.children||``,a=AM(r);if(i.trim()){let t=DM.parse(i);e.addNode(`mdxJsxFlowElement`,void 0,void 0,{name:n,attributes:a,children:t.children})}else e.addNode(`mdxJsxFlowElement`,void 0,void 0,{name:n,attributes:a,children:[]})}}})),PM=q(`insertMdxComponent`,()=>e=>(t,n)=>{if(!e)return!1;let r=t.schema.nodes.mdx_component;if(!r)return!1;let i=r.create({componentName:e.componentName,props:JSON.stringify(e.props),hasExpressions:!1,children:e.children||``});if(n){let{from:e}=t.selection;n(t.tr.insert(e,i))}return!0}),FM=h_(`mdx_esm`,()=>({group:`block`,atom:!0,attrs:{value:{default:``}},toDOM:()=>{let e=document.createElement(`span`);return e.style.display=`none`,e},parseDOM:[],parseMarkdown:{match:e=>e.type===`mdxjsEsm`,runner:(e,t,n)=>{e.addNode(n,{value:t.value??``})}},toMarkdown:{match:e=>e.type.name===`mdx_esm`,runner:(e,t)=>{e.addNode(`mdxjsEsm`,void 0,void 0,{value:t.attrs.value})}}})),IM=typeof global==`object`&&global&&global.Object===Object&&global,LM=typeof self==`object`&&self&&self.Object===Object&&self,RM=IM||LM||Function(`return this`)(),zM=RM.Symbol,BM=Object.prototype,VM=BM.hasOwnProperty,HM=BM.toString,UM=zM?zM.toStringTag:void 0;function WM(e){var t=VM.call(e,UM),n=e[UM];try{e[UM]=void 0;var r=!0}catch{}var i=HM.call(e);return r&&(t?e[UM]=n:delete e[UM]),i}var GM=Object.prototype.toString;function KM(e){return GM.call(e)}var qM=`[object Null]`,JM=`[object Undefined]`,YM=zM?zM.toStringTag:void 0;function XM(e){return e==null?e===void 0?JM:qM:YM&&YM in Object(e)?WM(e):KM(e)}function ZM(e){return typeof e==`object`&&!!e}var QM=`[object Symbol]`;function $M(e){return typeof e==`symbol`||ZM(e)&&XM(e)==QM}var eN=/\s/;function tN(e){for(var t=e.length;t--&&eN.test(e.charAt(t)););return t}var nN=/^\s+/;function rN(e){return e&&e.slice(0,tN(e)+1).replace(nN,``)}function iN(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var aN=NaN,oN=/^[-+]0x[0-9a-f]+$/i,sN=/^0b[01]+$/i,cN=/^0o[0-7]+$/i,lN=parseInt;function uN(e){if(typeof e==`number`)return e;if($M(e))return aN;if(iN(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=iN(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=rN(e);var n=sN.test(e);return n||cN.test(e)?lN(e.slice(2),n?2:8):oN.test(e)?aN:+e}var dN=function(){return RM.Date.now()},fN=`Expected a function`,pN=Math.max,mN=Math.min;function hN(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0;if(typeof e!=`function`)throw TypeError(fN);t=uN(t)||0,iN(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?pN(uN(n.maxWait)||0,t):a,f=`trailing`in n?!!n.trailing:f);function p(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function m(e){return l=e,s=setTimeout(_,t),u?p(e):o}function h(e){var n=e-c,r=e-l,i=t-n;return d?mN(i,a-r):i}function g(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){var e=dN();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(dN())}function x(){var e=dN(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}var gN=class{constructor(){this.beforeMountedListeners=[],this.mountedListeners=[],this.updatedListeners=[],this.selectionUpdatedListeners=[],this.markdownUpdatedListeners=[],this.blurListeners=[],this.focusListeners=[],this.destroyListeners=[],this.beforeMount=e=>(this.beforeMountedListeners.push(e),this),this.mounted=e=>(this.mountedListeners.push(e),this),this.updated=e=>(this.updatedListeners.push(e),this)}get listeners(){return{beforeMount:this.beforeMountedListeners,mounted:this.mountedListeners,updated:this.updatedListeners,markdownUpdated:this.markdownUpdatedListeners,blur:this.blurListeners,focus:this.focusListeners,destroy:this.destroyListeners,selectionUpdated:this.selectionUpdatedListeners}}markdownUpdated(e){return this.markdownUpdatedListeners.push(e),this}blur(e){return this.blurListeners.push(e),this}focus(e){return this.focusListeners.push(e),this}destroy(e){return this.destroyListeners.push(e),this}selectionUpdated(e){return this.selectionUpdatedListeners.push(e),this}},_N=P(new gN,`listener`),vN=new Yl(`MILKDOWN_LISTENER`),yN=e=>(e.inject(_N,new gN),async()=>{await e.wait(ug);let{listeners:t}=e.get(_N);t.beforeMount.forEach(t=>t(e)),await e.wait(Ig);let n=e.get(zg),r=null,i=null,a=null,o=null,s=hN(()=>{if(!o)return;let{doc:a}=o;if(t.updated.length>0&&r&&!r.eq(a)&&t.updated.forEach(t=>{t(e,a,r)}),t.markdownUpdated.length>0&&r&&!r.eq(a)){let r=n(a);t.markdownUpdated.forEach(t=>{t(e,r,i)}),i=r}r=a,o=null},200),c=new Kl({key:vN,view:()=>({destroy:()=>{t.destroy.forEach(t=>t(e))}}),props:{handleDOMEvents:{focus:()=>(t.focus.forEach(t=>t(e)),!1),blur:()=>(t.blur.forEach(t=>t(e)),!1)}},state:{init:(e,t)=>{r=t.doc,i=n(t.doc)},apply:n=>{let r=n.selection;(!a&&r||a&&!r.eq(a))&&(t.selectionUpdated.forEach(t=>{t(e,r,a)}),a=r),(n.docChanged||n.storedMarksSet)&&n.getMeta(`addToHistory`)!==!1&&(o=n,s())}}});e.update(ng,e=>e.concat(c)),await e.wait(Qg),t.mounted.forEach(t=>t(e))});yN.meta={package:`@milkdown/plugin-listener`,displayName:`Listener`};var bN=new Set([`strong`,`emphasis`,`delete`]),xN=/^[^\S\r\n]+/,SN=/[^\S\r\n]+$/,CN=/^[ \t]+/;function wN(e,t){let n=e.children??[],r=``;for(;;){let e=t===`start`?0:n.length-1,i=n[e];if(i?.type!==`text`||typeof i.value!=`string`)break;let a=i.value.match(t===`start`?xN:SN)?.[0]??``,o=t===`start`?i.value.slice(a.length):i.value.slice(0,i.value.length-a.length);if(o&&!a||(r=t===`start`?r+a:a+r,n=[...n.slice(0,e),...o?[{...i,value:o}]:[],...n.slice(e+1)],o))break}return n.length===0?[void 0,r]:[n===e.children?e:{...e,children:n},r]}var TN=e=>e?[{type:`text`,value:e}]:[];function EN(e){if(!e.children)return e;let t=e.children.flatMap((t,n)=>{let r=EN(t);if(!bN.has(r.type))return[r];let[i,a]=wN(r,`start`),[o,s]=i?wN(i,`end`):[void 0,``];return[...TN(e.type===`paragraph`&&n===0?a.replace(CN,``):a),...o?[o]:[],...TN(s)]});return{...e,children:t}}var DN=function(){let e=this.compiler;e&&(this.compiler=(t,n)=>e(EN(t),n))},ON=T_(`remarkMarkWhitespace`,()=>DN),kN={border:`1px solid #e4e4e7`,borderRadius:6,background:`#fff`},AN={padding:`6px 10px`,minHeight:60,fontSize:13,lineHeight:1.5,outline:`none`};function jN({value:e,onChange:t,media:n,mediaContext:r}){let i=(0,j.useRef)(null),a=(0,j.useRef)(null),[o,s]=(0,j.useState)(null),c=(0,j.useRef)(e),l=(0,j.useRef)(!1),u=(0,j.useRef)(t);return u.current=t,(0,j.useEffect)(()=>{let e=i.current;if(!e)return;let t=!1;return(async()=>{let n=await l_.make().config(t=>{t.set(t_,e),t.set(Vg,c.current),t.get(_N).markdownUpdated((e,t)=>{c.current=t})}).use(Ny).use(Gw).use(ON).use(yN).use(vT).use(yT).create();t?n.destroy():(a.current=n,s(n))})(),()=>{t=!0,a.current?.destroy(),a.current=null,s(null)}},[]),(0,j.useEffect)(()=>{a.current&&!l.current&&e!==c.current&&(a.current.action(O_(e)),bT(a.current.ctx.get(Zh)),c.current=e)}),(0,M.jsxs)(`div`,{style:kN,children:[(0,M.jsx)(IO,{editor:o,media:n,mediaContext:r,field:`children`,allowImageInsert:!1}),(0,M.jsx)(`div`,{ref:i,style:AN,onFocusCapture:()=>{l.current=!0},onBlurCapture:()=>{l.current=!1,a.current&&(c.current=a.current.action(D_())),c.current!==e&&u.current(c.current)}})]})}var MN={number:`number`,url:`url`,date:`date`,datetime:`datetime-local`,time:`time`,email:`email`,tel:`tel`},NN={border:`1px solid #d4d4d8`,borderRadius:8,background:`#fafafa`,margin:`8px 0`,fontSize:13},PN={display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8,padding:`6px 10px`,borderBottom:`1px solid #ececed`,background:`#f1f1f3`,borderTopLeftRadius:8,borderTopRightRadius:8},FN={fontWeight:600,fontFamily:`ui-monospace, monospace`,color:`#3f3f46`},IN={padding:`8px 10px`,display:`flex`,flexDirection:`column`,gap:8},LN={fontSize:11,color:`#71717a`,marginBottom:2},RN={width:`100%`,boxSizing:`border-box`,border:`1px solid #d4d4d8`,borderRadius:4,padding:`4px 6px`,font:`inherit`,background:`#fff`},zN={...RN,background:`#f4f4f5`,color:`#71717a`},BN={fontSize:10,color:`#a16207`,background:`#fef9c3`,borderRadius:3,padding:`0 4px`,marginLeft:6},VN={border:`none`,background:`transparent`,color:`#a1a1aa`,cursor:`pointer`,fontSize:16,lineHeight:1,padding:2},HN={border:`1px solid #d4d4d8`,background:`#fff`,borderRadius:4,padding:`4px 8px`,font:`inherit`,fontSize:12,cursor:`pointer`,color:`#3f3f46`,whiteSpace:`nowrap`};function UN({name:e,value:t,propType:n,editable:r,hasMedia:i,previewSrc:a,onChange:o,onBrowse:s}){if(n===`boolean`)return(0,M.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:t===`true`,disabled:!r,onChange:e=>o(e.target.checked?`true`:`false`)}),(0,M.jsx)(`span`,{style:{color:`#52525b`},children:t===`true`?`Yes`:`No`})]});if(n===`image`)return(0,M.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[a===``?null:(0,M.jsx)(`img`,{src:a,alt:``,style:{maxHeight:96,maxWidth:`100%`,objectFit:`contain`,borderRadius:4,alignSelf:`flex-start`}}),(0,M.jsxs)(`div`,{style:{display:`flex`,gap:6},children:[(0,M.jsx)(`input`,{style:r?RN:zN,value:t,readOnly:!r,placeholder:`Image URL or path`,onChange:r?e=>o(e.target.value):void 0}),r&&i?(0,M.jsx)(`button`,{type:`button`,style:HN,"data-mdx-action":`props`,onClick:s,children:`Browse`}):null]})]});if(n===`color`)return(0,M.jsxs)(`div`,{style:{display:`flex`,gap:6,alignItems:`center`},children:[(0,M.jsx)(`input`,{type:`color`,value:t||`#000000`,disabled:!r,onChange:e=>o(e.target.value),style:{width:30,height:28,padding:0,border:`1px solid #d4d4d8`,borderRadius:4,background:`transparent`,cursor:r?`pointer`:`default`}}),(0,M.jsx)(`input`,{style:r?RN:zN,value:t,readOnly:!r,placeholder:`#000000`,onChange:r?e=>o(e.target.value):void 0})]});let c=MN[n]??`text`;return(0,M.jsx)(`input`,{type:c,style:r?RN:zN,value:t,readOnly:!r,placeholder:`Enter ${e}…`,onChange:r?e=>o(e.target.value):void 0})}function WN({componentName:e,props:t,hasExpressions:n,slotContent:r,definition:i,media:a,mediaContext:o,onRemove:s,onSlotContentChange:c,onPropsChange:l}){let u=i?.slots?.includes(`default`)??!!c,d=Object.entries(t),[f,p]=(0,j.useState)(null),m=(0,j.useMemo)(()=>{let e=new Map;for(let t of i?.props??[])e.set(t.name,t);return e},[i]),h=(e,n)=>{l&&l({...t,[e]:n})};return(0,M.jsxs)(`div`,{style:NN,"data-cms-ui":``,contentEditable:!1,children:[(0,M.jsxs)(`div`,{style:PN,children:[(0,M.jsxs)(`span`,{style:FN,children:[`<${e} />`,n?(0,M.jsx)(`span`,{style:BN,children:`expr · read-only`}):null]}),(0,M.jsx)(`button`,{type:`button`,style:VN,title:`Remove block`,"data-mdx-action":`remove`,onClick:s,children:`×`})]}),(0,M.jsxs)(`div`,{style:IN,children:[u?(0,M.jsxs)(`div`,{"data-mdx-action":`children`,children:[(0,M.jsx)(`div`,{style:LN,children:`Content`}),c?(0,M.jsx)(jN,{value:r,onChange:c,media:a,mediaContext:o}):(0,M.jsx)(`div`,{style:{...zN,whiteSpace:`pre-wrap`,minHeight:40},children:r})]}):null,d.length===0&&!u?(0,M.jsx)(`div`,{style:{color:`#a1a1aa`,fontSize:12},children:`No props`}):null,d.map(([e,t])=>{let n=t.startsWith(TM),r=!!l&&!n,i=m.get(e),s=(i?.type??``).toLowerCase();return(0,M.jsxs)(`div`,{style:{display:`block`},"data-mdx-action":`props`,children:[(0,M.jsxs)(`div`,{style:LN,children:[e,i?.required?(0,M.jsx)(`span`,{style:{color:`#dc2626`},children:`*`}):null,n?(0,M.jsx)(`span`,{style:BN,children:`expression`}):null]}),n?(0,M.jsx)(`input`,{style:zN,value:`{${t.slice(TM.length)}}`,readOnly:!0}):(0,M.jsx)(UN,{name:e,value:t,propType:s,editable:r,hasMedia:!!a,previewSrc:s===`image`?fE(a,t,o):``,onChange:t=>h(e,t),onBrowse:()=>p(e)})]},e)})]}),f!==null&&a?(0,M.jsx)(uE,{media:a,context:o,field:f,accept:`image/*`,onSelect:e=>{h(f,e),p(null)},onClose:()=>p(null)}):null]})}var GN=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&re(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&re(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,ne=te.port2;te.port1.onmessage=ee,D=function(){ne.postMessage(null)}}else D=function(){_(ee,0)};function re(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,re(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),KN=o(((e,t)=>{t.exports=GN()})),qN=o((e=>{var t=Ge();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.7`})),JN=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=qN()})),YN=o((e=>{var t=KN(),n=Ge(),r=JN();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),D=Symbol.iterator;function te(e){return typeof e!=`object`||!e?null:(e=D&&e[D]||e[`@@iterator`],typeof e==`function`?e:null)}var ne=Symbol.for(`react.client.reference`);function re(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?re(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var ie=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},oe=[],se=-1;function ce(e){return{current:e}}function le(e){0>se||(e.current=oe[se],oe[se]=null,se--)}function ue(e,t){se++,oe[se]=e.current,e.current=t}var de=ce(null),fe=ce(null),pe=ce(null),me=ce(null);function he(e,t){switch(ue(pe,t),ue(fe,e),ue(de,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qd(t),e=Jd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}le(de),ue(de,e)}function ge(){le(de),le(fe),le(pe)}function _e(e){e.memoizedState!==null&&ue(me,e);var t=de.current,n=Jd(t,e.type);t!==n&&(ue(fe,e),ue(de,n))}function ve(e){fe.current===e&&(le(de),le(fe)),me.current===e&&(le(me),ip._currentValue=ae)}var ye,be;function xe(e){if(ye===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||``,be=-1<e.stack.indexOf(`
84
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
85
+ `+ye+e+be}var Se=!1;function Ce(e,t){if(!e||Se)return``;Se=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
86
+ `),l=s.split(`
87
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
88
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Se=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?xe(n):``}function we(e,t){switch(e.tag){case 26:case 27:case 5:return xe(e.type);case 16:return xe(`Lazy`);case 13:return e.child!==t&&t!==null?xe(`Suspense Fallback`):xe(`Suspense`);case 19:return xe(`SuspenseList`);case 0:case 15:return Ce(e.type,!1);case 11:return Ce(e.type.render,!1);case 1:return Ce(e.type,!0);case 31:return xe(`Activity`);default:return``}}function Te(e){try{var t=``,n=null;do t+=we(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
89
+ Error generating stack: `+e.message+`
90
+ `+e.stack}}var Ee=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,Oe=t.unstable_cancelCallback,ke=t.unstable_shouldYield,Ae=t.unstable_requestPaint,je=t.unstable_now,Me=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,Pe=t.unstable_UserBlockingPriority,Fe=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Le=t.unstable_IdlePriority,A=t.log,Re=t.unstable_setDisableYieldValue,ze=null,Be=null;function Ve(e){if(typeof A==`function`&&Re(e),Be&&typeof Be.setStrictMode==`function`)try{Be.setStrictMode(ze,e)}catch{}}var He=Math.clz32?Math.clz32:Ke,Ue=Math.log,We=Math.LN2;function Ke(e){return e>>>=0,e===0?32:31-(Ue(e)/We|0)|0}var qe=256,j=262144,M=4194304;function N(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Je(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=N(n))):i=N(o):i=N(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=N(n))):i=N(o)):i=N(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ye(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ze(){var e=M;return M<<=1,!(M&62914560)&&(M=4194304),e}function Qe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $e(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function et(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-He(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&tt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function tt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-He(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function nt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-He(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function rt(e,t){var n=t&-t;return n=n&42?1:it(n),(n&(e.suspendedLanes|t))===0?n:0}function it(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function at(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ot(){var e=k.p;return e===0?(e=window.event,e===void 0?32:bp(e.type)):e}function st(e,t){var n=k.p;try{return k.p=e,t()}finally{k.p=n}}var ct=Math.random().toString(36).slice(2),lt=`__reactFiber$`+ct,ut=`__reactProps$`+ct,dt=`__reactContainer$`+ct,ft=`__reactEvents$`+ct,pt=`__reactListeners$`+ct,mt=`__reactHandles$`+ct,ht=`__reactResources$`+ct,gt=`__reactMarker$`+ct;function _t(e){delete e[lt],delete e[ut],delete e[ft],delete e[pt],delete e[mt]}function P(e){var t=e[lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[dt]||n[lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=_f(e);e!==null;){if(n=e[lt])return n;e=_f(e)}return t}e=n,n=e.parentNode}return null}function vt(e){if(e=e[lt]||e[dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function yt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function bt(e){var t=e[ht];return t||=e[ht]={hoistableStyles:new Map,hoistableScripts:new Map},t}function xt(e){e[gt]=!0}var F=new Set,St={};function Ct(e,t){wt(e,t),wt(e+`Capture`,t)}function wt(e,t){for(St[e]=t,e=0;e<t.length;e++)F.add(t[e])}var Tt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Et={},Dt={};function Ot(e){return Ee.call(Dt,e)?!0:Ee.call(Et,e)?!1:Tt.test(e)?Dt[e]=!0:(Et[e]=!0,!1)}function kt(e,t,n){if(Ot(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function At(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function jt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Mt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Nt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Pt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ft(e){if(!e._valueTracker){var t=Nt(e)?`checked`:`value`;e._valueTracker=Pt(e,t,``+e[t])}}function It(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Nt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Lt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Rt=/[\n"\\]/g;function zt(e){return e.replace(Rt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Bt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Mt(t)):e.value!==``+Mt(t)&&(e.value=``+Mt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ht(e,o,Mt(n)):Ht(e,o,Mt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Mt(s):e.removeAttribute(`name`)}function Vt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Ft(e);return}n=n==null?``:``+Mt(n),t=t==null?n:``+Mt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Ft(e)}function Ht(e,t,n){t===`number`&&Lt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ut(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Mt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Wt(e,t,n){t!=null&&(t=``+Mt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Mt(n)}function I(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ie(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Mt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ft(e)}function L(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var R=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Gt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||R.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Kt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Gt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Gt(e,o,t[o])}function qt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var z=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Jt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Yt(e){return Jt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Xt(){}var Zt=null;function Qt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $t=null,en=null;function tn(e){var t=vt(e);if(t&&(e=t.stateNode)){var n=e[ut]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Bt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ut]||null;if(!a)throw Error(i(90));Bt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&It(r)}break a;case`textarea`:Wt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ut(e,!!n.multiple,t,!1)}}}var nn=!1;function rn(e,t,n){if(nn)return e(t,n);nn=!0;try{return e(t)}finally{if(nn=!1,($t!==null||en!==null)&&(Cu(),$t&&(t=$t,e=en,en=$t=null,tn(t),e)))for(t=0;t<e.length;t++)tn(e[t])}}function an(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ut]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var on=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,sn=!1;if(on)try{var cn={};Object.defineProperty(cn,"passive",{get:function(){sn=!0}}),window.addEventListener(`test`,cn,cn),window.removeEventListener(`test`,cn,cn)}catch{sn=!1}var ln=null,un=null,dn=null;function fn(){if(dn)return dn;var e,t=un,n=t.length,r,i=`value`in ln?ln.value:ln.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return dn=i.slice(e,1<r?1-r:void 0)}function pn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function mn(){return!0}function hn(){return!1}function gn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?mn:hn,this.isPropagationStopped=hn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=mn)},persist:function(){},isPersistent:mn}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vn=gn(_n),yn=f({},_n,{view:0,detail:0}),bn=gn(yn),xn,Sn,Cn,wn=f({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Cn&&(Cn&&e.type===`mousemove`?(xn=e.screenX-Cn.screenX,Sn=e.screenY-Cn.screenY):Sn=xn=0,Cn=e),xn)},movementY:function(e){return`movementY`in e?e.movementY:Sn}}),Tn=gn(wn),En=gn(f({},wn,{dataTransfer:0})),Dn=gn(f({},yn,{relatedTarget:0})),On=gn(f({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),kn=gn(f({},_n,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),An=gn(f({},_n,{data:0})),jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Mn={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`},Nn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Pn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nn[e])?!!t[e]:!1}function Fn(){return Pn}var In=gn(f({},yn,{key:function(e){if(e.key){var t=jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=pn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Mn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fn,charCode:function(e){return e.type===`keypress`?pn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?pn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Ln=gn(f({},wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rn=gn(f({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fn})),zn=gn(f({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),Bn=gn(f({},wn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Vn=gn(f({},_n,{newState:0,oldState:0})),Hn=[9,13,27,32],Un=on&&`CompositionEvent`in window,Wn=null;on&&`documentMode`in document&&(Wn=document.documentMode);var Gn=on&&`TextEvent`in window&&!Wn,Kn=on&&(!Un||Wn&&8<Wn&&11>=Wn),qn=` `,Jn=!1;function Yn(e,t){switch(e){case`keyup`:return Hn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Xn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Zn=!1;function Qn(e,t){switch(e){case`compositionend`:return Xn(t);case`keypress`:return t.which===32?(Jn=!0,qn):null;case`textInput`:return e=t.data,e===qn&&Jn?null:e;default:return null}}function $n(e,t){if(Zn)return e===`compositionend`||!Un&&Yn(e,t)?(e=fn(),dn=un=ln=null,Zn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Kn&&t.locale!==`ko`?null:t.data;default:return null}}var er={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 tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!er[e.type]:t===`textarea`}function nr(e,t,n,r){$t?en?en.push(r):en=[r]:$t=r,t=jd(t,`onChange`),0<t.length&&(n=new vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var rr=null,ir=null;function ar(e){Cd(e,0)}function or(e){if(It(yt(e)))return e}function sr(e,t){if(e===`change`)return t}var cr=!1;if(on){var lr;if(on){var ur=`oninput`in document;if(!ur){var dr=document.createElement(`div`);dr.setAttribute(`oninput`,`return;`),ur=typeof dr.oninput==`function`}lr=ur}else lr=!1;cr=lr&&(!document.documentMode||9<document.documentMode)}function fr(){rr&&(rr.detachEvent(`onpropertychange`,pr),ir=rr=null)}function pr(e){if(e.propertyName===`value`&&or(ir)){var t=[];nr(t,ir,e,Qt(e)),rn(ar,t)}}function mr(e,t,n){e===`focusin`?(fr(),rr=t,ir=n,rr.attachEvent(`onpropertychange`,pr)):e===`focusout`&&fr()}function hr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return or(ir)}function gr(e,t){if(e===`click`)return or(t)}function _r(e,t){if(e===`input`||e===`change`)return or(t)}function vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var yr=typeof Object.is==`function`?Object.is:vr;function br(e,t){if(yr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ee.call(t,i)||!yr(e[i],t[i]))return!1}return!0}function xr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sr(e,t){var n=xr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=xr(n)}}function Cr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lt(e.document)}return t}function Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Er=on&&`documentMode`in document&&11>=document.documentMode,Dr=null,Or=null,kr=null,Ar=!1;function jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ar||Dr==null||Dr!==Lt(r)||(r=Dr,`selectionStart`in r&&Tr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),kr&&br(kr,r)||(kr=r,r=jd(Or,`onSelect`),0<r.length&&(t=new vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Dr)))}function Mr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Nr={animationend:Mr(`Animation`,`AnimationEnd`),animationiteration:Mr(`Animation`,`AnimationIteration`),animationstart:Mr(`Animation`,`AnimationStart`),transitionrun:Mr(`Transition`,`TransitionRun`),transitionstart:Mr(`Transition`,`TransitionStart`),transitioncancel:Mr(`Transition`,`TransitionCancel`),transitionend:Mr(`Transition`,`TransitionEnd`)},Pr={},Fr={};on&&(Fr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Nr.animationend.animation,delete Nr.animationiteration.animation,delete Nr.animationstart.animation),`TransitionEvent`in window||delete Nr.transitionend.transition);function Ir(e){if(Pr[e])return Pr[e];if(!Nr[e])return e;var t=Nr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Fr)return Pr[e]=t[n];return e}var Lr=Ir(`animationend`),Rr=Ir(`animationiteration`),zr=Ir(`animationstart`),Br=Ir(`transitionrun`),Vr=Ir(`transitionstart`),Hr=Ir(`transitioncancel`),Ur=Ir(`transitionend`),Wr=new Map,Gr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Gr.push(`scrollEnd`);function Kr(e,t){Wr.set(e,t),Ct(t,[e])}var qr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Jr=[],Yr=0,Xr=0;function Zr(){for(var e=Yr,t=Xr=Yr=0;t<e;){var n=Jr[t];Jr[t++]=null;var r=Jr[t];Jr[t++]=null;var i=Jr[t];Jr[t++]=null;var a=Jr[t];if(Jr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ti(n,i,a)}}function Qr(e,t,n,r){Jr[Yr++]=e,Jr[Yr++]=t,Jr[Yr++]=n,Jr[Yr++]=r,Xr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function $r(e,t,n,r){return Qr(e,t,n,r),ni(e)}function ei(e,t){return Qr(e,null,null,t),ni(e)}function ti(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-He(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ni(e){if(50<mu)throw mu=0,hu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ri={};function ii(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ai(e,t,n,r){return new ii(e,t,n,r)}function oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function si(e,t){var n=e.alternate;return n===null?(n=ai(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ci(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function li(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)oi(e)&&(s=1);else if(typeof e==`string`)s=Yf(e,n,de.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=ai(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return ui(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=ai(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=ai(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=ai(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ai(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ui(e,t,n,r){return e=ai(7,e,r,t),e.lanes=n,e}function di(e,t,n){return e=ai(6,e,null,t),e.lanes=n,e}function fi(e){var t=ai(18,null,null,0);return t.stateNode=e,t}function pi(e,t,n){return t=ai(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var mi=new WeakMap;function hi(e,t){if(typeof e==`object`&&e){var n=mi.get(e);return n===void 0?(t={value:e,source:t,stack:Te(t)},mi.set(e,t),t):n}return{value:e,source:t,stack:Te(t)}}var gi=[],_i=0,vi=null,yi=0,bi=[],xi=0,Si=null,Ci=1,wi=``;function Ti(e,t){gi[_i++]=yi,gi[_i++]=vi,vi=e,yi=t}function Ei(e,t,n){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Si=e;var r=Ci;e=wi;var i=32-He(r)-1;r&=~(1<<i),n+=1;var a=32-He(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ci=1<<32-He(t)+i|n<<i|r,wi=a+e}else Ci=1<<a|n<<i|r,wi=e}function Di(e){e.return!==null&&(Ti(e,1),Ei(e,1,0))}function Oi(e){for(;e===vi;)vi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null;for(;e===Si;)Si=bi[--xi],bi[xi]=null,wi=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null}function ki(e,t){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Ci=t.id,wi=t.overflow,Si=e}var Ai=null,ji=null,Mi=!1,Ni=null,Pi=!1,Fi=Error(i(519));function Ii(e){throw Hi(hi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Fi}function Li(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[lt]=e,t[ut]=r,n){case`dialog`:wd(`cancel`,t),wd(`close`,t);break;case`iframe`:case`object`:case`embed`:wd(`load`,t);break;case`video`:case`audio`:for(n=0;n<xd.length;n++)wd(xd[n],t);break;case`source`:wd(`error`,t);break;case`img`:case`image`:case`link`:wd(`error`,t),wd(`load`,t);break;case`details`:wd(`toggle`,t);break;case`input`:wd(`invalid`,t),Vt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:wd(`invalid`,t);break;case`textarea`:wd(`invalid`,t),I(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Ld(t.textContent,n)?(r.popover!=null&&(wd(`beforetoggle`,t),wd(`toggle`,t)),r.onScroll!=null&&wd(`scroll`,t),r.onScrollEnd!=null&&wd(`scrollend`,t),r.onClick!=null&&(t.onclick=Xt),t=!0):t=!1,t||Ii(e,!0)}function Ri(e){for(Ai=e.return;Ai;)switch(Ai.tag){case 5:case 31:case 13:Pi=!1;return;case 27:case 3:Pi=!0;return;default:Ai=Ai.return}}function zi(e){if(e!==Ai)return!1;if(!Mi)return Ri(e),Mi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Yd(e.type,e.memoizedProps)),n=!n),n&&ji&&Ii(e),Ri(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=gf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=gf(e)}else t===27?(t=ji,rf(e.type)?(e=hf,hf=null,ji=e):ji=t):ji=Ai?mf(e.stateNode.nextSibling):null;return!0}function Bi(){ji=Ai=null,Mi=!1}function Vi(){var e=Ni;return e!==null&&(eu===null?eu=e:eu.push.apply(eu,e),Ni=null),e}function Hi(e){Ni===null?Ni=[e]:Ni.push(e)}var Ui=ce(null),Wi=null,Gi=null;function Ki(e,t,n){ue(Ui,t._currentValue),t._currentValue=n}function qi(e){e._currentValue=Ui.current,le(Ui)}function Ji(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Yi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ji(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ji(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Xi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;yr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===me.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ip]:e.push(ip))}a=a.return}e!==null&&Yi(t,e,n,r),t.flags|=262144}function Zi(e){for(e=e.firstContext;e!==null;){if(!yr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qi(e){Wi=e,Gi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $i(e){return ta(Wi,e)}function ea(e,t){return Wi===null&&Qi(e),ta(e,t)}function ta(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Gi===null){if(e===null)throw Error(i(308));Gi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Gi=Gi.next=t;return n}var na=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ra=t.unstable_scheduleCallback,ia=t.unstable_NormalPriority,aa={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oa(){return{controller:new na,data:new Map,refCount:0}}function sa(e){e.refCount--,e.refCount===0&&ra(ia,function(){e.controller.abort()})}var ca=null,la=0,ua=0,da=null;function fa(e,t){if(ca===null){var n=ca=[];la=0,ua=hd(),da={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return la++,t.then(pa,pa),t}function pa(){if(--la===0&&ca!==null){da!==null&&(da.status=`fulfilled`);var e=ca;ca=null,ua=0,da=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ma(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ha=O.S;O.S=function(e,t){ru=je(),typeof t==`object`&&t&&typeof t.then==`function`&&fa(e,t),ha!==null&&ha(e,t)};var ga=ce(null);function _a(){var e=ga.current;return e===null?Rl.pooledCache:e}function va(e,t){t===null?ue(ga,ga.current):ue(ga,t.pool)}function ya(){var e=_a();return e===null?null:{parent:aa._currentValue,pool:e}}var ba=Error(i(460)),xa=Error(i(474)),Sa=Error(i(542)),Ca={then:function(){}};function wa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ta(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Xt,Xt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e;default:if(typeof t.status==`string`)t.then(Xt,Xt);else{if(e=Rl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e}throw Da=t,ba}}function Ea(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Da=e,ba):e}}var Da=null;function Oa(){if(Da===null)throw Error(i(459));var e=Da;return Da=null,e}function ka(e){if(e===ba||e===Sa)throw Error(i(483))}var Aa=null,ja=0;function Ma(e){var t=ja;return ja+=1,Aa===null&&(Aa=[]),Ta(Aa,e,t)}function Na(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Pa(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Fa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=si(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=di(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&Ea(i)===t.type)?(t=a(t,n.props),Na(t,n),t.return=e,t):(t=li(n.type,n.key,n.props,null,e.mode,r),Na(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=pi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ui(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=di(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=li(t.type,t.key,t.props,null,e.mode,n),Na(n,t),n.return=e,n;case h:return t=pi(t,e.mode,n),t.return=e,t;case T:return t=Ea(t),f(e,t,n)}if(ie(t)||te(t))return t=ui(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ma(t),n);if(t.$$typeof===b)return f(e,ea(e,t),n);Pa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=Ea(n),p(e,t,n,r)}if(ie(n)||te(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ma(n),r);if(n.$$typeof===b)return p(e,t,ea(e,n),r);Pa(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=Ea(r),_(e,t,n,r,i)}if(ie(r)||te(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Ma(r),i);if(r.$$typeof===b)return _(e,t,n,ea(t,r),i);Pa(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),Mi&&Ti(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return Mi&&Ti(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),Mi&&Ti(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),Mi&&Ti(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return Mi&&Ti(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),Mi&&Ti(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Ea(l)===r.type){n(e,r.sibling),c=a(r,o.props),Na(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===g?(c=ui(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=li(o.type,o.key,o.props,null,e.mode,c),Na(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=pi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Ea(o),x(e,r,o,c)}if(ie(o))return v(e,r,o,c);if(te(o)){if(l=te(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Ma(o),c);if(o.$$typeof===b)return x(e,r,ea(e,o),c);Pa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=di(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ja=0;var i=x(e,t,n,r);return Aa=null,i}catch(t){if(t===ba||t===Sa)throw t;var a=ai(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ia=Fa(!0),La=Fa(!1),Ra=!1;function za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ba(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ha(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ll&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ni(e),ti(e,null,n),t}return Qr(e,r,t,n),ni(e)}function Ua(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nt(e,n)}}function Wa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ga=!1;function Ka(){if(Ga){var e=da;if(e!==null)throw e}}function qa(e,t,n,r){Ga=!1;var i=e.updateQueue;Ra=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Bl&p)===p:(r&p)===p){p!==0&&p===ua&&(Ga=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Ra=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Jl|=o,e.lanes=o,e.memoizedState=d}}function Ja(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ya(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ja(n[e],t)}var Xa=ce(null),Za=ce(0);function Qa(e,t){e=Kl,ue(Za,e),ue(Xa,t),Kl=e|t.baseLanes}function $a(){ue(Za,Kl),ue(Xa,Xa.current)}function eo(){Kl=Za.current,le(Xa),le(Za)}var to=ce(null),no=null;function ro(e){var t=e.alternate;ue(co,co.current&1),ue(to,e),no===null&&(t===null||Xa.current!==null||t.memoizedState!==null)&&(no=e)}function io(e){ue(co,co.current),ue(to,e),no===null&&(no=e)}function ao(e){e.tag===22?(ue(co,co.current),ue(to,e),no===null&&(no=e)):oo(e)}function oo(){ue(co,co.current),ue(to,to.current)}function so(e){le(to),no===e&&(no=null),le(co)}var co=ce(0);function lo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||df(n)||ff(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var uo=0,B=null,fo=null,V=null,po=!1,mo=!1,ho=!1,go=0,_o=0,vo=null,yo=0;function bo(){throw Error(i(321))}function xo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yr(e[n],t[n]))return!1;return!0}function So(e,t,n,r,i,a){return uo=a,B=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Rs:zs,ho=!1,a=n(r,i),ho=!1,mo&&(a=wo(t,n,r,i)),Co(e),a}function Co(e){O.H=Ls;var t=fo!==null&&fo.next!==null;if(uo=0,V=fo=B=null,po=!1,_o=0,vo=null,t)throw Error(i(300));e===null||nc||(e=e.dependencies,e!==null&&Zi(e)&&(nc=!0))}function wo(e,t,n,r){B=e;var a=0;do{if(mo&&(vo=null),_o=0,mo=!1,25<=a)throw Error(i(301));if(a+=1,V=fo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}O.H=Bs,o=t(n,r)}while(mo);return o}function To(){var e=O.H,t=e.useState()[0];return t=typeof t.then==`function`?Mo(t):t,e=e.useState()[0],(fo===null?null:fo.memoizedState)!==e&&(B.flags|=1024),t}function Eo(){var e=go!==0;return go=0,e}function Do(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Oo(e){if(po){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}po=!1}uo=0,V=fo=B=null,mo=!1,_o=go=0,vo=null}function ko(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return V===null?B.memoizedState=V=e:V=V.next=e,V}function Ao(){if(fo===null){var e=B.alternate;e=e===null?null:e.memoizedState}else e=fo.next;var t=V===null?B.memoizedState:V.next;if(t!==null)V=t,fo=e;else{if(e===null)throw B.alternate===null?Error(i(467)):Error(i(310));fo=e,e={memoizedState:fo.memoizedState,baseState:fo.baseState,baseQueue:fo.baseQueue,queue:fo.queue,next:null},V===null?B.memoizedState=V=e:V=V.next=e}return V}function jo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Mo(e){var t=_o;return _o+=1,vo===null&&(vo=[]),e=Ta(vo,e,t),t=B,(V===null?t.memoizedState:V.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Rs:zs),e}function No(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Mo(e);if(e.$$typeof===b)return $i(e)}throw Error(i(438,String(e)))}function Po(e){var t=null,n=B.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=B.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=jo(),B.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ee;return t.index++,n}function Fo(e,t){return typeof t==`function`?t(e):t}function Io(e){return Lo(Ao(),fo,e)}function Lo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(uo&f)===f:(Bl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ua&&(d=!0);else if((uo&p)===p){u=u.next,p===ua&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,B.lanes|=p,Jl|=p;f=u.action,ho&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,B.lanes|=f,Jl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!yr(o,e.memoizedState)&&(nc=!0,d&&(n=da,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ro(e){var t=Ao(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);yr(o,t.memoizedState)||(nc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function zo(e,t,n){var r=B,a=Ao(),o=Mi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!yr((fo||a).memoizedState,n);if(s&&(a.memoizedState=n,nc=!0),a=a.queue,ls(Ho.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||V!==null&&V.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},Vo.bind(null,r,a,n,t),null),Rl===null)throw Error(i(349));o||uo&127||Bo(r,t,n)}return n}function Bo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=B.updateQueue,t===null?(t=jo(),B.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Vo(e,t,n,r){t.value=n,t.getSnapshot=r,Uo(t)&&Wo(e)}function Ho(e,t,n){return n(function(){Uo(t)&&Wo(e)})}function Uo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yr(e,n)}catch{return!0}}function Wo(e){var t=ei(e,2);t!==null&&vu(t,e,2)}function Go(e){var t=ko();if(typeof e==`function`){var n=e;if(e=n(),ho){Ve(!0);try{n()}finally{Ve(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:e},t}function Ko(e,t,n,r){return e.baseState=n,Lo(e,fo,typeof r==`function`?r:Fo)}function qo(e,t,n,r,a){if(Ps(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};O.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,H(t,o)):(o.next=n.next,t.pending=n.next=o)}}function H(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=O.T,o={};O.T=o;try{var s=n(i,r),c=O.S;c!==null&&c(o,s),Jo(e,t,s)}catch(n){Xo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),O.T=a}}else try{a=n(i,r),Jo(e,t,a)}catch(n){Xo(e,t,n)}}function Jo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Yo(e,t,n)},function(n){return Xo(e,t,n)}):Yo(e,t,n)}function Yo(e,t,n){t.status=`fulfilled`,t.value=n,Zo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,H(e,n)))}function Xo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Zo(t),t=t.next;while(t!==r)}e.action=null}function Zo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Qo(e,t){return t}function U(e,t){if(Mi){var n=Rl.formState;if(n!==null){a:{var r=B;if(Mi){if(ji){b:{for(var i=ji,a=Pi;i.nodeType!==8;)if(!a||(i=mf(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ji=mf(i.nextSibling),r=i.data===`F!`;break a}}Ii(r)}r=!1}r&&(t=n[0])}}return n=ko(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qo,lastRenderedState:t},n.queue=r,n=js.bind(null,B,r),r.dispatch=n,r=Go(!1),a=Ns.bind(null,B,!1,r.queue),r=ko(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=qo.bind(null,B,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function $o(e){return es(Ao(),fo,e)}function es(e,t,n){if(t=Lo(e,t,Qo)[0],e=Io(Fo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Mo(t)}catch(e){throw e===ba?Sa:e}else r=t;t=Ao();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(B.flags|=2048,rs(9,{destroy:void 0},ts.bind(null,i,n),null)),[r,a,e]}function ts(e,t){e.action=t}function ns(e){var t=Ao(),n=fo;if(n!==null)return es(t,n,e);Ao(),t=t.memoizedState,n=Ao();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=B.updateQueue,t===null&&(t=jo(),B.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function is(){return Ao().memoizedState}function as(e,t,n,r){var i=ko();B.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function ss(e,t,n,r){var i=Ao();r=r===void 0?null:r;var a=i.memoizedState.inst;fo!==null&&r!==null&&xo(r,fo.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(B.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function cs(e,t){as(8390656,8,e,t)}function ls(e,t){ss(2048,8,e,t)}function us(e){B.flags|=4;var t=B.updateQueue;if(t===null)t=jo(),B.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ds(e){var t=Ao().memoizedState;return us({ref:t,nextImpl:e}),function(){if(Ll&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function fs(e,t){return ss(4,2,e,t)}function ps(e,t){return ss(4,4,e,t)}function ms(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function hs(e,t,n){n=n==null?null:n.concat([e]),ss(4,4,ms.bind(null,t,e),n)}function gs(){}function _s(e,t){var n=Ao();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&xo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function vs(e,t){var n=Ao();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&xo(t,r[1]))return r[0];if(r=e(),ho){Ve(!0);try{e()}finally{Ve(!1)}}return n.memoizedState=[r,t],r}function ys(e,t,n){return n===void 0||uo&1073741824&&!(Bl&261930)?e.memoizedState=t:(e.memoizedState=n,e=_u(),B.lanes|=e,Jl|=e,n)}function bs(e,t,n,r){return yr(n,t)?n:Xa.current===null?!(uo&42)||uo&1073741824&&!(Bl&261930)?(nc=!0,e.memoizedState=n):(e=_u(),B.lanes|=e,Jl|=e,t):(e=ys(e,n,r),yr(e,t)||(nc=!0),e)}function xs(e,t,n,r,i){var a=k.p;k.p=a!==0&&8>a?a:8;var o=O.T,s={};O.T=s,Ns(e,!1,t,n);try{var c=i(),l=O.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ms(e,t,ma(c,r),gu(e)):Ms(e,t,r,gu(e))}catch(n){Ms(e,t,{then:function(){},status:`rejected`,reason:n},gu())}finally{k.p=a,o!==null&&s.types!==null&&(o.types=s.types),O.T=o}}function Ss(){}function Cs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ws(e).queue;xs(e,a,t,ae,n===null?Ss:function(){return Ts(e),n(r)})}function ws(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ts(e){var t=ws(e);t.next===null&&(t=e.alternate.memoizedState),Ms(e,t.next.queue,{},gu())}function Es(){return $i(ip)}function Ds(){return Ao().memoizedState}function Os(){return Ao().memoizedState}function ks(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=gu();e=Va(n);var r=Ha(t,e,n);r!==null&&(vu(r,t,n),Ua(r,t,n)),t={cache:oa()},e.payload=t;return}t=t.return}}function As(e,t,n){var r=gu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ps(e)?Fs(t,n):(n=$r(e,t,n,r),n!==null&&(vu(n,e,r),Is(n,t,r)))}function js(e,t,n){Ms(e,t,n,gu())}function Ms(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ps(e))Fs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,yr(s,o))return Qr(e,t,i,0),Rl===null&&Zr(),!1}catch{}if(n=$r(e,t,i,r),n!==null)return vu(n,e,r),Is(n,t,r),!0}return!1}function Ns(e,t,n,r){if(r={lane:2,revertLane:hd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ps(e)){if(t)throw Error(i(479))}else t=$r(e,n,r,2),t!==null&&vu(t,e,2)}function Ps(e){var t=e.alternate;return e===B||t!==null&&t===B}function Fs(e,t){mo=po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Is(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nt(e,n)}}var Ls={readContext:$i,use:No,useCallback:bo,useContext:bo,useEffect:bo,useImperativeHandle:bo,useLayoutEffect:bo,useInsertionEffect:bo,useMemo:bo,useReducer:bo,useRef:bo,useState:bo,useDebugValue:bo,useDeferredValue:bo,useTransition:bo,useSyncExternalStore:bo,useId:bo,useHostTransitionStatus:bo,useFormState:bo,useActionState:bo,useOptimistic:bo,useMemoCache:bo,useCacheRefresh:bo};Ls.useEffectEvent=bo;var Rs={readContext:$i,use:No,useCallback:function(e,t){return ko().memoizedState=[e,t===void 0?null:t],e},useContext:$i,useEffect:cs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ms.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=ko();t=t===void 0?null:t;var r=e();if(ho){Ve(!0);try{e()}finally{Ve(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ko();if(n!==void 0){var i=n(t);if(ho){Ve(!0);try{n(t)}finally{Ve(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=As.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=ko();return e={current:e},t.memoizedState=e},useState:function(e){e=Go(e);var t=e.queue,n=js.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:gs,useDeferredValue:function(e,t){return ys(ko(),e,t)},useTransition:function(){var e=Go(!1);return e=xs.bind(null,B,e.queue,!0,!1),ko().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=ko();if(Mi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Rl===null)throw Error(i(349));Bl&127||Bo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,cs(Ho.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},Vo.bind(null,r,o,n,t),null),n},useId:function(){var e=ko(),t=Rl.identifierPrefix;if(Mi){var n=wi,r=Ci;n=(r&~(1<<32-He(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=go++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=yo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Es,useFormState:U,useActionState:U,useOptimistic:function(e){var t=ko();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ns.bind(null,B,!0,n),n.dispatch=t,[e,t]},useMemoCache:Po,useCacheRefresh:function(){return ko().memoizedState=ks.bind(null,B)},useEffectEvent:function(e){var t=ko(),n={impl:e};return t.memoizedState=n,function(){if(Ll&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},zs={readContext:$i,use:No,useCallback:_s,useContext:$i,useEffect:ls,useImperativeHandle:hs,useInsertionEffect:fs,useLayoutEffect:ps,useMemo:vs,useReducer:Io,useRef:is,useState:function(){return Io(Fo)},useDebugValue:gs,useDeferredValue:function(e,t){return bs(Ao(),fo.memoizedState,e,t)},useTransition:function(){var e=Io(Fo)[0],t=Ao().memoizedState;return[typeof e==`boolean`?e:Mo(e),t]},useSyncExternalStore:zo,useId:Ds,useHostTransitionStatus:Es,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){return Ko(Ao(),fo,e,t)},useMemoCache:Po,useCacheRefresh:Os};zs.useEffectEvent=ds;var Bs={readContext:$i,use:No,useCallback:_s,useContext:$i,useEffect:ls,useImperativeHandle:hs,useInsertionEffect:fs,useLayoutEffect:ps,useMemo:vs,useReducer:Ro,useRef:is,useState:function(){return Ro(Fo)},useDebugValue:gs,useDeferredValue:function(e,t){var n=Ao();return fo===null?ys(n,e,t):bs(n,fo.memoizedState,e,t)},useTransition:function(){var e=Ro(Fo)[0],t=Ao().memoizedState;return[typeof e==`boolean`?e:Mo(e),t]},useSyncExternalStore:zo,useId:Ds,useHostTransitionStatus:Es,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){var n=Ao();return fo===null?(n.baseState=e,[e,n.queue.dispatch]):Ko(n,fo,e,t)},useMemoCache:Po,useCacheRefresh:Os};Bs.useEffectEvent=ds;function Vs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Hs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gu(),i=Va(r);i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(vu(t,e,r),Ua(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gu(),i=Va(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(vu(t,e,r),Ua(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gu(),r=Va(n);r.tag=2,t!=null&&(r.callback=t),t=Ha(e,r,n),t!==null&&(vu(t,e,n),Ua(t,e,n))}};function Us(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!br(n,r)||!br(i,a):!0}function Ws(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Hs.enqueueReplaceState(t,t.state,null)}function Gs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ks(e){qr(e)}function qs(e){console.error(e)}function Js(e){qr(e)}function Ys(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Xs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Zs(e,t,n){return n=Va(n),n.tag=3,n.payload={element:null},n.callback=function(){Ys(e,t)},n}function Qs(e){return e=Va(e),e.tag=3,e}function $s(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Xs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Xs(t,n,r),typeof i!=`function`&&(ou===null?ou=new Set([this]):ou.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function ec(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Xi(t,n,a,!0),n=to.current,n!==null){switch(n.tag){case 31:case 13:return no===null?Au():n.alternate===null&&ql===0&&(ql=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Yu(e,r,a)),!1;case 22:return n.flags|=65536,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Yu(e,r,a)),!1}throw Error(i(435,n.tag))}return Yu(e,r,a),Au(),!1}if(Mi)return t=to.current,t===null?(r!==Fi&&(t=Error(i(423),{cause:r}),Hi(hi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=hi(r,n),a=Zs(e.stateNode,r,a),Wa(e,a),ql!==4&&(ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Fi&&(e=Error(i(422),{cause:r}),Hi(hi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=hi(o,n),$l===null?$l=[o]:$l.push(o),ql!==4&&(ql=2),t===null)return!0;r=hi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Zs(n.stateNode,r,e),Wa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ou===null||!ou.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Qs(a),$s(a,e,n,r),Wa(n,a),!1}n=n.return}while(n!==null);return!1}var tc=Error(i(461)),nc=!1;function rc(e,t,n,r){t.child=e===null?La(t,null,n,r):Ia(t,e.child,n,r)}function ic(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Qi(t),r=So(e,t,n,o,a,i),s=Eo(),e!==null&&!nc?(Do(e,t,i),Oc(e,t,i)):(Mi&&s&&Di(t),t.flags|=1,rc(e,t,r,i),t.child)}function ac(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!oi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,oc(e,t,a,r,i)):(e=li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!kc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?br:n,n(o,r)&&e.ref===t.ref)return Oc(e,t,i)}return t.flags|=1,e=si(a,r),e.ref=t.ref,e.return=t,t.child=e}function oc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(br(a,r)&&e.ref===t.ref){if(nc=!1,t.pendingProps=r=a,kc(e,i))e.flags&131072&&(nc=!0);else return t.lanes=e.lanes,Oc(e,t,i)}}return mc(e,t,n,r,i)}function sc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return lc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&va(t,a===null?null:a.cachePool),a===null?$a():Qa(t,a),ao(t);else return r=t.lanes=536870912,lc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&va(t,null),$a(),oo(t)):(va(t,a.cachePool),Qa(t,a),oo(t),t.memoizedState=null);return rc(e,t,i,n),t.child}function cc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function lc(e,t,n,r,i){var a=_a();return a=a===null?null:{parent:aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&va(t,null),$a(),ao(t),e!==null&&Xi(e,t,r,!0),t.childLanes=i,null}function uc(e,t){return t=Cc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dc(e,t,n){return Ia(t,e.child,null,n),e=uc(t,t.pendingProps),e.flags|=2,so(t),t.memoizedState=null,e}function fc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Mi){if(r.mode===`hidden`)return e=uc(t,r),t.lanes=536870912,cc(null,e);if(io(t),(e=ji)?(e=uf(e,Pi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Ii(t);return t.lanes=536870912,null}return uc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(io(t),a){if(t.flags&256)t.flags&=-257,t=dc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(nc||Xi(e,t,n,!1),a=(n&e.childLanes)!==0,nc||a){if(r=Rl,r!==null&&(s=rt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ei(e,s),vu(r,e,s),tc;Au(),t=dc(e,t,n)}else e=o.treeContext,ji=mf(s.nextSibling),Ai=t,Mi=!0,Ni=null,Pi=!1,e!==null&&ki(t,e),t=uc(t,r),t.flags|=4096;return t}return e=si(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function pc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function mc(e,t,n,r,i){return Qi(t),n=So(e,t,n,r,void 0,i),r=Eo(),e!==null&&!nc?(Do(e,t,i),Oc(e,t,i)):(Mi&&r&&Di(t),t.flags|=1,rc(e,t,n,i),t.child)}function hc(e,t,n,r,i,a){return Qi(t),t.updateQueue=null,n=wo(t,r,n,i),Co(e),r=Eo(),e!==null&&!nc?(Do(e,t,a),Oc(e,t,a)):(Mi&&r&&Di(t),t.flags|=1,rc(e,t,n,a),t.child)}function gc(e,t,n,r,i){if(Qi(t),t.stateNode===null){var a=ri,o=n.contextType;typeof o==`object`&&o&&(a=$i(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Hs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},za(t),o=n.contextType,a.context=typeof o==`object`&&o?$i(o):ri,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Vs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Hs.enqueueReplaceState(a,a.state,null),qa(t,r,a,i),Ka(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Gs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ri,typeof u==`object`&&u&&(o=$i(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ws(t,a,r,o),Ra=!1;var f=t.memoizedState;a.state=f,qa(t,r,a,i),Ka(),l=t.memoizedState,s||f!==l||Ra?(typeof d==`function`&&(Vs(t,n,d,r),l=t.memoizedState),(c=Ra||Us(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ba(e,t),o=t.memoizedProps,u=Gs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ri,typeof l==`object`&&l&&(c=$i(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ws(t,a,r,c),Ra=!1,f=t.memoizedState,a.state=f,qa(t,r,a,i),Ka();var p=t.memoizedState;o!==d||f!==p||Ra||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof s==`function`&&(Vs(t,n,s,r),p=t.memoizedState),(u=Ra||Us(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Zi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,pc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ia(t,e.child,null,i),t.child=Ia(t,null,n,i)):rc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Oc(e,t,i),e}function _c(e,t,n,r){return Bi(),t.flags|=256,rc(e,t,n,r),t.child}var vc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function yc(e){return{baseLanes:e,cachePool:ya()}}function bc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Zl),e}function xc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(co.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Mi){if(a?ro(t):oo(t),(e=ji)?(e=uf(e,Pi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Ii(t);return ff(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(oo(t),a=t.mode,c=Cc({mode:`hidden`,children:c},a),r=ui(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=yc(n),r.childLanes=bc(e,s,n),t.memoizedState=vc,cc(null,r)):(ro(t),Sc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(ro(t),t.flags&=-257,t=wc(e,t,n)):t.memoizedState===null?(oo(t),c=r.fallback,a=t.mode,r=Cc({mode:`visible`,children:r.children},a),c=ui(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ia(t,e.child,null,n),r=t.child,r.memoizedState=yc(n),r.childLanes=bc(e,s,n),t.memoizedState=vc,t=cc(null,r)):(oo(t),t.child=e.child,t.flags|=128,t=null);else if(ro(t),ff(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Hi({value:r,source:null,stack:null}),t=wc(e,t,n)}else if(nc||Xi(e,t,n,!1),s=(n&e.childLanes)!==0,nc||s){if(s=Rl,s!==null&&(r=rt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ei(e,r),vu(s,e,r),tc;df(c)||Au(),t=wc(e,t,n)}else df(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ji=mf(c.nextSibling),Ai=t,Mi=!0,Ni=null,Pi=!1,e!==null&&ki(t,e),t=Sc(t,r.children),t.flags|=4096);return t}return a?(oo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=si(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ui(c,a,n,null),c.flags|=2):c=si(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,cc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=yc(n):(a=c.cachePool,a===null?a=ya():(l=aa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=bc(e,s,n),t.memoizedState=vc,cc(e.child,r)):(ro(t),n=e.child,e=n.sibling,n=si(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Sc(e,t){return t=Cc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Cc(e,t){return e=ai(22,e,null,t),e.lanes=0,e}function wc(e,t,n){return Ia(t,e.child,null,n),e=Sc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ji(e.return,t,n)}function Ec(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Dc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=co.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,ue(co,o),rc(e,t,r,n),r=Mi?yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tc(e,n,t);else if(e.tag===19)Tc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&lo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ec(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&lo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ec(t,!0,n,null,a,r);break;case`together`:Ec(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Oc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jl|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Xi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=si(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=si(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function kc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Zi(e)))}function Ac(e,t,n){switch(t.tag){case 3:he(t,t.stateNode.containerInfo),Ki(t,aa,e.memoizedState.cache),Bi();break;case 27:case 5:_e(t);break;case 4:he(t,t.stateNode.containerInfo);break;case 10:Ki(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,io(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ro(t),e=Oc(e,t,n),e===null?null:e.sibling):xc(e,t,n):(ro(t),t.flags|=128,null);ro(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Xi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Dc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ue(co,co.current),r)break;return null;case 22:return t.lanes=0,sc(e,t,n,t.pendingProps);case 24:Ki(t,aa,e.memoizedState.cache)}return Oc(e,t,n)}function jc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)nc=!0;else{if(!kc(e,n)&&!(t.flags&128))return nc=!1,Ac(e,t,n);nc=!!(e.flags&131072)}}else nc=!1,Mi&&t.flags&1048576&&Ei(t,yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ea(t.elementType),t.type=e,typeof e==`function`)oi(e)?(r=Gs(e,r),t.tag=1,t=gc(null,t,e,r,n)):(t.tag=0,t=mc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=ic(null,t,e,r,n);break a}if(a===w){t.tag=14,t=ac(null,t,e,r,n);break a}}throw t=re(e)||e,Error(i(306,t,``))}}return t;case 0:return mc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Gs(r,t.pendingProps),gc(e,t,r,a,n);case 3:a:{if(he(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ba(e,t),qa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ki(t,aa,r),r!==o.cache&&Yi(t,[aa],n,!0),Ka(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=_c(e,t,r,n);break a}if(r!==a){a=hi(Error(i(424)),t),Hi(a),t=_c(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ji=mf(e.firstChild),Ai=t,Mi=!0,Ni=null,Pi=!0,n=La(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Bi(),r===a){t=Oc(e,t,n);break a}rc(e,t,r,n)}t=t.child}return t;case 26:return pc(e,t),e===null?(n=Ff(t.type,null,t.pendingProps,null))?t.memoizedState=n:Mi||(n=t.type,e=t.pendingProps,r=Kd(pe.current).createElement(n),r[lt]=t,r[ut]=e,Bd(r,n,e),xt(r),t.stateNode=r):t.memoizedState=Ff(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _e(t),e===null&&Mi&&(r=t.stateNode=vf(t.type,t.pendingProps,pe.current),Ai=t,Pi=!0,a=ji,rf(t.type)?(hf=a,ji=mf(r.firstChild)):ji=a),rc(e,t,t.pendingProps.children,n),pc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Mi&&((a=r=ji)&&(r=cf(r,t.type,t.pendingProps,Pi),r===null?a=!1:(t.stateNode=r,Ai=t,ji=mf(r.firstChild),Pi=!1,a=!0)),a||Ii(t)),_e(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Yd(a,o)?r=null:s!==null&&Yd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=So(e,t,To,null,null,n),ip._currentValue=a),pc(e,t),rc(e,t,r,n),t.child;case 6:return e===null&&Mi&&((e=n=ji)&&(n=lf(n,t.pendingProps,Pi),n===null?e=!1:(t.stateNode=n,Ai=t,ji=null,e=!0)),e||Ii(t)),null;case 13:return xc(e,t,n);case 4:return he(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ia(t,null,r,n):rc(e,t,r,n),t.child;case 11:return ic(e,t,t.type,t.pendingProps,n);case 7:return rc(e,t,t.pendingProps,n),t.child;case 8:return rc(e,t,t.pendingProps.children,n),t.child;case 12:return rc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ki(t,t.type,r.value),rc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Qi(t),a=$i(a),r=r(a),t.flags|=1,rc(e,t,r,n),t.child;case 14:return ac(e,t,t.type,t.pendingProps,n);case 15:return oc(e,t,t.type,t.pendingProps,n);case 19:return Dc(e,t,n);case 31:return fc(e,t,n);case 22:return sc(e,t,n,t.pendingProps);case 24:return Qi(t),r=$i(aa),e===null?(a=_a(),a===null&&(a=Rl,o=oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},za(t),Ki(t,aa,a)):((e.lanes&n)!==0&&(Ba(e,t),qa(t,null,null,n),Ka()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ki(t,aa,r),r!==a.cache&&Yi(t,[aa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ki(t,aa,r))),rc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Mc(e){e.flags|=4}function Nc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Du())e.flags|=8192;else throw Da=Ca,xa}}else e.flags&=-16777217}function Pc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Xf(t)){if(Du())e.flags|=8192;else throw Da=Ca,xa}}function Fc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ze(),e.lanes|=t,Ql|=t)}function Ic(e,t){if(!Mi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Lc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Rc(e,t,n){var r=t.pendingProps;switch(Oi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lc(t),null;case 1:return Lc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),qi(aa),ge(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zi(t)?Mc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vi())),Lc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Mc(t),o===null?(Lc(t),Nc(t,a,null,r,n)):(Lc(t),Pc(t,o))):o?o===e.memoizedState?(Lc(t),t.flags&=-16777217):(Mc(t),Lc(t),Pc(t,o)):(e=e.memoizedProps,e!==r&&Mc(t),Lc(t),Nc(t,a,e,r,n)),null;case 27:if(ve(t),n=pe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Lc(t),null}e=de.current,zi(t)?Li(t,e):(e=vf(a,r,n),t.stateNode=e,Mc(t))}return Lc(t),null;case 5:if(ve(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Lc(t),null}if(o=de.current,zi(t))Li(t,o);else{var s=Kd(pe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[lt]=t,o[ut]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Bd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Mc(t)}}return Lc(t),Nc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=pe.current,zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ai,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[lt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ld(e.nodeValue,n)),e||Ii(t,!0)}else e=Kd(e).createTextNode(r),e[lt]=t,t.stateNode=e}return Lc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=zi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[lt]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Lc(t),e=!1}else n=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(so(t),t):(so(t),null);if(t.flags&128)throw Error(i(558))}return Lc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=zi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[lt]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Lc(t),a=!1}else a=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(so(t),t):(so(t),null)}return so(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Fc(t,t.updateQueue),Lc(t),null);case 4:return ge(),e===null&&Dd(t.stateNode.containerInfo),Lc(t),null;case 10:return qi(t.type),Lc(t),null;case 19:if(le(co),r=t.memoizedState,r===null)return Lc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Ic(r,!1);else{if(ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=lo(e),o!==null){for(t.flags|=128,Ic(r,!1),e=o.updateQueue,t.updateQueue=e,Fc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ci(n,e),n=n.sibling;return ue(co,co.current&1|2),Mi&&Ti(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&je()>iu&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304)}}else{if(!a){if(e=lo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Fc(t,e),Ic(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Mi)return Lc(t),null}else 2*je()-r.renderingStartTime>iu&&n!==536870912&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Lc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=je(),e.sibling=null,n=co.current,ue(co,a?n&1|2:n&1),Mi&&Ti(t,r.treeForkCount),e);case 22:case 23:return so(t),eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Lc(t),t.subtreeFlags&6&&(t.flags|=8192)):Lc(t),n=t.updateQueue,n!==null&&Fc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&le(ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qi(aa),Lc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function zc(e,t){switch(Oi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qi(aa),ge(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(so(t),t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(so(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(co),null;case 4:return ge(),null;case 10:return qi(t.type),null;case 22:case 23:return so(t),eo(),e!==null&&le(ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qi(aa),null;case 25:return null;default:return null}}function Bc(e,t){switch(Oi(t),t.tag){case 3:qi(aa),ge();break;case 26:case 27:case 5:ve(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&so(t);break;case 13:so(t);break;case 19:le(co);break;case 10:qi(t.type);break;case 22:case 23:so(t),eo(),e!==null&&le(ga);break;case 24:qi(aa)}}function Vc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ju(t,t.return,e)}}function Hc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Ju(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ju(t,t.return,e)}}function Uc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ya(t,n)}catch(t){Ju(e,e.return,t)}}}function Wc(e,t,n){n.props=Gs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ju(e,t,n)}}function Gc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ju(e,t,n)}}function Kc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Ju(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ju(e,t,n)}else n.current=null}}function qc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ju(e,e.return,t)}}function Jc(e,t,n){try{var r=e.stateNode;Vd(r,e.type,n,t),r[ut]=t}catch(t){Ju(e,e.return,t)}}function Yc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&rf(e.type)||e.tag===4}function Xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Yc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&rf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xt));else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Bd(t,r,n),t[lt]=e,t[ut]=n}catch(t){Ju(e,e.return,t)}}var el=!1,tl=!1,nl=!1,rl=typeof WeakSet==`function`?WeakSet:Set,il=null;function al(e,t){if(e=e.containerInfo,Wd=pp,e=wr(e),Tr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Gd={focusedElem:e,selectionRange:n},pp=!1,il=t;il!==null;)if(t=il,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,il=e;else for(;il!==null;){switch(t=il,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Gs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ju(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)sf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:sf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,il=e;break}il=t.return}}function ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:xl(e,n),r&4&&Vc(5,n);break;case 1:if(xl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ju(n,n.return,e)}else{var i=Gs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ju(n,n.return,e)}}}r&64&&Uc(n),r&512&&Gc(n,n.return);break;case 3:if(xl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ya(e,t)}catch(e){Ju(n,n.return,e)}}break;case 27:t===null&&r&4&&$c(n);case 26:case 5:xl(e,n),t===null&&r&4&&qc(n),r&512&&Gc(n,n.return);break;case 12:xl(e,n);break;case 31:xl(e,n),r&4&&fl(e,n);break;case 13:xl(e,n),r&4&&pl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Qu.bind(null,n),pf(e,n))));break;case 22:if(r=n.memoizedState!==null||el,!r){t=t!==null&&t.memoizedState!==null||tl,i=el;var a=tl;el=r,(tl=t)&&!a?Cl(e,n,!!(n.subtreeFlags&8772)):xl(e,n),el=i,tl=a}break;case 30:break;default:xl(e,n)}}function sl(e){var t=e.alternate;t!==null&&(e.alternate=null,sl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&_t(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var cl=null,ll=!1;function ul(e,t,n){for(n=n.child;n!==null;)dl(e,t,n),n=n.sibling}function dl(e,t,n){if(Be&&typeof Be.onCommitFiberUnmount==`function`)try{Be.onCommitFiberUnmount(ze,n)}catch{}switch(n.tag){case 26:tl||Kc(n,t),ul(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:tl||Kc(n,t);var r=cl,i=ll;rf(n.type)&&(cl=n.stateNode,ll=!1),ul(e,t,n),yf(n.stateNode),cl=r,ll=i;break;case 5:tl||Kc(n,t);case 6:if(r=cl,i=ll,cl=null,ul(e,t,n),cl=r,ll=i,cl!==null){if(ll)try{(cl.nodeType===9?cl.body:cl.nodeName===`HTML`?cl.ownerDocument.body:cl).removeChild(n.stateNode)}catch(e){Ju(n,t,e)}else try{cl.removeChild(n.stateNode)}catch(e){Ju(n,t,e)}}break;case 18:cl!==null&&(ll?(e=cl,af(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),zp(e)):af(cl,n.stateNode));break;case 4:r=cl,i=ll,cl=n.stateNode.containerInfo,ll=!0,ul(e,t,n),cl=r,ll=i;break;case 0:case 11:case 14:case 15:Hc(2,n,t),tl||Hc(4,n,t),ul(e,t,n);break;case 1:tl||(Kc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Wc(n,t,r)),ul(e,t,n);break;case 21:ul(e,t,n);break;case 22:tl=(r=tl)||n.memoizedState!==null,ul(e,t,n),tl=r;break;default:ul(e,t,n)}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{zp(e)}catch(e){Ju(t,t.return,e)}}}function pl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{zp(e)}catch(e){Ju(t,t.return,e)}}function ml(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new rl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new rl),t;default:throw Error(i(435,e.tag))}}function hl(e,t){var n=ml(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=$u.bind(null,e,t);t.then(r,r)}})}function gl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(rf(c.type)){cl=c.stateNode,ll=!1;break a}break;case 5:cl=c.stateNode,ll=!1;break a;case 3:case 4:cl=c.stateNode.containerInfo,ll=!0;break a}c=c.return}if(cl===null)throw Error(i(160));dl(o,s,a),cl=null,ll=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)vl(t,e),t=t.sibling}var _l=null;function vl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gl(t,e),yl(e),r&4&&(Hc(3,e,e.return),Vc(3,e),Hc(5,e,e.return));break;case 1:gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),r&64&&el&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=_l;if(gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[gt]||o[lt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Bd(o,r,n),o[lt]=e,xt(o),r=o;break a;case`link`:var s=qf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=qf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[lt]=e,xt(o),r=o}e.stateNode=r}else Jf(a,e.type,e.stateNode)}else e.stateNode=Hf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Jc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Jf(a,e.type,e.stateNode):Hf(a,r,e.memoizedProps))}break;case 27:gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),n!==null&&r&4&&Jc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),e.flags&32){a=e.stateNode;try{L(a,``)}catch(t){Ju(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Jc(e,a,n===null?a:n.memoizedProps)),r&1024&&(nl=!0);break;case 6:if(gl(t,e),yl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ju(e,e.return,t)}}break;case 3:if(Kf=null,a=_l,_l=Sf(t.containerInfo),gl(t,e),_l=a,yl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{zp(t.containerInfo)}catch(t){Ju(e,e.return,t)}nl&&(nl=!1,bl(e));break;case 4:r=_l,_l=Sf(e.stateNode.containerInfo),gl(t,e),yl(e),_l=r;break;case 12:gl(t,e),yl(e);break;case 31:gl(t,e),yl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 13:gl(t,e),yl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(nu=je()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=el,d=tl;if(el=u||a,tl=d||l,gl(t,e),tl=d,el=u,yl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||el||tl||Sl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ju(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ju(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?of(m,!0):of(l.stateNode,!1)}catch(e){Ju(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,hl(e,n))));break;case 19:gl(t,e),yl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 30:break;case 21:break;default:gl(t,e),yl(e)}}function yl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Yc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Qc(e,Xc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(L(o,``),n.flags&=-33),Qc(e,Xc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Zc(e,Xc(e),s);break;default:throw Error(i(161))}}catch(t){Ju(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ol(e,t.alternate,t),t=t.sibling}function Sl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Hc(4,t,t.return),Sl(t);break;case 1:Kc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Wc(t,t.return,n),Sl(t);break;case 27:yf(t.stateNode);case 26:case 5:Kc(t,t.return),Sl(t);break;case 22:t.memoizedState===null&&Sl(t);break;case 30:Sl(t);break;default:Sl(t)}e=e.sibling}}function Cl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Cl(i,a,n),Vc(4,a);break;case 1:if(Cl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ju(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ja(c[i],s)}catch(e){Ju(r,r.return,e)}}n&&o&64&&Uc(a),Gc(a,a.return);break;case 27:$c(a);case 26:case 5:Cl(i,a,n),n&&r===null&&o&4&&qc(a),Gc(a,a.return);break;case 12:Cl(i,a,n);break;case 31:Cl(i,a,n),n&&o&4&&fl(i,a);break;case 13:Cl(i,a,n),n&&o&4&&pl(i,a);break;case 22:a.memoizedState===null&&Cl(i,a,n),Gc(a,a.return);break;case 30:break;default:Cl(i,a,n)}t=t.sibling}}function wl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&sa(n))}function Tl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e))}function El(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)W(e,t,n,r),t=t.sibling}function W(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:El(e,t,n,r),i&2048&&Vc(9,t);break;case 1:El(e,t,n,r);break;case 3:El(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e)));break;case 12:if(i&2048){El(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ju(t,t.return,e)}}else El(e,t,n,r);break;case 31:El(e,t,n,r);break;case 13:El(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?El(e,t,n,r):(a._visibility|=2,Dl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?El(e,t,n,r):Ol(e,t),i&2048&&wl(o,t);break;case 24:El(e,t,n,r),i&2048&&Tl(t.alternate,t);break;default:El(e,t,n,r)}}function Dl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Dl(a,o,s,c,i),Vc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Dl(a,o,s,c,i)):u._visibility&2?Dl(a,o,s,c,i):Ol(a,o),i&&l&2048&&wl(o.alternate,o);break;case 24:Dl(a,o,s,c,i),i&&l&2048&&Tl(o.alternate,o);break;default:Dl(a,o,s,c,i)}t=t.sibling}}function Ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ol(n,r),i&2048&&wl(r.alternate,r);break;case 24:Ol(n,r),i&2048&&Tl(r.alternate,r);break;default:Ol(n,r)}t=t.sibling}}var kl=8192;function G(e,t,n){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)Al(e,t,n),e=e.sibling}function Al(e,t,n){switch(e.tag){case 26:G(e,t,n),e.flags&kl&&e.memoizedState!==null&&Zf(n,_l,e.memoizedState,e.memoizedProps);break;case 5:G(e,t,n);break;case 3:case 4:var r=_l;_l=Sf(e.stateNode.containerInfo),G(e,t,n),_l=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=kl,kl=16777216,G(e,t,n),kl=r):G(e,t,n));break;default:G(e,t,n)}}function K(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];il=r,Pl(r,e)}K(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ml(e),e=e.sibling}function Ml(e){switch(e.tag){case 0:case 11:case 15:jl(e),e.flags&2048&&Hc(9,e,e.return);break;case 3:jl(e);break;case 12:jl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nl(e)):jl(e);break;default:jl(e)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];il=r,Pl(r,e)}K(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Hc(8,t,t.return),Nl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nl(t));break;default:Nl(t)}e=e.sibling}}function Pl(e,t){for(;il!==null;){var n=il;switch(n.tag){case 0:case 11:case 15:Hc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:sa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,il=r;else a:for(n=e;il!==null;){r=il;var i=r.sibling,a=r.return;if(sl(r),r===n){il=null;break a}if(i!==null){i.return=a,il=i;break a}il=a}}}var Fl={getCacheForType:function(e){var t=$i(aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return $i(aa).controller.signal}},Il=typeof WeakMap==`function`?WeakMap:Map,Ll=0,Rl=null,zl=null,Bl=0,Vl=0,Hl=null,Ul=!1,Wl=!1,Gl=!1,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=null,eu=null,tu=!1,nu=0,ru=0,iu=1/0,au=null,ou=null,su=0,cu=null,lu=null,uu=0,du=0,fu=null,pu=null,mu=0,hu=null;function gu(){return Ll&2&&Bl!==0?Bl&-Bl:O.T===null?ot():hd()}function _u(){if(Zl===0){if(!(Bl&536870912)||Mi){var e=j;j<<=1,!(j&3932160)&&(j=262144),Zl=e}else Zl=536870912}return e=to.current,e!==null&&(e.flags|=32),Zl}function vu(e,t,n){(e===Rl&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)&&(Tu(e,0),Su(e,Bl,Zl,!1)),$e(e,n),Ll&2&&e===Rl||(e===Rl&&(!(Ll&2)&&(Yl|=n),ql===4&&Su(e,Bl,Zl,!1)),sd(e))}function yu(e,t,n){if(Ll&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ye(e,t),a=r?Nu(e,t):ju(e,t,!0),o=r;do{if(a===0){Wl&&!r&&Su(e,t,0,!1);break}if(n=e.current.alternate,o&&!xu(n))a=ju(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=$l;var l=c.current.memoizedState.isDehydrated;if(l&&(Tu(c,s).flags|=256),s=ju(c,s,!1),s!==2){if(Gl&&!l){c.errorRecoveryDisabledLanes|=o,Yl|=o,a=4;break a}o=eu,eu=a,o!==null&&(eu===null?eu=o:eu.push.apply(eu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Tu(e,0),Su(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Su(r,t,Zl,!Ul);break a;case 2:eu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=nu+300-je(),10<a)){if(Su(r,t,Zl,!Ul),Je(r,0,!0)!==0)break a;uu=t,r.timeoutHandle=Qd(bu.bind(null,r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,`Throttled`,-0,0),a);break a}bu(r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,null,-0,0)}break}}while(1);sd(e)}function bu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xt},Al(t,a,d);var m=(a&62914560)===a?nu-je():(a&4194048)===a?ru-je():0;if(m=$f(d,m),m!==null){uu=a,e.cancelPendingCommit=m(Bu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Su(e,a,o,!l);return}}Bu(e,t,a,n,r,i,o,s,c)}function xu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!yr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Su(e,t,n,r){t&=~Xl,t&=~Yl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-He(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&tt(e,n,t)}function Cu(){return Ll&6?!0:(cd(0,!1),!1)}function wu(){if(zl!==null){if(Vl===0)var e=zl.return;else e=zl,Gi=Wi=null,Oo(e),Aa=null,ja=0,e=zl;for(;e!==null;)Bc(e.alternate,e),e=e.return;zl=null}}function Tu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,$d(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),uu=0,wu(),Rl=e,zl=n=si(e.current,null),Bl=t,Vl=0,Hl=null,Ul=!1,Wl=Ye(e,t),Gl=!1,Ql=Zl=Xl=Yl=Jl=ql=0,eu=$l=null,tu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-He(r),a=1<<i;t|=e[i],r&=~a}return Kl=t,Zr(),n}function Eu(e,t){B=null,O.H=Ls,t===ba||t===Sa?(t=Oa(),Vl=3):t===xa?(t=Oa(),Vl=4):Vl=t===tc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Hl=t,zl===null&&(ql=1,Ys(e,hi(t,e.current)))}function Du(){var e=to.current;return e===null?!0:(Bl&4194048)===Bl?no===null:(Bl&62914560)===Bl||Bl&536870912?e===no:!1}function Ou(){var e=O.H;return O.H=Ls,e===null?Ls:e}function ku(){var e=O.A;return O.A=Fl,e}function Au(){ql=4,Ul||(Bl&4194048)!==Bl&&to.current!==null||(Wl=!0),!(Jl&134217727)&&!(Yl&134217727)||Rl===null||Su(Rl,Bl,Zl,!1)}function ju(e,t,n){var r=Ll;Ll|=2;var i=Ou(),a=ku();(Rl!==e||Bl!==t)&&(au=null,Tu(e,t)),t=!1;var o=ql;a:do try{if(Vl!==0&&zl!==null){var s=zl,c=Hl;switch(Vl){case 8:wu(),o=6;break a;case 3:case 2:case 9:case 6:to.current===null&&(t=!0);var l=Vl;if(Vl=0,Hl=null,Lu(e,s,c,l),n&&Wl){o=0;break a}break;default:l=Vl,Vl=0,Hl=null,Lu(e,s,c,l)}}Mu(),o=ql;break}catch(t){Eu(e,t)}while(1);return t&&e.shellSuspendCounter++,Gi=Wi=null,Ll=r,O.H=i,O.A=a,zl===null&&(Rl=null,Bl=0,Zr()),o}function Mu(){for(;zl!==null;)Fu(zl)}function Nu(e,t){var n=Ll;Ll|=2;var r=Ou(),a=ku();Rl!==e||Bl!==t?(au=null,iu=je()+500,Tu(e,t)):Wl=Ye(e,t);a:do try{if(Vl!==0&&zl!==null){t=zl;var o=Hl;b:switch(Vl){case 1:Vl=0,Hl=null,Lu(e,t,o,1);break;case 2:case 9:if(wa(o)){Vl=0,Hl=null,Iu(t);break}t=function(){Vl!==2&&Vl!==9||Rl!==e||(Vl=7),sd(e)},o.then(t,t);break a;case 3:Vl=7;break a;case 4:Vl=5;break a;case 7:wa(o)?(Vl=0,Hl=null,Iu(t)):(Vl=0,Hl=null,Lu(e,t,o,7));break;case 5:var s=null;switch(zl.tag){case 26:s=zl.memoizedState;case 5:case 27:var c=zl;if(s?Xf(s):c.stateNode.complete){Vl=0,Hl=null;var l=c.sibling;if(l!==null)zl=l;else{var u=c.return;u===null?zl=null:(zl=u,Ru(u))}break b}}Vl=0,Hl=null,Lu(e,t,o,5);break;case 6:Vl=0,Hl=null,Lu(e,t,o,6);break;case 8:wu(),ql=6;break a;default:throw Error(i(462))}}Pu();break}catch(t){Eu(e,t)}while(1);return Gi=Wi=null,O.H=r,O.A=a,Ll=n,zl===null?(Rl=null,Bl=0,Zr(),ql):0}function Pu(){for(;zl!==null&&!ke();)Fu(zl)}function Fu(e){var t=jc(e.alternate,e,Kl);e.memoizedProps=e.pendingProps,t===null?Ru(e):zl=t}function Iu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=hc(n,t,t.pendingProps,t.type,void 0,Bl);break;case 11:t=hc(n,t,t.pendingProps,t.type.render,t.ref,Bl);break;case 5:Oo(t);default:Bc(n,t),t=zl=ci(t,Kl),t=jc(n,t,Kl)}e.memoizedProps=e.pendingProps,t===null?Ru(e):zl=t}function Lu(e,t,n,r){Gi=Wi=null,Oo(t),Aa=null,ja=0;var i=t.return;try{if(ec(e,i,t,n,Bl)){ql=1,Ys(e,hi(n,e.current)),zl=null;return}}catch(t){if(i!==null)throw zl=i,t;ql=1,Ys(e,hi(n,e.current)),zl=null;return}t.flags&32768?(Mi||r===1?e=!0:Wl||Bl&536870912?e=!1:(Ul=e=!0,(r===2||r===9||r===3||r===6)&&(r=to.current,r!==null&&r.tag===13&&(r.flags|=16384))),zu(t,e)):Ru(t)}function Ru(e){var t=e;do{if(t.flags&32768){zu(t,Ul);return}e=t.return;var n=Rc(t.alternate,t,Kl);if(n!==null){zl=n;return}if(t=t.sibling,t!==null){zl=t;return}zl=t=e}while(t!==null);ql===0&&(ql=5)}function zu(e,t){do{var n=zc(e.alternate,e);if(n!==null){n.flags&=32767,zl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){zl=e;return}zl=e=n}while(e!==null);ql=6,zl=null}function Bu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Gu();while(su!==0);if(Ll&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Xr,et(e,n,o,s,c,l),e===Rl&&(zl=Rl=null,Bl=0),lu=t,cu=e,uu=n,du=o,fu=a,pu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ed(Fe,function(){return Ku(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=O.T,O.T=null,a=k.p,k.p=2,s=Ll,Ll|=4;try{al(e,t,n)}finally{Ll=s,k.p=a,O.T=r}}su=1,Vu(),Hu(),Uu()}}function Vu(){if(su===1){su=0;var e=cu,t=lu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=O.T,O.T=null;var r=k.p;k.p=2;var i=Ll;Ll|=4;try{vl(t,e);var a=Gd,o=wr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Cr(s.ownerDocument.documentElement,s)){if(c!==null&&Tr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Sr(s,h),v=Sr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}pp=!!Wd,Gd=Wd=null}finally{Ll=i,k.p=r,O.T=n}}e.current=t,su=2}}function Hu(){if(su===2){su=0;var e=cu,t=lu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=O.T,O.T=null;var r=k.p;k.p=2;var i=Ll;Ll|=4;try{ol(e,t.alternate,t)}finally{Ll=i,k.p=r,O.T=n}}su=3}}function Uu(){if(su===4||su===3){su=0,Ae();var e=cu,t=lu,n=uu,r=pu;t.subtreeFlags&10256||t.flags&10256?su=5:(su=0,lu=cu=null,Wu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ou=null),at(n),t=t.stateNode,Be&&typeof Be.onCommitFiberRoot==`function`)try{Be.onCommitFiberRoot(ze,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=O.T,i=k.p,k.p=2,O.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{O.T=t,k.p=i}}uu&3&&Gu(),sd(e),i=e.pendingLanes,n&261930&&i&42?e===hu?mu++:(mu=0,hu=e):mu=0,cd(0,!1)}}function Wu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,sa(t)))}function Gu(){return Vu(),Hu(),Uu(),Ku()}function Ku(){if(su!==5)return!1;var e=cu,t=du;du=0;var n=at(uu),r=O.T,a=k.p;try{k.p=32>n?32:n,O.T=null,n=fu,fu=null;var o=cu,s=uu;if(su=0,lu=cu=null,uu=0,Ll&6)throw Error(i(331));var c=Ll;if(Ll|=4,Ml(o.current),W(o,o.current,s,n),Ll=c,cd(0,!1),Be&&typeof Be.onPostCommitFiberRoot==`function`)try{Be.onPostCommitFiberRoot(ze,o)}catch{}return!0}finally{k.p=a,O.T=r,Wu(e,t)}}function qu(e,t,n){t=hi(n,t),t=Zs(e.stateNode,t,2),e=Ha(e,t,2),e!==null&&($e(e,2),sd(e))}function Ju(e,t,n){if(e.tag===3)qu(e,e,n);else for(;t!==null;){if(t.tag===3){qu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ou===null||!ou.has(r))){e=hi(n,e),n=Qs(2),r=Ha(t,n,2),r!==null&&($s(n,r,t,e),$e(r,2),sd(r));break}}t=t.return}}function Yu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Il;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Gl=!0,i.add(n),e=Xu.bind(null,e,t,n),t.then(e,e))}function Xu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Rl===e&&(Bl&n)===n&&(ql===4||ql===3&&(Bl&62914560)===Bl&&300>je()-nu?!(Ll&2)&&Tu(e,0):Xl|=n,Ql===Bl&&(Ql=0)),sd(e)}function Zu(e,t){t===0&&(t=Ze()),e=ei(e,t),e!==null&&($e(e,t),sd(e))}function Qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zu(e,n)}function $u(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Zu(e,n)}function ed(e,t){return De(e,t)}var td=null,nd=null,rd=!1,id=!1,ad=!1,od=0;function sd(e){e!==nd&&e.next===null&&(nd===null?td=nd=e:nd=nd.next=e),id=!0,rd||(rd=!0,md())}function cd(e,t){if(!ad&&id){ad=!0;do for(var n=!1,r=td;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-He(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,pd(r,a))}else a=Bl,a=Je(r,r===Rl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ye(r,a)||(n=!0,pd(r,a))}r=r.next}while(n);ad=!1}}function ld(){ud()}function ud(){id=rd=!1;var e=0;od!==0&&Zd()&&(e=od);for(var t=je(),n=null,r=td;r!==null;){var i=r.next,a=dd(r,t);a===0?(r.next=null,n===null?td=i:n.next=i,i===null&&(nd=n)):(n=r,(e!==0||a&3)&&(id=!0)),r=i}su!==0&&su!==5||cd(e,!1),od!==0&&(od=0)}function dd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-He(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Xe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Rl,n=Bl,n=Je(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Oe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ye(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Oe(r),at(n)){case 2:case 8:n=Pe;break;case 32:n=Fe;break;case 268435456:n=Le;break;default:n=Fe}return r=fd.bind(null,e),n=De(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Oe(r),e.callbackPriority=2,e.callbackNode=null,2}function fd(e,t){if(su!==0&&su!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Gu()&&e.callbackNode!==n)return null;var r=Bl;return r=Je(e,e===Rl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(yu(e,r,t),dd(e,je()),e.callbackNode!=null&&e.callbackNode===n?fd.bind(null,e):null)}function pd(e,t){if(Gu())return null;yu(e,t,!0)}function md(){tf(function(){Ll&6?De(Ne,ld):ud()})}function hd(){if(od===0){var e=ua;e===0&&(e=qe,qe<<=1,!(qe&261888)&&(qe=256)),od=e}return od}function gd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Yt(``+e)}function _d(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function vd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=gd((i[ut]||null).action),o=r.submitter;o&&(t=(t=o[ut]||null)?gd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(od!==0){var e=o?_d(i,o):new FormData(i);Cs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?_d(i,o):new FormData(i),Cs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var yd=0;yd<Gr.length;yd++){var bd=Gr[yd];Kr(bd.toLowerCase(),`on`+(bd[0].toUpperCase()+bd.slice(1)))}Kr(Lr,`onAnimationEnd`),Kr(Rr,`onAnimationIteration`),Kr(zr,`onAnimationStart`),Kr(`dblclick`,`onDoubleClick`),Kr(`focusin`,`onFocus`),Kr(`focusout`,`onBlur`),Kr(Br,`onTransitionRun`),Kr(Vr,`onTransitionStart`),Kr(Hr,`onTransitionCancel`),Kr(Ur,`onTransitionEnd`),wt(`onMouseEnter`,[`mouseout`,`mouseover`]),wt(`onMouseLeave`,[`mouseout`,`mouseover`]),wt(`onPointerEnter`,[`pointerout`,`pointerover`]),wt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ct(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ct(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ct(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ct(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var xd=`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(` `),Sd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(xd));function Cd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){qr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){qr(e)}i.currentTarget=null,a=c}}}}function wd(e,t){var n=t[ft];n===void 0&&(n=t[ft]=new Set);var r=e+`__bubble`;n.has(r)||(Od(t,e,2,!1),n.add(r))}function Td(e,t,n){var r=0;t&&(r|=4),Od(n,e,r,t)}var Ed=`_reactListening`+Math.random().toString(36).slice(2);function Dd(e){if(!e[Ed]){e[Ed]=!0,F.forEach(function(t){t!==`selectionchange`&&(Sd.has(t)||Td(t,!1,e),Td(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ed]||(t[Ed]=!0,Td(`selectionchange`,!1,t))}}function Od(e,t,n,r){switch(bp(t)){case 2:var i=mp;break;case 8:i=hp;break;default:i=gp}n=i.bind(null,t,n,e),i=void 0,!sn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function kd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=P(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}rn(function(){var r=a,i=Qt(n),s=[];a:{var c=Wr.get(e);if(c!==void 0){var l=vn,u=e;switch(e){case`keypress`:if(pn(n)===0)break a;case`keydown`:case`keyup`:l=In;break;case`focusin`:u=`focus`,l=Dn;break;case`focusout`:u=`blur`,l=Dn;break;case`beforeblur`:case`afterblur`:l=Dn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Tn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=En;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Rn;break;case Lr:case Rr:case zr:l=On;break;case Ur:l=zn;break;case`scroll`:case`scrollend`:l=bn;break;case`wheel`:l=Bn;break;case`copy`:case`cut`:case`paste`:l=kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Ln;break;case`toggle`:case`beforetoggle`:l=Vn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=an(m,p),g!=null&&d.push(Ad(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Zt&&(u=n.relatedTarget||n.fromElement)&&(P(u)||u[dt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?P(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Tn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Ln,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:yt(l),h=u==null?c:yt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,P(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Md,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Nd(s,c,l,d,!1),u!==null&&f!==null&&Nd(s,f,u,d,!0)}}a:{if(c=r?yt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=sr;else if(tr(c)){if(cr)v=_r;else{v=hr;var y=mr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&qt(r.elementType)&&(v=sr):v=gr;if(v&&=v(e,r)){nr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ht(c,`number`,c.value)}switch(y=r?yt(r):window,e){case`focusin`:(tr(y)||y.contentEditable===`true`)&&(Dr=y,Or=r,kr=null);break;case`focusout`:kr=Or=Dr=null;break;case`mousedown`:Ar=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ar=!1,jr(s,n,i);break;case`selectionchange`:if(Er)break;case`keydown`:case`keyup`:jr(s,n,i)}var b;if(Un)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Zn?Yn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Kn&&n.locale!==`ko`&&(Zn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Zn&&(b=fn()):(ln=i,un=`value`in ln?ln.value:ln.textContent,Zn=!0)),y=jd(r,x),0<y.length&&(x=new An(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Xn(n),b!==null&&(x.data=b)))),(b=Gn?Qn(e,n):$n(e,n))&&(x=jd(r,`onBeforeInput`),0<x.length&&(y=new An(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),vd(s,e,r,n,i)}Cd(s,t)})}function Ad(e,t,n){return{instance:e,listener:t,currentTarget:n}}function jd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=an(e,n),i!=null&&r.unshift(Ad(e,i,a)),i=an(e,t),i!=null&&r.push(Ad(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Md(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Nd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=an(n,a),l!=null&&o.unshift(Ad(n,l,c))):i||(l=an(n,a),l!=null&&o.push(Ad(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Pd=/\r\n?/g,Fd=/\u0000|\uFFFD/g;function Id(e){return(typeof e==`string`?e:``+e).replace(Pd,`
91
+ `).replace(Fd,``)}function Ld(e,t){return t=Id(t),Id(e)===t}function Rd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||L(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&L(e,``+r);break;case`className`:At(e,`class`,r);break;case`tabIndex`:At(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:At(e,n,r);break;case`style`:Kt(e,r,o);break;case`data`:if(t!==`object`){At(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Rd(e,t,`name`,a.name,a,null),Rd(e,t,`formEncType`,a.formEncType,a,null),Rd(e,t,`formMethod`,a.formMethod,a,null),Rd(e,t,`formTarget`,a.formTarget,a,null)):(Rd(e,t,`encType`,a.encType,a,null),Rd(e,t,`method`,a.method,a,null),Rd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`onScroll`:r!=null&&wd(`scroll`,e);break;case`onScrollEnd`:r!=null&&wd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Yt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:wd(`beforetoggle`,e),wd(`toggle`,e),kt(e,`popover`,r);break;case`xlinkActuate`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:kt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=z.get(n)||n,kt(e,n,r))}}function zd(e,t,n,r,a,o){switch(n){case`style`:Kt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?L(e,r):(typeof r==`number`||typeof r==`bigint`)&&L(e,``+r);break;case`onScroll`:r!=null&&wd(`scroll`,e);break;case`onScrollEnd`:r!=null&&wd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!St.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ut]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):kt(e,n,r)}}}function Bd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:wd(`error`,e),wd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Rd(e,t,o,s,n,null)}}a&&Rd(e,t,`srcSet`,n.srcSet,n,null),r&&Rd(e,t,`src`,n.src,n,null);return;case`input`:wd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Rd(e,t,r,d,n,null)}}Vt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in wd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Rd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ut(e,!!r,n,!0):Ut(e,!!r,t,!1);return;case`textarea`:for(s in wd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Rd(e,t,s,c,n,null)}I(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Rd(e,t,l,r,n,null)}return;case`dialog`:wd(`beforetoggle`,e),wd(`toggle`,e),wd(`cancel`,e),wd(`close`,e);break;case`iframe`:case`object`:wd(`load`,e);break;case`video`:case`audio`:for(r=0;r<xd.length;r++)wd(xd[r],e);break;case`image`:wd(`error`,e),wd(`load`,e);break;case`details`:wd(`toggle`,e);break;case`embed`:case`source`:case`link`:wd(`error`,e),wd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Rd(e,t,u,r,n,null)}return;default:if(qt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&zd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Rd(e,t,c,r,n,null))}function Vd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Rd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Rd(e,t,p,m,r,f)}}Bt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Rd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Rd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ut(e,!!n,n?[]:``,!1):Ut(e,!!n,t,!0)):Ut(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Rd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Rd(e,t,s,a,r,o)}Wt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Rd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Rd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Rd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Rd(e,t,u,p,r,m)}return;default:if(qt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&zd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||zd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Rd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Rd(e,t,f,p,r,m)}function Hd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ud(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Hd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Hd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Wd=null,Gd=null;function Kd(e){return e.nodeType===9?e:e.ownerDocument}function qd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Jd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Yd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xd=null;function Zd(){var e=window.event;return e&&e.type===`popstate`?e!==Xd&&(Xd=e,!0):(Xd=null,!1)}var Qd=typeof setTimeout==`function`?setTimeout:void 0,$d=typeof clearTimeout==`function`?clearTimeout:void 0,ef=typeof Promise==`function`?Promise:void 0,tf=typeof queueMicrotask==`function`?queueMicrotask:ef===void 0?Qd:function(e){return ef.resolve(null).then(e).catch(nf)};function nf(e){setTimeout(function(){throw e})}function rf(e){return e===`head`}function af(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),zp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)yf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,yf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[gt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&yf(e.ownerDocument.body)}n=i}while(n);zp(t)}function of(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function sf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:sf(n),_t(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function cf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[gt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=mf(e.nextSibling),e===null)break}return null}function lf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=mf(e.nextSibling),e===null))return null;return e}function uf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=mf(e.nextSibling),e===null))return null;return e}function df(e){return e.data===`$?`||e.data===`$~`}function ff(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function pf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function mf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var hf=null;function gf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return mf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function _f(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function vf(e,t,n){switch(t=Kd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function yf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);_t(e)}var bf=new Map,xf=new Set;function Sf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Cf=k.d;k.d={f:wf,r:Tf,D:Of,C:kf,L:Af,m:jf,X:Nf,S:Mf,M:Pf};function wf(){var e=Cf.f(),t=Cu();return e||t}function Tf(e){var t=vt(e);t!==null&&t.tag===5&&t.type===`form`?Ts(t):Cf.r(e)}var Ef=typeof document>`u`?null:document;function Df(e,t,n){var r=Ef;if(r&&typeof t==`string`&&t){var i=zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),xf.has(i)||(xf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Bd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Of(e){Cf.D(e),Df(`dns-prefetch`,e,null)}function kf(e,t){Cf.C(e,t),Df(`preconnect`,e,t)}function Af(e,t,n){Cf.L(e,t,n);var r=Ef;if(r&&e&&t){var i=`link[rel="preload"][as="`+zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+zt(n.imageSizes)+`"]`)):i+=`[href="`+zt(e)+`"]`;var a=i;switch(t){case`style`:a=If(e);break;case`script`:a=Bf(e)}bf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),bf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Lf(a))||t===`script`&&r.querySelector(Vf(a))||(t=r.createElement(`link`),Bd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function jf(e,t){Cf.m(e,t);var n=Ef;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+zt(r)+`"][href="`+zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Bf(e)}if(!bf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),bf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Vf(a)))return}r=n.createElement(`link`),Bd(r,`link`,e),xt(r),n.head.appendChild(r)}}}function Mf(e,t,n){Cf.S(e,t,n);var r=Ef;if(r&&e){var i=bt(r).hoistableStyles,a=If(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Lf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=bf.get(a))&&Wf(e,n);var c=o=r.createElement(`link`);xt(c),Bd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Uf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Nf(e,t){Cf.X(e,t);var n=Ef;if(n&&e){var r=bt(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=f({src:e,async:!0},t),(t=bf.get(i))&&Gf(e,t),a=n.createElement(`script`),xt(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t){Cf.M(e,t);var n=Ef;if(n&&e){var r=bt(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=bf.get(i))&&Gf(e,t),a=n.createElement(`script`),xt(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ff(e,t,n,r){var a=(a=pe.current)?Sf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=If(n.href),n=bt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=If(n.href);var o=bt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Lf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),bf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},bf.set(e,n),o||zf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Bf(n),n=bt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function If(e){return`href="`+zt(e)+`"`}function Lf(e){return`link[rel="stylesheet"][`+e+`]`}function Rf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function zf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Bd(t,`link`,n),xt(t),e.head.appendChild(t))}function Bf(e){return`[src="`+zt(e)+`"]`}function Vf(e){return`script[async]`+e}function Hf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+zt(n.href)+`"]`);if(r)return t.instance=r,xt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),xt(r),Bd(r,`style`,a),Uf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=If(n.href);var o=e.querySelector(Lf(a));if(o)return t.state.loading|=4,t.instance=o,xt(o),o;r=Rf(n),(a=bf.get(a))&&Wf(r,a),o=(e.ownerDocument||e).createElement(`link`),xt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Bd(o,`link`,r),t.state.loading|=4,Uf(o,n.precedence,e),t.instance=o;case`script`:return o=Bf(n.src),(a=e.querySelector(Vf(o)))?(t.instance=a,xt(a),a):(r=n,(a=bf.get(o))&&(r=f({},n),Gf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),xt(a),Bd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Uf(r,n.precedence,e));return t.instance}function Uf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Wf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Gf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Kf=null;function qf(e,t,n){if(Kf===null){var r=new Map,i=Kf=new Map;i.set(n,r)}else i=Kf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[gt]||a[lt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Jf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Yf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Xf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=If(r.href),a=t.querySelector(Lf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ep.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,xt(a);return}a=t.ownerDocument||t,r=Rf(r),(i=bf.get(i))&&Wf(r,i),a=a.createElement(`link`),xt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Bd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ep.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Qf=0;function $f(e,t){return e.stylesheets&&e.count===0&&np(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&np(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Qf===0&&(Qf=62500*Ud());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&np(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ep(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)np(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var tp=null;function np(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,tp=new Map,t.forEach(rp,e),tp=null,ep.call(e))}function rp(e,t){if(!(t.state.loading&4)){var n=tp.get(e);if(n)var r=n.get(null);else{n=new Map,tp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ep.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ip={$$typeof:b,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function ap(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Qe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qe(0),this.hiddenUpdates=Qe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function op(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ap(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ai(3,null,null,t),e.current=a,a.stateNode=e,t=oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},za(a),e}function sp(e){return e?(e=ri,e):ri}function cp(e,t,n,r,i,a){i=sp(i),r.context===null?r.context=i:r.pendingContext=i,r=Va(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ha(e,r,t),n!==null&&(vu(n,e,t),Ua(n,e,t))}function lp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function up(e,t){lp(e,t),(e=e.alternate)&&lp(e,t)}function dp(e){if(e.tag===13||e.tag===31){var t=ei(e,67108864);t!==null&&vu(t,e,67108864),up(e,67108864)}}function fp(e){if(e.tag===13||e.tag===31){var t=gu();t=it(t);var n=ei(e,t);n!==null&&vu(n,e,t),up(e,t)}}var pp=!0;function mp(e,t,n,r){var i=O.T;O.T=null;var a=k.p;try{k.p=2,gp(e,t,n,r)}finally{k.p=a,O.T=i}}function hp(e,t,n,r){var i=O.T;O.T=null;var a=k.p;try{k.p=8,gp(e,t,n,r)}finally{k.p=a,O.T=i}}function gp(e,t,n,r){if(pp){var i=_p(r);if(i===null)kd(e,t,r,vp,n),kp(e,r);else if(jp(i,e,t,n,r))r.stopPropagation();else if(kp(e,r),t&4&&-1<Op.indexOf(e)){for(;i!==null;){var a=vt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=N(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-He(o);s.entanglements[1]|=c,o&=~c}sd(a),!(Ll&6)&&(iu=je()+500,cd(0,!1))}}break;case 31:case 13:s=ei(a,2),s!==null&&vu(s,a,2),Cu(),up(a,2)}if(a=_p(r),a===null&&kd(e,t,r,vp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else kd(e,t,r,null,n)}}function _p(e){return e=Qt(e),yp(e)}var vp=null;function yp(e){if(vp=null,e=P(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return vp=e,null}function bp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Me()){case Ne:return 2;case Pe:return 8;case Fe:case Ie:return 32;case Le:return 268435456;default:return 32}default:return 32}}var xp=!1,Sp=null,Cp=null,wp=null,Tp=new Map,Ep=new Map,Dp=[],Op=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function kp(e,t){switch(e){case`focusin`:case`focusout`:Sp=null;break;case`dragenter`:case`dragleave`:Cp=null;break;case`mouseover`:case`mouseout`:wp=null;break;case`pointerover`:case`pointerout`:Tp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ep.delete(t.pointerId)}}function Ap(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=vt(t),t!==null&&dp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function jp(e,t,n,r,i){switch(t){case`focusin`:return Sp=Ap(Sp,e,t,n,r,i),!0;case`dragenter`:return Cp=Ap(Cp,e,t,n,r,i),!0;case`mouseover`:return wp=Ap(wp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Tp.set(a,Ap(Tp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ep.set(a,Ap(Ep.get(a)||null,e,t,n,r,i)),!0}return!1}function Mp(e){var t=P(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,st(e.priority,function(){fp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,st(e.priority,function(){fp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Np(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_p(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Zt=r,n.target.dispatchEvent(r),Zt=null}else return t=vt(n),t!==null&&dp(t),e.blockedOn=n,!1;t.shift()}return!0}function Pp(e,t,n){Np(e)&&n.delete(t)}function Fp(){xp=!1,Sp!==null&&Np(Sp)&&(Sp=null),Cp!==null&&Np(Cp)&&(Cp=null),wp!==null&&Np(wp)&&(wp=null),Tp.forEach(Pp),Ep.forEach(Pp)}function Ip(e,n){e.blockedOn===n&&(e.blockedOn=null,xp||(xp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Fp)))}var Lp=null;function Rp(e){Lp!==e&&(Lp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Lp===e&&(Lp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(yp(r||n)===null)continue;break}var a=vt(n);a!==null&&(e.splice(t,3),t-=3,Cs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function zp(e){function t(t){return Ip(t,e)}Sp!==null&&Ip(Sp,e),Cp!==null&&Ip(Cp,e),wp!==null&&Ip(wp,e),Tp.forEach(t),Ep.forEach(t);for(var n=0;n<Dp.length;n++){var r=Dp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Dp.length&&(n=Dp[0],n.blockedOn===null);)Mp(n),n.blockedOn===null&&Dp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ut]||null;if(typeof a==`function`)o||Rp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ut]||null)s=o.formAction;else if(yp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Rp(n)}}}function Bp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Vp(e){this._internalRoot=e}Hp.prototype.render=Vp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;cp(n,gu(),e,t,null,null)},Hp.prototype.unmount=Vp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cp(e.current,2,null,e,null,null),Cu(),t[dt]=null}};function Hp(e){this._internalRoot=e}Hp.prototype.unstable_scheduleHydration=function(e){if(e){var t=ot();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dp.length&&t!==0&&t<Dp[n].priority;n++);Dp.splice(n,0,e),n===0&&Mp(e)}};var Up=n.version;if(Up!==`19.2.7`)throw Error(i(527,Up,`19.2.7`));k.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Wp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:O,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Gp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gp.isDisabled&&Gp.supportsFiber)try{ze=Gp.inject(Wp),Be=Gp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ks,s=qs,c=Js;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=op(e,1,!1,null,null,n,r,null,o,s,c,Bp),e[dt]=t.current,Dd(e),new Vp(t)}})),XN=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=YN()}))();function ZN(e,t,n){return v_(NM,()=>(r,i,a)=>{let o=document.createElement(`div`);o.className=`mdx-block-card-wrapper`,o.setAttribute(`data-cms-ui`,``),o.contentEditable=`false`;let s=(0,XN.createRoot)(o),c=null,l=e=>{let t=typeof a==`function`?a():null;if(t==null)return;let n=i.state.doc.nodeAt(t);if(!n)return;let r=i.state.tr.setNodeMarkup(t,void 0,{...n.attrs,...e});i.dispatch(r)},u=()=>{let e=typeof a==`function`?a():null;if(e==null)return;let t=i.state.doc.nodeAt(e);t&&i.dispatch(i.state.tr.delete(e,e+t.nodeSize))},d=r=>{let i=r.attrs.componentName,a=r.attrs.props,d=r.attrs.hasExpressions,f=r.attrs.children||``;o.setAttribute(`data-mdx-component`,i),o.setAttribute(`data-mdx-props`,a),o.setAttribute(`data-mdx-children`,f);let p=JSON.parse(a),m=e(i),h=(m?.slots?.includes(`default`)??!1)||f.trim()!==``;c={componentName:i,props:a,hasExpressions:d,children:f},s.render((0,j.createElement)(WN,{componentName:i,props:p,hasExpressions:d,slotContent:f,definition:m,media:t,mediaContext:n,onRemove:u,onSlotContentChange:h?e=>l({children:e}):void 0,onPropsChange:d?void 0:e=>l({props:JSON.stringify(e)})}))};return d(r),{dom:o,stopEvent:e=>{let t=e.target;return!!(t.tagName===`TEXTAREA`||t.tagName===`INPUT`||t.isContentEditable||t.closest(`[contenteditable]`)||t.closest(`[data-mdx-action]`)||(e.type===`mousedown`||e.type===`click`)&&(t.closest(`button`)||t.closest(`[data-mdx-action]`)))},ignoreMutation:()=>!0,update:e=>{if(e.type.name!==`mdx_component`)return!1;let t=e.attrs;return c&&t.componentName===c.componentName&&t.props===c.props&&t.hasExpressions===c.hasExpressions&&t.children===c.children||d(e),!0},destroy:()=>{queueMicrotask(()=>s.unmount())}}})}var QN={position:`relative`,width:`100%`,maxWidth:560,aspectRatio:`16 / 9`,margin:`0.5rem 0`,borderRadius:8,overflow:`hidden`,background:`#000`,border:`1px solid rgba(0,0,0,0.1)`},$N={position:`absolute`,inset:0,width:`100%`,height:`100%`,objectFit:`cover`,cursor:`pointer`},eP={position:`absolute`,inset:0,margin:`auto`,width:68,height:48,border:`none`,borderRadius:12,background:`rgba(0,0,0,0.7)`,color:`#fff`,fontSize:22,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`},tP={position:`absolute`,top:6,right:6,zIndex:2,width:24,height:24,border:`none`,borderRadius:6,background:`rgba(0,0,0,0.6)`,color:`#fff`,cursor:`pointer`,lineHeight:`24px`},nP={position:`absolute`,inset:0,width:`100%`,height:`100%`,border:`none`},rP={...QN,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#fff`,fontSize:13};function iP({videoId:e,onRemove:t}){let[n,r]=(0,j.useState)(!1);if(!e)return(0,j.createElement)(`div`,{style:rP,"data-cms-ui":``},`YouTube: missing video id`);let i=(0,j.createElement)(`button`,{type:`button`,style:tP,title:`Remove`,"data-mdx-action":`youtube-remove`,onClick:t},`✕`);return n?(0,j.createElement)(`div`,{style:QN,"data-cms-ui":``},i,(0,j.createElement)(`iframe`,{style:nP,src:`https://www.youtube-nocookie.com/embed/${e}?autoplay=1`,title:`YouTube video`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0})):(0,j.createElement)(`div`,{style:QN,"data-cms-ui":``},i,(0,j.createElement)(`img`,{style:$N,src:`https://i.ytimg.com/vi/${e}/hqdefault.jpg`,alt:`YouTube thumbnail`,loading:`lazy`,onClick:()=>r(!0)}),(0,j.createElement)(`button`,{type:`button`,style:eP,title:`Play`,"data-mdx-action":`youtube-play`,onClick:()=>r(!0)},`▶`))}function aP(){return v_(ND,()=>(e,t,n)=>{let r=document.createElement(`div`);r.setAttribute(`data-cms-ui`,``),r.contentEditable=`false`;let i=(0,XN.createRoot)(r),a=null,o=()=>{let e=typeof n==`function`?n():null;if(e==null)return;let r=t.state.doc.nodeAt(e);r&&t.dispatch(t.state.tr.delete(e,e+r.nodeSize))},s=e=>{let t=e.attrs.videoId;r.setAttribute(`data-youtube`,t),a=t,i.render((0,j.createElement)(iP,{videoId:t,onRemove:o}))};return s(e),{dom:r,stopEvent:e=>{let t=e.target;return t.closest(`[data-mdx-action]`)||t.tagName===`IFRAME`||t.tagName===`IMG`?!0:e.type===`mousedown`||e.type===`click`?!!t.closest(`button`):!1},ignoreMutation:()=>!0,update:e=>e.type.name===`youtube`&&(a===e.attrs.videoId||s(e),!0),destroy:()=>{queueMicrotask(()=>i.unmount())}}})}var oP={border:`1px solid #d4d4d8`,borderRadius:6,background:`#fff`,display:`flex`,flexDirection:`column`,minHeight:240,maxHeight:`max(70vh, 320px)`,overflow:`hidden`},sP={padding:`8px 12px`,flex:1,minHeight:0,overflowY:`auto`,outline:`none`},cP=`nua-mdx-editor-styles`,lP=`
92
+ .nua-mdx-editor .ProseMirror { line-height: 1.6; color: #18181b; }
93
+ .nua-mdx-editor .ProseMirror:focus { outline: none; }
94
+ .nua-mdx-editor .ProseMirror h1 { font-size: 1.6em; font-weight: 700; line-height: 1.25; margin: 0.7em 0 0.35em; }
95
+ .nua-mdx-editor .ProseMirror h2 { font-size: 1.35em; font-weight: 700; line-height: 1.3; margin: 0.7em 0 0.35em; }
96
+ .nua-mdx-editor .ProseMirror h3 { font-size: 1.15em; font-weight: 600; line-height: 1.35; margin: 0.6em 0 0.3em; }
97
+ .nua-mdx-editor .ProseMirror h4 { font-size: 1em; font-weight: 600; margin: 0.6em 0 0.3em; }
98
+ .nua-mdx-editor .ProseMirror p { margin: 0.5em 0; }
99
+ .nua-mdx-editor .ProseMirror ul { list-style: disc; padding-left: 1.5em; margin: 0.5em 0; }
100
+ .nua-mdx-editor .ProseMirror ol { list-style: decimal; padding-left: 1.5em; margin: 0.5em 0; }
101
+ .nua-mdx-editor .ProseMirror li { margin: 0.2em 0; }
102
+ .nua-mdx-editor .ProseMirror li > p { margin: 0.1em 0; }
103
+ .nua-mdx-editor .ProseMirror blockquote { border-left: 3px solid #d4d4d8; padding-left: 0.8em; margin: 0.6em 0; color: #52525b; }
104
+ .nua-mdx-editor .ProseMirror strong { font-weight: 700; }
105
+ .nua-mdx-editor .ProseMirror em { font-style: italic; }
106
+ .nua-mdx-editor .ProseMirror a { color: #2563eb; text-decoration: underline; }
107
+ .nua-mdx-editor .ProseMirror code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: #f4f4f5; padding: 0.1em 0.3em; border-radius: 3px; }
108
+ .nua-mdx-editor .ProseMirror pre { background: #f4f4f5; padding: 0.7em 0.9em; border-radius: 6px; overflow-x: auto; }
109
+ .nua-mdx-editor .ProseMirror pre code { background: none; padding: 0; }
110
+ .nua-mdx-editor .ProseMirror img { max-width: 100%; height: auto; border-radius: 4px; }
111
+ .nua-mdx-editor .ProseMirror hr { border: none; border-top: 1px solid #e4e4e7; margin: 1em 0; }
112
+ /* tables (GFM) — PM/prosemirror-tables ship no usable styles; without these the
113
+ cells collapse to 0 width and the table is invisible & uneditable */
114
+ .nua-mdx-editor .ProseMirror .tableWrapper { overflow-x: auto; margin: 0.8em 0; }
115
+ .nua-mdx-editor .ProseMirror table { border-collapse: collapse; table-layout: fixed; width: 100%; margin: 0.8em 0; overflow: hidden; }
116
+ .nua-mdx-editor .ProseMirror th, .nua-mdx-editor .ProseMirror td { border: 1px solid #d4d4d8; padding: 0.4em 0.6em; vertical-align: top; box-sizing: border-box; position: relative; min-width: 5em; }
117
+ .nua-mdx-editor .ProseMirror th { background: #f4f4f5; font-weight: 600; text-align: left; }
118
+ .nua-mdx-editor .ProseMirror th > p, .nua-mdx-editor .ProseMirror td > p { margin: 0; }
119
+ .nua-mdx-editor .ProseMirror .column-resize-handle { position: absolute; right: -2px; top: 0; bottom: 0; width: 4px; z-index: 20; background-color: #93c5fd; pointer-events: none; }
120
+ .nua-mdx-editor .ProseMirror .selectedCell:after { content: ''; position: absolute; inset: 0; z-index: 2; background: rgba(200,200,255,0.4); pointer-events: none; }
121
+ `;function uP(){(0,j.useEffect)(()=>{if(typeof document>`u`||document.getElementById(cP))return;let e=document.createElement(`style`);e.id=cP,e.textContent=lP,document.head.appendChild(e)},[])}function dP({value:e,onChange:t,components:n,listStyles:r,media:i,mediaContext:a,allowComponents:o=!0}){uP();let s=(0,j.useRef)(null),c=(0,j.useRef)(null),l=(0,j.useRef)(e),u=(0,j.useRef)(!1),d=(0,j.useRef)(!1),f=(0,j.useRef)(t);f.current=t;let p=(0,j.useRef)(new Map);(0,j.useEffect)(()=>{p.current=new Map((n??[]).map(e=>[e.name,e]))},[n]);let m=(0,j.useRef)(i);m.current=i;let h=(0,j.useRef)(a);h.current=a;let[g,_]=(0,j.useState)(!1),[v,y]=(0,j.useState)(null);return(0,j.useEffect)(()=>{let e=s.current;if(!e)return;let t=!1,n=e=>p.current.get(e);return(async()=>{let r=await l_.make().config(t=>{t.set(t_,e),t.set(Vg,l.current),t.get(_N).markdownUpdated((e,t)=>{l.current=t,u.current&&!d.current&&f.current(t)})}).use(Ny).use(pO).use(Gw).use(ON).use(yN).use(vT).use(yT).use(OM).use(FM).use(NM).use(ZN(n,m.current,h.current)).use(PM).use(ID).use(ND).use(aP()).use(LD).create();t?r.destroy():(c.current=r,y(r),queueMicrotask(()=>{u.current=!0}))})(),()=>{t=!0,u.current=!1,c.current?.destroy(),c.current=null,y(null)}},[]),(0,j.useEffect)(()=>{c.current&&u.current&&e!==l.current&&(d.current=!0,c.current.action(O_(e)),bT(c.current.ctx.get(Zh)),l.current=e,queueMicrotask(()=>{d.current=!1}))},[e]),(0,M.jsxs)(`div`,{className:`nua-mdx-editor`,style:oP,children:[(0,M.jsx)(IO,{editor:v,listStyles:r,media:i,mediaContext:a,field:`body`,onInsertComponent:o?()=>_(!0):void 0}),(0,M.jsx)(`div`,{ref:s,style:sP}),o?(0,M.jsx)(Qe,{open:g,components:n??[],onInsert:(e,t,n)=>{c.current?.action(E_(PM.key,{componentName:e,props:t,children:n}))},onClose:()=>_(!1)}):null]})}var fP={image:`Image URL or path`,file:`File URL or path`,video:`Video URL or path`};function pP({client:e,value:t,collection:n,entry:r,field:i,fieldType:a,accept:o,onChange:s}){let[c,l]=(0,j.useState)({kind:`probing`}),u=(0,j.useRef)(null);(0,j.useEffect)(()=>{let t=!0;return e.listMedia({limit:1}).then(()=>{t&&l({kind:`ready`})},e=>{t&&l(k(e)?{kind:`unavailable`}:{kind:`ready`})}),()=>{t=!1}},[e]);let d=async t=>{l({kind:`uploading`});try{let a=await e.uploadMedia(t,{collection:n,entry:r,field:i});a.success&&a.url?(s(a.url),l({kind:`ready`})):l({kind:`error`,message:a.error??`Upload failed`})}catch(e){if(k(e)){l({kind:`unavailable`});return}l({kind:`error`,message:e instanceof Error?e.message:`Upload failed`})}},f=c.kind===`ready`||c.kind===`error`,p=Ve(e,t,n,r);return(0,M.jsxs)(`div`,{className:`nua-cadmin-media`,children:[(0,M.jsx)(mP,{src:p,value:t,fieldType:a}),(0,M.jsxs)(`div`,{className:`nua-cadmin-media-row`,children:[(0,M.jsx)(`input`,{type:`text`,className:`nua-cadmin-input`,value:t,placeholder:fP[a],onChange:e=>s(e.target.value)}),t===``?null:(0,M.jsx)(`button`,{type:`button`,className:`nua-cadmin-icon-btn`,"aria-label":`Clear`,onClick:()=>s(``),children:`×`})]}),c.kind===`uploading`?(0,M.jsx)(`div`,{className:`nua-cadmin-field-loading`,children:`Uploading…`}):null,c.kind===`unavailable`?(0,M.jsx)(`div`,{className:`nua-cadmin-media-hint`,children:`Media uploads unavailable — paste a URL or path instead.`}):null,c.kind===`error`?(0,M.jsx)(`div`,{className:`nua-cadmin-media-error`,children:c.message}):null,f||c.kind===`probing`?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`input`,{ref:u,type:`file`,accept:o??(a===`video`?`video/mp4,video/webm`:void 0),className:`nua-cadmin-file-input`,disabled:!f,onChange:e=>{let t=e.target.files?.[0];t&&d(t),e.target.value=``}}),(0,M.jsx)(`button`,{type:`button`,className:`nua-cadmin-add-btn`,disabled:!f,onClick:()=>u.current?.click(),children:`Upload file`})]}):null]})}function mP({src:e,value:t,fieldType:n}){return e===``?null:n===`video`||Ue(t)?(0,M.jsx)(`video`,{className:`nua-cadmin-img`,src:e,muted:!0,playsInline:!0,controls:!0,preload:`metadata`}):He(t)?(0,M.jsx)(`img`,{className:`nua-cadmin-img`,src:e,alt:``}):null}var hP=[],gP={url:`url`,email:`email`,tel:`tel`},_P={date:`date`,datetime:`datetime-local`,time:`time`,month:`month`};function vP({field:e,value:t,onChange:n}){let r=e.hints;return(0,M.jsx)(`input`,{type:gP[e.type]??`text`,className:`nua-cadmin-input`,value:ge(t),placeholder:r?.placeholder,maxLength:r?.maxLength,minLength:r?.minLength,onChange:t=>n(he(e.type,t.target.value))})}function yP({value:e,rows:t,placeholder:n,maxLength:r,onChange:i}){let a=(0,j.useRef)(null);return(0,j.useEffect)(()=>{let e=a.current;e&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`)},[e]),(0,M.jsx)(`textarea`,{ref:a,className:`nua-cadmin-textarea nua-cadmin-textarea-autosize`,value:e,rows:t,placeholder:n,maxLength:r,onChange:e=>i(e.target.value)})}function bP({field:e,value:t,onChange:n}){return(0,M.jsx)(yP,{value:ge(t),rows:e.hints?.rows??4,placeholder:e.hints?.placeholder,maxLength:e.hints?.maxLength,onChange:n})}function xP({value:e,onChange:t,ctx:n}){let r=(0,j.useMemo)(()=>({collection:n.collection,entry:n.slug}),[n.collection,n.slug]),[i,a]=(0,j.useState)([]);return(0,j.useEffect)(()=>{let e=!0;return n.client.getConfig().then(t=>{e&&a(t.listStyles??[])},()=>{e&&a([])}),()=>{e=!1}},[n.client]),(0,M.jsx)(dP,{value:ge(e),onChange:t,components:hP,listStyles:i,media:n.client,mediaContext:r})}function SP({field:e,value:t,onChange:n}){return(0,M.jsx)(`input`,{type:`number`,className:`nua-cadmin-input`,value:ge(t),min:e.hints?.min,max:e.hints?.max,step:e.hints?.step,placeholder:e.hints?.placeholder,onChange:e=>n(he(`number`,e.target.value))})}function CP({value:e,onChange:t}){return(0,M.jsx)(`input`,{type:`number`,className:`nua-cadmin-input`,value:ge(e),min:1e3,max:9999,step:1,onChange:e=>t(he(`year`,e.target.value))})}function wP({field:e,value:t,onChange:n}){return(0,M.jsx)(`input`,{type:_P[e.type]??`date`,className:`nua-cadmin-input`,value:_e(t,e.type),onChange:t=>n(he(e.type,t.target.value))})}function TP({field:e,value:t,onChange:n}){let r=ve(t),i=e.role===`publish-toggle`;return(0,M.jsxs)(`button`,{type:`button`,className:`nua-cadmin-toggle${r?` nua-cadmin-toggle-on`:``}${i?` nua-cadmin-toggle-publish`:``}`,role:`switch`,"aria-checked":r,onClick:()=>n(!r),children:[(0,M.jsx)(`span`,{className:`nua-cadmin-toggle-knob`}),(0,M.jsx)(`span`,{className:`nua-cadmin-toggle-label`,children:r?`On`:`Off`})]})}function EP({field:e,value:t,onChange:n}){let r=e.options??[],i=ge(t);return(0,M.jsxs)(`select`,{className:`nua-cadmin-input`,value:i,onChange:e=>n(he(`select`,e.target.value)),children:[e.required?i===``?(0,M.jsx)(`option`,{value:``,disabled:!0,children:`— select —`}):null:(0,M.jsx)(`option`,{value:``,children:`— none —`}),r.map(e=>(0,M.jsx)(`option`,{value:e,children:e},e)),i!==``&&!r.includes(i)?(0,M.jsxs)(`option`,{value:i,children:[i,` (current)`]}):null]})}var DP=2e4,OP=100,kP={options:[],loading:!0,paging:!1,truncated:!1,failed:!1};function AP(e){let t={slug:e.slug,search:`${e.title??``} ${e.slug}`.toLowerCase()};return e.title!==void 0&&(t.title=e.title),t}function jP(e,t){let n=kP,r=!1,i=new Set,a=e=>{n={...n,...e};for(let e of i)e()},o=async()=>{if(r)return;r=!0;let i=n.options.length>0,o=[];try{let n=await se(e,t,`slug,title`,DP,(e,t)=>{for(let t of e)o.push(AP(t));i||a({options:[...o],loading:!1,paging:t,truncated:!1,failed:!1})});a({options:o,loading:!1,paging:!1,truncated:n.truncated,failed:!1})}catch{a({loading:!1,paging:!1,truncated:!i&&o.length>0,failed:n.options.length===0})}finally{r=!1}};return{getSnapshot:()=>n,subscribe(e){let t=i.size===0;return i.add(e),t&&!r&&o(),()=>{i.delete(e)}}}}var MP=new WeakMap;function NP(e,t){let n=MP.get(e);n||(n=new Map,MP.set(e,n));let r=n.get(t);if(r)return r;let i=jP(e,t);return n.set(t,i),i}function PP(e,t){let n=t===void 0||t===``?null:NP(e,t),r=(0,j.useCallback)(e=>n?.subscribe(e)??(()=>{}),[n]),i=(0,j.useCallback)(()=>n?.getSnapshot()??kP,[n]);return(0,j.useSyncExternalStore)(r,i,i)}function FP(e){let t=e.title?.trim();return t===void 0||t===``?e.slug:t}function IP(e,t){let n=0;for(let r of t){let t=e.search.indexOf(r);if(t<0)return null;n+=t}let r=t[0]??``;return e.slug.toLowerCase().startsWith(r)?n:n+1e3}function LP(e,t){let n=t.toLowerCase().split(/\s+/).filter(e=>e!==``);if(n.length===0)return e;let r=[];for(let t of e){let e=IP(t,n);e!==null&&r.push({option:t,score:e})}return r.sort((e,t)=>e.score-t.score),r.map(e=>e.option)}function RP({target:e,snapshot:t,value:n,onChange:r}){let{options:i,paging:a,truncated:o}=t,[s,c]=(0,j.useState)(!1),[l,u]=(0,j.useState)(``),[d,f]=(0,j.useState)(0),p=(0,j.useRef)(null),m=(0,j.useRef)(null),h=(0,j.useId)(),g=i.find(e=>e.slug===n),_=(0,j.useMemo)(()=>{let e=LP(i,l);return g===void 0||l.trim()!==``?e:[g,...e.filter(e=>e!==g)]},[i,l,g]),v=_.slice(0,OP),y=_.length-v.length;(0,j.useEffect)(()=>{if(!s)return;let e=e=>{p.current?.contains(e.target)||c(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[s]),(0,j.useEffect)(()=>{s&&m.current?.querySelector(`[data-active="true"]`)?.scrollIntoView({block:`nearest`})},[d,s]);let b=e=>{r(e),u(``),f(0),c(!1)},x=()=>{f(0),u(``),c(!0)},S=e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),!s){x();return}let t=v.length-1;f(n=>e.key===`ArrowDown`?Math.min(n+1,t):Math.max(n-1,0))}else if(e.key===`Enter`&&s){let t=v[d];t&&(e.preventDefault(),b(t.slug))}else e.key===`Escape`&&s&&(e.stopPropagation(),u(``),c(!1))},C=n!==``&&g===void 0&&!a;return(0,M.jsxs)(`div`,{className:`nua-cadmin-combobox`,ref:p,children:[(0,M.jsxs)(`div`,{className:`nua-cadmin-combobox-control`,children:[(0,M.jsx)(`input`,{type:`text`,className:`nua-cadmin-input nua-cadmin-combobox-input`,role:`combobox`,"aria-expanded":s,"aria-controls":h,"aria-autocomplete":`list`,"aria-activedescendant":s&&v[d]!==void 0?`${h}-${d}`:void 0,autoComplete:`off`,value:s?l:g?FP(g):n,placeholder:`Search ${e}…`,onFocus:x,onMouseDown:()=>{s||x()},onChange:e=>{u(e.target.value),f(0),c(!0)},onKeyDown:S}),n===``?null:(0,M.jsx)(`button`,{type:`button`,className:`nua-cadmin-combobox-clear`,title:`Clear reference`,"aria-label":`Clear reference`,onClick:()=>b(``),children:`×`})]}),s?(0,M.jsxs)(`ul`,{className:`nua-cadmin-combobox-list`,id:h,role:`listbox`,ref:m,children:[v.length===0&&!a?(0,M.jsxs)(`li`,{className:`nua-cadmin-combobox-empty`,children:[`No entry matches “`,l,`”`]}):null,v.map((e,t)=>{let r=FP(e);return(0,M.jsxs)(`li`,{id:`${h}-${t}`,role:`option`,"aria-selected":e.slug===n,"data-active":t===d,className:`nua-cadmin-combobox-option${t===d?` is-active`:``}`,onMouseDown:t=>{t.preventDefault(),b(e.slug)},onMouseEnter:()=>f(t),children:[(0,M.jsx)(`span`,{className:`nua-cadmin-combobox-option-label`,children:r}),r===e.slug?null:(0,M.jsx)(`span`,{className:`nua-cadmin-combobox-option-slug`,children:e.slug})]},e.slug)}),y>0?(0,M.jsxs)(`li`,{className:`nua-cadmin-combobox-more`,children:[`+`,y,` more — keep typing to narrow`]}):null,a?(0,M.jsx)(`li`,{className:`nua-cadmin-combobox-more`,children:`Loading more entries…`}):null]}):null,C?(0,M.jsxs)(`div`,{className:`nua-cadmin-combobox-hint`,children:[`“`,n,`” is not an entry of `,e]}):null,o?(0,M.jsxs)(`div`,{className:`nua-cadmin-combobox-hint`,children:[`Showing the first `,i.length,` `,i.length===1?`entry`:`entries`,` of `,e]}):null]})}function zP({field:e,value:t,onChange:n,ctx:r}){let i=e.collection,a=PP(r.client,i),o=ge(t);return i===void 0||i===``||a.failed?(0,M.jsx)(`input`,{type:`text`,className:`nua-cadmin-input`,value:o,placeholder:`entry slug`,onChange:e=>n(he(`reference`,e.target.value))}):a.loading?(0,M.jsxs)(`div`,{className:`nua-cadmin-field-loading`,children:[`Loading `,i,`…`]}):(0,M.jsx)(RP,{target:i,snapshot:a,value:o,onChange:e=>n(he(`reference`,e))})}function BP({field:e,value:t,onChange:n,ctx:r}){let i=ye(t),a=e.itemType??`text`,o={name:e.name,type:a,required:!1,fields:e.fields,options:e.options,collection:e.collection},s=(0,j.useCallback)((e,t)=>{let r=i.slice();r[e]=t,n(r)},[i,n]),c=(0,j.useCallback)(e=>{n(i.filter((t,n)=>n!==e))},[i,n]),l=(0,j.useCallback)(()=>{let t=a===`object`&&e.fields?p(e.fields):pe(a);n([...i,t])},[i,a,e.fields,n]);return(0,M.jsxs)(`div`,{className:`nua-cadmin-array`,children:[i.length===0?(0,M.jsx)(`div`,{className:`nua-cadmin-field-empty`,children:`No items.`}):null,i.map((e,t)=>(0,M.jsxs)(`div`,{className:`nua-cadmin-array-item`,children:[(0,M.jsx)(`div`,{className:`nua-cadmin-array-item-body`,children:(0,M.jsx)(HP,{field:o,value:e,onChange:e=>s(t,e),ctx:r})}),(0,M.jsx)(`button`,{type:`button`,className:`nua-cadmin-icon-btn`,"aria-label":`Remove item`,onClick:()=>c(t),children:`×`})]},t)),(0,M.jsx)(`button`,{type:`button`,className:`nua-cadmin-add-btn`,onClick:l,children:`+ Add item`})]})}function VP({field:e,value:t,onChange:n,ctx:r}){let i=be(t),a=e.fields??[],o=(0,j.useCallback)((e,t)=>{n({...i,[e]:t})},[i,n]);return a.length===0?(0,M.jsx)(`div`,{className:`nua-cadmin-field-empty`,children:`No nested fields.`}):(0,M.jsx)(`div`,{className:`nua-cadmin-object`,children:a.map(e=>(0,M.jsxs)(`div`,{className:`nua-cadmin-object-field`,children:[(0,M.jsxs)(`div`,{className:`nua-cadmin-field-label`,children:[(0,M.jsx)(`span`,{children:e.name}),(0,M.jsx)(`span`,{className:`nua-cadmin-field-type`,children:e.type})]}),(0,M.jsx)(HP,{field:e,value:i[e.name],onChange:t=>o(e.name,t),ctx:r})]},e.name))})}function HP({field:e,value:t,onChange:n,ctx:r}){switch(e.type){case`text`:case`url`:case`email`:case`tel`:case`color`:return(0,M.jsx)(vP,{field:e,value:t,onChange:n});case`textarea`:return(0,M.jsx)(bP,{field:e,value:t,onChange:n});case`markdown`:return(0,M.jsx)(xP,{value:t,onChange:n,ctx:r});case`number`:return(0,M.jsx)(SP,{field:e,value:t,onChange:n});case`year`:return(0,M.jsx)(CP,{value:t,onChange:n});case`date`:case`datetime`:case`time`:case`month`:return(0,M.jsx)(wP,{field:e,value:t,onChange:n});case`boolean`:return(0,M.jsx)(TP,{field:e,value:t,onChange:n});case`select`:return(0,M.jsx)(EP,{field:e,value:t,onChange:n});case`image`:case`file`:case`video`:return(0,M.jsx)(pP,{client:r.client,value:ge(t),collection:r.collection,entry:r.slug,field:e.name,fieldType:e.type,accept:e.hints?.accept,onChange:e=>n(e)});case`reference`:return(0,M.jsx)(zP,{field:e,value:t,onChange:n,ctx:r});case`array`:return(0,M.jsx)(BP,{field:e,value:t,onChange:n,ctx:r});case`object`:return(0,M.jsx)(VP,{field:e,value:t,onChange:n,ctx:r})}}function UP({client:e,definition:t,collection:n,onCreated:r,onCancel:i}){let a=(0,j.useMemo)(()=>t?.fields??[],[t]),[o,s]=(0,j.useState)(``),[c,l]=(0,j.useState)(()=>fe(a)),[u,d]=(0,j.useState)(!1),[f,p]=(0,j.useState)(null),{title:m,header:h,sidebar:g,sections:v}=(0,j.useMemo)(()=>Le(a,t?.layout),[a,t?.layout]),y=(0,j.useMemo)(()=>[...m?[{heading:void 0,fields:[m,...h]}]:h.length>0?[{heading:void 0,fields:h}]:[],...v.map(e=>({heading:e.title,fields:e.fields})),...g.length>0?[{heading:void 0,fields:g}]:[]],[m,h,v,g]),b=(0,j.useMemo)(()=>x(o),[o]),S=(0,j.useMemo)(()=>_(a,c.frontmatter,b),[a,c.frontmatter,b]),C=(0,j.useMemo)(()=>({client:e,collection:n}),[e,n]),w=(0,j.useCallback)((e,t)=>{l(n=>xe(n,e,t))},[]),T=(0,j.useCallback)(async()=>{if(b===``){p(`A slug is required.`);return}let i=Ce(a,S);if(i.length>0)p(we(i));else{d(!0),p(null);try{let i=await e.createEntry(n,{slug:b,frontmatter:S,body:c.body,fileExtension:t?.fileExtension});i.success?r(b):p(i.error??`Could not create the entry.`)}catch(e){p(e instanceof D?e.message:`Could not create the entry.`)}finally{d(!1)}}},[e,n,t,c.body,S,a,b,r]),E=t?.type===`data`;return(0,M.jsxs)(`div`,{className:`nua-cadmin-editor`,children:[(0,M.jsxs)(`div`,{className:`nua-cadmin-field`,children:[(0,M.jsxs)(`div`,{className:`nua-cadmin-field-label`,children:[(0,M.jsx)(`span`,{children:`slug`}),(0,M.jsx)(`span`,{className:`nua-cadmin-field-type`,children:`text · required`})]}),(0,M.jsx)(`input`,{type:`text`,className:`nua-cadmin-input`,value:o,placeholder:`my-new-entry`,onChange:e=>s(e.target.value)})]}),y.map((e,t)=>(0,M.jsxs)(j.Fragment,{children:[e.heading?(0,M.jsx)(`div`,{className:`nua-cadmin-form-heading`,children:e.heading}):null,e.fields.map(e=>(0,M.jsxs)(`div`,{className:`nua-cadmin-field${e.role?` nua-cadmin-field-${e.role}`:``}`,children:[(0,M.jsxs)(`div`,{className:`nua-cadmin-field-label`,children:[(0,M.jsx)(`span`,{children:Ae(e)}),(0,M.jsxs)(`span`,{className:`nua-cadmin-field-type`,children:[e.type,e.required?` · required`:``]})]}),(0,M.jsx)(HP,{field:e,value:c.frontmatter[e.name],onChange:t=>w(e.name,t),ctx:C})]},e.name))]},`block-${t}`)),E?null:(0,M.jsxs)(`div`,{className:`nua-cadmin-field`,children:[(0,M.jsxs)(`div`,{className:`nua-cadmin-field-label`,children:[(0,M.jsx)(`span`,{children:`Body`}),(0,M.jsx)(`span`,{className:`nua-cadmin-field-type`,children:`markdown`})]}),(0,M.jsx)(`textarea`,{className:`nua-cadmin-body-editor`,value:c.body,rows:10,onChange:e=>l(t=>({...t,body:e.target.value}))})]}),f?(0,M.jsx)(`div`,{className:`nua-cadmin-media-error`,children:f}):null,(0,M.jsxs)(`div`,{className:`nua-cadmin-editor-toolbar`,children:[(0,M.jsx)(`button`,{type:`button`,className:`nua-cadmin-btn nua-cadmin-btn-ghost`,disabled:u,onClick:i,children:`Cancel`}),(0,M.jsx)(`span`,{className:`nua-cadmin-spacer`}),(0,M.jsx)(`button`,{type:`button`,className:`nua-cadmin-btn nua-cadmin-btn-primary`,disabled:u,onClick:()=>void T(),children:u?`Creating…`:`Create entry`})]})]})}var WP=700;function GP({field:e,draft:t,onField:n,ctx:r}){return(0,M.jsxs)(`div`,{className:`nua-cadmin-field${e.width===`half`?` nua-cadmin-field-half`:``}${e.role?` nua-cadmin-field-${e.role}`:``}`,children:[(0,M.jsxs)(`div`,{className:`nua-cadmin-field-label`,children:[(0,M.jsx)(`span`,{children:Ae(e)}),(0,M.jsxs)(`span`,{className:`nua-cadmin-field-type`,children:[e.type,e.required?` · required`:``]})]}),e.help?(0,M.jsx)(`div`,{className:`nua-cadmin-field-help`,children:e.help}):null,(0,M.jsx)(HP,{field:e,value:t.frontmatter[e.name],onChange:t=>n(e.name,t),ctx:r})]})}function KP({fields:e,draft:t,onField:n,ctx:r}){return(0,M.jsx)(`div`,{className:`nua-cadmin-field-grid`,children:e.map(e=>(0,M.jsx)(GP,{field:e,draft:t,onField:n,ctx:r},e.name))})}function qP({sections:e,display:t,draft:n,onField:r,ctx:i}){let[a,o]=(0,j.useState)(0);if(t===`tabs`){let t=e[Math.min(a,e.length-1)];return(0,M.jsxs)(`div`,{className:`nua-cadmin-tabs`,children:[(0,M.jsx)(`div`,{className:`nua-cadmin-tabbar`,role:`tablist`,children:e.map((e,t)=>(0,M.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t===a,className:`nua-cadmin-tab${t===a?` is-active`:``}`,onClick:()=>o(t),children:e.title??`General`},`section-${t}`))}),t?(0,M.jsx)(KP,{fields:t.fields,draft:n,onField:r,ctx:i}):null]})}return(0,M.jsx)(M.Fragment,{children:e.map((e,t)=>e.title===void 0?(0,M.jsx)(KP,{fields:e.fields,draft:n,onField:r,ctx:i},`section-${t}`):(0,M.jsxs)(`details`,{className:`nua-cadmin-section`,open:!e.collapsed,children:[(0,M.jsx)(`summary`,{className:`nua-cadmin-section-summary`,children:e.title}),(0,M.jsx)(`div`,{className:`nua-cadmin-section-body`,children:(0,M.jsx)(KP,{fields:e.fields,draft:n,onField:r,ctx:i})})]},`section-${t}`))})}function JP({onUseServer:e,onUseOurs:t,onDismiss:n}){return(0,M.jsx)(`div`,{className:`nua-cadmin-dialog-backdrop`,role:`dialog`,"aria-modal":`true`,"aria-label":`Edit conflict`,children:(0,M.jsxs)(`div`,{className:`nua-cadmin-dialog`,children:[(0,M.jsx)(`div`,{className:`nua-cadmin-dialog-title`,children:`This entry changed elsewhere`}),(0,M.jsx)(`div`,{className:`nua-cadmin-dialog-body`,children:`Someone (or the agent) edited this entry after you opened it. Choose which version to keep.`}),(0,M.jsxs)(`div`,{className:`nua-cadmin-dialog-actions`,children:[(0,M.jsx)(`button`,{type:`button`,className:`nua-cadmin-btn`,onClick:e,children:`Use server version`}),(0,M.jsx)(`button`,{type:`button`,className:`nua-cadmin-btn nua-cadmin-btn-primary`,onClick:t,children:`Keep my changes`}),(0,M.jsx)(`button`,{type:`button`,className:`nua-cadmin-btn nua-cadmin-btn-ghost`,onClick:n,children:`Keep editing`})]})]})})}function YP({status:e}){switch(e.kind){case`saving`:return(0,M.jsx)(`span`,{className:`nua-cadmin-status nua-cadmin-status-saving`,children:`Saving…`});case`saved`:return(0,M.jsx)(`span`,{className:`nua-cadmin-status nua-cadmin-status-saved`,children:`Saved`});case`conflict`:return(0,M.jsx)(`span`,{className:`nua-cadmin-status nua-cadmin-status-conflict`,children:`Conflict`});case`error`:return(0,M.jsx)(`span`,{className:`nua-cadmin-status nua-cadmin-status-error`,children:e.message});default:return null}}function XP({client:e,definition:t,collection:n,slug:r,onDeleted:i,onRenamed:a}){let o=(0,j.useMemo)(()=>t?.fields??[],[t]),s=t?.fileExtension===`mdx`,[c,l]=(0,j.useState)(null),[u,d]=(0,j.useState)(null),[f,p]=(0,j.useState)({kind:`idle`}),[m,h]=(0,j.useState)([]),[g,_]=(0,j.useState)([]),v=(0,j.useMemo)(()=>Te(e,n,r),[e,n,r]),y=(0,j.useRef)(null);y.current=c;let b=(0,j.useRef)(null),x=(0,j.useMemo)(()=>({client:e,collection:n,slug:r}),[e,n,r]),S=(0,j.useMemo)(()=>({collection:n,entry:r}),[n,r]);(0,j.useEffect)(()=>{let t=!0;return v.reset(),l(null),d(null),p({kind:`idle`}),e.getEntry(n,r).then(e=>{t&&l(de(e,o))},e=>{t&&d(e instanceof Error?e:Error(String(e)))}),()=>{t=!1,b.current&&clearTimeout(b.current)}},[e,n,r,o,v]),(0,j.useEffect)(()=>{if(!s)return;let t=!0;return e.getComponents().then(e=>{t&&h(e)},()=>{t&&h([])}),()=>{t=!1}},[e,s]),(0,j.useEffect)(()=>{if(!s)return;let t=!0;return e.getConfig().then(e=>{t&&_(e.listStyles??[])},()=>{t&&_([])}),()=>{t=!1}},[e,s]);let C=(0,j.useCallback)(async(e,t)=>{let n=Ce(o,e.frontmatter);if(n.length>0){p({kind:`error`,message:`Not saved — ${we(n)}`});return}p({kind:`saving`});let r=await t(e);r.status===`conflict`?p({kind:`conflict`,conflict:r.conflict}):r.status===`error`?p({kind:`error`,message:r.message}):p({kind:`saved`})},[o]),w=(0,j.useCallback)(e=>{b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{C(e,v.save)},WP)},[C,v]),T=(0,j.useCallback)((e,t)=>{l(n=>{if(!n)return n;let r=xe(n,e,t);return w(r),r})},[w]),E=(0,j.useCallback)(e=>{l(t=>{if(!t)return t;let n={...t,body:e};return w(n),n})},[w]),ee=(0,j.useCallback)(()=>{f.kind===`conflict`&&(l(v.adoptServer(f.conflict,o)),p({kind:`saved`}))},[f,o,v]),te=(0,j.useCallback)(()=>{if(f.kind!==`conflict`)return;let e=y.current,{conflict:t}=f;e&&C(e,e=>v.overwrite(e,t))},[f,C,v]),ne=(0,j.useCallback)(()=>{f.kind===`conflict`&&p({kind:`idle`})},[f]),re=(0,j.useCallback)(async()=>{if(typeof window>`u`||window.confirm(`Delete entry "${r}"? This cannot be undone.`))try{await e.deleteEntry(n,r),i()}catch(e){p({kind:`error`,message:e instanceof D?e.message:`Delete failed`})}},[e,n,r,i]),ie=(0,j.useCallback)(async()=>{if(typeof window>`u`)return;let t=window.prompt(`Rename entry to (new slug):`,r);if(t!==null&&t.trim()!==``&&t!==r)try{await e.renameEntry(n,r,t.trim()),a(t.trim())}catch(e){p({kind:`error`,message:e instanceof D?e.message:`Rename failed`})}},[e,n,r,a]);if(u)return(0,M.jsxs)(`div`,{className:`nua-cadmin-error`,children:[(0,M.jsx)(`div`,{className:`nua-cadmin-error-title`,children:`Could not load entry`}),(0,M.jsx)(`div`,{children:u.message})]});if(!c)return(0,M.jsxs)(`div`,{className:`nua-cadmin-state`,children:[(0,M.jsx)(`div`,{className:`nua-cadmin-spinner`}),(0,M.jsx)(`div`,{children:`Loading entry…`})]});let{title:O,header:k,sidebar:ae,sections:oe,display:se}=Le(o,t?.layout);return(0,M.jsxs)(`div`,{className:`nua-cadmin-editor`,children:[(0,M.jsxs)(`div`,{className:`nua-cadmin-editor-toolbar`,children:[(0,M.jsx)(YP,{status:f}),(0,M.jsx)(`span`,{className:`nua-cadmin-spacer`}),(0,M.jsx)(`button`,{type:`button`,className:`nua-cadmin-btn nua-cadmin-btn-ghost`,onClick:()=>void ie(),children:`Rename`}),(0,M.jsx)(`button`,{type:`button`,className:`nua-cadmin-btn nua-cadmin-btn-danger`,onClick:()=>void re(),children:`Delete`})]}),O||k.length>0?(0,M.jsx)(`div`,{className:`nua-cadmin-editor-header-fields`,children:(0,M.jsx)(KP,{fields:O?[O,...k]:k,draft:c,onField:T,ctx:x})}):null,(0,M.jsxs)(`div`,{className:`nua-cadmin-editor-grid`,children:[(0,M.jsxs)(`div`,{className:`nua-cadmin-editor-main`,children:[(0,M.jsx)(qP,{sections:oe,display:se,draft:c,onField:T,ctx:x}),t?.type===`data`?null:(0,M.jsxs)(`div`,{className:`nua-cadmin-field`,children:[(0,M.jsxs)(`div`,{className:`nua-cadmin-field-label`,children:[(0,M.jsx)(`span`,{children:`Body`}),(0,M.jsx)(`span`,{className:`nua-cadmin-field-type`,children:s?`mdx`:`markdown`})]}),s?(0,M.jsx)(dP,{value:c.body,onChange:E,components:m,listStyles:g,media:e,mediaContext:S}):(0,M.jsx)(`textarea`,{className:`nua-cadmin-body-editor`,value:c.body,rows:16,onChange:e=>E(e.target.value)})]})]}),ae.length>0?(0,M.jsx)(`div`,{className:`nua-cadmin-editor-sidebar`,children:(0,M.jsx)(KP,{fields:ae,draft:c,onField:T,ctx:x})}):null]}),f.kind===`conflict`?(0,M.jsx)(JP,{onUseServer:ee,onUseOurs:te,onDismiss:ne}):null]})}function ZP(e){let t=e.replace(/^#\/?/,``).split(`/`).filter(Boolean);if(t[0]!==`c`||t[1]===void 0)return{view:`list`};let n=decodeURIComponent(t[1]);return t[2]===`new`?{view:`create`,collection:n}:t[2]===`e`&&t[3]!==void 0?{view:`detail`,collection:n,slug:decodeURIComponent(t[3])}:{view:`entries`,collection:n}}function QP(e){switch(e.view){case`list`:return`#/`;case`entries`:return`#/c/${encodeURIComponent(e.collection)}`;case`create`:return`#/c/${encodeURIComponent(e.collection)}/new`;case`detail`:return`#/c/${encodeURIComponent(e.collection)}/e/${encodeURIComponent(e.slug)}`}}function $P(e,t){let[n,r]=(0,j.useState)({data:null,error:null,loading:!0,settled:!1}),[i,a]=(0,j.useState)(0),o=(0,j.useRef)(e);o.current=e;let s=[...t,i],c=(0,j.useRef)(null);(0,j.useEffect)(()=>{let e=!0,n=c.current,i=n!==null&&n.length===t.length&&n.every((e,n)=>Object.is(e,t[n]));return c.current=t,r(e=>({data:null,error:null,loading:!0,settled:i&&e.settled})),o.current().then(t=>{e&&r({data:t,error:null,loading:!1,settled:!0})},t=>{e&&r({data:null,error:t instanceof Error?t:Error(String(t)),loading:!1,settled:!0})}),()=>{e=!1}},s);let l=(0,j.useCallback)(()=>a(e=>e+1),[]);return{...n,reload:l}}function eF({label:e}){return(0,M.jsxs)(`div`,{className:`nua-cadmin-state`,children:[(0,M.jsx)(`div`,{className:`nua-cadmin-spinner`}),(0,M.jsx)(`div`,{children:e})]})}function tF({error:e,onRetry:t}){let n=e instanceof D&&e.isUnauthorized?`Session expired`:e instanceof D&&e.isForbidden?`No access`:`Something went wrong`;return(0,M.jsxs)(`div`,{className:`nua-cadmin-error`,children:[(0,M.jsx)(`div`,{className:`nua-cadmin-error-title`,children:n}),(0,M.jsx)(`div`,{children:e.message}),t?(0,M.jsx)(`button`,{type:`button`,className:`nua-cadmin-retry`,onClick:t,children:`Try again`}):null]})}function nF({label:e}){return(0,M.jsx)(`div`,{className:`nua-cadmin-state`,children:e})}function rF({collections:e,locale:t,loading:n,error:r,activeCollection:i,onSelect:a,onReload:o,onClose:s}){let c=b(e,{locale:t}),l=(e,t)=>(0,M.jsxs)(`button`,{type:`button`,className:`nua-cadmin-nav-item${e.name===i?` is-active`:``}`,style:t>0?{paddingLeft:12+t*14}:void 0,onClick:()=>a(e.name),title:e.name,children:[(0,M.jsx)(`span`,{className:`nua-cadmin-nav-label`,children:e.label||e.name}),(0,M.jsx)(`span`,{className:`nua-cadmin-nav-count`,children:e.entryCount})]},e.name);return(0,M.jsxs)(`aside`,{className:`nua-cadmin-sidebar`,children:[(0,M.jsxs)(`div`,{className:`nua-cadmin-sidebar-head`,children:[(0,M.jsx)(`span`,{className:`nua-cadmin-brand`,children:`Collections`}),s?(0,M.jsx)(`button`,{type:`button`,className:`nua-cadmin-close`,"aria-label":`Close`,onClick:s,children:`×`}):null]}),(0,M.jsxs)(`nav`,{className:`nua-cadmin-nav`,children:[n?(0,M.jsx)(`div`,{className:`nua-cadmin-nav-state`,children:`Loading…`}):null,r?(0,M.jsx)(`button`,{type:`button`,className:`nua-cadmin-nav-state nua-cadmin-nav-error`,onClick:o,children:`Failed to load — retry`}):null,!n&&!r&&c.length===0?(0,M.jsx)(`div`,{className:`nua-cadmin-nav-state`,children:`No content types`}):null,!n&&!r?c.flatMap(e=>[e.group?(0,M.jsx)(`div`,{className:`nua-cadmin-nav-group`,children:e.group},`group:${e.group}`):null,...e.items.flatMap(({collection:e,children:t})=>[l(e,0),...t.map(e=>l(e,1))])]):null]})]})}var iF=50,aF=`slug,title,draft,pathname`;function oF({client:e,collection:t,onOpen:n,onCreate:r,onRetry:i}){let[a,o]=(0,j.useState)([]),[s,c]=(0,j.useState)(void 0),[l,u]=(0,j.useState)(!1),[d,f]=(0,j.useState)(null),[p,m]=(0,j.useState)(!0),[h,g]=(0,j.useState)(!1),_=(0,j.useCallback)(async(n,r)=>{r?g(!0):m(!0),f(null);try{let i=await e.getEntries(t,{fields:aF,draft:`all`,limit:iF,cursor:n});o(e=>r?[...e,...i.entries]:i.entries),c(i.cursor),u(i.hasMore)}catch(e){f(e instanceof Error?e:Error(String(e)))}finally{m(!1),g(!1)}},[e,t]);if((0,j.useEffect)(()=>{o([]),c(void 0),u(!1),_(void 0,!1)},[_]),p)return(0,M.jsx)(eF,{label:`Loading entries…`});if(d)return(0,M.jsx)(tF,{error:d,onRetry:()=>{i(),_(void 0,!1)}});let v=(0,M.jsx)(`div`,{className:`nua-cadmin-entries-toolbar`,children:(0,M.jsx)(`button`,{type:`button`,className:`nua-cadmin-btn nua-cadmin-btn-primary`,onClick:r,children:`+ New entry`})});return a.length===0?(0,M.jsxs)(`div`,{children:[v,(0,M.jsx)(nF,{label:`This collection has no entries.`})]}):(0,M.jsxs)(`div`,{children:[v,(0,M.jsxs)(`table`,{className:`nua-cadmin-table`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{children:`Slug`}),(0,M.jsx)(`th`,{children:`Title`}),(0,M.jsx)(`th`,{children:`Draft`}),(0,M.jsx)(`th`,{children:`Pathname`})]})}),(0,M.jsx)(`tbody`,{children:a.map(e=>(0,M.jsxs)(`tr`,{className:`nua-cadmin-row`,onClick:()=>n(e.slug),children:[(0,M.jsx)(`td`,{className:`nua-cadmin-cell-mono`,children:e.slug}),(0,M.jsx)(`td`,{children:e.title??(0,M.jsx)(`span`,{className:`nua-cadmin-field-empty`,children:`—`})}),(0,M.jsx)(`td`,{children:e.draft?(0,M.jsx)(`span`,{className:`nua-cadmin-badge nua-cadmin-badge-draft`,children:`draft`}):``}),(0,M.jsx)(`td`,{className:`nua-cadmin-cell-mono`,children:e.pathname??`—`})]},e.slug))})]}),l?(0,M.jsx)(`button`,{type:`button`,className:`nua-cadmin-load-more`,disabled:h,onClick:()=>void _(s,!0),children:h?`Loading…`:`Load more`}):null]})}function sF({apiBase:e,onClose:t}){let n=(0,j.useMemo)(()=>ae(e),[e]),[r,i]=(0,j.useState)(()=>typeof window<`u`?ZP(window.location.hash):{view:`list`});(0,j.useEffect)(()=>{let e=()=>i(ZP(window.location.hash));return window.addEventListener(`hashchange`,e),e(),()=>window.removeEventListener(`hashchange`,e)},[]);let a=(0,j.useCallback)(e=>{let t=QP(e);typeof window<`u`&&window.location.hash!==t?window.location.hash=t:i(e)},[]),o=$P(()=>n.getCollections(),[n]),s=o.data??[],c=$P(()=>n.getConfig(),[n]),l=(0,j.useCallback)(()=>{c.data||c.reload()},[c.data,c.reload]),u=(0,j.useCallback)(()=>{o.reload(),l()},[o.reload,l]),d=r.view===`list`?void 0:r.collection,f=d?s.find(e=>e.name===d):void 0,p=f?f.label||f.name:d??``,m=(0,j.useCallback)(e=>a({view:`entries`,collection:e}),[a]),h=(0,j.useCallback)((e,t)=>a({view:`detail`,collection:e,slug:t}),[a]),g=(0,j.useCallback)(e=>a({view:`create`,collection:e}),[a]);return(0,M.jsxs)(`div`,{className:`nua-cadmin`,children:[(0,M.jsx)(rF,{collections:s,locale:c.data?.locale,loading:o.loading||!c.settled,error:o.error,activeCollection:d,onSelect:m,onReload:u,onClose:t}),(0,M.jsxs)(`main`,{className:`nua-cadmin-main`,children:[(0,M.jsxs)(`div`,{className:`nua-cadmin-header`,children:[r.view===`detail`||r.view===`create`?(0,M.jsxs)(`button`,{type:`button`,className:`nua-cadmin-back`,onClick:()=>m(r.collection),children:[`← `,p]}):null,(0,M.jsxs)(`h2`,{className:`nua-cadmin-title`,children:[r.view===`list`?`Content`:p,r.view===`detail`?(0,M.jsxs)(`span`,{className:`nua-cadmin-crumb`,children:[`/ `,r.slug]}):null,r.view===`create`?(0,M.jsx)(`span`,{className:`nua-cadmin-crumb`,children:`/ new entry`}):null]}),(0,M.jsx)(`span`,{className:`nua-cadmin-spacer`})]}),(0,M.jsxs)(`div`,{className:`nua-cadmin-body`,children:[r.view===`list`?o.error?(0,M.jsx)(tF,{error:o.error,onRetry:u}):(0,M.jsx)(nF,{label:`Pick a content type from the left to browse its entries.`}):null,r.view===`entries`?(0,M.jsx)(oF,{client:n,collection:r.collection,onOpen:e=>h(r.collection,e),onCreate:()=>g(r.collection),onRetry:l}):null,r.view===`detail`?(0,M.jsx)(XP,{client:n,definition:f,collection:r.collection,slug:r.slug,onDeleted:()=>m(r.collection),onRenamed:e=>h(r.collection,e)},`${r.collection}/${r.slug}`):null,r.view===`create`?(0,M.jsx)(UP,{client:n,definition:f,collection:r.collection,onCreated:e=>h(r.collection,e),onCancel:()=>m(r.collection)}):null]})]})]})}var cF=document.getElementById(`nua-studio-root`);if(!cF)throw Error(`[cms-studio] #nua-studio-root container is missing`);(0,XN.createRoot)(cF).render((0,M.jsx)(j.StrictMode,{children:(0,M.jsx)(sF,{apiBase:`/cms/v1`})}));