@next-bricks/markdown 1.0.5 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +12 -3
- package/dist/chunks/295.35002895.js +2 -0
- package/dist/chunks/295.35002895.js.map +1 -0
- package/dist/chunks/369.304c9da8.js +3 -0
- package/dist/chunks/369.304c9da8.js.map +1 -0
- package/dist/chunks/446.e878ba24.js +2 -0
- package/dist/chunks/446.e878ba24.js.map +1 -0
- package/dist/chunks/549.93bc55f1.js +2 -0
- package/dist/chunks/549.93bc55f1.js.map +1 -0
- package/dist/chunks/646.4fbbffd5.js +2 -0
- package/dist/chunks/646.4fbbffd5.js.map +1 -0
- package/dist/chunks/{709.b2520f74.js → 709.d18a1e8d.js} +2 -2
- package/dist/chunks/{709.b2520f74.js.map → 709.d18a1e8d.js.map} +1 -1
- package/dist/chunks/717.bde18f5d.js +2 -0
- package/dist/chunks/717.bde18f5d.js.map +1 -0
- package/dist/chunks/746.72c7f05c.js +2 -0
- package/dist/chunks/746.72c7f05c.js.map +1 -0
- package/dist/chunks/eo-markdown-editor.556a4964.js +2 -0
- package/dist/chunks/eo-markdown-editor.556a4964.js.map +1 -0
- package/dist/chunks/{main.e91ee121.js → main.344fb737.js} +2 -2
- package/dist/chunks/{main.e91ee121.js.map → main.344fb737.js.map} +1 -1
- package/dist/index.0758ecd9.js +2 -0
- package/dist/index.0758ecd9.js.map +1 -0
- package/dist/manifest.json +8 -5
- package/dist/types.json +1 -1
- package/docs/markdown-editor.md +27 -0
- package/package.json +3 -3
- package/dist/chunks/247.ee2cea25.js +0 -2
- package/dist/chunks/247.ee2cea25.js.map +0 -1
- package/dist/chunks/287.13f9cb86.js +0 -3
- package/dist/chunks/287.13f9cb86.js.map +0 -1
- package/dist/chunks/295.c37c3bc7.js +0 -2
- package/dist/chunks/295.c37c3bc7.js.map +0 -1
- package/dist/chunks/446.b55c0036.js +0 -2
- package/dist/chunks/446.b55c0036.js.map +0 -1
- package/dist/chunks/543.75c481fc.js +0 -2
- package/dist/chunks/543.75c481fc.js.map +0 -1
- package/dist/chunks/549.fddc1055.js +0 -2
- package/dist/chunks/549.fddc1055.js.map +0 -1
- package/dist/chunks/717.2c03baee.js +0 -2
- package/dist/chunks/717.2c03baee.js.map +0 -1
- package/dist/chunks/markdown-editor.ba0a495e.js +0 -2
- package/dist/chunks/markdown-editor.ba0a495e.js.map +0 -1
- package/dist/index.f166f9a6.js +0 -2
- package/dist/index.f166f9a6.js.map +0 -1
- /package/dist/chunks/{287.13f9cb86.js.LICENSE.txt → 369.304c9da8.js.LICENSE.txt} +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 287.13f9cb86.js.LICENSE.txt */
|
|
2
|
-
(self.webpackChunk_next_bricks_markdown=self.webpackChunk_next_bricks_markdown||[]).push([[287,628],{2609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&s[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),t.push(u))}},t}},9601:e=>{"use strict";e.exports=function(e){return e[1]}},9385:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},s=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,h=arguments[0],d=1,p=arguments.length,f=!1;for("boolean"==typeof h&&(f=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<p;++d)if(null!=(t=arguments[d]))for(n in t)r=l(h,n),h!==(i=l(t,n))&&(f&&i&&(s(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},a(h,{name:n,newValue:e(f,u,i)})):void 0!==i&&a(h,{name:n,newValue:i}));return h}},3335:e=>{e.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},594:(e,t,n)=>{var r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,c="object"==typeof self&&self&&self.Object===Object&&self,u=l||c||Function("return this")(),h=Object.prototype.toString,d=Math.max,p=Math.min,f=function(){return u.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==h.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=o.test(e);return n||s.test(e)?a(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,o,s,a,l,c=0,u=!1,h=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function k(t){var n=r,o=i;return r=i=void 0,c=t,s=e.apply(o,n)}function v(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=o}function w(){var e=f();if(v(e))return x(e);a=setTimeout(w,function(e){var n=t-(e-l);return h?p(n,o-(e-c)):n}(e))}function x(e){return a=void 0,y&&r?k(e):(r=i=void 0,s)}function b(){var e=f(),n=v(e);if(r=arguments,i=this,l=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(w,t),u?k(e):s}(l);if(h)return a=setTimeout(w,t),k(l)}return void 0===a&&(a=setTimeout(w,t)),s}return t=g(t)||0,m(n)&&(u=!!n.leading,o=(h="maxWait"in n)?d(g(n.maxWait)||0,t):o,y="trailing"in n?!!n.trailing:y),b.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=l=i=a=void 0},b.flush=function(){return void 0===a?s:x(f())},b}},5303:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(6522);function i(e,t,n){return(i=function(){function e(e,t){return function(r){!function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished")}(t),n(r,"An initializer"),e.push(r)}}function t(t,n,r,i,o,s,a,l){var c;switch(o){case 1:c="accessor";break;case 2:c="method";break;case 3:c="getter";break;case 4:c="setter";break;default:c="field"}var u,h,d={kind:c,name:a?"#"+n:n,static:s,private:a},p={v:!1};0!==o&&(d.addInitializer=e(i,p)),0===o?a?(u=r.get,h=r.set):(u=function(){return this[n]},h=function(e){this[n]=e}):2===o?u=function(){return r.value}:(1!==o&&3!==o||(u=function(){return r.get.call(this)}),1!==o&&4!==o||(h=function(e){r.set.call(this,e)})),d.access=u&&h?{get:u,set:h}:u?{get:u}:{set:h};try{return t(l,d)}finally{p.v=!0}}function n(e,t){if("function"!=typeof e)throw new TypeError(t+" must be a function")}function i(e,t){var i=(0,r.Z)(t);if(1===e){if("object"!==i||null===t)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");void 0!==t.get&&n(t.get,"accessor.get"),void 0!==t.set&&n(t.set,"accessor.set"),void 0!==t.init&&n(t.init,"accessor.init")}else if("function"!==i)throw new TypeError((0===e?"field":10===e?"class":"method")+" decorators must return a function or void 0")}function o(e,n,r,o,s,a,l,c){var u,h,d,p,f,m,g=r[0];if(l?u=0===s||1===s?{get:r[3],set:r[4]}:3===s?{get:r[3]}:4===s?{set:r[3]}:{value:r[3]}:0!==s&&(u=Object.getOwnPropertyDescriptor(n,o)),1===s?d={get:u.get,set:u.set}:2===s?d=u.value:3===s?d=u.get:4===s&&(d=u.set),"function"==typeof g)void 0!==(p=t(g,o,u,c,s,a,l,d))&&(i(s,p),0===s?h=p:1===s?(h=p.init,f=p.get||d.get,m=p.set||d.set,d={get:f,set:m}):d=p);else for(var y=g.length-1;y>=0;y--){var k;void 0!==(p=t(g[y],o,u,c,s,a,l,d))&&(i(s,p),0===s?k=p:1===s?(k=p.init,f=p.get||d.get,m=p.set||d.set,d={get:f,set:m}):d=p,void 0!==k&&(void 0===h?h=k:"function"==typeof h?h=[h,k]:h.push(k)))}if(0===s||1===s){if(void 0===h)h=function(e,t){return t};else if("function"!=typeof h){var v=h;h=function(e,t){for(var n=t,r=0;r<v.length;r++)n=v[r].call(e,n);return n}}else{var w=h;h=function(e,t){return w.call(e,t)}}e.push(h)}0!==s&&(1===s?(u.get=d.get,u.set=d.set):2===s?u.value=d:3===s?u.get=d:4===s&&(u.set=d),l?1===s?(e.push((function(e,t){return d.get.call(e,t)})),e.push((function(e,t){return d.set.call(e,t)}))):2===s?e.push(d):e.push((function(e,t){return d.call(e,t)})):Object.defineProperty(n,o,u))}function s(e,t){for(var n,r,i=[],s=new Map,l=new Map,c=0;c<t.length;c++){var u=t[c];if(Array.isArray(u)){var h,d,p=u[1],f=u[2],m=u.length>3,g=p>=5;if(g?(h=e,0!=(p-=5)&&(d=r=r||[])):(h=e.prototype,0!==p&&(d=n=n||[])),0!==p&&!m){var y=g?l:s,k=y.get(f)||0;if(!0===k||3===k&&4!==p||4===k&&3!==p)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+f);!k&&p>2?y.set(f,p):y.set(f,!0)}o(i,h,u,f,p,g,m,d)}}return a(i,n),a(i,r),i}function a(e,t){t&&e.push((function(e){for(var n=0;n<t.length;n++)t[n].call(e);return e}))}return function(t,n,r){return{e:s(t,n),get c(){return function(t,n){if(n.length>0){for(var r=[],o=t,s=t.name,a=n.length-1;a>=0;a--){var l={v:!1};try{var c=n[a](o,{kind:"class",name:s,addInitializer:e(r,l)})}finally{l.v=!0}void 0!==c&&(i(10,c),o=c)}return[o,function(){for(var e=0;e<r.length;e++)r[e].call(o)}]}}(t,r)}}}}())(e,t,n)}},4795:(e,t,n)=>{"use strict";function r(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var s=e.apply(t,n);function a(e){r(s,i,o,a,l,"next",e)}function l(e){r(s,i,o,a,l,"throw",e)}a(void 0)}))}}n.d(t,{Z:()=>i})},5863:(e,t,n)=>{"use strict";function r(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}n.d(t,{Z:()=>r})},175:(e,t,n)=>{"use strict";function r(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}n.d(t,{Z:()=>r})},687:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(175);function i(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,(0,r.Z)(e,t,"get"))}},3395:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(5863);function i(e,t,n){(0,r.Z)(e,t),t.set(e,n)}},381:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(175);function i(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,(0,r.Z)(e,t,"set"),n),n}},6234:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(6522);function i(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==(0,r.Z)(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==(0,r.Z)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===(0,r.Z)(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},3028:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(6234);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},6522:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{Z:()=>r})},3848:(e,t,n)=>{"use strict";n.d(t,{ML:()=>xi,$B:()=>qr,Iq:()=>ur,R3:()=>xr,vc:()=>Dr,Xo:()=>ti,uW:()=>ei,Dn:()=>zr,U7:()=>Wr,i8:()=>Kr,tQ:()=>pr,ZP:()=>Mr,pB:()=>Cr,_z:()=>Tr,ZV:()=>fr,CG:()=>mr,KP:()=>Ur,le:()=>Sr,Ck:()=>Rr});var r={};n.r(r),n.d(r,{attentionMarkers:()=>Re,contentInitial:()=>Ee,disable:()=>Pe,document:()=>Ne,flow:()=>Ae,flowInitial:()=>Te,insideSpan:()=>Fe,string:()=>Ie,text:()=>De});var i=n(11),o=n(2665);const s={};function a(e,t){const n=t||s;return l(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function l(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return c(e.children,t,n)}return Array.isArray(e)?c(e,t,n):""}function c(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=l(e[i],t,n);return r.join("")}function u(e,t,n,r){const i=e.length;let o,s=0;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),[].splice.apply(e,o);else for(n&&[].splice.apply(e,[t,n]);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),[].splice.apply(e,o),s+=1e4,t+=1e4}function h(e,t){return e.length>0?(u(e,e.length,0,t),e):t}const d={}.hasOwnProperty;function p(e,t){let n;for(n in t){const r=(d.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;for(o in i){d.call(r,o)||(r[o]=[]);const e=i[o];f(r[o],Array.isArray(e)?e:e?[e]:[])}}}function f(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);u(e,0,0,r)}const m=N(/[A-Za-z]/),g=N(/\d/),y=N(/[\dA-Fa-f]/),k=N(/[\dA-Za-z]/),v=N(/[!-/:-@[-`{-~]/),w=N(/[#-'*+\--9=?A-Z^-~]/);function x(e){return null!==e&&(e<32||127===e)}function b(e){return null!==e&&(e<0||32===e)}function S(e){return null!==e&&e<-2}function C(e){return-2===e||-1===e||32===e}const M=N(/\s/),O=N(/[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/);function N(e){return function(t){return null!==t&&e.test(String.fromCharCode(t))}}function E(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return function(r){return C(r)?(e.enter(n),s(r)):t(r)};function s(r){return C(r)&&o++<i?(e.consume(r),s):(e.exit(n),t(r))}}const T={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,(function(n){if(null!==n)return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),E(e,t,"linePrefix");e.consume(n)}),(function(t){return e.enter("paragraph"),r(t)}));let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,i(t)}function i(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):S(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),i)}}},A={tokenize:function(e){const t=this,n=[];let r,i,o,s=0;return a;function a(r){if(s<n.length){const i=n[s];return t.containerState=i[1],e.attempt(i[0].continuation,l,c)(r)}return c(r)}function l(e){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&v();const n=t.events.length;let i,o=n;for(;o--;)if("exit"===t.events[o][0]&&"chunkFlow"===t.events[o][1].type){i=t.events[o][1].end;break}k(s);let a=n;for(;a<t.events.length;)t.events[a][1].end=Object.assign({},i),a++;return u(t.events,o+1,0,t.events.slice(n)),t.events.length=a,c(e)}return a(e)}function c(i){if(s===n.length){if(!r)return p(i);if(r.currentConstruct&&r.currentConstruct.concrete)return m(i);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(I,h,d)(i)}function h(e){return r&&v(),k(s),p(e)}function d(e){return t.parser.lazy[t.now().line]=s!==n.length,o=t.now().offset,m(e)}function p(n){return t.containerState={},e.attempt(I,f,m)(n)}function f(e){return s++,n.push([t.currentConstruct,t.containerState]),p(e)}function m(n){return null===n?(r&&v(),k(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:r}),g(n))}function g(n){return null===n?(y(e.exit("chunkFlow"),!0),k(0),void e.consume(n)):S(n)?(e.consume(n),y(e.exit("chunkFlow")),s=0,t.interrupt=void 0,a):(e.consume(n),g)}function y(e,n){const a=t.sliceStream(e);if(n&&a.push(null),e.previous=i,i&&(i.next=e),i=e,r.defineSkip(e.start),r.write(a),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<o&&(!r.events[e][1].end||r.events[e][1].end.offset>o))return;const n=t.events.length;let i,a,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(i){a=t.events[l][1].end;break}i=!0}for(k(s),e=n;e<t.events.length;)t.events[e][1].end=Object.assign({},a),e++;u(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function k(r){let i=n.length;for(;i-- >r;){const r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),i=void 0,r=void 0,t.containerState._closeFlow=void 0}}},I={tokenize:function(e,t,n){return E(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},D={tokenize:function(e,t,n){return E(e,(function(e){return null===e||S(e)?t(e):n(e)}),"linePrefix")},partial:!0};function F(e){const t={};let n,r,i,o,s,a,l,c=-1;for(;++c<e.length;){for(;c in t;)c=t[c];if(n=e[c],c&&"chunkFlow"===n[1].type&&"listItemPrefix"===e[c-1][1].type&&(a=n[1]._tokenizer.events,i=0,i<a.length&&"lineEndingBlank"===a[i][1].type&&(i+=2),i<a.length&&"content"===a[i][1].type))for(;++i<a.length&&"content"!==a[i][1].type;)"chunkText"===a[i][1].type&&(a[i][1]._isInFirstContentOfListItem=!0,i++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,R(e,c)),c=t[c],l=!0);else if(n[1]._container){for(i=c,r=void 0;i--&&(o=e[i],"lineEnding"===o[1].type||"lineEndingBlank"===o[1].type);)"enter"===o[0]&&(r&&(e[r][1].type="lineEndingBlank"),o[1].type="lineEnding",r=i);r&&(n[1].end=Object.assign({},e[r][1].start),s=e.slice(r,c),s.unshift(n),u(e,r,c-r+1,s))}}return!l}function R(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const o=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,l=[],c={};let h,d,p=-1,f=n,m=0,g=0;const y=[g];for(;f;){for(;e[++i][1]!==f;);o.push(i),f._tokenizer||(h=r.sliceStream(f),f.next||h.push(null),d&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(h),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++p<a.length;)"exit"===a[p][0]&&"enter"===a[p-1][0]&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(g=p+1,y.push(g),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):y.pop(),p=y.length;p--;){const t=a.slice(y[p],y[p+1]),n=o.pop();l.unshift([n,n+t.length-1]),u(e,n,2,t)}for(p=-1;++p<l.length;)c[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return c}const P={tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):S(t)?e.check(z,o,i)(t):(e.consume(t),r)}function i(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,r}},resolve:function(e){return F(e),e}},z={tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),E(e,i,"linePrefix")};function i(i){if(null===i||S(i))return n(i);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}},partial:!0},B={tokenize:function(e){const t=this,n=e.attempt(D,(function(r){if(null!==r)return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n;e.consume(r)}),e.attempt(this.parser.constructs.flowInitial,r,E(e,e.attempt(this.parser.constructs.flow,r,e.attempt(P,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}},L={resolveAll:H()},j=V("string"),$=V("text");function V(e){return{tokenize:function(t){const n=this,r=this.parser.constructs[e],i=t.attempt(r,o,s);return o;function o(e){return l(e)?i(e):s(e)}function s(e){if(null!==e)return t.enter("data"),t.consume(e),a;t.consume(e)}function a(e){return l(e)?(t.exit("data"),i(e)):(t.consume(e),a)}function l(e){if(null===e)return!0;const t=r[e];let i=-1;if(t)for(;++i<t.length;){const e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}},resolveAll:H("text"===e?q:void 0)}}function H(e){return function(t,n){let r,i=-1;for(;++i<=t.length;)void 0===r?t[i]&&"data"===t[i][1].type&&(r=i,i++):t[i]&&"data"===t[i][1].type||(i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),i=r+2),r=void 0);return e?e(t,n):t}}function q(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],i=t.sliceStream(r);let o,s=i.length,a=-1,l=0;for(;s--;){const e=i[s];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)l++,a--;if(a)break;a=-1}else if(-2===e)o=!0,l++;else if(-1!==e){s++;break}}if(l){const i={type:n===e.length||o||l<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-l,offset:r.end.offset-l,_index:r.start._index+s,_bufferIndex:s?a:r.start._bufferIndex+a},end:Object.assign({},r.end)};r.end=Object.assign({},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}function W(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}function _(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},o=[];let s=[],a=[],l=!0;const c={consume:function(e){S(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,x()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=e,l=!0},enter:function(e,t){const n=t||{};return n.type=e,n.start=g(),d.events.push(["enter",n,d]),a.push(n),n},exit:function(e){const t=a.pop();return t.end=g(),d.events.push(["exit",t,d]),t},attempt:v((function(e,t){w(e,t.from)})),check:v(k),interrupt:v(k,{interrupt:!0})},d={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:m,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if("string"==typeof o)s=o;else switch(o){case-5:s="\r";break;case-4:s="\n";break;case-3:s="\r\n";break;case-2:s=t?" ":"\t";break;case-1:if(!t&&i)continue;s=" ";break;default:s=String.fromCharCode(o)}i=-2===o,r.push(s)}return r.join("")}(m(e),t)},now:g,defineSkip:function(e){i[e.line]=e.column,x()},write:function(e){return s=h(s,e),function(){let e;for(;r._index<s.length;){const t=s[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)y(t.charCodeAt(r._bufferIndex));else y(t)}}(),null!==s[s.length-1]?[]:(w(t,0),d.events=W(o,d.events,d),d.events)}};let p,f=t.tokenize.call(d,c);return t.resolveAll&&o.push(t),d;function m(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;return n===i?s=[e[n].slice(r,o)]:(s=e.slice(n,i),r>-1&&(s[0]=s[0].slice(r)),o>0&&s.push(e[i].slice(0,o))),s}(s,e)}function g(){return Object.assign({},r)}function y(e){l=void 0,p=e,f=f(e)}function k(e,t){t.restore()}function v(e,t){return function(n,i,o){let s,u,h,p;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):function(e){return function(t){const n=null!==t&&e[t],r=null!==t&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function f(e){return s=e,u=0,0===e.length?o:m(e[u])}function m(e){return function(n){return p=function(){const e=g(),t=d.previous,n=d.currentConstruct,i=d.events.length,o=Array.from(a);return{restore:function(){r=e,d.previous=t,d.currentConstruct=n,d.events.length=i,a=o,x()},from:i}}(),h=e,e.partial||(d.currentConstruct=e),e.name&&d.parser.constructs.disable.null.includes(e.name)?k():e.tokenize.call(t?Object.assign(Object.create(d),t):d,c,y,k)(n)}}function y(t){return l=!0,e(h,p),i}function k(e){return l=!0,p.restore(),++u<s.length?m(s[u]):o}}}function w(e,t){e.resolveAll&&!o.includes(e)&&o.push(e),e.resolve&&u(d.events,t,d.events.length-t,e.resolve(d.events.slice(t),d)),e.resolveTo&&(d.events=e.resolveTo(d.events,d))}function x(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}const K={name:"thematicBreak",tokenize:function(e,t,n){let r,i=0;return function(t){return e.enter("thematicBreak"),r=t,o(t)};function o(a){return a===r?(e.enter("thematicBreakSequence"),s(a)):C(a)?E(e,o,"whitespace")(a):i<3||null!==a&&!S(a)?n(a):(e.exit("thematicBreak"),t(a))}function s(t){return t===r?(e.consume(t),i++,s):(e.exit("thematicBreakSequence"),o(t))}}},U={name:"list",tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,s=0;return function(t){const i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:g(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(K,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(t)}return n(t)};function a(t){return g(t)&&++s<10?(e.consume(t),a):(!r.interrupt||s<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(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(D,r.interrupt?n:c,e.attempt(Y,h,u))}function c(e){return r.containerState.initialBlankLine=!0,o++,h(e)}function u(t){return C(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),h):n(t)}function h(n){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}},continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(D,(function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,E(e,t,"listItemIndent",r.containerState.size+1)(n)}),(function(n){return r.containerState.furtherBlankLines||!C(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(J,t,i)(n))}));function i(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,E(e,e.attempt(U,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)}},Y={tokenize:function(e,t,n){const r=this;return E(e,(function(e){const i=r.events[r.events.length-1];return!C(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)}),"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)},partial:!0},J={tokenize:function(e,t,n){const r=this;return E(e,(function(e){const i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}),"listItemIndent",r.containerState.size+1)},partial:!0},G={name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return C(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}},continuation:{tokenize:function(e,t,n){return E(e,e.attempt(G,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},exit:function(e){e.exit("blockQuote")}};function Z(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){return 60===t?(e.enter(r),e.enter(i),e.enter(o),e.consume(t),e.exit(o),h):null===t||41===t||x(t)?n(t):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),f(t))};function h(n){return 62===n?(e.enter(o),e.consume(n),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(a),h(t)):null===t||60===t||S(t)?n(t):(e.consume(t),92===t?p:d)}function p(t){return 60===t||62===t||92===t?(e.consume(t),d):d(t)}function f(i){return 40===i?++u>c?n(i):(e.consume(i),f):41===i?u--?(e.consume(i),f):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(i)):null===i||b(i)?u?n(i):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(i)):x(i)?n(i):(e.consume(i),92===i?m:f)}function m(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function X(e,t,n,r,i,o){const s=this;let a,l=0;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(o),c};function c(h){return null===h||91===h||93===h&&!a||94===h&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs||l>999?n(h):93===h?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):S(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(t){return null===t||91===t||93===t||S(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),a=a||!C(t),92===t?h:u)}function h(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function Q(e,t,n,r,i,o){let s;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),s=40===t?41:t,a};function a(n){return n===s?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(o),l(n))}function l(t){return t===s?(e.exit(o),a(s)):null===t?n(t):S(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),E(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===s||null===t||S(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===s||92===t?(e.consume(t),c):c(t)}}function ee(e,t){let n;return function r(i){return S(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):C(i)?E(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function te(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ne={name:"definition",tokenize:function(e,t,n){const r=this;let i;return function(t){return e.enter("definition"),X.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)};function o(t){return i=te(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),ee(e,Z(e,e.attempt(re,E(e,s,"whitespace"),E(e,s,"whitespace")),n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):n(t)}function s(o){return null===o||S(o)?(e.exit("definition"),r.parser.defined.includes(i)||r.parser.defined.push(i),t(o)):n(o)}}},re={tokenize:function(e,t,n){return function(t){return b(t)?ee(e,r)(t):n(t)};function r(t){return 34===t||39===t||40===t?Q(e,E(e,i,"whitespace"),n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t):n(t)}function i(e){return null===e||S(e)?t(e):n(e)}},partial:!0},ie={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),E(e,i,"linePrefix",5)(t)};function i(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return null===t?a(t):S(t)?e.attempt(oe,o,a)(t):(e.enter("codeFlowValue"),s(t))}function s(t){return null===t||S(t)?(e.exit("codeFlowValue"),o(t)):(e.consume(t),s)}function a(n){return e.exit("codeIndented"),t(n)}}},oe={tokenize:function(e,t,n){const r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):S(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):E(e,o,"linePrefix",5)(t)}function o(e){const o=r.events[r.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(e):S(e)?i(e):n(e)}},partial:!0},se={name:"headingAtx",tokenize:function(e,t,n){const r=this;let i=0;return function(t){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),o(t)};function o(a){return 35===a&&i++<6?(e.consume(a),o):null===a||b(a)?(e.exit("atxHeadingSequence"),r.interrupt?t(a):s(a)):n(a)}function s(n){return 35===n?(e.enter("atxHeadingSequence"),a(n)):null===n||S(n)?(e.exit("atxHeading"),t(n)):C(n)?E(e,s,"whitespace")(n):(e.enter("atxHeadingText"),l(n))}function a(t){return 35===t?(e.consume(t),a):(e.exit("atxHeadingSequence"),s(t))}function l(t){return null===t||35===t||b(t)?(e.exit("atxHeadingText"),s(t)):(e.consume(t),l)}},resolve:function(e,t){let n,r,i=e.length-2,o=3;return"whitespace"===e[o][1].type&&(o+=2),i-2>o&&"whitespace"===e[i][1].type&&(i-=2),"atxHeadingSequence"===e[i][1].type&&(o===i-1||i-4>o&&"whitespace"===e[i-2][1].type)&&(i-=o+1===i?2:4),i>o&&(n={type:"atxHeadingText",start:e[o][1].start,end:e[i][1].end},r={type:"chunkText",start:e[o][1].start,end:e[i][1].end,contentType:"text"},u(e,o,i-o+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e}},ae={name:"setextUnderline",tokenize:function(e,t,n){const r=this;let i,o,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){o="paragraph"===r.events[s][1].type;break}return function(t){return r.parser.lazy[r.now().line]||!r.interrupt&&!o?n(t):(e.enter("setextHeadingLine"),e.enter("setextHeadingLineSequence"),i=t,a(t))};function a(t){return t===i?(e.consume(t),a):(e.exit("setextHeadingLineSequence"),E(e,l,"lineSuffix")(t))}function l(r){return null===r||S(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}},resolveTo:function(e,t){let n,r,i,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){n=o;break}"paragraph"===e[o][1].type&&(r=o)}else"content"===e[o][1].type&&e.splice(o,1),i||"definition"!==e[o][1].type||(i=o);const s={type:"setextHeading",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",s,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end=Object.assign({},e[i][1].end)):e[n][1]=s,e.push(["exit",s,t]),e}},le=["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","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ce=["pre","script","style","textarea"],ue={name:"htmlFlow",tokenize:function(e,t,n){const r=this;let i,o,s,a,l;return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c};function c(a){return 33===a?(e.consume(a),u):47===a?(e.consume(a),p):63===a?(e.consume(a),i=3,r.interrupt?t:j):m(a)?(e.consume(a),s=String.fromCharCode(a),o=!0,f):n(a)}function u(o){return 45===o?(e.consume(o),i=2,h):91===o?(e.consume(o),i=5,s="CDATA[",a=0,d):m(o)?(e.consume(o),i=4,r.interrupt?t:j):n(o)}function h(i){return 45===i?(e.consume(i),r.interrupt?t:j):n(i)}function d(i){return i===s.charCodeAt(a++)?(e.consume(i),a===s.length?r.interrupt?t:I:d):n(i)}function p(t){return m(t)?(e.consume(t),s=String.fromCharCode(t),f):n(t)}function f(a){return null===a||47===a||62===a||b(a)?47!==a&&o&&ce.includes(s.toLowerCase())?(i=1,r.interrupt?t(a):I(a)):le.includes(s.toLowerCase())?(i=6,47===a?(e.consume(a),g):r.interrupt?t(a):I(a)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(a):o?v(a):y(a)):45===a||k(a)?(e.consume(a),s+=String.fromCharCode(a),f):n(a)}function g(i){return 62===i?(e.consume(i),r.interrupt?t:I):n(i)}function y(t){return C(t)?(e.consume(t),y):T(t)}function v(t){return 47===t?(e.consume(t),T):58===t||95===t||m(t)?(e.consume(t),w):C(t)?(e.consume(t),v):T(t)}function w(t){return 45===t||46===t||58===t||95===t||k(t)?(e.consume(t),w):x(t)}function x(t){return 61===t?(e.consume(t),M):C(t)?(e.consume(t),x):v(t)}function M(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,O):C(t)?(e.consume(t),M):(l=null,N(t))}function O(t){return null===t||S(t)?n(t):t===l?(e.consume(t),E):(e.consume(t),O)}function N(t){return null===t||34===t||39===t||60===t||61===t||62===t||96===t||b(t)?x(t):(e.consume(t),N)}function E(e){return 47===e||62===e||C(e)?v(e):n(e)}function T(t){return 62===t?(e.consume(t),A):n(t)}function A(t){return C(t)?(e.consume(t),A):null===t||S(t)?I(t):n(t)}function I(t){return 45===t&&2===i?(e.consume(t),P):60===t&&1===i?(e.consume(t),z):62===t&&4===i?(e.consume(t),$):63===t&&3===i?(e.consume(t),j):93===t&&5===i?(e.consume(t),L):!S(t)||6!==i&&7!==i?null===t||S(t)?D(t):(e.consume(t),I):e.check(he,$,D)(t)}function D(t){return e.exit("htmlFlowData"),F(t)}function F(t){return null===t?V(t):S(t)?e.attempt({tokenize:R,partial:!0},F,V)(t):(e.enter("htmlFlowData"),I(t))}function R(e,t,n){return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function P(t){return 45===t?(e.consume(t),j):I(t)}function z(t){return 47===t?(e.consume(t),s="",B):I(t)}function B(t){return 62===t&&ce.includes(s.toLowerCase())?(e.consume(t),$):m(t)&&s.length<8?(e.consume(t),s+=String.fromCharCode(t),B):I(t)}function L(t){return 93===t?(e.consume(t),j):I(t)}function j(t){return 62===t?(e.consume(t),$):45===t&&2===i?(e.consume(t),j):I(t)}function $(t){return null===t||S(t)?(e.exit("htmlFlowData"),V(t)):(e.consume(t),$)}function V(n){return e.exit("htmlFlow"),t(n)}},resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(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},concrete:!0},he={tokenize:function(e,t,n){return function(r){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),e.attempt(D,t,n)}},partial:!0},de={name:"codeFenced",tokenize:function(e,t,n){const r=this,i={tokenize:function(e,t,n){let r=0;return E(e,(function(t){return e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),i(t)}),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function i(t){return t===l?(e.consume(t),r++,i):r<c?n(t):(e.exit("codeFencedFenceSequence"),E(e,o,"whitespace")(t))}function o(r){return null===r||S(r)?(e.exit("codeFencedFence"),t(r)):n(r)}},partial:!0},o={tokenize:function(e,t,n){const r=this;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},s=this.events[this.events.length-1],a=s&&"linePrefix"===s[1].type?s[2].sliceSerialize(s[1],!0).length:0;let l,c=0;return function(t){return e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l=t,u(t)};function u(t){return t===l?(e.consume(t),c++,u):(e.exit("codeFencedFenceSequence"),c<3?n(t):E(e,h,"whitespace")(t))}function h(t){return null===t||S(t)?m(t):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||b(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),E(e,p,"whitespace")(t)):96===t&&t===l?n(t):(e.consume(t),d)}function p(t){return null===t||S(t)?m(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),f(t))}function f(t){return null===t||S(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(t)):96===t&&t===l?n(t):(e.consume(t),f)}function m(n){return e.exit("codeFencedFence"),r.interrupt?t(n):g(n)}function g(t){return null===t?k(t):S(t)?e.attempt(o,e.attempt(i,k,a?E(e,g,"linePrefix",a+1):g),k)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||S(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),y)}function k(n){return e.exit("codeFenced"),t(n)}},concrete:!0},pe=document.createElement("i");function fe(e){const t="&"+e+";";pe.innerHTML=t;const n=pe.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}const me={name:"characterReference",tokenize:function(e,t,n){const r=this;let i,o,s=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),i=31,o=k,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=y,c):(e.enter("characterReferenceValue"),i=7,o=g,c(t))}function c(a){let l;return 59===a&&s?(l=e.exit("characterReferenceValue"),o!==k||fe(r.sliceSerialize(l))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)):o(a)&&s++<i?(e.consume(a),c):n(a)}}},ge={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return v(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},ye={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),E(e,t,"linePrefix")}}},ke={name:"labelEnd",tokenize:function(e,t,n){const r=this;let i,o,s=r.events.length;for(;s--;)if(("labelImage"===r.events[s][1].type||"labelLink"===r.events[s][1].type)&&!r.events[s][1]._balanced){i=r.events[s][1];break}return function(t){return i?i._inactive?l(t):(o=r.parser.defined.includes(te(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),a):n(t)};function a(n){return 40===n?e.attempt(ve,t,o?t:l)(n):91===n?e.attempt(we,t,o?e.attempt(xe,t,l):l)(n):o?t(n):l(n)}function l(e){return i._balanced=!0,n(e)}},resolveTo:function(e,t){let n,r,i,o,s=e.length,a=0;for(;s--;)if(n=e[s][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[s][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(i){if("enter"===e[s][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=s,"labelLink"!==n.type)){a=2;break}}else"labelEnd"===n.type&&(i=s);const l={type:"labelLink"===e[r][1].type?"link":"image",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[r][1].start),end:Object.assign({},e[i][1].end)},d={type:"labelText",start:Object.assign({},e[r+a+2][1].end),end:Object.assign({},e[i-2][1].start)};return o=[["enter",l,t],["enter",c,t]],o=h(o,e.slice(r+1,r+a+3)),o=h(o,[["enter",d,t]]),o=h(o,W(t.parser.constructs.insideSpan.null,e.slice(r+a+4,i-3),t)),o=h(o,[["exit",d,t],e[i-2],e[i-1],["exit",c,t]]),o=h(o,e.slice(i+1)),o=h(o,[["exit",l,t]]),u(e,r,e.length,o),e},resolveAll:function(e){let t,n=-1;for(;++n<e.length;)t=e[n][1],"labelImage"!==t.type&&"labelLink"!==t.type&&"labelEnd"!==t.type||(e.splice(n+1,"labelImage"===t.type?4:2),t.type="data",n++);return e}},ve={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),ee(e,r)};function r(t){return 41===t?s(t):Z(e,i,n,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return b(t)?ee(e,o)(t):s(t)}function o(t){return 34===t||39===t||40===t?Q(e,ee(e,s),n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):s(t)}function s(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},we={tokenize:function(e,t,n){const r=this;return function(t){return X.call(r,e,i,n,"reference","referenceMarker","referenceString")(t)};function i(e){return r.parser.defined.includes(te(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}}},xe={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};function be(e){return null===e||b(e)||M(e)?1:O(e)?2:void 0}const Se={name:"attention",tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=be(r);let o;return function(t){return e.enter("attentionSequence"),o=t,s(t)};function s(a){if(a===o)return e.consume(a),s;const l=e.exit("attentionSequence"),c=be(a),u=!c||2===c&&i||n.includes(a),h=!i||2===i&&c||n.includes(r);return l._open=Boolean(42===o?u:u&&(i||!h)),l._close=Boolean(42===o?h:h&&(c||!u)),t(a)}},resolveAll:function(e,t){let n,r,i,o,s,a,l,c,d=-1;for(;++d<e.length;)if("enter"===e[d][0]&&"attentionSequence"===e[d][1].type&&e[d][1]._close)for(n=d;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[d][1]).charCodeAt(0)){if((e[n][1]._close||e[d][1]._open)&&(e[d][1].end.offset-e[d][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[d][1].end.offset-e[d][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[d][1].end.offset-e[d][1].start.offset>1?2:1;const p=Object.assign({},e[n][1].end),f=Object.assign({},e[d][1].start);Ce(p,-a),Ce(f,a),o={type:a>1?"strongSequence":"emphasisSequence",start:p,end:Object.assign({},e[n][1].end)},s={type:a>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[d][1].start),end:f},i={type:a>1?"strongText":"emphasisText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[d][1].start)},r={type:a>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},s.end)},e[n][1].end=Object.assign({},o.start),e[d][1].start=Object.assign({},s.end),l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=h(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=h(l,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",i,t]]),l=h(l,W(t.parser.constructs.insideSpan.null,e.slice(n+1,d),t)),l=h(l,[["exit",i,t],["enter",s,t],["exit",s,t],["exit",r,t]]),e[d][1].end.offset-e[d][1].start.offset?(c=2,l=h(l,[["enter",e[d][1],t],["exit",e[d][1],t]])):c=0,u(e,n-1,d-n+3,l),d=n+l.length-c-2;break}for(d=-1;++d<e.length;)"attentionSequence"===e[d][1].type&&(e[d][1].type="data");return e}};function Ce(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Me={name:"htmlText",tokenize:function(e,t,n){const r=this;let i,o,s,a;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),l};function l(t){return 33===t?(e.consume(t),c):47===t?(e.consume(t),N):63===t?(e.consume(t),M):m(t)?(e.consume(t),I):n(t)}function c(t){return 45===t?(e.consume(t),u):91===t?(e.consume(t),o="CDATA[",s=0,g):m(t)?(e.consume(t),x):n(t)}function u(t){return 45===t?(e.consume(t),h):n(t)}function h(t){return null===t||62===t?n(t):45===t?(e.consume(t),d):p(t)}function d(e){return null===e||62===e?n(e):p(e)}function p(t){return null===t?n(t):45===t?(e.consume(t),f):S(t)?(a=p,j(t)):(e.consume(t),p)}function f(t){return 45===t?(e.consume(t),V):p(t)}function g(t){return t===o.charCodeAt(s++)?(e.consume(t),s===o.length?y:g):n(t)}function y(t){return null===t?n(t):93===t?(e.consume(t),v):S(t)?(a=y,j(t)):(e.consume(t),y)}function v(t){return 93===t?(e.consume(t),w):y(t)}function w(t){return 62===t?V(t):93===t?(e.consume(t),w):y(t)}function x(t){return null===t||62===t?V(t):S(t)?(a=x,j(t)):(e.consume(t),x)}function M(t){return null===t?n(t):63===t?(e.consume(t),O):S(t)?(a=M,j(t)):(e.consume(t),M)}function O(e){return 62===e?V(e):M(e)}function N(t){return m(t)?(e.consume(t),T):n(t)}function T(t){return 45===t||k(t)?(e.consume(t),T):A(t)}function A(t){return S(t)?(a=A,j(t)):C(t)?(e.consume(t),A):V(t)}function I(t){return 45===t||k(t)?(e.consume(t),I):47===t||62===t||b(t)?D(t):n(t)}function D(t){return 47===t?(e.consume(t),V):58===t||95===t||m(t)?(e.consume(t),F):S(t)?(a=D,j(t)):C(t)?(e.consume(t),D):V(t)}function F(t){return 45===t||46===t||58===t||95===t||k(t)?(e.consume(t),F):R(t)}function R(t){return 61===t?(e.consume(t),P):S(t)?(a=R,j(t)):C(t)?(e.consume(t),R):D(t)}function P(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),i=t,z):S(t)?(a=P,j(t)):C(t)?(e.consume(t),P):(e.consume(t),i=void 0,L)}function z(t){return t===i?(e.consume(t),B):null===t?n(t):S(t)?(a=z,j(t)):(e.consume(t),z)}function B(e){return 62===e||47===e||b(e)?D(e):n(e)}function L(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):62===t||b(t)?D(t):(e.consume(t),L)}function j(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),E(e,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function $(t){return e.enter("htmlTextData"),a(t)}function V(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}}},Oe={name:"codeText",tokenize:function(e,t,n){let r,i,o=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),s(t)};function s(t){return 96===t?(e.consume(t),o++,s):(e.exit("codeTextSequence"),a(t))}function a(t){return null===t?n(t):96===t?(i=e.enter("codeTextSequence"),r=0,c(t)):32===t?(e.enter("space"),e.consume(t),e.exit("space"),a):S(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||S(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),r++,c):r===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(i.type="codeTextData",l(n))}},resolve:function(e){let t,n,r=e.length-4,i=3;if(!("lineEnding"!==e[i][1].type&&"space"!==e[i][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=i;++t<r;)if("codeTextData"===e[t][1].type){e[i][1].type="codeTextPadding",e[r][1].type="codeTextPadding",i+=2,r-=2;break}for(t=i-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type}},Ne={42:U,43:U,45:U,48:U,49:U,50:U,51:U,52:U,53:U,54:U,55:U,56:U,57:U,62:G},Ee={91:ne},Te={[-2]:ie,[-1]:ie,32:ie},Ae={35:se,42:K,45:[ae,K],60:ue,61:ae,95:K,96:de,126:de},Ie={38:me,92:ge},De={[-5]:ye,[-4]:ye,[-3]:ye,33:{name:"labelStartImage",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),i};function i(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),o):n(t)}function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}},resolveAll:ke.resolveAll},38:me,42:Se,60:[{name:"autolink",tokenize:function(e,t,n){let r=1;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i};function i(t){return m(t)?(e.consume(t),o):w(t)?l(t):n(t)}function o(e){return 43===e||45===e||46===e||k(e)?s(e):l(e)}function s(t){return 58===t?(e.consume(t),a):(43===t||45===t||46===t||k(t))&&r++<32?(e.consume(t),s):l(t)}function a(t){return 62===t?(e.exit("autolinkProtocol"),d(t)):null===t||32===t||60===t||x(t)?n(t):(e.consume(t),a)}function l(t){return 64===t?(e.consume(t),r=0,c):w(t)?(e.consume(t),l):n(t)}function c(e){return k(e)?u(e):n(e)}function u(t){return 46===t?(e.consume(t),r=0,c):62===t?(e.exit("autolinkProtocol").type="autolinkEmail",d(t)):h(t)}function h(t){return(45===t||k(t))&&r++<63?(e.consume(t),45===t?h:u):n(t)}function d(n){return e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t}}},Me],91:{name:"labelStartLink",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),i};function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}},resolveAll:ke.resolveAll},92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.enter("escapeMarker"),e.consume(t),r};function r(r){return S(r)?(e.exit("escapeMarker"),e.exit("hardBreakEscape"),t(r)):n(r)}}},ge],93:ke,95:Se,96:Oe},Fe={null:[Se,L]},Re={null:[42,95]},Pe={null:[]};const ze=/[\0\t\n\r]/g;function Be(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||65535==(65535&n)||65534==(65535&n)||n>1114111?"�":String.fromCharCode(n)}const Le=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function je(e){return e.replace(Le,$e)}function $e(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return Be(n.slice(t?2:1),t?16:10)}return fe(n)||e}function Ve(e){return e&&"object"==typeof e?"position"in e||"type"in e?qe(e.position):"start"in e||"end"in e?qe(e):"line"in e||"column"in e?He(e):"":""}function He(e){return We(e&&e.line)+":"+We(e&&e.column)}function qe(e){return He(e&&e.start)+"-"+He(e&&e.end)}function We(e){return e&&"number"==typeof e?e:1}const _e={}.hasOwnProperty,Ke=function(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(x),autolinkProtocol:p,autolinkEmail:p,atxHeading:s(k),blockQuote:s((function(){return{type:"blockquote",children:[]}})),characterEscape:p,characterReference:p,codeFenced:s(y),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(y,l),codeText:s((function(){return{type:"inlineCode",value:""}}),l),codeTextData:p,data:p,codeFlowValue:p,definition:s((function(){return{type:"definition",identifier:"",label:null,title:null,url:""}})),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s((function(){return{type:"emphasis",children:[]}})),hardBreakEscape:s(v),hardBreakTrailing:s(v),htmlFlow:s(w,l),htmlFlowData:p,htmlText:s(w,l),htmlTextData:p,image:s((function(){return{type:"image",title:null,url:"",alt:null}})),label:l,link:s(x),listItem:s((function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}})),listItemValue:function(e){o("expectingFirstListItemValue")&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),i("expectingFirstListItemValue"))},listOrdered:s(b,(function(){i("expectingFirstListItemValue",!0)})),listUnordered:s(b),paragraph:s((function(){return{type:"paragraph",children:[]}})),reference:function(){i("referenceType","collapsed")},referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(k),strong:s((function(){return{type:"strong",children:[]}})),thematicBreak:s((function(){return{type:"thematicBreak"}}))},exit:{atxHeading:u(),atxHeadingSequence:function(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}},autolink:u(),autolinkEmail:function(e){f.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){f.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:u(),characterEscapeValue:f,characterReferenceMarkerHexadecimal:g,characterReferenceMarkerNumeric:g,characterReferenceValue:function(e){const t=this.sliceSerialize(e),n=o("characterReferenceType");let r;n?(r=Be(t,"characterReferenceMarkerNumeric"===n?10:16),i("characterReferenceType")):r=fe(t);const s=this.stack.pop();s.value+=r,s.position.end=Ue(e.end)},codeFenced:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),i("flowCodeInside")})),codeFencedFence:function(){o("flowCodeInside")||(this.buffer(),i("flowCodeInside",!0))},codeFencedFenceInfo:function(){const e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){const e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:f,codeIndented:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")})),codeText:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),codeTextData:f,data:f,definition:u(),definitionDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=te(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:u(),hardBreakEscape:u(m),hardBreakTrailing:u(m),htmlFlow:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),htmlFlowData:f,htmlText:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),htmlTextData:f,image:u((function(){const e=this.stack[this.stack.length-1];if(o("inReference")){const t=o("referenceType")||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;i("referenceType")})),label:function(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(i("inReference",!0),"link"===n.type){const t=e.children;n.children=t}else n.alt=t},labelText:function(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=je(t),n.identifier=te(t).toLowerCase()},lineEnding:function(e){const n=this.stack[this.stack.length-1];if(o("atHardBreak"))return n.children[n.children.length-1].position.end=Ue(e.end),void i("atHardBreak");!o("setextHeadingSlurpLineEnding")&&t.canContainEols.includes(n.type)&&(p.call(this,e),f.call(this,e))},link:u((function(){const e=this.stack[this.stack.length-1];if(o("inReference")){const t=o("referenceType")||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;i("referenceType")})),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=te(this.sliceSerialize(e)).toLowerCase(),i("referenceType","full")},resourceDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){i("inReference")},setextHeading:u((function(){i("setextHeadingSlurpLineEnding")})),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).charCodeAt(0)?1:2},setextHeadingText:function(){i("setextHeadingSlurpLineEnding",!0)},strong:u(),thematicBreak:u()}};Ye(t,(e||{}).mdastExtensions||[]);const n={};return function(e){let n={type:"root",children:[]};const s={stack:[n],tokenStack:[],config:t,enter:c,exit:h,buffer:l,resume:d,setData:i,getData:o},a=[];let u=-1;for(;++u<e.length;)"listOrdered"!==e[u][1].type&&"listUnordered"!==e[u][1].type||("enter"===e[u][0]?a.push(u):u=r(e,a.pop(),u));for(u=-1;++u<e.length;){const n=t[e[u][0]];_e.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},s),e[u][1])}if(s.tokenStack.length>0){const e=s.tokenStack[s.tokenStack.length-1];(e[1]||Ge).call(s,void 0,e[0])}for(n.position={start:Ue(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Ue(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)n=t.transforms[u](n)||n;return n};function r(e,t,n){let r,i,o,s,a=t-1,l=-1,c=!1;for(;++a<=n;){const t=e[a];if("listUnordered"===t[1].type||"listOrdered"===t[1].type||"blockQuote"===t[1].type?("enter"===t[0]?l++:l--,s=void 0):"lineEndingBlank"===t[1].type?"enter"===t[0]&&(!r||s||l||o||(o=a),s=void 0):"linePrefix"===t[1].type||"listItemValue"===t[1].type||"listItemMarker"===t[1].type||"listItemPrefix"===t[1].type||"listItemPrefixWhitespace"===t[1].type||(s=void 0),!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let s=a;for(i=void 0;s--;){const t=e[s];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;i&&(e[i][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",i=s}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}o&&(!i||o<i)&&(r._spread=!0),r.end=Object.assign({},i?e[i][1].start:t[1].end),e.splice(i||a,0,["exit",r,t[2]]),a++,n++}"listItemPrefix"===t[1].type&&(r={type:"listItem",_spread:!1,start:Object.assign({},t[1].start)},e.splice(a,0,["enter",r,t[2]]),a++,n++,o=void 0,s=!0)}}return e[t][1]._spread=c,n}function i(e,t){n[e]=t}function o(e){return n[e]}function s(e,t){return function(n){c.call(this,e(n),n),t&&t.call(this,n)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(e,t,n){return this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n]),e.position={start:Ue(t.start)},e}function u(e){return function(t){e&&e.call(this,t),h.call(this,t)}}function h(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+Ve({start:e.start,end:e.end})+"): it’s not open");return r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Ge).call(this,e,r[0])),n.position.end=Ue(e.end),n}function d(){return a(this.stack.pop())}function p(e){const t=this.stack[this.stack.length-1];let n=t.children[t.children.length-1];n&&"text"===n.type||(n={type:"text",value:""},n.position={start:Ue(e.start)},t.children.push(n)),this.stack.push(n)}function f(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Ue(e.end)}function m(){i("atHardBreak",!0)}function g(e){i("characterReferenceType",e.type)}function y(){return{type:"code",lang:null,meta:null,value:""}}function k(){return{type:"heading",depth:void 0,children:[]}}function v(){return{type:"break"}}function w(){return{type:"html",value:""}}function x(){return{type:"link",title:null,url:"",children:[]}}function b(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}}(n)(function(e){for(;!F(e););return e}(function(e={}){const t=function(e){const t={};let n=-1;for(;++n<e.length;)p(t,e[n]);return t}([r].concat(e.extensions||[])),n={defined:[],lazy:{},constructs:t,content:i(T),document:i(A),flow:i(B),string:i(j),text:i($)};return n;function i(e){return function(t){return _(n,e,t)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(i,o,s){const a=[];let l,c,u,h,d;for(i=n+i.toString(o),u=0,n="",r&&(65279===i.charCodeAt(0)&&u++,r=void 0);u<i.length;){if(ze.lastIndex=u,l=ze.exec(i),h=l&&void 0!==l.index?l.index:i.length,d=i.charCodeAt(h),!l){n=i.slice(u);break}if(10===d&&u===h&&e)a.push(-3),e=void 0;else switch(e&&(a.push(-5),e=void 0),u<h&&(a.push(i.slice(u,h)),t+=h-u),d){case 0:a.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),a.push(-2);t++<c;)a.push(-1);break;case 10:a.push(-4),t=1;break;default:e=!0,t=1}u=h+1}return s&&(e&&a.push(-5),n&&a.push(n),a.push(null)),a}}()(e,t,!0))))};function Ue(e){return{line:e.line,column:e.column,offset:e.offset}}function Ye(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Ye(e,r):Je(e,r)}}function Je(e,t){let n;for(n in t)if(_e.call(t,n))if("canContainEols"===n){const r=t[n];r&&e[n].push(...r)}else if("transforms"===n){const r=t[n];r&&e[n].push(...r)}else if("enter"===n||"exit"===n){const r=t[n];r&&Object.assign(e[n],r)}}function Ge(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ve({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ve({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ve({start:t.start,end:t.end})+") is still open")}function Ze(e){Object.assign(this,{Parser:t=>{const n=this.data("settings");return Ke(t,Object.assign({},n,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}const Xe={}.hasOwnProperty;function Qe(e,t){let n,r=-1;if(t.extensions)for(;++r<t.extensions.length;)Qe(e,t.extensions[r]);for(n in t)"extensions"===n||("unsafe"===n||"join"===n?e[n]=[...e[n]||[],...t[n]||[]]:"handlers"===n?e[n]=Object.assign(e[n],t[n]||{}):e.options[n]=t[n]);return e}function et(e,t,n){return">"+(n?"":" ")+e}function tt(e,t){return nt(e,t.inConstruct,!0)&&!nt(e,t.notInConstruct,!1)}function nt(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function rt(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if("\n"===n.unsafe[i].character&&tt(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return"\\\n"}function it(e,t){return Boolean(!t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function ot(e,t,n){return(n?"":" ")+e}function st(e){const t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function at(e,t,n,r){const i=function(e){const t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),o=n.enter("emphasis"),s=n.createTracker(r);let a=s.move(i);return a+=s.move(n.containerPhrasing(e,{before:a,after:i,...s.current()})),a+=s.move(i),o(),a}at.peek=function(e,t,n){return n.options.emphasis||"*"};var lt=n(6355),ct=n(1104);function ut(e,t){let n=!1;return(0,lt.Vn)(e,(e=>{if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,ct.BK})),Boolean((!e.depth||e.depth<3)&&a(e)&&(t.options.setext||n))}function ht(e){return e.value||""}function dt(e,t,n,r){const i=st(n),o='"'===i?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),c+=l.move(")"),s(),c}function pt(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const h=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,o(),"full"!==i&&c&&c===h?"shortcut"===i?l=l.slice(0,-1):l+=a.move("]"):l+=a.move(h+"]"),l}function ft(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function mt(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const e=n.unsafe[o],t=ft(e);let i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;10===r.charCodeAt(e)&&13===r.charCodeAt(e-1)&&e--,r=r.slice(0,e)+" "+r.slice(i.index+1)}}return i+r+i}function gt(e,t){const n=a(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}function yt(e,t,n,r){const i=st(n),o='"'===i?"Quote":"Apostrophe",s=n.createTracker(r);let a,l;if(gt(e,n)){const t=n.stack;n.stack=[],a=n.enter("autolink");let r=s.move("<");return r+=s.move(n.containerPhrasing(e,{before:r,after:">",...s.current()})),r+=s.move(">"),a(),n.stack=t,r}a=n.enter("link"),l=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=s.move(" "+i),c+=s.move(n.safe(e.title,{before:c,after:i,...s.current()})),c+=s.move(i),l()),c+=s.move(")"),a(),c}function kt(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const h=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=u,o(),"full"!==i&&c&&c===h?"shortcut"===i?l=l.slice(0,-1):l+=a.move("]"):l+=a.move(h+"]"),l}function vt(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function wt(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function xt(e){const t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}ht.peek=function(){return"<"},dt.peek=function(){return"!"},pt.peek=function(){return"!"},mt.peek=function(){return"`"},yt.peek=function(e,t,n){return gt(e,n)?"<":"["},kt.peek=function(){return"["};const bt=(0,n(7689).O)(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","link","linkReference","strong","text"]);function St(e,t,n,r){const i=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),o=n.enter("strong"),s=n.createTracker(r);let a=s.move(i+i);return a+=s.move(n.containerPhrasing(e,{before:a,after:i,...s.current()})),a+=s.move(i+i),o(),a}St.peek=function(e,t,n){return n.options.strong||"*"};const Ct={blockquote:function(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),et);return i(),s},break:rt,code:function(e,t,n,r){const i=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),o=e.value||"",s="`"===i?"GraveAccent":"Tilde";if(it(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(o,ot);return e(),t}const a=n.createTracker(r),l=i.repeat(Math.max(function(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if("string"!=typeof t)throw new TypeError("Expected substring");for(;-1!==r;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}(o,i)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const t=n.enter(`codeFencedLang${s}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${s}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...a.current()})),t()}return u+=a.move("\n"),o&&(u+=a.move(o+"\n")),u+=a.move(l),c(),u},definition:function(e,t,n,r){const i=st(n),o='"'===i?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),s(),c},emphasis:at,hardBreak:rt,heading:function(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(ut(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),s=n.containerPhrasing(e,{...o.current(),before:"\n",after:"\n"});return r(),t(),s+"\n"+(1===i?"=":"-").repeat(s.length-(Math.max(s.lastIndexOf("\r"),s.lastIndexOf("\n"))+1))}const s="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");o.move(s+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...o.current()});return/^[\t ]/.test(c)&&(c="&#x"+c.charCodeAt(0).toString(16).toUpperCase()+";"+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),l(),a(),c},html:ht,image:dt,imageReference:pt,inlineCode:mt,link:yt,linkReference:kt,list:function(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?wt(n):vt(n);const a=e.ordered?function(e){const t=wt(e),n=e.options.bulletOrderedOther;if(!n)return"."===t?")":".";if("."!==n&&")"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrderedOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bulletOrdered` (`"+t+"`) and `bulletOrderedOther` (`"+n+"`) to be different");return n}(n):function(e){const t=vt(e),n=e.options.bulletOther;if(!n)return"*"===t?"-":"*";if("*"!==n&&"+"!==n&&"-"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}(n),l=n.bulletLastUsed;let c=!1;if(t&&(e.ordered?n.options.bulletOrderedOther:n.options.bulletOther)&&l&&s===l&&(c=!0),!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==s&&"-"!==s||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(c=!0),xt(n)===s&&t){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if(n&&"listItem"===n.type&&n.children&&n.children[0]&&"thematicBreak"===n.children[0].type){c=!0;break}}}}c&&(s=a),n.bulletCurrent=s;const u=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),u},listItem:function(e,t,n,r){const i=function(e){const t=e.options.listItemIndent||"tab";if(1===t||"1"===t)return"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let o=n.bulletCurrent||vt(n);t&&"list"===t.type&&t.ordered&&(o=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+o);let s=o.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(s=4*Math.ceil(s/4));const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),(function(e,t,n){return t?(n?"":" ".repeat(s))+e:(n?o:o+" ".repeat(s-o.length))+e}));return l(),c},paragraph:function(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s},root:function(e,t,n,r){const i=e.children.some((e=>bt(e)));return(i?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:St,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(xt(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?r.slice(0,-1):r}},Mt=[function(e,t,n,r){if("code"===t.type&&it(t,r)&&("list"===e.type||e.type===t.type&&it(e,r)))return!1;if("list"===e.type&&e.type===t.type&&Boolean(e.ordered)===Boolean(t.ordered)&&!(e.ordered?r.options.bulletOrderedOther:r.options.bulletOther))return!1;if("spread"in n&&"boolean"==typeof n.spread){if("paragraph"===e.type&&(e.type===t.type||"definition"===t.type||"heading"===t.type&&ut(t,r)))return;return n.spread?1:0}}],Ot=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],Nt=[{character:"\t",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\n",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:Ot},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:"(?:[\r\n]|$)"},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Ot},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:"(?:[ \t\r\n*])"},{character:"*",inConstruct:"phrasing",notInConstruct:Ot},{atBreak:!0,character:"+",after:"(?:[ \t\r\n])"},{atBreak:!0,character:"-",after:"(?:[ \t\r\n-])"},{atBreak:!0,before:"\\d+",character:".",after:"(?:[ \t\r\n]|$)"},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Ot},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Ot},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Ot},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Ot},{atBreak:!0,character:"~"}];function Et(e){return e.label||!e.identifier?e.label||"":je(e.identifier)}function Tt(e,t,n,r){let i=r.join.length;for(;i--;){const o=r.join[i](e,t,n,r);if(!0===o||1===o)break;if("number"==typeof o)return"\n".repeat(1+o);if(!1===o)return"\n\n\x3c!----\x3e\n\n"}return"\n\n"}const At=/\r?\n|\r/g;function It(e,t){const n=[];let r,i=0,o=0;for(;r=At.exec(e);)s(e.slice(i,r.index)),n.push(r[0]),i=r.index+r[0].length,o++;return s(e.slice(i)),n.join("");function s(e){n.push(t(e,o,!e))}}function Dt(e,t){return e-t}function Ft(e,t){const n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],o=e+t;let s,a=-1,l=0;for(;s=n.exec(o);)r.push(s.index);for(;++a<r.length;)l!==r[a]&&i.push(e.slice(l,r[a])),i.push("\\"),l=r[a];return i.push(e.slice(l)),i.join("")}function Rt(e){const t=e||{},n=t.now||{};let r=t.lineShift||0,i=n.line||1,o=n.column||1;return{move:function(e){const t=e||"",n=t.split(/\r?\n|\r/g),s=n[n.length-1];return i+=n.length-1,o=1===n.length?o+s.length:1+s.length+r,t},current:function(){return{now:{line:i,column:o},lineShift:r}},shift:function(e){r+=e}}}function Pt(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function zt(e){throw new Error("Cannot handle unknown node `"+e.type+"`")}function Bt(e,t){if("definition"===e.type&&e.type===t.type)return 0}function Lt(e,t){return function(e,t,n){const r=t.indexStack,i=e.children||[],o=[];let s=-1,a=n.before;r.push(-1);let l=t.createTracker(n);for(;++s<i.length;){const c=i[s];let u;if(r[r.length-1]=s,s+1<i.length){let n=t.handle.handlers[i[s+1].type];n&&n.peek&&(n=n.peek),u=n?n(i[s+1],e,t,{before:"",after:"",...l.current()}).charAt(0):""}else u=n.after;o.length>0&&("\r"===a||"\n"===a)&&"html"===c.type&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),a=" ",l=t.createTracker(n),l.move(o.join(""))),o.push(l.move(t.handle(c,e,t,{...l.current(),before:a,after:u}))),a=o[o.length-1].slice(-1)}return r.pop(),o.join("")}(e,this,t)}function jt(e,t){return function(e,t,n){const r=t.indexStack,i=e.children||[],o=t.createTracker(n),s=[];let a=-1;for(r.push(-1);++a<i.length;){const n=i[a];r[r.length-1]=a,s.push(o.move(t.handle(n,e,t,{before:"\n",after:"\n",...o.current()}))),"list"!==n.type&&(t.bulletLastUsed=void 0),a<i.length-1&&s.push(o.move(Tt(n,i[a+1],e,t)))}return r.pop(),s.join("")}(e,this,t)}function $t(e,t){return function(e,t,n){const r=(n.before||"")+(t||"")+(n.after||""),i=[],o=[],s={};let a=-1;for(;++a<e.unsafe.length;){const t=e.unsafe[a];if(!tt(e.stack,t))continue;const n=ft(t);let o;for(;o=n.exec(r);){const e="before"in t||Boolean(t.atBreak),n="after"in t,r=o.index+(e?o[1].length:0);i.includes(r)?(s[r].before&&!e&&(s[r].before=!1),s[r].after&&!n&&(s[r].after=!1)):(i.push(r),s[r]={before:e,after:n})}}i.sort(Dt);let l=n.before?n.before.length:0;const c=r.length-(n.after?n.after.length:0);for(a=-1;++a<i.length;){const e=i[a];e<l||e>=c||e+1<c&&i[a+1]===e+1&&s[e].after&&!s[e+1].before&&!s[e+1].after||i[a-1]===e-1&&s[e].before&&!s[e-1].before&&!s[e-1].after||(l!==e&&o.push(Ft(r.slice(l,e),"\\")),l=e,!/[!-/:-@[-`{-~]/.test(r.charAt(e))||n.encode&&n.encode.includes(r.charAt(e))?(o.push("&#x"+r.charCodeAt(e).toString(16).toUpperCase()+";"),l++):o.push("\\"))}return o.push(Ft(r.slice(l,c),n.after)),o.join("")}(this,e,t)}function Vt(e){Object.assign(this,{Compiler:t=>{const n=this.data("settings");return function(e,t={}){const n={enter:function(e){return n.stack.push(e),function(){n.stack.pop()}},indentLines:It,associationId:Et,containerPhrasing:Lt,containerFlow:jt,createTracker:Rt,safe:$t,stack:[],unsafe:[],join:[],handlers:{},options:{},indexStack:[],handle:void 0};Qe(n,{unsafe:Nt,join:Mt,handlers:Ct}),Qe(n,t),n.options.tightDefinitions&&Qe(n,{join:[Bt]}),n.handle=function(e,t){const n=t||{};function r(t,...n){let i=r.invalid;const o=r.handlers;if(t&&Xe.call(t,e)){const n=String(t[e]);i=Xe.call(o,n)?o[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}("type",{invalid:Pt,unknown:zt,handlers:n.handlers});let r=n.handle(e,void 0,n,{before:"\n",after:"\n",now:{line:1,column:1},lineShift:0});return r&&10!==r.charCodeAt(r.length-1)&&13!==r.charCodeAt(r.length-1)&&(r+="\n"),r}(t,Object.assign({},n,e,{extensions:this.data("toMarkdownExtensions")||[]}))}})}function Ht(e){if(e)throw e}var qt=n(3335),Wt=n(9385);function _t(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}class Kt extends Error{constructor(e,t,n){const r=[null,null];let i={start:{line:null,column:null},end:{line:null,column:null}};if(super(),"string"==typeof t&&(n=t,t=void 0),"string"==typeof n){const e=n.indexOf(":");-1===e?r[1]=n:(r[0]=n.slice(0,e),r[1]=n.slice(e+1))}t&&("type"in t||"position"in t?t.position&&(i=t.position):"start"in t||"end"in t?i=t:("line"in t||"column"in t)&&(i.start=t)),this.name=Ve(t)||"1:1",this.message="object"==typeof e?e.message:e,this.stack="","object"==typeof e&&e.stack&&(this.stack=e.stack),this.reason=this.message,this.fatal,this.line=i.start.line,this.column=i.start.column,this.position=i,this.source=r[0],this.ruleId=r[1],this.file,this.actual,this.expected,this.url,this.note}}Kt.prototype.file="",Kt.prototype.name="",Kt.prototype.reason="",Kt.prototype.message="",Kt.prototype.stack="",Kt.prototype.fatal=null,Kt.prototype.column=null,Kt.prototype.line=null,Kt.prototype.source=null,Kt.prototype.ruleId=null,Kt.prototype.position=null;const Ut=function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Xt(e);let n,r=0,i=-1,o=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;o--;)if(47===e.charCodeAt(o)){if(n){r=o+1;break}}else i<0&&(n=!0,i=o+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(47===e.charCodeAt(o)){if(n){r=o+1;break}}else s<0&&(n=!0,s=o+1),a>-1&&(e.charCodeAt(o)===t.charCodeAt(a--)?a<0&&(i=o):(a=-1,i=s));return r===i?i=s:i<0&&(i=e.length),e.slice(r,i)},Yt=function(e){if(Xt(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.charCodeAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.charCodeAt(0)?"/":".":1===n&&47===e.charCodeAt(0)?"//":e.slice(0,n)},Jt=function(e){Xt(e);let t,n=e.length,r=-1,i=0,o=-1,s=0;for(;n--;){const a=e.charCodeAt(n);if(47!==a)r<0&&(t=!0,r=n+1),46===a?o<0?o=n:1!==s&&(s=1):o>-1&&(s=-1);else if(t){i=n+1;break}}return o<0||r<0||0===s||1===s&&o===r-1&&o===i+1?"":e.slice(o,r)},Gt=function(...e){let t,n=-1;for(;++n<e.length;)Xt(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Xt(e);const t=47===e.charCodeAt(0);let n=function(e,t){let n,r,i="",o=0,s=-1,a=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.charCodeAt(l);else{if(47===n)break;n=47}if(47===n){if(s===l-1||1===a);else if(s!==l-1&&2===a){if(i.length<2||2!==o||46!==i.charCodeAt(i.length-1)||46!==i.charCodeAt(i.length-2))if(i.length>2){if(r=i.lastIndexOf("/"),r!==i.length-1){r<0?(i="",o=0):(i=i.slice(0,r),o=i.length-1-i.lastIndexOf("/")),s=l,a=0;continue}}else if(i.length>0){i="",o=0,s=l,a=0;continue}t&&(i=i.length>0?i+"/..":"..",o=2)}else i.length>0?i+="/"+e.slice(s+1,l):i=e.slice(s+1,l),o=l-s-1;s=l,a=0}else 46===n&&a>-1?a++:a=-1}return i}(e,!t);return 0!==n.length||t||(n="."),n.length>0&&47===e.charCodeAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},Zt="/";function Xt(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Qt=function(){return"/"};function en(e){return null!==e&&"object"==typeof e&&e.href&&e.origin}const tn=["history","path","basename","stem","extname","dirname"];class nn{constructor(e){let t;t=e?"string"==typeof e||function(e){return qt(e)}(e)?{value:e}:en(e)?{path:e}:e:{},this.data={},this.messages=[],this.history=[],this.cwd=Qt(),this.value,this.stored,this.result,this.map;let n,r=-1;for(;++r<tn.length;){const e=tn[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)tn.includes(n)||(this[n]=t[n])}get path(){return this.history[this.history.length-1]}set path(e){en(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!en(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.charCodeAt(n)&&50===t.charCodeAt(n+1)){const e=t.charCodeAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),on(e,"path"),this.path!==e&&this.history.push(e)}get dirname(){return"string"==typeof this.path?Yt(this.path):void 0}set dirname(e){sn(this.basename,"dirname"),this.path=Gt(e||"",this.basename)}get basename(){return"string"==typeof this.path?Ut(this.path):void 0}set basename(e){on(e,"basename"),rn(e,"basename"),this.path=Gt(this.dirname||"",e)}get extname(){return"string"==typeof this.path?Jt(this.path):void 0}set extname(e){if(rn(e,"extname"),sn(this.dirname,"extname"),e){if(46!==e.charCodeAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Gt(this.dirname,this.stem+(e||""))}get stem(){return"string"==typeof this.path?Ut(this.path,this.extname):void 0}set stem(e){on(e,"stem"),rn(e,"stem"),this.path=Gt(this.dirname||"",e+(this.extname||""))}toString(e){return(this.value||"").toString(e||void 0)}message(e,t,n){const r=new Kt(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=null,r}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}}function rn(e,t){if(e&&e.includes(Zt))throw new Error("`"+t+"` cannot be a path: did not expect `"+Zt+"`")}function on(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function sn(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const an=function e(){const t=function(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function i(o,...s){const a=e[++n];let l=-1;if(o)r(o);else{for(;++l<t.length;)null!==s[l]&&void 0!==s[l]||(s[l]=t[l]);t=s,a?function(e,t){let n;return function(...t){const o=e.length>t.length;let s;o&&t.push(r);try{s=e.apply(this,t)}catch(e){if(o&&n)throw e;return r(e)}o||(s instanceof Promise?s.then(i,r):s instanceof Error?r(s):i(s))};function r(e,...r){n||(n=!0,t(e,...r))}function i(e){r(null,e)}}(a,i)(...s):r(null,...s)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}(),n=[];let r,i={},o=-1;return s.data=function(e,t){return"string"==typeof e?2===arguments.length?(dn("data",r),i[e]=t,s):ln.call(i,e)&&i[e]||null:e?(dn("data",r),i=e,s):i},s.Parser=void 0,s.Compiler=void 0,s.freeze=function(){if(r)return s;for(;++o<n.length;){const[e,...r]=n[o];if(!1===r[0])continue;!0===r[0]&&(r[0]=void 0);const i=e.call(s,...r);"function"==typeof i&&t.use(i)}return r=!0,o=Number.POSITIVE_INFINITY,s},s.attachers=n,s.use=function(e,...t){let o;if(dn("use",r),null==e);else if("function"==typeof e)u(e,...t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?c(e):l(e)}return o&&(i.settings=Object.assign(i.settings||{},o)),s;function a(e){if("function"==typeof e)u(e);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;u(t,...n)}else l(e)}}function l(e){c(e.plugins),e.settings&&(o=Object.assign(o||{},e.settings))}function c(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;)a(e[t])}}function u(e,t){let r,i=-1;for(;++i<n.length;)if(n[i][0]===e){r=n[i];break}r?(_t(r[1])&&_t(t)&&(t=Wt(!0,r[1],t)),r[1]=t):n.push([...arguments])}},s.parse=function(e){s.freeze();const t=mn(e),n=s.Parser;return un("parse",n),cn(n,"parse")?new n(String(t),t).parse():n(String(t),t)},s.stringify=function(e,t){s.freeze();const n=mn(t),r=s.Compiler;return hn("stringify",r),pn(e),cn(r,"compile")?new r(e,n).compile():r(e,n)},s.run=function(e,n,r){if(pn(e),s.freeze(),r||"function"!=typeof n||(r=n,n=void 0),!r)return new Promise(i);function i(i,o){t.run(e,mn(n),(function(t,n,s){n=n||e,t?o(t):i?i(n):r(null,n,s)}))}i(null,r)},s.runSync=function(e,t){let n,r;return s.run(e,t,(function(e,t){Ht(e),n=t,r=!0})),fn("runSync","run",r),n},s.process=function(e,t){if(s.freeze(),un("process",s.Parser),hn("process",s.Compiler),!t)return new Promise(n);function n(n,r){const i=mn(e);function o(e,i){e||!i?r(e):n?n(i):t(null,i)}s.run(s.parse(i),i,((e,t,n)=>{if(!e&&t&&n){const i=s.stringify(t,n);null==i||("string"==typeof(r=i)||qt(r)?n.value=i:n.result=i),o(e,n)}else o(e);var r}))}n(null,t)},s.processSync=function(e){let t;s.freeze(),un("processSync",s.Parser),hn("processSync",s.Compiler);const n=mn(e);return s.process(n,(function(e){t=!0,Ht(e)})),fn("processSync","process",t),n},s;function s(){const t=e();let r=-1;for(;++r<n.length;)t.use(...n[r]);return t.data(Wt(!0,{},i)),t}}().freeze(),ln={}.hasOwnProperty;function cn(e,t){return"function"==typeof e&&e.prototype&&(function(e){let t;for(t in e)if(ln.call(e,t))return!0;return!1}(e.prototype)||t in e.prototype)}function un(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `Parser`")}function hn(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `Compiler`")}function dn(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function pn(e){if(!_t(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function fn(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function mn(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new nn(e)}var gn,yn,kn,vn,wn,xn,bn,Sn=n(870),Cn=Object.defineProperty,Mn=(e,t,n)=>(((e,t,n)=>{t in e?Cn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),On=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Nn=(e,t,n)=>(On(e,t,"read from private field"),n?n.call(e):t.get(e)),En=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Tn=(e,t,n,r)=>(On(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);class An{}class In{constructor(){Mn(this,"elements",[]),Mn(this,"size",(()=>this.elements.length)),Mn(this,"top",(()=>this.elements.at(-1))),Mn(this,"push",(e=>{var t;null==(t=this.top())||t.push(e)})),Mn(this,"open",(e=>{this.elements.push(e)})),Mn(this,"close",(()=>{const e=this.elements.pop();if(!e)throw(0,Sn.qw)();return e}))}}class Dn extends An{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(e,t,n){return new Dn(e,t,n)}}const Fn=class extends In{constructor(e){super(),Mn(this,"schema"),En(this,gn,o.vc.none),En(this,yn,(e=>e.isText)),En(this,kn,((e,t)=>{if(Nn(this,yn).call(this,e)&&Nn(this,yn).call(this,t)&&o.vc.sameSet(e.marks,t.marks))return this.schema.text(e.text+t.text,e.marks)})),En(this,vn,(e=>{const t=Object.values({...this.schema.nodes,...this.schema.marks}).find((t=>t.spec.parseMarkdown.match(e)));if(!t)throw(0,Sn.y$)(e);return t})),En(this,wn,(e=>{const t=Nn(this,vn).call(this,e);t.spec.parseMarkdown.runner(this,e,t)})),Mn(this,"injectRoot",((e,t,n)=>(this.openNode(t,n),this.next(e.children),this))),Mn(this,"openNode",((e,t)=>(this.open(Dn.create(e,[],t)),this))),En(this,xn,(()=>{Tn(this,gn,o.vc.none);const e=this.close();return Nn(this,bn).call(this,e.type,e.attrs,e.content)})),Mn(this,"closeNode",(()=>(Nn(this,xn).call(this),this))),En(this,bn,((e,t,n)=>{const r=e.createAndFill(t,n,Nn(this,gn));if(!r)throw(0,Sn.Vh)(e,t,n);return this.push(r),r})),Mn(this,"addNode",((e,t,n)=>(Nn(this,bn).call(this,e,t,n),this))),Mn(this,"openMark",((e,t)=>{const n=e.create(t);return Tn(this,gn,n.addToSet(Nn(this,gn))),this})),Mn(this,"closeMark",(e=>(Tn(this,gn,e.removeFromSet(Nn(this,gn))),this))),Mn(this,"addText",(e=>{const t=this.top();if(!t)throw(0,Sn.qw)();const n=t.pop(),r=this.schema.text(e,Nn(this,gn));if(!n)return t.push(r),this;const i=Nn(this,kn).call(this,n,r);return i?(t.push(i),this):(t.push(n,r),this)})),Mn(this,"build",(()=>{let e;do{e=Nn(this,xn).call(this)}while(this.size());return e})),Mn(this,"next",((e=[])=>([e].flat().forEach((e=>Nn(this,wn).call(this,e))),this))),Mn(this,"toDoc",(()=>this.build())),Mn(this,"run",((e,t)=>{const n=e.runSync(e.parse(t),t);return this.next(n),this})),this.schema=e}};let Rn=Fn;gn=new WeakMap,yn=new WeakMap,kn=new WeakMap,vn=new WeakMap,wn=new WeakMap,xn=new WeakMap,bn=new WeakMap,Mn(Rn,"create",((e,t)=>{const n=new Fn(e);return e=>(n.run(t,e),n.toDoc())}));const Pn=class extends An{constructor(e,t,n,r={}){super(),Mn(this,"push",((e,...t)=>{this.children||(this.children=[]),this.children.push(e,...t)})),Mn(this,"pop",(()=>{var e;return null==(e=this.children)?void 0:e.pop()})),this.type=e,this.children=t,this.value=n,this.props=r}};let zn=Pn;var Bn,Ln,jn,$n,Vn,Hn,qn,Wn,_n,Kn,Un,Yn;Mn(zn,"create",((e,t,n,r={})=>new Pn(e,t,n,r)));const Jn=class extends In{constructor(e){super(),En(this,Bn,o.vc.none),Mn(this,"schema"),En(this,Ln,(e=>{const t=Object.values({...this.schema.nodes,...this.schema.marks}).find((t=>t.spec.toMarkdown.match(e)));if(!t)throw(0,Sn.OO)(e.type);return t})),En(this,jn,(e=>Nn(this,Ln).call(this,e).spec.toMarkdown.runner(this,e))),En(this,$n,((e,t)=>Nn(this,Ln).call(this,e).spec.toMarkdown.runner(this,e,t))),En(this,Vn,(e=>{const{marks:t}=e,n=e=>e.type.spec.priority??50;[...t].sort(((e,t)=>n(e)-n(t))).every((t=>!Nn(this,$n).call(this,t,e)))&&Nn(this,jn).call(this,e),t.forEach((e=>Nn(this,Yn).call(this,e)))})),En(this,Hn,((e,t)=>{var n;if(e.type===t||1!==(null==(n=e.children)?void 0:n.length))return e;const r=e=>{var n;if(e.type===t)return e;if(1!==(null==(n=e.children)?void 0:n.length))return null;const[i]=e.children;return i?r(i):null},i=r(e);if(!i)return e;const o=i.children?[...i.children]:void 0,s={...e,children:o};return s.children=o,i.children=[s],i})),En(this,qn,(e=>{const{children:t}=e;return t&&(e.children=t.reduce(((e,t,n)=>{if(0===n)return[t];const r=e.at(-1);if(r&&r.isMark&&t.isMark){t=Nn(this,Hn).call(this,t,r.type);const{children:n,...i}=t,{children:o,...s}=r;if(t.type===r.type&&n&&o&&JSON.stringify(i)===JSON.stringify(s)){const t={...s,children:[...o,...n]};return e.slice(0,-1).concat(Nn(this,qn).call(this,t))}}return e.concat(t)}),[])),e})),En(this,Wn,(e=>{const t={...e.props,type:e.type};return e.children&&(t.children=e.children),e.value&&(t.value=e.value),t})),Mn(this,"openNode",((e,t,n)=>(this.open(zn.create(e,void 0,t,n)),this))),En(this,_n,(()=>{const e=this.close();return Nn(this,Kn).call(this,e.type,e.children,e.value,e.props)})),Mn(this,"closeNode",(()=>(Nn(this,_n).call(this),this))),En(this,Kn,((e,t,n,r)=>{const i=zn.create(e,t,n,r),o=Nn(this,qn).call(this,Nn(this,Wn).call(this,i));return this.push(o),o})),Mn(this,"addNode",((e,t,n,r)=>(Nn(this,Kn).call(this,e,t,n,r),this))),En(this,Un,((e,t,n,r)=>e.isInSet(Nn(this,Bn))?this:(Tn(this,Bn,e.addToSet(Nn(this,Bn))),this.openNode(t,n,{...r,isMark:!0})))),En(this,Yn,(e=>{!e.isInSet(Nn(this,Bn))||(Tn(this,Bn,e.type.removeFromSet(Nn(this,Bn))),Nn(this,_n).call(this))})),Mn(this,"withMark",((e,t,n,r)=>(Nn(this,Un).call(this,e,t,n,r),this))),Mn(this,"closeMark",(e=>(Nn(this,Yn).call(this,e),this))),Mn(this,"build",(()=>{let e=null;do{e=Nn(this,_n).call(this)}while(this.size());return e})),Mn(this,"next",(e=>{return t=e,Object.prototype.hasOwnProperty.call(t,"size")?(e.forEach((e=>{Nn(this,Vn).call(this,e)})),this):(Nn(this,Vn).call(this,e),this);var t})),Mn(this,"toString",(e=>e.stringify(this.build()))),Mn(this,"run",(e=>(this.next(e),this))),this.schema=e}};let Gn=Jn;Bn=new WeakMap,Ln=new WeakMap,jn=new WeakMap,$n=new WeakMap,Vn=new WeakMap,Hn=new WeakMap,qn=new WeakMap,Wn=new WeakMap,_n=new WeakMap,Kn=new WeakMap,Un=new WeakMap,Yn=new WeakMap,Mn(Gn,"create",((e,t)=>{const n=new Jn(e);return e=>(n.run(e),n.toString(t))}));var Zn=n(7191),Xn=n(2780),Qn=n(4285),er=n(737),tr=n(840),nr=Object.defineProperty,rr=(e,t,n)=>(((e,t,n)=>{t in e?nr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),ir=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},or=(e,t,n)=>(ir(e,t,"read from private field"),n?n.call(e):t.get(e)),sr=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ar=(e,t,n,r)=>(ir(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);const lr=(e,t)=>(e.meta={package:"@milkdown/core",group:"System",...t},e),cr=(0,i.eF)("ConfigReady"),ur=(0,i.eF)("InitReady"),hr=(0,i.oM)([],"initTimer"),dr=(0,i.oM)({},"editor"),pr=(0,i.oM)([],"inputRules"),fr=(0,i.oM)([],"prosePlugins"),mr=(0,i.oM)([],"remarkPlugins"),gr=(0,i.oM)([],"nodeView"),yr=(0,i.oM)([],"markView"),kr=(0,i.oM)(an().use(Ze).use(Vt),"remark"),vr=(0,i.oM)({},"remarkStringifyOptions"),wr=e=>{const t=t=>(t.inject(dr,e).inject(fr).inject(mr).inject(pr).inject(gr).inject(yr).inject(vr).inject(kr,an().use(Ze).use(Vt)).inject(hr,[cr]).record(ur),async()=>{await t.waitTimers(hr);const e=t.get(vr);return t.set(kr,an().use(Ze).use(Vt,e)),t.done(ur),()=>{t.remove(dr).remove(fr).remove(mr).remove(pr).remove(gr).remove(yr).remove(vr).remove(kr).remove(hr).clearTimer(ur)}});return lr(t,{displayName:"Init"}),t},xr=(0,i.eF)("SchemaReady"),br=(0,i.oM)([],"schemaTimer"),Sr=(0,i.oM)({},"schema"),Cr=(0,i.oM)([],"nodes"),Mr=(0,i.oM)([],"marks"),Or=e=>{var t;return{...e,parseDOM:null==(t=e.parseDOM)?void 0:t.map((t=>({priority:e.priority,...t})))}},Nr=e=>(e.inject(Sr).inject(Cr).inject(Mr).inject(br,[ur]).record(xr),async()=>{await e.waitTimers(br);const t=e.get(kr),n=e.get(mr).reduce(((e,t)=>e.use(t)),t);e.set(kr,n);const r=Object.fromEntries(e.get(Cr).map((([e,t])=>[e,Or(t)]))),i=Object.fromEntries(e.get(Mr).map((([e,t])=>[e,Or(t)])));return e.set(Sr,new o.V_({nodes:r,marks:i})),e.done(xr),()=>{e.remove(Sr).remove(Cr).remove(Mr).remove(br).clearTimer(xr)}});lr(Nr,{displayName:"Schema"});const Er=(0,i.eF)("ParserReady"),Tr=(0,i.oM)((()=>{throw(0,Sn.S1)()}),"parser"),Ar=(0,i.oM)([],"parserTimer"),Ir=e=>(e.inject(Tr).inject(Ar,[xr]).record(Er),async()=>{await e.waitTimers(Ar);const t=e.get(kr),n=e.get(Sr);return e.set(Tr,Rn.create(n,t)),e.done(Er),()=>{e.remove(Tr).remove(Ar).clearTimer(Er)}});lr(Ir,{displayName:"Parser"});const Dr=(0,i.eF)("SerializerReady"),Fr=(0,i.oM)([],"serializerTimer"),Rr=(0,i.oM)((()=>""),"serializer"),Pr=e=>(e.inject(Rr).inject(Fr,[xr]).record(Dr),async()=>{await e.waitTimers(Fr);const t=e.get(kr),n=e.get(Sr);return e.set(Rr,Gn.create(n,t)),e.done(Dr),()=>{e.remove(Rr).remove(Fr).clearTimer(Dr)}});lr(Pr,{displayName:"Serializer"});const zr=(0,i.oM)("","defaultValue"),Br=(0,i.oM)({},"editorState"),Lr=(0,i.oM)((e=>e),"stateOptions"),jr=(0,i.oM)([],"editorStateTimer"),$r=(0,i.eF)("EditorStateReady"),Vr=new Zn.H$("MILKDOWN_STATE_TRACKER"),Hr=e=>(e.inject(zr).inject(Br).inject(Lr).inject(jr,[Er,Dr,ri]).record($r),async()=>{await e.waitTimers(jr);const t=e.get(Sr),n=e.get(Tr),r=e.get(pr),i=e.get(Lr),s=e.get(fr),a=((e,t,n)=>{if("string"==typeof e)return t(e);if("html"===e.type)return o.aw.fromSchema(n).parse(e.dom);if("json"===e.type)return o.NB.fromJSON(n,e.value);throw(0,Sn.rf)(e)})(e.get(zr),n,t),l=[...s,new Zn.Sy({key:Vr,state:{init:()=>{},apply:(t,n,r,i)=>{e.set(Br,i)}}}),(0,Qn.NJ)({rules:r}),(0,tr.h)(er.YR)];e.set(fr,l);const c=i({schema:t,doc:a,plugins:l}),u=Zn.yy.create(c);return e.set(Br,u),e.done($r),()=>{e.remove(zr).remove(Br).remove(Lr).remove(jr).clearTimer($r)}});lr(Hr,{displayName:"EditorState"});const qr=(0,i.eF)("EditorViewReady"),Wr=(0,i.oM)({},"editorView"),_r=(0,i.oM)([],"editorViewTimer"),Kr=(0,i.oM)({},"editorViewOptions"),Ur=(0,i.oM)(null,"root"),Yr=(0,i.oM)(null,"rootDOM"),Jr=(0,i.oM)({},"rootAttrs"),Gr=new Zn.H$("MILKDOWN_VIEW_CLEAR"),Zr=e=>(e.inject(Ur,document.body).inject(Wr).inject(Kr).inject(Yr).inject(Jr).inject(_r,[$r]).record(qr),async()=>{await e.wait(ur);const t=e.get(Ur)||document.body,n="string"==typeof t?document.querySelector(t):t;e.update(fr,(t=>[new Zn.Sy({key:Gr,view:t=>{const r=n?((e,t)=>{const n=document.createElement("div");n.className="milkdown",e.appendChild(n),t.set(Yr,n);const r=t.get(Jr);return Object.entries(r).forEach((([e,t])=>n.setAttribute(e,t))),n})(n,e):void 0;return(()=>{if(r&&n){const e=t.dom;n.replaceChild(r,e),r.appendChild(e)}})(),{destroy:()=>{null!=r&&r.parentNode&&(null==r||r.parentNode.replaceChild(t.dom,r)),null==r||r.remove()}}}}),...t])),await e.waitTimers(_r);const r=e.get(Br),i=e.get(Kr),o=Object.fromEntries(e.get(gr)),s=Object.fromEntries(e.get(yr)),a=new Xn.tk(n,{state:r,nodeViews:o,markViews:s,...i});return(e=>{e.classList.add("editor"),e.setAttribute("role","textbox")})(a.dom),e.set(Wr,a),e.done(qr),()=>{null==a||a.destroy(),e.remove(Ur).remove(Wr).remove(Kr).remove(Yr).remove(Jr).remove(_r).clearTimer(qr)}});var Xr,Qr;lr(Zr,{displayName:"EditorView"}),Xr=new WeakMap,Qr=new WeakMap;const ei=(e="cmdKey")=>(0,i.oM)((()=>()=>!1),e),ti=(0,i.oM)(new class{constructor(){sr(this,Xr,new i.W2),sr(this,Qr,null),rr(this,"setCtx",(e=>{ar(this,Qr,e)}))}create(e,t){const n=e.create(or(this,Xr).sliceMap);return n.set(t),n}get(e){return or(this,Xr).get(e).get()}remove(e){return or(this,Xr).remove(e)}call(e,t){if(null==or(this,Qr))throw(0,Sn.gq)();const n=this.get(e)(t),r=or(this,Qr).get(Wr);return n(r.state,r.dispatch,r)}},"commands"),ni=(0,i.oM)([xr],"commandsTimer"),ri=(0,i.eF)("CommandsReady"),ii=e=>(e.inject(ti).inject(ni).record(ri),e.get(ti).setCtx(e),async()=>(await e.waitTimers(ni),e.done(ri),()=>{e.remove(ti).remove(ni).clearTimer(ri)}));var oi,si,ai,li,ci,ui,hi,di,pi,fi,mi,gi,yi,ki,vi;lr(ii,{displayName:"Commands"});const wi=class{constructor(){sr(this,oi,!1),sr(this,si,"Idle"),sr(this,ai,[]),sr(this,li,(()=>{})),sr(this,ci,new i.W2),sr(this,ui,new i.SU),sr(this,hi,new Map),sr(this,di,new Map),sr(this,pi,new i.A7(or(this,ci),or(this,ui))),sr(this,fi,(()=>{const e=(e=>{const t=t=>(t.record(cr),async()=>(await e(t),t.done(cr),()=>{t.clearTimer(cr)}));return lr(t,{displayName:"Config"}),t})((async e=>{await Promise.all(or(this,ai).map((t=>t(e))))})),t=[Nr,Ir,Pr,ii,Hr,Zr,wr(this),e];or(this,mi).call(this,t,or(this,di))})),sr(this,mi,((e,t)=>{e.forEach((e=>{const n=or(this,pi).produce(or(this,oi)?e.meta:void 0),r=e(n);t.set(e,{ctx:n,handler:r,cleanup:void 0})}))})),sr(this,gi,((e,t=!1)=>Promise.all([e].flat().map((e=>{const n=or(this,hi).get(e),r=null==n?void 0:n.cleanup;return t?or(this,hi).delete(e):or(this,hi).set(e,{ctx:void 0,handler:void 0,cleanup:void 0}),"function"==typeof r?r():r}))))),sr(this,yi,(async()=>{await Promise.all([...or(this,di).entries()].map((([e,{cleanup:t}])=>"function"==typeof t?t():t))),or(this,di).clear()})),sr(this,ki,(e=>{ar(this,si,e),or(this,li).call(this,e)})),sr(this,vi,(e=>[...e.entries()].map((async([t,n])=>{const{ctx:r,handler:i}=n;if(!i)return;const o=await i();e.set(t,{ctx:r,handler:i,cleanup:o})})))),rr(this,"enableInspector",((e=!0)=>(ar(this,oi,e),this))),rr(this,"onStatusChange",(e=>(ar(this,li,e),this))),rr(this,"config",(e=>(or(this,ai).push(e),this))),rr(this,"removeConfig",(e=>(ar(this,ai,or(this,ai).filter((t=>t!==e))),this))),rr(this,"use",(e=>{const t=[e].flat();return t.flat().forEach((e=>{or(this,hi).set(e,{ctx:void 0,handler:void 0,cleanup:void 0})})),"Created"===or(this,si)&&or(this,mi).call(this,t,or(this,hi)),this})),rr(this,"remove",(async e=>"OnCreate"===or(this,si)?(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 or(this,gi).call(this,[e].flat(),!0),this))),rr(this,"create",(async()=>("OnCreate"===or(this,si)||("Created"===or(this,si)&&await this.destroy(),or(this,ki).call(this,"OnCreate"),or(this,fi).call(this),or(this,mi).call(this,[...or(this,hi).keys()],or(this,hi)),await Promise.all([or(this,vi).call(this,or(this,di)),or(this,vi).call(this,or(this,hi))].flat()),or(this,ki).call(this,"Created")),this))),rr(this,"destroy",(async(e=!1)=>"Destroyed"===or(this,si)||"OnDestroy"===or(this,si)?this:"OnCreate"===or(this,si)?new Promise((t=>{setTimeout((()=>{t(this.destroy(e))}),50)})):(e&&ar(this,ai,[]),or(this,ki).call(this,"OnDestroy"),await or(this,gi).call(this,[...or(this,hi).keys()],e),await or(this,yi).call(this),or(this,ki).call(this,"Destroyed"),this))),rr(this,"action",(e=>e(or(this,pi)))),rr(this,"inspect",(()=>or(this,oi)?[...or(this,di).values(),...or(this,hi).values()].map((({ctx:e})=>{var t;return null==(t=null==e?void 0:e.inspector)?void 0:t.read()})).filter((e=>Boolean(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 wi}get ctx(){return or(this,pi)}get status(){return or(this,si)}};let xi=wi;oi=new WeakMap,si=new WeakMap,ai=new WeakMap,li=new WeakMap,ci=new WeakMap,ui=new WeakMap,hi=new WeakMap,di=new WeakMap,pi=new WeakMap,fi=new WeakMap,mi=new WeakMap,gi=new WeakMap,yi=new WeakMap,ki=new WeakMap,vi=new WeakMap},11:(e,t,n)=>{"use strict";n.d(t,{A7:()=>D,SU:()=>F,W2:()=>p,eF:()=>H,oM:()=>g});var r,i,o,s=n(870),a=Object.defineProperty,l=(e,t,n)=>(((e,t,n)=>{t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),c=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},u=(e,t,n)=>(c(e,t,"read from private field"),n?n.call(e):t.get(e)),h=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},d=(e,t,n,r)=>(c(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);class p{constructor(){l(this,"sliceMap",new Map),l(this,"get",(e=>{const t="string"==typeof e?[...this.sliceMap.values()].find((t=>t.type.name===e)):this.sliceMap.get(e.id);if(!t){const t="string"==typeof e?e:e.name;throw(0,s.KE)(t)}return t})),l(this,"remove",(e=>{const t="string"==typeof e?[...this.sliceMap.values()].find((t=>t.type.name===e)):this.sliceMap.get(e.id);!t||this.sliceMap.delete(t.type.id)})),l(this,"has",(e=>"string"==typeof e?[...this.sliceMap.values()].some((t=>t.type.name===e)):this.sliceMap.has(e.id)))}}class f{constructor(e,t,n){l(this,"type"),h(this,r,[]),h(this,i,void 0),h(this,o,(()=>{u(this,r).forEach((e=>e(u(this,i))))})),l(this,"set",(e=>{d(this,i,e),u(this,o).call(this)})),l(this,"get",(()=>u(this,i))),l(this,"update",(e=>{d(this,i,e(u(this,i))),u(this,o).call(this)})),this.type=n,d(this,i,t),e.set(n.id,this)}on(e){return u(this,r).push(e),()=>{d(this,r,u(this,r).filter((t=>t!==e)))}}once(e){const t=this.on((n=>{e(n),t()}));return t}off(e){d(this,r,u(this,r).filter((t=>t!==e)))}offAll(){d(this,r,[])}}r=new WeakMap,i=new WeakMap,o=new WeakMap;class m{constructor(e,t){l(this,"id"),l(this,"name"),l(this,"_typeInfo"),l(this,"_defaultValue"),this.id=Symbol(`Context-${t}`),this.name=t,this._defaultValue=e,this._typeInfo=()=>{throw(0,s.S1)()}}create(e,t=this._defaultValue){return new f(e,t,this)}}const g=(e,t)=>new m(e,t);var y,k,v,w,x,b,S,C,M,O,N,E,T;class A{constructor(e,t,n){h(this,y,void 0),h(this,k,void 0),h(this,v,void 0),h(this,w,new Set),h(this,x,new Set),h(this,b,new Map),h(this,S,new Map),l(this,"read",(()=>({metadata:u(this,y),injectedSlices:[...u(this,w)].map((e=>({name:"string"==typeof e?e:e.name,value:u(this,C).call(this,e)}))),consumedSlices:[...u(this,x)].map((e=>({name:"string"==typeof e?e:e.name,value:u(this,C).call(this,e)}))),recordedTimers:[...u(this,b)].map((([e,{duration:t}])=>({name:e.name,duration:t,status:u(this,M).call(this,e)}))),waitTimers:[...u(this,S)].map((([e,{duration:t}])=>({name:e.name,duration:t,status:u(this,M).call(this,e)})))}))),l(this,"onRecord",(e=>{u(this,b).set(e,{start:Date.now(),duration:0})})),l(this,"onClear",(e=>{u(this,b).delete(e)})),l(this,"onDone",(e=>{const t=u(this,b).get(e);!t||(t.duration=Date.now()-t.start)})),l(this,"onWait",((e,t)=>{const n=Date.now();t.finally((()=>{u(this,S).set(e,{duration:Date.now()-n})}))})),l(this,"onInject",(e=>{u(this,w).add(e)})),l(this,"onRemove",(e=>{u(this,w).delete(e)})),l(this,"onUse",(e=>{u(this,x).add(e)})),h(this,C,(e=>u(this,k).get(e).get())),h(this,M,(e=>u(this,v).get(e).status)),d(this,k,e),d(this,v,t),d(this,y,n)}}y=new WeakMap,k=new WeakMap,v=new WeakMap,w=new WeakMap,x=new WeakMap,b=new WeakMap,S=new WeakMap,C=new WeakMap,M=new WeakMap;const I=class{constructor(e,t,n){h(this,O,void 0),h(this,N,void 0),h(this,E,void 0),h(this,T,void 0),l(this,"produce",(e=>e&&Object.keys(e).length?new I(u(this,O),u(this,N),{...e}):this)),l(this,"inject",((e,t)=>{var n;const r=e.create(u(this,O).sliceMap);return null!=t&&r.set(t),null==(n=u(this,T))||n.onInject(e),this})),l(this,"remove",(e=>{var t;return u(this,O).remove(e),null==(t=u(this,T))||t.onRemove(e),this})),l(this,"record",(e=>{var t;return e.create(u(this,N).store),null==(t=u(this,T))||t.onRecord(e),this})),l(this,"clearTimer",(e=>{var t;return u(this,N).remove(e),null==(t=u(this,T))||t.onClear(e),this})),l(this,"isInjected",(e=>u(this,O).has(e))),l(this,"isRecorded",(e=>u(this,N).has(e))),l(this,"use",(e=>{var t;return null==(t=u(this,T))||t.onUse(e),u(this,O).get(e)})),l(this,"get",(e=>this.use(e).get())),l(this,"set",((e,t)=>this.use(e).set(t))),l(this,"update",((e,t)=>this.use(e).update(t))),l(this,"timer",(e=>u(this,N).get(e))),l(this,"done",(e=>{var t;this.timer(e).done(),null==(t=u(this,T))||t.onDone(e)})),l(this,"wait",(e=>{var t;const n=this.timer(e).start();return null==(t=u(this,T))||t.onWait(e,n),n})),l(this,"waitTimers",(async e=>{await Promise.all(this.get(e).map((e=>this.wait(e))))})),d(this,O,e),d(this,N,t),d(this,E,n),n&&d(this,T,new A(e,t,n))}get meta(){return u(this,E)}get inspector(){return u(this,T)}};let D=I;O=new WeakMap,N=new WeakMap,E=new WeakMap,T=new WeakMap;class F{constructor(){l(this,"store",new Map),l(this,"get",(e=>{const t=this.store.get(e.id);if(!t)throw(0,s._O)(e.name);return t})),l(this,"remove",(e=>{this.store.delete(e.id)})),l(this,"has",(e=>this.store.has(e.id)))}}var R,P,z,B,L,j;class ${constructor(e,t){l(this,"type"),h(this,R,null),h(this,P,null),h(this,z,void 0),h(this,B,"pending"),l(this,"start",(()=>(u(this,R)??d(this,R,new Promise(((e,t)=>{d(this,P,(t=>{t instanceof CustomEvent&&t.detail.id===u(this,z)&&(d(this,B,"resolved"),u(this,L).call(this),t.stopImmediatePropagation(),e())})),u(this,j).call(this,(()=>{"pending"===u(this,B)&&d(this,B,"rejected"),u(this,L).call(this),t(new Error(`Timing ${this.type.name} timeout.`))})),d(this,B,"pending"),addEventListener(this.type.name,u(this,P))}))),u(this,R)))),l(this,"done",(()=>{const e=new CustomEvent(this.type.name,{detail:{id:u(this,z)}});dispatchEvent(e)})),h(this,L,(()=>{u(this,P)&&removeEventListener(this.type.name,u(this,P))})),h(this,j,(e=>{setTimeout((()=>{e()}),this.type.timeout)})),d(this,z,Symbol(t.name)),this.type=t,e.set(t.id,this)}get status(){return u(this,B)}}R=new WeakMap,P=new WeakMap,z=new WeakMap,B=new WeakMap,L=new WeakMap,j=new WeakMap;class V{constructor(e,t=3e3){l(this,"id"),l(this,"name"),l(this,"timeout"),l(this,"create",(e=>new $(e,this))),this.id=Symbol(`Timer-${e}`),this.name=e,this.timeout=t}}const H=(e,t=3e3)=>new V(e,t)},870:(e,t,n)=>{"use strict";n.d(t,{GZ:()=>g,KE:()=>c,OO:()=>m,S1:()=>h,Vh:()=>d,YN:()=>k,_O:()=>u,d2:()=>v,gq:()=>y,qw:()=>p,rf:()=>l,y$:()=>f});var r=Object.defineProperty,i=(e=>(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))(i||{});class o extends Error{constructor(e,t){super(t),((e,t,n)=>{((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n)})(this,"code"),this.name="MilkdownError",this.code=e}}const s=(e,t)=>"function"==typeof t?"[Function]":t,a=e=>JSON.stringify(e,s),l=e=>new o(i.docTypeError,`Doc type error, unsupported type: ${a(e)}`),c=e=>new o(i.contextNotFound,`Context "${e}" not found, do you forget to inject it?`),u=e=>new o(i.timerNotFound,`Timer "${e}" not found, do you forget to record it?`),h=()=>new o(i.ctxCallOutOfScope,"Should not call a context out of the plugin."),d=(...e)=>{const t=e.reduce(((e,t)=>{if(!t)return e;const n=e=>Array.isArray(e)?e.map((e=>n(e))).join(", "):e.toJSON?a(e.toJSON()):e.spec?a(e.spec):e.toString();return`${e}, ${n(t)}`}),"Create prosemirror node from remark failed in parser");return new o(i.createNodeInParserFail,t)},p=()=>new o(i.stackOverFlow,"Stack over flow, cannot pop on an empty stack."),f=e=>new o(i.parserMatchError,`Cannot match target parser for node: ${a(e)}.`),m=e=>new o(i.serializerMatchError,`Cannot match target serializer for node: ${a(e)}.`),g=e=>new o(i.expectDomTypeError,`Expect to be a dom, but get: ${a(e)}.`),y=()=>new o(i.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"),k=e=>new o(i.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${e}" in schema.`),v=e=>new o(i.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${e}" in schema.`)},790:(e,t,n)=>{"use strict";n.d(t,{m8:()=>D});var r=n(3848),i=200,o=function(){};o.prototype.append=function(e){return e.length?(e=o.from(e),!this.length&&e||e.length<i&&this.leafAppend(e)||this.length<i&&e.leafPrepend(this)||this.appendInner(e)):this},o.prototype.prepend=function(e){return e.length?o.from(e).append(this):this},o.prototype.appendInner=function(e){return new a(this,e)},o.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?o.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},o.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},o.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},o.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},o.from=function(e){return e instanceof o?e:e&&e.length?new s(e):o.empty};var s=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 0==e&&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(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=i)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=i)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}(o);o.empty=new s([]);var a=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;return!(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r))&&!(n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&!(n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))&&void 0},t.prototype.sliceInner=function(e,t){if(0==e&&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}(o);const l=o;var c=n(6151),u=n(7191);class h{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}t&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new d(e.map));let t,i=e.step.map(n.slice(r));i&&a.maybeStep(i).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new d(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(r)):e.selection,s=new h(this.items.slice(0,i).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,t,n,r){let i=[],o=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let l,c=e.steps[n].invert(e.docs[n]),u=new d(e.mapping.maps[n],c,t);(l=a&&a.merge(u))&&(u=l,n?i.pop():s=s.slice(0,s.length-1)),i.push(u),t&&(o++,t=void 0),r||(a=u)}let l=o-n.depth;return l>f&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),o-=l),new h(s.append(i),o)}remapping(e,t){let n=new c.vs;return this.items.forEach(((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new h(this.items.append(e.map((e=>new d(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(a+1,r));c&&s++,n.push(new d(l,o,c))}else n.push(new d(l))}),r);let l=[];for(let e=t;e<o;e++)l.push(new d(i.maps[e]));let c=this.items.slice(0,r).append(l).append(n),u=new h(c,s);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&i++;let l,c=new d(s.invert(),e,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else o.map&&n--}),this.items.length,0),new h(l.from(r.reverse()),i)}}h.empty=new h(l.empty,0);class d{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new d(t.getMap().invert(),t,this.selection)}}}class p{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}const f=20;function m(e){let t=[];return e.forEach(((e,n,r,i)=>t.push(r,i))),t}function g(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function y(e,t,n,r){let i=w(t),o=x.get(t).spec.config,s=(r?e.undone:e.done).popEvent(t,i);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),o,i),c=new p(r?l:s.remaining,r?s.remaining:l,null,0,-1);n(s.transform.setSelection(a).setMeta(x,{redo:r,historyState:c}).scrollIntoView())}let k=!1,v=null;function w(e){let t=e.plugins;if(v!=t){k=!1,v=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){k=!0;break}}return k}const x=new u.H$("history"),b=new u.H$("closeHistory");const S=(e,t)=>{let n=x.getState(e);return!(!n||0==n.done.eventCount||(t&&y(n,e,t,!1),0))},C=(e,t)=>{let n=x.getState(e);return!(!n||0==n.undone.eventCount||(t&&y(n,e,t,!0),0))};var M=n(948);const O=(e,t)=>(Object.assign(e,{meta:{package:"@milkdown/plugin-history",...t}}),e),N=(0,M.r1)("Undo",(()=>()=>S));O(N,{displayName:"Command<undo>"});const E=(0,M.r1)("Undo",(()=>()=>C));O(N,{displayName:"Command<redo>"});const T=(0,M.Tu)({},"historyProviderConfig");O(T,{displayName:"Ctx<historyProviderConfig>"});const A=(0,M.x6)((e=>function(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new u.Sy({key:x,state:{init:()=>new p(h.empty,h.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let i,o=n.getMeta(x);if(o)return o.historyState;n.getMeta(b)&&(e=new p(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(x))return s.getMeta(x).redo?new p(e.done.addTransform(n,void 0,r,w(t)),e.undone,m(n.mapping.maps[n.steps.length-1]),e.prevTime,e.prevComposition):new p(e.done,e.undone.addTransform(n,void 0,r,w(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new p(e.done.rebased(n,i),e.undone.rebased(n,i),g(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new p(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),g(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!s&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(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}(n,e.prevRanges)),a=s?g(e.prevRanges,n.mapping):m(n.mapping.maps[n.steps.length-1]);return new p(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,w(t)),h.empty,a,n.time,null==i?e.prevComposition:i)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?S:"historyRedo"==n?C:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}(e.get(T.key))));O(A,{displayName:"Ctx<historyProviderPlugin>"});const I=(0,M.Gv)("historyKeymap",{Undo:{shortcuts:"Mod-z",command:e=>{const t=e.get(r.Xo);return()=>t.call(N.key)}},Redo:{shortcuts:["Mod-y","Shift-Mod-z"],command:e=>{const t=e.get(r.Xo);return()=>t.call(E.key)}}});O(I.ctx,{displayName:"KeymapCtx<history>"}),O(I.shortcuts,{displayName:"Keymap<history>"});const D=[T,A,I,N,E].flat()},4547:(e,t,n)=>{"use strict";n.d(t,{QC:()=>u,X3:()=>d});var r=n(11),i=n(3848),o=n(7191),s=n(594),a=Object.defineProperty,l=(e,t,n)=>(((e,t,n)=>{t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class c{constructor(){l(this,"beforeMountedListeners",[]),l(this,"mountedListeners",[]),l(this,"updatedListeners",[]),l(this,"markdownUpdatedListeners",[]),l(this,"blurListeners",[]),l(this,"focusListeners",[]),l(this,"destroyListeners",[]),l(this,"beforeMount",(e=>(this.beforeMountedListeners.push(e),this))),l(this,"mounted",(e=>(this.mountedListeners.push(e),this))),l(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}}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}}const u=(0,r.oM)(new c,"listener"),h=new o.H$("MILKDOWN_LISTENER"),d=e=>(e.inject(u,new c),async()=>{await e.wait(i.Iq);const t=e.get(u),{listeners:n}=t;n.beforeMount.forEach((t=>t(e))),await e.wait(i.vc);const r=e.get(i.Ck);let a=null,l=null;const c=new o.Sy({key:h,view:()=>({destroy:()=>{n.destroy.forEach((t=>t(e)))}}),props:{handleDOMEvents:{focus:()=>(n.focus.forEach((t=>t(e))),!1),blur:()=>(n.blur.forEach((t=>t(e))),!1)}},state:{init:()=>{},apply:t=>t.docChanged&&!1!==t.getMeta("addToHistory")?s((()=>{const{doc:i}=t;if(n.updated.length>0&&(null==a||!a.eq(i))&&n.updated.forEach((t=>{t(e,i,a)})),n.markdownUpdated.length>0&&(null==a||!a.eq(i))){const t=r(i);n.markdownUpdated.forEach((n=>{n(e,t,l)})),l=t}a=i}),200)():void 0}});e.update(i.ZV,(e=>e.concat(c))),await e.wait(i.$B),n.mounted.forEach((t=>t(e)))});d.meta={package:"@milkdown/plugin-listener",displayName:"Listener"}},4426:(e,t,n)=>{"use strict";n.d(t,{mS:()=>l,ws:()=>u});var r=n(3848),i=n(7191),o=n(2780),s=n(948),a=n(870);const l=(0,s.Tu)({uploader:async(e,t)=>{const n=[];for(let t=0;t<e.length;t++){const r=e.item(t);!r||!r.type.includes("image")||n.push(r)}const{image:r}=t.nodes;if(!r)throw(0,a.YN)("image");return(await Promise.all(n.map((e=>(e=>new Promise((t=>{const n=new FileReader;n.addEventListener("load",(()=>{t({alt:e.name,src:n.result})}),!1),n.readAsDataURL(e)})))(e))))).map((({alt:e,src:t})=>r.createAndFill({src:t,alt:e})))},enableHtmlFileUploader:!1,uploadWidgetFactory:(e,t)=>{const n=document.createElement("span");return n.textContent="Upload in progress...",o.p.widget(e,n,t)}},"uploadConfig");l.meta={package:"@milkdown/plugin-upload",displayName:"Ctx<uploadConfig>"};const c=(0,s.x6)((e=>{const t=new i.H$("MILKDOWN_UPLOAD"),n=(n,i,o)=>{var s;if(!o||o.length<=0)return!1;const a=Symbol("upload symbol"),c=e.get(r.le),{tr:u}=n.state,h=i instanceof DragEvent?(null==(s=n.posAtCoords({left:i.clientX,top:i.clientY}))?void 0:s.pos)??u.selection.from:u.selection.from;n.dispatch(u.setMeta(t,{add:{id:a,pos:h}}));const{uploader:d}=e.get(l.key);return d(o,c).then((e=>{const r=((e,n)=>{var r;const i=t.getState(e);if(!i)return-1;const o=i.find(void 0,void 0,(e=>e.id===n));return o.length?(null==(r=o[0])?void 0:r.from)??-1:-1})(n.state,a);r<0||n.dispatch(n.state.tr.replaceWith(r,r,e).setMeta(t,{remove:{id:a}}))})).catch((e=>{console.error(e)})),!0};return new i.Sy({key:t,state:{init:()=>o.EH.empty,apply(t,n){const r=n.map(t.mapping,t.doc),i=t.getMeta(this);if(!i)return r;if(i.add){const{uploadWidgetFactory:n}=e.get(l.key),o=n(i.add.pos,{id:i.add.id});return r.add(t.doc,[o])}if(i.remove){const e=r.find(void 0,void 0,(e=>e.id===i.remove.id));return r.remove(e)}return r}},props:{decorations(e){return this.getState(e)},handlePaste:(t,r)=>{var i,o;const{enableHtmlFileUploader:s}=e.get(l.key);return!(!(r instanceof ClipboardEvent)||!s&&(null==(i=r.clipboardData)?void 0:i.getData("text/html")))&&n(t,r,null==(o=r.clipboardData)?void 0:o.files)},handleDrop:(e,t)=>{var r;return t instanceof DragEvent&&n(e,t,null==(r=t.dataTransfer)?void 0:r.files)}}})}));c.meta={package:"@milkdown/plugin-upload",displayName:"Prose<upload>"};const u=[l,c]},3928:(e,t,n)=>{"use strict";n.d(t,{iO:()=>ht});var r=n(948),i=n(3848),o=n(737),s=n(2665),a=n(870),l=n(6151);class c{constructor(e,t){var n;this.match=e,this.match=e,this.handler="string"==typeof t?(n=t,function(e,t,r,i){let o=n;if(t[1]){let e=t[0].lastIndexOf(t[1]);o+=t[0].slice(e+t[1].length);let n=(r+=e)-i;n>0&&(o=t[0].slice(e-n,e)+o,r=i)}return e.tr.insertText(o,r,i)}):t}}function u(e,t,n=null,r){return new c(e,((e,i,o,s)=>{let a=n instanceof Function?n(i):n,c=e.tr.delete(o,s),u=c.doc.resolve(o).blockRange(),h=u&&(0,l.nd)(u,t,a);if(!h)return null;c.wrap(u,h);let d=c.doc.resolve(o-1).nodeBefore;return d&&d.type==t&&(0,l.Mn)(c.doc,o-1)&&(!r||r(i,d))&&c.join(o-1),c}))}function h(e,t,n=null){return new c(e,((e,r,i,o)=>{let s=e.doc.resolve(i),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t)?e.tr.delete(i,o).setBlockType(i,i,t,a):null}))}function d(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function p(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}new c(/--$/,"—"),new c(/\.\.\.$/,"…"),new c(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new c(/"$/,"”"),new c(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new c(/'$/,"’");const f=[["ß","ss"],["ẞ","Ss"],["ä","ae"],["Ä","Ae"],["ö","oe"],["Ö","Oe"],["ü","ue"],["Ü","Ue"],["À","A"],["Á","A"],["Â","A"],["Ã","A"],["Ä","Ae"],["Å","A"],["Æ","AE"],["Ç","C"],["È","E"],["É","E"],["Ê","E"],["Ë","E"],["Ì","I"],["Í","I"],["Î","I"],["Ï","I"],["Ð","D"],["Ñ","N"],["Ò","O"],["Ó","O"],["Ô","O"],["Õ","O"],["Ö","Oe"],["Ő","O"],["Ø","O"],["Ù","U"],["Ú","U"],["Û","U"],["Ü","Ue"],["Ű","U"],["Ý","Y"],["Þ","TH"],["ß","ss"],["à","a"],["á","a"],["â","a"],["ã","a"],["ä","ae"],["å","a"],["æ","ae"],["ç","c"],["è","e"],["é","e"],["ê","e"],["ë","e"],["ì","i"],["í","i"],["î","i"],["ï","i"],["ð","d"],["ñ","n"],["ò","o"],["ó","o"],["ô","o"],["õ","o"],["ö","oe"],["ő","o"],["ø","o"],["ù","u"],["ú","u"],["û","u"],["ü","ue"],["ű","u"],["ý","y"],["þ","th"],["ÿ","y"],["ẞ","SS"],["à","a"],["À","A"],["á","a"],["Á","A"],["â","a"],["Â","A"],["ã","a"],["Ã","A"],["è","e"],["È","E"],["é","e"],["É","E"],["ê","e"],["Ê","E"],["ì","i"],["Ì","I"],["í","i"],["Í","I"],["ò","o"],["Ò","O"],["ó","o"],["Ó","O"],["ô","o"],["Ô","O"],["õ","o"],["Õ","O"],["ù","u"],["Ù","U"],["ú","u"],["Ú","U"],["ý","y"],["Ý","Y"],["ă","a"],["Ă","A"],["Đ","D"],["đ","d"],["ĩ","i"],["Ĩ","I"],["ũ","u"],["Ũ","U"],["ơ","o"],["Ơ","O"],["ư","u"],["Ư","U"],["ạ","a"],["Ạ","A"],["ả","a"],["Ả","A"],["ấ","a"],["Ấ","A"],["ầ","a"],["Ầ","A"],["ẩ","a"],["Ẩ","A"],["ẫ","a"],["Ẫ","A"],["ậ","a"],["Ậ","A"],["ắ","a"],["Ắ","A"],["ằ","a"],["Ằ","A"],["ẳ","a"],["Ẳ","A"],["ẵ","a"],["Ẵ","A"],["ặ","a"],["Ặ","A"],["ẹ","e"],["Ẹ","E"],["ẻ","e"],["Ẻ","E"],["ẽ","e"],["Ẽ","E"],["ế","e"],["Ế","E"],["ề","e"],["Ề","E"],["ể","e"],["Ể","E"],["ễ","e"],["Ễ","E"],["ệ","e"],["Ệ","E"],["ỉ","i"],["Ỉ","I"],["ị","i"],["Ị","I"],["ọ","o"],["Ọ","O"],["ỏ","o"],["Ỏ","O"],["ố","o"],["Ố","O"],["ồ","o"],["Ồ","O"],["ổ","o"],["Ổ","O"],["ỗ","o"],["Ỗ","O"],["ộ","o"],["Ộ","O"],["ớ","o"],["Ớ","O"],["ờ","o"],["Ờ","O"],["ở","o"],["Ở","O"],["ỡ","o"],["Ỡ","O"],["ợ","o"],["Ợ","O"],["ụ","u"],["Ụ","U"],["ủ","u"],["Ủ","U"],["ứ","u"],["Ứ","U"],["ừ","u"],["Ừ","U"],["ử","u"],["Ử","U"],["ữ","u"],["Ữ","U"],["ự","u"],["Ự","U"],["ỳ","y"],["Ỳ","Y"],["ỵ","y"],["Ỵ","Y"],["ỷ","y"],["Ỷ","Y"],["ỹ","y"],["Ỹ","Y"],["ء","e"],["آ","a"],["أ","a"],["ؤ","w"],["إ","i"],["ئ","y"],["ا","a"],["ب","b"],["ة","t"],["ت","t"],["ث","th"],["ج","j"],["ح","h"],["خ","kh"],["د","d"],["ذ","dh"],["ر","r"],["ز","z"],["س","s"],["ش","sh"],["ص","s"],["ض","d"],["ط","t"],["ظ","z"],["ع","e"],["غ","gh"],["ـ","_"],["ف","f"],["ق","q"],["ك","k"],["ل","l"],["م","m"],["ن","n"],["ه","h"],["و","w"],["ى","a"],["ي","y"],["َ","a"],["ُ","u"],["ِ","i"],["٠","0"],["١","1"],["٢","2"],["٣","3"],["٤","4"],["٥","5"],["٦","6"],["٧","7"],["٨","8"],["٩","9"],["چ","ch"],["ک","k"],["گ","g"],["پ","p"],["ژ","zh"],["ی","y"],["۰","0"],["۱","1"],["۲","2"],["۳","3"],["۴","4"],["۵","5"],["۶","6"],["۷","7"],["۸","8"],["۹","9"],["ټ","p"],["ځ","z"],["څ","c"],["ډ","d"],["ﺫ","d"],["ﺭ","r"],["ړ","r"],["ﺯ","z"],["ږ","g"],["ښ","x"],["ګ","g"],["ڼ","n"],["ۀ","e"],["ې","e"],["ۍ","ai"],["ٹ","t"],["ڈ","d"],["ڑ","r"],["ں","n"],["ہ","h"],["ھ","h"],["ے","e"],["А","A"],["а","a"],["Б","B"],["б","b"],["В","V"],["в","v"],["Г","G"],["г","g"],["Д","D"],["д","d"],["ъе","ye"],["Ъе","Ye"],["ъЕ","yE"],["ЪЕ","YE"],["Е","E"],["е","e"],["Ё","Yo"],["ё","yo"],["Ж","Zh"],["ж","zh"],["З","Z"],["з","z"],["И","I"],["и","i"],["ый","iy"],["Ый","Iy"],["ЫЙ","IY"],["ыЙ","iY"],["Й","Y"],["й","y"],["К","K"],["к","k"],["Л","L"],["л","l"],["М","M"],["м","m"],["Н","N"],["н","n"],["О","O"],["о","o"],["П","P"],["п","p"],["Р","R"],["р","r"],["С","S"],["с","s"],["Т","T"],["т","t"],["У","U"],["у","u"],["Ф","F"],["ф","f"],["Х","Kh"],["х","kh"],["Ц","Ts"],["ц","ts"],["Ч","Ch"],["ч","ch"],["Ш","Sh"],["ш","sh"],["Щ","Sch"],["щ","sch"],["Ъ",""],["ъ",""],["Ы","Y"],["ы","y"],["Ь",""],["ь",""],["Э","E"],["э","e"],["Ю","Yu"],["ю","yu"],["Я","Ya"],["я","ya"],["ă","a"],["Ă","A"],["ș","s"],["Ș","S"],["ț","t"],["Ț","T"],["ţ","t"],["Ţ","T"],["ş","s"],["Ş","S"],["ç","c"],["Ç","C"],["ğ","g"],["Ğ","G"],["ı","i"],["İ","I"],["ա","a"],["Ա","A"],["բ","b"],["Բ","B"],["գ","g"],["Գ","G"],["դ","d"],["Դ","D"],["ե","ye"],["Ե","Ye"],["զ","z"],["Զ","Z"],["է","e"],["Է","E"],["ը","y"],["Ը","Y"],["թ","t"],["Թ","T"],["ժ","zh"],["Ժ","Zh"],["ի","i"],["Ի","I"],["լ","l"],["Լ","L"],["խ","kh"],["Խ","Kh"],["ծ","ts"],["Ծ","Ts"],["կ","k"],["Կ","K"],["հ","h"],["Հ","H"],["ձ","dz"],["Ձ","Dz"],["ղ","gh"],["Ղ","Gh"],["ճ","tch"],["Ճ","Tch"],["մ","m"],["Մ","M"],["յ","y"],["Յ","Y"],["ն","n"],["Ն","N"],["շ","sh"],["Շ","Sh"],["ո","vo"],["Ո","Vo"],["չ","ch"],["Չ","Ch"],["պ","p"],["Պ","P"],["ջ","j"],["Ջ","J"],["ռ","r"],["Ռ","R"],["ս","s"],["Ս","S"],["վ","v"],["Վ","V"],["տ","t"],["Տ","T"],["ր","r"],["Ր","R"],["ց","c"],["Ց","C"],["ու","u"],["ՈՒ","U"],["Ու","U"],["փ","p"],["Փ","P"],["ք","q"],["Ք","Q"],["օ","o"],["Օ","O"],["ֆ","f"],["Ֆ","F"],["և","yev"],["ა","a"],["ბ","b"],["გ","g"],["დ","d"],["ე","e"],["ვ","v"],["ზ","z"],["თ","t"],["ი","i"],["კ","k"],["ლ","l"],["მ","m"],["ნ","n"],["ო","o"],["პ","p"],["ჟ","zh"],["რ","r"],["ს","s"],["ტ","t"],["უ","u"],["ფ","ph"],["ქ","q"],["ღ","gh"],["ყ","k"],["შ","sh"],["ჩ","ch"],["ც","ts"],["ძ","dz"],["წ","ts"],["ჭ","tch"],["ხ","kh"],["ჯ","j"],["ჰ","h"],["č","c"],["ď","d"],["ě","e"],["ň","n"],["ř","r"],["š","s"],["ť","t"],["ů","u"],["ž","z"],["Č","C"],["Ď","D"],["Ě","E"],["Ň","N"],["Ř","R"],["Š","S"],["Ť","T"],["Ů","U"],["Ž","Z"],["ހ","h"],["ށ","sh"],["ނ","n"],["ރ","r"],["ބ","b"],["ޅ","lh"],["ކ","k"],["އ","a"],["ވ","v"],["މ","m"],["ފ","f"],["ދ","dh"],["ތ","th"],["ލ","l"],["ގ","g"],["ޏ","gn"],["ސ","s"],["ޑ","d"],["ޒ","z"],["ޓ","t"],["ޔ","y"],["ޕ","p"],["ޖ","j"],["ޗ","ch"],["ޘ","tt"],["ޙ","hh"],["ޚ","kh"],["ޛ","th"],["ޜ","z"],["ޝ","sh"],["ޞ","s"],["ޟ","d"],["ޠ","t"],["ޡ","z"],["ޢ","a"],["ޣ","gh"],["ޤ","q"],["ޥ","w"],["ަ","a"],["ާ","aa"],["ި","i"],["ީ","ee"],["ު","u"],["ޫ","oo"],["ެ","e"],["ޭ","ey"],["ޮ","o"],["ޯ","oa"],["ް",""],["α","a"],["β","v"],["γ","g"],["δ","d"],["ε","e"],["ζ","z"],["η","i"],["θ","th"],["ι","i"],["κ","k"],["λ","l"],["μ","m"],["ν","n"],["ξ","ks"],["ο","o"],["π","p"],["ρ","r"],["σ","s"],["τ","t"],["υ","y"],["φ","f"],["χ","x"],["ψ","ps"],["ω","o"],["ά","a"],["έ","e"],["ί","i"],["ό","o"],["ύ","y"],["ή","i"],["ώ","o"],["ς","s"],["ϊ","i"],["ΰ","y"],["ϋ","y"],["ΐ","i"],["Α","A"],["Β","B"],["Γ","G"],["Δ","D"],["Ε","E"],["Ζ","Z"],["Η","I"],["Θ","TH"],["Ι","I"],["Κ","K"],["Λ","L"],["Μ","M"],["Ν","N"],["Ξ","KS"],["Ο","O"],["Π","P"],["Ρ","R"],["Σ","S"],["Τ","T"],["Υ","Y"],["Φ","F"],["Χ","X"],["Ψ","PS"],["Ω","O"],["Ά","A"],["Έ","E"],["Ί","I"],["Ό","O"],["Ύ","Y"],["Ή","I"],["Ώ","O"],["Ϊ","I"],["Ϋ","Y"],["ā","a"],["ē","e"],["ģ","g"],["ī","i"],["ķ","k"],["ļ","l"],["ņ","n"],["ū","u"],["Ā","A"],["Ē","E"],["Ģ","G"],["Ī","I"],["Ķ","K"],["Ļ","L"],["Ņ","N"],["Ū","U"],["č","c"],["š","s"],["ž","z"],["Č","C"],["Š","S"],["Ž","Z"],["ą","a"],["č","c"],["ę","e"],["ė","e"],["į","i"],["š","s"],["ų","u"],["ū","u"],["ž","z"],["Ą","A"],["Č","C"],["Ę","E"],["Ė","E"],["Į","I"],["Š","S"],["Ų","U"],["Ū","U"],["Ќ","Kj"],["ќ","kj"],["Љ","Lj"],["љ","lj"],["Њ","Nj"],["њ","nj"],["Тс","Ts"],["тс","ts"],["ą","a"],["ć","c"],["ę","e"],["ł","l"],["ń","n"],["ś","s"],["ź","z"],["ż","z"],["Ą","A"],["Ć","C"],["Ę","E"],["Ł","L"],["Ń","N"],["Ś","S"],["Ź","Z"],["Ż","Z"],["Є","Ye"],["І","I"],["Ї","Yi"],["Ґ","G"],["є","ye"],["і","i"],["ї","yi"],["ґ","g"],["IJ","IJ"],["ij","ij"],["¢","c"],["¥","Y"],["߿","b"],["৳","t"],["૱","Bo"],["฿","B"],["₠","CE"],["₡","C"],["₢","Cr"],["₣","F"],["₥","m"],["₦","N"],["₧","Pt"],["₨","Rs"],["₩","W"],["₫","s"],["€","E"],["₭","K"],["₮","T"],["₯","Dp"],["₰","S"],["₱","P"],["₲","G"],["₳","A"],["₴","S"],["₵","C"],["₶","tt"],["₷","S"],["₸","T"],["₹","R"],["₺","L"],["₽","P"],["₿","B"],["﹩","$"],["¢","c"],["¥","Y"],["₩","W"],["𝐀","A"],["𝐁","B"],["𝐂","C"],["𝐃","D"],["𝐄","E"],["𝐅","F"],["𝐆","G"],["𝐇","H"],["𝐈","I"],["𝐉","J"],["𝐊","K"],["𝐋","L"],["𝐌","M"],["𝐍","N"],["𝐎","O"],["𝐏","P"],["𝐐","Q"],["𝐑","R"],["𝐒","S"],["𝐓","T"],["𝐔","U"],["𝐕","V"],["𝐖","W"],["𝐗","X"],["𝐘","Y"],["𝐙","Z"],["𝐚","a"],["𝐛","b"],["𝐜","c"],["𝐝","d"],["𝐞","e"],["𝐟","f"],["𝐠","g"],["𝐡","h"],["𝐢","i"],["𝐣","j"],["𝐤","k"],["𝐥","l"],["𝐦","m"],["𝐧","n"],["𝐨","o"],["𝐩","p"],["𝐪","q"],["𝐫","r"],["𝐬","s"],["𝐭","t"],["𝐮","u"],["𝐯","v"],["𝐰","w"],["𝐱","x"],["𝐲","y"],["𝐳","z"],["𝐴","A"],["𝐵","B"],["𝐶","C"],["𝐷","D"],["𝐸","E"],["𝐹","F"],["𝐺","G"],["𝐻","H"],["𝐼","I"],["𝐽","J"],["𝐾","K"],["𝐿","L"],["𝑀","M"],["𝑁","N"],["𝑂","O"],["𝑃","P"],["𝑄","Q"],["𝑅","R"],["𝑆","S"],["𝑇","T"],["𝑈","U"],["𝑉","V"],["𝑊","W"],["𝑋","X"],["𝑌","Y"],["𝑍","Z"],["𝑎","a"],["𝑏","b"],["𝑐","c"],["𝑑","d"],["𝑒","e"],["𝑓","f"],["𝑔","g"],["𝑖","i"],["𝑗","j"],["𝑘","k"],["𝑙","l"],["𝑚","m"],["𝑛","n"],["𝑜","o"],["𝑝","p"],["𝑞","q"],["𝑟","r"],["𝑠","s"],["𝑡","t"],["𝑢","u"],["𝑣","v"],["𝑤","w"],["𝑥","x"],["𝑦","y"],["𝑧","z"],["𝑨","A"],["𝑩","B"],["𝑪","C"],["𝑫","D"],["𝑬","E"],["𝑭","F"],["𝑮","G"],["𝑯","H"],["𝑰","I"],["𝑱","J"],["𝑲","K"],["𝑳","L"],["𝑴","M"],["𝑵","N"],["𝑶","O"],["𝑷","P"],["𝑸","Q"],["𝑹","R"],["𝑺","S"],["𝑻","T"],["𝑼","U"],["𝑽","V"],["𝑾","W"],["𝑿","X"],["𝒀","Y"],["𝒁","Z"],["𝒂","a"],["𝒃","b"],["𝒄","c"],["𝒅","d"],["𝒆","e"],["𝒇","f"],["𝒈","g"],["𝒉","h"],["𝒊","i"],["𝒋","j"],["𝒌","k"],["𝒍","l"],["𝒎","m"],["𝒏","n"],["𝒐","o"],["𝒑","p"],["𝒒","q"],["𝒓","r"],["𝒔","s"],["𝒕","t"],["𝒖","u"],["𝒗","v"],["𝒘","w"],["𝒙","x"],["𝒚","y"],["𝒛","z"],["𝒜","A"],["𝒞","C"],["𝒟","D"],["𝒢","g"],["𝒥","J"],["𝒦","K"],["𝒩","N"],["𝒪","O"],["𝒫","P"],["𝒬","Q"],["𝒮","S"],["𝒯","T"],["𝒰","U"],["𝒱","V"],["𝒲","W"],["𝒳","X"],["𝒴","Y"],["𝒵","Z"],["𝒶","a"],["𝒷","b"],["𝒸","c"],["𝒹","d"],["𝒻","f"],["𝒽","h"],["𝒾","i"],["𝒿","j"],["𝓀","h"],["𝓁","l"],["𝓂","m"],["𝓃","n"],["𝓅","p"],["𝓆","q"],["𝓇","r"],["𝓈","s"],["𝓉","t"],["𝓊","u"],["𝓋","v"],["𝓌","w"],["𝓍","x"],["𝓎","y"],["𝓏","z"],["𝓐","A"],["𝓑","B"],["𝓒","C"],["𝓓","D"],["𝓔","E"],["𝓕","F"],["𝓖","G"],["𝓗","H"],["𝓘","I"],["𝓙","J"],["𝓚","K"],["𝓛","L"],["𝓜","M"],["𝓝","N"],["𝓞","O"],["𝓟","P"],["𝓠","Q"],["𝓡","R"],["𝓢","S"],["𝓣","T"],["𝓤","U"],["𝓥","V"],["𝓦","W"],["𝓧","X"],["𝓨","Y"],["𝓩","Z"],["𝓪","a"],["𝓫","b"],["𝓬","c"],["𝓭","d"],["𝓮","e"],["𝓯","f"],["𝓰","g"],["𝓱","h"],["𝓲","i"],["𝓳","j"],["𝓴","k"],["𝓵","l"],["𝓶","m"],["𝓷","n"],["𝓸","o"],["𝓹","p"],["𝓺","q"],["𝓻","r"],["𝓼","s"],["𝓽","t"],["𝓾","u"],["𝓿","v"],["𝔀","w"],["𝔁","x"],["𝔂","y"],["𝔃","z"],["𝔄","A"],["𝔅","B"],["𝔇","D"],["𝔈","E"],["𝔉","F"],["𝔊","G"],["𝔍","J"],["𝔎","K"],["𝔏","L"],["𝔐","M"],["𝔑","N"],["𝔒","O"],["𝔓","P"],["𝔔","Q"],["𝔖","S"],["𝔗","T"],["𝔘","U"],["𝔙","V"],["𝔚","W"],["𝔛","X"],["𝔜","Y"],["𝔞","a"],["𝔟","b"],["𝔠","c"],["𝔡","d"],["𝔢","e"],["𝔣","f"],["𝔤","g"],["𝔥","h"],["𝔦","i"],["𝔧","j"],["𝔨","k"],["𝔩","l"],["𝔪","m"],["𝔫","n"],["𝔬","o"],["𝔭","p"],["𝔮","q"],["𝔯","r"],["𝔰","s"],["𝔱","t"],["𝔲","u"],["𝔳","v"],["𝔴","w"],["𝔵","x"],["𝔶","y"],["𝔷","z"],["𝔸","A"],["𝔹","B"],["𝔻","D"],["𝔼","E"],["𝔽","F"],["𝔾","G"],["𝕀","I"],["𝕁","J"],["𝕂","K"],["𝕃","L"],["𝕄","M"],["𝕆","N"],["𝕊","S"],["𝕋","T"],["𝕌","U"],["𝕍","V"],["𝕎","W"],["𝕏","X"],["𝕐","Y"],["𝕒","a"],["𝕓","b"],["𝕔","c"],["𝕕","d"],["𝕖","e"],["𝕗","f"],["𝕘","g"],["𝕙","h"],["𝕚","i"],["𝕛","j"],["𝕜","k"],["𝕝","l"],["𝕞","m"],["𝕟","n"],["𝕠","o"],["𝕡","p"],["𝕢","q"],["𝕣","r"],["𝕤","s"],["𝕥","t"],["𝕦","u"],["𝕧","v"],["𝕨","w"],["𝕩","x"],["𝕪","y"],["𝕫","z"],["𝕬","A"],["𝕭","B"],["𝕮","C"],["𝕯","D"],["𝕰","E"],["𝕱","F"],["𝕲","G"],["𝕳","H"],["𝕴","I"],["𝕵","J"],["𝕶","K"],["𝕷","L"],["𝕸","M"],["𝕹","N"],["𝕺","O"],["𝕻","P"],["𝕼","Q"],["𝕽","R"],["𝕾","S"],["𝕿","T"],["𝖀","U"],["𝖁","V"],["𝖂","W"],["𝖃","X"],["𝖄","Y"],["𝖅","Z"],["𝖆","a"],["𝖇","b"],["𝖈","c"],["𝖉","d"],["𝖊","e"],["𝖋","f"],["𝖌","g"],["𝖍","h"],["𝖎","i"],["𝖏","j"],["𝖐","k"],["𝖑","l"],["𝖒","m"],["𝖓","n"],["𝖔","o"],["𝖕","p"],["𝖖","q"],["𝖗","r"],["𝖘","s"],["𝖙","t"],["𝖚","u"],["𝖛","v"],["𝖜","w"],["𝖝","x"],["𝖞","y"],["𝖟","z"],["𝖠","A"],["𝖡","B"],["𝖢","C"],["𝖣","D"],["𝖤","E"],["𝖥","F"],["𝖦","G"],["𝖧","H"],["𝖨","I"],["𝖩","J"],["𝖪","K"],["𝖫","L"],["𝖬","M"],["𝖭","N"],["𝖮","O"],["𝖯","P"],["𝖰","Q"],["𝖱","R"],["𝖲","S"],["𝖳","T"],["𝖴","U"],["𝖵","V"],["𝖶","W"],["𝖷","X"],["𝖸","Y"],["𝖹","Z"],["𝖺","a"],["𝖻","b"],["𝖼","c"],["𝖽","d"],["𝖾","e"],["𝖿","f"],["𝗀","g"],["𝗁","h"],["𝗂","i"],["𝗃","j"],["𝗄","k"],["𝗅","l"],["𝗆","m"],["𝗇","n"],["𝗈","o"],["𝗉","p"],["𝗊","q"],["𝗋","r"],["𝗌","s"],["𝗍","t"],["𝗎","u"],["𝗏","v"],["𝗐","w"],["𝗑","x"],["𝗒","y"],["𝗓","z"],["𝗔","A"],["𝗕","B"],["𝗖","C"],["𝗗","D"],["𝗘","E"],["𝗙","F"],["𝗚","G"],["𝗛","H"],["𝗜","I"],["𝗝","J"],["𝗞","K"],["𝗟","L"],["𝗠","M"],["𝗡","N"],["𝗢","O"],["𝗣","P"],["𝗤","Q"],["𝗥","R"],["𝗦","S"],["𝗧","T"],["𝗨","U"],["𝗩","V"],["𝗪","W"],["𝗫","X"],["𝗬","Y"],["𝗭","Z"],["𝗮","a"],["𝗯","b"],["𝗰","c"],["𝗱","d"],["𝗲","e"],["𝗳","f"],["𝗴","g"],["𝗵","h"],["𝗶","i"],["𝗷","j"],["𝗸","k"],["𝗹","l"],["𝗺","m"],["𝗻","n"],["𝗼","o"],["𝗽","p"],["𝗾","q"],["𝗿","r"],["𝘀","s"],["𝘁","t"],["𝘂","u"],["𝘃","v"],["𝘄","w"],["𝘅","x"],["𝘆","y"],["𝘇","z"],["𝘈","A"],["𝘉","B"],["𝘊","C"],["𝘋","D"],["𝘌","E"],["𝘍","F"],["𝘎","G"],["𝘏","H"],["𝘐","I"],["𝘑","J"],["𝘒","K"],["𝘓","L"],["𝘔","M"],["𝘕","N"],["𝘖","O"],["𝘗","P"],["𝘘","Q"],["𝘙","R"],["𝘚","S"],["𝘛","T"],["𝘜","U"],["𝘝","V"],["𝘞","W"],["𝘟","X"],["𝘠","Y"],["𝘡","Z"],["𝘢","a"],["𝘣","b"],["𝘤","c"],["𝘥","d"],["𝘦","e"],["𝘧","f"],["𝘨","g"],["𝘩","h"],["𝘪","i"],["𝘫","j"],["𝘬","k"],["𝘭","l"],["𝘮","m"],["𝘯","n"],["𝘰","o"],["𝘱","p"],["𝘲","q"],["𝘳","r"],["𝘴","s"],["𝘵","t"],["𝘶","u"],["𝘷","v"],["𝘸","w"],["𝘹","x"],["𝘺","y"],["𝘻","z"],["𝘼","A"],["𝘽","B"],["𝘾","C"],["𝘿","D"],["𝙀","E"],["𝙁","F"],["𝙂","G"],["𝙃","H"],["𝙄","I"],["𝙅","J"],["𝙆","K"],["𝙇","L"],["𝙈","M"],["𝙉","N"],["𝙊","O"],["𝙋","P"],["𝙌","Q"],["𝙍","R"],["𝙎","S"],["𝙏","T"],["𝙐","U"],["𝙑","V"],["𝙒","W"],["𝙓","X"],["𝙔","Y"],["𝙕","Z"],["𝙖","a"],["𝙗","b"],["𝙘","c"],["𝙙","d"],["𝙚","e"],["𝙛","f"],["𝙜","g"],["𝙝","h"],["𝙞","i"],["𝙟","j"],["𝙠","k"],["𝙡","l"],["𝙢","m"],["𝙣","n"],["𝙤","o"],["𝙥","p"],["𝙦","q"],["𝙧","r"],["𝙨","s"],["𝙩","t"],["𝙪","u"],["𝙫","v"],["𝙬","w"],["𝙭","x"],["𝙮","y"],["𝙯","z"],["𝙰","A"],["𝙱","B"],["𝙲","C"],["𝙳","D"],["𝙴","E"],["𝙵","F"],["𝙶","G"],["𝙷","H"],["𝙸","I"],["𝙹","J"],["𝙺","K"],["𝙻","L"],["𝙼","M"],["𝙽","N"],["𝙾","O"],["𝙿","P"],["𝚀","Q"],["𝚁","R"],["𝚂","S"],["𝚃","T"],["𝚄","U"],["𝚅","V"],["𝚆","W"],["𝚇","X"],["𝚈","Y"],["𝚉","Z"],["𝚊","a"],["𝚋","b"],["𝚌","c"],["𝚍","d"],["𝚎","e"],["𝚏","f"],["𝚐","g"],["𝚑","h"],["𝚒","i"],["𝚓","j"],["𝚔","k"],["𝚕","l"],["𝚖","m"],["𝚗","n"],["𝚘","o"],["𝚙","p"],["𝚚","q"],["𝚛","r"],["𝚜","s"],["𝚝","t"],["𝚞","u"],["𝚟","v"],["𝚠","w"],["𝚡","x"],["𝚢","y"],["𝚣","z"],["𝚤","l"],["𝚥","j"],["𝛢","A"],["𝛣","B"],["𝛤","G"],["𝛥","D"],["𝛦","E"],["𝛧","Z"],["𝛨","I"],["𝛩","TH"],["𝛪","I"],["𝛫","K"],["𝛬","L"],["𝛭","M"],["𝛮","N"],["𝛯","KS"],["𝛰","O"],["𝛱","P"],["𝛲","R"],["𝛳","TH"],["𝛴","S"],["𝛵","T"],["𝛶","Y"],["𝛷","F"],["𝛸","x"],["𝛹","PS"],["𝛺","O"],["𝛻","D"],["𝛼","a"],["𝛽","b"],["𝛾","g"],["𝛿","d"],["𝜀","e"],["𝜁","z"],["𝜂","i"],["𝜃","th"],["𝜄","i"],["𝜅","k"],["𝜆","l"],["𝜇","m"],["𝜈","n"],["𝜉","ks"],["𝜊","o"],["𝜋","p"],["𝜌","r"],["𝜍","s"],["𝜎","s"],["𝜏","t"],["𝜐","y"],["𝜑","f"],["𝜒","x"],["𝜓","ps"],["𝜔","o"],["𝜕","d"],["𝜖","E"],["𝜗","TH"],["𝜘","K"],["𝜙","f"],["𝜚","r"],["𝜛","p"],["𝜜","A"],["𝜝","V"],["𝜞","G"],["𝜟","D"],["𝜠","E"],["𝜡","Z"],["𝜢","I"],["𝜣","TH"],["𝜤","I"],["𝜥","K"],["𝜦","L"],["𝜧","M"],["𝜨","N"],["𝜩","KS"],["𝜪","O"],["𝜫","P"],["𝜬","S"],["𝜭","TH"],["𝜮","S"],["𝜯","T"],["𝜰","Y"],["𝜱","F"],["𝜲","X"],["𝜳","PS"],["𝜴","O"],["𝜵","D"],["𝜶","a"],["𝜷","v"],["𝜸","g"],["𝜹","d"],["𝜺","e"],["𝜻","z"],["𝜼","i"],["𝜽","th"],["𝜾","i"],["𝜿","k"],["𝝀","l"],["𝝁","m"],["𝝂","n"],["𝝃","ks"],["𝝄","o"],["𝝅","p"],["𝝆","r"],["𝝇","s"],["𝝈","s"],["𝝉","t"],["𝝊","y"],["𝝋","f"],["𝝌","x"],["𝝍","ps"],["𝝎","o"],["𝝏","a"],["𝝐","e"],["𝝑","i"],["𝝒","k"],["𝝓","f"],["𝝔","r"],["𝝕","p"],["𝝖","A"],["𝝗","B"],["𝝘","G"],["𝝙","D"],["𝝚","E"],["𝝛","Z"],["𝝜","I"],["𝝝","TH"],["𝝞","I"],["𝝟","K"],["𝝠","L"],["𝝡","M"],["𝝢","N"],["𝝣","KS"],["𝝤","O"],["𝝥","P"],["𝝦","R"],["𝝧","TH"],["𝝨","S"],["𝝩","T"],["𝝪","Y"],["𝝫","F"],["𝝬","X"],["𝝭","PS"],["𝝮","O"],["𝝯","D"],["𝝰","a"],["𝝱","v"],["𝝲","g"],["𝝳","d"],["𝝴","e"],["𝝵","z"],["𝝶","i"],["𝝷","th"],["𝝸","i"],["𝝹","k"],["𝝺","l"],["𝝻","m"],["𝝼","n"],["𝝽","ks"],["𝝾","o"],["𝝿","p"],["𝞀","r"],["𝞁","s"],["𝞂","s"],["𝞃","t"],["𝞄","y"],["𝞅","f"],["𝞆","x"],["𝞇","ps"],["𝞈","o"],["𝞉","a"],["𝞊","e"],["𝞋","i"],["𝞌","k"],["𝞍","f"],["𝞎","r"],["𝞏","p"],["𝞐","A"],["𝞑","V"],["𝞒","G"],["𝞓","D"],["𝞔","E"],["𝞕","Z"],["𝞖","I"],["𝞗","TH"],["𝞘","I"],["𝞙","K"],["𝞚","L"],["𝞛","M"],["𝞜","N"],["𝞝","KS"],["𝞞","O"],["𝞟","P"],["𝞠","S"],["𝞡","TH"],["𝞢","S"],["𝞣","T"],["𝞤","Y"],["𝞥","F"],["𝞦","X"],["𝞧","PS"],["𝞨","O"],["𝞩","D"],["𝞪","av"],["𝞫","g"],["𝞬","d"],["𝞭","e"],["𝞮","z"],["𝞯","i"],["𝞰","i"],["𝞱","th"],["𝞲","i"],["𝞳","k"],["𝞴","l"],["𝞵","m"],["𝞶","n"],["𝞷","ks"],["𝞸","o"],["𝞹","p"],["𝞺","r"],["𝞻","s"],["𝞼","s"],["𝞽","t"],["𝞾","y"],["𝞿","f"],["𝟀","x"],["𝟁","ps"],["𝟂","o"],["𝟃","a"],["𝟄","e"],["𝟅","i"],["𝟆","k"],["𝟇","f"],["𝟈","r"],["𝟉","p"],["𝟊","F"],["𝟋","f"],["⒜","(a)"],["⒝","(b)"],["⒞","(c)"],["⒟","(d)"],["⒠","(e)"],["⒡","(f)"],["⒢","(g)"],["⒣","(h)"],["⒤","(i)"],["⒥","(j)"],["⒦","(k)"],["⒧","(l)"],["⒨","(m)"],["⒩","(n)"],["⒪","(o)"],["⒫","(p)"],["⒬","(q)"],["⒭","(r)"],["⒮","(s)"],["⒯","(t)"],["⒰","(u)"],["⒱","(v)"],["⒲","(w)"],["⒳","(x)"],["⒴","(y)"],["⒵","(z)"],["Ⓐ","(A)"],["Ⓑ","(B)"],["Ⓒ","(C)"],["Ⓓ","(D)"],["Ⓔ","(E)"],["Ⓕ","(F)"],["Ⓖ","(G)"],["Ⓗ","(H)"],["Ⓘ","(I)"],["Ⓙ","(J)"],["Ⓚ","(K)"],["Ⓛ","(L)"],["Ⓝ","(N)"],["Ⓞ","(O)"],["Ⓟ","(P)"],["Ⓠ","(Q)"],["Ⓡ","(R)"],["Ⓢ","(S)"],["Ⓣ","(T)"],["Ⓤ","(U)"],["Ⓥ","(V)"],["Ⓦ","(W)"],["Ⓧ","(X)"],["Ⓨ","(Y)"],["Ⓩ","(Z)"],["ⓐ","(a)"],["ⓑ","(b)"],["ⓒ","(b)"],["ⓓ","(c)"],["ⓔ","(e)"],["ⓕ","(f)"],["ⓖ","(g)"],["ⓗ","(h)"],["ⓘ","(i)"],["ⓙ","(j)"],["ⓚ","(k)"],["ⓛ","(l)"],["ⓜ","(m)"],["ⓝ","(n)"],["ⓞ","(o)"],["ⓟ","(p)"],["ⓠ","(q)"],["ⓡ","(r)"],["ⓢ","(s)"],["ⓣ","(t)"],["ⓤ","(u)"],["ⓥ","(v)"],["ⓦ","(w)"],["ⓧ","(x)"],["ⓨ","(y)"],["ⓩ","(z)"],["Ċ","C"],["ċ","c"],["Ġ","G"],["ġ","g"],["Ħ","H"],["ħ","h"],["Ż","Z"],["ż","z"],["𝟎","0"],["𝟏","1"],["𝟐","2"],["𝟑","3"],["𝟒","4"],["𝟓","5"],["𝟔","6"],["𝟕","7"],["𝟖","8"],["𝟗","9"],["𝟘","0"],["𝟙","1"],["𝟚","2"],["𝟛","3"],["𝟜","4"],["𝟝","5"],["𝟞","6"],["𝟟","7"],["𝟠","8"],["𝟡","9"],["𝟢","0"],["𝟣","1"],["𝟤","2"],["𝟥","3"],["𝟦","4"],["𝟧","5"],["𝟨","6"],["𝟩","7"],["𝟪","8"],["𝟫","9"],["𝟬","0"],["𝟭","1"],["𝟮","2"],["𝟯","3"],["𝟰","4"],["𝟱","5"],["𝟲","6"],["𝟳","7"],["𝟴","8"],["𝟵","9"],["𝟶","0"],["𝟷","1"],["𝟸","2"],["𝟹","3"],["𝟺","4"],["𝟻","5"],["𝟼","6"],["𝟽","7"],["𝟾","8"],["𝟿","9"],["①","1"],["②","2"],["③","3"],["④","4"],["⑤","5"],["⑥","6"],["⑦","7"],["⑧","8"],["⑨","9"],["⑩","10"],["⑪","11"],["⑫","12"],["⑬","13"],["⑭","14"],["⑮","15"],["⑯","16"],["⑰","17"],["⑱","18"],["⑲","19"],["⑳","20"],["⑴","1"],["⑵","2"],["⑶","3"],["⑷","4"],["⑸","5"],["⑹","6"],["⑺","7"],["⑻","8"],["⑼","9"],["⑽","10"],["⑾","11"],["⑿","12"],["⒀","13"],["⒁","14"],["⒂","15"],["⒃","16"],["⒄","17"],["⒅","18"],["⒆","19"],["⒇","20"],["⒈","1."],["⒉","2."],["⒊","3."],["⒋","4."],["⒌","5."],["⒍","6."],["⒎","7."],["⒏","8."],["⒐","9."],["⒑","10."],["⒒","11."],["⒓","12."],["⒔","13."],["⒕","14."],["⒖","15."],["⒗","16."],["⒘","17."],["⒙","18."],["⒚","19."],["⒛","20."],["⓪","0"],["⓫","11"],["⓬","12"],["⓭","13"],["⓮","14"],["⓯","15"],["⓰","16"],["⓱","17"],["⓲","18"],["⓳","19"],["⓴","20"],["⓵","1"],["⓶","2"],["⓷","3"],["⓸","4"],["⓹","5"],["⓺","6"],["⓻","7"],["⓼","8"],["⓽","9"],["⓾","10"],["⓿","0"],["🙰","&"],["🙱","&"],["🙲","&"],["🙳","&"],["🙴","&"],["🙵","&"],["🙶",'"'],["🙷",'"'],["🙸",'"'],["‽","?!"],["🙹","?!"],["🙺","?!"],["🙻","?!"],["🙼","/"],["🙽","\\"],["🜇","AR"],["🜈","V"],["🜉","V"],["🜆","VR"],["🜅","VF"],["🜩","2"],["🜪","5"],["🝡","f"],["🝢","W"],["🝣","U"],["🝧","V"],["🝨","T"],["🝪","V"],["🝫","MB"],["🝬","VB"],["🝲","3B"],["🝳","3B"],["💯","100"],["🔙","BACK"],["🔚","END"],["🔛","ON!"],["🔜","SOON"],["🔝","TOP"],["🔞","18"],["🔤","abc"],["🔠","ABCD"],["🔡","abcd"],["🔢","1234"],["🔣","T&@%"],["#️⃣","#"],["*️⃣","*"],["0️⃣","0"],["1️⃣","1"],["2️⃣","2"],["3️⃣","3"],["4️⃣","4"],["5️⃣","5"],["6️⃣","6"],["7️⃣","7"],["8️⃣","8"],["9️⃣","9"],["🔟","10"],["🅰️","A"],["🅱️","B"],["🆎","AB"],["🆑","CL"],["🅾️","O"],["🅿","P"],["🆘","SOS"],["🅲","C"],["🅳","D"],["🅴","E"],["🅵","F"],["🅶","G"],["🅷","H"],["🅸","I"],["🅹","J"],["🅺","K"],["🅻","L"],["🅼","M"],["🅽","N"],["🆀","Q"],["🆁","R"],["🆂","S"],["🆃","T"],["🆄","U"],["🆅","V"],["🆆","W"],["🆇","X"],["🆈","Y"],["🆉","Z"]],m=[["&"," and "],["🦄"," unicorn "],["♥"," love "]];function g(e,t){if("string"!=typeof e)throw new TypeError(`Expected a string, got \`${typeof e}\``);const n=(t={separator:"-",lowercase:!0,decamelize:!0,customReplacements:[],preserveLeadingUnderscore:!1,preserveTrailingDash:!1,preserveCharacters:[],...t}).preserveLeadingUnderscore&&e.startsWith("_"),r=t.preserveTrailingDash&&e.endsWith("-");e=function(e,t){if("string"!=typeof e)throw new TypeError(`Expected a string, got \`${typeof e}\``);t={customReplacements:[],...t};const n=new Map([...f,...t.customReplacements]);return(e=((e,t)=>{for(const[n,r]of t)e=e.replace(new RegExp(p(n),"g"),r);return e})(e=e.normalize(),n)).normalize("NFD").replace(/\p{Diacritic}/gu,"").normalize()}(e,{customReplacements:new Map([...m,...t.customReplacements])}),t.decamelize&&(e=(e=>e.replace(/([A-Z]{2,})(\d+)/g,"$1 $2").replace(/([a-z\d]+)([A-Z]{2,})/g,"$1 $2").replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-rt-z\d]+)/g,"$1 $2"))(e));const i=(e=>{let t="a-z\\d";if(t+=e.lowercase?"":"A-Z",e.preserveCharacters.length>0)for(const n of e.preserveCharacters){if(n===e.separator)throw new Error(`The separator character \`${e.separator}\` cannot be included in preserved characters: ${e.preserveCharacters}`);t+=d(n)}return new RegExp(`[^${t}]+`,"g")})(t);return t.lowercase&&(e=e.toLowerCase()),e=(e=(e=e.replace(/([a-zA-Z\d]+)'([ts])(\s|$)/g,"$1$2$3")).replace(i,t.separator)).replace(/\\/g,""),t.separator&&(e=((e,t)=>{const n=d(t);return e.replace(new RegExp(`${n}{2,}`,"g"),t).replace(new RegExp(`^${n}|${n}$`,"g"),"")})(e,t.separator)),n&&(e=`_${e}`),r&&(e=`${e}-`),e}var y=n(7191),k=n(4285);var v=n(2780),w=n(6355),x=n(1104);const b={}.hasOwnProperty;function S(e){return String(e||"").toUpperCase()}function C(){return e=>{const t=function(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return(0,w.Vn)(e,"definition",(e=>{const n=S(e.identifier);n&&!b.call(t,n)&&(t[n]=e)})),function(e){const n=S(e);return n&&b.call(t,n)?t[n]:null}}(e);(0,w.Vn)(e,((e,n,r)=>{if("definition"===e.type&&null!==r&&"number"==typeof n)return r.children.splice(n,1),[x.AM,n];if("imageReference"===e.type||"linkReference"===e.type){const i=t(e.identifier);if(i&&null!==r&&"number"==typeof n){const t="imageReference"===e.type?{type:"image",url:i.url,title:i.title,alt:e.alt}:{type:"link",url:i.url,title:i.title,children:e.children};return r.children[n]=t,[x.AM,n]}}}))}}const M=(e,t)=>{var n;if(!(t.childCount>=1&&"hardbreak"===(null==(n=t.lastChild)?void 0:n.type.name)))return void e.next(t.content);const r=[];t.content.forEach(((e,n,i)=>{i!==t.childCount-1&&r.push(e)})),e.next(s.HY.fromArray(r))},O=(e,t)=>(Object.assign(e,{meta:{package:"@milkdown/preset-commonmark",...t}}),e),N=(0,r.we)("emphasis");O(N,{displayName:"Attr<emphasis>",group:"Emphasis"});const E=(0,r.c8)("emphasis",(e=>({inclusive:!1,parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:e=>"italic"===e}],toDOM:t=>["em",e.get(N.key)(t)],parseMarkdown:{match:e=>"emphasis"===e.type,runner:(e,t,n)=>{e.openMark(n),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"emphasis"===e.type.name,runner:(e,t)=>{e.withMark(t,"emphasis")}}})));O(E.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"}),O(E.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});const T=(0,r.r1)("ToggleEmphasis",(()=>()=>(0,o.w9)(E.type())));O(T,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});const A=(0,r.Gv)("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:e=>{const t=e.get(i.Xo);return()=>t.call(T.key)}}});O(A.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"}),O(A.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});const I=(0,r.we)("strong");O(I,{displayName:"Attr<strong>",group:"Strong"});const D=(0,r.c8)("strong",(e=>({inclusive:!1,parseDOM:[{tag:"b"},{tag:"strong"},{style:"font-style",getAttrs:e=>"bold"===e}],toDOM:t=>["strong",e.get(I.key)(t)],parseMarkdown:{match:e=>"strong"===e.type,runner:(e,t,n)=>{e.openMark(n),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"strong"===e.type.name,runner:(e,t)=>{e.withMark(t,"strong")}}})));O(D.mark,{displayName:"MarkSchema<strong>",group:"Strong"}),O(D.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});const F=(0,r.r1)("ToggleStrong",(()=>()=>(0,o.w9)(D.type())));O(F,{displayName:"Command<toggleStrongCommand>",group:"Strong"});const R=(0,r.Gv)("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:e=>{const t=e.get(i.Xo);return()=>t.call(F.key)}}});O(R.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"}),O(R.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});const P=(0,r.we)("inlineCode");O(P,{displayName:"Attr<inlineCode>",group:"InlineCode"});const z=(0,r.c8)("inlineCode",(e=>({priority:100,code:!0,inclusive:!1,parseDOM:[{tag:"code"}],toDOM:t=>["code",e.get(P.key)(t)],parseMarkdown:{match:e=>"inlineCode"===e.type,runner:(e,t,n)=>{e.openMark(n),e.addText(t.value),e.closeMark(n)}},toMarkdown:{match:e=>"inlineCode"===e.type.name,runner:(e,t,n)=>{e.withMark(t,"inlineCode",n.text||"")}}})));O(z.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"}),O(z.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});const B=(0,r.r1)("ToggleInlineCode",(()=>()=>(e,t)=>{const{selection:n,tr:r}=e;if(n.empty)return!1;const{from:i,to:o}=n;return e.doc.rangeHasMark(i,o,z.type())?(null==t||t(r.removeMark(i,o,z.type())),!0):(Object.keys(e.schema.marks).filter((e=>e!==z.type.name)).map((t=>e.schema.marks[t])).forEach((e=>{r.removeMark(i,o,e)})),null==t||t(r.addMark(i,o,z.type().create())),!0)}));O(B,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});const L=(0,r.Gv)("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:e=>{const t=e.get(i.Xo);return()=>t.call(B.key)}}});O(L.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"}),O(L.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});const j=(0,r.we)("link");O(j,{displayName:"Attr<link>",group:"Link"});const $=(0,r.c8)("link",(e=>({attrs:{href:{},title:{default:null}},parseDOM:[{tag:"a[href]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.GZ)(e);return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM:t=>["a",{...e.get(j.key)(t),...t.attrs}],parseMarkdown:{match:e=>"link"===e.type,runner:(e,t,n)=>{const r=t.url,i=t.title;e.openMark(n,{href:r,title:i}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"link"===e.type.name,runner:(e,t)=>{e.withMark(t,"link",void 0,{title:t.attrs.title,url:t.attrs.href})}}})));O($.mark,{displayName:"MarkSchema<link>",group:"Link"});const V=(0,r.r1)("ToggleLink",(()=>(e={})=>(0,o.w9)($.type(),e)));O(V,{displayName:"Command<toggleLinkCommand>",group:"Link"});const H=(0,r.r1)("UpdateLink",(()=>(e={})=>(t,n)=>{if(!n)return!1;let r,i=-1;const{selection:o}=t,{from:s,to:a}=o;if(t.doc.nodesBetween(s,s===a?a+1:a,((e,t)=>{if($.type().isInSet(e.marks))return r=e,i=t,!1})),!r)return!1;const l=r.marks.find((({type:e})=>e===$.type()));if(!l)return!1;const c=i,u=i+r.nodeSize,{tr:h}=t,d=$.type().create({...l.attrs,...e});return!!d&&(n(h.removeMark(c,u,l).addMark(c,u,d).setSelection(new y.Bs(h.selection.$anchor)).scrollIntoView()),!0)}));O(H,{displayName:"Command<updateLinkCommand>",group:"Link"});const q=(0,r.qT)("doc",(()=>({content:"block+",parseMarkdown:{match:({type:e})=>"root"===e,runner:(e,t,n)=>{e.injectRoot(t,n)}},toMarkdown:{match:e=>"doc"===e.type.name,runner:(e,t)=>{e.openNode("root"),e.next(t.content)}}})));O(q,{displayName:"NodeSchema<doc>",group:"Doc"});const W=(0,r.jO)("paragraph");O(W,{displayName:"Attr<paragraph>",group:"Paragraph"});const _=(0,r.yU)("paragraph",(e=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:t=>["p",e.get(W.key)(t),0],parseMarkdown:{match:e=>"paragraph"===e.type,runner:(e,t,n)=>{e.openNode(n),t.children?e.next(t.children):e.addText(t.value||""),e.closeNode()}},toMarkdown:{match:e=>"paragraph"===e.type.name,runner:(e,t)=>{e.openNode("paragraph"),M(e,t),e.closeNode()}}})));O(_.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"}),O(_.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});const K=(0,r.r1)("TurnIntoText",(()=>()=>(0,o.uJ)(_.type())));O(K,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});const U=(0,r.Gv)("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:e=>{const t=e.get(i.Xo);return()=>t.call(K.key)}}});O(U.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"}),O(U.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});const Y=Array(6).fill(0).map(((e,t)=>t+1)),J=(0,r.Tu)((e=>g(e.textContent)),"headingIdGenerator");O(J,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});const G=(0,r.jO)("heading");O(G,{displayName:"Attr<heading>",group:"Heading"});const Z=(0,r.yU)("heading",(e=>{const t=e.get(J.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:""},level:{default:1}},parseDOM:Y.map((e=>({tag:`h${e}`,getAttrs:t=>{if(!(t instanceof HTMLElement))throw(0,a.GZ)(t);return{level:e,id:t.id}}}))),toDOM:n=>[`h${n.attrs.level}`,{...e.get(G.key)(n),id:n.attrs.id||t(n)},0],parseMarkdown:{match:({type:e})=>"heading"===e,runner:(e,t,n)=>{const r=t.depth;e.openNode(n,{level:r}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"heading"===e.type.name,runner:(e,t)=>{e.openNode("heading",void 0,{depth:t.attrs.level}),M(e,t),e.closeNode()}}}}));O(Z.node,{displayName:"NodeSchema<heading>",group:"Heading"}),O(Z.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});const X=(0,r.Xt)((e=>h(/^(?<hashes>#+)\s$/,Z.type(),(t=>{var n,r;const o=(null==(r=null==(n=t.groups)?void 0:n.hashes)?void 0:r.length)||0,s=e.get(i.U7),{$from:a}=s.state.selection,l=a.node();if("heading"===l.type.name){let e=Number(l.attrs.level)+Number(o);return e>6&&(e=6),{level:e}}return{level:o}}))));O(X,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});const Q=(0,r.r1)("WrapInHeading",(()=>e=>(e??(e=1),e<1?(0,o.uJ)(_.type()):(0,o.uJ)(Z.type(),{level:e}))));O(Q,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});const ee=(0,r.r1)("DowngradeHeading",(()=>()=>(e,t,n)=>{const{$from:r}=e.selection,i=r.node();if(i.type!==Z.type()||!e.selection.empty||0!==r.parentOffset)return!1;const s=i.attrs.level-1;return s?(null==t||t(e.tr.setNodeMarkup(e.selection.$from.before(),void 0,{...i.attrs,level:s})),!0):(0,o.uJ)(_.type())(e,t,n)}));O(ee,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});const te=(0,r.Gv)("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:e=>{const t=e.get(i.Xo);return()=>t.call(Q.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:e=>{const t=e.get(i.Xo);return()=>t.call(Q.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:e=>{const t=e.get(i.Xo);return()=>t.call(Q.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:e=>{const t=e.get(i.Xo);return()=>t.call(Q.key,3)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:e=>{const t=e.get(i.Xo);return()=>t.call(Q.key,3)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:e=>{const t=e.get(i.Xo);return()=>t.call(Q.key,3)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:e=>{const t=e.get(i.Xo);return()=>t.call(ee.key)}}});O(te.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"}),O(te.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});const ne=(0,r.jO)("blockquote");O(ne,{displayName:"Attr<blockquote>",group:"Blockquote"});const re=(0,r.yU)("blockquote",(e=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:t=>["blockquote",e.get(ne.key)(t),0],parseMarkdown:{match:({type:e})=>"blockquote"===e,runner:(e,t,n)=>{e.openNode(n).next(t.children).closeNode()}},toMarkdown:{match:e=>"blockquote"===e.type.name,runner:(e,t)=>{e.openNode("blockquote").next(t.content).closeNode()}}})));O(re.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"}),O(re.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});const ie=(0,r.Xt)((()=>u(/^\s*>\s$/,re.type())));O(ie,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});const oe=(0,r.r1)("WrapInBlockquote",(()=>()=>(0,o.ym)(re.type())));O(oe,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});const se=(0,r.Gv)("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:e=>{const t=e.get(i.Xo);return()=>t.call(oe.key)}}});O(se.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"}),O(se.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});const ae=(0,r.jO)("codeBlock",(()=>({pre:{},code:{}})));O(ae,{displayName:"Attr<codeBlock>",group:"CodeBlock"});const le=(0,r.yU)("code_block",(e=>({content:"text*",group:"block",marks:"",defining:!0,code:!0,attrs:{language:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.GZ)(e);return{language:e.dataset.language}}}],toDOM:t=>{const n=e.get(ae.key)(t);return["pre",{...n.pre,"data-language":t.attrs.language},["code",n.code,0]]},parseMarkdown:{match:({type:e})=>"code"===e,runner:(e,t,n)=>{const r=t.lang,i=t.value;e.openNode(n,{language:r}),i&&e.addText(i),e.closeNode()}},toMarkdown:{match:e=>"code_block"===e.type.name,runner:(e,t)=>{var n;e.addNode("code",void 0,(null==(n=t.content.firstChild)?void 0:n.text)||"",{lang:t.attrs.language})}}})));O(le.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"}),O(le.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});const ce=(0,r.Xt)((()=>h(/^```(?<language>[a-z]*)?[\s\n]$/,le.type(),(e=>{var t;return{language:(null==(t=e.groups)?void 0:t.language)??""}}))));O(ce,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});const ue=(0,r.r1)("CreateCodeBlock",(()=>(e="")=>(0,o.uJ)(le.type(),{language:e})));O(ue,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"}),O((0,r.r1)("UpdateCodeBlockLanguage",(()=>({pos:e,language:t}={pos:-1,language:""})=>(n,r)=>e>=0&&(null==r||r(n.tr.setNodeAttribute(e,"language",t)),!0))),{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});const he=(0,r.Gv)("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:e=>{const t=e.get(i.Xo);return()=>t.call(ue.key)}}});O(he.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"}),O(he.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});const de=(0,r.jO)("image");O(de,{displayName:"Attr<image>",group:"Image"});const pe=(0,r.yU)("image",(e=>({inline:!0,group:"inline",selectable:!0,draggable:!0,marks:"",atom:!0,defining:!0,isolating:!0,attrs:{src:{default:""},alt:{default:""},title:{default:""}},parseDOM:[{tag:"img[src]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.GZ)(e);return{src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",title:e.getAttribute("title")||e.getAttribute("alt")||""}}}],toDOM:t=>["img",{...e.get(de.key)(t),...t.attrs}],parseMarkdown:{match:({type:e})=>"image"===e,runner:(e,t,n)=>{const r=t.url,i=t.alt,o=t.title;e.addNode(n,{src:r,alt:i,title:o})}},toMarkdown:{match:e=>"image"===e.type.name,runner:(e,t)=>{e.addNode("image",void 0,void 0,{title:t.attrs.title,url:t.attrs.src,alt:t.attrs.alt})}}})));O(pe.node,{displayName:"NodeSchema<image>",group:"Image"}),O(pe.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});const fe=(0,r.r1)("InsertImage",(()=>(e={})=>(t,n)=>{if(!n)return!0;const{src:r="",alt:i="",title:o=""}=e,s=pe.type().create({src:r,alt:i,title:o});return s&&n(t.tr.replaceSelectionWith(s).scrollIntoView()),!0}));O(fe,{displayName:"Command<insertImageCommand>",group:"Image"});const me=(0,r.r1)("UpdateImage",(()=>(e={})=>(t,n)=>{const r=(0,k.a1)(t.selection,pe.type());if(!r)return!1;const{node:i,pos:o}=r,s={...i.attrs},{src:a,alt:l,title:c}=e;return void 0!==a&&(s.src=a),void 0!==l&&(s.alt=l),void 0!==c&&(s.title=c),null==n||n(t.tr.setNodeMarkup(o,void 0,s).scrollIntoView()),!0}));O(me,{displayName:"Command<updateImageCommand>",group:"Image"}),O((0,r.Xt)((()=>new c(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,((e,t,n,r)=>{const[i,o,s="",a]=t;return i?e.tr.replaceWith(n,r,pe.type().create({src:s,alt:o,title:a})):null})))),{displayName:"InputRule<insertImageInputRule>",group:"Image"});const ge=(0,r.jO)("hardbreak",(e=>({"data-is-inline":e.attrs.isInline})));O(ge,{displayName:"Attr<hardbreak>",group:"Hardbreak"});const ye=(0,r.yU)("hardbreak",(e=>({inline:!0,group:"inline",attrs:{isInline:{default:!1}},selectable:!1,parseDOM:[{tag:"br"}],toDOM:t=>["br",e.get(ge.key)(t)],parseMarkdown:{match:({type:e})=>"break"===e,runner:(e,t,n)=>{var r;e.addNode(n,{isInline:Boolean(null==(r=t.data)?void 0:r.isInline)})}},leafText:()=>"\n",toMarkdown:{match:e=>"hardbreak"===e.type.name,runner:(e,t)=>{t.attrs.isInline?e.addNode("text",void 0,"\n"):e.addNode("break")}}})));O(ye.node,{displayName:"NodeSchema<hardbreak>",group:"Hardbreak"}),O(ye.ctx,{displayName:"NodeSchemaCtx<hardbreak>",group:"Hardbreak"});const ke=(0,r.r1)("InsertHardbreak",(()=>()=>(e,t)=>{var n;const{selection:r,tr:i}=e;if(r.empty){const o=r.$from.node();if(o.childCount>0&&"hardbreak"===(null==(n=o.lastChild)?void 0:n.type.name))return null==t||t(i.replaceRangeWith(r.to-1,r.to,e.schema.node("paragraph")).setSelection(y.Y1.near(i.doc.resolve(r.to))).scrollIntoView()),!0}return null==t||t(i.setMeta("hardbreak",!0).replaceSelectionWith(ye.type().create()).scrollIntoView()),!0}));O(ke,{displayName:"Command<insertHardbreakCommand>",group:"Hardbreak"});const ve=(0,r.Gv)("hardbreakKeymap",{InsertHardbreak:{shortcuts:"Shift-Enter",command:e=>{const t=e.get(i.Xo);return()=>t.call(ke.key)}}});O(ve.ctx,{displayName:"KeymapCtx<hardbreak>",group:"Hardbreak"}),O(ve.shortcuts,{displayName:"Keymap<hardbreak>",group:"Hardbreak"});const we=(0,r.jO)("hr");O(we,{displayName:"Attr<hr>",group:"Hr"});const xe=(0,r.yU)("hr",(e=>({group:"block",parseDOM:[{tag:"hr"}],toDOM:t=>["hr",e.get(we.key)(t)],parseMarkdown:{match:({type:e})=>"thematicBreak"===e,runner:(e,t,n)=>{e.addNode(n)}},toMarkdown:{match:e=>"hr"===e.type.name,runner:e=>{e.addNode("thematicBreak")}}})));O(xe.node,{displayName:"NodeSchema<hr>",group:"Hr"}),O(xe.ctx,{displayName:"NodeSchemaCtx<hr>",group:"Hr"});const be=(0,r.Xt)((()=>new c(/^(?:---|___\s|\*\*\*\s)$/,((e,t,n,r)=>{const{tr:i}=e;return t[0]&&i.replaceWith(n-1,r,xe.type().create()),i}))));O(be,{displayName:"InputRule<insertHrInputRule>",group:"Hr"});const Se=(0,r.r1)("InsertHr",(()=>()=>(e,t)=>{if(!t)return!0;const n=_.node.type().create(),{tr:r,selection:i}=e,{from:o}=i,s=xe.type().create();if(!s)return!0;const a=r.replaceSelectionWith(s).insert(o,n),l=y.Y1.findFrom(a.doc.resolve(o),1,!0);return l&&t(a.setSelection(l).scrollIntoView()),!0}));O(Se,{displayName:"Command<insertHrCommand>",group:"Hr"});const Ce=(0,r.jO)("bulletList");O(Ce,{displayName:"Attr<bulletList>",group:"BulletList"});const Me=(0,r.yU)("bullet_list",(e=>({content:"listItem+",group:"block",attrs:{spread:{default:!1}},parseDOM:[{tag:"ul",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.GZ)(e);return{spread:e.dataset.spread}}}],toDOM:t=>["ul",{...e.get(Ce.key)(t),"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>"list"===e&&!t,runner:(e,t,n)=>{const r=null!=t.spread?`${t.spread}`:"false";e.openNode(n,{spread:r}).next(t.children).closeNode()}},toMarkdown:{match:e=>"bullet_list"===e.type.name,runner:(e,t)=>{e.openNode("list",void 0,{ordered:!1,spread:"true"===t.attrs.spread}).next(t.content).closeNode()}}})));O(Me.node,{displayName:"NodeSchema<bulletList>",group:"BulletList"}),O(Me.ctx,{displayName:"NodeSchemaCtx<bulletList>",group:"BulletList"});const Oe=(0,r.Xt)((()=>u(/^\s*([-+*])\s$/,Me.type())));O(Oe,{displayName:"InputRule<wrapInBulletListInputRule>",group:"BulletList"});const Ne=(0,r.r1)("WrapInBulletList",(()=>()=>(0,o.ym)(Me.type())));O(Ne,{displayName:"Command<wrapInBulletListCommand>",group:"BulletList"});const Ee=(0,r.Gv)("bulletListKeymap",{WrapInBulletList:{shortcuts:"Mod-Alt-8",command:e=>{const t=e.get(i.Xo);return()=>t.call(Ne.key)}}});O(Ee.ctx,{displayName:"KeymapCtx<bulletListKeymap>",group:"BulletList"}),O(Ee.shortcuts,{displayName:"Keymap<bulletListKeymap>",group:"BulletList"});const Te=(0,r.jO)("orderedList");O(Te,{displayName:"Attr<orderedList>",group:"OrderedList"});const Ae=(0,r.yU)("ordered_list",(e=>({content:"listItem+",group:"block",attrs:{order:{default:1},spread:{default:!1}},parseDOM:[{tag:"ol",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.GZ)(e);return{spread:e.dataset.spread,order:e.hasAttribute("start")?Number(e.getAttribute("start")):1}}}],toDOM:t=>["ol",{...e.get(Te.key)(t),...1===t.attrs.order?{}:t.attrs.order,"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>"list"===e&&!!t,runner:(e,t,n)=>{const r=null!=t.spread?`${t.spread}`:"true";e.openNode(n,{spread:r}).next(t.children).closeNode()}},toMarkdown:{match:e=>"ordered_list"===e.type.name,runner:(e,t)=>{e.openNode("list",void 0,{ordered:!0,start:1,spread:"true"===t.attrs.spread}),e.next(t.content),e.closeNode()}}})));O(Ae.node,{displayName:"NodeSchema<orderedList>",group:"OrderedList"}),O(Ae.ctx,{displayName:"NodeSchemaCtx<orderedList>",group:"OrderedList"});const Ie=(0,r.Xt)((()=>u(/^\s*(\d+)\.\s$/,Ae.type(),(e=>({order:Number(e[1])})),((e,t)=>t.childCount+t.attrs.order===Number(e[1])))));O(Ie,{displayName:"InputRule<wrapInOrderedListInputRule>",group:"OrderedList"});const De=(0,r.r1)("WrapInOrderedList",(()=>()=>(0,o.ym)(Ae.type())));O(De,{displayName:"Command<wrapInOrderedListCommand>",group:"OrderedList"});const Fe=(0,r.Gv)("orderedListKeymap",{WrapInOrderedList:{shortcuts:"Mod-Alt-7",command:e=>{const t=e.get(i.Xo);return()=>t.call(De.key)}}});O(Fe.ctx,{displayName:"KeymapCtx<orderedList>",group:"OrderedList"}),O(Fe.shortcuts,{displayName:"Keymap<orderedList>",group:"OrderedList"});const Re=(0,r.jO)("listItem");O(Re,{displayName:"Attr<listItem>",group:"ListItem"});const Pe=(0,r.yU)("list_item",(e=>({group:"listItem",content:"paragraph block*",attrs:{label:{default:"•"},listType:{default:"bullet"},spread:{default:"true"}},defining:!0,parseDOM:[{tag:"li",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,a.GZ)(e);return{label:e.dataset.label,listType:e.dataset["list-type"],spread:e.dataset.spread}}}],toDOM:t=>["li",{...e.get(Re.key)(t),"data-label":t.attrs.label,"data-list-type":t.attrs.listType,"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e})=>"listItem"===e,runner:(e,t,n)=>{const r=null!=t.label?`${t.label}.`:"•",i=null!=t.label?"ordered":"bullet",o=null!=t.spread?`${t.spread}`:"true";e.openNode(n,{label:r,listType:i,spread:o}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"list_item"===e.type.name,runner:(e,t)=>{e.openNode("listItem",void 0,{spread:"true"===t.attrs.spread}),e.next(t.content),e.closeNode()}}})));O(Pe.node,{displayName:"NodeSchema<listItem>",group:"ListItem"}),O(Pe.ctx,{displayName:"NodeSchemaCtx<listItem>",group:"ListItem"});const ze=(0,r.r1)("SinkListItem",(()=>()=>{return e=Pe.type(),function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==e));if(!o)return!1;let a=o.startIndex;if(0==a)return!1;let c=o.parent,u=c.child(a-1);if(u.type!=e)return!1;if(n){let r=u.lastChild&&u.lastChild.type==c.type,i=s.HY.from(r?e.create():null),a=new s.p2(s.HY.from(e.create(null,s.HY.from(c.type.create(null,i)))),r?3:1,0),h=o.start,d=o.end;n(t.tr.step(new l.FC(h-(r?3:1),d,h,d,a,1,!0)).scrollIntoView())}return!0};var e}));O(ze,{displayName:"Command<sinkListItemCommand>",group:"ListItem"});const Be=(0,r.r1)("SplitListItem",(()=>()=>{return e=Pe.type(),function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==e));return!!o&&(!n||(r.node(o.depth-1).type==e?function(e,t,n,r){let i=e.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new l.FC(o-1,a,o,a,new s.p2(s.HY.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new s.Ts(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const c=(0,l.k9)(r);if(null==c)return!1;i.lift(r,c);let u=i.mapping.map(o,-1)-1;return(0,l.Mn)(i.doc,u)&&i.join(u),t(i.scrollIntoView()),!0}(t,n,e,o):function(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,o=n.startIndex;t>o;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let o=r.doc.resolve(n.start),a=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let c=0==n.startIndex,u=n.endIndex==i.childCount,h=o.node(-1),d=o.index(-1);if(!h.canReplace(d+(c?0:1),d+1,a.content.append(u?s.HY.empty:s.HY.from(i))))return!1;let p=o.pos,f=p+a.nodeSize;return r.step(new l.FC(p-(c?1:0),f+(u?1:0),p+1,f-1,new s.p2((c?s.HY.empty:s.HY.from(i.copy(s.HY.empty))).append(u?s.HY.empty:s.HY.from(i.copy(s.HY.empty))),c?0:1,u?0:1),c?0:1)),t(r.scrollIntoView()),!0}(t,n,o)))};var e}));O(Be,{displayName:"Command<liftListItemCommand>",group:"ListItem"});const Le=(0,r.r1)("SplitListItem",(()=>()=>{return e=Pe.type(),function(t,n){let{$from:r,$to:i,node:o}=t.selection;if(o&&o.isBlock||r.depth<2||!r.sameParent(i))return!1;let a=r.node(-1);if(a.type!=e)return!1;if(0==r.parent.content.size&&r.node(-1).childCount==r.indexAfter(-1)){if(3==r.depth||r.node(-3).type!=e||r.index(-2)!=r.node(-2).childCount-1)return!1;if(n){let i=s.HY.empty,o=r.index(-1)?1:r.index(-2)?2:3;for(let e=r.depth-o;e>=r.depth-3;e--)i=s.HY.from(r.node(e).copy(i));let a=r.indexAfter(-1)<r.node(-2).childCount?1:r.indexAfter(-2)<r.node(-3).childCount?2:3;i=i.append(s.HY.from(e.createAndFill()));let l=r.before(r.depth-(o-1)),c=t.tr.replace(l,r.after(-a),new s.p2(i,4-o,0)),u=-1;c.doc.nodesBetween(l,c.doc.content.size,((e,t)=>{if(u>-1)return!1;e.isTextblock&&0==e.content.size&&(u=t+1)})),u>-1&&c.setSelection(y.Y1.near(c.doc.resolve(u))),n(c.scrollIntoView())}return!0}let c=i.pos==r.end()?a.contentMatchAt(0).defaultType:null,u=t.tr.delete(r.pos,i.pos),h=c?[null,{type:c}]:void 0;return!!(0,l.Ax)(u.doc,r.pos,2,h)&&(n&&n(u.split(r.pos,2,h).scrollIntoView()),!0)};var e}));O(Le,{displayName:"Command<splitListItemCommand>",group:"ListItem"});const je=(0,r.Gv)("listItemKeymap",{NextListItem:{shortcuts:"Enter",command:e=>{const t=e.get(i.Xo);return()=>t.call(Le.key)}},SinkListItem:{shortcuts:["Tab","Mod-]"],command:e=>{const t=e.get(i.Xo);return()=>t.call(ze.key)}},LiftListItem:{shortcuts:["Shift-Tab","Mod-["],command:e=>{const t=e.get(i.Xo);return()=>t.call(Be.key)}}});O(je.ctx,{displayName:"KeymapCtx<listItem>",group:"ListItem"}),O(je.shortcuts,{displayName:"Keymap<listItem>",group:"ListItem"});const $e=(0,r.qT)("text",(()=>({group:"inline",parseMarkdown:{match:({type:e})=>"text"===e,runner:(e,t)=>{e.addText(t.value)}},toMarkdown:{match:e=>"text"===e.type.name,runner:(e,t)=>{e.addNode("text",void 0,t.text)}}})));O($e,{displayName:"NodeSchema<text>",group:"Text"});const Ve=(0,r.jO)("html");O(Ve,{displayName:"Attr<html>",group:"Html"});const He=(0,r.yU)("html",(e=>({atom:!0,group:"inline",inline:!0,attrs:{value:{default:""}},toDOM:t=>{const n=document.createElement("span"),r={...e.get(Ve.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})=>Boolean("html"===e),runner:(e,t,n)=>{e.addNode(n,{value:t.value})}},toMarkdown:{match:e=>"html"===e.type.name,runner:(e,t)=>{e.addNode("html",void 0,t.attrs.value)}}})));O(He.node,{displayName:"NodeSchema<html>",group:"Html"}),O(He.ctx,{displayName:"NodeSchemaCtx<html>",group:"Html"});const qe=[q,W,_,J,G,Z,ge,ye,ne,re,ae,le,we,xe,de,pe,Ce,Me,Te,Ae,Re,Pe,N,E,I,D,P,z,j,$,Ve,He,$e].flat(),We=[ie,Oe,Ie,ce,be,X].flat(),_e=[K,oe,Q,ee,ue,ke,Se,fe,me,De,Ne,ze,Le,Be,T,B,F,V,H],Ke=[se,he,ve,te,je,Fe,Ee,U,A,L,R].flat(),Ue=/\[(?<span>((www|https:\/\/|http:\/\/)[^\s\]]+))]\((?<url>[^\s\]]+)\)/,Ye=e=>{let t=e,n=t.match(Ue);for(;n&&n.groups;){const{span:e}=n.groups;t=t.replace(Ue,e),n=t.match(Ue)}return t},Je=(e,t,n)=>{const r=e.split(""),i=r[t];return r[t]&&r[n]&&(r[t]=r[n],r[n]=i),r.join("").toString()},Ge={placeholderConfig:{hole:"∅",punctuation:"⁂",char:"∴"},globalNodes:["footnote_definition"],shouldSyncNode:({prevNode:e,nextNode:t})=>e.inlineContent&&t&&e.type===t.type&&!e.eq(t),movePlaceholder:(e,t)=>{const n=["*","_"];let r=t.indexOf(e);for(;n.includes(t[r-1]||"")&&n.includes(t[r+1]||"");)t=Je(t,r,r+1),r+=1;return t}},Ze=(0,r.Tu)(Ge,"inlineSyncConfig");O(Ze,{displayName:"Ctx<inlineSyncConfig>",group:"Prose"});const Xe=e=>e.split("\n\n")[0]||"",Qe=(e,t)=>{try{const n=((e,t)=>{const{globalNodes:n}=e.get(Ze.key),r=[];return t.doc.descendants((e=>{if(n.includes(e.type.name)||n.includes(e.type))return r.push(e),!1})),r})(e,t),o=(e=>e.selection.$from.node())(t),s=((e,t,n,r)=>e.get(i.Ck)(t.schema.topNodeType.create(void 0,[n,...r])))(e,t,o,n),[a,l]=((e,t)=>{const n=e.get(Ze.key),i=n.placeholderConfig.hole,[o="",...s]=t.split("\n\n");let a=(0,r.zG)((e=>t=>t.replace((e=>new RegExp(`\\\\(?=[^\\w\\s${e}\\\\]|_)`,"g"))(e),""))(i),(e=>n.movePlaceholder(i,e)),Ye)(o);const l=(e=>t=>{const n=t.indexOf(e.hole),r=t.charAt(n-1),i=t.charAt(n+1),o=/[^\w]|_/;return i?r&&o.test(r)&&o.test(i)?e.punctuation:e.char:e.punctuation})(n.placeholderConfig)(a);return a=a.replace(i,l),a=[a,...s].join("\n\n"),[a,l]})(e,s),c=((e,t)=>{const n=e.get(i._z)(t);return n?n.firstChild:null})(e,a);return!c||o.type!==c.type||(e=>1===e.childCount&&"html"===e.child(0).type.name)(c)?null:(c.attrs={...o.attrs},c.descendants((e=>{var t;const n=e.marks.find((e=>"link"===e.type.name));n&&(null==(t=e.text)?void 0:t.includes(l))&&n.attrs.href.includes(l)&&(n.attrs.href=n.attrs.href.replace(l,""))})),{text:Xe(a),prevNode:o,nextNode:c,placeholder:l})}catch{return null}},et=(0,r.x6)((e=>{let t=null;const n=new y.H$("MILKDOWN_INLINE_SYNC");return new y.Sy({key:n,state:{init:()=>null,apply:(r,o,s,a)=>{var l;const c=e.get(i.U7);if(null==(l=c.hasFocus)||!l.call(c)||!c.editable||!r.docChanged||r.getMeta(n))return null;const u=Qe(e,a);if(!u)return null;t&&(cancelAnimationFrame(t),t=null);const{prevNode:h,nextNode:d,text:p}=u,{shouldSyncNode:f}=e.get(Ze.key);return f({prevNode:h,nextNode:d,ctx:e,tr:r,text:p})&&(t=requestAnimationFrame((()=>{t=null;const{dispatch:r,state:o}=e.get(i.U7);((e,t,n,r,i)=>{const{placeholderConfig:o}=e.get(Ze.key),s=o.hole;let a=n.tr.setMeta(t,!0).insertText(s,n.selection.from);const l=n.apply(a),c=Qe(e,l);if(!c)return;const{$from:u}=l.selection,h=u.before(),d=u.after(),p=((e,t,n)=>{let r=t,i=!1;return e.descendants((e=>{var t;if(i)return!1;if(e.isText){const o=null==(t=e.text)?void 0:t.indexOf(n);if(null!=o&&o>=0)return i=!0,r+=o,!1}r+=e.nodeSize})),r})(c.nextNode,h,c.placeholder);a=a.replaceWith(h,d,c.nextNode).setNodeMarkup(h,void 0,i).delete(p+1,p+2),a=a.setSelection(y.Bs.near(a.doc.resolve(p+1))),r(a)})(e,n,o,r,h.attrs)})),r.setMeta("addToHistory",!1)),null}}})}));O(et,{displayName:"Prose<inlineSyncPlugin>",group:"Prose"});const tt=(0,r.te)((()=>()=>e=>{(0,w.Vn)(e,"list",(e=>{if(e.ordered){const t=e.start??1;e.children.forEach(((e,n)=>{e.label=n+t}))}}))}));O(tt,{displayName:"Remark<remarkAddOrderInListPlugin>",group:"Remark"});const nt=(0,r.te)((()=>()=>e=>{const t=/[\t ]*(?:\r?\n|\r)/g;(0,w.Vn)(e,"text",((e,n,r)=>{if(!e.value||"string"!=typeof e.value)return;const i=[];let o=0;t.lastIndex=0;let s=t.exec(e.value);for(;s;){const n=s.index;o!==n&&i.push({type:"text",value:e.value.slice(o,n)}),i.push({type:"break",data:{isInline:!0}}),o=n+s[0].length,s=t.exec(e.value)}return i.length>0&&r&&"number"==typeof n?(o<e.value.length&&i.push({type:"text",value:e.value.slice(o)}),r.children.splice(n,1,...i),n+i.length):void 0}))}));O(nt,{displayName:"Remark<remarkLineBreak>",group:"Remark"});const rt=(0,r.te)((()=>C));O(rt,{displayName:"Remark<remarkInlineLinkPlugin>",group:"Remark"});const it=(0,r.te)((()=>()=>e=>{!function(e,t){(function e(t,n,r){if((e=>!!e.children)(t)){const n=[];for(let r=0,i=t.children.length;r<i;r++){const i=t.children[r];if(i){const o=e(i,r,t);if(o)for(let e=0,t=o.length;e<t;e++){const t=o[e];t&&n.push(t)}}}t.children=n}return((e,t,n)=>(e=>"html"===e.type)(e)?("root"===(null==n?void 0:n.type)&&(e.children=[{...e}],delete e.value,e.type="paragraph"),[e]):[e])(t,0,r)})(e,0,null)[0]}(e)}));O(it,{displayName:"Remark<remarkHtmlTransformer>",group:"Remark"});const ot=(0,r.x6)((()=>{let e=!1;const t=new y.H$("MILKDOWN_INLINE_NODES_CURSOR"),n=new y.Sy({key:t,state:{init:()=>!1,apply(e){if(!e.selection.empty)return!1;const t=e.selection.$from,n=t.nodeBefore,r=t.nodeAfter;return!(!(n&&r&&n.isInline&&!n.isText&&r.isInline)||r.isText)}},props:{handleDOMEvents:{compositionend:(t,r)=>!!e&&(e=!1,requestAnimationFrame((()=>{if(n.getState(t.state)){const e=t.state.selection.from;r.preventDefault(),t.dispatch(t.state.tr.insertText(r.data||"",e))}})),!0),compositionstart:t=>(n.getState(t.state)&&(e=!0),!1),beforeinput:(t,r)=>{if(n.getState(t.state)&&r instanceof InputEvent&&r.data&&!e){const e=t.state.selection.from;return r.preventDefault(),t.dispatch(t.state.tr.insertText(r.data||"",e)),!0}return!1}},decorations(e){if(n.getState(e)){const t=e.selection.$from.pos,n=document.createElement("span"),r=v.p.widget(t,n,{side:-1}),i=document.createElement("span"),o=v.p.widget(t,i);return setTimeout((()=>{n.contentEditable="true",i.contentEditable="true"})),v.EH.create(e.doc,[r,o])}return v.EH.empty}}});return n}));O(ot,{displayName:"Prose<inlineNodesCursorPlugin>",group:"Prose"});const st=(0,r.x6)((()=>new y.Sy({key:new y.H$("MILKDOWN_HARDBREAK_MARKS"),appendTransaction:(e,t,n)=>{if(!e.length)return;const[r]=e;if(!r)return;const[i]=r.steps;if(r.getMeta("hardbreak")){if(!(i instanceof l.Pu))return;const{from:e}=i;return n.tr.setNodeMarkup(e,ye.type(),void 0,[])}if(i instanceof l.WJ){let e=n.tr;const{from:t,to:r}=i;return n.doc.nodesBetween(t,r,((t,n)=>{t.type===ye.type()&&(e=e.setNodeMarkup(n,ye.type(),void 0,[]))})),e}}})));O(st,{displayName:"Prose<hardbreakClearMarkPlugin>",group:"Prose"});const at=(0,r.Tu)(["table","code_block"],"hardbreakFilterNodes");O(at,{displayName:"Ctx<hardbreakFilterNodes>",group:"Prose"});const lt=(0,r.x6)((e=>{const t=e.get(at.key);return new y.Sy({key:new y.H$("MILKDOWN_HARDBREAK_FILTER"),filterTransaction:(e,n)=>{const r=e.getMeta("hardbreak"),[i]=e.steps;if(r&&i){const{from:e}=i,r=n.doc.resolve(e);let o=r.depth,s=!0;for(;o>0;)t.includes(r.node(o).type.name)&&(s=!1),o--;return s}return!0}})}));O(lt,{displayName:"Prose<hardbreakFilterPlugin>",group:"Prose"});const ct=(0,r.x6)((e=>{const t=new y.H$("MILKDOWN_HEADING_ID"),n=n=>{if(n.composing||!n.editable)return;const r=e.get(J.key),i=n.state.tr.setMeta("addToHistory",!1);let o=!1;n.state.doc.descendants(((e,n)=>{if(e.type===Z.type()){if(0===e.textContent.trim().length)return;const s=e.attrs,a=r(e);s.id!==a&&(o=!0,i.setMeta(t,!0).setNodeMarkup(n,void 0,{...s,id:a}))}})),o&&n.dispatch(i)};return new y.Sy({key:t,view:e=>(n(e),{update:e=>{n(e)}})})}));O(ct,{displayName:"Prose<syncHeadingIdPlugin>",group:"Prose"});const ut=(0,r.x6)((()=>{const e=e=>{if(e.composing||!e.editable)return;const t=Ae.type(),n=Me.type(),r=Pe.type(),i=e.state,o=(e,t)=>{let n=!1;const r=`${t+1}.`;return e.label!==r&&(e.label=r,n=!0),n};let s=i.tr,a=!1;i.doc.descendants(((e,i,l,c)=>{if(e.type===n){const n=e.maybeChild(0);(null==n?void 0:n.type)===r&&"ordered"===n.attrs.listType&&(a=!0,s.setNodeMarkup(i,t,{spread:"true"}),e.descendants(((e,t,n,i)=>{if(e.type===r){const n={...e.attrs};o(n,i)&&(s=s.setNodeMarkup(t,void 0,n))}return!1})))}else if(e.type===r&&(null==l?void 0:l.type)===t){const t={...e.attrs};let n=!1;"ordered"!==t.listType&&(t.listType="ordered",n=!0),(null==l?void 0:l.maybeChild(0))&&(n=o(t,c)),n&&(s=s.setNodeMarkup(i,void 0,t),a=!0)}})),a&&e.dispatch(s.setMeta("addToHistory",!1))};return new y.Sy({key:new y.H$("MILKDOWN_KEEP_LIST_ORDER"),view:t=>(e(t),{update:t=>{e(t)}})})}));O(ut,{displayName:"Prose<syncListOrderPlugin>",group:"Prose"});const ht=[qe,We,_e,Ke,[Ze,et,st,at,lt,ot,tt,rt,nt,it,ct,ut]].flat()},4285:(e,t,n)=>{"use strict";n.d(t,{NJ:()=>f,a1:()=>m});var r=n(7191);const i="undefined"!=typeof navigator?navigator:null,o="undefined"!=typeof document?document:null,s=i&&i.userAgent||"",a=/Edge\/(\d+)/.exec(s),l=/MSIE \d/.exec(s),c=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(s),u=!!(l||c||a),h=((l?document.documentMode:c?c[1]:a&&a[1],!u&&/gecko\/(\d+)/i.test(s))&&(/Firefox\/(\d+)/.exec(s)||[0,0])[1],!u&&/Chrome\/(\d+)/.exec(s));function d(e,t,n,r,i,o){if(e.composing)return!1;const s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;const l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,void 0,"")+r;for(let a=0;a<i.length;a++){const c=i[a].match.exec(l),u=c&&c[0]&&i[a].handler(s,c,t-(c[0].length-r.length),n);if(u)return e.dispatch(u.setMeta(o,{transform:u,from:t,to:n,text:r})),!0}return!1}((h&&h[1],!u&&!!i&&/Apple Computer/.test(i.vendor))&&(/Mobile\/\w+/.test(s)||!!i&&i.maxTouchPoints>2)||!!i&&/Mac/.test(i.platform),/Android \d/.test(s),!!o&&"webkitFontSmoothing"in o.documentElement.style)&&(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];const p=new r.H$("MILKDOWN_CUSTOM_INPUTRULES"),f=({rules:e})=>{const t=new r.Sy({key:p,isInputRules:!0,state:{init:()=>null,apply(e,t){return e.getMeta(this)||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(n,r,i,o)=>d(n,r,i,o,e,t),handleDOMEvents:{compositionend:n=>(setTimeout((()=>{const{$cursor:r}=n.state.selection;r&&d(n,r.pos,r.pos,"",e,t)})),!1)},handleKeyDown(n,r){if("Enter"!==r.key)return!1;const{$cursor:i}=n.state.selection;return!!i&&d(n,i.pos,i.pos,"\n",e,t)}}});return t};Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;const m=(e,t)=>{if(!(e instanceof r.qv))return;const{node:n,$from:i}=e;return((e,t)=>Array.isArray(e)&&e.includes(t.type)||t.type===e)(t,n)?{node:n,pos:i.pos,start:i.start(i.depth),depth:i.depth}:void 0}},4611:(e,t,n)=>{"use strict";n.d(t,{Nl:()=>o,iz:()=>s,jE:()=>a});var r=n(8657);const i=(0,r.createContext)({}),o=()=>{const e=(()=>{const{dom:e,editor:t,setLoading:n,editorFactory:o}=(0,r.useContext)(i),s=(0,r.useRef)(null);return(0,r.useEffect)((()=>{const r=s.current;if(!o||!r)return;e.current=r;const i=o(r);return i?(n(!0),i.create().then((e=>{t.current=e})).finally((()=>{n(!1)})).catch(console.error),()=>{var e;null==(e=t.current)||e.destroy()}):void 0}),[e,t,o,n]),s})();return r.createElement("div",{"data-milkdown-root":!0,ref:e})},s=({children:e})=>{const t=(0,r.useRef)(void 0),[n,o]=(0,r.useState)(void 0),s=(0,r.useRef)(),[a,l]=(0,r.useState)(!0),c=(0,r.useMemo)((()=>({loading:a,dom:t,editor:s,setLoading:l,editorFactory:n,setEditorFactory:o})),[a,n]);return r.createElement(i.Provider,{value:c},e)},a=(e,t=[])=>{const n=(0,r.useContext)(i),o=(0,r.useCallback)(e,t);return(0,r.useLayoutEffect)((()=>{n.setEditorFactory((()=>o))}),[n,o]),{loading:n.loading,get:()=>n.editor.current}}},8652:(e,t,n)=>{"use strict";n.d(t,{Q:()=>s});var r=n(3848);function i(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=i(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}const o=function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=i(e))&&(r&&(r+=" "),r+=t);return r},s=e=>{e.update(r.i8,(e=>{const t=e.attributes;return{...e,attributes:e=>{const n="function"==typeof t?t(e):t;return{...n,class:o("prose dark:prose-invert outline-none",(null==n?void 0:n.class)||"","milkdown-theme-nord")}}}}))}},948:(e,t,n)=>{"use strict";n.d(t,{r1:()=>a,Tu:()=>d,Xt:()=>l,we:()=>y,c8:()=>f,qT:()=>c,jO:()=>g,yU:()=>p,x6:()=>u,te:()=>h,Gv:()=>m,zG:()=>k});var r=n(3848),i=n(11);var o=n(870),s=n(840);((e,t=21)=>{((e,t,n)=>{Math.log(e.length-1),Math.LN2,e.length})("abcedfghicklmn",t)})(0,10);const a=(e,t)=>{const n=(0,r.uW)(e),i=o=>async()=>{i.key=n,await o.wait(r.R3);const s=t(o);return o.get(r.Xo).create(n,s),i.run=t=>o.get(r.Xo).call(e,t),()=>{o.get(r.Xo).remove(n)}};return i},l=e=>{const t=n=>async()=>{await n.wait(r.R3);const i=e(n);return n.update(r.tQ,(e=>[...e,i])),t.inputRule=i,()=>{n.update(r.tQ,(e=>e.filter((e=>e!==i))))}};return t},c=(e,t)=>{let n;const i=s=>async()=>{const a=t(s);if(s.update(r.pB,(t=>[...t.filter((t=>t[0]!==e)),[e,a]])),i.id=e,i.schema=a,await s.wait(r.R3),n=s.get(r.le).nodes[e],!n)throw(0,o.YN)(e);return()=>{s.update(r.pB,(t=>t.filter((([t])=>t!==e))))}};return i.type=()=>n,i},u=e=>{let t;const n=n=>async()=>(await n.wait(r.R3),t=e(n),n.update(r.ZV,(e=>[...e,t])),()=>{n.update(r.ZV,(e=>e.filter((e=>e!==t))))});return n.plugin=()=>t,n.key=()=>t.spec.key,n},h=e=>{const t=n=>async()=>{await n.wait(r.Iq);const i=e(n);return n.update(r.CG,(e=>[...e,i])),t.plugin=i,()=>{n.update(r.CG,(e=>e.filter((e=>e!==i))))}};return t},d=(e,t)=>{const n=(0,i.oM)(e,t),r=e=>(e.inject(n),()=>()=>{e.remove(n)});return r.key=n,r},p=(e,t)=>{const n=d(t,e),i=c(e,(e=>e.get(n.key)(e))),o=[n,i];return o.id=i.id,o.node=i,o.type=i.type,o.schema=i.schema,o.ctx=n,o.key=n.key,o.extendSchema=t=>i=>()=>{const s=i.get(n.key),a=t(s)(i);i.update(r.pB,(t=>[...t.filter((t=>t[0]!==e)),[e,a]])),o.schema=a},o},f=(e,t)=>{const n=d(t,e),i=((e,t)=>{let n;const i=s=>async()=>{const a=t(s);if(s.update(r.ZP,(t=>[...t.filter((t=>t[0]!==e)),[e,a]])),i.id=e,i.schema=a,await s.wait(r.R3),n=s.get(r.le).marks[e],!n)throw(0,o.d2)(e);return()=>{s.update(r.ZP,(t=>t.filter((([t])=>t!==e))))}};return i.type=()=>n,i})(e,(e=>e.get(n.key)(e))),s=[n,i];return s.id=i.id,s.mark=i,s.type=i.type,s.schema=i.schema,s.ctx=n,s.key=n.key,s.extendSchema=t=>i=>()=>{const o=i.get(n.key),a=t(o)(i);i.update(r.ZP,(t=>[...t.filter((t=>t[0]!==e)),[e,a]])),s.schema=a},s},m=(e,t)=>{const n=Object.fromEntries(Object.entries(t).map((([e,{shortcuts:t}])=>[e,t]))),i=d(n,`${e}Keymap`),o=(e=>{const t=n=>async()=>{await n.wait(r.R3);const i=e(n),o=(0,s.h)(i);return n.update(r.ZV,(e=>[...e,o])),t.keymap=i,()=>{n.update(r.ZV,(e=>e.filter((e=>e!==o))))}};return t})((e=>{const n=e.get(i.key),r=Object.entries(t).flatMap((([t,{command:r}])=>[n[t]].flat().map((t=>[t,r(e)]))));return Object.fromEntries(r)})),a=[i,o];return a.ctx=i,a.shortcuts=o,a.key=i.key,a.keymap=o.keymap,a},g=(e,t=(()=>({})))=>d(t,`${e}Attr`),y=(e,t=(()=>({})))=>d(t,`${e}Attr`),k=(...e)=>{const t=e.length;let n=t;for(;n--;)if("function"!=typeof e[n])throw new TypeError("Expected a function");return(...n)=>{let r=0,i=t?e[r](...n):n[0];for(;++r<t;)i=e[r](i);return i}}},6226:(e,t,n)=>{"use strict";n.d(t,{Q:()=>o});var r=n(4795),i=n(3352),o=function(){var e=(0,r.Z)((function*(e,t,n){var r=new FormData,o=function*(){if(Array.isArray(a)){var e="".concat(s,"[]");a.forEach((t=>{r.append(e,t)}))}else r.append(s,a)};for(var[s,a]of Object.entries(t))yield*o();return(yield i.http.put("api/gateway/object_store.object_store.PutObject/api/v1/objectStore/bucket/".concat(e,"/object"),r,n)).data}));return function(t,n,r){return e.apply(this,arguments)}}()},737:(e,t,n)=>{"use strict";n.d(t,{YR:()=>C,uJ:()=>y,w9:()=>k,ym:()=>g});var r=n(6151),i=n(2665),o=n(7191);const s=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function a(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function l(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 c(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}function u(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 h;function d(e,t,n){let s,l,c=t.nodeBefore,u=t.nodeAfter;if(c.type.spec.isolating||u.type.spec.isolating)return!1;if(function(e,t,n){let i=t.nodeBefore,o=t.nodeAfter,s=t.index();return!(!(i&&o&&i.type.compatibleContent(o.type))||(!i.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(s,s+1)||!o.isTextblock&&!(0,r.Mn)(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,i.type,i.contentMatchAt(i.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let h=t.parent.canReplace(t.index(),t.index()+1);if(h&&(s=(l=c.contentMatchAt(c.childCount)).findWrapping(u.type))&&l.matchType(s[0]||u.type).validEnd){if(n){let o=t.pos+u.nodeSize,a=i.HY.empty;for(let e=s.length-1;e>=0;e--)a=i.HY.from(s[e].create(null,a));a=i.HY.from(c.copy(a));let l=e.tr.step(new r.FC(t.pos-1,o,t.pos,o,new i.p2(a,1,0),s.length,!0)),h=o+2*s.length;(0,r.Mn)(l.doc,h)&&l.join(h),n(l.scrollIntoView())}return!0}let d=o.Y1.findFrom(t,1),p=d&&d.$from.blockRange(d.$to),f=p&&(0,r.k9)(p);if(null!=f&&f>=t.depth)return n&&n(e.tr.lift(p,f).scrollIntoView()),!0;if(h&&a(u,"start",!0)&&a(c,"end")){let o=c,s=[];for(;s.push(o),!o.isTextblock;)o=o.lastChild;let a=u,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(o.canReplace(o.childCount,o.childCount,a.content)){if(n){let o=i.HY.empty;for(let e=s.length-1;e>=0;e--)o=i.HY.from(s[e].copy(o));n(e.tr.step(new r.FC(t.pos-s.length,t.pos+u.nodeSize,t.pos+l,t.pos+u.nodeSize-l,new i.p2(o,s.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function p(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return!!i.node(s).isTextblock&&(n&&n(t.tr.setSelection(o.Bs.create(t.doc,e<0?i.start(s):i.end(s)))),!0)}}const f=p(-1),m=p(1);function g(e,t=null){return function(n,i){let{$from:o,$to:s}=n.selection,a=o.blockRange(s),l=a&&(0,r.nd)(a,e,t);return!!l&&(i&&i(n.tr.wrap(a,l).scrollIntoView()),!0)}}function y(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(o,s,((r,o)=>{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)i=!0;else{let t=n.doc.resolve(o),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:o},$to:{pos:s}}=n.selection.ranges[r];i.setBlockType(o,s,e,t)}r(i.scrollIntoView())}return!0}}function k(e,t=null){return function(n,r){let{empty:i,$cursor:o,ranges:s}=n.selection;if(i&&!o||!function(e,t,n){for(let r=0;r<t.length;r++){let{$from:i,$to:o}=t[r],s=0==i.depth&&e.inlineContent&&e.type.allowsMarkType(n);if(e.nodesBetween(i.pos,o.pos,(e=>{if(s)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)})),s)return!0}return!1}(n.doc,s,e))return!1;if(r)if(o)e.isInSet(n.storedMarks||o.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{let i=!1,o=n.tr;for(let t=0;!i&&t<s.length;t++){let{$from:r,$to:o}=s[t];i=n.doc.rangeHasMark(r.pos,o.pos,e)}for(let n=0;n<s.length;n++){let{$from:r,$to:a}=s[n];if(i)o.removeMark(r.pos,a.pos,e);else{let n=r.pos,i=a.pos,s=r.nodeAfter,l=a.nodeBefore,c=s&&s.isText?/^\s*/.exec(s.text)[0].length:0,u=l&&l.isText?/\s*$/.exec(l.text)[0].length:0;n+c<i&&(n+=c,i-=u),o.addMark(n,i,e.create(t))}}r(o.scrollIntoView())}return!0}}function v(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let w=v(s,((e,t,n)=>{let s=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}(e,n);if(!s)return!1;let c=l(s);if(!c){let n=s.blockRange(),i=n&&(0,r.k9)(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let u=c.nodeBefore;if(!u.type.spec.isolating&&d(e,c,t))return!0;if(0==s.parent.content.size&&(a(u,"end")||o.qv.isSelectable(u))){let n=(0,r.dR)(e.doc,s.before(),s.after(),i.p2.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(a(u,"end")?o.Y1.findFrom(r.doc.resolve(r.mapping.map(c.pos,-1)),-1):o.qv.create(r.doc,c.pos-u.nodeSize)),t(r.scrollIntoView())}return!0}}return!(!u.isAtom||c.depth!=s.depth-1||(t&&t(e.tr.delete(c.pos-u.nodeSize,c.pos).scrollIntoView()),0))}),((e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;s=l(r)}let a=s&&s.nodeBefore;return!(!a||!o.qv.isSelectable(a)||(t&&t(e.tr.setSelection(o.qv.create(e.doc,s.pos-a.nodeSize)).scrollIntoView()),0))})),x=v(s,((e,t,n)=>{let s=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}(e,n);if(!s)return!1;let l=c(s);if(!l)return!1;let u=l.nodeAfter;if(d(e,l,t))return!0;if(0==s.parent.content.size&&(a(u,"start")||o.qv.isSelectable(u))){let n=(0,r.dR)(e.doc,s.before(),s.after(),i.p2.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(a(u,"start")?o.Y1.findFrom(r.doc.resolve(r.mapping.map(l.pos)),1):o.qv.create(r.doc,r.mapping.map(l.pos))),t(r.scrollIntoView())}return!0}}return!(!u.isAtom||l.depth!=s.depth-1||(t&&t(e.tr.delete(l.pos,l.pos+u.nodeSize).scrollIntoView()),0))}),((e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;s=c(r)}let a=s&&s.nodeAfter;return!(!a||!o.qv.isSelectable(a)||(t&&t(e.tr.setSelection(o.qv.create(e.doc,s.pos)).scrollIntoView()),0))}));const b={Enter:v(((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))}),((e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof o.C1||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=u(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=e.tr.insert(n,s.createAndFill());a.setSelection(o.Bs.create(a.doc,n+1)),t(a.scrollIntoView())}return!0}),((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if((0,r.Ax)(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),o=i&&(0,r.k9)(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)}),((e,t)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof o.qv&&e.selection.node.isBlock)return!(!n.parentOffset||!(0,r.Ax)(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.parent.isBlock)return!1;if(t){let s=i.parentOffset==i.parent.content.size,a=e.tr;(e.selection instanceof o.Bs||e.selection instanceof o.C1)&&a.deleteSelection();let l=0==n.depth?null:u(n.node(-1).contentMatchAt(n.indexAfter(-1))),c=h?[h]:s&&l?[{type:l}]:void 0,d=(0,r.Ax)(a.doc,a.mapping.map(n.pos),1,c);if(c||d||!(0,r.Ax)(a.doc,a.mapping.map(n.pos),1,l?[{type:l}]:void 0)||(l&&(c=[{type:l}]),d=!0),d&&(a.split(a.mapping.map(n.pos),1,c),!s&&!n.parentOffset&&n.parent.type!=l)){let e=a.mapping.map(n.before()),t=a.doc.resolve(e);l&&n.node(-1).canReplaceWith(t.index(),t.index()+1,l)&&a.setNodeMarkup(a.mapping.map(n.before()),l)}t(a.scrollIntoView())}return!0})),"Mod-Enter":(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),s=n.indexAfter(-1),a=u(i.contentMatchAt(s));if(!a||!i.canReplaceWith(s,s,a))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,a.createAndFill());i.setSelection(o.Y1.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Backspace:w,"Mod-Backspace":w,"Shift-Backspace":w,Delete:x,"Mod-Delete":x,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new o.C1(e.doc))),!0)},S={"Ctrl-h":b.Backspace,"Alt-Backspace":b["Mod-Backspace"],"Ctrl-d":b.Delete,"Ctrl-Alt-Backspace":b["Mod-Delete"],"Alt-Delete":b["Mod-Delete"],"Alt-d":b["Mod-Delete"],"Ctrl-a":f,"Ctrl-e":m};for(let e in b)S[e]=b[e];const C=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&"darwin"==os.platform())?S:b},840:(e,t,n)=>{"use strict";n.d(t,{h:()=>m});for(var r={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:"'"},i={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},o="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),s=("undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)),a="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),l=s||o&&+o[1]<57,c=0;c<10;c++)r[48+c]=r[96+c]=String(c);for(c=1;c<=24;c++)r[c+111]="F"+c;for(c=65;c<=90;c++)r[c]=String.fromCharCode(c+32),i[c]=String.fromCharCode(c);for(var u in r)i.hasOwnProperty(u)||(i[u]=r[u]);var h=n(7191);const d="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function p(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);d?i=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function f(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 m(e){return new h.Sy({props:{handleKeyDown:g(e)}})}function g(e){let t=function(e){let t=Object.create(null);for(let n in e)t[p(n)]=e[n];return t}(e);return function(e,n){let o,s=function(e){var t=!(l&&(e.ctrlKey||e.altKey||e.metaKey)||a&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?i:r)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),c=t[f(s,n)];if(c&&c(e.state,e.dispatch,e))return!0;if(1==s.length&&" "!=s){if(n.shiftKey){let r=t[f(s,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.shiftKey||n.altKey||n.metaKey||s.charCodeAt(0)>127)&&(o=r[n.keyCode])&&o!=s){let r=t[f(o,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}},2665:(e,t,n)=>{"use strict";function r(e){this.content=e}n.d(t,{aw:()=>Z,PW:()=>ae,HY:()=>a,vc:()=>h,ZU:()=>Y,NB:()=>I,Ts:()=>T,e4:()=>d,V_:()=>J,p2:()=>p}),r.prototype={constructor:r,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-1==t?void 0:this.content[t+1]},update:function(e,t,n){var i=n&&n!=e?this.remove(n):this,o=i.find(e),s=i.content.slice();return-1==o?s.push(n||e,t):(s[o+1]=t,n&&(s[o]=n)),new r(s)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new r(n)},addToStart:function(e,t){return new r([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new r(n)},addBefore:function(e,t,n){var i=this.remove(t),o=i.content.slice(),s=i.find(e);return o.splice(-1==s?o.length:s,0,t,n),new r(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=r.from(e)).size?new r(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=r.from(e)).size?new r(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=r.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}},r.from=function(e){if(e instanceof r)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new r(t)};const i=r;function o(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),s=t.child(r);if(i!=s){if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let e=0;i.text[e]==s.text[e];e++)n++;return n}if(i.content.size||s.content.size){let e=o(i.content,s.content,n+1);if(null!=e)return e}n+=i.nodeSize}else n+=i.nodeSize}}function s(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let a=e.child(--i),l=t.child(--o),c=a.nodeSize;if(a!=l){if(!a.sameMarkup(l))return{a:n,b:r};if(a.isText&&a.text!=l.text){let e=0,t=Math.min(a.text.length,l.text.length);for(;e<t&&a.text[a.text.length-e-1]==l.text[l.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(a.content.size||l.content.size){let e=s(a.content,l.content,n-1,r-1);if(e)return e}n-=c,r-=c}else n-=c,r-=c}}class a{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(i+=s.text.slice(Math.max(e,a)-a,t-a),o=!n):s.isLeaf?(r?i+="function"==typeof r?r(s):r:s.type.spec.leafText&&(i+=s.type.spec.leafText(s)),o=!n):!o&&s.isBlock&&(i+=n,o=!0)}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new a(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a}return new a(n,r)}cutByIndex(e,t){return e==t?a.empty:0==e&&t==this.content.length?this:new a(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new a(r,i)}addToStart(e){return new a([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new a(this.content.concat(e),this.size+e.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 new 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 o(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return s(this,e,t,n)}findIndex(e,t=-1){if(0==e)return c(0,e);if(e==this.size)return c(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?c(n+1,i):c(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return a.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new a(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return a.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new a(t||e,n)}static from(e){if(!e)return a.empty;if(e instanceof a)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new a([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}a.empty=new a([],0);const l={index:0,offset:0};function c(e,t){return l.index=e,l.offset=t,l}function u(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)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(!u(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!u(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class h{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||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(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&&u(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 new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}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(e){if(!e||Array.isArray(e)&&0==e.length)return h.none;if(e instanceof h)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}h.none=[];class d extends Error{}class p{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=m(this.content,e+this.openStart,t);return n&&new p(n,this.openStart,this.openEnd)}removeBetween(e,t){return new p(f(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return p.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new p(a.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new p(e,n,r)}}function f(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(f(o.content,t-i-1,n-i-1)))}function m(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=m(s.content,t-o-1,n);return a&&e.replaceChild(i,s.copy(a))}function g(e,t,n){if(n.openStart>e.depth)throw new d("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new d("Inconsistent open depths");return y(e,t,n,0)}function y(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=y(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:i,end:s}=function(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(a.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return b(o,S(e,i,s,t,r))}{let r=e.parent,i=r.content;return b(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return b(o,C(e,t,r))}function k(e,t){if(!t.type.compatibleContent(e.type))throw new d("Cannot join "+t.type.name+" onto "+e.type.name)}function v(e,t,n){let r=e.node(n);return k(r,t.node(n)),r}function w(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 x(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(w(e.nodeAfter,r),o++));for(let e=o;e<s;e++)w(i.child(e),r);t&&t.depth==n&&t.textOffset&&w(t.nodeBefore,r)}function b(e,t){return e.type.checkContent(t),e.copy(t)}function S(e,t,n,r,i){let o=e.depth>i&&v(e,t,i+1),s=r.depth>i&&v(n,r,i+1),l=[];return x(null,e,i,l),o&&s&&t.index(i)==n.index(i)?(k(o,s),w(b(o,S(e,t,n,r,i+1)),l)):(o&&w(b(o,C(e,t,i+1)),l),x(t,n,i,l),s&&w(b(s,C(n,r,i+1)),l)),x(r,null,i,l),new a(l)}function C(e,t,n){let r=[];return x(null,e,n,r),e.depth>n&&w(b(v(e,t,n+1),C(e,t,n+1)),r),x(t,null,n,r),new a(r)}p.empty=new p(a.empty,0,0);class M{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?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[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].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):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-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(0==e.content.size)return h.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 o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].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++)!1!==n[i].type.spec.inclusive||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 T(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(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),s=i-o;if(n.push(t,e,r+o),!s)break;if(t=t.child(e),t.isText)break;i=s-1,r+=o+1}return new M(t,n,i)}static resolveCached(e,t){for(let n=0;n<O.length;n++){let r=O[n];if(r.pos==t&&r.doc==e)return r}let n=O[N]=M.resolve(e,t);return N=(N+1)%E,n}}let O=[],N=0,E=12;class T{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)}}const A=Object.create(null);class I{constructor(e,t,n,r=h.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||a.empty}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&&u(this.attrs,t||e.defaultAttrs||A)&&h.sameSet(this.marks,n||h.none)}copy(e=null){return e==this.content?this:new I(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new I(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return p.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o),a=r.node(o).content.cut(r.pos-s,i.pos-s);return new p(a,r.depth-o,i.depth-o)}replace(e,t,n){return g(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(0==e)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 M.resolveCached(this,e)}resolveNoCache(e){return M.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()+")"),F(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=a.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.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),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}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);let e=h.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!h.sameSet(e,this.marks))throw new 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 new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=a.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}I.prototype.text=void 0;class D extends I{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):F(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(e){return e==this.marks?this:new D(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new D(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&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 F(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class R{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new P(e,t);if(null==n.next)return R.empty;let r=z(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return 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]);H(e,n).forEach((e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let o=t[r.join(",")]=new R(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(V);o.next.push({type:i[e][0],next:t[r.join(",")]||n(r)})}return o}(H(e,0))}(function(e){let t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(e(n,o))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(o,s),i(e(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return i(e(t.expr,o),s),i(e(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(o)].concat(e(t.expr,o));if("range"==t.type){let s=o;for(let r=0;r<t.min;r++){let r=n();i(e(t.expr,s),r),s=r}if(-1==t.max)i(e(t.expr,s),s);else for(let o=t.min;o<t.max;o++){let o=n();r(s,o),i(e(t.expr,s),o),s=o}return[r(s)]}if("name"==t.type)return[r(o,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=e(t.exprs[r],o);if(r==t.exprs.length-1)return s;i(s,o=n())}}(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))}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,n),i}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 0!=this.next.length&&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];return function i(o,s){let l=o.matchFragment(e,n);if(l&&(!t||l.validEnd))return a.from(s.map((e=>e.createAndFill())));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=i(n,s.concat(t));if(e)return e}}return null}(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:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(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("\n")}}R.empty=new R(!0);class P{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 new SyntaxError(e+" (in content expression '"+this.string+"')")}}function z(e){let t=[];do{t.push(B(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function B(e){let t=[];do{t.push(L(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function L(e){let t=function(e){if(e.eat("(")){let t=z(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(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.groups.indexOf(t)>-1&&i.push(r)}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(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("{"))break;t=$(e,t)}return t}function j(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function $(e,t){let n=j(e),r=n;return e.eat(",")&&(r="}"!=e.next?j(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function V(e,t){return t-e}function H(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(V)}function q(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 W(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=t.default}n[r]=i}return n}function _(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new U(e[n]);return t}class K{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=_(n.attrs),this.defaultAttrs=q(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==R.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}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:W(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new I(this,this.computeAttrs(e),a.from(t),h.setFrom(n))}createChecked(e=null,t,n){return t=a.from(t),this.checkContent(t),new I(this,this.computeAttrs(e),t,h.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=a.from(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(a.empty,!0);return i?new I(this,e,t.append(i),h.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 new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:h.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,r)=>n[e]=new K(e,t,r)));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class U{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Y{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=_(r.attrs),this.excluded=null;let i=q(this.attrs);this.instance=i?new h(this,i):null}create(e=null){return!e&&this.instance?this.instance:new h(this,W(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new Y(e,r++,t,i))),n}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]}excludes(e){return this.excluded.indexOf(e)>-1}}class J{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=i.from(e.nodes),t.marks=i.from(e.marks||{}),this.nodes=K.compile(this.spec.nodes,this),this.marks=Y.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",i=t.spec.marks;t.contentMatch=n[r]||(n[r]=R.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.markSet="_"==i?null:i?G(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:G(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof K))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new 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 D(n,n.defaultAttrs,e,h.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return I.fromJSON(this,e)}markFromJSON(e){return h.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function G(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Z{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&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 re(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new re(this,t,!0);return n.addAll(e,t.from,t.to),p.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(ie(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)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],o=r.style;if(!(0!=o.indexOf(e)||r.context&&!n.matchesContext(r.context)||o.length>e.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?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=oe(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=oe(e)),e.node||e.ignore||e.mark||(e.node=t)}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Z(e,Z.schemaRules(e)))}}const X={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},Q={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ee={ol:!0,ul:!0};function te(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class ne{constructor(e,t,n,r,i,o,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=h.none,this.stashMarks=[],this.match=o||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(a.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=a.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(a.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):se(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!X.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class re{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,i=t.topNode,o=te(null,t.preserveWhitespace,0)|(n?4:0);r=i?new ne(i.type,i.attrs,h.none,h.none,!0,t.topMatch||i.type.contentMatch,o):new ne(n?null:e.schema.topNodeType,null,h.none,h.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){let t=e.getAttribute("style");if(t){let n=this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t));if(!n)return;let[r,i]=n,o=this.top;for(let e=0;e<i.length;e++)this.removePendingMark(i[e],o);for(let e=0;e<r.length;e++)this.addPendingMark(r[e]);this.addElement(e);for(let e=0;e<r.length;e++)this.removePendingMark(r[e],o);for(let e=0;e<i.length;e++)this.addPendingMark(i[e])}else this.addElement(e)}}addTextNode(e){let t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n,r=e.nodeName.toLowerCase();ee.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&ee.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(i?i.ignore:Q.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let t,n=this.top,o=this.needsBlock;if(X.hasOwnProperty(r))n.content.length&&n.content[0].isInline&&this.open&&(this.open--,n=this.top),t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),t&&this.sync(n),this.needsBlock=o}else this.addElementByRule(e,i,!1===i.consuming?n:void 0)}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=h.none,n=h.none;for(let r=0;r<e.length;r+=2)for(let i;;){let o=this.parser.matchStyle(e[r],e[r+1],this,i);if(!o)break;if(o.ignore)return null;if(o.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach((e=>{o.clearMark(e)&&(n=e.addToSet(n))})):t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),!1!==o.consuming)break;i=o}return[t,n]}addElementByRule(e,t,n){let r,i,o;t.node?(i=this.parser.schema.nodes[t.node],i.isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):r=this.enter(i,t.attrs||null,t.preserveWhitespace)):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(e,t,n){let r=t||0;for(let i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(let e=0;e<t.length;e++)this.enterInner(t[e],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)t.type&&!t.type.allowsMarkType(e.marks[r].type)||(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e,t=null,n=!1,r){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let o=te(e,r,i.options);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new ne(e,t,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}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;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++)null==this.find[t].pos&&1==e.nodeType&&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++)null==this.find[r].pos&&1==e.nodeType&&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?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return o(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}}addPendingMark(e){let t=function(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function ie(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function oe(e){let t={};for(let n in e)t[n]=e[n];return t}function se(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t)return!0;if(o.indexOf(i)<0&&s(i))return!0}};if(s(i.contentMatch))return!0}}class ae{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=ce(t).createDocumentFragment());let r=n,i=[];return e.forEach((e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(this.marks[t.type.name]){if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}else o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=ae.renderSpec(ce(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new 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&&ae.renderSpec(ce(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,i=t[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?e.createElementNS(n,i):e.createElement(i),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let i=l;i<t.length;i++){let o=t[i];if(0===o){if(i<t.length-1||i>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:i}=ae.renderSpec(e,o,n);if(s.appendChild(t),i){if(r)throw new RangeError("Multiple content holes");r=i}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ae(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=le(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return le(e.marks)}}function le(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function ce(e){return e.document||window.document}},7191:(e,t,n)=>{"use strict";n.d(t,{Bs:()=>u,C1:()=>f,H$:()=>E,Sy:()=>M,Y1:()=>s,qv:()=>d,yy:()=>S});var r=n(2665),i=n(6151);const o=Object.create(null);class s{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new a(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=r.p2.empty){let n=t.content.lastChild,i=null;for(let e=0;e<t.openEnd;e++)i=n,n=n.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=e.mapping.slice(o);e.replaceRange(u.map(l.pos),u.map(c.pos),a?r.p2.empty:t),0==a&&y(e,o,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=e.mapping.slice(n),l=a.map(o.pos),c=a.map(s.pos);i?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),y(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new u(e):g(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?g(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):g(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 f(e.node(0))}static atStart(e){return g(e,e,0,0,1)||new f(e)}static atEnd(e){return g(e,e,e.content.size,e.childCount,-1)||new f(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=o[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in o)throw new RangeError("Duplicate use of selection JSON ID "+e);return o[e]=t,t.prototype.jsonID=e,t}getBookmark(){return u.between(this.$anchor,this.$head).getBookmark()}}s.prototype.visible=!0;class a{constructor(e,t){this.$from=e,this.$to=t}}let l=!1;function c(e){l||e.parent.inlineContent||(l=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class u extends s{constructor(e,t=e){c(e),c(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return s.near(n);let r=e.resolve(t.map(this.anchor));return new u(r.parent.inlineContent?r:n,n)}replace(e,t=r.p2.empty){if(super.replace(e,t),t==r.p2.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof u&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new h(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new u(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=s.findFrom(t,n,!0)||s.findFrom(t,-n,!0);if(!e)return s.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(s.findFrom(e,-n,!0)||s.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new u(e,t)}}s.jsonID("text",u);class h{constructor(e,t){this.anchor=e,this.head=t}map(e){return new h(e.map(this.anchor),e.map(this.head))}resolve(e){return u.between(e.resolve(this.anchor),e.resolve(this.head))}}class d extends s{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?s.near(i):new d(i)}content(){return new r.p2(r.HY.from(this.node),0,0)}eq(e){return e instanceof d&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new p(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new d(e.resolve(t.anchor))}static create(e,t){return new d(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}d.prototype.visible=!1,s.jsonID("node",d);class p{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new h(n,n):new p(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&d.isSelectable(n)?new d(t):s.near(t)}}class f extends s{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=r.p2.empty){if(t==r.p2.empty){e.delete(0,e.doc.content.size);let t=s.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new f(e)}map(e){return new f(e)}eq(e){return e instanceof f}getBookmark(){return m}}s.jsonID("all",f);const m={map(){return this},resolve:e=>new f(e)};function g(e,t,n,r,i,o=!1){if(t.inlineContent)return u.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&d.isSelectable(r))return d.create(e,n-(i<0?r.nodeSize:0))}else{let t=g(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function y(e,t,n){let r=e.steps.length-1;if(r<t)return;let o,a=e.steps[r];(a instanceof i.Pu||a instanceof i.FC)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==o&&(o=r)})),e.setSelection(s.near(e.doc.resolve(o),n)))}class k extends i.wx{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return r.vc.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(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,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)||r.vc.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!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.setSelection(s.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function v(e,t){return t&&e?e.bind(t):e}class w{constructor(e,t,n){this.name=e,this.init=v(t.init,n),this.apply=v(t.apply,n)}}const x=[new w("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new w("selection",{init:(e,t)=>e.selection||s.atStart(t.doc),apply:e=>e.selection}),new w("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new w("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class b{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=x.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new 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 w(e.key,e.spec.state,e))}))}}class S{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 o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=r?r[o].n:0,l=r?r[o].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new S(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new k(this)}static create(e){let t=new b(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new S(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new b(this.schema,e.plugins),n=t.fields,r=new S(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new 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(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new b(e.schema,e.plugins),o=new S(i);return i.fields.forEach((i=>{if("doc"==i.name)o.doc=r.NB.fromJSON(e.schema,t.doc);else if("selection"==i.name)o.selection=s.fromJSON(o.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let r in n){let s=n[r],a=s.spec.state;if(s.key==i.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,r))return void(o[i.name]=a.fromJSON.call(s,e,t[r],o))}o[i.name]=i.init(e,o)}})),o}}function C(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=C(i,t,{})),n[r]=i}return n}class M{constructor(e){this.spec=e,this.props={},e.props&&C(e.props,this,this.props),this.key=e.key?e.key.key:N("plugin")}getState(e){return e[this.key]}}const O=Object.create(null);function N(e){return e in O?e+"$"+ ++O[e]:(O[e]=0,e+"$")}class E{constructor(e="key"){this.key=N(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}},6151:(e,t,n)=>{"use strict";n.d(t,{Ax:()=>C,FC:()=>k,Mn:()=>M,Pu:()=>y,WJ:()=>p,dR:()=>N,k9:()=>x,nd:()=>b,nj:()=>O,vs:()=>l,wx:()=>$});var r=n(2665);const i=Math.pow(2,16);function o(e){return 65535&e}class s{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class a{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&a.empty)return a.empty}recover(e){let t=0,n=o(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/i}(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,o=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>e)break;let u=this.ranges[l+o],h=this.ranges[l+a],d=c+u;if(e<=d){let o=c+r+((u?e==c?-1:e==d?1:t:t)<0?0:h);if(n)return o;let a=e==c?2:e==d?1:4;return(t<0?e!=c:e!=d)&&(a|=8),new s(o,a,e==(t<0?c:d)?null:l/3+(e-c)*i)}r+=h-u}return n?e+r:new s(e+r,0,null)}touches(e,t){let n=0,r=o(t),i=this.inverted?2:1,s=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 a=this.ranges[t+i];if(e<=o+a&&t==3*r)return!0;n+=this.ranges[t+s]-a}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 o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),i+=c-l}}invert(){return new a(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?a.empty:new a(e<0?[0,-e,0]:[0,0,e])}}a.empty=new a([]);class l{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new l(this.maps,this.mirror,e,t)}copy(){return new l(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&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],null!=r&&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=[]),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(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new l;return e.appendMappingInverted(this),e}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(null!=i.recover){let t=this.getMirror(n);if(null!=t&&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 s(e,r,null)}}const c=Object.create(null);class u{getMap(){return a.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=c[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in c)throw new RangeError("Duplicate use of step JSON ID "+e);return c[e]=t,t.prototype.jsonID=e,t}}class h{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new h(e,null)}static fail(e){return new h(null,e)}static fromReplace(e,t,n,i){try{return h.ok(e.replace(t,n,i))}catch(e){if(e instanceof r.e4)return h.fail(e.message);throw e}}}function d(e,t,n){let i=[];for(let r=0;r<e.childCount;r++){let o=e.child(r);o.content.size&&(o=o.copy(d(o.content,t,o))),o.isInline&&(o=t(o,n,r)),i.push(o)}return r.HY.fromArray(i)}class p extends u{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),i=n.node(n.sharedDepth(this.to)),o=new r.p2(d(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),i),t.openStart,t.openEnd);return h.fromReplace(e,this.from,this.to,o)}invert(){return new f(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new p(t.pos,n.pos,this.mark)}merge(e){return e instanceof p&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new p(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new p(t.from,t.to,e.markFromJSON(t.mark))}}u.jsonID("addMark",p);class f extends u{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 r.p2(d(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return h.fromReplace(e,this.from,this.to,n)}invert(){return new p(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new f(t.pos,n.pos,this.mark)}merge(e){return e instanceof f&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new f(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new f(t.from,t.to,e.markFromJSON(t.mark))}}u.jsonID("removeMark",f);class m extends u{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return h.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return h.fromReplace(e,this.pos,this.pos+1,new r.p2(r.HY.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new m(this.pos,t.marks[n]);return new m(this.pos,this.mark)}}return new g(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new m(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new m(t.pos,e.markFromJSON(t.mark))}}u.jsonID("addNodeMark",m);class g extends u{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return h.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return h.fromReplace(e,this.pos,this.pos+1,new r.p2(r.HY.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new m(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new g(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new g(t.pos,e.markFromJSON(t.mark))}}u.jsonID("removeNodeMark",g);class y extends u{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&v(e,this.from,this.to)?h.fail("Structure replace would overwrite content"):h.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new a([this.from,this.to-this.from,this.slice.size])}invert(e){return new y(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new y(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof y)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?r.p2.empty:new r.p2(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new y(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?r.p2.empty:new r.p2(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new y(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new y(t.from,t.to,r.p2.fromJSON(e,t.slice),!!t.structure)}}u.jsonID("replace",y);class k extends u{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(v(e,this.from,this.gapFrom)||v(e,this.gapTo,this.to)))return h.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return h.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?h.fromReplace(e,this.from,this.to,n):h.fail("Content does not fit in gap")}getMap(){return new a([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new k(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new k(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new k(t.from,t.to,t.gapFrom,t.gapTo,r.p2.fromJSON(e,t.slice),t.insert,!!t.structure)}}function v(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function w(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function x(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!w(r,i,o))break}return null}function b(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;a&&e<i;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null}(r,t);return o?i.map(S).concat({type:t,attrs:n}).concat(o.map(S)):null}function S(e){return{type:e,attrs:null}}function C(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),a=r&&r[t]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(o+1,n.childCount)||!a.type.validContent(s))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function M(e,t){let n=e.resolve(t),r=n.index();return i=n.nodeBefore,o=n.nodeAfter,!(!i||!o||i.isLeaf||!i.canAppend(o))&&n.parent.canReplace(r,r+1);var i,o}function O(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<=(0==n.openStart&&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,o=r.index(t)+(n>0?1:0),s=r.node(t),a=!1;if(1==e)a=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(o,o,e[0])}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function N(e,t,n=t,i=r.p2.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return E(o,s,i)?new y(t,n,i):new T(o,s,i).fit()}function E(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}u.jsonID("replaceAround",k);class T{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=r.HY.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=r.HY.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,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let o=this.placed,s=n.depth,a=i.depth;for(;s&&a&&1==o.childCount;)o=o.firstChild.content,s--,a--;let l=new r.p2(o,s,a);return e>-1?new k(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new y(n.pos,i.pos,l):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=1==t?e:this.unplaced.openStart;n>=0;n--){let e,i=null;n?(i=D(this.unplaced.content,n-1).firstChild,e=i.content):e=this.unplaced.content;let o=e.firstChild;for(let e=this.depth;e>=0;e--){let s,{type:a,match:l}=this.frontier[e],c=null;if(1==t&&(o?l.matchType(o.type)||(c=l.fillBefore(r.HY.from(o),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:e,parent:i,inject:c};if(2==t&&o&&(s=l.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:e,parent:i,wrap:s};if(i&&l.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=D(e,t);return!(!i.childCount||i.firstChild.isLeaf||(this.unplaced=new r.p2(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),0))}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=D(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new r.p2(A(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new r.p2(A(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e<o.length;e++)this.openFrontierNode(o[e]);let s=this.unplaced,a=n?n.content:s.content,l=s.openStart-e,c=0,u=[],{match:h,type:d}=this.frontier[t];if(i){for(let e=0;e<i.childCount;e++)u.push(i.child(e));h=h.matchFragment(i)}let p=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let e=a.child(c),t=h.matchType(e.type);if(!t)break;c++,(c>1||0==l||e.content.size)&&(h=t,u.push(F(e.mark(d.allowedMarks(e.marks)),1==c?l:0,c==a.childCount?p:-1)))}let f=c==a.childCount;f||(p=-1),this.placed=I(this.placed,t,r.HY.from(u)),this.frontier[t].match=h,f&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=a;e<p;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=f?0==e?r.p2.empty:new r.p2(A(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new r.p2(A(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!R(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.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){e: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)),o=R(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=R(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,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=I(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 i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=I(this.placed,this.depth,r.HY.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(r.HY.empty,!0);e.childCount&&(this.placed=I(this.placed,this.frontier.length,e))}}function A(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(A(e.firstChild.content,t-1,n)))}function I(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(I(e.lastChild.content,t-1,n)))}function D(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function F(e,t,n){if(t<=0)return e;let i=e.content;return t>1&&(i=i.replaceChild(0,F(i.firstChild,t-1,1==i.childCount?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(r.HY.empty,!0)))),e.copy(i)}function R(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function P(e){return e.spec.defining||e.spec.definingForContent}function z(e,t,n,i,o){if(t<n){let r=e.firstChild;e=e.replaceChild(0,r.copy(z(r.content,t+1,n,i,r)))}if(t>i){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(r.HY.empty,!0))}return e}function B(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}class L extends u{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 h.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 i=t.type.create(n,null,t.marks);return h.fromReplace(e,this.pos,this.pos+1,new r.p2(r.HY.from(i),0,t.isLeaf?0:1))}getMap(){return a.empty}invert(e){return new L(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new L(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new L(t.pos,t.attr,t.value)}}u.jsonID("attr",L);let j=class extends Error{};j=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(j.prototype=Object.create(Error.prototype)).constructor=j,j.prototype.name="TransformError";class ${constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new l}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new j(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}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=r.p2.empty){let i=N(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new r.p2(r.HY.from(n),0,0))}delete(e,t){return this.replace(e,t,r.p2.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,i){if(!i.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),s=e.doc.resolve(n);if(E(o,s,i))return e.step(new y(t,n,i));let a=B(o,e.doc.resolve(n));0==a[a.length-1]&&a.pop();let l=-(o.depth+1);a.unshift(l);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;a.indexOf(e)>-1?l=e:o.before(e)==t&&a.splice(1,0,-e)}let c=a.indexOf(l),u=[],h=i.openStart;for(let e=i.content,t=0;;t++){let n=e.firstChild;if(u.push(n),t==i.openStart)break;e=n.content}for(let e=h-1;e>=0;e--){let t=u[e].type,n=P(t);if(n&&o.node(c).type!=t)h=e;else if(n||!t.isTextblock)break}for(let t=i.openStart;t>=0;t--){let l=(t+h+1)%(i.openStart+1),d=u[l];if(d)for(let t=0;t<a.length;t++){let u=a[(t+c)%a.length],h=!0;u<0&&(h=!1,u=-u);let p=o.node(u-1),f=o.index(u-1);if(p.canReplaceWith(f,f,d.type,d.marks))return e.replace(o.before(u),h?s.after(u):n,new r.p2(z(i.content,0,i.openStart,l),l,i.openEnd))}}let d=e.steps.length;for(let r=a.length-1;r>=0&&(e.replace(t,n,i),!(e.steps.length>d));r--){let e=a[r];e<0||(t=o.before(e),n=s.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let r=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)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}(e.doc,t,i.type);null!=r&&(t=n=r)}e.replaceRange(t,n,new r.p2(r.HY.from(i),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=B(r,i);for(let t=0;t<o.length;t++){let n=o[t],s=t==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o)return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:i,$to:o,depth:s}=t,a=i.before(s+1),l=o.after(s+1),c=a,u=l,h=r.HY.empty,d=0;for(let e=s,t=!1;e>n;e--)t||i.index(e)>0?(t=!0,h=r.HY.from(i.node(e).copy(h)),d++):c--;let p=r.HY.empty,f=0;for(let e=s,t=!1;e>n;e--)t||o.after(e+1)<o.end(e)?(t=!0,p=r.HY.from(o.node(e).copy(p)),f++):u++;e.step(new k(c,u,a,l,new r.p2(h.append(p),d,f),h.size-d,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let i=new y(t-n,t+n,r.p2.empty,!0);e.step(i)}(this,e,t),this}wrap(e,t){return function(e,t,n){let i=r.HY.empty;for(let e=n.length-1;e>=0;e--){if(i.size){let t=n[e].type.contentMatch.matchFragment(i);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.HY.from(n[e].type.create(n[e].attrs,i))}let o=t.start,s=t.end;e.step(new k(o,s,o,s,new r.p2(i,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,i=null){return function(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(i,o)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(s).map(n),i)){e.clearIncompatible(e.mapping.slice(s).map(n,1),i);let a=e.mapping.slice(s),l=a.map(n,1),c=a.map(n+t.nodeSize,1);return e.step(new k(l,c,l+1,c-1,new r.p2(r.HY.from(i.create(o,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return function(e,t,n,i,o){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let a=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,a);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new k(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new r.p2(r.HY.from(a),0,0),1,!0))}(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new L(e,t,n)),this}addNodeMark(e,t){return this.step(new m(e,t)),this}removeNodeMark(e,t){if(!(t instanceof r.vc)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new g(e,t)),this}split(e,t=1,n){return function(e,t,n=1,i){let o=e.doc.resolve(t),s=r.HY.empty,a=r.HY.empty;for(let e=o.depth,t=o.depth-n,l=n-1;e>t;e--,l--){s=r.HY.from(o.node(e).copy(s));let t=i&&i[l];a=r.HY.from(t?t.type.create(t.attrs,a):o.node(e).copy(a))}e.step(new y(t,t,new r.p2(s.append(a),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),h=Math.min(l+e.nodeSize,n),d=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(d)||(i&&i.to==c&&i.mark.eq(u[e])?i.to=h:s.push(i=new f(c,h,u[e])));o&&o.to==c?o.to=h:a.push(o=new p(c,h,r))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,i){let o=[],s=0;e.doc.nodesBetween(t,n,((e,a)=>{if(!e.isInline)return;s++;let l=null;if(i instanceof r.ZU){let t,n=e.marks;for(;t=i.isInSet(n);)(l||(l=[])).push(t),n=t.removeFromSet(n)}else i?i.isInSet(e.marks)&&(l=[i]):l=e.marks;if(l&&l.length){let r=Math.min(a+e.nodeSize,n);for(let e=0;e<l.length;e++){let n,i=l[e];for(let e=0;e<o.length;e++){let t=o[e];t.step==s-1&&i.eq(o[e].style)&&(n=t)}n?(n.to=r,n.step=s):o.push({style:i,from:Math.max(a,t),to:r,step:s})}}})),o.forEach((t=>e.step(new f(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,i=n.contentMatch){let o=e.doc.nodeAt(t),s=[],a=t+1;for(let t=0;t<o.childCount;t++){let l=o.child(t),c=a+l.nodeSize,u=i.matchType(l.type);if(u){i=u;for(let t=0;t<l.marks.length;t++)n.allowsMarkType(l.marks[t].type)||e.step(new f(a,c,l.marks[t]))}else s.push(new y(a,c,r.p2.empty));a=c}if(!i.validEnd){let t=i.fillBefore(r.HY.empty,!0);e.replace(a,a,new r.p2(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}(this,e,t,n),this}}},2780:(e,t,n)=>{"use strict";n.d(t,{EH:()=>jt,p:()=>zt,tk:()=>an});var r=n(7191),i=n(2665),o=n(6151);const s=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},a=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let l=null;const c=function(e,t,n){let r=l||(l=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},u=function(e,t,n,r){return n&&(d(e,t,n,r,-1)||d(e,t,n,r,1))},h=/^(img|br|input|textarea|hr)$/i;function d(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:p(e))){let n=e.parentNode;if(!n||1!=n.nodeType||f(e)||h.test(e.nodeName)||"false"==e.contentEditable)return!1;t=s(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?p(e):0}}}function p(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function f(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const m=function(e){return e.focusNode&&u(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function g(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const y="undefined"!=typeof navigator?navigator:null,k="undefined"!=typeof document?document:null,v=y&&y.userAgent||"",w=/Edge\/(\d+)/.exec(v),x=/MSIE \d/.exec(v),b=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(v),S=!!(x||b||w),C=x?document.documentMode:b?+b[1]:w?+w[1]:0,M=!S&&/gecko\/(\d+)/i.test(v);M&&(/Firefox\/(\d+)/.exec(v)||[0,0])[1];const O=!S&&/Chrome\/(\d+)/.exec(v),N=!!O,E=O?+O[1]:0,T=!S&&!!y&&/Apple Computer/.test(y.vendor),A=T&&(/Mobile\/\w+/.test(v)||!!y&&y.maxTouchPoints>2),I=A||!!y&&/Mac/.test(y.platform),D=!!y&&/Win/.test(y.platform),F=/Android \d/.test(v),R=!!k&&"webkitFontSmoothing"in k.documentElement.style,P=R?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function z(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function B(e,t){return"number"==typeof e?e:e[t]}function L(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 j(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;s=a(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,a=n?z(o):L(e),l=0,c=0;if(t.top<a.top+B(r,"top")?c=-(a.top-t.top+B(i,"top")):t.bottom>a.bottom-B(r,"bottom")&&(c=t.bottom-a.bottom+B(i,"bottom")),t.left<a.left+B(r,"left")?l=-(a.left-t.left+B(i,"left")):t.right>a.right-B(r,"right")&&(l=t.right-a.right+B(i,"right")),l||c)if(n)o.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}if(n)break}}function $(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=a(r));return t}function V(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let H=null;function q(e,t){let n,r,i,o,s=2e8,a=0,l=t.top,u=t.top;for(let h=e.firstChild,d=0;h;h=h.nextSibling,d++){let e;if(1==h.nodeType)e=h.getClientRects();else{if(3!=h.nodeType)continue;e=c(h).getClientRects()}for(let c=0;c<e.length;c++){let p=e[c];if(p.top<=l&&p.bottom>=u){l=Math.max(p.bottom,l),u=Math.min(p.top,u);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<s){n=h,s=e,r=e&&3==n.nodeType?{left:p.right<t.left?p.right:p.left,top:t.top}:t,1==h.nodeType&&e&&(a=d+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!i&&p.left<=t.left&&p.right>=t.left&&(i=h,o={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&&i&&(n=i,r=o,s=0),n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=Y(r,1);if(n.top!=n.bottom&&W(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:e,offset:a}:q(n,r)}function W(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function _(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let n=e.childNodes[o];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(W(t,i))return _(n,t,i)}}if((o=(o+1)%r)==i)break}return e}function K(e,t){let n,r=e.dom.ownerDocument,i=0,o=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}(r,t.left,t.top);o&&({node:n,offset:i}=o);let s,l=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!l||!e.dom.contains(1!=l.nodeType?l.parentNode:l)){let n=e.dom.getBoundingClientRect();if(!W(t,n))return null;if(l=_(e.dom,t,n),!l)return null}if(T)for(let e=l;n&&e;e=a(e))e.draggable&&(n=void 0);if(l=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(l,t),n){if(M&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let e,r=n.childNodes[i];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(s=function(e,t,n,r){let i=-1;for(let n=t,o=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0);if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent&&!o||!t.contentDOM)){let e=t.dom.getBoundingClientRect();if(t.node.isBlock&&t.parent&&!o&&(o=!0,e.left>r.left||e.top>r.top?i=t.posBefore:(e.right<r.left||e.bottom<r.top)&&(i=t.posAfter)),!t.contentDOM&&i<0)return(t.node.isBlock?r.top<(e.top+e.bottom)/2:r.left<(e.left+e.right)/2)?t.posBefore:t.posAfter}n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}(e,n,i,t))}null==s&&(s=function(e,t,n){let{node:r,offset:i}=q(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,l,t));let c=e.docView.nearestDesc(l,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function U(e){return e.top<e.bottom||e.left<e.right}function Y(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(U(e))return e}return Array.prototype.find.call(n,U)||e.getBoundingClientRect()}const J=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function G(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=R||M;if(3==r.nodeType){if(!s||!J.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,Z(Y(c(r,e,t),o),o<0)}{let e=Y(c(r,i,i),n);if(M&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=Y(c(r,i-1,i-1),-1);if(t.top==e.top){let n=Y(c(r,i,i+1),-1);if(n.top!=e.top)return Z(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==p(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return X(e.getBoundingClientRect(),!1)}if(null==o&&i<p(r)){let e=r.childNodes[i];if(1==e.nodeType)return X(e.getBoundingClientRect(),!0)}return X(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==p(r))){let e=r.childNodes[i-1],t=3==e.nodeType?c(e,p(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return Z(Y(t,1),!1)}if(null==o&&i<p(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?c(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return Z(Y(t,-1),!0)}return Z(Y(3==r.nodeType?c(r):r,-n),n>=0)}function Z(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function X(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Q(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()}}const ee=/[\u0590-\u08ac]/;let te=null,ne=null,re=!1;class ie{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,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(1==e.nodeType?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>s(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}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;)r=r.children[0];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],o=t+i.size;if(o>e||i instanceof he){r=e-t;break}t=o}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 oe&&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?s(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?s(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,a=0;;a++){let n=this.children[a],l=o+n.size;if(-1==r&&e<=l){let i=o+n.border;if(e>=i&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=a;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=s(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(l>t||a==this.children.length-1)){t=l;for(let e=a+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=s(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=l}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 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(i>a&&o<c)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=c}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.getSelection(),c=!1;if((M||T)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType)c=!(!t||"\n"!=e.nodeValue[t-1]);else{let n=e.childNodes[t-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(M&&l.focusNode&&l.focusNode!=a.node&&1==l.focusNode.nodeType){let e=l.focusNode.childNodes[l.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||c&&T)&&u(s.node,s.offset,l.anchorNode,l.anchorOffset)&&u(a.node,a.offset,l.focusNode,l.focusOffset))return;let h=!1;if((l.extend||e==t)&&!c){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),h=!0}catch(e){}}if(!h){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}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],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s)return this.dirty=e==n||t==o?2:1,void(e!=r||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class oe extends ie{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,(()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r))),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class se extends ie{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.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class ae extends ie{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let o=r.nodeViews[t.type.name],s=o&&o(t,r,n);return s&&s.dom||(s=i.PW.renderSpec(document,t.type.spec.toDOM(t,n))),new ae(e,t,s.dom,s.contentDOM||s.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=ae.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=Ce(i,t,o,n)),e>0&&(i=Ce(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r}}class le extends ie{constructor(e,t,n,r,i,o,s,a,l){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,n,r,o,s){let a,l=o.nodeViews[t.type.name],c=l&&l(t,o,(()=>a?a.parent?a.parent.posBeforeChild(a):void 0:s),n,r),u=c&&c.dom,h=c&&c.contentDOM;if(t.isText)if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(t.text);else u||({dom:u,contentDOM:h}=i.PW.renderSpec(document,t.type.spec.toDOM(t)));h||t.isText||"BR"==u.nodeName||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let d=u;return u=ve(u,n,t),c?a=new de(e,t,n,r,u,h||null,d,c,o,s+1):t.isText?new ue(e,t,n,r,u,d,o):new le(e,t,n,r,u,h||null,d,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){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=()=>i.HY.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&we(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new be(this,s&&s.node,e);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){if(s<i.length&&i[s].to==o){let e,t=i[s++];for(;s<i.length&&i[s].to==o;)(e||(e=[t])).push(i[s++]);if(e){e.sort(Se);for(let t=0;t<e.length;t++)n(e[t],c,!!l)}else n(t,c,!!l)}let u,h;if(l)h=-1,u=l,l=null;else{if(!(c<e.childCount))break;h=c,u=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=o&&a.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let d=o+u.nodeSize;if(u.isText){let e=d;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<d&&(l=u.cut(e-o),u=u.cut(0,e-o),d=e,h=-1)}r(u,u.isInline&&!u.isLeaf?a.filter((e=>!e.inline)):a.slice(),t.forChild(o,u),h),o=d}}(this.node,this.innerDeco,((t,o,s)=>{t.spec.marks?l.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!s&&l.syncToMarks(o==this.node.childCount?i.vc.none:this.node.child(o).marks,n,e),l.placeWidget(t,e,r)}),((t,i,s,c)=>{let u;l.syncToMarks(t.marks,n,e),l.findNodeMatch(t,i,s,c)||a&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(t,i,s,u,e)||l.updateNextNode(t,i,s,e,c,r)||l.addNode(t,i,s,e,r),r+=t.nodeSize})),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(s&&this.protectLocalComposition(e,s),pe(this.contentDOM,this.children,e),A&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof r.Bs)||n<t||i>t+this.node.content.size)return null;let o=e.domSelectionRange(),s=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=p(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let e=s.nodeValue,r=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;l+=t.text}if(o>=n){let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,i-t);return r<0?null:{node:s,pos:r,text:e}}return{node:s,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 o=new se(this,i,t,r);e.input.compositionNodes.push(o),this.children=Ce(this.children,n,n+r.length,e,o)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node)||(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=0}updateOuterDeco(e){if(we(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=ye(this.dom,this.nodeDOM,ge(this.outerDeco,this.node,t),ge(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function ce(e,t,n,r,i){ve(r,t,e);let o=new le(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class ue extends le{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,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!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(t),0==this.dirty&&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=0,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"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new ue(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class he extends ie{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class de extends le{constructor(e,t,n,r,i,o,s,a,l,c){super(e,t,n,r,i,o,s,l,c),this.spec=a}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&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):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)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function pe(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=xe(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof ae){let t=r?r.previousSibling:e.lastChild;pe(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=xe(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const fe=function(e){e&&(this.nodeName=e)};fe.prototype=Object.create(null);const me=[new fe];function ge(e,t,n){if(0==e.length)return me;let r=n?me[0]:new fe,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new fe(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new fe(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}}return i}function ye(e,t,n,r){if(n==me&&r==me)return t;let i=t;for(let t=0;t<r.length;t++){let o=r[t],s=n[t];if(t){let t;s&&s.nodeName==o.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||(t=document.createElement(o.nodeName),t.pmIsDeco=!0,t.appendChild(i),s=me[0]),i=t}ke(i,s||me[0],o)}return i}function ke(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&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++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function ve(e,t,n){return ye(e,e,me,ge(t,n,1!=e.nodeType))}function we(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 xe(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class be{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof ae)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(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){let r=0,i=this.stack.length>>1,o=Math.min(i,e.length);for(;r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++){let n=this.top.children[t];if(n.matchesMark(e[i])&&!this.isLocked(n.dom)){r=t;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=ae.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let r=this.index,i=Math.min(this.top.children.length,r+5);r<i;r++){let i=this.top.children[r];if(i.matchesNode(e,t,n)&&!this.preMatch.matched.has(i)){o=r;break}}return!(o<0||(this.destroyBetween(this.index,o),this.index++,0))}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}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,o){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof le){let l=this.preMatch.matched.get(a);if(null!=l&&l!=i)return!1;let c,u=a.dom,h=this.isLocked(u)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&we(t,a.outerDeco));if(!h&&a.update(e,t,n,r))return this.destroyBetween(this.index,s),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(c=this.recreateWrapper(a,e,t,n,r,o)))return this.top.children[this.index]=c,c.dirty=2,c.updateChildren(r,o+1),c.dirty=0,this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let s=le.create(this.top,t,n,r,i,o);if(!s.contentDOM)return null;s.children=e.children,e.children=[];for(let e of s.children)e.parent=s;return s}addNode(e,t,n,r,i){let o=le.create(this.top,e,t,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),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){let r=new oe(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof ae;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof ue)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((T||N)&&e&&"false"==e.dom.contentEditable&&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);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new he(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function Se(e,t){return e.type.side-t.type.side}function Ce(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,u=a+=l.size;c>=n||u<=t?o.push(l):(c<t&&o.push(l.slice(0,t-c,r)),i&&(o.push(i),i=void 0),u>n&&o.push(l.slice(n-c,l.size,r)))}return o}function Me(e,t=null){let n=e.domSelectionRange(),i=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),a=o&&0==o.size,l=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(l<0)return null;let c,u,h=i.resolve(l);if(m(n)){for(c=h;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&r.qv.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==p(e);r||i;){if(e==n)return!0;let t=s(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==p(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;u=new r.qv(l==e?h:i.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;c=i.resolve(t)}return u||(u=Re(e,c,h,"pointer"==t||e.state.selection.head<h.pos&&!a?1:-1)),u}function Oe(e){return e.editable?e.hasFocus():ze(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Ne(e,t=!1){let n=e.state.selection;if(De(e,n),Oe(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&N){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&u(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,s(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&S&&C<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let i,o,{anchor:s,head:a}=n;!Ee||n instanceof r.Bs||(n.$from.parent.inlineContent||(i=Te(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=Te(e,n.to))),e.docView.setSelection(s,a,e.root,t),Ee&&(i&&Ie(i),o&&Ie(o)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(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((()=>{Oe(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Ee=T||N&&E<63;function Te(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(T&&i&&"false"==i.contentEditable)return Ae(i);if(!(i&&"false"!=i.contentEditable||o&&"false"!=o.contentEditable)){if(i)return Ae(i);if(o)return Ae(o)}}function Ae(e){return e.contentEditable="true",T&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Ie(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function De(e,t){if(t instanceof r.qv){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Fe(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Fe(e)}function Fe(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Re(e,t,n,i){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||r.Bs.between(t,n,i)}function Pe(e){return!(e.editable&&!e.hasFocus())&&ze(e)}function ze(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function Be(e,t){let{$anchor:n,$head:i}=e.selection,o=t>0?n.max(i):n.min(i),s=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return s&&r.Y1.findFrom(s,t)}function Le(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function je(e,t,n){let i=e.state.selection;if(!(i instanceof r.Bs)){if(i instanceof r.qv&&i.node.isInline)return Le(e,new r.Bs(t>0?i.$to:i.$from));{let n=Be(e.state,t);return!!n&&Le(e,n)}}if(!i.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=Be(e.state,t);return!!(n&&n instanceof r.qv)&&Le(e,n)}if(!(I&&n.indexOf("m")>-1)){let n,o=i.$head,s=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!s||s.isText)return!1;let a=t<0?o.pos-s.nodeSize:o.pos;return!!(s.isAtom||(n=e.docView.descAt(a))&&!n.contentDOM)&&(r.qv.isSelectable(s)?Le(e,new r.qv(t<0?e.state.doc.resolve(o.pos-s.nodeSize):o)):!!R&&Le(e,new r.Bs(e.state.doc.resolve(t<0?a:a+s.nodeSize))))}}function $e(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Ve(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function He(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(M&&1==n.nodeType&&r<$e(n)&&Ve(n.childNodes[r])&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(Ve(e))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(We(n))break;{let t=n.previousSibling;for(;t&&Ve(t);)i=n.parentNode,o=s(t),t=t.previousSibling;if(t)n=t,r=$e(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?_e(e,n,r):i&&_e(e,i,o)}(e):qe(e)}function qe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=$e(n);for(;;)if(r<a){if(1!=n.nodeType)break;if(!Ve(n.childNodes[r]))break;i=n,o=++r}else{if(We(n))break;{let t=n.nextSibling;for(;t&&Ve(t);)i=t.parentNode,o=s(t)+1,t=t.nextSibling;if(t)n=t,r=0,a=$e(n);else{if(n=n.parentNode,n==e.dom)break;r=a=0}}}i&&_e(e,i,o)}function We(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function _e(e,t,n){let r=e.domSelection();if(m(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&&Ne(e)}),50)}function Ke(e,t){let n=e.state.doc.resolve(t);if(!N&&!D&&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"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function Ue(e,t,n){let i=e.state.selection;if(i instanceof r.Bs&&!i.empty||n.indexOf("s")>-1)return!1;if(I&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=i;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Be(e.state,t);if(n&&n instanceof r.qv)return Le(e,n)}if(!o.parent.inlineContent){let n=t<0?o:s,a=i instanceof r.C1?r.Y1.near(n,t):r.Y1.findFrom(n,t);return!!a&&Le(e,a)}return!1}function Ye(e,t){if(!(e.state.selection instanceof r.Bs))return!0;let{$head:n,$anchor:i,empty:o}=e.state.selection;if(!n.sameParent(i))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let r=e.state.tr;return t<0?r.delete(n.pos-s.nodeSize,n.pos):r.delete(n.pos,n.pos+s.nodeSize),e.dispatch(r),!0}return!1}function Je(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Ge(e,t){e.someProp("transformCopied",(n=>{t=n(t,e)}));let n=[],{content:r,openStart:o,openEnd:s}=t;for(;o>1&&s>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,s--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let a=e.someProp("clipboardSerializer")||i.PW.fromSchema(e.state.schema),l=st(),c=l.createElement("div");c.appendChild(a.serializeFragment(r,{document:l}));let u,h=c.firstChild,d=0;for(;h&&1==h.nodeType&&(u=it[h.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=l.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}h=c.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",`${o} ${s}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:c,text:e.someProp("clipboardTextSerializer",(n=>n(t,e)))||t.content.textBetween(0,t.content.size,"\n\n")}}function Ze(e,t,n,r,o){let s,a,l=o.parent.type.spec.code;if(!n&&!t)return null;let c=t&&(r||l||!n);if(c){if(e.someProp("transformPastedText",(n=>{t=n(t,l||r,e)})),l)return t?new i.p2(i.HY.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):i.p2.empty;let n=e.someProp("clipboardTextParser",(n=>n(t,o,r,e)));if(n)a=n;else{let n=o.marks(),{schema:r}=e.state,a=i.PW.fromSchema(r);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=s.appendChild(document.createElement("p"));e&&t.appendChild(a.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(t=>{n=t(n,e)})),s=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=st().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);if((n=i&&it[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join("")),r.innerHTML=e,n)for(let e=0;e<n.length;e++)r=r.querySelector(n[e])||r;return r}(n),R&&function(e){let t=e.querySelectorAll(N?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(s);let u=s&&s.querySelector("[data-pm-slice]"),h=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let e=+h[3];e>0;e--){let e=s.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;s=e}if(!a){let t=e.someProp("clipboardParser")||e.someProp("domParser")||i.aw.fromSchema(e.state.schema);a=t.parseSlice(s,{preserveWhitespace:!(!c&&!h),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Xe.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(h)a=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:o,openStart:s,openEnd:a}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;o=i.HY.from(t.create(n[e+1],o)),s++,a++}return new i.p2(o,s,a)}(rt(a,+h[1],+h[2]),h[4]);else if(a=i.p2.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,o=t.node(n).contentMatchAt(t.index(n)),s=[];if(e.forEach((e=>{if(!s)return;let t,n=o.findWrapping(e.type);if(!n)return s=null;if(t=s.length&&r.length&&et(n,r,e,s[s.length-1],0))s[s.length-1]=t;else{s.length&&(s[s.length-1]=tt(s[s.length-1],r.length));let t=Qe(e,n);s.push(t),o=o.matchType(t.type),r=n}})),s)return i.HY.from(s)}return e}(a.content,o),!0),a.openStart||a.openEnd){let e=0,t=0;for(let t=a.content.firstChild;e<a.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=a.content.lastChild;t<a.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);a=rt(a,e,t)}return e.someProp("transformPasted",(t=>{a=t(a,e)})),a}const Xe=/^(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 Qe(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,i.HY.from(e));return e}function et(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let s=et(e,t,n,r.lastChild,o+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(i.HY.from(Qe(n,e,o+1))))}}function tt(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,tt(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(i.HY.empty,!0);return e.copy(n.append(r))}function nt(e,t,n,r,o,s){let a=t<0?e.firstChild:e.lastChild,l=a.content;return e.childCount>1&&(s=0),o<r-1&&(l=nt(l,t,n,r,o+1,s)),o>=n&&(l=t<0?a.contentMatchAt(0).fillBefore(l,s<=o).append(l):l.append(a.contentMatchAt(a.childCount).fillBefore(i.HY.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(l))}function rt(e,t,n){return t<e.openStart&&(e=new i.p2(nt(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new i.p2(nt(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const it={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let ot=null;function st(){return ot||(ot=document.implementation.createHTMLDocument("title"))}const at={},lt={},ct={touchstart:!0,touchmove:!0};class ut{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function ht(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function dt(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>pt(e,t))}))}function pt(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function ft(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||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function mt(e){return{left:e.clientX,top:e.clientY}}function gt(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,(t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1))))return!0;return!1}function yt(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function kt(e,t,n,r){return gt(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function vt(e,t,n,i){return gt(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",(n=>n(e,t,i)))||function(e,t,n){if(0!=n.button)return!1;let i=e.state.doc;if(-1==t)return!!i.inlineContent&&(yt(e,r.Bs.create(i,0,i.content.size),"pointer"),!0);let o=i.resolve(t);for(let t=o.depth+1;t>0;t--){let n=t>o.depth?o.nodeAfter:o.node(t),s=o.before(t);if(n.inlineContent)yt(e,r.Bs.create(i,s+1,s+1+n.content.size),"pointer");else{if(!r.qv.isSelectable(n))continue;yt(e,r.qv.create(i,s),"pointer")}return!0}}(e,n,i)}function wt(e){return Nt(e)}lt.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!St(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!F||!N||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!A||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||function(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||I&&72==n&&"c"==r)return Ye(e,-1)||He(e,-1);if(46==n||I&&68==n&&"c"==r)return Ye(e,1)||He(e,1);if(13==n||27==n)return!0;if(37==n||I&&66==n&&"c"==r){let t=37==n?"ltr"==Ke(e,e.state.selection.from)?-1:1:-1;return je(e,t,r)||He(e,t)}if(39==n||I&&70==n&&"c"==r){let t=39==n?"ltr"==Ke(e,e.state.selection.from)?1:-1:1;return je(e,t,r)||He(e,t)}return 38==n||I&&80==n&&"c"==r?Ue(e,-1,r)||He(e,-1):40==n||I&&78==n&&"c"==r?function(e){if(!T||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Je(e,n,"true"),setTimeout((()=>Je(e,n,"false")),20)}return!1}(e)||Ue(e,1,r)||qe(e):r==(I?"m":"c")&&(66==n||73==n||89==n||90==n)}(e,n)?n.preventDefault():ht(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},lt.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},lt.keypress=(e,t)=>{let n=t;if(St(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||I&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let i=e.state.selection;if(!(i instanceof r.Bs&&i.$from.sameParent(i.$to))){let t=String.fromCharCode(n.charCode);/[\r\n]/.test(t)||e.someProp("handleTextInput",(n=>n(e,i.$from.pos,i.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const xt=I?"metaKey":"ctrlKey";at.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=wt(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[xt]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(mt(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new bt(e,s,n,!!r)):("doubleClick"==o?kt:vt)(e,s.pos,s.inside,n)?n.preventDefault():ht(e,"pointer"))};class bt{constructor(e,t,n,i){let o,s;if(this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[xt],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,s=n.depth?n.before():0}const a=i?null:n.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=e.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||c instanceof r.qv&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!M||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)),ht(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((()=>Ne(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(mt(e))),this.updateAllowDefault(e),this.allowDefault||!t?ht(this.view,"pointer"):function(e,t,n,i,o){return gt(e,"handleClickOn",t,n,i)||e.someProp("handleClick",(n=>n(e,t,i)))||(o?function(e,t){if(-1==t)return!1;let n,i,o=e.state.selection;o instanceof r.qv&&(n=o.node);let s=e.state.doc.resolve(t);for(let e=s.depth+1;e>0;e--){let t=e>s.depth?s.nodeAfter:s.node(e);if(r.qv.isSelectable(t)){i=n&&o.$from.depth>0&&e>=o.$from.depth&&s.before(o.$from.depth+1)==o.$from.pos?s.before(o.$from.depth):s.before(e);break}}return null!=i&&(yt(e,r.qv.create(e.state.doc,i),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return!!(i&&i.isAtom&&r.qv.isSelectable(i))&&(yt(e,new r.qv(n),"pointer"),!0)}(e,n))}(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||T&&this.mightDrag&&!this.mightDrag.node.isAtom||N&&!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)?(yt(this.view,r.Y1.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):ht(this.view,"pointer")}move(e){this.updateAllowDefault(e),ht(this.view,"pointer"),0==e.buttons&&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)}}function St(e,t){return!!e.composing||!!(T&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}at.touchstart=e=>{e.input.lastTouch=Date.now(),wt(e),ht(e,"pointer")},at.touchmove=e=>{e.input.lastTouch=Date.now(),ht(e,"pointer")},at.contextmenu=e=>wt(e);const Ct=F?5e3:-1;function Mt(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>Nt(e)),t))}function Ot(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Nt(e,t=!1){if(!(F&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Ot(e),t||e.docView&&e.docView.dirty){let t=Me(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}lt.compositionstart=lt.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),Nt(e,!0),e.markCursor=null;else if(Nt(e),M&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){e.domSelection().collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}Mt(e,Ct)},lt.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionID++,Mt(e,20))};const Et=S&&C<15||A&&P<604;function Tt(e,t,n,r,o){let s=Ze(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,o,s||i.p2.empty))))return!0;if(!s)return!1;let a=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(s),l=a?e.state.tr.replaceSelectionWith(a,e.input.shiftKey):e.state.tr.replaceSelection(s);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}at.copy=lt.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=Et?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Ge(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(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)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},lt.paste=(e,t)=>{let n=t;if(e.composing&&!F)return;let r=Et?null:n.clipboardData;r&&Tt(e,r.getData("text/plain"),r.getData("text/html"),e.input.shiftKey,n)?n.preventDefault():function(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(),setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Tt(e,r.value,null,e.input.shiftKey,t):Tt(e,r.textContent,r.innerHTML,e.input.shiftKey,t)}),50)}(e,n)};class At{constructor(e,t){this.slice=e,this.move=t}}const It=I?"altKey":"ctrlKey";at.dragstart=(e,t)=>{let n=t,i=e.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let o=e.state.selection,s=o.empty?null:e.posAtCoords(mt(n));if(s&&s.pos>=o.from&&s.pos<=(o instanceof r.qv?o.to-1:o.to));else if(i&&i.mightDrag)e.dispatch(e.state.tr.setSelection(r.qv.create(e.state.doc,i.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(r.qv.create(e.state.doc,t.posBefore)))}let a=e.state.selection.content(),{dom:l,text:c}=Ge(e,a);n.dataTransfer.clearData(),n.dataTransfer.setData(Et?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Et||n.dataTransfer.setData("text/plain",c),e.dragging=new At(a,!n[It])},at.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},lt.dragover=lt.dragenter=(e,t)=>t.preventDefault(),lt.drop=(e,t)=>{let n=t,s=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let a=e.posAtCoords(mt(n));if(!a)return;let l=e.state.doc.resolve(a.pos),c=s&&s.slice;c?e.someProp("transformPasted",(t=>{c=t(c,e)})):c=Ze(e,n.dataTransfer.getData(Et?"Text":"text/plain"),Et?null:n.dataTransfer.getData("text/html"),!1,l);let u=!(!s||n[It]);if(e.someProp("handleDrop",(t=>t(e,n,c||i.p2.empty,u))))return void n.preventDefault();if(!c)return;n.preventDefault();let h=c?(0,o.nj)(e.state.doc,l.pos,c):l.pos;null==h&&(h=l.pos);let d=e.state.tr;u&&d.deleteSelection();let p=d.mapping.map(h),f=0==c.openStart&&0==c.openEnd&&1==c.content.childCount,m=d.doc;if(f?d.replaceRangeWith(p,p,c.content.firstChild):d.replaceRange(p,p,c),d.doc.eq(m))return;let g=d.doc.resolve(p);if(f&&r.qv.isSelectable(c.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(c.content.firstChild))d.setSelection(new r.qv(g));else{let t=d.mapping.map(h);d.mapping.maps[d.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),d.setSelection(Re(e,g,d.doc.resolve(t)))}e.focus(),e.dispatch(d.setMeta("uiEvent","drop"))},at.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())&&Ne(e)}),20))},at.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},at.beforeinput=(e,t)=>{if(N&&F&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,g(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 lt)at[e]=lt[e];function Dt(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Ft{constructor(e,t){this.toDOM=e,this.spec=t||Lt,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new zt(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Ft&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Dt(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Rt{constructor(e,t){this.attrs=e,this.spec=t||Lt}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new zt(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Rt&&Dt(this.attrs,e.attrs)&&Dt(this.spec,e.spec)}static is(e){return e.type instanceof Rt}destroy(){}}class Pt{constructor(e,t){this.attrs=e,this.spec=t||Lt}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new zt(i.pos-n,o.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof Pt&&Dt(this.attrs,e.attrs)&&Dt(this.spec,e.spec)}destroy(){}}class zt{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new zt(e,t,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(e,t,n){return new zt(e,e,new Ft(t,n))}static inline(e,t,n,r){return new zt(e,t,new Rt(n,r))}static node(e,t,n,r){return new zt(e,t,new Pt(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Rt}}const Bt=[],Lt={};class jt{constructor(e,t){this.local=e.length?e:Bt,this.children=t.length?t:Bt}static create(e,t){return t.length?_t(t,e,0,Lt):$t}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==$t||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Lt)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let a=e.slice();for(let e=0,t=o;e<n.maps.length;e++){let r=0;n.maps[e].forEach(((e,n,o,s)=>{let l=s-o-(n-e);for(let s=0;s<a.length;s+=3){let c=a[s+1];if(c<0||e>c+t-r)continue;let u=a[s]+t-r;n>=u?a[s+1]=e<=u?-2:-1:o>=i&&l&&(a[s]+=l,a[s+1]+=l)}r+=l})),t=n.maps[e].map(t,-1)}let l=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){l=!0,a[t+1]=-1;continue}let c=n.map(e[t]+o),u=c-i;if(u<0||u>=r.content.size){l=!0;continue}let h=n.map(e[t+1]+o,-1)-i,{index:d,offset:p}=r.content.findIndex(u),f=r.maybeChild(d);if(f&&p==u&&p+f.nodeSize==h){let r=a[t+2].mapInner(n,f,c+1,e[t]+o+1,s);r!=$t?(a[t]=u,a[t+1]=h,a[t+2]=r):(a[t+1]=-2,l=!0)}else l=!0}if(l){let l=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o<e.local.length;o++){let a=e.local[o].map(r,i,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&a(e[n+2],t[n]+o+1);return n}(a,e,t,n,i,o,s),c=_t(l,r,0,s);t=c.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new jt(t.sort(Kt),a)}(this.children,o||[],e,t,n,r,i):o?new jt(o.sort(Kt),Bt):$t}add(e,t){return t.length?this==$t?jt.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach(((e,o)=>{let s,a=o+n;if(s=qt(t,e,a)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,s,a+1):r.splice(i,0,o,o+e.nodeSize,_t(s,e,a+1,Lt)),i+=3}}));let o=Ht(i?Wt(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new jt(o.length?this.local.concat(o).sort(Kt):this.local,r||this.children)}remove(e){return 0==e.length||this==$t?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(i||(i=[])).push(t));if(!i)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(i,o+1);a!=$t?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,i=0;i<e.length;i++)if(n=e[i])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new jt(r,n):$t}forChild(e,t){if(this==$t)return this;if(t.isLeaf)return jt.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof Rt){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new jt(r.sort(Kt),Bt);return n?new Vt([e,n]):e}return n||$t}eq(e){if(this==e)return!0;if(!(e instanceof jt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Ut(this.localsInner(e))}localsInner(e){if(this==$t)return Bt;if(e.inlineContent||!this.local.some(Rt.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Rt||t.push(this.local[e]);return t}}jt.empty=new jt([],[]),jt.removeOverlap=Ut;const $t=jt.empty;class Vt{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,Lt)));return Vt.from(n)}forChild(e,t){if(t.isLeaf)return jt.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=$t&&(i instanceof Vt?n=n.concat(i.members):n.push(i))}return Vt.from(n)}eq(e){if(!(e instanceof Vt)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))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){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?Ut(n?t:t.sort(Kt)):Bt}static from(e){switch(e.length){case 0:return $t;case 1:return e[0];default:return new Vt(e.every((e=>e instanceof jt))?e:e.reduce(((e,t)=>e.concat(t instanceof jt?t:t.members)),[]))}}}function Ht(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new zt(i.from+t,i.to+t,i.type))}return n}function qt(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t,o=0;o<e.length;o++)(t=e[o])&&t.from>n&&t.to<r&&((i||(i=[])).push(t),e[o]=null);return i}function Wt(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function _t(e,t,n,r){let i=[],o=!1;t.forEach(((t,s)=>{let a=qt(e,t,s+n);if(a){o=!0;let e=_t(a,t,n+s+1,r);e!=$t&&i.push(s,s+t.nodeSize,e)}}));let s=Ht(o?Wt(e):e,-n).sort(Kt);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new jt(s,i):$t}function Kt(e,t){return e.from-t.from||e.to-t.to}function Ut(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),Yt(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),Yt(t,i+1,o.copy(r.to,o.to)))}}return t}function Yt(e,t,n){for(;t<e.length&&Kt(n,e[t])>0;)t++;e.splice(t,0,n)}function Jt(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=$t&&t.push(r)})),e.cursorWrapper&&t.push(jt.create(e.state.doc,[e.cursorWrapper.deco])),Vt.from(t)}const Gt={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Zt=S&&C<=11;class Xt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Qt{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Xt,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);S&&C<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),Zt&&(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,Gt)),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(Pe(this.view)){if(this.suppressingSelectionUpdates)return Ne(this.view);if(S&&C<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&u(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,n=new Set;for(let t=e.focusNode;t;t=a(t))n.add(t);for(let r=e.anchorNode;r;r=a(r))if(n.has(r)){t=r;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Pe(e)&&!this.ignoreSelectionChange(n),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],l);n&&(o=o<0?n.from:Math.min(n.from,o),s=s<0?n.to:Math.max(n.to,s),n.typeOver&&(a=!0))}if(M&&l.length>1){let e=l.filter((e=>"BR"==e.nodeName));if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&m(n)&&(c=Me(e))&&c.eq(r.Y1.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ne(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),function(e){if(!en.has(e)&&(en.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))){if(e.requiresGeckoHackNode=M,tn)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."),tn=!0}}(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Ne(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("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++)t.push(e.addedNodes[n]);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(S&&C<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!o||Array.prototype.indexOf.call(e.addedNodes,o)<0)&&(i=o)}let o=r&&r.parentNode==e.target?s(r)+1:0,a=n.localPosFromDOM(e.target,o,-1),l=i&&i.parentNode==e.target?s(i):e.target.childNodes.length;return{from:a,to:n.localPosFromDOM(e.target,l,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let en=new WeakMap,tn=!1;function nn(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(T&&/^(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||T&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const rn=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function on(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Re(e,t.resolve(n.anchor),t.resolve(n.head))}function sn(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}class an{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 ut,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(dn),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=un(this),cn(this),this.nodeViews=hn(this),this.docView=ce(this.state.doc,ln(this),Jt(this),this.dom,this),this.domObserver=new Qt(this,((e,t,n,o)=>function(e,t,n,o,s){if(t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Me(e,t);if(n&&!e.state.selection.eq(n)){if(N&&F&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),e.composing&&r.setMeta("composition",e.input.compositionID),e.dispatch(r)}return}let a=e.state.doc.resolve(t),l=a.sharedDepth(n);t=a.before(l+1),n=e.state.doc.resolve(n).after(l+1);let c,u,h=e.state.selection,d=function(e,t,n){let r,{node:o,fromOffset:s,toOffset:a,from:l,to:c}=e.docView.parseRange(t,n),u=e.domSelectionRange(),h=u.anchorNode;if(h&&e.dom.contains(1==h.nodeType?h:h.parentNode)&&(r=[{node:h,offset:u.anchorOffset}],m(u)||r.push({node:u.focusNode,offset:u.focusOffset})),N&&8===e.input.lastKeyCode)for(let e=a;e>s;e--){let t=o.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,p=e.someProp("domParser")||i.aw.fromSchema(e.state.schema),f=d.resolve(l),g=null,y=p.parse(o,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:s,to:a,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:nn,context:f});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),g={anchor:e+l,head:t+l}}return{doc:y,sel:g,from:l,to:c}}(e,t,n),p=e.state.doc,f=p.slice(d.from,d.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(c=e.state.selection.to,u="end"):(c=e.state.selection.from,u="start"),e.input.lastKeyCode=null;let y=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);return"end"==i&&(r-=s+Math.max(0,o-Math.min(s,a))-o),s<o&&e.size<t.size?(o-=r<=o&&r>=s?o-r:0,a=o+(a-s),s=o):a<o&&(o-=r<=o&&r>=a?o-r:0,s=o+(s-a),a=o),{start:o,endA:s,endB:a}}(f.content,d.doc.content,d.from,c,u);if((A&&e.input.lastIOSEnter>Date.now()-225||F)&&s.some((e=>1==e.nodeType&&!rn.test(e.nodeName)))&&(!y||y.endA>=y.endB)&&e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!y){if(!(o&&h instanceof r.Bs&&!h.empty&&h.$head.sameParent(h.$anchor))||e.composing||d.sel&&d.sel.anchor!=d.sel.head){if(d.sel){let t=on(e,e.state.doc,d.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);e.composing&&n.setMeta("composition",e.input.compositionID),e.dispatch(n)}}return}y={start:h.from,endA:h.to,endB:h.to}}if(N&&e.cursorWrapper&&d.sel&&d.sel.anchor==e.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let e=y.endB-y.start;d.sel={anchor:d.sel.anchor+e,head:d.sel.anchor+e}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&y.start==y.endB&&e.state.selection instanceof r.Bs&&(y.start>e.state.selection.from&&y.start<=e.state.selection.from+2&&e.state.selection.from>=d.from?y.start=e.state.selection.from:y.endA<e.state.selection.to&&y.endA>=e.state.selection.to-2&&e.state.selection.to<=d.to&&(y.endB+=e.state.selection.to-y.endA,y.endA=e.state.selection.to)),S&&C<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>d.from&&" "==d.doc.textBetween(y.start-d.from-1,y.start-d.from+1)&&(y.start--,y.endA--,y.endB--);let k,v=d.doc.resolveNoCache(y.start-d.from),w=d.doc.resolveNoCache(y.endB-d.from),x=p.resolve(y.start),b=v.sameParent(w)&&v.parent.inlineContent&&x.end()>=y.endA;if((A&&e.input.lastIOSEnter>Date.now()-225&&(!b||s.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!b&&v.pos<d.doc.content.size&&(k=r.Y1.findFrom(d.doc.resolve(v.pos+1),1,!0))&&k.head==w.pos)&&e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>y.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||sn(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(sn(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||sn(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(p,y.start,y.endA,v,w)&&e.someProp("handleKeyDown",(t=>t(e,g(8,"Backspace")))))return void(F&&N&&e.domObserver.suppressSelectionUpdates());N&&F&&y.endB==y.start&&(e.input.lastAndroidDelete=Date.now()),F&&!b&&v.start()!=w.start()&&0==w.parentOffset&&v.depth==w.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==y.endA&&(y.endB-=2,w=d.doc.resolveNoCache(y.endB-d.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,g(13,"Enter"))}))}),20));let M,O,E,T=y.start,I=y.endA;if(b)if(v.pos==w.pos)S&&C<=11&&0==v.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Ne(e)),20)),M=e.state.tr.delete(T,I),O=p.resolve(y.start).marksAcross(p.resolve(y.endA));else if(y.endA==y.endB&&(E=function(e,t){let n,r,o,s=e.firstChild.marks,a=t.firstChild.marks,l=s,c=a;for(let e=0;e<a.length;e++)l=a[e].removeFromSet(l);for(let e=0;e<s.length;e++)c=s[e].removeFromSet(c);if(1==l.length&&0==c.length)r=l[0],n="add",o=e=>e.mark(r.addToSet(e.marks));else{if(0!=l.length||1!=c.length)return null;r=c[0],n="remove",o=e=>e.mark(r.removeFromSet(e.marks))}let u=[];for(let e=0;e<t.childCount;e++)u.push(o(t.child(e)));if(i.HY.from(u).eq(e))return{mark:r,type:n}}(v.parent.content.cut(v.parentOffset,w.parentOffset),x.parent.content.cut(x.parentOffset,y.endA-x.start()))))M=e.state.tr,"add"==E.type?M.addMark(T,I,E.mark):M.removeMark(T,I,E.mark);else if(v.parent.child(v.index()).isText&&v.index()==w.index()-(w.textOffset?0:1)){let t=v.parent.textBetween(v.parentOffset,w.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,T,I,t))))return;M=e.state.tr.insertText(t,T,I)}if(M||(M=e.state.tr.replace(T,I,d.doc.slice(y.start-d.from,y.endB-d.from))),d.sel){let t=on(e,M.doc,d.sel);t&&!(N&&F&&e.composing&&t.empty&&(y.start!=y.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==T||t.head==M.mapping.map(I)-1)||S&&t.empty&&t.head==T)&&M.setSelection(t)}O&&M.ensureMarks(O),e.composing&&M.setMeta("composition",e.input.compositionID),e.dispatch(M.scrollIntoView())}(this,e,t,n,o))),this.domObserver.start(),function(e){for(let t in at){let n=at[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!ft(e,t)||pt(e,t)||!e.editable&&t.type in lt||n(e,t)},ct[t]?{passive:!0}:void 0)}T&&e.dom.addEventListener("input",(()=>null)),dt(e)}(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&&dt(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(dn),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&&(Ot(this),i=!0),this.state=e;let o=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(o||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=hn(this);(function(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})(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(o||t.handleDOMEvents!=this._props.handleDOMEvents)&&dt(this),this.editable=un(this),cn(this);let s=Jt(this),a=ln(this),l=n.plugins==e.plugins||n.doc.eq(e.doc)?e.scrollToSelection>n.scrollToSelection?"to selection":"preserve":"reset",c=r||!this.docView.matchesNode(e.doc,a,s);!c&&e.selection.eq(n.selection)||(i=!0);let h="preserve"==l&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=i-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:$(e.dom)}}(this);if(i){this.domObserver.stop();let t=c&&(S||N)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(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)}(n.selection,e.selection);if(c){let n=N?this.trackWrites=this.domSelectionRange().focusNode:null;!r&&this.docView.update(e.doc,a,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ce(e.doc,a,s,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return u(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Ne(this,t):(De(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():h&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;V(n,0==r?0:r-t)}(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof r.qv){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&j(this,t.getBoundingClientRect(),e)}else j(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)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{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))}}}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let i=this.directPlugins[r].props[e];if(null!=i&&(n=t?t(i):i))return n}let i=this.state.plugins;if(i)for(let r=0;r<i.length;r++){let o=i[r].props[e];if(null!=o&&(n=t?t(o):o))return n}}hasFocus(){if(S){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("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(H)return e.focus(H);let t=$(e);e.focus(null==H?{get preventScroll(){return H={preventScroll:!0},!0}}:void 0),H||(H=!1,V(t,0))}(this.dom),Ne(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}posAtCoords(e){return K(this,e)}coordsAtPos(e,t=1){return G(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(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){return te==t&&ne==n?re:(te=t,ne=n,re="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return Q(e,t,(()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-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=G(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=c(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return ee.test(r.parent.textContent)&&a.modify?Q(e,t,(()=>{let{focusNode:t,focusOffset:i,anchorNode:o,anchorOffset:s}=e.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:h}=e.domSelectionRange(),d=u&&!c.contains(1==u.nodeType?u:u.parentNode)||t==u&&i==h;try{a.collapse(o,s),t&&(t!=o||i!=s)&&a.extend&&a.extend(t,i)}catch(e){}return null!=l&&(a.caretBidiLevel=l),d})):"left"==n||"backward"==n?o:s}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return Tt(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Tt(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(function(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)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Jt(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){pt(e,t)||!at[t.type]||!e.editable&&t.type in lt||at[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return T&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom?function(e){let t;function n(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",n,!0);let r=t.startContainer,i=t.startOffset,o=t.endContainer,s=t.endOffset,a=e.domAtPos(e.state.selection.anchor);return u(a.node,a.offset,o,s)&&([r,i,o,s]=[o,s,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function ln(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),t.translate||(t.translate="no"),[zt.node(0,e.state.doc.content.size,t)]}function cn(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:zt.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function un(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function hn(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 dn(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}},7689:(e,t,n)=>{"use strict";n.d(t,{O:()=>r});const r=function(e){if(null==e)return o;if("string"==typeof e)return t=e,i((function(e){return e&&e.type===t}));var t;if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=r(e[n]);return i((function(...e){let n=-1;for(;++n<t.length;)if(t[n].call(this,...e))return!0;return!1}))}(e):function(e){return i((function(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0}))}(e);if("function"==typeof e)return i(e);throw new Error("Expected function, string, or object as test")};function i(e){return function(t,...n){return Boolean(t&&"object"==typeof t&&"type"in t&&Boolean(e.call(this,t,...n)))}}function o(){return!0}},1104:(e,t,n)=>{"use strict";n.d(t,{BK:()=>i,AM:()=>o,S4:()=>s});var r=n(7689);const i=!1,o="skip",s=function(e,t,n,s){"function"==typeof t&&"function"!=typeof n&&(s=n,n=t,t=null);const a=(0,r.O)(t),l=s?-1:1;!function e(r,c,u){const h=r&&"object"==typeof r?r:{};if("string"==typeof h.type){const e="string"==typeof h.tagName?h.tagName:"string"==typeof h.name?h.name:void 0;Object.defineProperty(d,"name",{value:"node ("+r.type+(e?"<"+e+">":"")+")"})}return d;function d(){let h,d,p,f=[];if((!t||a(r,c,u[u.length-1]||null))&&(f=function(e){return Array.isArray(e)?e:"number"==typeof e?[!0,e]:[e]}(n(r,u)),f[0]===i))return f;if(r.children&&f[0]!==o)for(d=(s?r.children.length:-1)+l,p=u.concat(r);d>-1&&d<r.children.length;){if(h=e(r.children[d],d,p)(),h[0]===i)return h;d="number"==typeof h[1]?h[1]:d+l}return f}}(e,void 0,[])()}},6355:(e,t,n)=>{"use strict";n.d(t,{Vn:()=>i});var r=n(1104);const i=function(e,t,n,i){"function"==typeof t&&"function"!=typeof n&&(i=n,n=t,t=null),(0,r.S4)(e,t,(function(e,t){const r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}),i)}}}]);
|
|
3
|
-
//# sourceMappingURL=287.13f9cb86.js.map
|