/*! For license information please see 976bee94.js.LICENSE.txt */
(self.webpackChunk_articulate_mondrian_bundles=self.webpackChunk_articulate_mondrian_bundles||[]).push([[342,356],{2806: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,s,i){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(o[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&o[d[0]]||(void 0!==i&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=i),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),s&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=s):d[4]="".concat(s)),t.push(d))}},t}},1182:e=>{"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),i="/*# ".concat(s," */");return[t].concat([i]).join("\n")}return[t].join("\n")}},1741:(e,t,n)=>{var r=n(5289).Symbol;e.exports=r},7888:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}},9052:(e,t,n)=>{var r=n(1741),s=n(2143),i=n(1274),o=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?s(e):i(e)}},56:(e,t,n)=>{var r=n(1741),s=n(7888),i=n(4509),o=n(3062),a=r?r.prototype:void 0,l=a?a.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return s(t,e)+"";if(o(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},9348:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},2143:(e,t,n)=>{var r=n(1741),s=Object.prototype,i=s.hasOwnProperty,o=s.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var s=o.call(e);return r&&(t?e[a]=n:delete e[a]),s}},1274:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5289:(e,t,n)=>{var r=n(9348),s="object"==typeof self&&self&&self.Object===Object&&self,i=r||s||Function("return this")();e.exports=i},4509:e=>{var t=Array.isArray;e.exports=t},7926:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},3062:(e,t,n)=>{var r=n(9052),s=n(7926);e.exports=function(e){return"symbol"==typeof e||s(e)&&"[object Symbol]"==r(e)}},8514:(e,t,n)=>{var r=n(56);e.exports=function(e){return null==e?"":r(e)}},2732:(e,t,n)=>{var r=n(8514),s=0;e.exports=function(e){var t=++s;return r(e)+t}},2604:e=>{"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var i={},o=[],a=0;a<e.length;a++){var l=e[a],c=r.base?l[0]+r.base:l[0],d=i[c]||0,u="".concat(c," ").concat(d);i[c]=d+1;var h=n(u),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==h)t[h].references++,t[h].updater(p);else{var f=s(p,r);r.byIndex=a,t.splice(a,0,{identifier:u,updater:f,references:1})}o.push(u)}return o}function s(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,s){var i=r(e=e||[],s=s||{});return function(e){e=e||[];for(var o=0;o<i.length;o++){var a=n(i[o]);t[a].references--}for(var l=r(e,s),c=0;c<i.length;c++){var d=n(i[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}i=l}}},5863:e=>{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},6896:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},3124:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},101:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var s=void 0!==n.layer;s&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,s&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},9917:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},9777:(e,t,n)=>{"use strict";n.d(t,{Mj:()=>O,X$:()=>T});var r={grad:.9,turn:360,rad:360/(2*Math.PI)},s=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},i=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},o=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},a=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},l=function(e){return{r:o(e.r,0,255),g:o(e.g,0,255),b:o(e.b,0,255),a:o(e.a)}},c=function(e){return{r:i(e.r),g:i(e.g),b:i(e.b),a:i(e.a,3)}},d=/^#([0-9a-f]{3,8})$/i,u=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},h=function(e){var t=e.r,n=e.g,r=e.b,s=e.a,i=Math.max(t,n,r),o=i-Math.min(t,n,r),a=o?i===t?(n-r)/o:i===n?2+(r-t)/o:4+(t-n)/o:0;return{h:60*(a<0?a+6:a),s:i?o/i*100:0,v:i/255*100,a:s}},p=function(e){var t=e.h,n=e.s,r=e.v,s=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),o=r*(1-n),a=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:255*[r,a,o,o,l,r][c],g:255*[l,r,r,a,o,o][c],b:255*[o,o,l,r,r,a][c],a:s}},f=function(e){return{h:a(e.h),s:o(e.s,0,100),l:o(e.l,0,100),a:o(e.a)}},m=function(e){return{h:i(e.h),s:i(e.s),l:i(e.l),a:i(e.a,3)}},g=function(e){return p((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},y=function(e){return{h:(t=h(e)).h,s:(s=(200-(n=t.s))*(r=t.v)/100)>0&&s<200?n*r/100/(s<=100?s:200-s)*100:0,l:s/2,a:t.a};var t,n,r,s},v=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,b=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,x=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,w=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,k={string:[[function(e){var t=d.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?i(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?i(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=x.exec(e)||w.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:l({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=v.exec(e)||b.exec(e);if(!t)return null;var n,s,i=f({h:(n=t[1],s=t[2],void 0===s&&(s="deg"),Number(n)*(r[s]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return g(i)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=void 0===i?1:i;return s(t)&&s(n)&&s(r)?l({r:Number(t),g:Number(n),b:Number(r),a:Number(o)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,i=e.a,o=void 0===i?1:i;if(!s(t)||!s(n)||!s(r))return null;var a=f({h:Number(t),s:Number(n),l:Number(r),a:Number(o)});return g(a)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,i=e.a,l=void 0===i?1:i;if(!s(t)||!s(n)||!s(r))return null;var c=function(e){return{h:a(e.h),s:o(e.s,0,100),v:o(e.v,0,100),a:o(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(l)});return p(c)},"hsv"]]},_=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0](e);if(r)return[r,t[n][1]]}return[null,void 0]},C=function(e,t){var n=y(e);return{h:n.h,s:o(n.s+100*t,0,100),l:n.l,a:n.a}},S=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},A=function(e,t){var n=y(e);return{h:n.h,s:n.s,l:o(n.l+100*t,0,100),a:n.a}},M=function(){function e(e){this.parsed=function(e){return"string"==typeof e?_(e.trim(),k.string):"object"==typeof e&&null!==e?_(e,k.object):[null,void 0]}(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return i(S(this.rgba),2)},e.prototype.isDark=function(){return S(this.rgba)<.5},e.prototype.isLight=function(){return S(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=c(this.rgba)).r,n=e.g,r=e.b,o=(s=e.a)<1?u(i(255*s)):"","#"+u(t)+u(n)+u(r)+o;var e,t,n,r,s,o},e.prototype.toRgb=function(){return c(this.rgba)},e.prototype.toRgbString=function(){return t=(e=c(this.rgba)).r,n=e.g,r=e.b,(s=e.a)<1?"rgba("+t+", "+n+", "+r+", "+s+")":"rgb("+t+", "+n+", "+r+")";var e,t,n,r,s},e.prototype.toHsl=function(){return m(y(this.rgba))},e.prototype.toHslString=function(){return t=(e=m(y(this.rgba))).h,n=e.s,r=e.l,(s=e.a)<1?"hsla("+t+", "+n+"%, "+r+"%, "+s+")":"hsl("+t+", "+n+"%, "+r+"%)";var e,t,n,r,s},e.prototype.toHsv=function(){return e=h(this.rgba),{h:i(e.h),s:i(e.s),v:i(e.v),a:i(e.a,3)};var e},e.prototype.invert=function(){return O({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),O(C(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),O(C(this.rgba,-e))},e.prototype.grayscale=function(){return O(C(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),O(A(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),O(A(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?O({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):i(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=y(this.rgba);return"number"==typeof e?O({h:e,s:t.s,l:t.l,a:t.a}):i(t.h)},e.prototype.isEqual=function(e){return this.toHex()===O(e).toHex()},e}(),O=function(e){return e instanceof M?e:new M(e)},N=[],T=function(e){e.forEach((function(e){N.indexOf(e)<0&&(e(M,k),N.push(e))}))}},7601:(e,t,n)=>{"use strict";n.d(t,{mN:()=>S,AH:()=>l,W3:()=>k,Ec:()=>_});const r=globalThis,s=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),o=new WeakMap;class a{constructor(e,t,n){if(this._$cssResult$=!0,n!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(s&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=o.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&o.set(t,e))}return e}toString(){return this.cssText}}const l=(e,...t)=>{const n=1===e.length?e[0]:t.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[r+1]),e[0]);return new a(n,e,i)},c=(e,t)=>{if(s)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of t){const t=document.createElement("style"),s=r.litNonce;void 0!==s&&t.setAttribute("nonce",s),t.textContent=n.cssText,e.appendChild(t)}},d=s?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new a("string"==typeof e?e:e+"",void 0,i))(t)})(e):e,{is:u,defineProperty:h,getOwnPropertyDescriptor:p,getOwnPropertyNames:f,getOwnPropertySymbols:m,getPrototypeOf:g}=Object,y=globalThis,v=y.trustedTypes,b=v?v.emptyScript:"",x=y.reactiveElementPolyfillSupport,w=(e,t)=>e,k={toAttribute(e,t){switch(t){case Boolean:e=e?b:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},_=(e,t)=>!u(e,t),C={attribute:!0,type:String,converter:k,reflect:!1,hasChanged:_};Symbol.metadata??=Symbol("metadata"),y.litPropertyMetadata??=new WeakMap;class S extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=C){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&h(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:s}=p(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return r?.call(this)},set(t){const i=r?.call(this);s.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??C}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;const e=g(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){const e=this.properties,t=[...f(e),...m(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(d(e))}else void 0!==e&&t.push(d(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return c(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EC(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const s=(void 0!==n.converter?.toAttribute?n.converter:k).toAttribute(t,n.type);this._$Em=e,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:k;this._$Em=r,this[r]=s.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){if(n??=this.constructor.getPropertyOptions(e),!(n.hasChanged??_)(this[e],t))return;this.P(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,n){this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e)!0!==n.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],n)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[w("elementProperties")]=new Map,S[w("finalized")]=new Map,x?.({ReactiveElement:S}),(y.reactiveElementVersions??=[]).push("2.0.4")},4198:(e,t,n)=>{"use strict";n.d(t,{YY:()=>ie,CU:()=>Pe,bP:()=>Fe,gk:()=>V,iI:()=>P,z6:()=>ke,_w:()=>Ce,U0:()=>ve,OX:()=>Ee,Zc:()=>Le,KV:()=>z,jT:()=>De,JJ:()=>Re,tG:()=>Ie});var r=n(2559),s=(n(5873),n(1804)),i=n(9679),o=n(196);const a=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function l(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const c=(e,t,n)=>{let s=l(e,n);if(!s)return!1;let a=p(s);if(!a){let n=s.blockRange(),r=n&&(0,o.jP)(n);return null!=r&&(t&&t(e.tr.lift(n,r).scrollIntoView()),!0)}let c=a.nodeBefore;if(!c.type.spec.isolating&&C(e,a,t))return!0;if(0==s.parent.content.size&&(u(c,"end")||r.nh.isSelectable(c))){let n=(0,o.$L)(e.doc,s.before(),s.after(),i.Ji.empty);if(n&&n.slice.size<n.to-n.from){if(t){let s=e.tr.step(n);s.setSelection(u(c,"end")?r.LN.findFrom(s.doc.resolve(s.mapping.map(a.pos,-1)),-1):r.nh.create(s.doc,a.pos-c.nodeSize)),t(s.scrollIntoView())}return!0}}return!(!c.isAtom||a.depth!=s.depth-1||(t&&t(e.tr.delete(a.pos-c.nodeSize,a.pos).scrollIntoView()),0))};function d(e,t,n){let s=t.nodeBefore,a=t.pos-1;for(;!s.isTextblock;a--){if(s.type.spec.isolating)return!1;let e=s.lastChild;if(!e)return!1;s=e}let l=t.nodeAfter,c=t.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let e=l.firstChild;if(!e)return!1;l=e}let d=(0,o.$L)(e.doc,a,c,i.Ji.empty);if(!d||d.from!=a||d instanceof o.Ln&&d.slice.size>=c-a)return!1;if(n){let t=e.tr.step(d);t.setSelection(r.U3.create(t.doc,a)),n(t.scrollIntoView())}return!0}function u(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}const h=(e,t,n)=>{let{$head:s,empty:i}=e.selection,o=s;if(!i)return!1;if(s.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):s.parentOffset>0)return!1;o=p(s)}let a=o&&o.nodeBefore;return!(!a||!r.nh.isSelectable(a)||(t&&t(e.tr.setSelection(r.nh.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),0))};function p(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 f(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const m=(e,t,n)=>{let s=f(e,n);if(!s)return!1;let a=y(s);if(!a)return!1;let l=a.nodeAfter;if(C(e,a,t))return!0;if(0==s.parent.content.size&&(u(l,"start")||r.nh.isSelectable(l))){let n=(0,o.$L)(e.doc,s.before(),s.after(),i.Ji.empty);if(n&&n.slice.size<n.to-n.from){if(t){let s=e.tr.step(n);s.setSelection(u(l,"start")?r.LN.findFrom(s.doc.resolve(s.mapping.map(a.pos)),1):r.nh.create(s.doc,s.mapping.map(a.pos))),t(s.scrollIntoView())}return!0}}return!(!l.isAtom||a.depth!=s.depth-1||(t&&t(e.tr.delete(a.pos,a.pos+l.nodeSize).scrollIntoView()),0))},g=(e,t,n)=>{let{$head:s,empty:i}=e.selection,o=s;if(!i)return!1;if(s.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):s.parentOffset<s.parent.content.size)return!1;o=y(s)}let a=o&&o.nodeAfter;return!(!a||!r.nh.isSelectable(a)||(t&&t(e.tr.setSelection(r.nh.create(e.doc,o.pos)).scrollIntoView()),0))};function y(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const 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))};function b(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const x=(e,t)=>{let{$head:n,$anchor:s}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(s))return!1;let i=n.node(-1),o=n.indexAfter(-1),a=b(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(t){let s=n.after(),i=e.tr.replaceWith(s,s,a.createAndFill());i.setSelection(r.LN.near(i.doc.resolve(s),1)),t(i.scrollIntoView())}return!0},w=(e,t)=>{let n=e.selection,{$from:s,$to:i}=n;if(n instanceof r.i5||s.parent.inlineContent||i.parent.inlineContent)return!1;let o=b(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!s.parentOffset&&i.index()<i.parent.childCount?s:i).pos,a=e.tr.insert(n,o.createAndFill());a.setSelection(r.U3.create(a.doc,n+1)),t(a.scrollIntoView())}return!0},k=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if((0,o.zy)(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),s=r&&(0,o.jP)(r);return null!=s&&(t&&t(e.tr.lift(r,s).scrollIntoView()),!0)};var _;function C(e,t,n){let s,a,l=t.nodeBefore,c=t.nodeAfter;if(l.type.spec.isolating||c.type.spec.isolating)return!1;if(function(e,t,n){let r=t.nodeBefore,s=t.nodeAfter,i=t.index();return!(!(r&&s&&r.type.compatibleContent(s.type))||(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(i,i+1)||!s.isTextblock&&!(0,o.n9)(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let d=t.parent.canReplace(t.index(),t.index()+1);if(d&&(s=(a=l.contentMatchAt(l.childCount)).findWrapping(c.type))&&a.matchType(s[0]||c.type).validEnd){if(n){let r=t.pos+c.nodeSize,a=i.FK.empty;for(let e=s.length-1;e>=0;e--)a=i.FK.from(s[e].create(null,a));a=i.FK.from(l.copy(a));let d=e.tr.step(new o.Wg(t.pos-1,r,t.pos,r,new i.Ji(a,1,0),s.length,!0)),u=r+2*s.length;(0,o.n9)(d.doc,u)&&d.join(u),n(d.scrollIntoView())}return!0}let h=r.LN.findFrom(t,1),p=h&&h.$from.blockRange(h.$to),f=p&&(0,o.jP)(p);if(null!=f&&f>=t.depth)return n&&n(e.tr.lift(p,f).scrollIntoView()),!0;if(d&&u(c,"start",!0)&&u(l,"end")){let r=l,s=[];for(;s.push(r),!r.isTextblock;)r=r.lastChild;let a=c,d=1;for(;!a.isTextblock;a=a.firstChild)d++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=i.FK.empty;for(let e=s.length-1;e>=0;e--)r=i.FK.from(s[e].copy(r));n(e.tr.step(new o.Wg(t.pos-s.length,t.pos+c.nodeSize,t.pos+d,t.pos+c.nodeSize-d,new i.Ji(r,s.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function S(e){return function(t,n){let s=t.selection,i=e<0?s.$from:s.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(r.U3.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}const A=S(-1),M=S(1);function O(e,t=null){return function(n,r){let s=!1;for(let r=0;r<n.selection.ranges.length&&!s;r++){let{$from:{pos:i},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(i,o,((r,i)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{let t=n.doc.resolve(i),r=t.index();s=t.parent.canReplaceWith(r,r+1,e)}}))}if(!s)return!1;if(r){let s=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:o}}=n.selection.ranges[r];s.setBlockType(i,o,e,t)}r(s.scrollIntoView())}return!0}}function N(...e){return function(t,n,r){for(let s=0;s<e.length;s++)if(e[s](t,n,r))return!0;return!1}}let T=N(a,c,h),$=N(a,m,g);const E={Enter:N(v,w,k,((e,t)=>{let{$from:n,$to:s}=e.selection;if(e.selection instanceof r.nh&&e.selection.node.isBlock)return!(!n.parentOffset||!(0,o.zy)(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.parent.isBlock)return!1;if(t){let i=s.parentOffset==s.parent.content.size,a=e.tr;(e.selection instanceof r.U3||e.selection instanceof r.i5)&&a.deleteSelection();let l=0==n.depth?null:b(n.node(-1).contentMatchAt(n.indexAfter(-1))),c=_?[_]:i&&l?[{type:l}]:void 0,d=(0,o.zy)(a.doc,a.mapping.map(n.pos),1,c);if(c||d||!(0,o.zy)(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),!i&&!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":x,Backspace:T,"Mod-Backspace":T,"Shift-Backspace":T,Delete:$,"Mod-Delete":$,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new r.i5(e.doc))),!0)},D={"Ctrl-h":E.Backspace,"Alt-Backspace":E["Mod-Backspace"],"Ctrl-d":E.Delete,"Ctrl-Alt-Backspace":E["Mod-Delete"],"Alt-Delete":E["Mod-Delete"],"Alt-d":E["Mod-Delete"],"Ctrl-a":A,"Ctrl-e":M};for(let e in E)D[e]=E[e];function R(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:s}=n,{storedMarks:i}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return s},get tr(){return r=n.selection,s=n.doc,i=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class I{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:s}=n,i=this.buildProps(s);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(i);return s.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(s),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:s}=this,{view:i}=r,o=[],a=!!e,l=e||s.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),s=n(...e)(r);return o.push(s),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(l),o.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=e||n.tr,s=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...s,dispatch:void 0})]))),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:s}=this,{view:i}=r,o={tr:e,editor:r,view:i,state:R({state:s,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map((([e,t])=>[e,(...e)=>t(...e)(o)])))}};return o}}function P(e,t,n){return void 0===e.config[t]&&e.parent?P(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?P(e.parent,t,n):null}):e.config[t]}function F(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function L(e){const t=[],{nodeExtensions:n,markExtensions:r}=F(e),s=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=P(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage});n&&n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...i,...r}})}))}))}))})),s.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=P(e,"addAttributes",n);if(!r)return;const s=r();Object.entries(s).forEach((([n,r])=>{const s={...i,...r};"function"==typeof(null==s?void 0:s.default)&&(s.default=s.default()),(null==s?void 0:s.isRequired)&&void 0===(null==s?void 0:s.default)&&delete s.default,t.push({type:e.name,name:n,attribute:s})}))})),t}function B(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function z(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{if(n[e])if("class"===e){const r=t?t.split(" "):[],s=n[e]?n[e].split(" "):[],i=r.filter((e=>!s.includes(e)));n[e]=[...s,...i].join(" ")}else n[e]="style"===e?[n[e],t].join("; "):t;else n[e]=t})),n}),{})}function j(e,t){return t.filter((e=>e.attribute.rendered)).map((t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]})).reduce(((e,t)=>z(e,t)),{})}function V(e,t=void 0,...n){return function(e){return"function"==typeof e}(e)?t?e.bind(t)(...n):e(...n):e}function H(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const s=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...s}}}}function U(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function q(e,t){var n;const r=L(e),{nodeExtensions:s,markExtensions:o}=F(e),a=null===(n=s.find((e=>P(e,"topNode"))))||void 0===n?void 0:n.name,l=Object.fromEntries(s.map((n=>{const s=r.filter((e=>e.type===n.name)),i={name:n.name,options:n.options,storage:n.storage,editor:t},o=U({...e.reduce(((e,t)=>{const r=P(t,"extendNodeSchema",i);return{...e,...r?r(n):{}}}),{}),content:V(P(n,"content",i)),marks:V(P(n,"marks",i)),group:V(P(n,"group",i)),inline:V(P(n,"inline",i)),atom:V(P(n,"atom",i)),selectable:V(P(n,"selectable",i)),draggable:V(P(n,"draggable",i)),code:V(P(n,"code",i)),defining:V(P(n,"defining",i)),isolating:V(P(n,"isolating",i)),attrs:Object.fromEntries(s.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=V(P(n,"parseHTML",i));a&&(o.parseDOM=a.map((e=>H(e,s))));const l=P(n,"renderHTML",i);l&&(o.toDOM=e=>l({node:e,HTMLAttributes:j(e,s)}));const c=P(n,"renderText",i);return c&&(o.toText=c),[n.name,o]}))),c=Object.fromEntries(o.map((n=>{const s=r.filter((e=>e.type===n.name)),i={name:n.name,options:n.options,storage:n.storage,editor:t},o=U({...e.reduce(((e,t)=>{const r=P(t,"extendMarkSchema",i);return{...e,...r?r(n):{}}}),{}),inclusive:V(P(n,"inclusive",i)),excludes:V(P(n,"excludes",i)),group:V(P(n,"group",i)),spanning:V(P(n,"spanning",i)),code:V(P(n,"code",i)),attrs:Object.fromEntries(s.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=V(P(n,"parseHTML",i));a&&(o.parseDOM=a.map((e=>H(e,s))));const l=P(n,"renderHTML",i);return l&&(o.toDOM=e=>l({mark:e,HTMLAttributes:j(e,s)})),[n.name,o]})));return new i.Sj({topNode:a,nodes:l,marks:c})}function K(e,t){return t.nodes[e]||t.marks[e]||null}function Z(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}const J=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,((e,t,s,i)=>{var o,a;const l=(null===(a=(o=e.type.spec).toText)||void 0===a?void 0:a.call(o,{node:e,pos:t,parent:s,index:i}))||e.textContent||"%leaf%";n+=l.slice(0,Math.max(0,r-t))})),n};function W(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class G{constructor(e){this.find=e.find,this.handler=e.handler}}const Y=(e,t)=>{if(W(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function X(e){var t;const{editor:n,from:r,to:s,text:i,rules:o,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null===(t=c.nodeBefore||c.nodeAfter)||void 0===t?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let d=!1;const u=J(c)+i;return o.forEach((e=>{if(d)return;const t=Y(u,e.find);if(!t)return;const o=l.state.tr,c=R({state:l.state,transaction:o}),h={from:r-(t[0].length-i.length),to:s},{commands:p,chain:f,can:m}=new I({editor:n,state:c});null!==e.handler({state:c,range:h,match:t,commands:p,chain:f,can:m})&&o.steps.length&&(o.setMeta(a,{transform:o,from:r,to:s,text:i}),l.dispatch(o),d=!0)})),d}function Q(e){const{editor:t,rules:n}=e,s=new r.k_({state:{init:()=>null,apply:(e,t)=>e.getMeta(s)||(e.selectionSet||e.docChanged?null:t)},props:{handleTextInput:(e,r,i,o)=>X({editor:t,from:r,to:i,text:o,rules:n,plugin:s}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:r}=e.state.selection;r&&X({editor:t,from:r.pos,to:r.pos,text:"",rules:n,plugin:s})})),!1)},handleKeyDown(e,r){if("Enter"!==r.key)return!1;const{$cursor:i}=e.state.selection;return!!i&&X({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:s})}},isInputRules:!0});return s}class ee{constructor(e){this.find=e.find,this.handler=e.handler}}function te(e){const{editor:t,rules:n}=e;let s=null,i=!1,o=!1,a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,l="undefined"!=typeof DragEvent?new DragEvent("drop"):null;const c=n.map((e=>new r.k_({view(e){const t=t=>{var n;s=(null===(n=e.dom.parentElement)||void 0===n?void 0:n.contains(t.target))?e.dom.parentElement:null};return window.addEventListener("dragstart",t),{destroy(){window.removeEventListener("dragstart",t)}}},props:{handleDOMEvents:{drop:(e,t)=>(o=s===e.dom.parentElement,l=t,!1),paste:(e,t)=>{var n;const r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return a=t,i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,s)=>{const c=n[0],d="paste"===c.getMeta("uiEvent")&&!i,u="drop"===c.getMeta("uiEvent")&&!o;if(!d&&!u)return;const h=r.doc.content.findDiffStart(s.doc.content),p=r.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof h||!p||h===p.b)return;const f=s.tr,m=R({state:s,transaction:f}),g=function(e){const{editor:t,state:n,from:r,to:s,rule:i,pasteEvent:o,dropEvent:a}=e,{commands:l,chain:c,can:d}=new I({editor:t,state:n}),u=[];return n.doc.nodesBetween(r,s,((e,t)=>{if(!e.isTextblock||e.type.spec.code)return;const h=Math.max(r,t),p=Math.min(s,t+e.content.size);((e,t,n)=>{if(W(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map((t=>{const n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n})):[]})(e.textBetween(h-t,p-t,void 0,""),i.find,o).forEach((e=>{if(void 0===e.index)return;const t=h+e.index+1,r=t+e[0].length,s={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},p=i.handler({state:n,range:s,match:e,commands:l,chain:c,can:d,pasteEvent:o,dropEvent:a});u.push(p)}))})),u.every((e=>null!==e))}({editor:t,state:m,from:Math.max(h-1,0),to:p.b-1,rule:e,pasteEvent:a,dropEvent:l});return g&&f.steps.length?(l="undefined"!=typeof DragEvent?new DragEvent("drop"):null,a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,f):void 0}})));return c}class ne{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=ne.resolve(e),this.schema=q(this.extensions,t),this.extensions.forEach((e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:K(e.name,this.schema)};"mark"===e.type&&(null===(t=V(P(e,"keepOnSplit",n)))||void 0===t||t)&&this.splittableMarks.push(e.name);const r=P(e,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const s=P(e,"onCreate",n);s&&this.editor.on("create",s);const i=P(e,"onUpdate",n);i&&this.editor.on("update",i);const o=P(e,"onSelectionUpdate",n);o&&this.editor.on("selectionUpdate",o);const a=P(e,"onTransaction",n);a&&this.editor.on("transaction",a);const l=P(e,"onFocus",n);l&&this.editor.on("focus",l);const c=P(e,"onBlur",n);c&&this.editor.on("blur",c);const d=P(e,"onDestroy",n);d&&this.editor.on("destroy",d)}))}static resolve(e){const t=ne.sort(ne.flatten(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return[...new Set(t)]}(t.map((e=>e.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((e=>`'${e}'`)).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map((e=>{const t=P(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...this.flatten(t())]:e})).flat(10)}static sort(e){return e.sort(((e,t)=>{const n=P(e,"priority")||100,r=P(t,"priority")||100;return n>r?-1:n<r?1:0}))}get commands(){return this.extensions.reduce(((e,t)=>{const n=P(t,"addCommands",{name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:K(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=ne.sort([...this.extensions].reverse()),n=[],r=[],i=t.map((t=>{const i={name:t.name,options:t.options,storage:t.storage,editor:e,type:K(t.name,this.schema)},o=[],a=P(t,"addKeyboardShortcuts",i);let l={};if("mark"===t.type&&t.config.exitable&&(l.ArrowRight=()=>Pe.handleExit({editor:e,mark:t})),a){const t=Object.fromEntries(Object.entries(a()).map((([t,n])=>[t,()=>n({editor:e})])));l={...l,...t}}const c=(0,s.w)(l);o.push(c);const d=P(t,"addInputRules",i);Z(t,e.options.enableInputRules)&&d&&n.push(...d());const u=P(t,"addPasteRules",i);Z(t,e.options.enablePasteRules)&&u&&r.push(...u());const h=P(t,"addProseMirrorPlugins",i);if(h){const e=h();o.push(...e)}return o})).flat();return[Q({editor:e,rules:n}),...te({editor:e,rules:r}),...i]}get attributes(){return L(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=F(this.extensions);return Object.fromEntries(t.filter((e=>!!P(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:t.storage,editor:e,type:B(t.name,this.schema)},s=P(t,"addNodeView",r);return s?[t.name,(r,i,o,a)=>{const l=j(r,n);return s()({editor:e,node:r,getPos:o,decorations:a,HTMLAttributes:l,extension:t})}]:[]})))}}function re(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function se(e,t){const n={...e};return re(e)&&re(t)&&Object.keys(t).forEach((r=>{re(t[r])?r in e?n[r]=se(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})})),n}class ie{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=V(P(this,"addOptions",{name:this.name}))),this.storage=V(P(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ie(e)}configure(e={}){const t=this.extend();return t.options=se(this.options,e),t.storage=V(P(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new ie({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=V(P(t,"addOptions",{name:t.name})),t.storage=V(P(t,"addStorage",{name:t.name,options:t.options})),t}}function oe(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}function ae(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:W(t[r])?t[r].test(e[r]):t[r]===e[r]))}function le(e,t,n={}){return e.find((e=>e.type===t&&ae(e.attrs,n)))}function ce(e,t,n={}){return!!le(e,t,n)}function de(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const s=le([...r.node.marks],t,n);if(!s)return;let i=r.index,o=e.start()+r.offset,a=i+1,l=o+r.node.nodeSize;for(le([...r.node.marks],t,n);i>0&&s.isInSet(e.parent.child(i-1).marks);)i-=1,o-=e.parent.child(i).nodeSize;for(;a<e.parent.childCount&&ce([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function ue(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function he(e){return e instanceof r.U3}function pe(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function fe(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}ie.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new r.k_({key:new r.hs("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:s}=t,{ranges:i}=s;return function(e,t,n){const{from:r,to:s}=t,{blockSeparator:i="\n\n",textSerializers:o={}}=n||{};let a="",l=!0;return e.nodesBetween(r,s,((e,n,c,d)=>{var u;const h=null==o?void 0:o[e.type.name];h?(e.isBlock&&!l&&(a+=i,l=!0),c&&(a+=h({node:e,pos:n,parent:c,index:d,range:t}))):e.isText?(a+=null===(u=null==e?void 0:e.text)||void 0===u?void 0:u.slice(Math.max(r,n)-n,s-n),l=!1):e.isBlock&&!l&&(a+=i,l=!0)})),a}(r,{from:Math.min(...i.map((e=>e.$from.pos))),to:Math.max(...i.map((e=>e.$to.pos)))},{textSerializers:oe(n)})}}})]}});const me=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&me(r)}return e};function ge(e){const t=`<body>${e}</body>`,n=(new window.DOMParser).parseFromString(t,"text/html").body;return me(n)}function ye(e,t,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof e&&null!==e)try{return Array.isArray(e)&&e.length>0?i.FK.fromArray(e.map((e=>t.nodeFromJSON(e)))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),ye("",t,n)}if("string"==typeof e){const r=i.S4.fromSchema(t);return n.slice?r.parseSlice(ge(e),n.parseOptions).content:r.parse(ge(e),n.parseOptions)}return ye("",t,n)}function ve(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function be(e,t,n={}){const{from:r,to:s,empty:i}=e.selection,o=t?B(t,e.schema):null,a=[];e.doc.nodesBetween(r,s,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),i=Math.min(s,t+e.nodeSize);a.push({node:e,from:n,to:i})}));const l=s-r,c=a.filter((e=>!o||o.name===e.node.type.name)).filter((e=>ae(e.node.attrs,n,{strict:!1})));return i?!!c.length:c.reduce(((e,t)=>e+t.to-t.from),0)>=l}function xe(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function we(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}function ke(e,t){const n=ue(t,e.schema),{from:r,to:s,empty:i}=e.selection,o=[];i?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,s,(e=>{o.push(...e.marks)}));const a=o.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function _e(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function Ce(e,t){return q(ne.resolve(e),t)}function Se(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach((t=>{const s=de(n.resolve(e-1),t.type);s&&r.push({mark:t,...s})})):n.nodesBetween(e,t,((e,t)=>{e&&void 0!==(null==e?void 0:e.nodeSize)&&r.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),r}function Ae(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}function Me(e,t){const{nodeExtensions:n}=F(t),r=n.find((t=>t.name===e));if(!r)return!1;const s=V(P(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof s&&s.split(" ").includes("list")}function Oe(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}const Ne=(e,t)=>{const n=_e((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const s=e.doc.nodeAt(r);return n.node.type!==(null==s?void 0:s.type)||!(0,o.n9)(e.doc,n.pos)||(e.join(n.pos),!0)},Te=(e,t)=>{const n=_e((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const s=e.doc.nodeAt(r);return n.node.type!==(null==s?void 0:s.type)||!(0,o.n9)(e.doc,r)||(e.join(r),!0)};var $e=Object.freeze({__proto__:null,blur:()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(e=!1)=>({commands:t})=>t.setContent("",e),clearNodes:()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:s}=r;return!n||(s.forEach((({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,((e,n)=>{if(e.type.isText)return;const{doc:r,mapping:s}=t,i=r.resolve(s.map(n)),a=r.resolve(s.map(n+e.nodeSize)),l=i.blockRange(a);if(!l)return;const c=(0,o.jP)(l);if(e.type.isTextblock){const{defaultType:e}=i.parent.contentMatchAt(i.index());t.setNodeMarkup(l.start,e)}(c||0===c)&&t.lift(l,c)}))})),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>w(e,t),cut:(e,t)=>({editor:n,tr:s})=>{const{state:i}=n,o=i.doc.slice(e.from,e.to);s.deleteRange(e.from,e.to);const a=s.mapping.map(t);return s.insert(a,o.content),s.setSelection(new r.U3(s.doc.resolve(a-1))),!0},deleteCurrentNode:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const s=e.selection.$anchor;for(let n=s.depth;n>0;n-=1)if(s.node(n).type===r.type){if(t){const t=s.before(n),r=s.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1},deleteNode:e=>({tr:t,state:n,dispatch:r})=>{const s=B(e,n.schema),i=t.selection.$anchor;for(let e=i.depth;e>0;e-=1)if(i.node(e).type===s){if(r){const n=i.before(e),r=i.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{const{from:r,to:s}=e;return n&&t.delete(r,s),!0},deleteSelection:()=>({state:e,dispatch:t})=>a(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>x(e,t),extendMarkRange:(e,t={})=>({tr:n,state:s,dispatch:i})=>{const o=ue(e,s.schema),{doc:a,selection:l}=n,{$from:c,from:d,to:u}=l;if(i){const e=de(c,o,t);if(e&&e.from<=d&&e.to>=u){const t=r.U3.create(a,e.from,e.to);n.setSelection(t)}}return!0},first:e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},focus:(e=null,t={})=>({editor:n,view:s,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const a=()=>{fe()&&s.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(s.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(s.hasFocus()&&null===e||!1===e)return!0;if(o&&null===e&&!he(n.state.selection))return a(),!0;const l=function(e,t=null){if(!t)return null;const n=r.LN.atStart(e),s=r.LN.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return s;const i=n.from,o=s.to;return"all"===t?r.U3.create(e,pe(0,i,o),pe(e.content.size,i,o)):r.U3.create(e,pe(t,i,o),pe(t,i,o))}(i.doc,e)||n.state.selection,c=n.state.selection.eq(l);return o&&(c||i.setSelection(l),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},forEach:(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),insertContent:(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),insertContentAt:(e,t,n)=>({tr:s,dispatch:i,editor:a})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const i=ye(t,a.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===i.toString())return!0;let{from:l,to:c}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},d=!0,u=!0;if((i.toString().startsWith("<")?i:[i]).forEach((e=>{e.check(),d=!!d&&e.isText&&0===e.marks.length,u=!!u&&e.isBlock})),l===c&&u){const{parent:e}=s.doc.resolve(l);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(l-=1,c+=1)}d?Array.isArray(t)?s.insertText(t.map((e=>e.text||"")).join(""),l,c):"object"==typeof t&&t&&t.text?s.insertText(t.text,l,c):s.insertText(t,l,c):s.replaceWith(l,c,i),n.updateSelection&&function(e,t,n){const s=e.steps.length-1;if(s<t)return;const i=e.steps[s];if(!(i instanceof o.Ln||i instanceof o.Wg))return;const a=e.mapping.maps[s];let l=0;a.forEach(((e,t,n,r)=>{0===l&&(l=r)})),e.setSelection(r.LN.near(e.doc.resolve(l),-1))}(s,s.steps.length-1)}return!0},joinUp:()=>({state:e,dispatch:t})=>((e,t)=>{let n,s=e.selection,i=s instanceof r.nh;if(i){if(s.node.isTextblock||!(0,o.n9)(e.doc,s.from))return!1;n=s.from}else if(n=(0,o.N0)(e.doc,s.from,-1),null==n)return!1;if(t){let s=e.tr.join(n);i&&s.setSelection(r.nh.create(s.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(s.scrollIntoView())}return!0})(e,t),joinDown:()=>({state:e,dispatch:t})=>((e,t)=>{let n,s=e.selection;if(s instanceof r.nh){if(s.node.isTextblock||!(0,o.n9)(e.doc,s.to))return!1;n=s.to}else if(n=(0,o.N0)(e.doc,s.to,1),null==n)return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0})(e,t),joinBackward:()=>({state:e,dispatch:t})=>c(e,t),joinForward:()=>({state:e,dispatch:t})=>m(e,t),joinItemBackward:()=>({tr:e,state:t,dispatch:n})=>{try{const r=(0,o.N0)(t.doc,t.selection.$from.pos,-1);return null!=r&&(e.join(r,2),n&&n(e),!0)}catch{return!1}},joinItemForward:()=>({state:e,dispatch:t,tr:n})=>{try{const r=(0,o.N0)(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch(e){return!1}},joinTextblockBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=l(e,void 0);if(!r)return!1;let s=p(r);return!!s&&d(e,s,t)})(e,t),joinTextblockForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=f(e,void 0);if(!r)return!1;let s=y(r);return!!s&&d(e,s,t)})(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:r,dispatch:s})=>{const i=function(e){const t=e.split(/-(?!$)/);let n,r,s,i,o=t[t.length-1];"Space"===o&&(o=" ");for(let e=0;e<t.length-1;e+=1){const o=t[e];if(/^(cmd|meta|m)$/i.test(o))i=!0;else if(/^a(lt)?$/i.test(o))n=!0;else if(/^(c|ctrl|control)$/i.test(o))r=!0;else if(/^s(hift)?$/i.test(o))s=!0;else{if(!/^mod$/i.test(o))throw new Error(`Unrecognized modifier name: ${o}`);fe()||ve()?i=!0:r=!0}}return n&&(o=`Alt-${o}`),r&&(o=`Ctrl-${o}`),i&&(o=`Meta-${o}`),s&&(o=`Shift-${o}`),o}(e).split(/-(?!$)/),o=i.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===o?" ":o,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&s&&r.maybeStep(t)})),!0},lift:(e,t={})=>({state:n,dispatch:r})=>!!be(n,B(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,s=n.blockRange(r),i=s&&(0,o.jP)(s);return null!=i&&(t&&t(e.tr.lift(s,i).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:e,dispatch:t})=>k(e,t),liftListItem:e=>({state:t,dispatch:n})=>{return(r=B(e,t.schema),function(e,t){let{$from:n,$to:s}=e.selection,a=n.blockRange(s,(e=>e.childCount>0&&e.firstChild.type==r));return!!a&&(!t||(n.node(a.depth-1).type==r?function(e,t,n,r){let s=e.tr,a=r.end,l=r.$to.end(r.depth);a<l&&(s.step(new o.Wg(a-1,l,a,l,new i.Ji(i.FK.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new i.u$(s.doc.resolve(r.$from.pos),s.doc.resolve(l),r.depth));const c=(0,o.jP)(r);if(null==c)return!1;s.lift(r,c);let d=s.mapping.map(a,-1)-1;return(0,o.n9)(s.doc,d)&&s.join(d),t(s.scrollIntoView()),!0}(e,t,r,a):function(e,t,n){let r=e.tr,s=n.parent;for(let e=n.end,t=n.endIndex-1,i=n.startIndex;t>i;t--)e-=s.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),l=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let c=0==n.startIndex,d=n.endIndex==s.childCount,u=a.node(-1),h=a.index(-1);if(!u.canReplace(h+(c?0:1),h+1,l.content.append(d?i.FK.empty:i.FK.from(s))))return!1;let p=a.pos,f=p+l.nodeSize;return r.step(new o.Wg(p-(c?1:0),f+(d?1:0),p+1,f-1,new i.Ji((c?i.FK.empty:i.FK.from(s.copy(i.FK.empty))).append(d?i.FK.empty:i.FK.from(s.copy(i.FK.empty))),c?0:1,d?0:1),c?0:1)),t(r.scrollIntoView()),!0}(e,t,a)))})(t,n);var r},newlineInCode:()=>({state:e,dispatch:t})=>v(e,t),resetAttributes:(e,t)=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const a=xe("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(i=B(e,r.schema)),"mark"===a&&(o=ue(e,r.schema)),s&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{i&&i===e.type&&n.setNodeMarkup(r,void 0,we(e.attrs,t)),o&&e.marks.length&&e.marks.forEach((s=>{o===s.type&&n.addMark(r,r+e.nodeSize,o.create(we(s.attrs,t)))}))}))})),!0)},scrollIntoView:()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),selectAll:()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),selectNodeBackward:()=>({state:e,dispatch:t})=>h(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>g(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:s,to:i}=e.selection,o=s.sharedDepth(i);return 0!=o&&(n=s.before(o),t&&t(e.tr.setSelection(r.nh.create(e.doc,n))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>M(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>A(e,t),setContent:(e,t=!1,n={})=>({tr:r,editor:s,dispatch:i})=>{const{doc:o}=r,a=function(e,t,n={}){return ye(e,t,{slice:!1,parseOptions:n})}(e,s.schema,n);return i&&r.replaceWith(0,o.content.size,a).setMeta("preventUpdate",!t),!0},setMark:(e,t={})=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=n,{empty:o,ranges:a}=i,l=ue(e,r.schema);if(s)if(o){const e=ke(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const s=e.$from.pos,i=e.$to.pos;r.doc.nodesBetween(s,i,((e,r)=>{const o=Math.max(r,s),a=Math.min(r+e.nodeSize,i);e.marks.find((e=>e.type===l))?e.marks.forEach((e=>{l===e.type&&n.addMark(o,a,l.create({...e.attrs,...t}))})):n.addMark(o,a,l.create(t))}))}));return function(e,t,n){var r;const{selection:s}=t;let i=null;if(he(s)&&(i=s.$cursor),i){const t=null!==(r=e.storedMarks)&&void 0!==r?r:i.marks();return!!n.isInSet(t)||!t.some((e=>e.type.excludes(n)))}const{ranges:o}=s;return o.some((({$from:t,$to:r})=>{let s=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,((e,t,r)=>{if(s)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),i=!!n.isInSet(e.marks)||!e.marks.some((e=>e.type.excludes(n)));s=t&&i}return!s})),s}))}(r,n,l)},setMeta:(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:r,chain:s})=>{const i=B(e,n.schema);return i.isTextblock?s().command((({commands:e})=>!!O(i,t)(n)||e.clearNodes())).command((({state:e})=>O(i,t)(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,s=pe(e,0,n.content.size),i=r.nh.create(n,s);t.setSelection(i)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:s,to:i}="number"==typeof e?{from:e,to:e}:e,o=r.U3.atStart(n).from,a=r.U3.atEnd(n).to,l=pe(s,o,a),c=pe(i,o,a),d=r.U3.create(n,l,c);t.setSelection(d)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{const r=B(e,t.schema);return(s=r,function(e,t){let{$from:n,$to:r}=e.selection,a=n.blockRange(r,(e=>e.childCount>0&&e.firstChild.type==s));if(!a)return!1;let l=a.startIndex;if(0==l)return!1;let c=a.parent,d=c.child(l-1);if(d.type!=s)return!1;if(t){let n=d.lastChild&&d.lastChild.type==c.type,r=i.FK.from(n?s.create():null),l=new i.Ji(i.FK.from(s.create(null,i.FK.from(c.type.create(null,r)))),n?3:1,0),u=a.start,h=a.end;t(e.tr.step(new o.Wg(u-(n?3:1),h,u,h,l,1,!0)).scrollIntoView())}return!0})(t,n);var s},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:s,editor:i})=>{const{selection:a,doc:l}=t,{$from:c,$to:d}=a,u=Ae(i.extensionManager.attributes,c.node().type.name,c.node().attrs);if(a instanceof r.nh&&a.node.isBlock)return!(!c.parentOffset||!(0,o.zy)(l,c.pos)||(s&&(e&&Oe(n,i.extensionManager.splittableMarks),t.split(c.pos).scrollIntoView()),0));if(!c.parent.isBlock)return!1;if(s){const s=d.parentOffset===d.parent.content.size;a instanceof r.U3&&t.deleteSelection();const l=0===c.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(c.node(-1).contentMatchAt(c.indexAfter(-1)));let h=s&&l?[{type:l,attrs:u}]:void 0,p=(0,o.zy)(t.doc,t.mapping.map(c.pos),1,h);if(h||p||!(0,o.zy)(t.doc,t.mapping.map(c.pos),1,l?[{type:l}]:void 0)||(p=!0,h=l?[{type:l,attrs:u}]:void 0),p&&(t.split(t.mapping.map(c.pos),1,h),l&&!s&&!c.parentOffset&&c.parent.type!==l)){const e=t.mapping.map(c.before()),n=t.doc.resolve(e);c.node(-1).canReplaceWith(n.index(),n.index()+1,l)&&t.setNodeMarkup(t.mapping.map(c.before()),l)}e&&Oe(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},splitListItem:e=>({tr:t,state:n,dispatch:s,editor:a})=>{var l;const c=B(e,n.schema),{$from:d,$to:u}=n.selection,h=n.selection.node;if(h&&h.isBlock||d.depth<2||!d.sameParent(u))return!1;const p=d.node(-1);if(p.type!==c)return!1;const f=a.extensionManager.attributes;if(0===d.parent.content.size&&d.node(-1).childCount===d.indexAfter(-1)){if(2===d.depth||d.node(-3).type!==c||d.index(-2)!==d.node(-2).childCount-1)return!1;if(s){let e=i.FK.empty;const n=d.index(-1)?1:d.index(-2)?2:3;for(let t=d.depth-n;t>=d.depth-3;t-=1)e=i.FK.from(d.node(t).copy(e));const s=d.indexAfter(-1)<d.node(-2).childCount?1:d.indexAfter(-2)<d.node(-3).childCount?2:3,o=Ae(f,d.node().type.name,d.node().attrs),a=(null===(l=c.contentMatch.defaultType)||void 0===l?void 0:l.createAndFill(o))||void 0;e=e.append(i.FK.from(c.createAndFill(null,a)||void 0));const u=d.before(d.depth-(n-1));t.replace(u,d.after(-s),new i.Ji(e,4-n,0));let h=-1;t.doc.nodesBetween(u,t.doc.content.size,((e,t)=>{if(h>-1)return!1;e.isTextblock&&0===e.content.size&&(h=t+1)})),h>-1&&t.setSelection(r.U3.near(t.doc.resolve(h))),t.scrollIntoView()}return!0}const m=u.pos===d.end()?p.contentMatchAt(0).defaultType:null,g=Ae(f,p.type.name,p.attrs),y=Ae(f,d.node().type.name,d.node().attrs);t.delete(d.pos,u.pos);const v=m?[{type:c,attrs:g},{type:m,attrs:y}]:[{type:c,attrs:g}];if(!(0,o.zy)(t.doc,d.pos,2))return!1;if(s){const{selection:e,storedMarks:r}=n,{splittableMarks:i}=a.extensionManager,o=r||e.$to.parentOffset&&e.$from.marks();if(t.split(d.pos,2,v).scrollIntoView(),!o||!s)return!0;const l=o.filter((e=>i.includes(e.type.name)));t.ensureMarks(l)}return!0},toggleList:(e,t,n,r={})=>({editor:s,tr:i,state:o,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:u,splittableMarks:h}=s.extensionManager,p=B(e,o.schema),f=B(t,o.schema),{selection:m,storedMarks:g}=o,{$from:y,$to:v}=m,b=y.blockRange(v),x=g||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;const w=_e((e=>Me(e.type.name,u)))(m);if(b.depth>=1&&w&&b.depth-w.depth<=1){if(w.node.type===p)return c.liftListItem(f);if(Me(w.node.type.name,u)&&p.validContent(w.node.content)&&a)return l().command((()=>(i.setNodeMarkup(w.pos,p),!0))).command((()=>Ne(i,p))).command((()=>Te(i,p))).run()}return n&&x&&a?l().command((()=>{const e=d().wrapInList(p,r),t=x.filter((e=>h.includes(e.type.name)));return i.ensureMarks(t),!!e||c.clearNodes()})).wrapInList(p,r).command((()=>Ne(i,p))).command((()=>Te(i,p))).run():l().command((()=>!!d().wrapInList(p,r)||c.clearNodes())).wrapInList(p,r).command((()=>Ne(i,p))).command((()=>Te(i,p))).run()},toggleMark:(e,t={},n={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:i=!1}=n,o=ue(e,r.schema);return function(e,t,n={}){const{empty:r,ranges:s}=e.selection,i=t?ue(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!i||i.name===e.type.name)).find((e=>ae(e.attrs,n,{strict:!1})));let o=0;const a=[];if(s.forEach((({$from:t,$to:n})=>{const r=t.pos,s=n.pos;e.doc.nodesBetween(r,s,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),i=Math.min(s,t+e.nodeSize);o+=i-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:i}))))}))})),0===o)return!1;const l=a.filter((e=>!i||i.name===e.mark.type.name)).filter((e=>ae(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!i||e.mark.type!==i&&e.mark.type.excludes(i))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=o}(r,o,t)?s.unsetMark(o,{extendEmptyMarkRange:i}):s.setMark(o,t)},toggleNode:(e,t,n={})=>({state:r,commands:s})=>{const i=B(e,r.schema),o=B(t,r.schema);return be(r,i,n)?s.setNode(o):s.setNode(i,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const s=B(e,n.schema);return be(n,s,t)?r.lift(s):r.wrapIn(s,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const s=n[r];let i;if(s.spec.isInputRules&&(i=s.getState(e))){if(t){const t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){const n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:s}=n;return r||t&&s.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:s})=>{var i;const{extendEmptyMarkRange:o=!1}=t,{selection:a}=n,l=ue(e,r.schema),{$from:c,empty:d,ranges:u}=a;if(!s)return!0;if(d&&o){let{from:e,to:t}=a;const r=null===(i=c.marks().find((e=>e.type===l)))||void 0===i?void 0:i.attrs,s=de(c,l,r);s&&(e=s.from,t=s.to),n.removeMark(e,t,l)}else u.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const a=xe("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(i=B(e,r.schema)),"mark"===a&&(o=ue(e,r.schema)),s&&n.selection.ranges.forEach((e=>{const s=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(s,a,((e,r)=>{i&&i===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),o&&e.marks.length&&e.marks.forEach((i=>{if(o===i.type){const l=Math.max(r,s),c=Math.min(r+e.nodeSize,a);n.addMark(l,c,o.create({...i.attrs,...t}))}}))}))})),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:s,$to:i}=n.selection,a=s.blockRange(i),l=a&&(0,o.oM)(a,e,t);return!!l&&(r&&r(n.tr.wrap(a,l).scrollIntoView()),!0)}}(B(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:s,$to:a}=n.selection,l=s.blockRange(a),c=!1,d=l;if(!l)return!1;if(l.depth>=2&&s.node(l.depth-1).type.compatibleContent(e)&&0==l.startIndex){if(0==s.index(l.depth-1))return!1;let e=n.doc.resolve(l.start-2);d=new i.u$(e,e,l.depth),l.endIndex<l.parent.childCount&&(l=new i.u$(s,n.doc.resolve(a.end(l.depth)),l.depth)),c=!0}let u=(0,o.oM)(d,e,t,l);return!!u&&(r&&r(function(e,t,n,r,s){let a=i.FK.empty;for(let e=n.length-1;e>=0;e--)a=i.FK.from(n[e].type.create(n[e].attrs,a));e.step(new o.Wg(t.start-(r?2:0),t.end,t.start,t.end,new i.Ji(a,0,0),n.length,!0));let l=0;for(let e=0;e<n.length;e++)n[e].type==s&&(l=e+1);let c=n.length-l,d=t.start+n.length-(r?2:0),u=t.parent;for(let n=t.startIndex,r=t.endIndex,s=!0;n<r;n++,s=!1)!s&&(0,o.zy)(e.doc,d,c)&&(e.split(d,c),d+=2*c),d+=u.child(n).nodeSize;return e}(n.tr,l,u,c,e).scrollIntoView()),!0)}}(B(e,n.schema),t)(n,r)});function Ee(e){return new G({find:e.find,handler:({state:t,range:n,match:r})=>{const s=V(e.getAttributes,void 0,r);if(!1===s||null===s)return null;const{tr:i}=t,o=r[r.length-1],a=r[0];if(o){const r=a.search(/\S/),l=n.from+a.indexOf(o),c=l+o.length;if(Se(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>l)).length)return null;c<n.to&&i.delete(c,n.to),l>n.from&&i.delete(n.from+r,l);const d=n.from+r+o.length;i.addMark(n.from+r,d,e.type.create(s||{})),i.removeStoredMark(e.type)}}})}function De(e){return new G({find:e.find,handler:({state:t,range:n,match:r})=>{const s=V(e.getAttributes,void 0,r)||{},{tr:i}=t,o=n.from;let a=n.to;const l=e.type.create(s);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>a?e=a:a=e+r[1].length;const t=r[0][r[0].length-1];i.insertText(t,o+r[0].length-1),i.replaceWith(e,a,l)}else r[0]&&i.insert(o-1,e.type.create(s)).delete(i.mapping.map(o),i.mapping.map(a));i.scrollIntoView()}})}function Re(e){return new G({find:e.find,handler:({state:t,range:n,match:r})=>{const s=t.doc.resolve(n.from),i=V(e.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)}})}function Ie(e){return new G({find:e.find,handler:({state:t,range:n,match:r,chain:s})=>{const i=V(e.getAttributes,void 0,r)||{},a=t.tr.delete(n.from,n.to),l=a.doc.resolve(n.from).blockRange(),c=l&&(0,o.oM)(l,e.type,i);if(!c)return null;if(a.wrap(l,c),e.keepMarks&&e.editor){const{selection:n,storedMarks:r}=t,{splittableMarks:s}=e.editor.extensionManager,i=r||n.$to.parentOffset&&n.$from.marks();if(i){const e=i.filter((e=>s.includes(e.type.name)));a.ensureMarks(e)}}if(e.keepAttributes){const t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";s().updateAttributes(t,i).run()}const d=a.doc.resolve(n.from-1).nodeBefore;d&&d.type===e.type&&(0,o.n9)(a.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,d))&&a.join(n.from-1)}})}ie.create({name:"commands",addCommands:()=>({...$e})}),ie.create({name:"editable",addProseMirrorPlugins(){return[new r.k_({key:new r.hs("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ie.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new r.k_({key:new r.hs("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),ie.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:s}=t,{empty:i,$anchor:o}=n,{pos:a,parent:l}=o,c=o.parent.isTextblock?t.doc.resolve(a-1):o,d=c.parent.type.spec.isolating,u=o.pos-o.parentOffset,h=d&&1===c.parent.childCount?u===o.pos:r.LN.atStart(s).from===a;return!(!(i&&h&&l.type.isTextblock)||l.textContent.length)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()])),t=()=>this.editor.commands.first((({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},s={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return fe()||ve()?i:s},addProseMirrorPlugins(){return[new r.k_({key:new r.hs("clearDocument"),appendTransaction:(e,t,n)=>{if(!e.some((e=>e.docChanged))||t.doc.eq(n.doc))return;const{empty:s,from:i,to:o}=t.selection,a=r.LN.atStart(t.doc).from,l=r.LN.atEnd(t.doc).to;if(s||i!==a||o!==l)return;if(0!==n.doc.textBetween(0,n.doc.content.size," "," ").length)return;const c=n.tr,d=R({state:n,transaction:c}),{commands:u}=new I({editor:this.editor,state:d});return u.clearNodes(),c.steps.length?c:void 0}})]}}),ie.create({name:"tabindex",addProseMirrorPlugins(){return[new r.k_({key:new r.hs("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Pe{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=V(P(this,"addOptions",{name:this.name}))),this.storage=V(P(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Pe(e)}configure(e={}){const t=this.extend();return t.options=se(this.options,e),t.storage=V(P(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Pe({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=V(P(t,"addOptions",{name:t.name})),t.storage=V(P(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const s=r.marks();if(!s.find((e=>(null==e?void 0:e.type.name)===t.name)))return!1;const i=s.find((e=>(null==e?void 0:e.type.name)===t.name));return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}}class Fe{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=V(P(this,"addOptions",{name:this.name}))),this.storage=V(P(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Fe(e)}configure(e={}){const t=this.extend();return t.options=se(this.options,e),t.storage=V(P(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Fe({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=V(P(t,"addOptions",{name:t.name})),t.storage=V(P(t,"addStorage",{name:t.name,options:t.options})),t}}function Le(e){return new ee({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:s})=>{const i=V(e.getAttributes,void 0,r,s);if(!1===i||null===i)return null;const{tr:o}=t,a=r[r.length-1],l=r[0];let c=n.to;if(a){const r=l.search(/\S/),s=n.from+l.indexOf(a),d=s+a.length;if(Se(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>s)).length)return null;d<n.to&&o.delete(d,n.to),s>n.from&&o.delete(n.from+r,s),c=n.from+r+a.length,o.addMark(n.from+r,c,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}},4717:(e,t,n)=>{"use strict";n.d(t,{A:()=>r}),n(31);const r=n(4198).YY.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;return null===(t=e.style.color)||void 0===t?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})})},2359:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(4198).YY.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>e.style.textAlign||this.options.defaultAlignment,renderHTML:e=>e.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${e.textAlign}`}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>!!this.options.alignments.includes(e)&&this.options.types.every((n=>t.updateAttributes(n,{textAlign:e}))),unsetTextAlign:()=>({commands:e})=>this.options.types.every((t=>e.resetAttributes(t,"textAlign")))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}})},31:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(4198);const s=r.CU.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=(0,r.z6)(e,this.type);return!!Object.entries(n).some((([,e])=>!!e))||t.unsetMark(this.name)}}}})},2740:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(4198);const s=r.CU.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}})},3948:(e,t,n)=>{"use strict";n.d(t,{Z:()=>re});var r,s,i=n(4198),o=n(9679);!function(e){e.Attribute="attribute",e.Pseudo="pseudo",e.PseudoElement="pseudo-element",e.Tag="tag",e.Universal="universal",e.Adjacent="adjacent",e.Child="child",e.Descendant="descendant",e.Parent="parent",e.Sibling="sibling",e.ColumnCombinator="column-combinator"}(r||(r={})),function(e){e.Any="any",e.Element="element",e.End="end",e.Equals="equals",e.Exists="exists",e.Hyphen="hyphen",e.Not="not",e.Start="start"}(s||(s={}));const a=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,l=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,c=new Map([[126,s.Element],[94,s.Start],[36,s.End],[42,s.Any],[33,s.Not],[124,s.Hyphen]]),d=new Set(["has","not","matches","is","where","host","host-context"]),u=new Set(["contains","icontains"]);function h(e,t,n){const r=parseInt(t,16)-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)}function p(e){return e.replace(l,h)}function f(e){return 39===e||34===e}function m(e){return 32===e||9===e||10===e||12===e||13===e}function g(e){const t=[],n=y(t,`${e}`,0);if(n<e.length)throw new Error(`Unmatched selector: ${e.slice(n)}`);return t}function y(e,t,n){let i=[];function o(e){const r=t.slice(n+e).match(a);if(!r)throw new Error(`Expected name, found ${t.slice(n)}`);const[s]=r;return n+=e+s.length,p(s)}function l(e){for(n+=e;n<t.length&&m(t.charCodeAt(n));)n++}function h(){const e=n+=1;let r=1;for(;r>0&&n<t.length;n++)40!==t.charCodeAt(n)||g(n)?41!==t.charCodeAt(n)||g(n)||r--:r++;if(r)throw new Error("Parenthesis not matched");return p(t.slice(e,n-1))}function g(e){let n=0;for(;92===t.charCodeAt(--e);)n++;return!(1&~n)}function v(){if(i.length>0&&function(e){switch(e.type){case r.Adjacent:case r.Child:case r.Descendant:case r.Parent:case r.Sibling:case r.ColumnCombinator:return!0;default:return!1}}(i[i.length-1]))throw new Error("Did not expect successive traversals.")}function b(e){i.length>0&&i[i.length-1].type===r.Descendant?i[i.length-1].type=e:(v(),i.push({type:e}))}function x(e,t){i.push({type:r.Attribute,name:e,action:t,value:o(1),namespace:null,ignoreCase:"quirks"})}function w(){if(i.length&&i[i.length-1].type===r.Descendant&&i.pop(),0===i.length)throw new Error("Empty sub-selector");e.push(i)}if(l(0),t.length===n)return n;e:for(;n<t.length;){const e=t.charCodeAt(n);switch(e){case 32:case 9:case 10:case 12:case 13:0!==i.length&&i[0].type===r.Descendant||(v(),i.push({type:r.Descendant})),l(1);break;case 62:b(r.Child),l(1);break;case 60:b(r.Parent),l(1);break;case 126:b(r.Sibling),l(1);break;case 43:b(r.Adjacent),l(1);break;case 46:x("class",s.Element);break;case 35:x("id",s.Equals);break;case 91:{let e;l(1);let a=null;124===t.charCodeAt(n)?e=o(1):t.startsWith("*|",n)?(a="*",e=o(2)):(e=o(0),124===t.charCodeAt(n)&&61!==t.charCodeAt(n+1)&&(a=e,e=o(1))),l(0);let d=s.Exists;const u=c.get(t.charCodeAt(n));if(u){if(d=u,61!==t.charCodeAt(n+1))throw new Error("Expected `=`");l(2)}else 61===t.charCodeAt(n)&&(d=s.Equals,l(1));let h="",y=null;if("exists"!==d){if(f(t.charCodeAt(n))){const e=t.charCodeAt(n);let r=n+1;for(;r<t.length&&(t.charCodeAt(r)!==e||g(r));)r+=1;if(t.charCodeAt(r)!==e)throw new Error("Attribute value didn't end");h=p(t.slice(n+1,r)),n=r+1}else{const e=n;for(;n<t.length&&(!m(t.charCodeAt(n))&&93!==t.charCodeAt(n)||g(n));)n+=1;h=p(t.slice(e,n))}l(0);const e=32|t.charCodeAt(n);115===e?(y=!1,l(1)):105===e&&(y=!0,l(1))}if(93!==t.charCodeAt(n))throw new Error("Attribute selector didn't terminate");n+=1;const v={type:r.Attribute,name:e,action:d,value:h,namespace:a,ignoreCase:y};i.push(v);break}case 58:{if(58===t.charCodeAt(n+1)){i.push({type:r.PseudoElement,name:o(2).toLowerCase(),data:40===t.charCodeAt(n)?h():null});continue}const e=o(1).toLowerCase();let s=null;if(40===t.charCodeAt(n))if(d.has(e)){if(f(t.charCodeAt(n+1)))throw new Error(`Pseudo-selector ${e} cannot be quoted`);if(s=[],n=y(s,t,n+1),41!==t.charCodeAt(n))throw new Error(`Missing closing parenthesis in :${e} (${t})`);n+=1}else{if(s=h(),u.has(e)){const e=s.charCodeAt(0);e===s.charCodeAt(s.length-1)&&f(e)&&(s=s.slice(1,-1))}s=p(s)}i.push({type:r.Pseudo,name:e,data:s});break}case 44:w(),i=[],l(1);break;default:{if(t.startsWith("/*",n)){const e=t.indexOf("*/",n+2);if(e<0)throw new Error("Comment was not terminated");n=e+2,0===i.length&&l(0);break}let s,c=null;if(42===e)n+=1,s="*";else if(124===e){if(s="",124===t.charCodeAt(n+1)){b(r.ColumnCombinator),l(2);break}}else{if(!a.test(t.slice(n)))break e;s=o(0)}124===t.charCodeAt(n)&&124!==t.charCodeAt(n+1)&&(c=s,42===t.charCodeAt(n+1)?(s="*",n+=2):s=o(1)),i.push("*"===s?{type:r.Universal,namespace:c}:{type:r.Tag,name:s,namespace:c})}}}return w(),n}var v=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[\x01-\x7F]/g,x=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,w=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,k={"":"shy","":"zwnj","":"zwj","":"lrm","":"ic","":"it","":"af","":"rlm","":"ZeroWidthSpace","":"NoBreak","̑":"DownBreve","⃛":"tdot","⃜":"DotDot","\t":"Tab","\n":"NewLine"," ":"puncsp"," ":"MediumSpace"," ":"thinsp"," ":"hairsp"," ":"emsp13"," ":"ensp"," ":"emsp14"," ":"emsp"," ":"numsp"," ":"nbsp"," ":"ThickSpace","‾":"oline",_:"lowbar","‐":"dash","–":"ndash","—":"mdash","―":"horbar",",":"comma",";":"semi","⁏":"bsemi",":":"colon","⩴":"Colone","!":"excl","¡":"iexcl","?":"quest","¿":"iquest",".":"period","‥":"nldr","…":"mldr","·":"middot","'":"apos","‘":"lsquo","’":"rsquo","‚":"sbquo","‹":"lsaquo","›":"rsaquo",'"':"quot","“":"ldquo","”":"rdquo","„":"bdquo","«":"laquo","»":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","⌈":"lceil","⌉":"rceil","⌊":"lfloor","⌋":"rfloor","⦅":"lopar","⦆":"ropar","⦋":"lbrke","⦌":"rbrke","⦍":"lbrkslu","⦎":"rbrksld","⦏":"lbrksld","⦐":"rbrkslu","⦑":"langd","⦒":"rangd","⦓":"lparlt","⦔":"rpargt","⦕":"gtlPar","⦖":"ltrPar","⟦":"lobrk","⟧":"robrk","⟨":"lang","⟩":"rang","⟪":"Lang","⟫":"Rang","⟬":"loang","⟭":"roang","❲":"lbbrk","❳":"rbbrk","‖":"Vert","§":"sect","¶":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","‰":"permil","‱":"pertenk","†":"dagger","‡":"Dagger","•":"bull","⁃":"hybull","′":"prime","″":"Prime","‴":"tprime","⁗":"qprime","‵":"bprime","⁁":"caret","`":"grave","´":"acute","˜":"tilde","^":"Hat","¯":"macr","˘":"breve","˙":"dot","¨":"die","˚":"ring","˝":"dblac","¸":"cedil","˛":"ogon",ˆ:"circ",ˇ:"caron","°":"deg","©":"copy","®":"reg","℗":"copysr",℘:"wp","℞":"rx","℧":"mho","℩":"iiota","←":"larr","↚":"nlarr","→":"rarr","↛":"nrarr","↑":"uarr","↓":"darr","↔":"harr","↮":"nharr","↕":"varr","↖":"nwarr","↗":"nearr","↘":"searr","↙":"swarr","↝":"rarrw","↝̸":"nrarrw","↞":"Larr","↟":"Uarr","↠":"Rarr","↡":"Darr","↢":"larrtl","↣":"rarrtl","↤":"mapstoleft","↥":"mapstoup","↦":"map","↧":"mapstodown","↩":"larrhk","↪":"rarrhk","↫":"larrlp","↬":"rarrlp","↭":"harrw","↰":"lsh","↱":"rsh","↲":"ldsh","↳":"rdsh","↵":"crarr","↶":"cularr","↷":"curarr","↺":"olarr","↻":"orarr","↼":"lharu","↽":"lhard","↾":"uharr","↿":"uharl","⇀":"rharu","⇁":"rhard","⇂":"dharr","⇃":"dharl","⇄":"rlarr","⇅":"udarr","⇆":"lrarr","⇇":"llarr","⇈":"uuarr","⇉":"rrarr","⇊":"ddarr","⇋":"lrhar","⇌":"rlhar","⇐":"lArr","⇍":"nlArr","⇑":"uArr","⇒":"rArr","⇏":"nrArr","⇓":"dArr","⇔":"iff","⇎":"nhArr","⇕":"vArr","⇖":"nwArr","⇗":"neArr","⇘":"seArr","⇙":"swArr","⇚":"lAarr","⇛":"rAarr","⇝":"zigrarr","⇤":"larrb","⇥":"rarrb","⇵":"duarr","⇽":"loarr","⇾":"roarr","⇿":"hoarr","∀":"forall","∁":"comp","∂":"part","∂̸":"npart","∃":"exist","∄":"nexist","∅":"empty","∇":"Del","∈":"in","∉":"notin","∋":"ni","∌":"notni","϶":"bepsi","∏":"prod","∐":"coprod","∑":"sum","+":"plus","±":"pm","÷":"div","×":"times","<":"lt","≮":"nlt","<⃒":"nvlt","=":"equals","≠":"ne","=⃥":"bne","⩵":"Equal",">":"gt","≯":"ngt",">⃒":"nvgt","¬":"not","|":"vert","¦":"brvbar","−":"minus","∓":"mp","∔":"plusdo","⁄":"frasl","∖":"setmn","∗":"lowast","∘":"compfn","√":"Sqrt","∝":"prop","∞":"infin","∟":"angrt","∠":"ang","∠⃒":"nang","∡":"angmsd","∢":"angsph","∣":"mid","∤":"nmid","∥":"par","∦":"npar","∧":"and","∨":"or","∩":"cap","∩︀":"caps","∪":"cup","∪︀":"cups","∫":"int","∬":"Int","∭":"tint","⨌":"qint","∮":"oint","∯":"Conint","∰":"Cconint","∱":"cwint","∲":"cwconint","∳":"awconint","∴":"there4","∵":"becaus","∶":"ratio","∷":"Colon","∸":"minusd","∺":"mDDot","∻":"homtht","∼":"sim","≁":"nsim","∼⃒":"nvsim","∽":"bsim","∽̱":"race","∾":"ac","∾̳":"acE","∿":"acd","≀":"wr","≂":"esim","≂̸":"nesim","≃":"sime","≄":"nsime","≅":"cong","≇":"ncong","≆":"simne","≈":"ap","≉":"nap","≊":"ape","≋":"apid","≋̸":"napid","≌":"bcong","≍":"CupCap","≭":"NotCupCap","≍⃒":"nvap","≎":"bump","≎̸":"nbump","≏":"bumpe","≏̸":"nbumpe","≐":"doteq","≐̸":"nedot","≑":"eDot","≒":"efDot","≓":"erDot","≔":"colone","≕":"ecolon","≖":"ecir","≗":"cire","≙":"wedgeq","≚":"veeeq","≜":"trie","≟":"equest","≡":"equiv","≢":"nequiv","≡⃥":"bnequiv","≤":"le","≰":"nle","≤⃒":"nvle","≥":"ge","≱":"nge","≥⃒":"nvge","≦":"lE","≦̸":"nlE","≧":"gE","≧̸":"ngE","≨︀":"lvnE","≨":"lnE","≩":"gnE","≩︀":"gvnE","≪":"ll","≪̸":"nLtv","≪⃒":"nLt","≫":"gg","≫̸":"nGtv","≫⃒":"nGt","≬":"twixt","≲":"lsim","≴":"nlsim","≳":"gsim","≵":"ngsim","≶":"lg","≸":"ntlg","≷":"gl","≹":"ntgl","≺":"pr","⊀":"npr","≻":"sc","⊁":"nsc","≼":"prcue","⋠":"nprcue","≽":"sccue","⋡":"nsccue","≾":"prsim","≿":"scsim","≿̸":"NotSucceedsTilde","⊂":"sub","⊄":"nsub","⊂⃒":"vnsub","⊃":"sup","⊅":"nsup","⊃⃒":"vnsup","⊆":"sube","⊈":"nsube","⊇":"supe","⊉":"nsupe","⊊︀":"vsubne","⊊":"subne","⊋︀":"vsupne","⊋":"supne","⊍":"cupdot","⊎":"uplus","⊏":"sqsub","⊏̸":"NotSquareSubset","⊐":"sqsup","⊐̸":"NotSquareSuperset","⊑":"sqsube","⋢":"nsqsube","⊒":"sqsupe","⋣":"nsqsupe","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊕":"oplus","⊖":"ominus","⊗":"otimes","⊘":"osol","⊙":"odot","⊚":"ocir","⊛":"oast","⊝":"odash","⊞":"plusb","⊟":"minusb","⊠":"timesb","⊡":"sdotb","⊢":"vdash","⊬":"nvdash","⊣":"dashv","⊤":"top","⊥":"bot","⊧":"models","⊨":"vDash","⊭":"nvDash","⊩":"Vdash","⊮":"nVdash","⊪":"Vvdash","⊫":"VDash","⊯":"nVDash","⊰":"prurel","⊲":"vltri","⋪":"nltri","⊳":"vrtri","⋫":"nrtri","⊴":"ltrie","⋬":"nltrie","⊴⃒":"nvltrie","⊵":"rtrie","⋭":"nrtrie","⊵⃒":"nvrtrie","⊶":"origof","⊷":"imof","⊸":"mumap","⊹":"hercon","⊺":"intcal","⊻":"veebar","⊽":"barvee","⊾":"angrtvb","⊿":"lrtri","⋀":"Wedge","⋁":"Vee","⋂":"xcap","⋃":"xcup","⋄":"diam","⋅":"sdot","⋆":"Star","⋇":"divonx","⋈":"bowtie","⋉":"ltimes","⋊":"rtimes","⋋":"lthree","⋌":"rthree","⋍":"bsime","⋎":"cuvee","⋏":"cuwed","⋐":"Sub","⋑":"Sup","⋒":"Cap","⋓":"Cup","⋔":"fork","⋕":"epar","⋖":"ltdot","⋗":"gtdot","⋘":"Ll","⋘̸":"nLl","⋙":"Gg","⋙̸":"nGg","⋚︀":"lesg","⋚":"leg","⋛":"gel","⋛︀":"gesl","⋞":"cuepr","⋟":"cuesc","⋦":"lnsim","⋧":"gnsim","⋨":"prnsim","⋩":"scnsim","⋮":"vellip","⋯":"ctdot","⋰":"utdot","⋱":"dtdot","⋲":"disin","⋳":"isinsv","⋴":"isins","⋵":"isindot","⋵̸":"notindot","⋶":"notinvc","⋷":"notinvb","⋹":"isinE","⋹̸":"notinE","⋺":"nisd","⋻":"xnis","⋼":"nis","⋽":"notnivc","⋾":"notnivb","⌅":"barwed","⌆":"Barwed","⌌":"drcrop","⌍":"dlcrop","⌎":"urcrop","⌏":"ulcrop","⌐":"bnot","⌒":"profline","⌓":"profsurf","⌕":"telrec","⌖":"target","⌜":"ulcorn","⌝":"urcorn","⌞":"dlcorn","⌟":"drcorn","⌢":"frown","⌣":"smile","⌭":"cylcty","⌮":"profalar","⌶":"topbot","⌽":"ovbar","⌿":"solbar","⍼":"angzarr","⎰":"lmoust","⎱":"rmoust","⎴":"tbrk","⎵":"bbrk","⎶":"bbrktbrk","⏜":"OverParenthesis","⏝":"UnderParenthesis","⏞":"OverBrace","⏟":"UnderBrace","⏢":"trpezium","⏧":"elinters","␣":"blank","─":"boxh","│":"boxv","┌":"boxdr","┐":"boxdl","└":"boxur","┘":"boxul","├":"boxvr","┤":"boxvl","┬":"boxhd","┴":"boxhu","┼":"boxvh","═":"boxH","║":"boxV","╒":"boxdR","╓":"boxDr","╔":"boxDR","╕":"boxdL","╖":"boxDl","╗":"boxDL","╘":"boxuR","╙":"boxUr","╚":"boxUR","╛":"boxuL","╜":"boxUl","╝":"boxUL","╞":"boxvR","╟":"boxVr","╠":"boxVR","╡":"boxvL","╢":"boxVl","╣":"boxVL","╤":"boxHd","╥":"boxhD","╦":"boxHD","╧":"boxHu","╨":"boxhU","╩":"boxHU","╪":"boxvH","╫":"boxVh","╬":"boxVH","▀":"uhblk","▄":"lhblk","█":"block","░":"blk14","▒":"blk12","▓":"blk34","□":"squ","▪":"squf","▫":"EmptyVerySmallSquare","▭":"rect","▮":"marker","▱":"fltns","△":"xutri","▴":"utrif","▵":"utri","▸":"rtrif","▹":"rtri","▽":"xdtri","▾":"dtrif","▿":"dtri","◂":"ltrif","◃":"ltri","◊":"loz","○":"cir","◬":"tridot","◯":"xcirc","◸":"ultri","◹":"urtri","◺":"lltri","◻":"EmptySmallSquare","◼":"FilledSmallSquare","★":"starf","☆":"star","☎":"phone","♀":"female","♂":"male","♠":"spades","♣":"clubs","♥":"hearts","♦":"diams","♪":"sung","✓":"check","✗":"cross","✠":"malt","✶":"sext","❘":"VerticalSeparator","⟈":"bsolhsub","⟉":"suphsol","⟵":"xlarr","⟶":"xrarr","⟷":"xharr","⟸":"xlArr","⟹":"xrArr","⟺":"xhArr","⟼":"xmap","⟿":"dzigrarr","⤂":"nvlArr","⤃":"nvrArr","⤄":"nvHarr","⤅":"Map","⤌":"lbarr","⤍":"rbarr","⤎":"lBarr","⤏":"rBarr","⤐":"RBarr","⤑":"DDotrahd","⤒":"UpArrowBar","⤓":"DownArrowBar","⤖":"Rarrtl","⤙":"latail","⤚":"ratail","⤛":"lAtail","⤜":"rAtail","⤝":"larrfs","⤞":"rarrfs","⤟":"larrbfs","⤠":"rarrbfs","⤣":"nwarhk","⤤":"nearhk","⤥":"searhk","⤦":"swarhk","⤧":"nwnear","⤨":"toea","⤩":"tosa","⤪":"swnwar","⤳":"rarrc","⤳̸":"nrarrc","⤵":"cudarrr","⤶":"ldca","⤷":"rdca","⤸":"cudarrl","⤹":"larrpl","⤼":"curarrm","⤽":"cularrp","⥅":"rarrpl","⥈":"harrcir","⥉":"Uarrocir","⥊":"lurdshar","⥋":"ldrushar","⥎":"LeftRightVector","⥏":"RightUpDownVector","⥐":"DownLeftRightVector","⥑":"LeftUpDownVector","⥒":"LeftVectorBar","⥓":"RightVectorBar","⥔":"RightUpVectorBar","⥕":"RightDownVectorBar","⥖":"DownLeftVectorBar","⥗":"DownRightVectorBar","⥘":"LeftUpVectorBar","⥙":"LeftDownVectorBar","⥚":"LeftTeeVector","⥛":"RightTeeVector","⥜":"RightUpTeeVector","⥝":"RightDownTeeVector","⥞":"DownLeftTeeVector","⥟":"DownRightTeeVector","⥠":"LeftUpTeeVector","⥡":"LeftDownTeeVector","⥢":"lHar","⥣":"uHar","⥤":"rHar","⥥":"dHar","⥦":"luruhar","⥧":"ldrdhar","⥨":"ruluhar","⥩":"rdldhar","⥪":"lharul","⥫":"llhard","⥬":"rharul","⥭":"lrhard","⥮":"udhar","⥯":"duhar","⥰":"RoundImplies","⥱":"erarr","⥲":"simrarr","⥳":"larrsim","⥴":"rarrsim","⥵":"rarrap","⥶":"ltlarr","⥸":"gtrarr","⥹":"subrarr","⥻":"suplarr","⥼":"lfisht","⥽":"rfisht","⥾":"ufisht","⥿":"dfisht","⦚":"vzigzag","⦜":"vangrt","⦝":"angrtvbd","⦤":"ange","⦥":"range","⦦":"dwangle","⦧":"uwangle","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","⦰":"bemptyv","⦱":"demptyv","⦲":"cemptyv","⦳":"raemptyv","⦴":"laemptyv","⦵":"ohbar","⦶":"omid","⦷":"opar","⦹":"operp","⦻":"olcross","⦼":"odsold","⦾":"olcir","⦿":"ofcir","⧀":"olt","⧁":"ogt","⧂":"cirscir","⧃":"cirE","⧄":"solb","⧅":"bsolb","⧉":"boxbox","⧍":"trisb","⧎":"rtriltri","⧏":"LeftTriangleBar","⧏̸":"NotLeftTriangleBar","⧐":"RightTriangleBar","⧐̸":"NotRightTriangleBar","⧜":"iinfin","⧝":"infintie","⧞":"nvinfin","⧣":"eparsl","⧤":"smeparsl","⧥":"eqvparsl","⧫":"lozf","⧴":"RuleDelayed","⧶":"dsol","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨄":"xuplus","⨆":"xsqcup","⨍":"fpartint","⨐":"cirfnint","⨑":"awint","⨒":"rppolint","⨓":"scpolint","⨔":"npolint","⨕":"pointint","⨖":"quatint","⨗":"intlarhk","⨢":"pluscir","⨣":"plusacir","⨤":"simplus","⨥":"plusdu","⨦":"plussim","⨧":"plustwo","⨩":"mcomma","⨪":"minusdu","⨭":"loplus","⨮":"roplus","⨯":"Cross","⨰":"timesd","⨱":"timesbar","⨳":"smashp","⨴":"lotimes","⨵":"rotimes","⨶":"otimesas","⨷":"Otimes","⨸":"odiv","⨹":"triplus","⨺":"triminus","⨻":"tritime","⨼":"iprod","⨿":"amalg","⩀":"capdot","⩂":"ncup","⩃":"ncap","⩄":"capand","⩅":"cupor","⩆":"cupcap","⩇":"capcup","⩈":"cupbrcap","⩉":"capbrcup","⩊":"cupcup","⩋":"capcap","⩌":"ccups","⩍":"ccaps","⩐":"ccupssm","⩓":"And","⩔":"Or","⩕":"andand","⩖":"oror","⩗":"orslope","⩘":"andslope","⩚":"andv","⩛":"orv","⩜":"andd","⩝":"ord","⩟":"wedbar","⩦":"sdote","⩪":"simdot","⩭":"congdot","⩭̸":"ncongdot","⩮":"easter","⩯":"apacir","⩰":"apE","⩰̸":"napE","⩱":"eplus","⩲":"pluse","⩳":"Esim","⩷":"eDDot","⩸":"equivDD","⩹":"ltcir","⩺":"gtcir","⩻":"ltquest","⩼":"gtquest","⩽":"les","⩽̸":"nles","⩾":"ges","⩾̸":"nges","⩿":"lesdot","⪀":"gesdot","⪁":"lesdoto","⪂":"gesdoto","⪃":"lesdotor","⪄":"gesdotol","⪅":"lap","⪆":"gap","⪇":"lne","⪈":"gne","⪉":"lnap","⪊":"gnap","⪋":"lEg","⪌":"gEl","⪍":"lsime","⪎":"gsime","⪏":"lsimg","⪐":"gsiml","⪑":"lgE","⪒":"glE","⪓":"lesges","⪔":"gesles","⪕":"els","⪖":"egs","⪗":"elsdot","⪘":"egsdot","⪙":"el","⪚":"eg","⪝":"siml","⪞":"simg","⪟":"simlE","⪠":"simgE","⪡":"LessLess","⪡̸":"NotNestedLessLess","⪢":"GreaterGreater","⪢̸":"NotNestedGreaterGreater","⪤":"glj","⪥":"gla","⪦":"ltcc","⪧":"gtcc","⪨":"lescc","⪩":"gescc","⪪":"smt","⪫":"lat","⪬":"smte","⪬︀":"smtes","⪭":"late","⪭︀":"lates","⪮":"bumpE","⪯":"pre","⪯̸":"npre","⪰":"sce","⪰̸":"nsce","⪳":"prE","⪴":"scE","⪵":"prnE","⪶":"scnE","⪷":"prap","⪸":"scap","⪹":"prnap","⪺":"scnap","⪻":"Pr","⪼":"Sc","⪽":"subdot","⪾":"supdot","⪿":"subplus","⫀":"supplus","⫁":"submult","⫂":"supmult","⫃":"subedot","⫄":"supedot","⫅":"subE","⫅̸":"nsubE","⫆":"supE","⫆̸":"nsupE","⫇":"subsim","⫈":"supsim","⫋︀":"vsubnE","⫋":"subnE","⫌︀":"vsupnE","⫌":"supnE","⫏":"csub","⫐":"csup","⫑":"csube","⫒":"csupe","⫓":"subsup","⫔":"supsub","⫕":"subsub","⫖":"supsup","⫗":"suphsub","⫘":"supdsub","⫙":"forkv","⫚":"topfork","⫛":"mlcp","⫤":"Dashv","⫦":"Vdashl","⫧":"Barv","⫨":"vBar","⫩":"vBarv","⫫":"Vbar","⫬":"Not","⫭":"bNot","⫮":"rnmid","⫯":"cirmid","⫰":"midcir","⫱":"topcir","⫲":"nhpar","⫳":"parsim","⫽":"parsl","⫽⃥":"nparsl","♭":"flat","♮":"natur","♯":"sharp","¤":"curren","¢":"cent",$:"dollar","£":"pound","¥":"yen","€":"euro","¹":"sup1","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","²":"sup2","⅔":"frac23","⅖":"frac25","³":"sup3","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78",𝒶:"ascr",𝕒:"aopf",𝔞:"afr",𝔸:"Aopf",𝔄:"Afr",𝒜:"Ascr",ª:"ordf",á:"aacute",Á:"Aacute",à:"agrave",À:"Agrave",ă:"abreve",Ă:"Abreve",â:"acirc",Â:"Acirc",å:"aring",Å:"angst",ä:"auml",Ä:"Auml",ã:"atilde",Ã:"Atilde",ą:"aogon",Ą:"Aogon",ā:"amacr",Ā:"Amacr",æ:"aelig",Æ:"AElig",𝒷:"bscr",𝕓:"bopf",𝔟:"bfr",𝔹:"Bopf",ℬ:"Bscr",𝔅:"Bfr",𝔠:"cfr",𝒸:"cscr",𝕔:"copf",ℭ:"Cfr",𝒞:"Cscr",ℂ:"Copf",ć:"cacute",Ć:"Cacute",ĉ:"ccirc",Ĉ:"Ccirc",č:"ccaron",Č:"Ccaron",ċ:"cdot",Ċ:"Cdot",ç:"ccedil",Ç:"Ccedil","℅":"incare",𝔡:"dfr",ⅆ:"dd",𝕕:"dopf",𝒹:"dscr",𝒟:"Dscr",𝔇:"Dfr",ⅅ:"DD",𝔻:"Dopf",ď:"dcaron",Ď:"Dcaron",đ:"dstrok",Đ:"Dstrok",ð:"eth",Ð:"ETH",ⅇ:"ee",ℯ:"escr",𝔢:"efr",𝕖:"eopf",ℰ:"Escr",𝔈:"Efr",𝔼:"Eopf",é:"eacute",É:"Eacute",è:"egrave",È:"Egrave",ê:"ecirc",Ê:"Ecirc",ě:"ecaron",Ě:"Ecaron",ë:"euml",Ë:"Euml",ė:"edot",Ė:"Edot",ę:"eogon",Ę:"Eogon",ē:"emacr",Ē:"Emacr",𝔣:"ffr",𝕗:"fopf",𝒻:"fscr",𝔉:"Ffr",𝔽:"Fopf",ℱ:"Fscr",ff:"fflig",ffi:"ffilig",ffl:"ffllig",fi:"filig",fj:"fjlig",fl:"fllig",ƒ:"fnof",ℊ:"gscr",𝕘:"gopf",𝔤:"gfr",𝒢:"Gscr",𝔾:"Gopf",𝔊:"Gfr",ǵ:"gacute",ğ:"gbreve",Ğ:"Gbreve",ĝ:"gcirc",Ĝ:"Gcirc",ġ:"gdot",Ġ:"Gdot",Ģ:"Gcedil",𝔥:"hfr",ℎ:"planckh",𝒽:"hscr",𝕙:"hopf",ℋ:"Hscr",ℌ:"Hfr",ℍ:"Hopf",ĥ:"hcirc",Ĥ:"Hcirc",ℏ:"hbar",ħ:"hstrok",Ħ:"Hstrok",𝕚:"iopf",𝔦:"ifr",𝒾:"iscr",ⅈ:"ii",𝕀:"Iopf",ℐ:"Iscr",ℑ:"Im",í:"iacute",Í:"Iacute",ì:"igrave",Ì:"Igrave",î:"icirc",Î:"Icirc",ï:"iuml",Ï:"Iuml",ĩ:"itilde",Ĩ:"Itilde",İ:"Idot",į:"iogon",Į:"Iogon",ī:"imacr",Ī:"Imacr",ij:"ijlig",IJ:"IJlig",ı:"imath",𝒿:"jscr",𝕛:"jopf",𝔧:"jfr",𝒥:"Jscr",𝔍:"Jfr",𝕁:"Jopf",ĵ:"jcirc",Ĵ:"Jcirc",ȷ:"jmath",𝕜:"kopf",𝓀:"kscr",𝔨:"kfr",𝒦:"Kscr",𝕂:"Kopf",𝔎:"Kfr",ķ:"kcedil",Ķ:"Kcedil",𝔩:"lfr",𝓁:"lscr",ℓ:"ell",𝕝:"lopf",ℒ:"Lscr",𝔏:"Lfr",𝕃:"Lopf",ĺ:"lacute",Ĺ:"Lacute",ľ:"lcaron",Ľ:"Lcaron",ļ:"lcedil",Ļ:"Lcedil",ł:"lstrok",Ł:"Lstrok",ŀ:"lmidot",Ŀ:"Lmidot",𝔪:"mfr",𝕞:"mopf",𝓂:"mscr",𝔐:"Mfr",𝕄:"Mopf",ℳ:"Mscr",𝔫:"nfr",𝕟:"nopf",𝓃:"nscr",ℕ:"Nopf",𝒩:"Nscr",𝔑:"Nfr",ń:"nacute",Ń:"Nacute",ň:"ncaron",Ň:"Ncaron",ñ:"ntilde",Ñ:"Ntilde",ņ:"ncedil",Ņ:"Ncedil","№":"numero",ŋ:"eng",Ŋ:"ENG",𝕠:"oopf",𝔬:"ofr",ℴ:"oscr",𝒪:"Oscr",𝔒:"Ofr",𝕆:"Oopf",º:"ordm",ó:"oacute",Ó:"Oacute",ò:"ograve",Ò:"Ograve",ô:"ocirc",Ô:"Ocirc",ö:"ouml",Ö:"Ouml",ő:"odblac",Ő:"Odblac",õ:"otilde",Õ:"Otilde",ø:"oslash",Ø:"Oslash",ō:"omacr",Ō:"Omacr",œ:"oelig",Œ:"OElig",𝔭:"pfr",𝓅:"pscr",𝕡:"popf",ℙ:"Popf",𝔓:"Pfr",𝒫:"Pscr",𝕢:"qopf",𝔮:"qfr",𝓆:"qscr",𝒬:"Qscr",𝔔:"Qfr",ℚ:"Qopf",ĸ:"kgreen",𝔯:"rfr",𝕣:"ropf",𝓇:"rscr",ℛ:"Rscr",ℜ:"Re",ℝ:"Ropf",ŕ:"racute",Ŕ:"Racute",ř:"rcaron",Ř:"Rcaron",ŗ:"rcedil",Ŗ:"Rcedil",𝕤:"sopf",𝓈:"sscr",𝔰:"sfr",𝕊:"Sopf",𝔖:"Sfr",𝒮:"Sscr","Ⓢ":"oS",ś:"sacute",Ś:"Sacute",ŝ:"scirc",Ŝ:"Scirc",š:"scaron",Š:"Scaron",ş:"scedil",Ş:"Scedil",ß:"szlig",𝔱:"tfr",𝓉:"tscr",𝕥:"topf",𝒯:"Tscr",𝔗:"Tfr",𝕋:"Topf",ť:"tcaron",Ť:"Tcaron",ţ:"tcedil",Ţ:"Tcedil","™":"trade",ŧ:"tstrok",Ŧ:"Tstrok",𝓊:"uscr",𝕦:"uopf",𝔲:"ufr",𝕌:"Uopf",𝔘:"Ufr",𝒰:"Uscr",ú:"uacute",Ú:"Uacute",ù:"ugrave",Ù:"Ugrave",ŭ:"ubreve",Ŭ:"Ubreve",û:"ucirc",Û:"Ucirc",ů:"uring",Ů:"Uring",ü:"uuml",Ü:"Uuml",ű:"udblac",Ű:"Udblac",ũ:"utilde",Ũ:"Utilde",ų:"uogon",Ų:"Uogon",ū:"umacr",Ū:"Umacr",𝔳:"vfr",𝕧:"vopf",𝓋:"vscr",𝔙:"Vfr",𝕍:"Vopf",𝒱:"Vscr",𝕨:"wopf",𝓌:"wscr",𝔴:"wfr",𝒲:"Wscr",𝕎:"Wopf",𝔚:"Wfr",ŵ:"wcirc",Ŵ:"Wcirc",𝔵:"xfr",𝓍:"xscr",𝕩:"xopf",𝕏:"Xopf",𝔛:"Xfr",𝒳:"Xscr",𝔶:"yfr",𝓎:"yscr",𝕪:"yopf",𝒴:"Yscr",𝔜:"Yfr",𝕐:"Yopf",ý:"yacute",Ý:"Yacute",ŷ:"ycirc",Ŷ:"Ycirc",ÿ:"yuml",Ÿ:"Yuml",𝓏:"zscr",𝔷:"zfr",𝕫:"zopf",ℨ:"Zfr",ℤ:"Zopf",𝒵:"Zscr",ź:"zacute",Ź:"Zacute",ž:"zcaron",Ž:"Zcaron",ż:"zdot",Ż:"Zdot",Ƶ:"imped",þ:"thorn",Þ:"THORN",ʼn:"napos",α:"alpha",Α:"Alpha",β:"beta",Β:"Beta",γ:"gamma",Γ:"Gamma",δ:"delta",Δ:"Delta",ε:"epsi",ϵ:"epsiv",Ε:"Epsilon",ϝ:"gammad",Ϝ:"Gammad",ζ:"zeta",Ζ:"Zeta",η:"eta",Η:"Eta",θ:"theta",ϑ:"thetav",Θ:"Theta",ι:"iota",Ι:"Iota",κ:"kappa",ϰ:"kappav",Κ:"Kappa",λ:"lambda",Λ:"Lambda",μ:"mu",µ:"micro",Μ:"Mu",ν:"nu",Ν:"Nu",ξ:"xi",Ξ:"Xi",ο:"omicron",Ο:"Omicron",π:"pi",ϖ:"piv",Π:"Pi",ρ:"rho",ϱ:"rhov",Ρ:"Rho",σ:"sigma",Σ:"Sigma",ς:"sigmaf",τ:"tau",Τ:"Tau",υ:"upsi",Υ:"Upsilon",ϒ:"Upsi",φ:"phi",ϕ:"phiv",Φ:"Phi",χ:"chi",Χ:"Chi",ψ:"psi",Ψ:"Psi",ω:"omega",Ω:"ohm",а:"acy",А:"Acy",б:"bcy",Б:"Bcy",в:"vcy",В:"Vcy",г:"gcy",Г:"Gcy",ѓ:"gjcy",Ѓ:"GJcy",д:"dcy",Д:"Dcy",ђ:"djcy",Ђ:"DJcy",е:"iecy",Е:"IEcy",ё:"iocy",Ё:"IOcy",є:"jukcy",Є:"Jukcy",ж:"zhcy",Ж:"ZHcy",з:"zcy",З:"Zcy",ѕ:"dscy",Ѕ:"DScy",и:"icy",И:"Icy",і:"iukcy",І:"Iukcy",ї:"yicy",Ї:"YIcy",й:"jcy",Й:"Jcy",ј:"jsercy",Ј:"Jsercy",к:"kcy",К:"Kcy",ќ:"kjcy",Ќ:"KJcy",л:"lcy",Л:"Lcy",љ:"ljcy",Љ:"LJcy",м:"mcy",М:"Mcy",н:"ncy",Н:"Ncy",њ:"njcy",Њ:"NJcy",о:"ocy",О:"Ocy",п:"pcy",П:"Pcy",р:"rcy",Р:"Rcy",с:"scy",С:"Scy",т:"tcy",Т:"Tcy",ћ:"tshcy",Ћ:"TSHcy",у:"ucy",У:"Ucy",ў:"ubrcy",Ў:"Ubrcy",ф:"fcy",Ф:"Fcy",х:"khcy",Х:"KHcy",ц:"tscy",Ц:"TScy",ч:"chcy",Ч:"CHcy",џ:"dzcy",Џ:"DZcy",ш:"shcy",Ш:"SHcy",щ:"shchcy",Щ:"SHCHcy",ъ:"hardcy",Ъ:"HARDcy",ы:"ycy",Ы:"Ycy",ь:"softcy",Ь:"SOFTcy",э:"ecy",Э:"Ecy",ю:"yucy",Ю:"YUcy",я:"yacy",Я:"YAcy",ℵ:"aleph",ℶ:"beth",ℷ:"gimel",ℸ:"daleth"},_=/["&'<>`]/g,C=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;String.fromCharCode;function S(e,t){if(!e)return t;const n={};let r;for(r in t)n[r]=ne(e,r)?e[r]:t[r];return n}var A=function(e){return`&#x${e.toString(16).toUpperCase()};`},M=function(e){return`&#${e};`};function O(e){throw new Error(`Parse error: ${e}`)}var N=function(e,t){(t=S(t,N.options)).strict&&C.test(e)&&O("forbidden code point");const n=t.encodeEverything,r=t.useNamedReferences,s=t.allowUnsafeSymbols,i=t.decimal?M:A,o=function(e){return i(e.charCodeAt(0))};return n?(e=e.replace(b,(e=>r&&ne(k,e)?`&${k[e]};`:o(e))),r&&(e=e.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),r&&(e=e.replace(w,(e=>`&${k[e]};`)))):r?(s||(e=e.replace(_,(e=>`&${k[e]};`))),e=(e=e.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒")).replace(w,(e=>`&${k[e]};`))):s||(e=e.replace(_,o)),e.replace(v,(e=>{const t=e.charCodeAt(0),n=e.charCodeAt(1);return i(1024*(t-55296)+n-56320+65536)})).replace(x,o)};function T(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")}function $(e,t,...n){return"object"==typeof e&&(n=(e="fragment").children,t=e.attrs),Array.isArray(t)?(n=[t],t={}):t?t.attrs&&delete(t={...t.attrs,...t}).attrs:t={},{tag:e,attrs:t,children:"string"==typeof n[0]?n:n.flat(Number.POSITIVE_INFINITY)}}N.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var E=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","command"];function D(e,t,n={},r){const s=!("string"==typeof r&&""===r||Array.isArray(r)&&(0===r.length||1===r.length&&""===r[0])||null==r),i=[];if("noop"!==(t=t.replace(/__/g,":"))&&""!==t){"cdata"!==t?i.push(`<${t}`):i.push("<![CDATA[");for(let e in n)if(e&&ne(n,e)){const t=n[e];if("html"===e)continue;"classname"===e.toLowerCase()&&(e="class"),e=e.replace(/__/g,":"),!0===t?i.push(` ${e}`):"style"===e&&"object"==typeof t?i.push(` ${e}="${Object.keys(t).filter((e=>null!=t[e])).map((e=>{let n=t[e];return n="number"==typeof n?`${n}px`:n,`${e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${n}`})).join(";")}"`):!1!==t&&null!=t&&i.push(` ${e}="${T(t.toString())}"`)}if("cdata"!==t){if(e&&!s)return i.push(" />"),i.join("");i.push(">")}if(!e&&E.includes(t))return i.join("")}if(s)if("string"==typeof r)i.push(r);else if(r&&r.length>0)for(let e of r)if(null!=e&&!1!==e){Array.isArray(e)||(e=[e]);for(const n of e)n.startsWith("<")&&n.endsWith(">")||"script"===t||"style"===t?i.push(n):i.push(T(n.toString()))}return n.html&&i.push(n.html),"noop"!==t&&""!==t&&("cdata"!==t?i.push(`</${t}>`):i.push("]]>")),i.join("")}function R(e,t,...n){const{tag:r,attrs:s,children:i}=$(e,t,n);return D(!1,r,s,i)}var I=D.bind(null,!1);R.firstLine="<!DOCTYPE html>",R.html=!0;var P={};var F=Symbol.for("nodejs.util.inspect.custom"),L={fontWeight:"bold"},B={fontStyle:"italic"},z={backgroundColor:"rgb(255, 250, 165)"},j={textDecorations:"underline"},V={textDecorations:"line-through"},H={b:L,strong:L,em:B,i:B,mark:z,u:j,a:j,s:V,del:V,ins:z,strike:V},U=class e{constructor(){this.append=this.appendChild,this._parentNode=null,this._childNodes=[]}get nodeType(){return console.error("Subclasses should define nodeType!"),0}get nodeName(){return console.error("Subclasses should define nodeName!"),""}get nodeValue(){return null}cloneNode(e=!1){const t=new this.constructor;return e&&(t._childNodes=this._childNodes.map((e=>e.cloneNode(!0))),t._fixChildNodesParent()),t}_fixChildNodesParent(){this._childNodes.forEach((e=>e._parentNode=this))}insertBefore(e,t){if(e!==t){let n=t?this._childNodes.indexOf(t):0;n<0&&(n=0),this._childNodes.splice(n,0,e),this._fixChildNodesParent()}}appendChild(t){if(null!=t)if(t!==this){if(t instanceof X&&console.warn("No defined how to append a document to a node!",t),t instanceof Y)for(const e of[...t._childNodes])this.appendChild(e);else if(Array.isArray(t))for(const e of[...t])this.appendChild(e);else if(t instanceof e)t.remove(),this._childNodes.push(t);else try{const e="string"==typeof t?t:JSON.stringify(t,null,2);this._childNodes.push(new Z(e))}catch(e){console.error(`The data ${t} to be added to ${this.render()} is problematic: ${e}`)}this._fixChildNodesParent()}else console.warn("Cannot appendChild to self")}removeChild(e){const t=this._childNodes.indexOf(e);t>=0&&(e._parentNode=null,this._childNodes.splice(t,1),this._fixChildNodesParent())}remove(){var e;return null==(e=null==this?void 0:this.parentNode)||e.removeChild(this),this}replaceChildren(...e){this._childNodes=e.map((e=>"string"==typeof e?new Z(e):e.remove())),this._fixChildNodesParent()}replaceWith(...e){const t=this._parentNode;if(t){const n=this._indexInParent();n>=0&&(e=e.map((e=>"string"==typeof e?new Z(e):e.remove())),t._childNodes.splice(n,1,...e),this._parentNode=null,t._fixChildNodesParent())}}_indexInParent(){return this._parentNode?this._parentNode.childNodes.indexOf(this):-1}get parentNode(){return this._parentNode}get childNodes(){return this._childNodes||[]}get children(){return this._childNodes||[]}get firstChild(){return this._childNodes[0]}get lastChild(){return this._childNodes[this._childNodes.length-1]}get nextSibling(){const e=this._indexInParent();return null!=e&&this.parentNode.childNodes[e+1]||null}get previousSibling(){const e=this._indexInParent();return e>0&&this.parentNode.childNodes[e-1]||null}flatten(){const e=[];this instanceof W&&e.push(this);for(const t of this._childNodes)e.push(...t.flatten());return e}flattenNodes(){const e=[];e.push(this);for(const t of this._childNodes)e.push(...t.flattenNodes());return e}render(){return""}get textContent(){return this._childNodes.map((e=>e.textContent)).join("")}set textContent(e){this._childNodes=[],e&&this.appendChild(new Z(e.toString()))}contains(e){return e===this||this._childNodes.some((t=>t.contains(e)))}get ownerDocument(){var t;return this.nodeType===e.DOCUMENT_NODE||this.nodeType===e.DOCUMENT_FRAGMENT_NODE?this:null==(t=null==this?void 0:this._parentNode)?void 0:t.ownerDocument}toString(){return`${this.nodeName}`}[F](){return`${this.constructor.name} "${this.render()}"`}};U.ELEMENT_NODE=1,U.TEXT_NODE=3,U.CDATA_SECTION_NODE=4,U.PROCESSING_INSTRUCTION_NODE=7,U.COMMENT_NODE=8,U.DOCUMENT_NODE=9,U.DOCUMENT_TYPE_NODE=10,U.DOCUMENT_FRAGMENT_NODE=11;var q,K=U,Z=class extends K{constructor(e=""){super(),this._text=e}get nodeType(){return K.TEXT_NODE}get nodeName(){return"#text"}get nodeValue(){return this._text||""}get textContent(){return this.nodeValue}render(){var e;const t=null==(e=this.parentNode)?void 0:e.tagName;return"SCRIPT"===t||"STYLE"===t?this._text:T(this._text)}cloneNode(e=!1){const t=super.cloneNode(e);return t._text=this._text,t}},J=class extends K{getElementById(e){return this.flatten().find((t=>t._attributes.id===e))}getElementsByClassName(e){return this.flatten().filter((t=>t.classList.contains(e)))}matches(e){return function(e,t,{debug:n=!1}={}){for(const n of function(e){let t=P[e];return null==t&&(t=g(e),P[e]=t),t}(e)){const r=(t,n)=>{var s,i,o,a;let l=!1;for(const c of n){const{type:d,name:u,action:h,value:p,_ignoreCase:f=!0,data:m}=c;if("attribute"===d)"equals"===h?l=t.getAttribute(u)===p:"start"===h?l=!!(null==(s=t.getAttribute(u))?void 0:s.startsWith(p)):"end"===h?l=!!(null==(i=t.getAttribute(u))?void 0:i.endsWith(p)):"element"===h?l="class"===u?t.classList.contains(p):!!(null==(o=t.getAttribute(u))?void 0:o.includes(p)):"exists"===h?l=t.hasAttribute(u):"any"===h?l=!!(null==(a=t.getAttribute(u))?void 0:a.includes(p)):console.warn("Unknown CSS selector action",h);else if("tag"===d)l=t.tagName===u.toUpperCase();else if("universal"===d)l=!0;else if("pseudo"===d){if("not"===u){let e=!0;m.forEach((n=>{r(t,n)||(e=!1)})),l=!e}}else console.warn("Unknown CSS selector type",d,e,n);if(!l)break}return l};if(r(t,n))return!0}return!1}(e,this)}querySelectorAll(e){return this.flatten().filter((t=>t.matches(e)))}querySelector(e){return this.flatten().find((t=>t.matches(e)))}parent(e){var t;return this.matches(e)?this:null==this.parentNode?null:null==(t=this.parentNode)?void 0:t.parent(e)}handle(e,t){let n=0;for(const r of this.querySelectorAll(e))t(r,n++)}},W=class extends J{constructor(e="div",t={}){super(),this._originalTagName=e,this._nodeName=(e||"").toUpperCase(),this._attributes=t||{},this._styles=null}get nodeType(){return K.ELEMENT_NODE}get nodeName(){return this._nodeName}cloneNode(e=!1){const t=super.cloneNode(e);return t._originalTagName=this._originalTagName,t._nodeName=this._nodeName,t._attributes=Object.assign({},this._attributes),t}get attributes(){return Object.entries(this._attributes).map((([e,t])=>({name:e,value:t})))}get attributesObject(){return{...this._attributes}}_findAttributeName(e){const t=e.toLowerCase();return Object.keys(this._attributes).find((e=>t===e.toLowerCase()))||null}setAttribute(e,t){this.removeAttribute(e),this._attributes[e]=t,this._styles=null}getAttribute(e){const t=this._findAttributeName(e),n=t?this._attributes[t]:null;return null==n?null:"string"==typeof n?n:""}removeAttribute(e){this._findAttributeName(String(e))&&delete this._attributes[e]}hasAttribute(e){const t=this._findAttributeName(e);return!!t&&null!=this._attributes[t]}get style(){if(null==this._styles){const t=Object.assign({},H[this.tagName.toLowerCase()]||{}),n=this.getAttribute("style");if(n){let r;const s=/\s*([\w-]+)\s*:\s*([^;]+)/g;for(;r=s.exec(n);){const n=r[1],s=r[2].trim();t[n]=s,t[(e=n,e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,((e,t)=>t.toUpperCase())))]=s}}this._styles=t}var e;return this._styles}get tagName(){return this._nodeName}setTagName(e){this._nodeName=e.toUpperCase()}get id(){return this._attributes.id||null}set id(e){null==e?delete this._attributes.id:this._attributes.id=e}get src(){return this._attributes.src}set src(e){null==e?delete this._attributes.src:this._attributes.src=e}getElementsByTagName(e){e=e.toUpperCase();const t=this.flatten();return"*"!==e?t.filter((t=>t.tagName===e)):t}setInnerHTML(e){}get innerHTML(){return this._childNodes.map((e=>e.render(R))).join("")}set innerHTML(e){this.setInnerHTML(e)}get outerHTML(){return this.render(I)}get className(){return this._attributes.class||""}set className(e){Array.isArray(e)?e=e.filter((e=>!!e)).join(" "):"object"==typeof e&&(e=Object.entries(e).filter((([e,t])=>!!t)).map((([e,t])=>e)).join(" ")),this._attributes.class=e}get classList(){var e;const t=this,n=String(null!=(e=this.className)?e:"").trim().split(/\s+/g)||[];return{contains:e=>n.includes(e),add(e){n.includes(e)||(n.push(e),t.className=n)},remove(e){const r=n.indexOf(e);r>=0&&(n.splice(r,1),t.className=n)}}}render(e=I){return e(this._originalTagName||this.tagName,this._attributes,this._childNodes.map((t=>t.render(e))).join(""))}},G=class e extends K{get nodeName(){return super.nodeName}get nodeValue(){return super.nodeValue}get nodeType(){return e.DOCUMENT_TYPE_NODE}render(){return"<!DOCTYPE html>"}},Y=class e extends J{get nodeType(){return K.DOCUMENT_FRAGMENT_NODE}get nodeName(){return"#document-fragment"}render(e=I){return this._childNodes.map((t=>t.render(e)||[])).join("")}get innerHTML(){return this._childNodes.map((e=>e.render(R))).join("")}createElement(e,t={}){return new W(e,t)}createDocumentFragment(){return new e}createTextNode(e){return new Z(e)}},X=class extends Y{get nodeType(){return K.DOCUMENT_NODE}get nodeName(){return"#document"}get documentElement(){return this.firstChild}render(e=I){let t=super.render(e);return this.docType&&(t=this.docType.render()+t),t}},Q=class extends X{constructor(e=!1){if(super(),this.docType=new G,!e){const e=new W("html"),t=new W("body"),n=new W("head"),r=new W("title");e.appendChild(n),n.appendChild(r),e.appendChild(t),this.appendChild(e)}}get body(){let e=this.querySelector("body");if(!e){let t=this.querySelector("html");t||(t=new W("html"),this.appendChild(t)),e=new W("body"),t.appendChild(t)}return e}get title(){var e;return(null==(e=this.querySelector("title"))?void 0:e.textContent)||""}set title(e){const t=this.querySelector("title");t&&(t.textContent=e)}get head(){let e=this.querySelector("head");if(!e){let t=this.querySelector("html");t||(t=new W("html"),this.appendChild(t)),e=new W("head"),t.insertBefore(t)}return e}},ee=new X;(q={document:ee}).h=function(e,t,...n){const{tag:r,attrs:s,children:i}=$(e,t,n);return function(e,t,n,r){if("function"==typeof t)return t({props:{...n,children:r},attrs:n,children:r,h:e.h,context:e});{let s,i=!0;if(t?"fragment"===t.toLowerCase()?(s=e.document.createDocumentFragment(),i=!1):s=e.document.createElement(t):s=e.document.createElement("div"),n&&i){const e=s;for(let[t,r]of Object.entries(n)){t=t.toString();const n=t.toLowerCase();"classname"===n?e.className=r:"on"===n?Object.entries(r).forEach((([t,n])=>{e.setAttribute(`on${t}`,String(n))})):!1!==r&&null!=r&&(!0===r?e.setAttribute(t,t):e.setAttribute(t,r.toString()))}}if(r)for(const t of r){const n=Array.isArray(t)?[...t]:[t];for(const t of n)t&&!1!==t&&null!=t&&("object"!=typeof t?s.appendChild(e.document.createTextNode(t.toString())):s.appendChild(t))}return s}}(q,r,s,i)},q.h;var te={}.hasOwnProperty;function ne(e,t){return te.call(e,t)}function re(e,t){const n=(0,i._w)(t);return function(e,t,n){return o.ZF.fromSchema(t).serializeFragment(e.content,{document:new Q}).render()}(o.bP.fromJSON(n,e),n)}},9049:(e,t,n)=>{"use strict";n.d(t,{A:()=>_e});var r=n(4198);const s=/^\s*>\s$/,i=r.bP.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[(0,r.tG)({find:s,type:this.type})]}}),o=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,a=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,l=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,c=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,d=r.CU.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[(0,r.OX)({find:o,type:this.type}),(0,r.OX)({find:l,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:a,type:this.type}),(0,r.Zc)({find:c,type:this.type})]}}),u=r.bP.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",(0,r.KV)(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),h=r.CU.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=(0,r.z6)(e,this.type);return!!Object.entries(n).some((([,e])=>!!e))||t.unsetMark(this.name)}}}}),p=/^\s*([-+*])\s$/,f=r.bP.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(u.name,this.editor.getAttributes(h.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=(0,r.tG)({find:p,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,r.tG)({find:p,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(h.name),editor:this.editor})),[e]}}),m=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,g=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,y=r.CU.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[(0,r.OX)({find:m,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:g,type:this.type})]}});var v=n(2559);const b=/^```([a-z]+)?[\s\n]$/,x=/^~~~([a-z]+)?[\s\n]$/,w=r.bP.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options;return[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter((e=>e.startsWith(n))).map((e=>e.replace(n,"")))[0]||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",(0,r.KV)(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes()},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:s}=n;if(!s||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith("\n\n");return!(!i||!o)&&e.chain().command((({tr:e})=>(e.delete(r.pos-2,r.pos),!0))).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:s,empty:i}=n;if(!i||s.parent.type!==this.type)return!1;if(s.parentOffset!==s.parent.nodeSize-2)return!1;const o=s.after();return void 0!==o&&(!r.nodeAt(o)&&e.commands.exitCode())}}},addInputRules(){return[(0,r.JJ)({find:b,type:this.type,getAttributes:e=>({language:e[1]})}),(0,r.JJ)({find:x,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new v.k_({key:new v.hs("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),s=r?JSON.parse(r):void 0,i=null==s?void 0:s.mode;if(!n||!i)return!1;const{tr:o}=e.state;return o.replaceSelectionWith(this.type.create({language:i})),o.setSelection(v.U3.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.insertText(n.replace(/\r\n?/g,"\n")),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}}),k=r.bP.create({name:"doc",topNode:!0,content:"block+"});var _=n(196);function C(e={}){return new v.k_({view:t=>new S(t,e)})}class S{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=t.width)&&void 0!==n?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map((t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}destroy(){this.handlers.forEach((({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t)))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent;if(n){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(t){let s=t.getBoundingClientRect(),i=n?s.bottom:s.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:s.left,right:s.right,top:i-this.width/2,bottom:i+this.width/2}}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos);e={left:t.left-this.width/2,right:t.left+this.width/2,top:t.top,bottom:t.bottom}}let r,s,i=this.editorView.dom.offsetParent;if(this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!i||i==document.body&&"static"==getComputedStyle(i).position)r=-pageXOffset,s=-pageYOffset;else{let e=i.getBoundingClientRect();r=e.left-i.scrollLeft,s=e.top-i.scrollTop}this.element.style.left=e.left-r+"px",this.element.style.top=e.top-s+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,s="function"==typeof r?r(this.editorView,t,e):r;if(t&&!s){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=(0,_.Um)(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const A=r.YY.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[C(this.options)]}});var M=n(1804),O=n(9679),N=n(5873);class T extends v.LN{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return T.valid(n)?new T(n):v.LN.near(n)}content(){return O.Ji.empty}eq(e){return e instanceof T&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new T(e.resolve(t.pos))}getBookmark(){return new $(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&T.valid(e))return e;let r=e.pos,s=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){s=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let o=e.doc.resolve(r);if(T.valid(o))return o}for(;;){let i=t>0?s.firstChild:s.lastChild;if(!i){if(s.isAtom&&!s.isText&&!v.nh.isSelectable(s)){e=e.doc.resolve(r+s.nodeSize*t),n=!1;continue e}break}s=i,r+=t;let o=e.doc.resolve(r);if(T.valid(o))return o}return null}}}T.prototype.visible=!1,T.findFrom=T.findGapCursorFrom,v.LN.jsonID("gapcursor",T);class ${constructor(e){this.pos=e}map(e){return new $(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return T.valid(t)?new T(t):v.LN.near(t)}}const E=(0,M.K)({ArrowLeft:D("horiz",-1),ArrowRight:D("horiz",1),ArrowUp:D("vert",-1),ArrowDown:D("vert",1)});function D(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,s){let i=e.selection,o=t>0?i.$to:i.$from,a=i.empty;if(i instanceof v.U3){if(!s.endOfTextblock(n)||0==o.depth)return!1;a=!1,o=e.doc.resolve(t>0?o.after():o.before())}let l=T.findGapCursorFrom(o,t,a);return!!l&&(r&&r(e.tr.setSelection(new T(l))),!0)}}function R(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!T.valid(r))return!1;let s=e.posAtCoords({left:n.clientX,top:n.clientY});return!(s&&s.inside>-1&&v.nh.isSelectable(e.state.doc.nodeAt(s.inside))||(e.dispatch(e.state.tr.setSelection(new T(r))),0))}function I(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof T))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let s=O.FK.empty;for(let e=r.length-1;e>=0;e--)s=O.FK.from(r[e].createAndFill(null,s));let i=e.state.tr.replace(n.pos,n.pos,new O.Ji(s,0,0));return i.setSelection(v.U3.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function P(e){if(!(e.selection instanceof T))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",N.zF.create(e.doc,[N.NZ.widget(e.selection.head,t,{key:"gapcursor"})])}const F=r.YY.create({name:"gapCursor",addProseMirrorPlugins:()=>[new v.k_({props:{decorations:P,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&T.valid(n)?new T(n):null,handleClick:R,handleKeyDown:E,handleDOMEvents:{beforeinput:I}}})],extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!==(t=(0,r.gk)((0,r.iI)(e,"allowGapCursor",n)))&&void 0!==t?t:null}}}),L=r.bP.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",(0,r.KV)(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:e,storedMarks:s}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:o}=r.extensionManager,a=s||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{if(t&&a&&i){const t=a.filter((e=>o.includes(e.type.name)));e.ensureMarks(t)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),B=r.bP.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((e=>({tag:`h${e}`,attrs:{level:e}})))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,(0,r.KV)(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce(((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})})),{})},addInputRules(){return this.options.levels.map((e=>(0,r.JJ)({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}})))}});var z=200,j=function(){};j.prototype.append=function(e){return e.length?(e=j.from(e),!this.length&&e||e.length<z&&this.leafAppend(e)||this.length<z&&e.leafPrepend(this)||this.appendInner(e)):this},j.prototype.prepend=function(e){return e.length?j.from(e).append(this):this},j.prototype.appendInner=function(e){return new H(this,e)},j.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?j.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},j.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},j.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)},j.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},j.from=function(e){return e instanceof j?e:e&&e.length?new V(e):j.empty};var V=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 s=t;s<n;s++)if(!1===e(this.values[s],r+s))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var s=t-1;s>=n;s--)if(!1===e(this.values[s],r+s))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=z)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=z)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}(j);j.empty=new V([]);var H=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 s=this.left.length;return!(t<s&&!1===this.left.forEachInner(e,t,Math.min(n,s),r))&&!(n>s&&!1===this.right.forEachInner(e,Math.max(t-s,0),Math.min(this.length,n)-s,r+s))&&void 0},t.prototype.forEachInvertedInner=function(e,t,n,r){var s=this.left.length;return!(t>s&&!1===this.right.forEachInvertedInner(e,t-s,Math.max(n,s)-s,r+s))&&!(n<s&&!1===this.left.forEachInvertedInner(e,Math.min(t,s),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}(j);const U=j;class q{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}t&&(n=this.remapping(s,this.items.length),r=n.maps.length);let i,o,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(s,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new K(e.map));let t,s=e.step.map(n.slice(r));s&&a.maybeStep(s).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new K(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(i=n?e.selection.map(n.slice(r)):e.selection,o=new q(this.items.slice(0,s).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:o,transform:a,selection:i}}addTransform(e,t,n,r){let s=[],i=this.eventCount,o=this.items,a=!r&&o.length?o.get(o.length-1):null;for(let n=0;n<e.steps.length;n++){let l,c=e.steps[n].invert(e.docs[n]),d=new K(e.mapping.maps[n],c,t);(l=a&&a.merge(d))&&(d=l,n?s.pop():o=o.slice(0,o.length-1)),s.push(d),t&&(i++,t=void 0),r||(a=d)}let l=i-n.depth;return l>J&&(o=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(o,l),i-=l),new q(o.append(s),i)}remapping(e,t){let n=new _.X9;return this.items.forEach(((t,r)=>{let s=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,s)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new q(this.items.append(e.map((e=>new K(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),s=e.mapping,i=e.steps.length,o=this.eventCount;this.items.forEach((e=>{e.selection&&o--}),r);let a=t;this.items.forEach((t=>{let r=s.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=s.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(s.slice(a+1,r));c&&o++,n.push(new K(l,i,c))}else n.push(new K(l))}),r);let l=[];for(let e=t;e<i;e++)l.push(new K(s.maps[e]));let c=this.items.slice(0,r).append(l).append(n),d=new q(c,o);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d}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=[],s=0;return this.items.forEach(((i,o)=>{if(o>=e)r.push(i),i.selection&&s++;else if(i.step){let e=i.step.map(t.slice(n)),o=e&&e.getMap();if(n--,o&&t.appendMap(o,n),e){let a=i.selection&&i.selection.map(t.slice(n));a&&s++;let l,c=new K(o.invert(),e,a),d=r.length-1;(l=r.length&&r[d].merge(c))?r[d]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new q(U.from(r.reverse()),s)}}q.empty=new q(U.empty,0);class K{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 K(t.getMap().invert(),t,this.selection)}}}class Z{constructor(e,t,n,r,s){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=s}}const J=20;function W(e){let t=[];return e.forEach(((e,n,r,s)=>t.push(r,s))),t}function G(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let s=t.map(e[r],1),i=t.map(e[r+1],-1);s<=i&&n.push(s,i)}return n}function Y(e,t,n,r){let s=ee(t),i=te.get(t).spec.config,o=(r?e.undone:e.done).popEvent(t,s);if(!o)return;let a=o.selection.resolve(o.transform.doc),l=(r?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,s),c=new Z(r?l:o.remaining,r?o.remaining:l,null,0,-1);n(o.transform.setSelection(a).setMeta(te,{redo:r,historyState:c}).scrollIntoView())}let X=!1,Q=null;function ee(e){let t=e.plugins;if(Q!=t){X=!1,Q=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){X=!0;break}}return X}const te=new v.hs("history"),ne=new v.hs("closeHistory");function re(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new v.k_({key:te,state:{init:()=>new Z(q.empty,q.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let s,i=n.getMeta(te);if(i)return i.historyState;n.getMeta(ne)&&(e=new Z(e.done,e.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(o&&o.getMeta(te))return o.getMeta(te).redo?new Z(e.done.addTransform(n,void 0,r,ee(t)),e.undone,W(n.mapping.maps[n.steps.length-1]),e.prevTime,e.prevComposition):new Z(e.done,e.undone.addTransform(n,void 0,r,ee(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))return(s=n.getMeta("rebased"))?new Z(e.done.rebased(n,s),e.undone.rebased(n,s),G(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Z(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),G(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let s=n.getMeta("composition"),i=0==e.prevTime||!o&&e.prevComposition!=s&&(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 s=0;s<t.length;s+=2)e<=t[s+1]&&r>=t[s]&&(n=!0)})),n}(n,e.prevRanges)),a=o?G(e.prevRanges,n.mapping):W(n.mapping.maps[n.steps.length-1]);return new Z(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,ee(t)),q.empty,a,n.time,null==s?e.prevComposition:s)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?se:"historyRedo"==n?ie:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}const se=(e,t)=>{let n=te.getState(e);return!(!n||0==n.done.eventCount||(t&&Y(n,e,t,!1),0))},ie=(e,t)=>{let n=te.getState(e);return!(!n||0==n.undone.eventCount||(t&&Y(n,e,t,!0),0))},oe=r.YY.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>se(e,t),redo:()=>({state:e,dispatch:t})=>ie(e,t)}),addProseMirrorPlugins(){return[re(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),ae=r.bP.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",(0,r.KV)(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{const{$to:n}=t.selection,r=e();return 0===n.parentOffset?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command((({tr:e,dispatch:t})=>{var n;if(t){const{$to:t}=e.selection,r=t.end();if(t.nodeAfter)t.nodeAfter.isTextblock?e.setSelection(v.U3.create(e.doc,t.pos+1)):t.nodeAfter.isBlock?e.setSelection(v.nh.create(e.doc,t.pos)):e.setSelection(v.U3.create(e.doc,t.pos));else{const s=null===(n=t.parent.type.contentMatch.defaultType)||void 0===n?void 0:n.create();s&&(e.insert(r,s),e.setSelection(v.U3.create(e.doc,r+1)))}e.scrollIntoView()}return!0})).run()}}},addInputRules(){return[(0,r.jT)({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),le=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,ce=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,de=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,ue=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,he=r.CU.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,r.OX)({find:le,type:this.type}),(0,r.OX)({find:de,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:ce,type:this.type}),(0,r.Zc)({find:ue,type:this.type})]}}),pe=r.bP.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",(0,r.KV)(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),fe=r.bP.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",(0,r.KV)(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),me=r.CU.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=(0,r.z6)(e,this.type);return!!Object.entries(n).some((([,e])=>!!e))||t.unsetMark(this.name)}}}}),ge=/^(\d+)\.\s$/,ye=r.bP.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",(0,r.KV)(this.options.HTMLAttributes,n),0]:["ol",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(fe.name,this.editor.getAttributes(me.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=(0,r.tG)({find:ge,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,r.tG)({find:ge,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(me.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),ve=r.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),be=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,xe=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,we=r.CU.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){const e={};return(0,r.U0)()?e["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():e["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),e},addInputRules(){return[(0,r.OX)({find:be,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:xe,type:this.type})]}}),ke=r.bP.create({name:"text",group:"inline"}),_e=r.YY.create({name:"starterKit",addExtensions(){var e,t,n,r,s,o,a,l,c,u,h,p,m,g,v,b,x,_;const C=[];return!1!==this.options.blockquote&&C.push(i.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&C.push(d.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&C.push(f.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&C.push(y.configure(null===(r=this.options)||void 0===r?void 0:r.code)),!1!==this.options.codeBlock&&C.push(w.configure(null===(s=this.options)||void 0===s?void 0:s.codeBlock)),!1!==this.options.document&&C.push(k.configure(null===(o=this.options)||void 0===o?void 0:o.document)),!1!==this.options.dropcursor&&C.push(A.configure(null===(a=this.options)||void 0===a?void 0:a.dropcursor)),!1!==this.options.gapcursor&&C.push(F.configure(null===(l=this.options)||void 0===l?void 0:l.gapcursor)),!1!==this.options.hardBreak&&C.push(L.configure(null===(c=this.options)||void 0===c?void 0:c.hardBreak)),!1!==this.options.heading&&C.push(B.configure(null===(u=this.options)||void 0===u?void 0:u.heading)),!1!==this.options.history&&C.push(oe.configure(null===(h=this.options)||void 0===h?void 0:h.history)),!1!==this.options.horizontalRule&&C.push(ae.configure(null===(p=this.options)||void 0===p?void 0:p.horizontalRule)),!1!==this.options.italic&&C.push(he.configure(null===(m=this.options)||void 0===m?void 0:m.italic)),!1!==this.options.listItem&&C.push(pe.configure(null===(g=this.options)||void 0===g?void 0:g.listItem)),!1!==this.options.orderedList&&C.push(ye.configure(null===(v=this.options)||void 0===v?void 0:v.orderedList)),!1!==this.options.paragraph&&C.push(ve.configure(null===(b=this.options)||void 0===b?void 0:b.paragraph)),!1!==this.options.strike&&C.push(we.configure(null===(x=this.options)||void 0===x?void 0:x.strike)),!1!==this.options.text&&C.push(ke.configure(null===(_=this.options)||void 0===_?void 0:_.text)),C}})},5942:(e,t,n)=>{"use strict";n.d(t,{EM:()=>r,MZ:()=>a,wk:()=>l});const r=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)};var s=n(7601);const i={attribute:!0,type:String,converter:s.W3,reflect:!1,hasChanged:s.Ec},o=(e=i,t,n)=>{const{kind:r,metadata:s}=n;let o=globalThis.litPropertyMetadata.get(s);if(void 0===o&&globalThis.litPropertyMetadata.set(s,o=new Map),o.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const s=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,s,e)},init(t){return void 0!==t&&this.P(r,void 0,e),t}}}if("setter"===r){const{name:r}=n;return function(n){const s=this[r];t.call(this,n),this.requestUpdate(r,s,e)}}throw Error("Unsupported decorator location: "+r)};function a(e){return(t,n)=>"object"==typeof n?o(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,r?{...e,wrapped:!0}:e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function l(e){return a({...e,state:!0,attribute:!1})}},251:(e,t,n)=>{"use strict";n.d(t,{WF:()=>V,AH:()=>r.AH,qy:()=>C,XX:()=>j});var r=n(7601);const s=globalThis,i=s.trustedTypes,o=i?i.createPolicy("lit-html",{createHTML:e=>e}):void 0,a="$lit$",l=`lit$${(Math.random()+"").slice(9)}$`,c="?"+l,d=`<${c}>`,u=document,h=()=>u.createComment(""),p=e=>null===e||"object"!=typeof e&&"function"!=typeof e,f=Array.isArray,m="[ \t\n\f\r]",g=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,y=/-->/g,v=/>/g,b=RegExp(`>|${m}(?:([^\\s"'>=/]+)(${m}*=${m}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),x=/'/g,w=/"/g,k=/^(?:script|style|textarea|title)$/i,_=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),C=_(1),S=(_(2),Symbol.for("lit-noChange")),A=Symbol.for("lit-nothing"),M=new WeakMap,O=u.createTreeWalker(u,129);function N(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==o?o.createHTML(t):t}const T=(e,t)=>{const n=e.length-1,r=[];let s,i=2===t?"<svg>":"",o=g;for(let t=0;t<n;t++){const n=e[t];let c,u,h=-1,p=0;for(;p<n.length&&(o.lastIndex=p,u=o.exec(n),null!==u);)p=o.lastIndex,o===g?"!--"===u[1]?o=y:void 0!==u[1]?o=v:void 0!==u[2]?(k.test(u[2])&&(s=RegExp("</"+u[2],"g")),o=b):void 0!==u[3]&&(o=b):o===b?">"===u[0]?(o=s??g,h=-1):void 0===u[1]?h=-2:(h=o.lastIndex-u[2].length,c=u[1],o=void 0===u[3]?b:'"'===u[3]?w:x):o===w||o===x?o=b:o===y||o===v?o=g:(o=b,s=void 0);const f=o===b&&e[t+1].startsWith("/>")?" ":"";i+=o===g?n+d:h>=0?(r.push(c),n.slice(0,h)+a+n.slice(h)+l+f):n+l+(-2===h?t:f)}return[N(e,i+(e[n]||"<?>")+(2===t?"</svg>":"")),r]};class ${constructor({strings:e,_$litType$:t},n){let r;this.parts=[];let s=0,o=0;const d=e.length-1,u=this.parts,[p,f]=T(e,t);if(this.el=$.createElement(p,n),O.currentNode=this.el.content,2===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(r=O.nextNode())&&u.length<d;){if(1===r.nodeType){if(r.hasAttributes())for(const e of r.getAttributeNames())if(e.endsWith(a)){const t=f[o++],n=r.getAttribute(e).split(l),i=/([.?@])?(.*)/.exec(t);u.push({type:1,index:s,name:i[2],strings:n,ctor:"."===i[1]?P:"?"===i[1]?F:"@"===i[1]?L:I}),r.removeAttribute(e)}else e.startsWith(l)&&(u.push({type:6,index:s}),r.removeAttribute(e));if(k.test(r.tagName)){const e=r.textContent.split(l),t=e.length-1;if(t>0){r.textContent=i?i.emptyScript:"";for(let n=0;n<t;n++)r.append(e[n],h()),O.nextNode(),u.push({type:2,index:++s});r.append(e[t],h())}}}else if(8===r.nodeType)if(r.data===c)u.push({type:2,index:s});else{let e=-1;for(;-1!==(e=r.data.indexOf(l,e+1));)u.push({type:7,index:s}),e+=l.length-1}s++}}static createElement(e,t){const n=u.createElement("template");return n.innerHTML=e,n}}function E(e,t,n=e,r){if(t===S)return t;let s=void 0!==r?n._$Co?.[r]:n._$Cl;const i=p(t)?void 0:t._$litDirective$;return s?.constructor!==i&&(s?._$AO?.(!1),void 0===i?s=void 0:(s=new i(e),s._$AT(e,n,r)),void 0!==r?(n._$Co??=[])[r]=s:n._$Cl=s),void 0!==s&&(t=E(e,s._$AS(e,t.values),s,r)),t}class D{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??u).importNode(t,!0);O.currentNode=r;let s=O.nextNode(),i=0,o=0,a=n[0];for(;void 0!==a;){if(i===a.index){let t;2===a.type?t=new R(s,s.nextSibling,this,e):1===a.type?t=new a.ctor(s,a.name,a.strings,this,e):6===a.type&&(t=new B(s,this,e)),this._$AV.push(t),a=n[++o]}i!==a?.index&&(s=O.nextNode(),i++)}return O.currentNode=u,r}p(e){let t=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=E(this,e,t),p(e)?e===A||null==e||""===e?(this._$AH!==A&&this._$AR(),this._$AH=A):e!==this._$AH&&e!==S&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>f(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==A&&p(this._$AH)?this._$AA.nextSibling.data=e:this.T(u.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=$.createElement(N(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{const e=new D(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=M.get(e.strings);return void 0===t&&M.set(e.strings,t=new $(e)),t}k(e){f(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,r=0;for(const s of e)r===t.length?t.push(n=new R(this.S(h()),this.S(h()),this,this.options)):n=t[r],n._$AI(s),r++;r<t.length&&(this._$AR(n&&n._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class I{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,s){this.type=1,this._$AH=A,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=A}_$AI(e,t=this,n,r){const s=this.strings;let i=!1;if(void 0===s)e=E(this,e,t,0),i=!p(e)||e!==this._$AH&&e!==S,i&&(this._$AH=e);else{const r=e;let o,a;for(e=s[0],o=0;o<s.length-1;o++)a=E(this,r[n+o],t,o),a===S&&(a=this._$AH[o]),i||=!p(a)||a!==this._$AH[o],a===A?e=A:e!==A&&(e+=(a??"")+s[o+1]),this._$AH[o]=a}i&&!r&&this.j(e)}j(e){e===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class P extends I{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===A?void 0:e}}class F extends I{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==A)}}class L extends I{constructor(e,t,n,r,s){super(e,t,n,r,s),this.type=5}_$AI(e,t=this){if((e=E(this,e,t,0)??A)===S)return;const n=this._$AH,r=e===A&&n!==A||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==A&&(n===A||r);r&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class B{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){E(this,e)}}const z=s.litHtmlPolyfillSupport;z?.($,R),(s.litHtmlVersions??=[]).push("3.1.2");const j=(e,t,n)=>{const r=n?.renderBefore??t;let s=r._$litPart$;if(void 0===s){const e=n?.renderBefore??null;r._$litPart$=s=new R(t.insertBefore(h(),e),e,void 0,n??{})}return s._$AI(e),s};class V extends r.mN{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=j(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return S}}V._$litElement$=!0,V.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:V});const H=globalThis.litElementPolyfillSupport;H?.({LitElement:V}),(globalThis.litElementVersions??=[]).push("4.0.4")},1804:(e,t,n)=>{"use strict";n.d(t,{K:()=>f,w:()=>p});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:"'"},s={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},i="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),o="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),a=0;a<10;a++)r[48+a]=r[96+a]=String(a);for(a=1;a<=24;a++)r[a+111]="F"+a;for(a=65;a<=90;a++)r[a]=String.fromCharCode(a+32),s[a]=String.fromCharCode(a);for(var l in r)s.hasOwnProperty(l)||(s[l]=r[l]);var c=n(2559);const d="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function u(e){let t,n,r,s,i=e.split(/-(?!$)/),o=i[i.length-1];"Space"==o&&(o=" ");for(let e=0;e<i.length-1;e++){let o=i[e];if(/^(cmd|meta|m)$/i.test(o))s=!0;else if(/^a(lt)?$/i.test(o))t=!0;else if(/^(c|ctrl|control)$/i.test(o))n=!0;else if(/^s(hift)?$/i.test(o))r=!0;else{if(!/^mod$/i.test(o))throw new Error("Unrecognized modifier name: "+o);d?s=!0:n=!0}}return t&&(o="Alt-"+o),n&&(o="Ctrl-"+o),s&&(o="Meta-"+o),r&&(o="Shift-"+o),o}function h(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 p(e){return new c.k_({props:{handleKeyDown:f(e)}})}function f(e){let t=function(e){let t=Object.create(null);for(let n in e)t[u(n)]=e[n];return t}(e);return function(e,n){let a,l=function(e){var t=!(i&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||o&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?s: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[h(l,n)];if(c&&c(e.state,e.dispatch,e))return!0;if(1==l.length&&" "!=l){if(n.shiftKey){let r=t[h(l,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.shiftKey||n.altKey||n.metaKey||l.charCodeAt(0)>127)&&(a=r[n.keyCode])&&a!=l){let r=t[h(a,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}},9679:(e,t,n)=>{"use strict";function r(e){this.content=e}n.d(t,{S4:()=>Y,ZF:()=>ae,FK:()=>a,CU:()=>u,sX:()=>J,bP:()=>$,u$:()=>N,vI:()=>h,Sj:()=>W,Ji:()=>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 s=n&&n!=e?this.remove(n):this,i=s.find(e),o=s.content.slice();return-1==i?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new r(o)},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 s=this.remove(t),i=s.content.slice(),o=s.find(e);return i.splice(-1==o?i.length:o,0,t,n),new r(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=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 s=r;function i(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let s=e.child(r),o=t.child(r);if(s!=o){if(!s.sameMarkup(o))return n;if(s.isText&&s.text!=o.text){for(let e=0;s.text[e]==o.text[e];e++)n++;return n}if(s.content.size||o.content.size){let e=i(s.content,o.content,n+1);if(null!=e)return e}n+=s.nodeSize}else n+=s.nodeSize}}function o(e,t,n,r){for(let s=e.childCount,i=t.childCount;;){if(0==s||0==i)return s==i?null:{a:n,b:r};let a=e.child(--s),l=t.child(--i),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=o(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,s){for(let i=0,o=0;o<t;i++){let a=this.content[i],l=o+a.nodeSize;if(l>e&&!1!==n(a,r+o,s||null,i)&&a.content.size){let s=o+1;a.nodesBetween(Math.max(0,e-s),Math.min(a.content.size,t-s),n,r+s)}o=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let s="",i=!0;return this.nodesBetween(e,t,((o,a)=>{let l=o.isText?o.text.slice(Math.max(e,a)-a,t-a):o.isLeaf?r?"function"==typeof r?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&l||o.isTextblock)&&n&&(i?i=!1:s+=n),s+=l}),0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),s=1);s<e.content.length;s++)r.push(e.content[s]);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 s=0,i=0;i<t;s++){let o=this.content[s],a=i+o.nodeSize;a>e&&((i<e||a>t)&&(o=o.isText?o.cut(Math.max(0,e-i),Math.min(o.text.length,t-i)):o.cut(Math.max(0,e-i-1),Math.min(o.content.size,t-i-1))),n.push(o),r+=o.nodeSize),i=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(),s=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new a(r,s)}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 i(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return o(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 s=r+this.child(n).nodeSize;if(s>=e)return s==e||t>0?c(n+1,s):c(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,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 s=e[r];n+=s.nodeSize,r&&s.isText&&e[r-1].sameMarkup(s)?(t||(t=e.slice(0,r)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}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 d(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(!d(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!d(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class u{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let s=e[r];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,r));else{if(s.type.excludes(this.type))return e;!n&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(s)}}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&&d(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 u.none;if(e instanceof u)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}u.none=[];class h 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:s}=e.findIndex(t),i=e.maybeChild(r),{index:o,offset:a}=e.findIndex(n);if(s==t||i.isText){if(a!=n&&!e.child(o).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(f(i.content,t-s-1,n-s-1)))}function m(e,t,n,r){let{index:s,offset:i}=e.findIndex(t),o=e.maybeChild(s);if(i==t||o.isText)return r&&!r.canReplace(s,s,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=m(o.content,t-i-1,n);return a&&e.replaceChild(s,o.copy(a))}function g(e,t,n){if(n.openStart>e.depth)throw new h("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new h("Inconsistent open depths");return y(e,t,n,0)}function y(e,t,n,r){let s=e.index(r),i=e.node(r);if(s==t.index(r)&&r<e.depth-n.openStart){let o=y(e,t,n,r+1);return i.copy(i.content.replaceChild(s,o))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:s,end:o}=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 k(i,_(e,s,o,t,r))}{let r=e.parent,s=r.content;return k(r,s.cut(0,e.parentOffset).append(n.content).append(s.cut(t.parentOffset)))}}return k(i,C(e,t,r))}function v(e,t){if(!t.type.compatibleContent(e.type))throw new h("Cannot join "+t.type.name+" onto "+e.type.name)}function b(e,t,n){let r=e.node(n);return v(r,t.node(n)),r}function x(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 w(e,t,n,r){let s=(t||e).node(n),i=0,o=t?t.index(n):s.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(x(e.nodeAfter,r),i++));for(let e=i;e<o;e++)x(s.child(e),r);t&&t.depth==n&&t.textOffset&&x(t.nodeBefore,r)}function k(e,t){return e.type.checkContent(t),e.copy(t)}function _(e,t,n,r,s){let i=e.depth>s&&b(e,t,s+1),o=r.depth>s&&b(n,r,s+1),l=[];return w(null,e,s,l),i&&o&&t.index(s)==n.index(s)?(v(i,o),x(k(i,_(e,t,n,r,s+1)),l)):(i&&x(k(i,C(e,t,s+1)),l),w(t,n,s,l),o&&x(k(o,C(n,r,s+1)),l)),w(r,null,s,l),new a(l)}function C(e,t,n){let r=[];return w(null,e,n,r),e.depth>n&&x(k(b(e,t,n+1),C(e,t,n+1)),r),w(t,null,n,r),new a(r)}p.empty=new p(a.empty,0,0);class S{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 u.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 s=n.marks;for(var i=0;i<s.length;i++)!1!==s[i].type.spec.inclusive||r&&s[i].isInSet(r.marks)||(s=s[i--].removeFromSet(s));return s}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 s=0;s<n.length;s++)!1!==n[s].type.spec.inclusive||r&&n[s].isInSet(r.marks)||(n=n[s--].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 N(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,s=t;for(let t=e;;){let{index:e,offset:i}=t.content.findIndex(s),o=s-i;if(n.push(t,e,r+i),!o)break;if(t=t.child(e),t.isText)break;s=o-1,r+=i+1}return new S(t,n,s)}static resolveCached(e,t){for(let n=0;n<A.length;n++){let r=A[n];if(r.pos==t&&r.doc==e)return r}let n=A[M]=S.resolve(e,t);return M=(M+1)%O,n}}let A=[],M=0,O=12;class N{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 T=Object.create(null);class ${constructor(e,t,n,r=u.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&&d(this.attrs,t||e.defaultAttrs||T)&&u.sameSet(this.marks,n||u.none)}copy(e=null){return e==this.content?this:new $(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new $(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),s=this.resolve(t),i=n?0:r.sharedDepth(t),o=r.start(i),a=r.node(i).content.cut(r.pos-o,s.pos-o);return new p(a,r.depth-i,s.depth-i)}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 S.resolveCached(this,e)}resolveNoCache(e){return S.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()+")"),D(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,s=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,r,s),o=i&&i.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<s;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 s=this.contentMatchAt(e).matchType(n),i=s&&s.matchFragment(this.content,t);return!!i&&i.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=u.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!u.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)}}$.prototype.text=void 0;class E extends ${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):D(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 E(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new E(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 D(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 I(e,t);if(null==n.next)return R.empty;let r=P(n);n.next&&n.err("Unexpected trailing text");let s=function(e){let t=Object.create(null);return function n(r){let s=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<s.length;e++)s[e][0]==t&&(r=s[e][1]);V(e,n).forEach((e=>{r||s.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let i=t[r.join(",")]=new R(r.indexOf(e.length-1)>-1);for(let e=0;e<s.length;e++){let r=s[e][1].sort(j);i.next.push({type:s[e][0],next:t[r.join(",")]||n(r)})}return i}(V(e,0))}(function(e){let t=[[]];return s(function e(t,i){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(e(n,i))),[]);if("seq"!=t.type){if("star"==t.type){let o=n();return r(i,o),s(e(t.expr,o),o),[r(o)]}if("plus"==t.type){let o=n();return s(e(t.expr,i),o),s(e(t.expr,o),o),[r(o)]}if("opt"==t.type)return[r(i)].concat(e(t.expr,i));if("range"==t.type){let o=i;for(let r=0;r<t.min;r++){let r=n();s(e(t.expr,o),r),o=r}if(-1==t.max)s(e(t.expr,o),o);else for(let i=t.min;i<t.max;i++){let i=n();r(o,i),s(e(t.expr,o),i),o=i}return[r(o)]}if("name"==t.type)return[r(i,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let o=e(t.exprs[r],i);if(r==t.exprs.length-1)return o;s(o,i=n())}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let s={term:r,to:n};return t[e].push(s),s}function s(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],s=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];i.push(n.name),!s||n.isText||n.hasRequiredAttrs()||(s=!1),-1==r.indexOf(o)&&r.push(o)}s&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,n),s}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 s=t;r&&s<n;s++)r=r.matchType(e.child(s).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 s(i,o){let l=i.matchFragment(e,n);if(l&&(!t||l.validEnd))return a.from(o.map((e=>e.createAndFill())));for(let e=0;e<i.next.length;e++){let{type:t,next:n}=i.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=s(n,o.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(),s=r.match;if(s.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<s.next.length;e++){let{type:i,next:o}=s.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||r.type&&!o.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),t[i.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 I{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 P(e){let t=[];do{t.push(F(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function F(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=P(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 s=[];for(let e in n){let r=n[e];r.groups.indexOf(t)>-1&&s.push(r)}return 0==s.length&&e.err("No node type or group '"+t+"' found"),s}(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=z(e,t)}return t}function B(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function z(e,t){let n=B(e),r=n;return e.eat(",")&&(r="}"!=e.next?B(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function j(e,t){return t-e}function V(e,t){let n=[];return function t(r){let s=e[r];if(1==s.length&&!s[0].term)return t(s[0].to);n.push(r);for(let e=0;e<s.length;e++){let{term:r,to:i}=s[e];r||-1!=n.indexOf(i)||t(i)}}(t),n.sort(j)}function H(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 U(e,t){let n=Object.create(null);for(let r in e){let s=t&&t[r];if(void 0===s){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);s=t.default}n[r]=s}return n}function q(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new Z(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=q(n.attrs),this.defaultAttrs=H(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:U(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new $(this,this.computeAttrs(e),a.from(t),u.setFrom(n))}createChecked(e=null,t,n){return t=a.from(t),this.checkContent(t),new $(this,this.computeAttrs(e),t,u.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),s=r&&r.fillBefore(a.empty,!0);return s?new $(this,e,t.append(s),u.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:u.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 Z{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class J{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=q(r.attrs),this.excluded=null;let s=H(this.attrs);this.instance=s?new u(this,s):null}create(e=null){return!e&&this.instance?this.instance:new u(this,U(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,s)=>n[e]=new J(e,r++,t,s))),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 W{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=s.from(e.nodes),t.marks=s.from(e.marks||{}),this.nodes=K.compile(this.spec.nodes,this),this.marks=J.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||"",s=t.spec.marks;t.contentMatch=n[r]||(n[r]=R.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.markSet="_"==s?null:s?G(this,s.split(" ")):""!=s&&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 E(n,n.defaultAttrs,e,u.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return $.fromJSON(this,e)}markFromJSON(e){return u.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 s=t[r],i=e.marks[s],o=i;if(i)n.push(i);else for(let t in e.marks){let r=e.marks[t];("_"==s||r.spec.group&&r.spec.group.split(" ").indexOf(s)>-1)&&n.push(o=r)}if(!o)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Y{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(se(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 s=r?this.styles.indexOf(r)+1:0;s<this.styles.length;s++){let r=this.styles[s],i=r.style;if(!(0!=i.indexOf(e)||r.context&&!n.matchesContext(r.context)||i.length>e.length&&(61!=i.charCodeAt(e.length)||i.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=ie(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=ie(e)),e.node||e.ignore||e.mark||(e.node=t)}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Y(e,Y.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,s,i,o){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=u.none,this.stashMarks=[],this.match=i||(4&o?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):oe(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,s=t.topNode,i=te(null,t.preserveWhitespace,0)|(n?4:0);r=s?new ne(s.type,s.attrs,u.none,u.none,!0,t.topMatch||s.type.contentMatch,i):new ne(n?null:e.schema.topNodeType,null,u.none,u.none,!0,null,i),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){3==e.nodeType?this.addTextNode(e):1==e.nodeType&&this.addElement(e)}withStyleRules(e,t){let n=e.getAttribute("style");if(!n)return t();let r=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}(n));if(!r)return;let[s,i]=r,o=this.top;for(let e=0;e<i.length;e++)this.removePendingMark(i[e],o);for(let e=0;e<s.length;e++)this.addPendingMark(s[e]);t();for(let e=0;e<s.length;e++)this.removePendingMark(s[e],o);for(let e=0;e<i.length;e++)this.addPendingMark(i[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],s=e.previousSibling;(!r||s&&"BR"==s.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 s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(s?s.ignore:Q.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let t,n=this.top,i=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);s&&s.skip?this.addAll(e):this.withStyleRules(e,(()=>this.addAll(e))),t&&this.sync(n),this.needsBlock=i}else this.withStyleRules(e,(()=>{this.addElementByRule(e,s,!1===s.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=u.none,n=u.none;for(let r=0;r<e.length;r+=2)for(let s;;){let i=this.parser.matchStyle(e[r],e[r+1],this,s);if(!i)break;if(i.ignore)return null;if(i.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach((e=>{i.clearMark(e)&&(n=e.addToSet(n))})):t=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(t),!1!==i.consuming)break;s=i}return[t,n]}addElementByRule(e,t,n){let r,s,i;t.node?(s=this.parser.schema.nodes[t.node],s.isLeaf?this.insertNode(s.create(t.attrs))||this.leafFallback(e):r=this.enter(s,t.attrs||null,t.preserveWhitespace)):(i=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(i));let o=this.top;if(s&&s.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(o)&&this.open--,i&&this.removePendingMark(i,o)}addAll(e,t,n){let r=t||0;for(let s=t?e.childNodes[t]:e.firstChild,i=null==n?null:e.childNodes[n];s!=i;s=s.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(s);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let s=this.nodes[r],i=s.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=s,!i.length))break;if(s.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 s=this.top;s.applyPending(e),s.match=s.match&&s.match.matchType(e);let i=te(e,r,s.options);4&s.options&&0==s.content.length&&(i|=4),this.nodes.push(new ne(e,t,s.activeMarks,s.pendingMarks,n,null,i)),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),s=-(n?n.depth+1:0)+(r?0:1),i=(e,o)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;o>=s;o--)if(i(e-1,o))return!0;return!1}{let e=o>0||0==o&&r?this.nodes[o].type:n&&o>=s?n.node(o-s).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;o--}}return!0};return i(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 se(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ie(e){let t={};for(let n in e)t[n]=e[n];return t}function oe(e,t){let n=t.schema.nodes;for(let r in n){let s=n[r];if(!s.allowsMarkType(e))continue;let i=[],o=e=>{i.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:s}=e.edge(n);if(r==t)return!0;if(i.indexOf(s)<0&&o(s))return!0}};if(o(s.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,s=[];return e.forEach((e=>{if(s.length||e.marks.length){let n=0,i=0;for(;n<s.length&&i<e.marks.length;){let t=e.marks[i];if(this.marks[t.type.name]){if(!t.eq(s[n][0])||!1===t.type.spec.spanning)break;n++,i++}else i++}for(;n<s.length;)r=s.pop()[1];for(;i<e.marks.length;){let n=e.marks[i++],o=this.serializeMark(n,e.isInline,t);o&&(s.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=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 s=this.serializeMark(e.marks[r],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(n),n=s.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,s=t[0],i=s.indexOf(" ");i>0&&(n=s.slice(0,i),s=s.slice(i+1));let o=n?e.createElementNS(n,s):e.createElement(s),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?o.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):o.setAttribute(e,a[e])}}for(let s=l;s<t.length;s++){let i=t[s];if(0===i){if(s<t.length-1||s>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:o,contentDOM:o}}{let{dom:t,contentDOM:s}=ae.renderSpec(e,i,n);if(o.appendChild(t),s){if(r)throw new RangeError("Multiple content holes");r=s}}}return{dom:o,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}},2559:(e,t,n)=>{"use strict";n.d(t,{$t:()=>_,LN:()=>o,U3:()=>d,hs:()=>O,i5:()=>f,k_:()=>S,nh:()=>h});var r=n(9679),s=n(196);const i=Object.create(null);class o{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.Ji.empty){let n=t.content.lastChild,s=null;for(let e=0;e<t.openEnd;e++)s=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:c}=o[a],d=e.mapping.slice(i);e.replaceRange(d.map(l.pos),d.map(c.pos),a?r.Ji.empty:t),0==a&&y(e,i,(n?n.isInline:s&&s.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let s=0;s<r.length;s++){let{$from:i,$to:o}=r[s],a=e.mapping.slice(n),l=a.map(i.pos),c=a.map(o.pos);s?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 d(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 s=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(s)return s}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=i[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 i)throw new RangeError("Duplicate use of selection JSON ID "+e);return i[e]=t,t.prototype.jsonID=e,t}getBookmark(){return d.between(this.$anchor,this.$head).getBookmark()}}o.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 d extends o{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 o.near(n);let r=e.resolve(t.map(this.anchor));return new d(r.parent.inlineContent?r:n,n)}replace(e,t=r.Ji.empty){if(super.replace(e,t),t==r.Ji.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof d&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new u(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 d(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=o.findFrom(t,n,!0)||o.findFrom(t,-n,!0);if(!e)return o.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(o.findFrom(e,-n,!0)||o.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new d(e,t)}}o.jsonID("text",d);class u{constructor(e,t){this.anchor=e,this.head=t}map(e){return new u(e.map(this.anchor),e.map(this.head))}resolve(e){return d.between(e.resolve(this.anchor),e.resolve(this.head))}}class h extends o{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),s=e.resolve(r);return n?o.near(s):new h(s)}content(){return new r.Ji(r.FK.from(this.node),0,0)}eq(e){return e instanceof h&&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 h(e.resolve(t.anchor))}static create(e,t){return new h(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}h.prototype.visible=!1,o.jsonID("node",h);class p{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new u(n,n):new p(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&h.isSelectable(n)?new h(t):o.near(t)}}class f extends o{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=r.Ji.empty){if(t==r.Ji.empty){e.delete(0,e.doc.content.size);let t=o.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}}o.jsonID("all",f);const m={map(){return this},resolve:e=>new f(e)};function g(e,t,n,r,s,i=!1){if(t.inlineContent)return d.create(e,n);for(let o=r-(s>0?0:1);s>0?o<t.childCount:o>=0;o+=s){let r=t.child(o);if(r.isAtom){if(!i&&h.isSelectable(r))return h.create(e,n-(s<0?r.nodeSize:0))}else{let t=g(e,r,n+s,s<0?r.childCount:0,s,i);if(t)return t}n+=r.nodeSize*s}return null}function y(e,t,n){let r=e.steps.length-1;if(r<t)return;let i,a=e.steps[r];(a instanceof s.Ln||a instanceof s.Wg)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==i&&(i=r)})),e.setSelection(o.near(e.doc.resolve(i),n)))}class v extends s.dL{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&this.updated|1,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.CU.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.CU.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 s=this.storedMarks;if(!s){let e=this.doc.resolve(t);s=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,s)),this.selection.empty||this.setSelection(o.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 b(e,t){return t&&e?e.bind(t):e}class x{constructor(e,t,n){this.name=e,this.init=b(t.init,n),this.apply=b(t.apply,n)}}const w=[new x("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new x("selection",{init:(e,t)=>e.selection||o.atStart(t.doc),apply:e=>e.selection}),new x("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new x("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class k{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=w.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 x(e.key,e.spec.state,e))}))}}class _{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 s=!1;for(let i=0;i<this.config.plugins.length;i++){let o=this.config.plugins[i];if(o.spec.appendTransaction){let a=r?r[i].n:0,l=r?r[i].state:this,c=a<t.length&&o.spec.appendTransaction.call(o,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),s=!0}r&&(r[i]={state:n,n:t.length})}}if(!s)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new _(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let s=n[r];t[s.name]=s.apply(e,this[s.name],this,t)}return t}get tr(){return new v(this)}static create(e){let t=new k(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new _(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 k(this.schema,e.plugins),n=t.fields,r=new _(t);for(let t=0;t<n.length;t++){let s=n[t].name;r[s]=this.hasOwnProperty(s)?this[s]: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],s=r.spec.state;s&&s.toJSON&&(t[n]=s.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 s=new k(e.schema,e.plugins),i=new _(s);return s.fields.forEach((s=>{if("doc"==s.name)i.doc=r.bP.fromJSON(e.schema,t.doc);else if("selection"==s.name)i.selection=o.fromJSON(i.doc,t.selection);else if("storedMarks"==s.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let r in n){let o=n[r],a=o.spec.state;if(o.key==s.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,r))return void(i[s.name]=a.fromJSON.call(o,e,t[r],i))}i[s.name]=s.init(e,i)}})),i}}function C(e,t,n){for(let r in e){let s=e[r];s instanceof Function?s=s.bind(t):"handleDOMEvents"==r&&(s=C(s,t,{})),n[r]=s}return n}class S{constructor(e){this.spec=e,this.props={},e.props&&C(e.props,this,this.props),this.key=e.key?e.key.key:M("plugin")}getState(e){return e[this.key]}}const A=Object.create(null);function M(e){return e in A?e+"$"+ ++A[e]:(A[e]=0,e+"$")}class O{constructor(e="key"){this.key=M(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}},196:(e,t,n)=>{"use strict";n.d(t,{$L:()=>N,Ln:()=>y,N0:()=>M,Um:()=>O,Wg:()=>v,X9:()=>l,dL:()=>V,jP:()=>w,n9:()=>S,oM:()=>k,zy:()=>C});var r=n(9679);const s=Math.pow(2,16);function i(e){return 65535&e}class o{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=i(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))/s}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[l+i],u=this.ranges[l+a],h=c+d;if(e<=h){let i=c+r+((d?e==c?-1:e==h?1:t:t)<0?0:u);if(n)return i;let a=e==c?2:e==h?1:4;return(t<0?e!=c:e!=h)&&(a|=8),new o(i,a,e==(t<0?c:h)?null:l/3+(e-c)*s)}r+=u-d}return n?e+r:new o(e+r,0,null)}touches(e,t){let n=0,r=i(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let i=this.ranges[t]-(this.inverted?n:0);if(i>e)break;let a=this.ranges[t+s];if(e<=i+a&&t==3*r)return!0;n+=this.ranges[t+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,s=0;r<this.ranges.length;r+=3){let i=this.ranges[r],o=i-(this.inverted?s:0),a=i+(this.inverted?0:s),l=this.ranges[r+t],c=this.ranges[r+n];e(o,o+l,a,a+c),s+=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 s=this.maps[n].mapResult(e,t);if(null!=s.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this.maps[t].recover(s.recover);continue}}r|=s.delInfo,e=s.pos}return n?e:new o(e,r,null)}}const c=Object.create(null);class d{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 u{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new u(e,null)}static fail(e){return new u(null,e)}static fromReplace(e,t,n,s){try{return u.ok(e.replace(t,n,s))}catch(e){if(e instanceof r.vI)return u.fail(e.message);throw e}}}function h(e,t,n){let s=[];for(let r=0;r<e.childCount;r++){let i=e.child(r);i.content.size&&(i=i.copy(h(i.content,t,i))),i.isInline&&(i=t(i,n,r)),s.push(i)}return r.FK.fromArray(s)}class p extends d{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),s=n.node(n.sharedDepth(this.to)),i=new r.Ji(h(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),s),t.openStart,t.openEnd);return u.fromReplace(e,this.from,this.to,i)}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))}}d.jsonID("addMark",p);class f extends d{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.Ji(h(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return u.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))}}d.jsonID("removeMark",f);class m extends d{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return u.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return u.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.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))}}d.jsonID("addNodeMark",m);class g extends d{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return u.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return u.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.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))}}d.jsonID("removeNodeMark",g);class y extends d{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&b(e,this.from,this.to)?u.fail("Structure replace would overwrite content"):u.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.Ji.empty:new r.Ji(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.Ji.empty:new r.Ji(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.Ji.fromJSON(e,t.slice),!!t.structure)}}d.jsonID("replace",y);class v extends d{constructor(e,t,n,r,s,i,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=s,this.insert=i,this.structure=o}apply(e){if(this.structure&&(b(e,this.from,this.gapFrom)||b(e,this.gapTo,this.to)))return u.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return u.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?u.fromReplace(e,this.from,this.to,n):u.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 v(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),s=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||s>n.pos?null:new v(t.pos,n.pos,r,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,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 v(t.from,t.to,t.gapFrom,t.gapTo,r.Ji.fromJSON(e,t.slice),t.insert,!!t.structure)}}function b(e,t,n){let r=e.resolve(t),s=n-t,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,s--}}return!1}function x(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function w(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),s=e.$from.index(n),i=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(s,i,t))return n;if(0==n||r.type.spec.isolating||!x(r,s,i))break}return null}function k(e,t,n=null,r=e){let s=function(e,t){let{parent:n,startIndex:r,endIndex:s}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let o=i.length?i[0]:t;return n.canReplaceWith(r,s,o)?i:null}(e,t),i=s&&function(e,t){let{parent:n,startIndex:r,endIndex:s}=e,i=n.child(r),o=t.contentMatch.findWrapping(i.type);if(!o)return null;let a=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;a&&e<s;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?o:null}(r,t);return i?s.map(_).concat({type:t,attrs:n}).concat(i.map(_)):null}function _(e){return{type:e,attrs:null}}function C(e,t,n=1,r){let s=e.resolve(t),i=s.depth-n,o=r&&r[r.length-1]||s.parent;if(i<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!o.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let e=s.depth-1,t=n-2;e>i;e--,t--){let n=s.node(e),i=s.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(i,n.childCount),a=r&&r[t+1];a&&(o=o.replaceChild(0,a.type.create(a.attrs)));let l=r&&r[t]||n;if(!n.canReplace(i+1,n.childCount)||!l.type.validContent(o))return!1}let a=s.indexAfter(i),l=r&&r[0];return s.node(i).canReplaceWith(a,a,l?l.type:s.node(i+1).type)}function S(e,t){let n=e.resolve(t),r=n.index();return A(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function A(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function M(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let s,i,o=r.index(e);if(e==r.depth?(s=r.nodeBefore,i=r.nodeAfter):n>0?(s=r.node(e+1),o++,i=r.node(e).maybeChild(o)):(s=r.node(e).maybeChild(o-1),i=r.node(e+1)),s&&!s.isTextblock&&A(s,i)&&r.node(e).canReplace(o,o+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function O(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let s=n.content;for(let e=0;e<n.openStart;e++)s=s.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,i=r.index(t)+(n>0?1:0),o=r.node(t),a=!1;if(1==e)a=o.canReplace(i,i,s);else{let e=o.contentMatchAt(i).findWrapping(s.firstChild.type);a=e&&o.canReplaceWith(i,i,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,s=r.Ji.empty){if(t==n&&!s.size)return null;let i=e.resolve(t),o=e.resolve(n);return T(i,o,s)?new y(t,n,s):new $(i,o,s).fit()}function T(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}d.jsonID("replaceAround",v);class ${constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=r.FK.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.FK.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,s=this.close(e<0?this.$to:n.doc.resolve(e));if(!s)return null;let i=this.placed,o=n.depth,a=s.depth;for(;o&&a&&1==i.childCount;)i=i.firstChild.content,o--,a--;let l=new r.Ji(i,o,a);return e>-1?new v(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new y(n.pos,s.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 s=t.firstChild;if(t.childCount>1&&(r=0),s.type.spec.isolating&&r<=n){e=n;break}t=s.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,s=null;n?(s=R(this.unplaced.content,n-1).firstChild,e=s.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let o,{type:a,match:l}=this.frontier[e],c=null;if(1==t&&(i?l.matchType(i.type)||(c=l.fillBefore(r.FK.from(i),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:n,frontierDepth:e,parent:s,inject:c};if(2==t&&i&&(o=l.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:s,wrap:o};if(s&&l.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,s=R(e,t);return!(!s.childCount||s.firstChild.isLeaf||(this.unplaced=new r.Ji(e,t+1,Math.max(n,s.size+t>=e.size-n?t+1:0)),0))}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,s=R(e,t);if(s.childCount<=1&&t>0){let i=e.size-t<=t+s.size;this.unplaced=new r.Ji(E(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new r.Ji(E(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:s,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let o=this.unplaced,a=n?n.content:o.content,l=o.openStart-e,c=0,d=[],{match:u,type:h}=this.frontier[t];if(s){for(let e=0;e<s.childCount;e++)d.push(s.child(e));u=u.matchFragment(s)}let p=a.size+e-(o.content.size-o.openEnd);for(;c<a.childCount;){let e=a.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||0==l||e.content.size)&&(u=t,d.push(I(e.mark(h.allowedMarks(e.marks)),1==c?l:0,c==a.childCount?p:-1)))}let f=c==a.childCount;f||(p=-1),this.placed=D(this.placed,t,r.FK.from(d)),this.frontier[t].match=u,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.Ji.empty:new r.Ji(E(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new r.Ji(E(o.content,e,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!P(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],s=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=P(e,t,r,n,s);if(i){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],s=P(e,n,r,t,!0);if(!s||s.childCount)continue e}return{depth:t,fit:i,move:s?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=D(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 s=this.frontier[this.depth];s.match=s.match.matchType(e),this.placed=D(this.placed,this.depth,r.FK.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(r.FK.empty,!0);e.childCount&&(this.placed=D(this.placed,this.frontier.length,e))}}function E(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(E(e.firstChild.content,t-1,n)))}function D(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(D(e.lastChild.content,t-1,n)))}function R(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function I(e,t,n){if(t<=0)return e;let s=e.content;return t>1&&(s=s.replaceChild(0,I(s.firstChild,t-1,1==s.childCount?n-1:0))),t>0&&(s=e.type.contentMatch.fillBefore(s).append(s),n<=0&&(s=s.append(e.type.contentMatch.matchFragment(s).fillBefore(r.FK.empty,!0)))),e.copy(s)}function P(e,t,n,r,s){let i=e.node(t),o=s?e.indexAfter(t):e.index(t);if(o==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,o);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,i.content,o)?a:null}function F(e,t,n,s,i){if(t<n){let r=e.firstChild;e=e.replaceChild(0,r.copy(F(r.content,t+1,n,s,r)))}if(t>s){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(r.FK.empty,!0))}return e}function L(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let s=e.start(r);if(s<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;(s==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==s-1)&&n.push(r)}return n}class B extends d{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 u.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 s=t.type.create(n,null,t.marks);return u.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(s),0,t.isLeaf?0:1))}getMap(){return a.empty}invert(e){return new B(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 B(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 B(t.pos,t.attr,t.value)}}d.jsonID("attr",B);class z extends d{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return u.ok(n)}getMap(){return a.empty}invert(e){return new z(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new z(t.attr,t.value)}}d.jsonID("docAttr",z);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 V{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.Ji.empty){let s=N(this.doc,e,t,n);return s&&this.step(s),this}replaceWith(e,t,n){return this.replace(e,t,new r.Ji(r.FK.from(n),0,0))}delete(e,t){return this.replace(e,t,r.Ji.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,s){if(!s.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(T(i,o,s))return e.step(new y(t,n,s));let a=L(i,e.doc.resolve(n));0==a[a.length-1]&&a.pop();let l=-(i.depth+1);a.unshift(l);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;a.indexOf(e)>-1?l=e:i.before(e)==t&&a.splice(1,0,-e)}let c=a.indexOf(l),d=[],u=s.openStart;for(let e=s.content,t=0;;t++){let n=e.firstChild;if(d.push(n),t==s.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=d[e],n=(h=t.type).spec.defining||h.spec.definingForContent;if(n&&!t.sameMarkup(i.node(Math.abs(l)-1)))u=e;else if(n||!t.type.isTextblock)break}var h;for(let t=s.openStart;t>=0;t--){let l=(t+u+1)%(s.openStart+1),h=d[l];if(h)for(let t=0;t<a.length;t++){let d=a[(t+c)%a.length],u=!0;d<0&&(u=!1,d=-d);let p=i.node(d-1),f=i.index(d-1);if(p.canReplaceWith(f,f,h.type,h.marks))return e.replace(i.before(d),u?o.after(d):n,new r.Ji(F(s.content,0,s.openStart,l),l,s.openEnd))}}let p=e.steps.length;for(let r=a.length-1;r>=0&&(e.replace(t,n,s),!(e.steps.length>p));r--){let e=a[r];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,s){if(!s.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,s.type);null!=r&&(t=n=r)}e.replaceRange(t,n,new r.Ji(r.FK.from(s),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),s=e.doc.resolve(n),i=L(r,s);for(let t=0;t<i.length;t++){let n=i[t],o=t==i.length-1;if(o&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),s.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),s.indexAfter(n-1))))return e.delete(r.before(n),s.after(n))}for(let i=1;i<=r.depth&&i<=s.depth;i++)if(t-r.start(i)==r.depth-i&&n>r.end(i)&&s.end(i)-n!=s.depth-i)return e.delete(r.before(i),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:s,$to:i,depth:o}=t,a=s.before(o+1),l=i.after(o+1),c=a,d=l,u=r.FK.empty,h=0;for(let e=o,t=!1;e>n;e--)t||s.index(e)>0?(t=!0,u=r.FK.from(s.node(e).copy(u)),h++):c--;let p=r.FK.empty,f=0;for(let e=o,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,p=r.FK.from(i.node(e).copy(p)),f++):d++;e.step(new v(c,d,a,l,new r.Ji(u.append(p),h,f),u.size-h,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let s=new y(t-n,t+n,r.Ji.empty,!0);e.step(s)}(this,e,t),this}wrap(e,t){return function(e,t,n){let s=r.FK.empty;for(let e=n.length-1;e>=0;e--){if(s.size){let t=n[e].type.contentMatch.matchFragment(s);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}s=r.FK.from(n[e].type.create(n[e].attrs,s))}let i=t.start,o=t.end;e.step(new v(i,o,i,o,new r.Ji(s,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,s=null){return function(e,t,n,s,i){if(!s.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(s,i)&&function(e,t,n){let r=e.resolve(t),s=r.index();return r.parent.canReplaceWith(s,s+1,n)}(e.doc,e.mapping.slice(o).map(n),s)){e.clearIncompatible(e.mapping.slice(o).map(n,1),s);let a=e.mapping.slice(o),l=a.map(n,1),c=a.map(n+t.nodeSize,1);return e.step(new v(l,c,l+1,c-1,new r.Ji(r.FK.from(s.create(i,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,s),this}setNodeMarkup(e,t,n=null,s){return function(e,t,n,s,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let a=n.create(s,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,a);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new v(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new r.Ji(r.FK.from(a),0,0),1,!0))}(this,e,t,n,s),this}setNodeAttribute(e,t,n){return this.step(new B(e,t,n)),this}setDocAttribute(e,t){return this.step(new z(e,t)),this}addNodeMark(e,t){return this.step(new m(e,t)),this}removeNodeMark(e,t){if(!(t instanceof r.CU)){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,s){let i=e.doc.resolve(t),o=r.FK.empty,a=r.FK.empty;for(let e=i.depth,t=i.depth-n,l=n-1;e>t;e--,l--){o=r.FK.from(i.node(e).copy(o));let t=s&&s[l];a=r.FK.from(t?t.type.create(t.attrs,a):i.node(e).copy(a))}e.step(new y(t,t,new r.Ji(o.append(a),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let s,i,o=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let d=e.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),u=Math.min(l+e.nodeSize,n),h=r.addToSet(d);for(let e=0;e<d.length;e++)d[e].isInSet(h)||(s&&s.to==c&&s.mark.eq(d[e])?s.to=u:o.push(s=new f(c,u,d[e])));i&&i.to==c?i.to=u:a.push(i=new p(c,u,r))}})),o.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,s){let i=[],o=0;e.doc.nodesBetween(t,n,((e,a)=>{if(!e.isInline)return;o++;let l=null;if(s instanceof r.sX){let t,n=e.marks;for(;t=s.isInSet(n);)(l||(l=[])).push(t),n=t.removeFromSet(n)}else s?s.isInSet(e.marks)&&(l=[s]):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,s=l[e];for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&s.eq(i[e].style)&&(n=t)}n?(n.to=r,n.step=o):i.push({style:s,from:Math.max(a,t),to:r,step:o})}}})),i.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,s=n.contentMatch){let i=e.doc.nodeAt(t),o=[],a=t+1;for(let t=0;t<i.childCount;t++){let l=i.child(t),c=a+l.nodeSize,d=s.matchType(l.type);if(d){s=d;for(let t=0;t<l.marks.length;t++)n.allowsMarkType(l.marks[t].type)||e.step(new f(a,c,l.marks[t]));if(l.isText&&!n.spec.code){let e,t,s=/\r?\n|\r/g;for(;e=s.exec(l.text);)t||(t=new r.Ji(r.FK.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),o.push(new y(a+e.index,a+e.index+e[0].length,t))}}else o.push(new y(a,c,r.Ji.empty));a=c}if(!s.validEnd){let t=s.fillBefore(r.FK.empty,!0);e.replace(a,a,new r.Ji(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}(this,e,t,n),this}}},5873:(e,t,n)=>{"use strict";n.d(t,{Lz:()=>ln,NZ:()=>Pt,zF:()=>Bt});var r=n(2559),s=n(9679),i=n(196);const o=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},d=function(e,t,n,r){return n&&(h(e,t,n,r,-1)||h(e,t,n,r,1))},u=/^(img|br|input|textarea|hr)$/i;function h(e,t,n,r,s){for(;;){if(e==n&&t==r)return!0;if(t==(s<0?0:p(e))){let n=e.parentNode;if(!n||1!=n.nodeType||f(e)||u.test(e.nodeName)||"false"==e.contentEditable)return!1;t=o(e)+(s<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(s<0?-1:0)]).contentEditable)return!1;t=s<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&&d(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,v="undefined"!=typeof document?document:null,b=y&&y.userAgent||"",x=/Edge\/(\d+)/.exec(b),w=/MSIE \d/.exec(b),k=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(b),_=!!(w||k||x),C=w?document.documentMode:k?+k[1]:x?+x[1]:0,S=!_&&/gecko\/(\d+)/i.test(b);S&&(/Firefox\/(\d+)/.exec(b)||[0,0])[1];const A=!_&&/Chrome\/(\d+)/.exec(b),M=!!A,O=A?+A[1]:0,N=!_&&!!y&&/Apple Computer/.test(y.vendor),T=N&&(/Mobile\/\w+/.test(b)||!!y&&y.maxTouchPoints>2),$=T||!!y&&/Mac/.test(y.platform),E=!!y&&/Win/.test(y.platform),D=/Android \d/.test(b),R=!!v&&"webkitFontSmoothing"in v.documentElement.style,I=R?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function P(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function F(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 B(e,t,n){let r=e.someProp("scrollThreshold")||0,s=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let o=n||e.dom;o;o=a(o)){if(1!=o.nodeType)continue;let e=o,n=e==i.body,a=n?P(i):L(e),l=0,c=0;if(t.top<a.top+F(r,"top")?c=-(a.top-t.top+F(s,"top")):t.bottom>a.bottom-F(r,"bottom")&&(c=t.bottom-t.top>a.bottom-a.top?t.top+F(s,"top")-a.top:t.bottom-a.bottom+F(s,"bottom")),t.left<a.left+F(r,"left")?l=-(a.left-t.left+F(s,"left")):t.right>a.right-F(r,"right")&&(l=t.right-a.right+F(s,"right")),l||c)if(n)i.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let s=e.scrollLeft-n,i=e.scrollTop-r;t={left:t.left-s,top:t.top-i,right:t.right-s,bottom:t.bottom-i}}if(n||/^(fixed|sticky)$/.test(getComputedStyle(o).position))break}}function z(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 j(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:s,left:i}=e[n];r.scrollTop!=s+t&&(r.scrollTop=s+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let V=null;function H(e,t){let n,r,s,i,o=2e8,a=0,l=t.top,d=t.top;for(let u=e.firstChild,h=0;u;u=u.nextSibling,h++){let e;if(1==u.nodeType)e=u.getClientRects();else{if(3!=u.nodeType)continue;e=c(u).getClientRects()}for(let c=0;c<e.length;c++){let p=e[c];if(p.top<=l&&p.bottom>=d){l=Math.max(p.bottom,l),d=Math.min(p.top,d);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<o){n=u,o=e,r=e&&3==n.nodeType?{left:p.right<t.left?p.right:p.left,top:t.top}:t,1==u.nodeType&&e&&(a=h+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!s&&p.left<=t.left&&p.right>=t.left&&(s=u,i={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=h+1)}}return!n&&s&&(n=s,r=i,o=0),n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let s=0;s<n;s++){r.setEnd(e,s+1),r.setStart(e,s);let n=J(r,1);if(n.top!=n.bottom&&U(t,n))return{node:e,offset:s+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:e,offset:a}:H(n,r)}function U(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function q(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let s=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=s;;){let n=e.childNodes[i];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let s=e[r];if(U(t,s))return q(n,t,s)}}if((i=(i+1)%r)==s)break}return e}function K(e,t){let n,r=e.dom.ownerDocument,s=0,i=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);i&&({node:n,offset:s}=i);let o,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(!U(t,n))return null;if(l=q(e.dom,t,n),!l)return null}if(N)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(S&&1==n.nodeType&&(s=Math.min(s,n.childNodes.length),s<n.childNodes.length)){let e,r=n.childNodes[s];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&s++}let r;R&&s&&1==n.nodeType&&1==(r=n.childNodes[s-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&s--,n==e.dom&&s==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:0!=s&&1==n.nodeType&&"BR"==n.childNodes[s-1].nodeName||(o=function(e,t,n,r){let s=-1;for(let n=t,i=!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&&!i||!t.contentDOM)){let e=t.dom.getBoundingClientRect();if(t.node.isBlock&&t.parent&&!i&&(i=!0,e.left>r.left||e.top>r.top?s=t.posBefore:(e.right<r.left||e.bottom<r.top)&&(s=t.posAfter)),!t.contentDOM&&s<0&&!t.node.isText)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 s>-1?s:e.docView.posFromDOM(t,n,-1)}(e,n,s,t))}null==o&&(o=function(e,t,n){let{node:r,offset:s}=H(t,n),i=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();i=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,s,i)}(e,l,t));let c=e.docView.nearestDesc(l,!0);return{pos:o,inside:c?c.posAtStart-c.border:-1}}function Z(e){return e.top<e.bottom||e.left<e.right}function J(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(Z(e))return e}return Array.prototype.find.call(n,Z)||e.getBoundingClientRect()}const W=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function G(e,t,n){let{node:r,offset:s,atom:i}=e.docView.domFromPos(t,n<0?-1:1),o=R||S;if(3==r.nodeType){if(!o||!W.test(r.nodeValue)&&(n<0?s:s!=r.nodeValue.length)){let e=s,t=s,i=n<0?1:-1;return n<0&&!s?(t++,i=-1):n>=0&&s==r.nodeValue.length?(e--,i=1):n<0?e--:t++,Y(J(c(r,e,t),i),i<0)}{let e=J(c(r,s,s),n);if(S&&s&&/\s/.test(r.nodeValue[s-1])&&s<r.nodeValue.length){let t=J(c(r,s-1,s-1),-1);if(t.top==e.top){let n=J(c(r,s,s+1),-1);if(n.top!=e.top)return Y(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(null==i&&s&&(n<0||s==p(r))){let e=r.childNodes[s-1];if(1==e.nodeType)return X(e.getBoundingClientRect(),!1)}if(null==i&&s<p(r)){let e=r.childNodes[s];if(1==e.nodeType)return X(e.getBoundingClientRect(),!0)}return X(r.getBoundingClientRect(),n>=0)}if(null==i&&s&&(n<0||s==p(r))){let e=r.childNodes[s-1],t=3==e.nodeType?c(e,p(e)-(o?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return Y(J(t,1),!1)}if(null==i&&s<p(r)){let e=r.childNodes[s];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?c(e,0,o?0:1):1==e.nodeType?e:null:null;if(t)return Y(J(t,-1),!0)}return Y(J(3==r.nodeType?c(r):r,-n),n>=0)}function Y(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,s=e.root.activeElement;r!=t&&e.updateState(t),s!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),s!=e.dom&&s&&s.focus()}}const ee=/[\u0590-\u08ac]/;let te=null,ne=null,re=!1;class se{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>o(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 s,i=this.getDesc(r);if(i&&(!t||i.node)){if(!n||!(s=i.nodeDOM)||(1==s.nodeType?s.contains(1==e.nodeType?e:e.parentNode):s==e))return i;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 s=this.getDesc(r);if(s)return s.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],s=n+r.size;if(n==e&&s!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<s)return r.descAt(e-n-r.border);n=s}}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 s=this.children[n],i=t+s.size;if(i>e||s instanceof ue){r=e-t;break}t=i}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 ie&&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?o(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?o(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,s=-1;for(let i=n,a=0;;a++){let n=this.children[a],l=i+n.size;if(-1==r&&e<=l){let s=i+n.border;if(e>=s&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,s);e=i;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=o(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)){s=o(n.dom);break}t+=n.size}-1==s&&(s=this.contentDOM.childNodes.length);break}i=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:s}}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 s=Math.min(e,t),i=Math.max(e,t);for(let o=0,a=0;o<this.children.length;o++){let l=this.children[o],c=a+l.size;if(s>a&&i<c)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=c}let a=this.domFromPos(e,e?-1:1),l=t==e?a:this.domFromPos(t,t?-1:1),c=n.getSelection(),u=!1;if((S||N)&&e==t){let{node:e,offset:t}=a;if(3==e.nodeType){if(u=!(!t||"\n"!=e.nodeValue[t-1]),u&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(a=l={node:t.parentNode,offset:o(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(S&&c.focusNode&&c.focusNode!=l.node&&1==c.focusNode.nodeType){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||u&&N)&&d(a.node,a.offset,c.anchorNode,c.anchorOffset)&&d(l.node,l.offset,c.focusNode,c.focusOffset))return;let h=!1;if((c.extend||e==t)&&!u){c.collapse(a.node,a.offset);try{e!=t&&c.extend(l.node,l.offset),h=!0}catch(e){}}if(!h){if(e>t){let e=a;a=l,l=e}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(a.node,a.offset),c.removeAllRanges(),c.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 s=this.children[r],i=n+s.size;if(n==i?e<=i&&t>=n:e<i&&t>n){let r=n+s.border,o=i-s.border;if(e>=r&&t<=o)return this.dirty=e==n||t==i?2:1,void(e!=r||t!=o||!s.contentLost&&s.dom.parentNode==this.contentDOM?s.markDirty(e-r,t-r):s.dirty=3);s.dirty=s.dom!=s.contentDOM||s.dom.parentNode!=this.contentDOM||s.children.length?3:2}n=i}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 ie extends se{constructor(e,t,n,r){let s,i=t.type.toDOM;if("function"==typeof i&&(i=i(n,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:r))),!t.type.spec.raw){if(1!=i.nodeType){let e=document.createElement("span");e.appendChild(i),i=e}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,s=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 oe extends se{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 se{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=s.ZF.renderSpec(document,t.type.spec.toDOM(t,n))),new ae(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}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),s=this.children,i=this.size;t<i&&(s=Ce(s,t,i,n)),e>0&&(s=Ce(s,0,e,n));for(let e=0;e<s.length;e++)s[e].parent=r;return r.children=s,r}}class le extends se{constructor(e,t,n,r,s,i,o,a,l){super(e,[],s,i),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(e,t,n,r,i,o){let a,l=i.nodeViews[t.type.name],c=l&&l(t,i,(()=>a?a.parent?a.parent.posBeforeChild(a):void 0:o),n,r),d=c&&c.dom,u=c&&c.contentDOM;if(t.isText)if(d){if(3!=d.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else d=document.createTextNode(t.text);else d||({dom:d,contentDOM:u}=s.ZF.renderSpec(document,t.type.spec.toDOM(t)));u||t.isText||"BR"==d.nodeName||(d.hasAttribute("contenteditable")||(d.contentEditable="false"),t.type.spec.draggable&&(d.draggable=!0));let h=d;return d=be(d,n,t),c?a=new he(e,t,n,r,d,u||null,h,c,i,o+1):t.isText?new de(e,t,n,r,d,h,i):new le(e,t,n,r,d,u||null,h,i,o+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=()=>s.FK.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)&&xe(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,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new ke(this,o&&o.node,e);!function(e,t,n,r){let s=t.locals(e),i=0;if(0==s.length){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,s,t.forChild(i,o),n),i+=o.nodeSize}return}let o=0,a=[],l=null;for(let c=0;;){let d,u,h,p;for(;o<s.length&&s[o].to==i;){let e=s[o++];e.widget&&(d?(u||(u=[d])).push(e):d=e)}if(d)if(u){u.sort(_e);for(let e=0;e<u.length;e++)n(u[e],c,!!l)}else n(d,c,!!l);if(l)p=-1,h=l,l=null;else{if(!(c<e.childCount))break;p=c,h=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=i&&a.splice(e--,1);for(;o<s.length&&s[o].from<=i&&s[o].to>i;)a.push(s[o++]);let f=i+h.nodeSize;if(h.isText){let e=f;o<s.length&&s[o].from<e&&(e=s[o].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<f&&(l=h.cut(e-i),h=h.cut(0,e-i),f=e,p=-1)}else for(;o<s.length&&s[o].to<f;)o++;r(h,h.isInline&&!h.isLeaf?a.filter((e=>!e.inline)):a.slice(),t.forChild(i,h),p),i=f}}(this.node,this.innerDeco,((t,i,o)=>{t.spec.marks?l.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!o&&l.syncToMarks(i==this.node.childCount?s.CU.none:this.node.child(i).marks,n,e),l.placeWidget(t,e,r)}),((t,s,o,c)=>{let d;l.syncToMarks(t.marks,n,e),l.findNodeMatch(t,s,o,c)||a&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(d=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(t,s,o,d,e)||l.updateNextNode(t,s,o,e,c,r)||l.addNode(t,s,o,e,r),r+=t.nodeSize})),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),pe(this.contentDOM,this.children,e),T&&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:s}=e.state.selection;if(!(e.state.selection instanceof r.U3)||n<t||s>t+this.node.content.size)return null;let i=e.domSelectionRange(),o=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}}}(i.focusNode,i.focusOffset);if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,r=function(e,t,n,r){for(let s=0,i=0;s<e.childCount&&i<=r;){let o=e.child(s++),a=i;if(i+=o.nodeSize,!o.isText)continue;let l=o.text;for(;s<e.childCount;){let t=e.child(s++);if(i+=t.nodeSize,!t.isText)break;l+=t.text}if(i>=n){if(i>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;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,s-t);return r<0?null:{node:o,pos:r,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let s=t;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let i=new oe(this,s,t,r);e.input.compositionNodes.push(i),this.children=Ce(this.children,n,n+r.length,e,i)}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(xe(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,s){be(r,t,e);let i=new le(void 0,e,t,n,r,r,r,s,0);return i.contentDOM&&i.updateChildren(s,0),i}class de extends le{constructor(e,t,n,r,s,i,o){super(e,t,n,r,s,null,i,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(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),s=document.createTextNode(r.text);return new de(this.parent,r,this.outerDeco,this.innerDeco,s,s,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 ue extends se{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 he extends le{constructor(e,t,n,r,s,i,o,a,l,c){super(e,t,n,r,s,i,o,l,c),this.spec=a}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update){let s=this.spec.update(e,t,n);return s&&this.updateInner(e,t,n,r),s}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,s=!1;for(let i=0;i<t.length;i++){let o=t[i],a=o.dom;if(a.parentNode==e){for(;a!=r;)r=we(r),s=!0;r=r.nextSibling}else s=!0,e.insertBefore(a,r);if(o instanceof ae){let t=r?r.previousSibling:e.lastChild;pe(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=we(r),s=!0;s&&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,s=[r];for(let i=0;i<e.length;i++){let o=e[i].type.attrs;if(o){o.nodeName&&s.push(r=new fe(o.nodeName));for(let e in o){let i=o[e];null!=i&&(n&&1==s.length&&s.push(r=new fe(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+i:"style"==e?r.style=(r.style?r.style+";":"")+i:"nodeName"!=e&&(r[e]=i))}}}return s}function ye(e,t,n,r){if(n==me&&r==me)return t;let s=t;for(let t=0;t<r.length;t++){let i=r[t],o=n[t];if(t){let t;o&&o.nodeName==i.nodeName&&s!=e&&(t=s.parentNode)&&t.nodeName.toLowerCase()==i.nodeName||(t=document.createElement(i.nodeName),t.pmIsDeco=!0,t.appendChild(s),o=me[0]),s=t}ve(s,o||me[0],i)}return s}function ve(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):[],s=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==s.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<s.length;t++)-1==r.indexOf(s[t])&&e.classList.add(s[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 be(e,t,n){return ye(e,e,me,ge(t,n,1!=e.nodeType))}function xe(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 we(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class ke{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,s=e.childCount,i=new Map,o=[];e:for(;s>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(s-1))break;--s,i.set(a,s),o.push(a)}}return{index:s,matched:i,matches:o.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,s=this.stack.length>>1,i=Math.min(s,e.length);for(;r<i&&(r==s-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<s;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<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[s])&&!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[s],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,s++}}findNodeMatch(e,t,n,r){let s,i=-1;if(r>=this.preMatch.index&&(s=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&s.matchesNode(e,t,n))i=this.top.children.indexOf(s,this.index);else for(let r=this.index,s=Math.min(this.top.children.length,r+5);r<s;r++){let s=this.top.children[r];if(s.matchesNode(e,t,n)&&!this.preMatch.matched.has(s)){i=r;break}}return!(i<0||(this.destroyBetween(this.index,i),this.index++,0))}updateNodeAt(e,t,n,r,s){let i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(e,t,n,s)&&(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,s,i){for(let o=this.index;o<this.top.children.length;o++){let a=this.top.children[o];if(a instanceof le){let l=this.preMatch.matched.get(a);if(null!=l&&l!=s)return!1;let c,d=a.dom,u=this.isLocked(d)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&xe(t,a.outerDeco));if(!u&&a.update(e,t,n,r))return this.destroyBetween(this.index,o),a.dom!=d&&(this.changed=!0),this.index++,!0;if(!u&&(c=this.recreateWrapper(a,e,t,n,r,i)))return this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,i+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,s,i){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let o=le.create(this.top,t,n,r,s,i);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,s){let i=le.create(this.top,e,t,n,r,s);i.contentDOM&&i.updateChildren(r,s+1),this.top.children.splice(this.index++,0,i),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 ie(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 de)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((N||M)&&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 ue(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 _e(e,t){return e.type.side-t.type.side}function Ce(e,t,n,r,s){let i=[];for(let o=0,a=0;o<e.length;o++){let l=e[o],c=a,d=a+=l.size;c>=n||d<=t?i.push(l):(c<t&&i.push(l.slice(0,t-c,r)),s&&(i.push(s),s=void 0),d>n&&i.push(l.slice(n-c,l.size,r)))}return i}function Se(e,t=null){let n=e.domSelectionRange(),s=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&0==i.size,l=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(l<0)return null;let c,d,u=s.resolve(l);if(m(n)){for(c=u;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&r.nh.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,s=t==p(e);r||s;){if(e==n)return!0;let t=o(e);if(!(e=e.parentNode))return!1;r=r&&0==t,s=s&&t==p(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;d=new r.nh(l==e?u:s.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;c=s.resolve(t)}return d||(d=Re(e,c,u,"pointer"==t||e.state.selection.head<u.pos&&!a?1:-1)),d}function Ae(e){return e.editable?e.hasFocus():Pe(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Me(e,t=!1){let n=e.state.selection;if(Ee(e,n),Ae(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&M){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&d(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,s="IMG"==r.nodeName;s?n.setEnd(r.parentNode,o(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!s&&!e.state.selection.visible&&_&&C<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let s,i,{anchor:o,head:a}=n;!Oe||n instanceof r.U3||(n.$from.parent.inlineContent||(s=Ne(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=Ne(e,n.to))),e.docView.setSelection(o,a,e.root,t),Oe&&(s&&$e(s),i&&$e(i)),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,s=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==s||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Ae(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Oe=N||M&&O<63;function Ne(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),s=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(N&&s&&"false"==s.contentEditable)return Te(s);if(!(s&&"false"!=s.contentEditable||i&&"false"!=i.contentEditable)){if(s)return Te(s);if(i)return Te(i)}}function Te(e){return e.contentEditable="true",N&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function $e(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Ee(e,t){if(t instanceof r.nh){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(De(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else De(e)}function De(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Re(e,t,n,s){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||r.U3.between(t,n,s)}function Ie(e){return!(e.editable&&!e.hasFocus())&&Pe(e)}function Pe(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 Fe(e,t){let{$anchor:n,$head:s}=e.selection,i=t>0?n.max(s):n.min(s),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&r.LN.findFrom(o,t)}function Le(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Be(e,t,n){let s=e.state.selection;if(!(s instanceof r.U3)){if(s instanceof r.nh&&s.node.isInline)return Le(e,new r.U3(t>0?s.$to:s.$from));{let n=Fe(e.state,t);return!!n&&Le(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=s,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return Le(e,new r.U3(s.$anchor,o))}if(!s.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=Fe(e.state,t);return!!(n&&n instanceof r.nh)&&Le(e,n)}if(!($&&n.indexOf("m")>-1)){let n,i=s.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let a=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(a))&&!n.contentDOM)&&(r.nh.isSelectable(o)?Le(e,new r.nh(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!R&&Le(e,new r.U3(e.state.doc.resolve(t<0?a:a+o.nodeSize))))}}function ze(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function je(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function Ve(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let s,i,a=!1;for(S&&1==n.nodeType&&r<ze(n)&&je(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(je(e,-1))s=n,i=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(He(n))break;{let t=n.previousSibling;for(;t&&je(t,-1);)s=n.parentNode,i=o(t),t=t.previousSibling;if(t)n=t,r=ze(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?Ue(e,n,r):s&&Ue(e,s,i)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let s,i,a=ze(n);for(;;)if(r<a){if(1!=n.nodeType)break;if(!je(n.childNodes[r],1))break;s=n,i=++r}else{if(He(n))break;{let t=n.nextSibling;for(;t&&je(t,1);)s=t.parentNode,i=o(t)+1,t=t.nextSibling;if(t)n=t,r=0,a=ze(n);else{if(n=n.parentNode,n==e.dom)break;r=a=0}}}s&&Ue(e,s,i)}(e)}function He(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Ue(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!f(e);)t=o(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!f(e);)t=o(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}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:s}=e;setTimeout((()=>{e.state==s&&Me(e)}),50)}function qe(e,t){let n=e.state.doc.resolve(t);if(!M&&!E&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),s=(n.top+n.bottom)/2;if(s>r.top&&s<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),s=(n.top+n.bottom)/2;if(s>r.top&&s<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 Ke(e,t,n){let s=e.state.selection;if(s instanceof r.U3&&!s.empty||n.indexOf("s")>-1)return!1;if($&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=s;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Fe(e.state,t);if(n&&n instanceof r.nh)return Le(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,a=s instanceof r.i5?r.LN.near(n,t):r.LN.findFrom(n,t);return!!a&&Le(e,a)}return!1}function Ze(e,t){if(!(e.state.selection instanceof r.U3))return!0;let{$head:n,$anchor:s,empty:i}=e.state.selection;if(!n.sameParent(s))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function Je(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function We(e,t){e.someProp("transformCopied",(n=>{t=n(t,e)}));let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;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")||s.ZF.fromSchema(e.state.schema),l=it(),c=l.createElement("div");c.appendChild(a.serializeFragment(r,{document:l}));let d,u=c.firstChild,h=0;for(;u&&1==u.nodeType&&(d=rt[u.nodeName.toLowerCase()]);){for(let e=d.length-1;e>=0;e--){let t=l.createElement(d[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),h++}u=c.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${i} ${o}${h?` -${h}`:""} ${JSON.stringify(n)}`),{dom:c,text:e.someProp("clipboardTextSerializer",(n=>n(t,e)))||t.content.textBetween(0,t.content.size,"\n\n")}}function Ge(e,t,n,r,i){let o,a,l=i.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 s.Ji(s.FK.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):s.Ji.empty;let n=e.someProp("clipboardTextParser",(n=>n(t,i,r,e)));if(n)a=n;else{let n=i.marks(),{schema:r}=e.state,a=s.ZF.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(a.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(t=>{n=t(n,e)})),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=it().createElement("div"),s=/<([a-z][^>\s]+)/i.exec(e);if((n=s&&rt[s[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(M?"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)}}(o);let d=o&&o.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;o=e}if(!a){let t=e.someProp("clipboardParser")||e.someProp("domParser")||s.S4.fromSchema(e.state.schema);a=t.parseSlice(o,{preserveWhitespace:!(!c&&!u),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Ye.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(u)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:i,openStart:o,openEnd:a}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;i=s.FK.from(t.create(n[e+1],i)),o++,a++}return new s.Ji(i,o,a)}(nt(a,+u[1],+u[2]),u[4]);else if(a=s.Ji.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&Qe(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=et(o[o.length-1],r.length));let t=Xe(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return s.FK.from(o)}return e}(a.content,i),!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=nt(a,e,t)}return e.someProp("transformPasted",(t=>{a=t(a,e)})),a}const Ye=/^(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 Xe(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,s.FK.from(e));return e}function Qe(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=Qe(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(s.FK.from(Xe(n,e,i+1))))}}function et(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,et(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(s.FK.empty,!0);return e.copy(n.append(r))}function tt(e,t,n,r,i,o){let a=t<0?e.firstChild:e.lastChild,l=a.content;return e.childCount>1&&(o=0),i<r-1&&(l=tt(l,t,n,r,i+1,o)),i>=n&&(l=t<0?a.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(a.contentMatchAt(a.childCount).fillBefore(s.FK.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(l))}function nt(e,t,n){return t<e.openStart&&(e=new s.Ji(tt(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new s.Ji(tt(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const rt={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 st=null;function it(){return st||(st=document.implementation.createHTMLDocument("title"))}const ot={},at={},lt={touchstart:!0,touchmove:!0};class ct{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.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function dt(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function ut(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>ht(e,t))}))}function ht(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function pt(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 ft(e){return{left:e.clientX,top:e.clientY}}function mt(e,t,n,r,s){if(-1==r)return!1;let i=e.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(e.someProp(t,(t=>r>i.depth?t(e,n,i.nodeAfter,i.before(r),s,!0):t(e,n,i.node(r),i.before(r),s,!1))))return!0;return!1}function gt(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function yt(e,t,n,r){return mt(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function vt(e,t,n,s){return mt(e,"handleTripleClickOn",t,n,s)||e.someProp("handleTripleClick",(n=>n(e,t,s)))||function(e,t,n){if(0!=n.button)return!1;let s=e.state.doc;if(-1==t)return!!s.inlineContent&&(gt(e,r.U3.create(s,0,s.content.size),"pointer"),!0);let i=s.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)gt(e,r.U3.create(s,o+1,o+1+n.content.size),"pointer");else{if(!r.nh.isSelectable(n))continue;gt(e,r.nh.create(s,o),"pointer")}return!0}}(e,n,s)}function bt(e){return At(e)}at.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!kt(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!D||!M||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!T||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||$&&72==n&&"c"==r)return Ze(e,-1)||Ve(e,-1);if(46==n&&!t.shiftKey||$&&68==n&&"c"==r)return Ze(e,1)||Ve(e,1);if(13==n||27==n)return!0;if(37==n||$&&66==n&&"c"==r){let t=37==n?"ltr"==qe(e,e.state.selection.from)?-1:1:-1;return Be(e,t,r)||Ve(e,t)}if(39==n||$&&70==n&&"c"==r){let t=39==n?"ltr"==qe(e,e.state.selection.from)?1:-1:1;return Be(e,t,r)||Ve(e,t)}return 38==n||$&&80==n&&"c"==r?Ke(e,-1,r)||Ve(e,-1):40==n||$&&78==n&&"c"==r?function(e){if(!N||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)||Ke(e,1,r)||Ve(e,1):r==($?"m":"c")&&(66==n||73==n||89==n||90==n)}(e,n)?n.preventDefault():dt(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)}},at.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},at.keypress=(e,t)=>{let n=t;if(kt(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||$&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let s=e.state.selection;if(!(s instanceof r.U3&&s.$from.sameParent(s.$to))){let t=String.fromCharCode(n.charCode);/[\r\n]/.test(t)||e.someProp("handleTextInput",(n=>n(e,s.$from.pos,s.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const xt=$?"metaKey":"ctrlKey";ot.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=bt(e),s=Date.now(),i="singleClick";s-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?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:s,x:n.clientX,y:n.clientY,type:i};let o=e.posAtCoords(ft(n));o&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new wt(e,o,n,!!r)):("doubleClick"==i?yt:vt)(e,o.pos,o.inside,n)?n.preventDefault():dt(e,"pointer"))};class wt{constructor(e,t,n,s){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=s,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[xt],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const a=s?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&&i.type.spec.draggable&&!1!==i.type.spec.selectable||c instanceof r.nh&&c.from<=o&&c.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!S||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)),dt(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((()=>Me(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(ft(e))),this.updateAllowDefault(e),this.allowDefault||!t?dt(this.view,"pointer"):function(e,t,n,s,i){return mt(e,"handleClickOn",t,n,s)||e.someProp("handleClick",(n=>n(e,t,s)))||(i?function(e,t){if(-1==t)return!1;let n,s,i=e.state.selection;i instanceof r.nh&&(n=i.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(r.nh.isSelectable(t)){s=n&&i.$from.depth>0&&e>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(e);break}}return null!=s&&(gt(e,r.nh.create(e.state.doc,s),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),s=n.nodeAfter;return!!(s&&s.isAtom&&r.nh.isSelectable(s))&&(gt(e,new r.nh(n),"pointer"),!0)}(e,n))}(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||N&&this.mightDrag&&!this.mightDrag.node.isAtom||M&&!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)?(gt(this.view,r.LN.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):dt(this.view,"pointer")}move(e){this.updateAllowDefault(e),dt(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 kt(e,t){return!!e.composing||!!(N&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}ot.touchstart=e=>{e.input.lastTouch=Date.now(),bt(e),dt(e,"pointer")},ot.touchmove=e=>{e.input.lastTouch=Date.now(),dt(e,"pointer")},ot.contextmenu=e=>bt(e);const _t=D?5e3:-1;function Ct(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>At(e)),t))}function St(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 At(e,t=!1){if(!(D&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),St(e),t||e.docView&&e.docView.dirty){let t=Se(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}at.compositionstart=at.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(),At(e,!0),e.markCursor=null;else if(At(e),S&&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}Ct(e,_t)},at.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then((()=>e.domObserver.flush())),e.input.compositionID++,Ct(e,20))};const Mt=_&&C<15||T&&I<604;function Ot(e,t,n,r,i){let o=Ge(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,i,o||s.Ji.empty))))return!0;if(!o)return!1;let a=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),l=a?e.state.tr.replaceSelectionWith(a,r):e.state.tr.replaceSelection(o);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Nt(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ot.copy=at.cut=(e,t)=>{let n=t,r=e.state.selection,s="cut"==n.type;if(r.empty)return;let i=Mt?null:n.clipboardData,o=r.content(),{dom:a,text:l}=We(e,o);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.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(),s=document.createRange();s.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(s),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),s&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},at.paste=(e,t)=>{let n=t;if(e.composing&&!D)return;let r=Mt?null:n.clipboardData,s=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&Ot(e,Nt(r),r.getData("text/html"),s,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();let s=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Ot(e,r.value,null,s,t):Ot(e,r.textContent,r.innerHTML,s,t)}),50)}(e,n)};class Tt{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const $t=$?"altKey":"ctrlKey";ot.dragstart=(e,t)=>{let n=t,s=e.input.mouseDown;if(s&&s.done(),!n.dataTransfer)return;let i,o=e.state.selection,a=o.empty?null:e.posAtCoords(ft(n));if(a&&a.pos>=o.from&&a.pos<=(o instanceof r.nh?o.to-1:o.to));else if(s&&s.mightDrag)i=r.nh.create(e.state.doc,s.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&&(i=r.nh.create(e.state.doc,t.posBefore))}let l=(i||e.state.selection).content(),{dom:c,text:d}=We(e,l);n.dataTransfer.clearData(),n.dataTransfer.setData(Mt?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",Mt||n.dataTransfer.setData("text/plain",d),e.dragging=new Tt(l,!n[$t],i)},ot.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},at.dragover=at.dragenter=(e,t)=>t.preventDefault(),at.drop=(e,t)=>{let n=t,o=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let a=e.posAtCoords(ft(n));if(!a)return;let l=e.state.doc.resolve(a.pos),c=o&&o.slice;c?e.someProp("transformPasted",(t=>{c=t(c,e)})):c=Ge(e,Nt(n.dataTransfer),Mt?null:n.dataTransfer.getData("text/html"),!1,l);let d=!(!o||n[$t]);if(e.someProp("handleDrop",(t=>t(e,n,c||s.Ji.empty,d))))return void n.preventDefault();if(!c)return;n.preventDefault();let u=c?(0,i.Um)(e.state.doc,l.pos,c):l.pos;null==u&&(u=l.pos);let h=e.state.tr;if(d){let{node:e}=o;e?e.replace(h):h.deleteSelection()}let p=h.mapping.map(u),f=0==c.openStart&&0==c.openEnd&&1==c.content.childCount,m=h.doc;if(f?h.replaceRangeWith(p,p,c.content.firstChild):h.replaceRange(p,p,c),h.doc.eq(m))return;let g=h.doc.resolve(p);if(f&&r.nh.isSelectable(c.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(c.content.firstChild))h.setSelection(new r.nh(g));else{let t=h.mapping.map(u);h.mapping.maps[h.mapping.maps.length-1].forEach(((e,n,r,s)=>t=s)),h.setSelection(Re(e,g,h.doc.resolve(t)))}e.focus(),e.dispatch(h.setMeta("uiEvent","drop"))},ot.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())&&Me(e)}),20))},ot.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)},ot.beforeinput=(e,t)=>{if(M&&D&&"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 at)ot[e]=at[e];function Et(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 Dt{constructor(e,t){this.toDOM=e,this.spec=t||Lt,this.side=this.spec.side||0}map(e,t,n,r){let{pos:s,deleted:i}=e.mapResult(t.from+r,this.side<0?-1:1);return i?null:new Pt(s-n,s-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Dt&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Et(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 s=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return s>=i?null:new Pt(s,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Rt&&Et(this.attrs,e.attrs)&&Et(this.spec,e.spec)}static is(e){return e.type instanceof Rt}destroy(){}}class It{constructor(e,t){this.attrs=e,this.spec=t||Lt}map(e,t,n,r){let s=e.mapResult(t.from+r,1);if(s.deleted)return null;let i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=s.pos?null:new Pt(s.pos-n,i.pos-n,this)}valid(e,t){let n,{index:r,offset:s}=e.content.findIndex(t.from);return s==t.from&&!(n=e.child(r)).isText&&s+n.nodeSize==t.to}eq(e){return this==e||e instanceof It&&Et(this.attrs,e.attrs)&&Et(this.spec,e.spec)}destroy(){}}class Pt{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new Pt(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 Pt(e,e,new Dt(t,n))}static inline(e,t,n,r){return new Pt(e,t,new Rt(n,r))}static node(e,t,n,r){return new Pt(e,t,new It(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Rt}get widget(){return this.type instanceof Dt}}const Ft=[],Lt={};class Bt{constructor(e,t){this.local=e.length?e:Ft,this.children=t.length?t:Ft}static create(e,t){return t.length?qt(t,e,0,Lt):zt}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,s){for(let i=0;i<this.local.length;i++){let o=this.local[i];o.from<=t&&o.to>=e&&(!s||s(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let o=this.children[i]+1;this.children[i+2].findInner(e-o,t-o,n,r+o,s)}}map(e,t,n){return this==zt||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Lt)}mapInner(e,t,n,r,s){let i;for(let o=0;o<this.local.length;o++){let a=this.local[o].map(e,n,r);a&&a.type.valid(t,a)?(i||(i=[])).push(a):s.onRemove&&s.onRemove(this.local[o].spec)}return this.children.length?function(e,t,n,r,s,i,o){let a=e.slice();for(let e=0,t=i;e<n.maps.length;e++){let r=0;n.maps[e].forEach(((e,n,s,i)=>{let o=i-s-(n-e);for(let s=0;s<a.length;s+=3){let i=a[s+1];if(i<0||e>i+t-r)continue;let l=a[s]+t-r;n>=l?a[s+1]=e<=l?-2:-1:e>=t&&o&&(a[s]+=o,a[s+1]+=o)}r+=o})),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]+i),d=c-s;if(d<0||d>=r.content.size){l=!0;continue}let u=n.map(e[t+1]+i,-1)-s,{index:h,offset:p}=r.content.findIndex(d),f=r.maybeChild(h);if(f&&p==d&&p+f.nodeSize==u){let r=a[t+2].mapInner(n,f,c+1,e[t]+i+1,o);r!=zt?(a[t]=d,a[t+1]=u,a[t+2]=r):(a[t+1]=-2,l=!0)}else l=!0}if(l){let l=function(e,t,n,r,s,i,o){function a(e,t){for(let i=0;i<e.local.length;i++){let a=e.local[i].map(r,s,t);a?n.push(a):o.onRemove&&o.onRemove(e.local[i].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]+i+1);return n}(a,e,t,n,s,i,o),c=qt(l,r,0,o);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 Bt(t.sort(Kt),a)}(this.children,i||[],e,t,n,r,s):i?new Bt(i.sort(Kt),Ft):zt}add(e,t){return t.length?this==zt?Bt.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,s=0;e.forEach(((e,i)=>{let o,a=i+n;if(o=Ht(t,e,a)){for(r||(r=this.children.slice());s<r.length&&r[s]<i;)s+=3;r[s]==i?r[s+2]=r[s+2].addInner(e,o,a+1):r.splice(s,0,i,i+e.nodeSize,qt(o,e,a+1,Lt)),s+=3}}));let i=Vt(s?Ut(t):t,-n);for(let t=0;t<i.length;t++)i[t].type.valid(e,i[t])||i.splice(t--,1);return new Bt(i.length?this.local.concat(i).sort(Kt):this.local,r||this.children)}remove(e){return 0==e.length||this==zt?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 s,i=n[r]+t,o=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>i&&t.to<o&&(e[n]=null,(s||(s=[])).push(t));if(!s)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(s,i+1);a!=zt?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,s=0;s<e.length;s++)if(n=e[s])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 Bt(r,n):zt}forChild(e,t){if(this==zt)return this;if(t.isLeaf)return Bt.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 s=e+1,i=s+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<i&&t.to>s&&t.type instanceof Rt){let e=Math.max(s,t.from)-s,n=Math.min(i,t.to)-s;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new Bt(r.sort(Kt),Ft);return n?new jt([e,n]):e}return n||zt}eq(e){if(this==e)return!0;if(!(e instanceof Bt)||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 Zt(this.localsInner(e))}localsInner(e){if(this==zt)return Ft;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}}Bt.empty=new Bt([],[]),Bt.removeOverlap=Zt;const zt=Bt.empty;class jt{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,Lt)));return jt.from(n)}forChild(e,t){if(t.isLeaf)return Bt.empty;let n=[];for(let r=0;r<this.members.length;r++){let s=this.members[r].forChild(e,t);s!=zt&&(s instanceof jt?n=n.concat(s.members):n.push(s))}return jt.from(n)}eq(e){if(!(e instanceof jt)||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 s=this.members[r].localsInner(e);if(s.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<s.length;e++)t.push(s[e])}else t=s}return t?Zt(n?t:t.sort(Kt)):Ft}static from(e){switch(e.length){case 0:return zt;case 1:return e[0];default:return new jt(e.every((e=>e instanceof Bt))?e:e.reduce(((e,t)=>e.concat(t instanceof Bt?t:t.members)),[]))}}}function Vt(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let s=e[r];n.push(new Pt(s.from+t,s.to+t,s.type))}return n}function Ht(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,s=null;for(let t,i=0;i<e.length;i++)(t=e[i])&&t.from>n&&t.to<r&&((s||(s=[])).push(t),e[i]=null);return s}function Ut(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function qt(e,t,n,r){let s=[],i=!1;t.forEach(((t,o)=>{let a=Ht(e,t,o+n);if(a){i=!0;let e=qt(a,t,n+o+1,r);e!=zt&&s.push(o,o+t.nodeSize,e)}}));let o=Vt(i?Ut(e):e,-n).sort(Kt);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||s.length?new Bt(o,s):zt}function Kt(e,t){return e.from-t.from||e.to-t.to}function Zt(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let s=n+1;s<t.length;s++){let i=t[s];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),Jt(t,s,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[s]=i.copy(i.from,r.to),Jt(t,s+1,i.copy(r.to,i.to)))}}return t}function Jt(e,t,n){for(;t<e.length&&Kt(n,e[t])>0;)t++;e.splice(t,0,n)}function Wt(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=zt&&t.push(r)})),e.cursorWrapper&&t.push(Bt.create(e.state.doc,[e.cursorWrapper.deco])),jt.from(t)}const Gt={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Yt=_&&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]);_&&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()})),Yt&&(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(Ie(this.view)){if(this.suppressingSelectionUpdates)return Me(this.view);if(_&&C<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&d(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}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Ie(e)&&!this.ignoreSelectionChange(n),i=-1,o=-1,a=!1,l=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],l);n&&(i=i<0?n.from:Math.min(n.from,i),o=o<0?n.to:Math.max(n.to,o),n.typeOver&&(a=!0))}if(S&&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;i<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&m(n)&&(c=Se(e))&&c.eq(r.LN.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Me(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||s)&&(i>-1&&(e.docView.markDirty(i,o),function(e){if(!en.has(e)&&(en.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))){if(e.requiresGeckoHackNode=S,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(i,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Me(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,s=e.nextSibling;if(_&&C<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:i}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!i||Array.prototype.indexOf.call(e.addedNodes,i)<0)&&(s=i)}let i=r&&r.parentNode==e.target?o(r)+1:0,a=n.localPosFromDOM(e.target,i,-1),l=s&&s.parentNode==e.target?o(s):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(N&&/^(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||N&&/^(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 sn(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 on(e,t,n){let r=e.depth,s=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,s++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,s++}return s}function an(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class ln{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 ct,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(pn),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),dn(this),this.nodeViews=hn(this),this.docView=ce(this.state.doc,cn(this),Wt(this),this.dom,this),this.domObserver=new Qt(this,((e,t,n,i)=>function(e,t,n,i,o){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Se(e,t);if(n&&!e.state.selection.eq(n)){if(M&&D&&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(),a&&r.setMeta("composition",a),e.dispatch(r)}return}let l=e.state.doc.resolve(t),c=l.sharedDepth(n);t=l.before(c+1),n=e.state.doc.resolve(n).after(c+1);let d,u,h=e.state.selection,p=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:a,from:l,to:c}=e.docView.parseRange(t,n),d=e.domSelectionRange(),u=d.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:d.anchorOffset}],m(d)||r.push({node:d.focusNode,offset:d.focusOffset})),M&&8===e.input.lastKeyCode)for(let e=a;e>o;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){a=e;break}if(!n||n.size)break}let h=e.state.doc,p=e.someProp("domParser")||s.S4.fromSchema(e.state.schema),f=h.resolve(l),g=null,y=p.parse(i,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:o,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),f=e.state.doc,y=f.slice(p.from,p.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(d=e.state.selection.to,u="end"):(d=e.state.selection.from,u="start"),e.input.lastKeyCode=null;let v=function(e,t,n,r,s){let i=e.findDiffStart(t,n);if(null==i)return null;let{a:o,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==s&&(r-=o+Math.max(0,i-Math.min(o,a))-i),o<i&&e.size<t.size){let e=r<=i&&r>=o?i-r:0;i-=e,i&&i<t.size&&an(t.textBetween(i-1,i+1))&&(i+=e?1:-1),a=i+(a-o),o=i}else if(a<i){let t=r<=i&&r>=a?i-r:0;i-=t,i&&i<e.size&&an(e.textBetween(i-1,i+1))&&(i+=t?1:-1),o=i+(o-a),a=i}return{start:i,endA:o,endB:a}}(y.content,p.doc.content,p.from,d,u);if((T&&e.input.lastIOSEnter>Date.now()-225||D)&&o.some((e=>1==e.nodeType&&!rn.test(e.nodeName)))&&(!v||v.endA>=v.endB)&&e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!v){if(!(i&&h instanceof r.U3&&!h.empty&&h.$head.sameParent(h.$anchor))||e.composing||p.sel&&p.sel.anchor!=p.sel.head){if(p.sel){let t=sn(e,e.state.doc,p.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta("composition",a),e.dispatch(n)}}return}v={start:h.from,endA:h.to,endB:h.to}}if(M&&e.cursorWrapper&&p.sel&&p.sel.anchor==e.cursorWrapper.deco.from&&p.sel.head==p.sel.anchor){let e=v.endB-v.start;p.sel={anchor:p.sel.anchor+e,head:p.sel.anchor+e}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&v.start==v.endB&&e.state.selection instanceof r.U3&&(v.start>e.state.selection.from&&v.start<=e.state.selection.from+2&&e.state.selection.from>=p.from?v.start=e.state.selection.from:v.endA<e.state.selection.to&&v.endA>=e.state.selection.to-2&&e.state.selection.to<=p.to&&(v.endB+=e.state.selection.to-v.endA,v.endA=e.state.selection.to)),_&&C<=11&&v.endB==v.start+1&&v.endA==v.start&&v.start>p.from&&" "==p.doc.textBetween(v.start-p.from-1,v.start-p.from+1)&&(v.start--,v.endA--,v.endB--);let b,x=p.doc.resolveNoCache(v.start-p.from),w=p.doc.resolveNoCache(v.endB-p.from),k=f.resolve(v.start),S=x.sameParent(w)&&x.parent.inlineContent&&k.end()>=v.endA;if((T&&e.input.lastIOSEnter>Date.now()-225&&(!S||o.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!S&&x.pos<p.doc.content.size&&!x.sameParent(w)&&(b=r.LN.findFrom(p.doc.resolve(x.pos+1),1,!0))&&b.head==w.pos)&&e.someProp("handleKeyDown",(t=>t(e,g(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>v.start&&function(e,t,n,r,s){if(!r.parent.isTextblock||n-t<=s.pos-r.pos||on(r,!0,!1)<s.pos)return!1;let i=e.resolve(t);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let o=e.resolve(on(i,!0,!0));return!(!o.parent.isTextblock||o.pos>n||on(o,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(o.parent.content)}(f,v.start,v.endA,x,w)&&e.someProp("handleKeyDown",(t=>t(e,g(8,"Backspace")))))return void(D&&M&&e.domObserver.suppressSelectionUpdates());M&&D&&v.endB==v.start&&(e.input.lastAndroidDelete=Date.now()),D&&!S&&x.start()!=w.start()&&0==w.parentOffset&&x.depth==w.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==v.endA&&(v.endB-=2,w=p.doc.resolveNoCache(v.endB-p.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,g(13,"Enter"))}))}),20));let A,O,N,$=v.start,E=v.endA;if(S)if(x.pos==w.pos)_&&C<=11&&0==x.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Me(e)),20)),A=e.state.tr.delete($,E),O=f.resolve(v.start).marksAcross(f.resolve(v.endA));else if(v.endA==v.endB&&(N=function(e,t){let n,r,i,o=e.firstChild.marks,a=t.firstChild.marks,l=o,c=a;for(let e=0;e<a.length;e++)l=a[e].removeFromSet(l);for(let e=0;e<o.length;e++)c=o[e].removeFromSet(c);if(1==l.length&&0==c.length)r=l[0],n="add",i=e=>e.mark(r.addToSet(e.marks));else{if(0!=l.length||1!=c.length)return null;r=c[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let d=[];for(let e=0;e<t.childCount;e++)d.push(i(t.child(e)));if(s.FK.from(d).eq(e))return{mark:r,type:n}}(x.parent.content.cut(x.parentOffset,w.parentOffset),k.parent.content.cut(k.parentOffset,v.endA-k.start()))))A=e.state.tr,"add"==N.type?A.addMark($,E,N.mark):A.removeMark($,E,N.mark);else if(x.parent.child(x.index()).isText&&x.index()==w.index()-(w.textOffset?0:1)){let t=x.parent.textBetween(x.parentOffset,w.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,$,E,t))))return;A=e.state.tr.insertText(t,$,E)}if(A||(A=e.state.tr.replace($,E,p.doc.slice(v.start-p.from,v.endB-p.from))),p.sel){let t=sn(e,A.doc,p.sel);t&&!(M&&D&&e.composing&&t.empty&&(v.start!=v.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==$||t.head==A.mapping.map(E)-1)||_&&t.empty&&t.head==$)&&A.setSelection(t)}O&&A.ensureMarks(O),a&&A.setMeta("composition",a),e.dispatch(A.scrollIntoView())}(this,e,t,n,i))),this.domObserver.start(),function(e){for(let t in ot){let n=ot[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!pt(e,t)||ht(e,t)||!e.editable&&t.type in at||n(e,t)},lt[t]?{passive:!0}:void 0)}N&&e.dom.addEventListener("input",(()=>null)),ut(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&&ut(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(pn),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){var n;let r=this.state,s=!1,i=!1;e.storedMarks&&this.composing&&(St(this),i=!0),this.state=e;let o=r.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,s=!0)}(o||t.handleDOMEvents!=this._props.handleDOMEvents)&&ut(this),this.editable=un(this),dn(this);let a=Wt(this),l=cn(this),c=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",u=s||!this.docView.matchesNode(e.doc,l,a);!u&&e.selection.eq(r.selection)||(i=!0);let h="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),s=Math.max(0,r.top);for(let i=(r.left+r.right)/2,o=s+1;o<Math.min(innerHeight,r.bottom);o+=5){let r=e.root.elementFromPoint(i,o);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=s-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:z(e.dom)}}(this);if(i){this.domObserver.stop();let t=u&&(_||M)&&!this.composing&&!r.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)}(r.selection,e.selection);if(u){let n=M?this.trackWrites=this.domSelectionRange().focusNode:null;!s&&this.docView.update(e.doc,l,a,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ce(e.doc,l,a,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 d(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Me(this,t):(Ee(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():h&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;j(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.nh){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&B(this,t.getBoundingClientRect(),e)}else B(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))}}}updateDraggedNode(e,t){let n=e.node,s=-1;if(this.state.doc.nodeAt(n.from)==n.node)s=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==n.node&&(s=e)}this.dragging=new Tt(e.slice,e.move,s<0?void 0:r.nh.create(this.state.doc,s))}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 s=this.directPlugins[r].props[e];if(null!=s&&(n=t?t(s):s))return n}let s=this.state.plugins;if(s)for(let r=0;r<s.length;r++){let i=s[r].props[e];if(null!=i&&(n=t?t(i):i))return n}}hasFocus(){if(_){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(V)return e.focus(V);let t=z(e);e.focus(null==V?{get preventScroll(){return V={preventScroll:!0},!0}}:void 0),V||(V=!1,j(t,0))}(this.dom),Me(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}updateRoot(){this._root=null}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,s="up"==n?r.$from:r.$to;return Q(e,t,(()=>{let{node:t}=e.docView.domFromPos(s.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,s.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 s=t[e];if(s.bottom>s.top+1&&("up"==n?r.top-s.top>2*(s.bottom-r.top):s.bottom-r.bottom>2*(r.bottom-s.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let s=r.parentOffset,i=!s,o=s==r.parent.content.size,a=e.domSelection();return ee.test(r.parent.textContent)&&a.modify?Q(e,t,(()=>{let{focusNode:t,focusOffset:s,anchorNode:i,anchorOffset:o}=e.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:d,focusOffset:u}=e.domSelectionRange(),h=d&&!c.contains(1==d.nodeType?d:d.parentNode)||t==d&&s==u;try{a.collapse(i,o),t&&(t!=i||s!=o)&&a.extend&&a.extend(t,s)}catch(e){}return null!=l&&(a.caretBidiLevel=l),h})):"left"==n||"backward"==n?i:o}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return Ot(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Ot(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,[],Wt(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){ht(e,t)||!ot[t.type]||!e.editable&&t.type in at||ot[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 N&&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,s=t.startOffset,i=t.endContainer,o=t.endOffset,a=e.domAtPos(e.state.selection.anchor);return d(a.node,a.offset,i,o)&&([r,s,i,o]=[i,o,r,s]),{anchorNode:r,anchorOffset:s,focusNode:i,focusOffset:o}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function cn(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"),[Pt.node(0,e.state.doc.content.size,t)]}function dn(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:Pt.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 pn(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")}},2466:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>at});var r=n(6218),s=(n(9763),n(7268)),i=n(9777),o=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},a=function(e){return.2126*o(e.r)+.7152*o(e.g)+.0722*o(e.b)};function l(e){e.prototype.luminance=function(){return e=a(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,r,s,i,o,l,c,d=t instanceof e?t:new e(t);return i=this.rgba,o=d.toRgb(),n=(l=a(i))>(c=a(o))?(l+.05)/(c+.05):(c+.05)/(l+.05),void 0===(r=2)&&(r=0),void 0===s&&(s=Math.pow(10,r)),Math.floor(s*n)/s+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(o=void 0===(i=(n=t).size)?"normal":i,"AAA"===(s=void 0===(r=n.level)?"AA":r)&&"normal"===o?7:"AA"===s&&"large"===o?3:4.5);var n,r,s,i,o}}var c=n(1120);const d=(0,c.writable)({ArrowLeft:0,ArrowUp:0,ArrowRight:0,ArrowDown:0}),u=(0,c.derived)(d,(e=>({...e,ArrowV:e.ArrowUp+e.ArrowDown,ArrowH:e.ArrowLeft+e.ArrowRight,ArrowVH:e.ArrowUp+e.ArrowDown+e.ArrowLeft+e.ArrowRight})));function h(e,t=.001,n=.01){const r=Math.min(1,Math.max(1,e-50)/50);return t+(n-t)/2*(1-Math.cos(Math.PI*r))}const{window:p}=r.globals;function f(e){(0,r.append_styles)(e,"svelte-uiwgvv",".picker.svelte-uiwgvv{position:relative;width:100%;height:100%;background:linear-gradient(#ffffff00, #000000ff),\n\t\t\tlinear-gradient(0.25turn, #ffffffff, #00000000), var(--color-bg);outline:none;user-select:none}")}function m(e){let t,n,s,o,a,l,c,d;var u=e[2].pickerIndicator;function h(e,t){return{props:{pos:e[9],isDark:e[5],hex:(0,i.Mj)({h:e[3],s:e[0],v:e[1],a:1}).toHex()}}}return u&&(n=(0,r.construct_svelte_component)(u,h(e))),{c(){t=(0,r.element)("div"),n&&(0,r.create_component)(n.$$.fragment),(0,r.attr)(t,"class","picker svelte-uiwgvv"),(0,r.attr)(t,"tabindex","0"),(0,r.set_style)(t,"--color-bg",e[8]),(0,r.attr)(t,"aria-label","saturation and brightness picker (arrow keyboard navigation)"),(0,r.attr)(t,"aria-valuemin",s=0),(0,r.attr)(t,"aria-valuemax",o=100),(0,r.attr)(t,"aria-valuetext",a="saturation "+e[9].x?.toFixed()+"%, brightness "+e[9].y?.toFixed()+"%")},m(s,i){(0,r.insert)(s,t,i),n&&(0,r.mount_component)(n,t,null),e[18](t),l=!0,c||(d=[(0,r.listen)(t,"mousedown",(0,r.prevent_default)(e[10])),(0,r.listen)(t,"touchstart",e[16]),(0,r.listen)(t,"touchmove",(0,r.prevent_default)(e[16])),(0,r.listen)(t,"touchend",e[16])],c=!0)},p(e,s){if(4&s&&u!==(u=e[2].pickerIndicator)){if(n){(0,r.group_outros)();const e=n;(0,r.transition_out)(e.$$.fragment,1,0,(()=>{(0,r.destroy_component)(e,1)})),(0,r.check_outros)()}u?(n=(0,r.construct_svelte_component)(u,h(e)),(0,r.create_component)(n.$$.fragment),(0,r.transition_in)(n.$$.fragment,1),(0,r.mount_component)(n,t,null)):n=null}else if(u){const t={};512&s&&(t.pos=e[9]),32&s&&(t.isDark=e[5]),11&s&&(t.hex=(0,i.Mj)({h:e[3],s:e[0],v:e[1],a:1}).toHex()),n.$set(t)}(!l||256&s)&&(0,r.set_style)(t,"--color-bg",e[8]),(!l||512&s&&a!==(a="saturation "+e[9].x?.toFixed()+"%, brightness "+e[9].y?.toFixed()+"%"))&&(0,r.attr)(t,"aria-valuetext",a)},i(e){l||(n&&(0,r.transition_in)(n.$$.fragment,e),l=!0)},o(e){n&&(0,r.transition_out)(n.$$.fragment,e),l=!1},d(s){s&&(0,r.detach)(t),n&&(0,r.destroy_component)(n),e[18](null),c=!1,(0,r.run_all)(d)}}}function g(e){let t,n,s,i,o;var a=e[2].pickerWrapper;function l(e,t){return{props:{focused:e[7],toRight:e[4],$$slots:{default:[m]},$$scope:{ctx:e}}}}return a&&(t=(0,r.construct_svelte_component)(a,l(e))),{c(){t&&(0,r.create_component)(t.$$.fragment),n=(0,r.empty)()},m(a,l){t&&(0,r.mount_component)(t,a,l),(0,r.insert)(a,n,l),s=!0,i||(o=[(0,r.listen)(p,"mouseup",e[11]),(0,r.listen)(p,"mousedown",e[13]),(0,r.listen)(p,"mousemove",e[12]),(0,r.listen)(p,"keyup",e[14]),(0,r.listen)(p,"keydown",e[15])],i=!0)},p(e,[s]){if(4&s&&a!==(a=e[2].pickerWrapper)){if(t){(0,r.group_outros)();const e=t;(0,r.transition_out)(e.$$.fragment,1,0,(()=>{(0,r.destroy_component)(e,1)})),(0,r.check_outros)()}a?(t=(0,r.construct_svelte_component)(a,l(e)),(0,r.create_component)(t.$$.fragment),(0,r.transition_in)(t.$$.fragment,1),(0,r.mount_component)(t,n.parentNode,n)):t=null}else if(a){const n={};128&s&&(n.focused=e[7]),16&s&&(n.toRight=e[4]),67109743&s&&(n.$$scope={dirty:s,ctx:e}),t.$set(n)}},i(e){s||(t&&(0,r.transition_in)(t.$$.fragment,e),s=!0)},o(e){t&&(0,r.transition_out)(t.$$.fragment,e),s=!1},d(e){e&&(0,r.detach)(n),t&&(0,r.destroy_component)(t,e),i=!1,(0,r.run_all)(o)}}}function y(e,t,n){return Math.min(Math.max(t,e),n)}function v(e,t,n){let s,o;(0,r.component_subscribe)(e,d,(e=>n(22,s=e))),(0,r.component_subscribe)(e,u,(e=>n(23,o=e)));let a,l,c,p,{components:f}=t,{h:m}=t,{s:g}=t,{v}=t,{isOpen:b}=t,{toRight:x}=t,{isDark:w}=t,k=!1,_=!1,C={x:100,y:0};function S(e){let t=e.offsetX,r=e.offsetY,s=a.getBoundingClientRect().width,i=a.getBoundingClientRect().height;n(0,g=100*y(t/s,0,1)),n(1,v=100*y((i-r)/i,0,1))}function A(){o.ArrowVH?l||(c=0,l=window.setInterval((()=>{let e=h(++c);n(0,g=Math.min(100,Math.max(0,g+(s.ArrowRight-s.ArrowLeft)*e*100))),n(1,v=Math.min(100,Math.max(0,v+(s.ArrowUp-s.ArrowDown)*e*100)))}),10)):l&&(clearInterval(l),l=void 0)}return e.$$set=e=>{"components"in e&&n(2,f=e.components),"h"in e&&n(3,m=e.h),"s"in e&&n(0,g=e.s),"v"in e&&n(1,v=e.v),"isOpen"in e&&n(17,b=e.isOpen),"toRight"in e&&n(4,x=e.toRight),"isDark"in e&&n(5,w=e.isDark)},e.$$.update=()=>{8&e.$$.dirty&&"number"==typeof m&&n(8,p=(0,i.Mj)({h:m,s:100,v:100,a:1}).toHex()),67&e.$$.dirty&&"number"==typeof g&&"number"==typeof v&&a&&n(9,C={x:g,y:100-v})},[g,v,f,m,x,w,a,_,p,C,function(e){0===e.button&&(k=!0,S(e))},function(){k=!1},function(e){k&&S({offsetX:Math.max(0,Math.min(a.getBoundingClientRect().width,e.clientX-a.getBoundingClientRect().left)),offsetY:Math.max(0,Math.min(a.getBoundingClientRect().height,e.clientY-a.getBoundingClientRect().top))})},function(e){e.target.isSameNode(a)||n(7,_=!1)},function(e){"Tab"===e.key&&n(7,_=!!document.activeElement?.isSameNode(a)),!e.repeat&&_&&A()},function(e){_&&o.ArrowVH&&(e.preventDefault(),e.repeat||A())},function(e){e.preventDefault(),S({offsetX:e.changedTouches[0].clientX-a.getBoundingClientRect().left,offsetY:e.changedTouches[0].clientY-a.getBoundingClientRect().top})},b,function(e){r.binding_callbacks[e?"unshift":"push"]((()=>{a=e,n(6,a)}))}]}class b extends r.SvelteComponent{constructor(e){super(),(0,r.init)(this,e,v,g,r.safe_not_equal,{components:2,h:3,s:0,v:1,isOpen:17,toRight:4,isDark:5},f)}}const x=b,{window:w}=r.globals;function k(e){(0,r.append_styles)(e,"svelte-14nweqy",".slider.svelte-14nweqy{--gradient:#ff0000, #ffff00 17.2%, #ffff00 18.2%, #00ff00 33.3%, #00ffff 49.5%, #00ffff 51.5%,\n\t\t\t#0000ff 67.7%, #ff00ff 83.3%, #ff0000;position:relative;width:100%;height:100%;background:linear-gradient(var(--gradient));outline:none;user-select:none}.to-right.svelte-14nweqy{background:linear-gradient(0.25turn, var(--gradient))}")}function _(e){let t,n,s,i,o,a,l,c;var d=e[1].sliderIndicator;function u(e,t){return{props:{pos:e[4],toRight:e[2]}}}return d&&(n=(0,r.construct_svelte_component)(d,u(e))),{c(){t=(0,r.element)("div"),n&&(0,r.create_component)(n.$$.fragment),(0,r.attr)(t,"class","slider svelte-14nweqy"),(0,r.attr)(t,"tabindex","0"),(0,r.attr)(t,"aria-label","hue picker (arrow keyboard navigation)"),(0,r.attr)(t,"aria-valuemin",s=0),(0,r.attr)(t,"aria-valuemax",i=360),(0,r.attr)(t,"aria-valuenow",o=Math.round(e[0])),(0,r.toggle_class)(t,"to-right",e[2])},m(s,i){(0,r.insert)(s,t,i),n&&(0,r.mount_component)(n,t,null),e[12](t),a=!0,l||(c=[(0,r.listen)(t,"mousedown",(0,r.prevent_default)(e[6])),(0,r.listen)(t,"touchstart",e[11]),(0,r.listen)(t,"touchmove",(0,r.prevent_default)(e[11])),(0,r.listen)(t,"touchend",e[11])],l=!0)},p(e,s){if(2&s&&d!==(d=e[1].sliderIndicator)){if(n){(0,r.group_outros)();const e=n;(0,r.transition_out)(e.$$.fragment,1,0,(()=>{(0,r.destroy_component)(e,1)})),(0,r.check_outros)()}d?(n=(0,r.construct_svelte_component)(d,u(e)),(0,r.create_component)(n.$$.fragment),(0,r.transition_in)(n.$$.fragment,1),(0,r.mount_component)(n,t,null)):n=null}else if(d){const t={};16&s&&(t.pos=e[4]),4&s&&(t.toRight=e[2]),n.$set(t)}(!a||1&s&&o!==(o=Math.round(e[0])))&&(0,r.attr)(t,"aria-valuenow",o),(!a||4&s)&&(0,r.toggle_class)(t,"to-right",e[2])},i(e){a||(n&&(0,r.transition_in)(n.$$.fragment,e),a=!0)},o(e){n&&(0,r.transition_out)(n.$$.fragment,e),a=!1},d(s){s&&(0,r.detach)(t),n&&(0,r.destroy_component)(n),e[12](null),l=!1,(0,r.run_all)(c)}}}function C(e){let t,n,s,i,o;var a=e[1].sliderWrapper;function l(e,t){return{props:{focused:e[5],toRight:e[2],$$slots:{default:[_]},$$scope:{ctx:e}}}}return a&&(t=(0,r.construct_svelte_component)(a,l(e))),{c(){t&&(0,r.create_component)(t.$$.fragment),n=(0,r.empty)()},m(a,l){t&&(0,r.mount_component)(t,a,l),(0,r.insert)(a,n,l),s=!0,i||(o=[(0,r.listen)(w,"mouseup",e[7]),(0,r.listen)(w,"mousemove",e[8]),(0,r.listen)(w,"keyup",e[9]),(0,r.listen)(w,"keydown",e[10])],i=!0)},p(e,[s]){if(2&s&&a!==(a=e[1].sliderWrapper)){if(t){(0,r.group_outros)();const e=t;(0,r.transition_out)(e.$$.fragment,1,0,(()=>{(0,r.destroy_component)(e,1)})),(0,r.check_outros)()}a?(t=(0,r.construct_svelte_component)(a,l(e)),(0,r.create_component)(t.$$.fragment),(0,r.transition_in)(t.$$.fragment,1),(0,r.mount_component)(t,n.parentNode,n)):t=null}else if(a){const n={};32&s&&(n.focused=e[5]),4&s&&(n.toRight=e[2]),1048607&s&&(n.$$scope={dirty:s,ctx:e}),t.$set(n)}},i(e){s||(t&&(0,r.transition_in)(t.$$.fragment,e),s=!0)},o(e){t&&(0,r.transition_out)(t.$$.fragment,e),s=!1},d(e){e&&(0,r.detach)(n),t&&(0,r.destroy_component)(t,e),i=!1,(0,r.run_all)(o)}}}function S(e,t,n){let s,i;(0,r.component_subscribe)(e,d,(e=>n(16,s=e))),(0,r.component_subscribe)(e,u,(e=>n(17,i=e)));let o,a,l,{components:c}=t,{toRight:p}=t,f=!1,{h:m}=t,g=0,y=!1;function v(e){const t=p?o.getBoundingClientRect().width:o.getBoundingClientRect().height,r=Math.max(0,Math.min(t,e));n(0,m=r/t*360)}function b(){i.ArrowVH?a||(l=0,a=window.setInterval((()=>{const e=h(++l),t=p?s.ArrowRight-s.ArrowLeft:s.ArrowDown-s.ArrowUp;n(0,m=Math.min(360,Math.max(0,m+360*t*e)))}),10)):a&&(clearInterval(a),a=void 0)}return e.$$set=e=>{"components"in e&&n(1,c=e.components),"toRight"in e&&n(2,p=e.toRight),"h"in e&&n(0,m=e.h)},e.$$.update=()=>{9&e.$$.dirty&&"number"==typeof m&&o&&n(4,g=100*m/360)},[m,c,p,o,g,y,function(e){0===e.button&&(f=!0,v(p?e.offsetX:e.offsetY))},function(){f=!1},function(e){f&&v(p?e.clientX-o.getBoundingClientRect().left:e.clientY-o.getBoundingClientRect().top)},function(e){"Tab"===e.key&&n(5,y=!!document.activeElement?.isSameNode(o)),!e.repeat&&y&&b()},function(e){y&&i.ArrowVH&&(e.preventDefault(),e.repeat||b())},function(e){e.preventDefault(),v(p?e.changedTouches[0].clientX-o.getBoundingClientRect().left:e.changedTouches[0].clientY-o.getBoundingClientRect().top)},function(e){r.binding_callbacks[e?"unshift":"push"]((()=>{o=e,n(3,o)}))}]}class A extends r.SvelteComponent{constructor(e){super(),(0,r.init)(this,e,S,C,r.safe_not_equal,{components:1,toRight:2,h:0},k)}}const M=A,{window:O}=r.globals;function N(e){(0,r.append_styles)(e,"svelte-f2vq53",".alpha.svelte-f2vq53:after{position:absolute;content:'';inset:0;background:linear-gradient(#00000000, var(--alpha-color));z-index:0}.to-right.svelte-f2vq53:after{background:linear-gradient(0.25turn, #00000000, var(--alpha-color))}.alpha.svelte-f2vq53{position:relative;width:100%;height:100%;background-image:linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%),\n\t\t\tlinear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%);background-size:var(--pattern-size-2x, 12px) var(--pattern-size-2x, 12px);background-position:0 0, var(--pattern-size, 6px) var(--pattern-size, 6px);outline:none;user-select:none}")}function T(e){let t,n,s,i,o,a,l,c,d;var u=e[0].alphaIndicator;function h(e,t){return{props:{pos:e[5],toRight:e[2]}}}return u&&(n=(0,r.construct_svelte_component)(u,h(e))),{c(){t=(0,r.element)("div"),n&&(0,r.create_component)(n.$$.fragment),(0,r.attr)(t,"class","alpha svelte-f2vq53"),(0,r.attr)(t,"tabindex","0"),(0,r.set_style)(t,"--alpha-color",e[1]?.substring(0,7)),(0,r.attr)(t,"aria-label","transparency picker (arrow keyboard navigation)"),(0,r.attr)(t,"aria-valuemin",s=0),(0,r.attr)(t,"aria-valuemax",i=100),(0,r.attr)(t,"aria-valuenow",o=Math.round(e[5])),(0,r.attr)(t,"aria-valuetext",a=e[5]?.toFixed()+"%"),(0,r.toggle_class)(t,"to-right",e[2])},m(s,i){(0,r.insert)(s,t,i),n&&(0,r.mount_component)(n,t,null),e[14](t),l=!0,c||(d=[(0,r.listen)(t,"mousedown",(0,r.prevent_default)(e[6])),(0,r.listen)(t,"touchstart",e[11]),(0,r.listen)(t,"touchmove",(0,r.prevent_default)(e[11])),(0,r.listen)(t,"touchend",e[11])],c=!0)},p(e,s){if(1&s&&u!==(u=e[0].alphaIndicator)){if(n){(0,r.group_outros)();const e=n;(0,r.transition_out)(e.$$.fragment,1,0,(()=>{(0,r.destroy_component)(e,1)})),(0,r.check_outros)()}u?(n=(0,r.construct_svelte_component)(u,h(e)),(0,r.create_component)(n.$$.fragment),(0,r.transition_in)(n.$$.fragment,1),(0,r.mount_component)(n,t,null)):n=null}else if(u){const t={};32&s&&(t.pos=e[5]),4&s&&(t.toRight=e[2]),n.$set(t)}(!l||2&s)&&(0,r.set_style)(t,"--alpha-color",e[1]?.substring(0,7)),(!l||32&s&&o!==(o=Math.round(e[5])))&&(0,r.attr)(t,"aria-valuenow",o),(!l||32&s&&a!==(a=e[5]?.toFixed()+"%"))&&(0,r.attr)(t,"aria-valuetext",a),(!l||4&s)&&(0,r.toggle_class)(t,"to-right",e[2])},i(e){l||(n&&(0,r.transition_in)(n.$$.fragment,e),l=!0)},o(e){n&&(0,r.transition_out)(n.$$.fragment,e),l=!1},d(s){s&&(0,r.detach)(t),n&&(0,r.destroy_component)(n),e[14](null),c=!1,(0,r.run_all)(d)}}}function $(e){let t,n,s,i,o;var a=e[0].alphaWrapper;function l(e,t){return{props:{focused:e[4],toRight:e[2],$$slots:{default:[T]},$$scope:{ctx:e}}}}return a&&(t=(0,r.construct_svelte_component)(a,l(e))),{c(){t&&(0,r.create_component)(t.$$.fragment),n=(0,r.empty)()},m(a,l){t&&(0,r.mount_component)(t,a,l),(0,r.insert)(a,n,l),s=!0,i||(o=[(0,r.listen)(O,"mouseup",e[7]),(0,r.listen)(O,"mousemove",e[8]),(0,r.listen)(O,"keyup",e[9]),(0,r.listen)(O,"keydown",e[10])],i=!0)},p(e,[s]){if(1&s&&a!==(a=e[0].alphaWrapper)){if(t){(0,r.group_outros)();const e=t;(0,r.transition_out)(e.$$.fragment,1,0,(()=>{(0,r.destroy_component)(e,1)})),(0,r.check_outros)()}a?(t=(0,r.construct_svelte_component)(a,l(e)),(0,r.create_component)(t.$$.fragment),(0,r.transition_in)(t.$$.fragment,1),(0,r.mount_component)(t,n.parentNode,n)):t=null}else if(a){const n={};16&s&&(n.focused=e[4]),4&s&&(n.toRight=e[2]),4194351&s&&(n.$$scope={dirty:s,ctx:e}),t.$set(n)}},i(e){s||(t&&(0,r.transition_in)(t.$$.fragment,e),s=!0)},o(e){t&&(0,r.transition_out)(t.$$.fragment,e),s=!1},d(e){e&&(0,r.detach)(n),t&&(0,r.destroy_component)(t,e),i=!1,(0,r.run_all)(o)}}}function E(e,t,n){let s,i;(0,r.component_subscribe)(e,d,(e=>n(18,s=e))),(0,r.component_subscribe)(e,u,(e=>n(19,i=e)));let o,a,l,c,{components:p}=t,{isOpen:f}=t,{a:m=1}=t,{hex:g}=t,{toRight:y}=t,v=!1,b=!1;function x(e){const t=y?o.getBoundingClientRect().width:o.getBoundingClientRect().height,r=Math.max(0,Math.min(t,e));n(12,m=r/t)}function w(){i.ArrowVH?a||(l=0,a=window.setInterval((()=>{const e=h(++l),t=y?s.ArrowRight-s.ArrowLeft:s.ArrowDown-s.ArrowUp;n(12,m=Math.min(1,Math.max(0,m+t*e)))}),10)):a&&(clearInterval(a),a=void 0)}return e.$$set=e=>{"components"in e&&n(0,p=e.components),"isOpen"in e&&n(13,f=e.isOpen),"a"in e&&n(12,m=e.a),"hex"in e&&n(1,g=e.hex),"toRight"in e&&n(2,y=e.toRight)},e.$$.update=()=>{4104&e.$$.dirty&&"number"==typeof m&&o&&n(5,c=100*m)},[p,g,y,o,b,c,function(e){0===e.button&&(v=!0,x(y?e.offsetX:e.offsetY))},function(){v=!1},function(e){v&&x(y?e.clientX-o.getBoundingClientRect().left:e.clientY-o.getBoundingClientRect().top)},function(e){"Tab"===e.key&&n(4,b=!!document.activeElement?.isSameNode(o)),!e.repeat&&b&&w()},function(e){b&&i.ArrowVH&&(e.preventDefault(),e.repeat||w())},function(e){e.preventDefault(),x(y?e.changedTouches[0].clientX-o.getBoundingClientRect().left:e.changedTouches[0].clientY-o.getBoundingClientRect().top)},m,f,function(e){r.binding_callbacks[e?"unshift":"push"]((()=>{o=e,n(3,o)}))}]}class D extends r.SvelteComponent{constructor(e){super(),(0,r.init)(this,e,E,$,r.safe_not_equal,{components:0,isOpen:13,a:12,hex:1,toRight:2},N)}}const R=D;function I(e){(0,r.append_styles)(e,"svelte-11z4jba",".text-input.svelte-11z4jba{display:flex;flex-direction:column;gap:10px;margin:10px 5px 5px}.input-container.svelte-11z4jba{display:flex;flex:1;gap:10px}input.svelte-11z4jba,button.svelte-11z4jba{flex:1;border:none;background-color:#eee;padding:0;border-radius:5px;height:30px;line-height:30px;text-align:center}input.svelte-11z4jba{width:5px}button.svelte-11z4jba{cursor:pointer;flex:1;margin:0;transition:background-color 0.2s}button.svelte-11z4jba:hover{background-color:#ccc}input.svelte-11z4jba:focus,button.svelte-11z4jba:focus{outline:none}input.svelte-11z4jba:focus-visible,button.svelte-11z4jba:focus-visible{outline:2px solid var(--focus-color, red);outline-offset:2px}")}function P(e){let t,n,s,i,o,a,l,c,d,u=e[2]&&B(e);return{c(){t=(0,r.element)("div"),n=(0,r.element)("input"),s=(0,r.space)(),i=(0,r.element)("input"),o=(0,r.space)(),a=(0,r.element)("input"),l=(0,r.space)(),u&&u.c(),(0,r.attr)(n,"aria-label","hue chanel color"),n.value=e[8],(0,r.attr)(n,"type","number"),(0,r.attr)(n,"min","0"),(0,r.attr)(n,"max","360"),(0,r.attr)(n,"class","svelte-11z4jba"),(0,r.attr)(i,"aria-label","saturation chanel color"),i.value=e[7],(0,r.attr)(i,"type","number"),(0,r.attr)(i,"min","0"),(0,r.attr)(i,"max","100"),(0,r.attr)(i,"class","svelte-11z4jba"),(0,r.attr)(a,"aria-label","brightness chanel color"),a.value=e[6],(0,r.attr)(a,"type","number"),(0,r.attr)(a,"min","0"),(0,r.attr)(a,"max","100"),(0,r.attr)(a,"class","svelte-11z4jba"),(0,r.attr)(t,"class","input-container svelte-11z4jba")},m(h,p){(0,r.insert)(h,t,p),(0,r.append)(t,n),(0,r.append)(t,s),(0,r.append)(t,i),(0,r.append)(t,o),(0,r.append)(t,a),(0,r.append)(t,l),u&&u.m(t,null),c||(d=[(0,r.listen)(n,"input",e[12]("h")),(0,r.listen)(i,"input",e[12]("s")),(0,r.listen)(a,"input",e[12]("v"))],c=!0)},p(e,r){256&r&&n.value!==e[8]&&(n.value=e[8]),128&r&&i.value!==e[7]&&(i.value=e[7]),64&r&&a.value!==e[6]&&(a.value=e[6]),e[2]?u?u.p(e,r):(u=B(e),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(e){e&&(0,r.detach)(t),u&&u.d(),c=!1,(0,r.run_all)(d)}}}function F(e){let t,n,s,i,o,a,l,c,d,u,h,p,f=e[2]&&z(e);return{c(){t=(0,r.element)("div"),n=(0,r.element)("input"),i=(0,r.space)(),o=(0,r.element)("input"),l=(0,r.space)(),c=(0,r.element)("input"),u=(0,r.space)(),f&&f.c(),(0,r.attr)(n,"aria-label","red chanel color"),n.value=s=e[0].r,(0,r.attr)(n,"type","number"),(0,r.attr)(n,"min","0"),(0,r.attr)(n,"max","255"),(0,r.attr)(n,"class","svelte-11z4jba"),(0,r.attr)(o,"aria-label","green chanel color"),o.value=a=e[0].g,(0,r.attr)(o,"type","number"),(0,r.attr)(o,"min","0"),(0,r.attr)(o,"max","255"),(0,r.attr)(o,"class","svelte-11z4jba"),(0,r.attr)(c,"aria-label","blue chanel color"),c.value=d=e[0].b,(0,r.attr)(c,"type","number"),(0,r.attr)(c,"min","0"),(0,r.attr)(c,"max","255"),(0,r.attr)(c,"class","svelte-11z4jba"),(0,r.attr)(t,"class","input-container svelte-11z4jba")},m(s,a){(0,r.insert)(s,t,a),(0,r.append)(t,n),(0,r.append)(t,i),(0,r.append)(t,o),(0,r.append)(t,l),(0,r.append)(t,c),(0,r.append)(t,u),f&&f.m(t,null),h||(p=[(0,r.listen)(n,"input",e[11]("r")),(0,r.listen)(o,"input",e[11]("g")),(0,r.listen)(c,"input",e[11]("b"))],h=!0)},p(e,r){1&r&&s!==(s=e[0].r)&&n.value!==s&&(n.value=s),1&r&&a!==(a=e[0].g)&&o.value!==a&&(o.value=a),1&r&&d!==(d=e[0].b)&&c.value!==d&&(c.value=d),e[2]?f?f.p(e,r):(f=z(e),f.c(),f.m(t,null)):f&&(f.d(1),f=null)},d(e){e&&(0,r.detach)(t),f&&f.d(),h=!1,(0,r.run_all)(p)}}}function L(e){let t,n,s,i,o,a=e[2]&&j(e);return{c(){t=(0,r.element)("div"),n=(0,r.element)("input"),s=(0,r.space)(),a&&a.c(),n.value=e[1],(0,r.set_style)(n,"flex","3"),(0,r.attr)(n,"class","svelte-11z4jba"),(0,r.attr)(t,"class","input-container svelte-11z4jba")},m(l,c){(0,r.insert)(l,t,c),(0,r.append)(t,n),(0,r.append)(t,s),a&&a.m(t,null),i||(o=(0,r.listen)(n,"input",e[10]),i=!0)},p(e,r){2&r&&n.value!==e[1]&&(n.value=e[1]),e[2]?a?a.p(e,r):(a=j(e),a.c(),a.m(t,null)):a&&(a.d(1),a=null)},d(e){e&&(0,r.detach)(t),a&&a.d(),i=!1,o()}}}function B(e){let t,n,s;return{c(){t=(0,r.element)("input"),(0,r.attr)(t,"aria-label","transparency chanel color"),t.value=e[5],(0,r.attr)(t,"type","number"),(0,r.attr)(t,"min","0"),(0,r.attr)(t,"max","1"),(0,r.attr)(t,"step","0.01"),(0,r.attr)(t,"class","svelte-11z4jba")},m(i,o){(0,r.insert)(i,t,o),n||(s=(0,r.listen)(t,"input",e[12]("a")),n=!0)},p(e,n){32&n&&t.value!==e[5]&&(t.value=e[5])},d(e){e&&(0,r.detach)(t),n=!1,s()}}}function z(e){let t,n,s;return{c(){t=(0,r.element)("input"),(0,r.attr)(t,"aria-label","transparency chanel color"),t.value=e[5],(0,r.attr)(t,"type","number"),(0,r.attr)(t,"min","0"),(0,r.attr)(t,"max","1"),(0,r.attr)(t,"step","0.01"),(0,r.attr)(t,"class","svelte-11z4jba")},m(i,o){(0,r.insert)(i,t,o),n||(s=(0,r.listen)(t,"input",e[11]("a")),n=!0)},p(e,n){32&n&&t.value!==e[5]&&(t.value=e[5])},d(e){e&&(0,r.detach)(t),n=!1,s()}}}function j(e){let t,n,s;return{c(){t=(0,r.element)("input"),(0,r.attr)(t,"aria-label","hexadecimal color"),t.value=e[5],(0,r.attr)(t,"type","number"),(0,r.attr)(t,"min","0"),(0,r.attr)(t,"max","1"),(0,r.attr)(t,"step","0.01"),(0,r.attr)(t,"class","svelte-11z4jba")},m(i,o){(0,r.insert)(i,t,o),n||(s=(0,r.listen)(t,"input",e[11]("a")),n=!0)},p(e,n){32&n&&t.value!==e[5]&&(t.value=e[5])},d(e){e&&(0,r.detach)(t),n=!1,s()}}}function V(e){let t,n,s,i,o,a=e[9][e[4]]+"";return{c(){t=(0,r.element)("button"),n=(0,r.text)(a),(0,r.attr)(t,"aria-label",s="change inputs to "+e[9][(e[4]+1)%3]),(0,r.attr)(t,"class","svelte-11z4jba")},m(s,a){(0,r.insert)(s,t,a),(0,r.append)(t,n),i||(o=(0,r.listen)(t,"click",e[14]),i=!0)},p(e,i){16&i&&a!==(a=e[9][e[4]]+"")&&(0,r.set_data)(n,a),16&i&&s!==(s="change inputs to "+e[9][(e[4]+1)%3])&&(0,r.attr)(t,"aria-label",s)},d(e){e&&(0,r.detach)(t),i=!1,o()}}}function H(e){let t,n;function s(e,t){return 0===e[4]?L:1===e[4]?F:P}let i=s(e),o=i(e),a=e[3]&&V(e);return{c(){t=(0,r.element)("div"),o.c(),n=(0,r.space)(),a&&a.c(),(0,r.attr)(t,"class","text-input svelte-11z4jba")},m(e,s){(0,r.insert)(e,t,s),o.m(t,null),(0,r.append)(t,n),a&&a.m(t,null)},p(e,[r]){i===(i=s(e))&&o?o.p(e,r):(o.d(1),o=i(e),o&&(o.c(),o.m(t,n))),e[3]?a?a.p(e,r):(a=V(e),a.c(),a.m(t,null)):a&&(a.d(1),a=null)},i:r.noop,o:r.noop,d(e){e&&(0,r.detach)(t),o.d(),a&&a.d()}}}const U=/^#?([A-F0-9]{6}|[A-F0-9]{8})$/i;function q(e,t,n){let r,s,i,o,{isAlpha:a}=t,{rgb:l}=t,{hsv:c}=t,{hex:d}=t,{canChangeMode:u}=t,h=0;return e.$$set=e=>{"isAlpha"in e&&n(2,a=e.isAlpha),"rgb"in e&&n(0,l=e.rgb),"hsv"in e&&n(13,c=e.hsv),"hex"in e&&n(1,d=e.hex),"canChangeMode"in e&&n(3,u=e.canChangeMode)},e.$$.update=()=>{8192&e.$$.dirty&&n(8,r=Math.round(c.h)),8192&e.$$.dirty&&n(7,s=Math.round(c.s)),8192&e.$$.dirty&&n(6,i=Math.round(c.v)),8192&e.$$.dirty&&n(5,o=void 0===c.a?1:Math.round(100*c.a)/100)},[l,d,a,u,h,o,i,s,r,["HEX","RGB","HSV"],function(e){const t=e.target;U.test(t.value)&&n(1,d=t.value)},function(e){return function(t){n(0,l={...l,[e]:parseFloat(t.target.value)})}},function(e){return function(t){n(13,c={...c,[e]:parseFloat(t.target.value)})}},c,()=>n(4,h=(h+1)%3)]}class K extends r.SvelteComponent{constructor(e){super(),(0,r.init)(this,e,q,H,r.safe_not_equal,{isAlpha:2,rgb:0,hsv:13,hex:1,canChangeMode:3},I)}}const Z=K;function J(e){(0,r.append_styles)(e,"svelte-13znx8u","div.svelte-13znx8u{position:absolute;width:9.5px;height:9.5px;background-color:white;border-radius:5px;margin-left:1.5px;pointer-events:none;z-index:1;border:1px solid black;box-sizing:border-box}")}function W(e){let t;return{c(){t=(0,r.element)("div"),(0,r.attr)(t,"class","slider-indicator svelte-13znx8u"),(0,r.set_style)(t,"top",e[0])},m(e,n){(0,r.insert)(e,t,n)},p(e,[n]){1&n&&(0,r.set_style)(t,"top",e[0])},i:r.noop,o:r.noop,d(e){e&&(0,r.detach)(t)}}}function G(e,t,n){let r,{pos:s}=t,{toRight:i}=t;return e.$$set=e=>{"pos"in e&&n(1,s=e.pos),"toRight"in e&&n(2,i=e.toRight)},e.$$.update=()=>{2&e.$$.dirty&&n(0,r=`calc(${s} * (var(--picker-height, 200px) - 14px) / 100 + 2px)`)},[r,s,i]}class Y extends r.SvelteComponent{constructor(e){super(),(0,r.init)(this,e,G,W,r.safe_not_equal,{pos:1,toRight:2},J)}}const X=Y;function Q(e){(0,r.append_styles)(e,"svelte-1nw247x","div.svelte-1nw247x{position:absolute;width:10px;height:10px;background-color:white;border-radius:5px;pointer-events:none;z-index:1;transition:box-shadow 0.2s}")}function ee(e){let t,n;return{c(){t=(0,r.element)("div"),(0,r.attr)(t,"class","picker-indicator svelte-1nw247x"),(0,r.attr)(t,"style",n=`left: ${e[2]}; top: ${e[1]}; box-shadow: 0 0 4px ${e[0]?"white":"black"};`)},m(e,n){(0,r.insert)(e,t,n)},p(e,[s]){7&s&&n!==(n=`left: ${e[2]}; top: ${e[1]}; box-shadow: 0 0 4px ${e[0]?"white":"black"};`)&&(0,r.attr)(t,"style",n)},i:r.noop,o:r.noop,d(e){e&&(0,r.detach)(t)}}}function te(e,t,n){let r,s,{pos:i}=t,{hex:o}=t,{isDark:a}=t;return e.$$set=e=>{"pos"in e&&n(3,i=e.pos),"hex"in e&&n(4,o=e.hex),"isDark"in e&&n(0,a=e.isDark)},e.$$.update=()=>{8&e.$$.dirty&&n(2,r=`calc(${i.x} * (var(--picker-width, 200px) - 14px) / 100 + 2px)`),8&e.$$.dirty&&n(1,s=`calc(${i.y} * (var(--picker-height, 200px) - 14px) / 100 + 2px)`)},[a,s,r,i,o]}class ne extends r.SvelteComponent{constructor(e){super(),(0,r.init)(this,e,te,ee,r.safe_not_equal,{pos:3,hex:4,isDark:0},Q)}}const re=ne;function se(e){let t,n;return{c:r.noop,m(s,i){t||(n=[(0,r.listen)(window,"keyup",e[0]),(0,r.listen)(window,"keydown",e[1])],t=!0)},p:r.noop,i:r.noop,o:r.noop,d(e){t=!1,(0,r.run_all)(n)}}}function ie(e,t,n){let s;return(0,r.component_subscribe)(e,d,(e=>n(2,s=e))),[function(e){["ArrowLeft","ArrowUp","ArrowRight","ArrowDown"].includes(e.key)&&((0,r.set_store_value)(d,s[e.key]=0,s),d.set(s))},function(e){["ArrowLeft","ArrowUp","ArrowRight","ArrowDown"].includes(e.key)&&(e.repeat||((0,r.set_store_value)(d,s[e.key]=1,s),d.set(s)))}]}class oe extends r.SvelteComponent{constructor(e){super(),(0,r.init)(this,e,ie,se,r.safe_not_equal,{})}}const ae=oe;function le(e){(0,r.append_styles)(e,"svelte-1hhmcjg","div.svelte-1hhmcjg{display:inline-block;margin-right:5px;width:var(--picker-width, 200px);height:var(--picker-height, 200px);border-radius:8px;overflow:hidden;outline:2px solid transparent;outline-offset:3px;transition:outline 0.2s ease-in-out;user-select:none}div.focused.svelte-1hhmcjg{outline:2px solid var(--focus-color, red)}")}function ce(e){let t,n;const s=e[3].default,i=(0,r.create_slot)(s,e,e[2],null);return{c(){t=(0,r.element)("div"),i&&i.c(),(0,r.attr)(t,"class","picker-wrapper svelte-1hhmcjg"),(0,r.toggle_class)(t,"focused",e[0])},m(e,s){(0,r.insert)(e,t,s),i&&i.m(t,null),n=!0},p(e,[o]){i&&i.p&&(!n||4&o)&&(0,r.update_slot_base)(i,s,e,e[2],n?(0,r.get_slot_changes)(s,e[2],o,null):(0,r.get_all_dirty_from_scope)(e[2]),null),(!n||1&o)&&(0,r.toggle_class)(t,"focused",e[0])},i(e){n||((0,r.transition_in)(i,e),n=!0)},o(e){(0,r.transition_out)(i,e),n=!1},d(e){e&&(0,r.detach)(t),i&&i.d(e)}}}function de(e,t,n){let{$$slots:r={},$$scope:s}=t,{focused:i}=t,{toRight:o}=t;return e.$$set=e=>{"focused"in e&&n(0,i=e.focused),"toRight"in e&&n(1,o=e.toRight),"$$scope"in e&&n(2,s=e.$$scope)},[i,o,s,r]}class ue extends r.SvelteComponent{constructor(e){super(),(0,r.init)(this,e,de,ce,r.safe_not_equal,{focused:0,toRight:1},le)}}const he=ue;function pe(e){(0,r.append_styles)(e,"svelte-1udewng","div.svelte-1udewng{display:inline-block;margin-right:5px;width:var(--slider-width, 12px);height:var(--picker-height, 200px);border-radius:6px;overflow:hidden;user-select:none;outline:2px solid transparent;outline-offset:3px;transition:outline 0.2s ease-in-out}div.focused.svelte-1udewng{outline:2px solid var(--focus-color, red)}")}function fe(e){let t,n;const s=e[3].default,i=(0,r.create_slot)(s,e,e[2],null);return{c(){t=(0,r.element)("div"),i&&i.c(),(0,r.attr)(t,"class","slider-wrapper svelte-1udewng"),(0,r.toggle_class)(t,"focused",e[0])},m(e,s){(0,r.insert)(e,t,s),i&&i.m(t,null),n=!0},p(e,[o]){i&&i.p&&(!n||4&o)&&(0,r.update_slot_base)(i,s,e,e[2],n?(0,r.get_slot_changes)(s,e[2],o,null):(0,r.get_all_dirty_from_scope)(e[2]),null),(!n||1&o)&&(0,r.toggle_class)(t,"focused",e[0])},i(e){n||((0,r.transition_in)(i,e),n=!0)},o(e){(0,r.transition_out)(i,e),n=!1},d(e){e&&(0,r.detach)(t),i&&i.d(e)}}}function me(e,t,n){let{$$slots:r={},$$scope:s}=t,{focused:i}=t,{toRight:o}=t;return e.$$set=e=>{"focused"in e&&n(0,i=e.focused),"toRight"in e&&n(1,o=e.toRight),"$$scope"in e&&n(2,s=e.$$scope)},[i,o,s,r]}class ge extends r.SvelteComponent{constructor(e){super(),(0,r.init)(this,e,me,fe,r.safe_not_equal,{focused:0,toRight:1},pe)}}const ye=ge;function ve(e){(0,r.append_styles)(e,"svelte-2ybi8r","label.svelte-2ybi8r{display:flex;align-items:center;gap:8px;cursor:pointer;border-radius:3px;margin:4px}.container.svelte-2ybi8r{position:relative;display:block;display:flex;align-items:center;justify-content:center}input.svelte-2ybi8r{margin:0;padding:0;border:none;width:4px;height:4px;flex-shrink:0;cursor:pointer;border-radius:50%;margin:0 12px}.alpha.svelte-2ybi8r{clip-path:circle(50%);background-image:linear-gradient(\n\t\t\t\tto right,\n\t\t\t\trgba(238, 238, 238, 0.75),\n\t\t\t\trgba(238, 238, 238, 0.75)\n\t\t\t),\n\t\t\tlinear-gradient(to right, black 50%, white 50%),\n\t\t\tlinear-gradient(to bottom, black 50%, white 50%);background-blend-mode:normal, difference, normal;background-size:12px 12px}.alpha.svelte-2ybi8r,.color.svelte-2ybi8r{position:absolute;width:30px;height:30px;border-radius:15px;user-select:none}input.svelte-2ybi8r:focus{outline:2px solid var(--focus-color, red);outline-offset:15px}")}function be(e){let t,n,s,i,o,a,l,c,d,u,h;return{c(){t=(0,r.element)("label"),n=(0,r.element)("div"),s=(0,r.element)("input"),i=(0,r.space)(),o=(0,r.element)("div"),a=(0,r.space)(),l=(0,r.element)("div"),c=(0,r.space)(),d=(0,r.text)(e[2]),(0,r.attr)(s,"type","color"),s.value=e[1],(0,r.attr)(s,"aria-haspopup","dialog"),(0,r.attr)(s,"class","svelte-2ybi8r"),(0,r.attr)(o,"class","alpha svelte-2ybi8r"),(0,r.attr)(l,"class","color svelte-2ybi8r"),(0,r.set_style)(l,"background",e[1]),(0,r.attr)(n,"class","container svelte-2ybi8r"),(0,r.attr)(t,"class","svelte-2ybi8r")},m(p,f){(0,r.insert)(p,t,f),(0,r.append)(t,n),(0,r.append)(n,s),(0,r.append)(n,i),(0,r.append)(n,o),(0,r.append)(n,a),(0,r.append)(n,l),(0,r.append)(t,c),(0,r.append)(t,d),e[4](t),u||(h=[(0,r.listen)(s,"click",(0,r.prevent_default)(xe)),(0,r.listen)(s,"mousedown",(0,r.prevent_default)(we)),(0,r.listen)(t,"click",(0,r.prevent_default)(ke)),(0,r.listen)(t,"mousedown",(0,r.prevent_default)(_e))],u=!0)},p(e,[t]){2&t&&(s.value=e[1]),2&t&&(0,r.set_style)(l,"background",e[1]),4&t&&(0,r.set_data)(d,e[2])},i:r.noop,o:r.noop,d(n){n&&(0,r.detach)(t),e[4](null),u=!1,(0,r.run_all)(h)}}}const xe=()=>{},we=()=>{},ke=()=>{},_e=()=>{};function Ce(e,t,n){let{labelWrapper:s}=t,{hex:i}=t,{label:o}=t,{isOpen:a}=t;return e.$$set=e=>{"labelWrapper"in e&&n(0,s=e.labelWrapper),"hex"in e&&n(1,i=e.hex),"label"in e&&n(2,o=e.label),"isOpen"in e&&n(3,a=e.isOpen)},[s,i,o,a,function(e){r.binding_callbacks[e?"unshift":"push"]((()=>{s=e,n(0,s)}))}]}class Se extends r.SvelteComponent{constructor(e){super(),(0,r.init)(this,e,Ce,be,r.safe_not_equal,{labelWrapper:0,hex:1,label:2,isOpen:3},ve)}}const Ae=Se;function Me(e){(0,r.append_styles)(e,"svelte-6lhts","div.svelte-6lhts{padding:8px 5px 5px 8px;background-color:white;margin:0 10px 10px;border:1px solid black;border-radius:12px;display:none;width:max-content}.isOpen.svelte-6lhts{display:block}.isPopup.svelte-6lhts{position:absolute;top:30px;z-index:var(--picker-z-index, 2)}")}function Oe(e){let t,n,s;const i=e[5].default,o=(0,r.create_slot)(i,e,e[4],null);return{c(){t=(0,r.element)("div"),o&&o.c(),(0,r.attr)(t,"class","wrapper svelte-6lhts"),(0,r.attr)(t,"role",n=e[2]?"dialog":void 0),(0,r.attr)(t,"aria-label","color picker"),(0,r.toggle_class)(t,"isOpen",e[1]),(0,r.toggle_class)(t,"isPopup",e[2])},m(n,i){(0,r.insert)(n,t,i),o&&o.m(t,null),e[6](t),s=!0},p(e,[a]){o&&o.p&&(!s||16&a)&&(0,r.update_slot_base)(o,i,e,e[4],s?(0,r.get_slot_changes)(i,e[4],a,null):(0,r.get_all_dirty_from_scope)(e[4]),null),(!s||4&a&&n!==(n=e[2]?"dialog":void 0))&&(0,r.attr)(t,"role",n),(!s||2&a)&&(0,r.toggle_class)(t,"isOpen",e[1]),(!s||4&a)&&(0,r.toggle_class)(t,"isPopup",e[2])},i(e){s||((0,r.transition_in)(o,e),s=!0)},o(e){(0,r.transition_out)(o,e),s=!1},d(n){n&&(0,r.detach)(t),o&&o.d(n),e[6](null)}}}function Ne(e,t,n){let{$$slots:s={},$$scope:i}=t,{wrapper:o}=t,{isOpen:a}=t,{isPopup:l}=t,{toRight:c}=t;return e.$$set=e=>{"wrapper"in e&&n(0,o=e.wrapper),"isOpen"in e&&n(1,a=e.isOpen),"isPopup"in e&&n(2,l=e.isPopup),"toRight"in e&&n(3,c=e.toRight),"$$scope"in e&&n(4,i=e.$$scope)},[o,a,l,c,i,s,function(e){r.binding_callbacks[e?"unshift":"push"]((()=>{o=e,n(0,o)}))}]}class Te extends r.SvelteComponent{constructor(e){super(),(0,r.init)(this,e,Ne,Oe,r.safe_not_equal,{wrapper:0,isOpen:1,isPopup:2,toRight:3},Me)}}const $e=Te;function Ee(e){(0,r.append_styles)(e,"svelte-1s4dluu","details.svelte-1s4dluu.svelte-1s4dluu{width:245px;margin:8px auto}summary.svelte-1s4dluu.svelte-1s4dluu{margin-bottom:8px;cursor:pointer;transition:color 0.2s}summary.svelte-1s4dluu.svelte-1s4dluu:hover{color:blue}.not-closable.svelte-1s4dluu summary.svelte-1s4dluu{pointer-events:none}.not-closable.svelte-1s4dluu summary.svelte-1s4dluu{list-style:none}.svelte-1s4dluu.svelte-1s4dluu:focus-visible,span.svelte-1s4dluu :focus-visible{border-radius:2px;outline:2px solid var(--focus-color, red);outline-offset:2px}")}function De(e,t,n){const r=e.slice();return r[9]=t[n].contrast,r[10]=t[n].hex,r[11]=t[n].placeholder,r[12]=t[n].reverse,r[13]=t[n].size,r}function Re(e){let t,n,s;var i=e[0].a11ySingleNotice;function o(e,t){return{props:{contrast:e[9],textColor:e[12]?e[10]:e[1],bgColor:e[12]?e[1]:e[10],placeholder:e[11],size:e[13]}}}return i&&(t=(0,r.construct_svelte_component)(i,o(e))),{c(){t&&(0,r.create_component)(t.$$.fragment),n=(0,r.empty)()},m(e,i){t&&(0,r.mount_component)(t,e,i),(0,r.insert)(e,n,i),s=!0},p(e,s){if(1&s&&i!==(i=e[0].a11ySingleNotice)){if(t){(0,r.group_outros)();const e=t;(0,r.transition_out)(e.$$.fragment,1,0,(()=>{(0,r.destroy_component)(e,1)})),(0,r.check_outros)()}i?(t=(0,r.construct_svelte_component)(i,o(e)),(0,r.create_component)(t.$$.fragment),(0,r.transition_in)(t.$$.fragment,1),(0,r.mount_component)(t,n.parentNode,n)):t=null}else if(i){const n={};16&s&&(n.contrast=e[9]),18&s&&(n.textColor=e[12]?e[10]:e[1]),18&s&&(n.bgColor=e[12]?e[1]:e[10]),16&s&&(n.placeholder=e[11]),16&s&&(n.size=e[13]),t.$set(n)}},i(e){s||(t&&(0,r.transition_in)(t.$$.fragment,e),s=!0)},o(e){t&&(0,r.transition_out)(t.$$.fragment,e),s=!1},d(e){e&&(0,r.detach)(n),t&&(0,r.destroy_component)(t,e)}}}function Ie(e){let t;return{c(){t=(0,r.element)("span"),(0,r.attr)(t,"class","svelte-1s4dluu")},m(n,s){(0,r.insert)(n,t,s),t.innerHTML=e[2]},p(e,n){4&n&&(t.innerHTML=e[2])},d(e){e&&(0,r.detach)(t)}}}function Pe(e){let t,n,s,i,o,a,l,c,d;var u=e[0].a11ySummary;function h(e,t){return{props:{a11yColors:e[4],hex:e[1]}}}u&&(s=(0,r.construct_svelte_component)(u,h(e)));let p=(0,r.ensure_array_like)(e[4]),f=[];for(let t=0;t<p.length;t+=1)f[t]=Re(De(e,p,t));const m=e=>(0,r.transition_out)(f[e],1,1,(()=>{f[e]=null}));let g=e[2]&&Ie(e);return{c(){t=(0,r.element)("details"),n=(0,r.element)("summary"),s&&(0,r.create_component)(s.$$.fragment),o=(0,r.space)(),a=(0,r.element)("div");for(let e=0;e<f.length;e+=1)f[e].c();l=(0,r.space)(),g&&g.c(),(0,r.attr)(n,"tabindex",i=e[5]?-1:void 0),(0,r.attr)(n,"class","svelte-1s4dluu"),(0,r.attr)(a,"class","svelte-1s4dluu"),(0,r.attr)(t,"class",c="a11y-notice "+(e[5]?"not-closable":"")+" svelte-1s4dluu"),t.open=e[3]},m(e,i){(0,r.insert)(e,t,i),(0,r.append)(t,n),s&&(0,r.mount_component)(s,n,null),(0,r.append)(t,o),(0,r.append)(t,a);for(let e=0;e<f.length;e+=1)f[e]&&f[e].m(a,null);(0,r.append)(a,l),g&&g.m(a,null),d=!0},p(e,[o]){if(1&o&&u!==(u=e[0].a11ySummary)){if(s){(0,r.group_outros)();const e=s;(0,r.transition_out)(e.$$.fragment,1,0,(()=>{(0,r.destroy_component)(e,1)})),(0,r.check_outros)()}u?(s=(0,r.construct_svelte_component)(u,h(e)),(0,r.create_component)(s.$$.fragment),(0,r.transition_in)(s.$$.fragment,1),(0,r.mount_component)(s,n,null)):s=null}else if(u){const t={};16&o&&(t.a11yColors=e[4]),2&o&&(t.hex=e[1]),s.$set(t)}if((!d||32&o&&i!==(i=e[5]?-1:void 0))&&(0,r.attr)(n,"tabindex",i),19&o){let t;for(p=(0,r.ensure_array_like)(e[4]),t=0;t<p.length;t+=1){const n=De(e,p,t);f[t]?(f[t].p(n,o),(0,r.transition_in)(f[t],1)):(f[t]=Re(n),f[t].c(),(0,r.transition_in)(f[t],1),f[t].m(a,l))}for((0,r.group_outros)(),t=p.length;t<f.length;t+=1)m(t);(0,r.check_outros)()}e[2]?g?g.p(e,o):(g=Ie(e),g.c(),g.m(a,null)):g&&(g.d(1),g=null),(!d||32&o&&c!==(c="a11y-notice "+(e[5]?"not-closable":"")+" svelte-1s4dluu"))&&(0,r.attr)(t,"class",c),(!d||8&o)&&(t.open=e[3])},i(e){if(!d){s&&(0,r.transition_in)(s.$$.fragment,e);for(let e=0;e<p.length;e+=1)(0,r.transition_in)(f[e]);d=!0}},o(e){s&&(0,r.transition_out)(s.$$.fragment,e),f=f.filter(Boolean);for(let e=0;e<f.length;e+=1)(0,r.transition_out)(f[e]);d=!1},d(e){e&&(0,r.detach)(t),s&&(0,r.destroy_component)(s),(0,r.destroy_each)(f,e),g&&g.d()}}}function Fe(e,t,n){let r,s,{components:i}=t,{a11yColors:o}=t,{hex:a}=t,{color:l}=t,{a11yGuidelines:c}=t,{isA11yOpen:d}=t,{isA11yClosable:u}=t;return e.$$set=e=>{"components"in e&&n(0,i=e.components),"a11yColors"in e&&n(6,o=e.a11yColors),"hex"in e&&n(1,a=e.hex),"color"in e&&n(7,l=e.color),"a11yGuidelines"in e&&n(2,c=e.a11yGuidelines),"isA11yOpen"in e&&n(3,d=e.isA11yOpen),"isA11yClosable"in e&&n(8,u=e.isA11yClosable)},e.$$.update=()=>{264&e.$$.dirty&&n(5,r=d&&!u),192&e.$$.dirty&&n(4,s=o.map((e=>({...e,contrast:l?.contrast(e.hex)}))))},[i,a,c,d,s,r,o,l,u]}class Le extends r.SvelteComponent{constructor(e){super(),(0,r.init)(this,e,Fe,Pe,r.safe_not_equal,{components:0,a11yColors:6,hex:1,color:7,a11yGuidelines:2,isA11yOpen:3,isA11yClosable:8},Ee)}}const Be=Le;function ze(e){(0,r.append_styles)(e,"svelte-obnxge",".a11y-single-notice.svelte-obnxge.svelte-obnxge{display:flex;align-items:center;margin:4px 0;gap:12px;height:48px}.large.svelte-obnxge.svelte-obnxge{font-size:22px}.score.svelte-obnxge.svelte-obnxge{width:95px;flex-shrink:0;margin-bottom:10px}.score.svelte-obnxge p.svelte-obnxge{margin-bottom:2px}.grade.svelte-obnxge.svelte-obnxge{border-radius:50px;padding:2px 8px;background-color:orange;font-weight:bold}.grade-ok.svelte-obnxge.svelte-obnxge{background-color:green;color:white}p.svelte-obnxge.svelte-obnxge{margin:0}.lorem.svelte-obnxge.svelte-obnxge{flex:1;text-align:center;padding:4px 8px;border-radius:4px;border:1px solid black;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}")}function je(e){let t,n,s,i,o,a,l,c,d,u,h,p,f,m=(e[2]||"Lorem Ipsum")+"",g=(e[3]>=10?e[3].toFixed(1):e[3])+"";return{c(){t=(0,r.element)("div"),n=(0,r.element)("p"),s=(0,r.text)(m),o=(0,r.space)(),a=(0,r.element)("div"),l=(0,r.element)("p"),c=(0,r.text)("contrast: "),d=(0,r.text)(g),u=(0,r.space)(),h=(0,r.element)("span"),h.textContent="AA",p=(0,r.space)(),f=(0,r.element)("span"),f.textContent="AAA",(0,r.attr)(n,"class",i="lorem "+("large"===e[4]&&"large")+" svelte-obnxge"),(0,r.set_style)(n,"color",e[0]),(0,r.set_style)(n,"background-color",e[1]),(0,r.attr)(l,"class","svelte-obnxge"),(0,r.attr)(h,"class","grade svelte-obnxge"),(0,r.toggle_class)(h,"grade-ok",e[3]>("large"===e[4]?3:4.5)),(0,r.attr)(f,"class","grade svelte-obnxge"),(0,r.toggle_class)(f,"grade-ok",e[3]>("large"===e[4]?4.5:7)),(0,r.attr)(a,"class","score svelte-obnxge"),(0,r.attr)(t,"class","a11y-single-notice svelte-obnxge")},m(e,i){(0,r.insert)(e,t,i),(0,r.append)(t,n),(0,r.append)(n,s),(0,r.append)(t,o),(0,r.append)(t,a),(0,r.append)(a,l),(0,r.append)(l,c),(0,r.append)(l,d),(0,r.append)(a,u),(0,r.append)(a,h),(0,r.append)(a,p),(0,r.append)(a,f)},p(e,[t]){4&t&&m!==(m=(e[2]||"Lorem Ipsum")+"")&&(0,r.set_data)(s,m),16&t&&i!==(i="lorem "+("large"===e[4]&&"large")+" svelte-obnxge")&&(0,r.attr)(n,"class",i),1&t&&(0,r.set_style)(n,"color",e[0]),2&t&&(0,r.set_style)(n,"background-color",e[1]),8&t&&g!==(g=(e[3]>=10?e[3].toFixed(1):e[3])+"")&&(0,r.set_data)(d,g),24&t&&(0,r.toggle_class)(h,"grade-ok",e[3]>("large"===e[4]?3:4.5)),24&t&&(0,r.toggle_class)(f,"grade-ok",e[3]>("large"===e[4]?4.5:7))},i:r.noop,o:r.noop,d(e){e&&(0,r.detach)(t)}}}function Ve(e,t,n){let{textColor:r}=t,{bgColor:s}=t,{placeholder:i}=t,{contrast:o=1}=t,{size:a}=t;return e.$$set=e=>{"textColor"in e&&n(0,r=e.textColor),"bgColor"in e&&n(1,s=e.bgColor),"placeholder"in e&&n(2,i=e.placeholder),"contrast"in e&&n(3,o=e.contrast),"size"in e&&n(4,a=e.size)},[r,s,i,o,a]}class He extends r.SvelteComponent{constructor(e){super(),(0,r.init)(this,e,Ve,je,r.safe_not_equal,{textColor:0,bgColor:1,placeholder:2,contrast:3,size:4},ze)}}const Ue=He;function qe(e){let t;return{c(){t=(0,r.text)(e[0])},m(e,n){(0,r.insert)(e,t,n)},p(e,[n]){1&n&&(0,r.set_data)(t,e[0])},i:r.noop,o:r.noop,d(e){e&&(0,r.detach)(t)}}}function Ke({contrast:e,size:t}){return e?"large"===t?e<3?2:e<4.5?1:0:e<4.5?2:e<7?1:0:1}function Ze(e,t,n){let r,s,{a11yColors:i}=t,{hex:o}=t;return e.$$set=e=>{"a11yColors"in e&&n(1,i=e.a11yColors),"hex"in e&&n(2,o=e.hex)},e.$$.update=()=>{2&e.$$.dirty&&n(3,r=i.map(Ke).reduce(((e,t)=>e+t))),8&e.$$.dirty&&n(0,s=r?`⚠️ ${r} contrast grade${r&&"s"} fail`:"Contrast grade information")},[s,i,o,r]}class Je extends r.SvelteComponent{constructor(e){super(),(0,r.init)(this,e,Ze,qe,r.safe_not_equal,{a11yColors:1,hex:2})}}const We=Je;function Ge(e){(0,r.append_styles)(e,"svelte-7ntk55","span.svelte-7ntk55{position:relative}")}function Ye(e){let t;return{c(){t=(0,r.element)("input"),(0,r.attr)(t,"type","hidden"),t.value=e[2]},m(e,n){(0,r.insert)(e,t,n)},p(e,n){4&n[0]&&(t.value=e[2])},i:r.noop,o:r.noop,d(e){e&&(0,r.detach)(t)}}}function Xe(e){let t,n,s,i,o;function a(t){e[26](t)}function l(t){e[27](t)}var c=e[21]().input;function d(e,t){let n={hex:e[2],label:e[6]};return void 0!==e[19]&&(n.labelWrapper=e[19]),void 0!==e[3]&&(n.isOpen=e[3]),{props:n}}return c&&(t=(0,r.construct_svelte_component)(c,d(e)),r.binding_callbacks.push((()=>(0,r.bind)(t,"labelWrapper",a))),r.binding_callbacks.push((()=>(0,r.bind)(t,"isOpen",l)))),{c(){t&&(0,r.create_component)(t.$$.fragment),i=(0,r.empty)()},m(e,n){t&&(0,r.mount_component)(t,e,n),(0,r.insert)(e,i,n),o=!0},p(e,o){if(c!==(c=e[21]().input)){if(t){(0,r.group_outros)();const e=t;(0,r.transition_out)(e.$$.fragment,1,0,(()=>{(0,r.destroy_component)(e,1)})),(0,r.check_outros)()}c?(t=(0,r.construct_svelte_component)(c,d(e)),r.binding_callbacks.push((()=>(0,r.bind)(t,"labelWrapper",a))),r.binding_callbacks.push((()=>(0,r.bind)(t,"isOpen",l))),(0,r.create_component)(t.$$.fragment),(0,r.transition_in)(t.$$.fragment,1),(0,r.mount_component)(t,i.parentNode,i)):t=null}else if(c){const i={};4&o[0]&&(i.hex=e[2]),64&o[0]&&(i.label=e[6]),!n&&524288&o[0]&&(n=!0,i.labelWrapper=e[19],(0,r.add_flush_callback)((()=>n=!1))),!s&&8&o[0]&&(s=!0,i.isOpen=e[3],(0,r.add_flush_callback)((()=>s=!1))),t.$set(i)}},i(e){o||(t&&(0,r.transition_in)(t.$$.fragment,e),o=!0)},o(e){t&&(0,r.transition_out)(t.$$.fragment,e),o=!1},d(e){e&&(0,r.detach)(i),t&&(0,r.destroy_component)(t,e)}}}function Qe(e){let t,n,s,i;function o(t){e[32](t)}function a(t){e[33](t)}let l={components:e[21](),hex:e[2],toRight:e[17]};return void 0!==e[1].a&&(l.a=e[1].a),void 0!==e[3]&&(l.isOpen=e[3]),t=new R({props:l}),r.binding_callbacks.push((()=>(0,r.bind)(t,"a",o))),r.binding_callbacks.push((()=>(0,r.bind)(t,"isOpen",a))),{c(){(0,r.create_component)(t.$$.fragment)},m(e,n){(0,r.mount_component)(t,e,n),i=!0},p(e,i){const o={};4&i[0]&&(o.hex=e[2]),131072&i[0]&&(o.toRight=e[17]),!n&&2&i[0]&&(n=!0,o.a=e[1].a,(0,r.add_flush_callback)((()=>n=!1))),!s&&8&i[0]&&(s=!0,o.isOpen=e[3],(0,r.add_flush_callback)((()=>s=!1))),t.$set(o)},i(e){i||((0,r.transition_in)(t.$$.fragment,e),i=!0)},o(e){(0,r.transition_out)(t.$$.fragment,e),i=!1},d(e){(0,r.destroy_component)(t,e)}}}function et(e){let t,n,s,i,o,a;function l(t){e[34](t)}function c(t){e[35](t)}function d(t){e[36](t)}var u=e[21]().textInput;function h(e,t){let n={isAlpha:e[7],canChangeMode:e[10]};return void 0!==e[2]&&(n.hex=e[2]),void 0!==e[0]&&(n.rgb=e[0]),void 0!==e[1]&&(n.hsv=e[1]),{props:n}}return u&&(t=(0,r.construct_svelte_component)(u,h(e)),r.binding_callbacks.push((()=>(0,r.bind)(t,"hex",l))),r.binding_callbacks.push((()=>(0,r.bind)(t,"rgb",c))),r.binding_callbacks.push((()=>(0,r.bind)(t,"hsv",d)))),{c(){t&&(0,r.create_component)(t.$$.fragment),o=(0,r.empty)()},m(e,n){t&&(0,r.mount_component)(t,e,n),(0,r.insert)(e,o,n),a=!0},p(e,a){if(u!==(u=e[21]().textInput)){if(t){(0,r.group_outros)();const e=t;(0,r.transition_out)(e.$$.fragment,1,0,(()=>{(0,r.destroy_component)(e,1)})),(0,r.check_outros)()}u?(t=(0,r.construct_svelte_component)(u,h(e)),r.binding_callbacks.push((()=>(0,r.bind)(t,"hex",l))),r.binding_callbacks.push((()=>(0,r.bind)(t,"rgb",c))),r.binding_callbacks.push((()=>(0,r.bind)(t,"hsv",d))),(0,r.create_component)(t.$$.fragment),(0,r.transition_in)(t.$$.fragment,1),(0,r.mount_component)(t,o.parentNode,o)):t=null}else if(u){const o={};128&a[0]&&(o.isAlpha=e[7]),1024&a[0]&&(o.canChangeMode=e[10]),!n&&4&a[0]&&(n=!0,o.hex=e[2],(0,r.add_flush_callback)((()=>n=!1))),!s&&1&a[0]&&(s=!0,o.rgb=e[0],(0,r.add_flush_callback)((()=>s=!1))),!i&&2&a[0]&&(i=!0,o.hsv=e[1],(0,r.add_flush_callback)((()=>i=!1))),t.$set(o)}},i(e){a||(t&&(0,r.transition_in)(t.$$.fragment,e),a=!0)},o(e){t&&(0,r.transition_out)(t.$$.fragment,e),a=!1},d(e){e&&(0,r.detach)(o),t&&(0,r.destroy_component)(t,e)}}}function tt(e){let t,n,s;var i=e[21]().a11yNotice;function o(e,t){return{props:{components:e[21](),a11yColors:e[12],color:e[4],hex:e[2],a11yGuidelines:e[13],isA11yOpen:e[14],isA11yClosable:e[15]}}}return i&&(t=(0,r.construct_svelte_component)(i,o(e))),{c(){t&&(0,r.create_component)(t.$$.fragment),n=(0,r.empty)()},m(e,i){t&&(0,r.mount_component)(t,e,i),(0,r.insert)(e,n,i),s=!0},p(e,s){if(i!==(i=e[21]().a11yNotice)){if(t){(0,r.group_outros)();const e=t;(0,r.transition_out)(e.$$.fragment,1,0,(()=>{(0,r.destroy_component)(e,1)})),(0,r.check_outros)()}i?(t=(0,r.construct_svelte_component)(i,o(e)),(0,r.create_component)(t.$$.fragment),(0,r.transition_in)(t.$$.fragment,1),(0,r.mount_component)(t,n.parentNode,n)):t=null}else if(i){const n={};4096&s[0]&&(n.a11yColors=e[12]),16&s[0]&&(n.color=e[4]),4&s[0]&&(n.hex=e[2]),8192&s[0]&&(n.a11yGuidelines=e[13]),16384&s[0]&&(n.isA11yOpen=e[14]),32768&s[0]&&(n.isA11yClosable=e[15]),t.$set(n)}},i(e){s||(t&&(0,r.transition_in)(t.$$.fragment,e),s=!0)},o(e){t&&(0,r.transition_out)(t.$$.fragment,e),s=!1},d(e){e&&(0,r.detach)(n),t&&(0,r.destroy_component)(t,e)}}}function nt(e){let t,n,s,i,o,a,l,c,d,u,h,p;function f(t){e[28](t)}function m(t){e[29](t)}function g(t){e[30](t)}let y={components:e[21](),h:e[1].h,toRight:e[17],isDark:e[5]};function v(t){e[31](t)}void 0!==e[1].s&&(y.s=e[1].s),void 0!==e[1].v&&(y.v=e[1].v),void 0!==e[3]&&(y.isOpen=e[3]),t=new x({props:y}),r.binding_callbacks.push((()=>(0,r.bind)(t,"s",f))),r.binding_callbacks.push((()=>(0,r.bind)(t,"v",m))),r.binding_callbacks.push((()=>(0,r.bind)(t,"isOpen",g)));let b={components:e[21](),toRight:e[17]};void 0!==e[1].h&&(b.h=e[1].h),a=new M({props:b}),r.binding_callbacks.push((()=>(0,r.bind)(a,"h",v)));let w=e[7]&&Qe(e),k=e[9]&&et(e),_=e[11]&&tt(e);return{c(){(0,r.create_component)(t.$$.fragment),o=(0,r.space)(),(0,r.create_component)(a.$$.fragment),c=(0,r.space)(),w&&w.c(),d=(0,r.space)(),k&&k.c(),u=(0,r.space)(),_&&_.c(),h=(0,r.empty)()},m(e,n){(0,r.mount_component)(t,e,n),(0,r.insert)(e,o,n),(0,r.mount_component)(a,e,n),(0,r.insert)(e,c,n),w&&w.m(e,n),(0,r.insert)(e,d,n),k&&k.m(e,n),(0,r.insert)(e,u,n),_&&_.m(e,n),(0,r.insert)(e,h,n),p=!0},p(e,o){const c={};2&o[0]&&(c.h=e[1].h),131072&o[0]&&(c.toRight=e[17]),32&o[0]&&(c.isDark=e[5]),!n&&2&o[0]&&(n=!0,c.s=e[1].s,(0,r.add_flush_callback)((()=>n=!1))),!s&&2&o[0]&&(s=!0,c.v=e[1].v,(0,r.add_flush_callback)((()=>s=!1))),!i&&8&o[0]&&(i=!0,c.isOpen=e[3],(0,r.add_flush_callback)((()=>i=!1))),t.$set(c);const p={};131072&o[0]&&(p.toRight=e[17]),!l&&2&o[0]&&(l=!0,p.h=e[1].h,(0,r.add_flush_callback)((()=>l=!1))),a.$set(p),e[7]?w?(w.p(e,o),128&o[0]&&(0,r.transition_in)(w,1)):(w=Qe(e),w.c(),(0,r.transition_in)(w,1),w.m(d.parentNode,d)):w&&((0,r.group_outros)(),(0,r.transition_out)(w,1,1,(()=>{w=null})),(0,r.check_outros)()),e[9]?k?(k.p(e,o),512&o[0]&&(0,r.transition_in)(k,1)):(k=et(e),k.c(),(0,r.transition_in)(k,1),k.m(u.parentNode,u)):k&&((0,r.group_outros)(),(0,r.transition_out)(k,1,1,(()=>{k=null})),(0,r.check_outros)()),e[11]?_?(_.p(e,o),2048&o[0]&&(0,r.transition_in)(_,1)):(_=tt(e),_.c(),(0,r.transition_in)(_,1),_.m(h.parentNode,h)):_&&((0,r.group_outros)(),(0,r.transition_out)(_,1,1,(()=>{_=null})),(0,r.check_outros)())},i(e){p||((0,r.transition_in)(t.$$.fragment,e),(0,r.transition_in)(a.$$.fragment,e),(0,r.transition_in)(w),(0,r.transition_in)(k),(0,r.transition_in)(_),p=!0)},o(e){(0,r.transition_out)(t.$$.fragment,e),(0,r.transition_out)(a.$$.fragment,e),(0,r.transition_out)(w),(0,r.transition_out)(k),(0,r.transition_out)(_),p=!1},d(e){e&&((0,r.detach)(o),(0,r.detach)(c),(0,r.detach)(d),(0,r.detach)(u),(0,r.detach)(h)),(0,r.destroy_component)(t,e),(0,r.destroy_component)(a,e),w&&w.d(e),k&&k.d(e),_&&_.d(e)}}}function rt(e){let t,n,s,i,o,a,l,c,d,u,h;t=new ae({});const p=[Xe,Ye],f=[];function m(e,t){return e[8]?0:1}function g(t){e[37](t)}i=m(e),o=f[i]=p[i](e);var y=e[21]().wrapper;function v(e,t){let n={isOpen:e[3],isPopup:e[16],toRight:e[17],$$slots:{default:[nt]},$$scope:{ctx:e}};return void 0!==e[20]&&(n.wrapper=e[20]),{props:n}}return y&&(l=(0,r.construct_svelte_component)(y,v(e)),r.binding_callbacks.push((()=>(0,r.bind)(l,"wrapper",g)))),{c(){(0,r.create_component)(t.$$.fragment),n=(0,r.space)(),s=(0,r.element)("span"),o.c(),a=(0,r.space)(),l&&(0,r.create_component)(l.$$.fragment),(0,r.attr)(s,"class","color-picker svelte-7ntk55")},m(o,c){(0,r.mount_component)(t,o,c),(0,r.insert)(o,n,c),(0,r.insert)(o,s,c),f[i].m(s,null),(0,r.append)(s,a),l&&(0,r.mount_component)(l,s,null),e[38](s),d=!0,u||(h=[(0,r.listen)(window,"mousedown",e[22]),(0,r.listen)(window,"keyup",e[23])],u=!0)},p(e,t){let n=i;if(i=m(e),i===n?f[i].p(e,t):((0,r.group_outros)(),(0,r.transition_out)(f[n],1,1,(()=>{f[n]=null})),(0,r.check_outros)(),o=f[i],o?o.p(e,t):(o=f[i]=p[i](e),o.c()),(0,r.transition_in)(o,1),o.m(s,a)),y!==(y=e[21]().wrapper)){if(l){(0,r.group_outros)();const e=l;(0,r.transition_out)(e.$$.fragment,1,0,(()=>{(0,r.destroy_component)(e,1)})),(0,r.check_outros)()}y?(l=(0,r.construct_svelte_component)(y,v(e)),r.binding_callbacks.push((()=>(0,r.bind)(l,"wrapper",g))),(0,r.create_component)(l.$$.fragment),(0,r.transition_in)(l.$$.fragment,1),(0,r.mount_component)(l,s,null)):l=null}else if(y){const n={};8&t[0]&&(n.isOpen=e[3]),65536&t[0]&&(n.isPopup=e[16]),131072&t[0]&&(n.toRight=e[17]),196287&t[0]|16384&t[1]&&(n.$$scope={dirty:t,ctx:e}),!c&&1048576&t[0]&&(c=!0,n.wrapper=e[20],(0,r.add_flush_callback)((()=>c=!1))),l.$set(n)}},i(e){d||((0,r.transition_in)(t.$$.fragment,e),(0,r.transition_in)(o),l&&(0,r.transition_in)(l.$$.fragment,e),d=!0)},o(e){(0,r.transition_out)(t.$$.fragment,e),(0,r.transition_out)(o),l&&(0,r.transition_out)(l.$$.fragment,e),d=!1},d(o){o&&((0,r.detach)(n),(0,r.detach)(s)),(0,r.destroy_component)(t,o),f[i].d(),l&&(0,r.destroy_component)(l),e[38](null),u=!1,(0,r.run_all)(h)}}}function st(e,t,n){(0,i.X$)([l]);let{components:o={}}=t;const a=(0,s.createEventDispatcher)();let c,{label:d="Choose a color"}=t,{isAlpha:u=!0}=t,{isInput:h=!0}=t,{isTextInput:p=!0}=t,{canChangeMode:f=!0}=t,{isA11y:m=!1}=t,{a11yColors:g=[{hex:"#ffffff"}]}=t,{a11yGuidelines:y='<p style="margin: 0; font-size: 12px;">Learn more at <a href="https://webaim.org/articles/contrast/" target="_blank">WebAIM contrast guide</a></p>'}=t,{isA11yOpen:v=!1}=t,{isA11yClosable:b=!0}=t,{isPopup:x=h}=t,{isOpen:w=!h}=t,{toRight:k=!1}=t,{disableCloseClickOutside:_=!1}=t,{rgb:C={r:255,g:0,b:0,a:1}}=t,{hsv:S={h:0,s:100,v:100,a:1}}=t,{hex:A="#ff0000"}=t,{color:M}=t,{isDark:O=!1}=t,N={r:255,g:0,b:0,a:1},T={h:0,s:100,v:100,a:1},$="#ff0000";const E={sliderIndicator:X,pickerIndicator:re,alphaIndicator:X,pickerWrapper:he,sliderWrapper:ye,alphaWrapper:ye,textInput:Z,a11yNotice:Be,a11ySingleNotice:Ue,a11ySummary:We,input:Ae,wrapper:$e};let D,R;return e.$$set=e=>{"components"in e&&n(24,o=e.components),"label"in e&&n(6,d=e.label),"isAlpha"in e&&n(7,u=e.isAlpha),"isInput"in e&&n(8,h=e.isInput),"isTextInput"in e&&n(9,p=e.isTextInput),"canChangeMode"in e&&n(10,f=e.canChangeMode),"isA11y"in e&&n(11,m=e.isA11y),"a11yColors"in e&&n(12,g=e.a11yColors),"a11yGuidelines"in e&&n(13,y=e.a11yGuidelines),"isA11yOpen"in e&&n(14,v=e.isA11yOpen),"isA11yClosable"in e&&n(15,b=e.isA11yClosable),"isPopup"in e&&n(16,x=e.isPopup),"isOpen"in e&&n(3,w=e.isOpen),"toRight"in e&&n(17,k=e.toRight),"disableCloseClickOutside"in e&&n(25,_=e.disableCloseClickOutside),"rgb"in e&&n(0,C=e.rgb),"hsv"in e&&n(1,S=e.hsv),"hex"in e&&n(2,A=e.hex),"color"in e&&n(4,M=e.color),"isDark"in e&&n(5,O=e.isDark)},e.$$.update=()=>{7&e.$$.dirty[0]&&(S||C||A)&&(S.h===T.h&&S.s===T.s&&S.v===T.v&&S.a===T.a&&C.r===N.r&&C.g===N.g&&C.b===N.b&&C.a===N.a&&A===$||(void 0===S.a&&n(1,S.a=1,S),void 0===T.a&&(T.a=1),void 0===C.a&&n(0,C.a=1,C),void 0===N.a&&(N.a=1),"ff"===A?.substring(7)&&n(2,A=A.substring(0,7)),"ff"===A?.substring(7)&&n(2,A=A.substring(0,7)),S.h!==T.h||S.s!==T.s||S.v!==T.v||S.a!==T.a?(n(4,M=(0,i.Mj)(S)),n(0,C=M.toRgb()),n(2,A=M.toHex())):C.r!==N.r||C.g!==N.g||C.b!==N.b||C.a!==N.a?(n(4,M=(0,i.Mj)(C)),n(2,A=M.toHex()),n(1,S=M.toHsv())):A!==$&&(n(4,M=(0,i.Mj)(A)),n(0,C=M.toRgb()),n(1,S=M.toHsv())),M&&n(5,O=M.isDark()),T=Object.assign({},S),N=Object.assign({},C),$=A,a("input",{color:M,hsv:S,rgb:C,hex:A})))},[C,S,A,w,M,O,d,u,h,p,f,m,g,y,v,b,x,k,c,D,R,function(){return{...E,...o}},function({target:e}){h&&(D.contains(e)||D.isSameNode(e)?n(3,w=!w):!w||R.contains(e)||_||n(3,w=!1))},function(e){"Tab"===e.key&&x&&n(3,w=c?.contains(document.activeElement))},o,_,function(e){D=e,n(19,D)},function(e){w=e,n(3,w)},function(t){e.$$.not_equal(S.s,t)&&(S.s=t,n(1,S))},function(t){e.$$.not_equal(S.v,t)&&(S.v=t,n(1,S))},function(e){w=e,n(3,w)},function(t){e.$$.not_equal(S.h,t)&&(S.h=t,n(1,S))},function(t){e.$$.not_equal(S.a,t)&&(S.a=t,n(1,S))},function(e){w=e,n(3,w)},function(e){A=e,n(2,A)},function(e){C=e,n(0,C)},function(e){S=e,n(1,S)},function(e){R=e,n(20,R)},function(e){r.binding_callbacks[e?"unshift":"push"]((()=>{c=e,n(18,c)}))}]}class it extends r.SvelteComponent{constructor(e){super(),(0,r.init)(this,e,st,rt,r.safe_not_equal,{components:24,label:6,isAlpha:7,isInput:8,isTextInput:9,canChangeMode:10,isA11y:11,a11yColors:12,a11yGuidelines:13,isA11yOpen:14,isA11yClosable:15,isPopup:16,isOpen:3,toRight:17,disableCloseClickOutside:25,rgb:0,hsv:1,hex:2,color:4,isDark:5},Ge,[-1,-1])}}const ot=it;r.SvelteComponent,r.SvelteComponent,r.SvelteComponent,r.SvelteComponent,r.SvelteComponent,r.SvelteComponent;const at=ot},9763:(e,t,n)=>{"use strict";var r=n(4356);"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add(r.j)},4356:(e,t,n)=>{"use strict";n.d(t,{j:()=>s,x:()=>r});const r="4.2.12",s="4"},5608:(e,t,n)=>{"use strict";function r(e,t,n,r){var s,i=arguments.length,o=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(i<3?s(o):i>3?s(t,n,o):s(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function s(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function i(e,t,n,r,s){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?s.call(e,n):s?s.value=n:t.set(e,n),n}n.d(t,{Cg:()=>r,GG:()=>i,gn:()=>s}),Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError},6195:(e,t,n)=>{"use strict";var r,s;n.d(t,{Ay:()=>lt}),function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(r||(r={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(s||(s={}));const i=r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),o=e=>{switch(typeof e){case"undefined":return i.undefined;case"string":return i.string;case"number":return isNaN(e)?i.nan:i.number;case"boolean":return i.boolean;case"function":return i.function;case"bigint":return i.bigint;case"symbol":return i.symbol;case"object":return Array.isArray(e)?i.array:null===e?i.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?i.promise:"undefined"!=typeof Map&&e instanceof Map?i.map:"undefined"!=typeof Set&&e instanceof Set?i.set:"undefined"!=typeof Date&&e instanceof Date?i.date:i.object;default:return i.unknown}},a=r.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class l extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(r);else if("invalid_return_type"===s.code)r(s.returnTypeError);else if("invalid_arguments"===s.code)r(s.argumentsError);else if(0===s.path.length)n._errors.push(t(s));else{let e=n,r=0;for(;r<s.path.length;){const n=s.path[r];r===s.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(s))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,r.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}l.create=e=>new l(e);const c=(e,t)=>{let n;switch(e.code){case a.invalid_type:n=e.received===i.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case a.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,r.jsonStringifyReplacer)}`;break;case a.unrecognized_keys:n=`Unrecognized key(s) in object: ${r.joinValues(e.keys,", ")}`;break;case a.invalid_union:n="Invalid input";break;case a.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${r.joinValues(e.options)}`;break;case a.invalid_enum_value:n=`Invalid enum value. Expected ${r.joinValues(e.options)}, received '${e.received}'`;break;case a.invalid_arguments:n="Invalid function arguments";break;case a.invalid_return_type:n="Invalid function return type";break;case a.invalid_date:n="Invalid date";break;case a.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:r.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case a.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case a.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case a.custom:n="Invalid input";break;case a.invalid_intersection_types:n="Intersection results could not be merged";break;case a.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case a.not_finite:n="Number must be finite";break;default:n=t.defaultError,r.assertNever(e)}return{message:n}};let d=c;function u(){return d}const h=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,i=[...n,...s.path||[]],o={...s,path:i};let a="";const l=r.filter((e=>!!e)).slice().reverse();for(const e of l)a=e(o,{data:t,defaultError:a}).message;return{...s,path:i,message:s.message||a}};function p(e,t){const n=h({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,u(),c].filter((e=>!!e))});e.common.issues.push(n)}class f{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return m;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t)n.push({key:await e.key,value:await e.value});return f.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:s}=r;if("aborted"===t.status)return m;if("aborted"===s.status)return m;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===t.value||void 0===s.value&&!r.alwaysSet||(n[t.value]=s.value)}return{status:e.value,value:n}}}const m=Object.freeze({status:"aborted"}),g=e=>({status:"dirty",value:e}),y=e=>({status:"valid",value:e}),v=e=>"aborted"===e.status,b=e=>"dirty"===e.status,x=e=>"valid"===e.status,w=e=>"undefined"!=typeof Promise&&e instanceof Promise;var k;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(k||(k={}));class _{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const C=(e,t)=>{if(x(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new l(e.common.issues);return this._error=t,this._error}}};function S(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=r?r:t.defaultError}:{message:null!=n?n:t.defaultError},description:s}}class A{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return o(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:o(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new f,ctx:{common:e.parent.common,data:e.data,parsedType:o(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(w(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)},s=this._parseSync({data:e,path:r.path,parent:r});return C(r,s)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)},r=this._parse({data:e,path:n.path,parent:n}),s=await(w(r)?r:Promise.resolve(r));return C(n,s)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const s=e(t),i=()=>r.addIssue({code:a.custom,...n(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(i(),!1))):!!s||(i(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new pe({schema:this,typeName:Se.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return fe.create(this,this._def)}nullable(){return me.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return J.create(this,this._def)}promise(){return he.create(this,this._def)}or(e){return Y.create([this,e],this._def)}and(e){return te.create(this,e,this._def)}transform(e){return new pe({...S(this._def),schema:this,typeName:Se.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ge({...S(this._def),innerType:this,defaultValue:t,typeName:Se.ZodDefault})}brand(){return new xe({typeName:Se.ZodBranded,type:this,...S(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ye({...S(this._def),innerType:this,catchValue:t,typeName:Se.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return we.create(this,e)}readonly(){return ke.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const M=/^c[^\s-]{8,}$/i,O=/^[a-z][a-z0-9]*$/,N=/^[0-9A-HJKMNP-TV-Z]{26}$/,T=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let E;const D=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,R=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;class I extends A{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==i.string){const t=this._getOrReturnCtx(e);return p(t,{code:a.invalid_type,expected:i.string,received:t.parsedType}),m}const t=new f;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),p(n,{code:a.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),p(n,{code:a.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,s=e.data.length<i.value;(r||s)&&(n=this._getOrReturnCtx(e,n),r?p(n,{code:a.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&p(n,{code:a.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)$.test(e.data)||(n=this._getOrReturnCtx(e,n),p(n,{validation:"email",code:a.invalid_string,message:i.message}),t.dirty());else if("emoji"===i.kind)E||(E=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),E.test(e.data)||(n=this._getOrReturnCtx(e,n),p(n,{validation:"emoji",code:a.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)T.test(e.data)||(n=this._getOrReturnCtx(e,n),p(n,{validation:"uuid",code:a.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)M.test(e.data)||(n=this._getOrReturnCtx(e,n),p(n,{validation:"cuid",code:a.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)O.test(e.data)||(n=this._getOrReturnCtx(e,n),p(n,{validation:"cuid2",code:a.invalid_string,message:i.message}),t.dirty());else if("ulid"===i.kind)N.test(e.data)||(n=this._getOrReturnCtx(e,n),p(n,{validation:"ulid",code:a.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),p(n,{validation:"url",code:a.invalid_string,message:i.message}),t.dirty()}else"regex"===i.kind?(i.regex.lastIndex=0,i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),p(n,{validation:"regex",code:a.invalid_string,message:i.message}),t.dirty())):"trim"===i.kind?e.data=e.data.trim():"includes"===i.kind?e.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(e,n),p(n,{code:a.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),t.dirty()):"toLowerCase"===i.kind?e.data=e.data.toLowerCase():"toUpperCase"===i.kind?e.data=e.data.toUpperCase():"startsWith"===i.kind?e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),p(n,{code:a.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty()):"endsWith"===i.kind?e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),p(n,{code:a.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty()):"datetime"===i.kind?((l=i).precision?l.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${l.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${l.precision}}Z$`):0===l.precision?l.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):l.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(n=this._getOrReturnCtx(e,n),p(n,{code:a.invalid_string,validation:"datetime",message:i.message}),t.dirty()):"ip"===i.kind?(s=e.data,("v4"!==(o=i.version)&&o||!D.test(s))&&("v6"!==o&&o||!R.test(s))&&(n=this._getOrReturnCtx(e,n),p(n,{validation:"ip",code:a.invalid_string,message:i.message}),t.dirty())):r.assertNever(i);var s,o,l;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:a.invalid_string,...k.errToObj(n)})}_addCheck(e){return new I({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...k.errToObj(e)})}url(e){return this._addCheck({kind:"url",...k.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...k.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...k.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...k.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...k.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...k.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...k.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...k.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...k.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...k.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...k.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...k.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...k.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...k.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...k.errToObj(t)})}nonempty(e){return this.min(1,k.errToObj(e))}trim(){return new I({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new I({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new I({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function P(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r;return parseInt(e.toFixed(s).replace(".",""))%parseInt(t.toFixed(s).replace(".",""))/Math.pow(10,s)}I.create=e=>{var t;return new I({checks:[],typeName:Se.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...S(e)})};class F extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==i.number){const t=this._getOrReturnCtx(e);return p(t,{code:a.invalid_type,expected:i.number,received:t.parsedType}),m}let t;const n=new f;for(const s of this._def.checks)"int"===s.kind?r.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),p(t,{code:a.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):"min"===s.kind?(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),p(t,{code:a.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):"max"===s.kind?(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),p(t,{code:a.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):"multipleOf"===s.kind?0!==P(e.data,s.value)&&(t=this._getOrReturnCtx(e,t),p(t,{code:a.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):"finite"===s.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),p(t,{code:a.not_finite,message:s.message}),n.dirty()):r.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,k.toString(t))}gt(e,t){return this.setLimit("min",e,!1,k.toString(t))}lte(e,t){return this.setLimit("max",e,!0,k.toString(t))}lt(e,t){return this.setLimit("max",e,!1,k.toString(t))}setLimit(e,t,n,r){return new F({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:k.toString(r)}]})}_addCheck(e){return new F({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:k.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:k.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&r.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}F.create=e=>new F({checks:[],typeName:Se.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...S(e)});class L extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==i.bigint){const t=this._getOrReturnCtx(e);return p(t,{code:a.invalid_type,expected:i.bigint,received:t.parsedType}),m}let t;const n=new f;for(const s of this._def.checks)"min"===s.kind?(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),p(t,{code:a.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):"max"===s.kind?(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),p(t,{code:a.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):"multipleOf"===s.kind?e.data%s.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),p(t,{code:a.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):r.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,k.toString(t))}gt(e,t){return this.setLimit("min",e,!1,k.toString(t))}lte(e,t){return this.setLimit("max",e,!0,k.toString(t))}lt(e,t){return this.setLimit("max",e,!1,k.toString(t))}setLimit(e,t,n,r){return new L({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:k.toString(r)}]})}_addCheck(e){return new L({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}L.create=e=>{var t;return new L({checks:[],typeName:Se.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...S(e)})};class B extends A{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==i.boolean){const t=this._getOrReturnCtx(e);return p(t,{code:a.invalid_type,expected:i.boolean,received:t.parsedType}),m}return y(e.data)}}B.create=e=>new B({typeName:Se.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...S(e)});class z extends A{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==i.date){const t=this._getOrReturnCtx(e);return p(t,{code:a.invalid_type,expected:i.date,received:t.parsedType}),m}if(isNaN(e.data.getTime()))return p(this._getOrReturnCtx(e),{code:a.invalid_date}),m;const t=new f;let n;for(const s of this._def.checks)"min"===s.kind?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),p(n,{code:a.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),t.dirty()):"max"===s.kind?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),p(n,{code:a.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),t.dirty()):r.assertNever(s);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new z({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:k.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:k.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}z.create=e=>new z({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Se.ZodDate,...S(e)});class j extends A{_parse(e){if(this._getType(e)!==i.symbol){const t=this._getOrReturnCtx(e);return p(t,{code:a.invalid_type,expected:i.symbol,received:t.parsedType}),m}return y(e.data)}}j.create=e=>new j({typeName:Se.ZodSymbol,...S(e)});class V extends A{_parse(e){if(this._getType(e)!==i.undefined){const t=this._getOrReturnCtx(e);return p(t,{code:a.invalid_type,expected:i.undefined,received:t.parsedType}),m}return y(e.data)}}V.create=e=>new V({typeName:Se.ZodUndefined,...S(e)});class H extends A{_parse(e){if(this._getType(e)!==i.null){const t=this._getOrReturnCtx(e);return p(t,{code:a.invalid_type,expected:i.null,received:t.parsedType}),m}return y(e.data)}}H.create=e=>new H({typeName:Se.ZodNull,...S(e)});class U extends A{constructor(){super(...arguments),this._any=!0}_parse(e){return y(e.data)}}U.create=e=>new U({typeName:Se.ZodAny,...S(e)});class q extends A{constructor(){super(...arguments),this._unknown=!0}_parse(e){return y(e.data)}}q.create=e=>new q({typeName:Se.ZodUnknown,...S(e)});class K extends A{_parse(e){const t=this._getOrReturnCtx(e);return p(t,{code:a.invalid_type,expected:i.never,received:t.parsedType}),m}}K.create=e=>new K({typeName:Se.ZodNever,...S(e)});class Z extends A{_parse(e){if(this._getType(e)!==i.undefined){const t=this._getOrReturnCtx(e);return p(t,{code:a.invalid_type,expected:i.void,received:t.parsedType}),m}return y(e.data)}}Z.create=e=>new Z({typeName:Se.ZodVoid,...S(e)});class J extends A{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==i.array)return p(t,{code:a.invalid_type,expected:i.array,received:t.parsedType}),m;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,s=t.data.length<r.exactLength.value;(e||s)&&(p(t,{code:e?a.too_big:a.too_small,minimum:s?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(p(t,{code:a.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(p(t,{code:a.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new _(t,e,t.path,n))))).then((e=>f.mergeArray(n,e)));const s=[...t.data].map(((e,n)=>r.type._parseSync(new _(t,e,t.path,n))));return f.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new J({...this._def,minLength:{value:e,message:k.toString(t)}})}max(e,t){return new J({...this._def,maxLength:{value:e,message:k.toString(t)}})}length(e,t){return new J({...this._def,exactLength:{value:e,message:k.toString(t)}})}nonempty(e){return this.min(1,e)}}function W(e){if(e instanceof G){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=fe.create(W(r))}return new G({...e._def,shape:()=>t})}return e instanceof J?new J({...e._def,type:W(e.element)}):e instanceof fe?fe.create(W(e.unwrap())):e instanceof me?me.create(W(e.unwrap())):e instanceof ne?ne.create(e.items.map((e=>W(e)))):e}J.create=(e,t)=>new J({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Se.ZodArray,...S(t)});class G extends A{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=r.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==i.object){const t=this._getOrReturnCtx(e);return p(t,{code:a.invalid_type,expected:i.object,received:t.parsedType}),m}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof K&&"strip"===this._def.unknownKeys))for(const e in n.data)s.includes(e)||o.push(e);const l=[];for(const e of s){const t=r[e],s=n.data[e];l.push({key:{status:"valid",value:e},value:t._parse(new _(n,s,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof K){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)l.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)o.length>0&&(p(n,{code:a.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const r=n.data[t];l.push({key:{status:"valid",value:t},value:e._parse(new _(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of l){const n=await t.key;e.push({key:n,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>f.mergeObjectSync(t,e))):f.mergeObjectSync(t,l)}get shape(){return this._def.shape()}strict(e){return k.errToObj,new G({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,s,i,o;const a=null!==(i=null===(s=(r=this._def).errorMap)||void 0===s?void 0:s.call(r,t,n).message)&&void 0!==i?i:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(o=k.errToObj(e).message)&&void 0!==o?o:a}:{message:a}}}:{}})}strip(){return new G({...this._def,unknownKeys:"strip"})}passthrough(){return new G({...this._def,unknownKeys:"passthrough"})}extend(e){return new G({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new G({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Se.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new G({...this._def,catchall:e})}pick(e){const t={};return r.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new G({...this._def,shape:()=>t})}omit(e){const t={};return r.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new G({...this._def,shape:()=>t})}deepPartial(){return W(this)}partial(e){const t={};return r.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new G({...this._def,shape:()=>t})}required(e){const t={};return r.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof fe;)e=e._def.innerType;t[n]=e}})),new G({...this._def,shape:()=>t})}keyof(){return ce(r.objectKeys(this.shape))}}G.create=(e,t)=>new G({shape:()=>e,unknownKeys:"strip",catchall:K.create(),typeName:Se.ZodObject,...S(t)}),G.strictCreate=(e,t)=>new G({shape:()=>e,unknownKeys:"strict",catchall:K.create(),typeName:Se.ZodObject,...S(t)}),G.lazycreate=(e,t)=>new G({shape:e,unknownKeys:"strip",catchall:K.create(),typeName:Se.ZodObject,...S(t)});class Y extends A{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new l(e.ctx.common.issues)));return p(t,{code:a.invalid_union,unionErrors:n}),m}));{let e;const r=[];for(const s of n){const n={...t,common:{...t.common,issues:[]},parent:null},i=s._parseSync({data:t.data,path:t.path,parent:n});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=r.map((e=>new l(e)));return p(t,{code:a.invalid_union,unionErrors:s}),m}}get options(){return this._def.options}}Y.create=(e,t)=>new Y({options:e,typeName:Se.ZodUnion,...S(t)});const X=e=>e instanceof ae?X(e.schema):e instanceof pe?X(e.innerType()):e instanceof le?[e.value]:e instanceof de?e.options:e instanceof ue?Object.keys(e.enum):e instanceof ge?X(e._def.innerType):e instanceof V?[void 0]:e instanceof H?[null]:null;class Q extends A{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==i.object)return p(t,{code:a.invalid_type,expected:i.object,received:t.parsedType}),m;const n=this.discriminator,r=t.data[n],s=this.optionsMap.get(r);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(p(t,{code:a.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=X(n.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of t){if(r.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);r.set(s,n)}}return new Q({typeName:Se.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...S(n)})}}function ee(e,t){const n=o(e),s=o(t);if(e===t)return{valid:!0,data:e};if(n===i.object&&s===i.object){const n=r.objectKeys(t),s=r.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of s){const r=ee(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===i.array&&s===i.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const s=ee(e[r],t[r]);if(!s.valid)return{valid:!1};n.push(s.data)}return{valid:!0,data:n}}return n===i.date&&s===i.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class te extends A{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(v(e)||v(r))return m;const s=ee(e.value,r.value);return s.valid?((b(e)||b(r))&&t.dirty(),{status:t.value,value:s.data}):(p(n,{code:a.invalid_intersection_types}),m)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}te.create=(e,t,n)=>new te({left:e,right:t,typeName:Se.ZodIntersection,...S(n)});class ne extends A{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.array)return p(n,{code:a.invalid_type,expected:i.array,received:n.parsedType}),m;if(n.data.length<this._def.items.length)return p(n,{code:a.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m;!this._def.rest&&n.data.length>this._def.items.length&&(p(n,{code:a.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new _(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>f.mergeArray(t,e))):f.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new ne({...this._def,rest:e})}}ne.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ne({items:e,typeName:Se.ZodTuple,rest:null,...S(t)})};class re extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.object)return p(n,{code:a.invalid_type,expected:i.object,received:n.parsedType}),m;const r=[],s=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:s._parse(new _(n,e,n.path,e)),value:o._parse(new _(n,n.data[e],n.path,e))});return n.common.async?f.mergeObjectAsync(t,r):f.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new re(t instanceof A?{keyType:e,valueType:t,typeName:Se.ZodRecord,...S(n)}:{keyType:I.create(),valueType:e,typeName:Se.ZodRecord,...S(t)})}}class se extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.map)return p(n,{code:a.invalid_type,expected:i.map,received:n.parsedType}),m;const r=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map((([e,t],i)=>({key:r._parse(new _(n,e,n.path,[i,"key"])),value:s._parse(new _(n,t,n.path,[i,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of o){const r=await n.key,s=await n.value;if("aborted"===r.status||"aborted"===s.status)return m;"dirty"!==r.status&&"dirty"!==s.status||t.dirty(),e.set(r.value,s.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of o){const r=n.key,s=n.value;if("aborted"===r.status||"aborted"===s.status)return m;"dirty"!==r.status&&"dirty"!==s.status||t.dirty(),e.set(r.value,s.value)}return{status:t.value,value:e}}}}se.create=(e,t,n)=>new se({valueType:t,keyType:e,typeName:Se.ZodMap,...S(n)});class ie extends A{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.set)return p(n,{code:a.invalid_type,expected:i.set,received:n.parsedType}),m;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(p(n,{code:a.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(p(n,{code:a.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const s=this._def.valueType;function o(e){const n=new Set;for(const r of e){if("aborted"===r.status)return m;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const l=[...n.data.values()].map(((e,t)=>s._parse(new _(n,e,n.path,t))));return n.common.async?Promise.all(l).then((e=>o(e))):o(l)}min(e,t){return new ie({...this._def,minSize:{value:e,message:k.toString(t)}})}max(e,t){return new ie({...this._def,maxSize:{value:e,message:k.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ie.create=(e,t)=>new ie({valueType:e,minSize:null,maxSize:null,typeName:Se.ZodSet,...S(t)});class oe extends A{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==i.function)return p(t,{code:a.invalid_type,expected:i.function,received:t.parsedType}),m;function n(e,n){return h({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,u(),c].filter((e=>!!e)),issueData:{code:a.invalid_arguments,argumentsError:n}})}function r(e,n){return h({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,u(),c].filter((e=>!!e)),issueData:{code:a.invalid_return_type,returnTypeError:n}})}const s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof he){const e=this;return y((async function(...t){const i=new l([]),a=await e._def.args.parseAsync(t,s).catch((e=>{throw i.addIssue(n(t,e)),i})),c=await Reflect.apply(o,this,a);return await e._def.returns._def.type.parseAsync(c,s).catch((e=>{throw i.addIssue(r(c,e)),i}))}))}{const e=this;return y((function(...t){const i=e._def.args.safeParse(t,s);if(!i.success)throw new l([n(t,i.error)]);const a=Reflect.apply(o,this,i.data),c=e._def.returns.safeParse(a,s);if(!c.success)throw new l([r(a,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new oe({...this._def,args:ne.create(e).rest(q.create())})}returns(e){return new oe({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new oe({args:e||ne.create([]).rest(q.create()),returns:t||q.create(),typeName:Se.ZodFunction,...S(n)})}}class ae extends A{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ae.create=(e,t)=>new ae({getter:e,typeName:Se.ZodLazy,...S(t)});class le extends A{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return p(t,{received:t.data,code:a.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ce(e,t){return new de({values:e,typeName:Se.ZodEnum,...S(t)})}le.create=(e,t)=>new le({value:e,typeName:Se.ZodLiteral,...S(t)});class de extends A{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return p(t,{expected:r.joinValues(n),received:t.parsedType,code:a.invalid_type}),m}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return p(t,{received:t.data,code:a.invalid_enum_value,options:n}),m}return y(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return de.create(e)}exclude(e){return de.create(this.options.filter((t=>!e.includes(t))))}}de.create=ce;class ue extends A{_parse(e){const t=r.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==i.string&&n.parsedType!==i.number){const e=r.objectValues(t);return p(n,{expected:r.joinValues(e),received:n.parsedType,code:a.invalid_type}),m}if(-1===t.indexOf(e.data)){const e=r.objectValues(t);return p(n,{received:n.data,code:a.invalid_enum_value,options:e}),m}return y(e.data)}get enum(){return this._def.values}}ue.create=(e,t)=>new ue({values:e,typeName:Se.ZodNativeEnum,...S(t)});class he extends A{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==i.promise&&!1===t.common.async)return p(t,{code:a.invalid_type,expected:i.promise,received:t.parsedType}),m;const n=t.parsedType===i.promise?t.data:Promise.resolve(t.data);return y(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}he.create=(e,t)=>new he({type:e,typeName:Se.ZodPromise,...S(t)});class pe extends A{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Se.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:e=>{p(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===s.type){const e=s.transform(n.data,i);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:n.path,parent:n}))):this._def.schema._parseSync({data:e,path:n.path,parent:n})}if("refinement"===s.type){const e=e=>{const t=s.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?m:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?m:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===s.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!x(e))return e;const r=s.transform(e.value,i);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>x(e)?Promise.resolve(s.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}r.assertNever(s)}}pe.create=(e,t,n)=>new pe({schema:e,typeName:Se.ZodEffects,effect:t,...S(n)}),pe.createWithPreprocess=(e,t,n)=>new pe({schema:t,effect:{type:"preprocess",transform:e},typeName:Se.ZodEffects,...S(n)});class fe extends A{_parse(e){return this._getType(e)===i.undefined?y(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}fe.create=(e,t)=>new fe({innerType:e,typeName:Se.ZodOptional,...S(t)});class me extends A{_parse(e){return this._getType(e)===i.null?y(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}me.create=(e,t)=>new me({innerType:e,typeName:Se.ZodNullable,...S(t)});class ge extends A{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===i.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ge.create=(e,t)=>new ge({innerType:e,typeName:Se.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...S(t)});class ye extends A{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return w(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new l(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new l(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ye.create=(e,t)=>new ye({innerType:e,typeName:Se.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...S(t)});class ve extends A{_parse(e){if(this._getType(e)!==i.nan){const t=this._getOrReturnCtx(e);return p(t,{code:a.invalid_type,expected:i.nan,received:t.parsedType}),m}return{status:"valid",value:e.data}}}ve.create=e=>new ve({typeName:Se.ZodNaN,...S(e)});const be=Symbol("zod_brand");class xe extends A{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class we extends A{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?m:"dirty"===e.status?(t.dirty(),g(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?m:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new we({in:e,out:t,typeName:Se.ZodPipeline})}}class ke extends A{_parse(e){const t=this._def.innerType._parse(e);return x(t)&&(t.value=Object.freeze(t.value)),t}}ke.create=(e,t)=>new ke({innerType:e,typeName:Se.ZodReadonly,...S(t)});const _e=(e,t={},n)=>e?U.create().superRefine(((r,s)=>{var i,o;if(!e(r)){const e="function"==typeof t?t(r):"string"==typeof t?{message:t}:t,a=null===(o=null!==(i=e.fatal)&&void 0!==i?i:n)||void 0===o||o,l="string"==typeof e?{message:e}:e;s.addIssue({code:"custom",...l,fatal:a})}})):U.create(),Ce={object:G.lazycreate};var Se;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Se||(Se={}));const Ae=I.create,Me=F.create,Oe=ve.create,Ne=L.create,Te=B.create,$e=z.create,Ee=j.create,De=V.create,Re=H.create,Ie=U.create,Pe=q.create,Fe=K.create,Le=Z.create,Be=J.create,ze=G.create,je=G.strictCreate,Ve=Y.create,He=Q.create,Ue=te.create,qe=ne.create,Ke=re.create,Ze=se.create,Je=ie.create,We=oe.create,Ge=ae.create,Ye=le.create,Xe=de.create,Qe=ue.create,et=he.create,tt=pe.create,nt=fe.create,rt=me.create,st=pe.createWithPreprocess,it=we.create,ot={string:e=>I.create({...e,coerce:!0}),number:e=>F.create({...e,coerce:!0}),boolean:e=>B.create({...e,coerce:!0}),bigint:e=>L.create({...e,coerce:!0}),date:e=>z.create({...e,coerce:!0})},at=m;var lt=Object.freeze({__proto__:null,defaultErrorMap:c,setErrorMap:function(e){d=e},getErrorMap:u,makeIssue:h,EMPTY_PATH:[],addIssueToContext:p,ParseStatus:f,INVALID:m,DIRTY:g,OK:y,isAborted:v,isDirty:b,isValid:x,isAsync:w,get util(){return r},get objectUtil(){return s},ZodParsedType:i,getParsedType:o,ZodType:A,ZodString:I,ZodNumber:F,ZodBigInt:L,ZodBoolean:B,ZodDate:z,ZodSymbol:j,ZodUndefined:V,ZodNull:H,ZodAny:U,ZodUnknown:q,ZodNever:K,ZodVoid:Z,ZodArray:J,ZodObject:G,ZodUnion:Y,ZodDiscriminatedUnion:Q,ZodIntersection:te,ZodTuple:ne,ZodRecord:re,ZodMap:se,ZodSet:ie,ZodFunction:oe,ZodLazy:ae,ZodLiteral:le,ZodEnum:de,ZodNativeEnum:ue,ZodPromise:he,ZodEffects:pe,ZodTransformer:pe,ZodOptional:fe,ZodNullable:me,ZodDefault:ge,ZodCatch:ye,ZodNaN:ve,BRAND:be,ZodBranded:xe,ZodPipeline:we,ZodReadonly:ke,custom:_e,Schema:A,ZodSchema:A,late:Ce,get ZodFirstPartyTypeKind(){return Se},coerce:ot,any:Ie,array:Be,bigint:Ne,boolean:Te,date:$e,discriminatedUnion:He,effect:tt,enum:Xe,function:We,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>_e((t=>t instanceof e),t),intersection:Ue,lazy:Ge,literal:Ye,map:Ze,nan:Oe,nativeEnum:Qe,never:Fe,null:Re,nullable:rt,number:Me,object:ze,oboolean:()=>Te().optional(),onumber:()=>Me().optional(),optional:nt,ostring:()=>Ae().optional(),pipeline:it,preprocess:st,promise:et,record:Ke,set:Je,strictObject:je,string:Ae,symbol:Ee,transformer:tt,tuple:qe,undefined:De,union:Ve,unknown:Pe,void:Le,NEVER:at,ZodIssueCode:a,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:l})}}]);
//# sourceMappingURL=976bee94.js.map