@bigbinary/neeto-editor 0.12.13 → 0.12.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -1
- package/build/index.js +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as e from"react";import t,{createContext as n,useContext as i,useState as o,useEffect as r,useRef as s,useCallback as a,Children as l,isValidElement as c,cloneElement as p,forwardRef as u,useLayoutEffect as d}from"react";import h,{flushSync as m,createPortal as f}from"react-dom";import g from"http";import b from"https";import v from"url";import y from"stream";import x from"assert";import w from"tty";import k from"util";import E from"os";import _ from"zlib";import M from"path";import C from"fs";import{renderToString as D}from"react-dom/server";var O=[],T=[];function N(e,t){if(e&&"undefined"!=typeof document){var n,i=!0===t.prepend?"prepend":"append",o=!0===t.singleTag,r="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var s=O.indexOf(r);-1===s&&(s=O.push(r)-1,T[s]={}),n=T[s]&&T[s][i]?T[s][i]:T[s][i]=a()}else n=a();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function a(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),o=0;o<n.length;o++)e.setAttribute(n[o],t.attributes[n[o]]);var s="prepend"===i?"afterbegin":"beforeend";return r.insertAdjacentElement(s,e),e}}function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},S.apply(this,arguments)}function A(e){this.content=e}function j(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(i),r=t.child(i);if(o!=r){if(!o.sameMarkup(r))return n;if(o.isText&&o.text!=r.text){for(let e=0;o.text[e]==r.text[e];e++)n++;return n}if(o.content.size||r.content.size){let e=j(o.content,r.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function I(e,t,n,i){for(let o=e.childCount,r=t.childCount;;){if(0==o||0==r)return o==r?null:{a:n,b:i};let s=e.child(--o),a=t.child(--r),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:i};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,i--;return{a:n,b:i}}if(s.content.size||a.content.size){let e=I(s.content,a.content,n-1,i-1);if(e)return e}n-=l,i-=l}else n-=l,i-=l}}N('@charset "UTF-8";\n@import url("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/github.min.css");\n/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n/* Document\n ========================================================================== */\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n/* Sections\n ========================================================================== */\n/**\n * Remove the margin in all browsers.\n */\nbody {\n margin: 0;\n}\n/**\n * Render the `main` element consistently in IE.\n */\nmain {\n display: block;\n}\n/**\n * Correct the font size and margin on `h1` elements within `section` and\n * `article` contexts in Chrome, Firefox, and Safari.\n */\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n/* Grouping content\n ========================================================================== */\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\npre {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n/* Text-level semantics\n ========================================================================== */\n/**\n * Remove the gray background on active links in IE 10.\n */\na {\n background-color: transparent;\n}\n/**\n * 1. Remove the bottom border in Chrome 57-\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted; /* 2 */\n}\n/**\n * Add the correct font weight in Chrome, Edge, and Safari.\n */\nb,\nstrong {\n font-weight: bolder;\n}\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n/**\n * Add the correct font size in all browsers.\n */\nsmall {\n font-size: 80%;\n}\n/**\n * Prevent `sub` and `sup` elements from affecting the line height in\n * all browsers.\n */\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\nsub {\n bottom: -0.25em;\n}\nsup {\n top: -0.5em;\n}\n/* Embedded content\n ========================================================================== */\n/**\n * Remove the border on images inside links in IE 10.\n */\nimg {\n border-style: none;\n}\n/* Forms\n ========================================================================== */\n/**\n * 1. Change the font styles in all browsers.\n * 2. Remove the margin in Firefox and Safari.\n */\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\nbutton,\ninput {\n /* 1 */\n overflow: visible;\n}\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\nbutton,\nselect {\n /* 1 */\n text-transform: none;\n}\n/**\n * Correct the inability to style clickable types in iOS and Safari.\n */\nbutton,\n[type=button],\n[type=reset],\n[type=submit] {\n -webkit-appearance: button;\n}\n/**\n * Remove the inner border and padding in Firefox.\n */\nbutton::-moz-focus-inner,\n[type=button]::-moz-focus-inner,\n[type=reset]::-moz-focus-inner,\n[type=submit]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n/**\n * Restore the focus styles unset by the previous rule.\n */\nbutton:-moz-focusring,\n[type=button]:-moz-focusring,\n[type=reset]:-moz-focusring,\n[type=submit]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n/**\n * Correct the padding in Firefox.\n */\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from `fieldset` elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * `fieldset` elements in all browsers.\n */\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\nprogress {\n vertical-align: baseline;\n}\n/**\n * Remove the default vertical scrollbar in IE 10+.\n */\ntextarea {\n overflow: auto;\n}\n/**\n * 1. Add the correct box sizing in IE 10.\n * 2. Remove the padding in IE 10.\n */\n[type=checkbox],\n[type=radio] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n[type=number]::-webkit-inner-spin-button,\n[type=number]::-webkit-outer-spin-button {\n height: auto;\n}\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n[type=search] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n/**\n * Remove the inner padding in Chrome and Safari on macOS.\n */\n[type=search]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to `inherit` in Safari.\n */\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n/* Interactive\n ========================================================================== */\n/*\n * Add the correct display in Edge, IE 10+, and Firefox.\n */\ndetails {\n display: block;\n}\n/*\n * Add the correct display in all browsers.\n */\nsummary {\n display: list-item;\n}\n/* Misc\n ========================================================================== */\n/**\n * Add the correct display in IE 10+.\n */\ntemplate {\n display: none;\n}\n/**\n * Add the correct display in IE 10.\n */\n[hidden] {\n display: none;\n}\naudio,\ncanvas,\nembed,\niframe,\nimg,\nobject,\nsvg,\nvideo {\n display: block;\n}\nbutton {\n background-color: transparent;\n background-image: none;\n border: none;\n}\nfieldset,\nol,\nul {\n margin: 0;\n padding: 0;\n}\nblockquote,\ndd,\ndl,\nfigure,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\np,\npre {\n margin: 0;\n}\n[type=checkbox],\n[type=radio] {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: 0;\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n display: inline-block;\n vertical-align: middle;\n background-origin: border-box;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n flex-shrink: 0;\n height: 1rem;\n width: 1rem;\n color: #2563eb;\n background-color: rgb(var(--neeto-ui-white));\n border-color: #6b7280;\n border-width: 1px;\n}\n[type=checkbox]:checked,\n[type=radio]:checked {\n border-color: transparent;\n background-color: currentColor;\n background-size: auto;\n background-position: center;\n background-repeat: no-repeat;\n}\n[type=radio]:checked {\n background-image: url("data:image/svg+xml,%3Csvg width=\'6\' height=\'6\' viewBox=\'0 0 6 6\' fill=\'none\' xmlns=\'http://www.w3.org/2000/svg\'%3E%3Ccircle cx=\'3\' cy=\'3\' r=\'3\' fill=\'white\'/%3E%3C/svg%3E%0A");\n}\n[type=checkbox]:checked {\n background-image: url("data:image/svg+xml,%3Csvg width=\'11\' height=\'8\' viewBox=\'0 0 11 8\' fill=\'none\' xmlns=\'http://www.w3.org/2000/svg\'%3E%3Cpath d=\'M9.66671 1L4.00004 6.66667L1.33337 4\' stroke=\'white\' stroke-width=\'1.5\' stroke-linecap=\'round\' stroke-linejoin=\'round\'/%3E%3C/svg%3E%0A");\n}\n[type=radio] {\n border-radius: 100%;\n}\nbody {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif !important;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.3;\n color: #222;\n}\nbody *,\nbody *::after,\nbody *::before {\n box-sizing: border-box;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\nbody {\n color: rgb(var(--neeto-ui-gray-800));\n}\nh1 {\n font-size: var(--neeto-ui-text-3xl);\n font-weight: var(--neeto-ui-font-semibold);\n line-height: var(--neeto-ui-leading-tight);\n}\nh2 {\n font-size: var(--neeto-ui-text-2xl);\n font-weight: var(--neeto-ui-font-semibold);\n line-height: var(--neeto-ui-leading-tight);\n}\nh3 {\n font-size: var(--neeto-ui-text-xl);\n font-weight: var(--neeto-ui-font-semibold);\n line-height: var(--neeto-ui-leading-tight);\n}\nh4 {\n font-size: var(--neeto-ui-text-base);\n font-weight: var(--neeto-ui-font-semibold);\n line-height: var(--neeto-ui-leading-tight);\n}\nh5 {\n font-size: var(--neeto-ui-text-sm);\n font-weight: var(--neeto-ui-font-semibold);\n line-height: var(--neeto-ui-leading-tight);\n}\nh6 {\n font-size: var(--neeto-ui-text-xs);\n font-weight: var(--neeto-ui-font-semibold);\n line-height: var(--neeto-ui-leading-tight);\n}\np {\n font-size: var(--neeto-ui-text-sm);\n line-height: var(--neeto-ui-leading-normal);\n}\n:root {\n --neeto-ui-black: 27, 31, 35;\n --neeto-ui-white: 255, 255, 255;\n --neeto-ui-gray-800: 47, 57, 65;\n --neeto-ui-gray-700: 73, 84, 92;\n --neeto-ui-gray-600: 104, 115, 125;\n --neeto-ui-gray-500: 135, 146, 157;\n --neeto-ui-gray-400: 194, 200, 204;\n --neeto-ui-gray-300: 216, 220, 222;\n --neeto-ui-gray-200: 233, 235, 237;\n --neeto-ui-gray-100: 248, 249, 249;\n --neeto-ui-primary-800: 45, 54, 212;\n --neeto-ui-primary-600: 54, 66, 223;\n --neeto-ui-primary-500: 69, 88, 249;\n --neeto-ui-primary-100: 235, 236, 254;\n --neeto-ui-error-800: 187, 18, 26;\n --neeto-ui-error-600: 201, 37, 45;\n --neeto-ui-error-500: 215, 55, 63;\n --neeto-ui-error-100: 254, 236, 240;\n --neeto-ui-success-800: 16, 113, 84;\n --neeto-ui-success-600: 18, 128, 92;\n --neeto-ui-success-500: 38, 142, 108;\n --neeto-ui-success-100: 225, 243, 238;\n --neeto-ui-warning-800: 189, 100, 13;\n --neeto-ui-warning-600: 203, 111, 16;\n --neeto-ui-warning-500: 218, 123, 17;\n --neeto-ui-warning-100: 251, 242, 225;\n --neeto-ui-info-800: 9, 90, 186;\n --neeto-ui-info-600: 13, 102, 208;\n --neeto-ui-info-500: 20, 115, 230;\n --neeto-ui-info-100: 226, 242, 255;\n --neeto-ui-pastel-silver: 232, 233, 237;\n --neeto-ui-pastel-red: 255, 229, 229;\n --neeto-ui-pastel-yellow: 254, 243, 197;\n --neeto-ui-pastel-green: 211, 249, 232;\n --neeto-ui-pastel-blue: 236, 244, 255;\n --neeto-ui-pastel-purple: 238, 235, 255;\n --neeto-ui-pastel-pink: 253, 226, 241;\n --neeto-ui-pastel-silver: 232, 233, 237;\n --neeto-ui-pastel-red: 255, 229, 229;\n --neeto-ui-pastel-yellow: 254, 243, 197;\n --neeto-ui-pastel-green: 211, 249, 232;\n --neeto-ui-pastel-blue: 236, 244, 255;\n --neeto-ui-pastel-purple: 238, 235, 255;\n --neeto-ui-pastel-pink: 253, 226, 241;\n --neeto-ui-surface-bg: 255, 255, 255;\n --neeto-ui-shadow-xs: 0px 1px 4px -1px rgba(28, 48, 74, 0.12);\n --neeto-ui-shadow-s: 0px 3px 12px -1px rgba(28, 52, 84, 0.12), 0px 2px 4px -1px rgba(28, 55, 90, 0.08);\n --neeto-ui-shadow-m: 0px 8px 24px -4px rgba(28, 50, 79, 0.12), 0px 2px 6px -1px rgba(28, 55, 90, 0.08);\n --neeto-ui-shadow-l: 0px 12px 48px -6px rgba(28, 50, 79, 0.12), 0px 3px 18px -2px rgba(28, 55, 90, 0.08);\n --neeto-ui-text-h1: 32px;\n --neeto-ui-text-h2: 24px;\n --neeto-ui-text-h3: 20px;\n --neeto-ui-text-h4: 16px;\n --neeto-ui-text-h5: 14px;\n --neeto-ui-text-h6: 12px;\n --neeto-ui-text-body1: 16px;\n --neeto-ui-text-body2: 14px;\n --neeto-ui-text-body3: 12px;\n --neeto-ui-text-nano: 10px;\n --neeto-ui-text-xxs: 10px;\n --neeto-ui-text-xs: 12px;\n --neeto-ui-text-sm: 14px;\n --neeto-ui-text-base: 16px;\n --neeto-ui-text-lg: 18px;\n --neeto-ui-text-xl: 20px;\n --neeto-ui-text-2xl: 24px;\n --neeto-ui-text-3xl: 32px;\n --neeto-ui-text-4xl: 48px;\n --neeto-ui-font-thin: 100;\n --neeto-ui-font-extralight: 200;\n --neeto-ui-font-light: 300;\n --neeto-ui-font-normal: 400;\n --neeto-ui-font-medium: 500;\n --neeto-ui-font-semibold: 600;\n --neeto-ui-font-bold: 700;\n --neeto-ui-font-extrabold: 800;\n --neeto-ui-font-black: 900;\n --neeto-ui-leading-none: 1;\n --neeto-ui-leading-tight: 1.25;\n --neeto-ui-leading-snug: 1.375;\n --neeto-ui-leading-normal: 1.5;\n --neeto-ui-leading-relaxed: 1.625;\n --neeto-ui-leading-loose: 2;\n --neeto-ui-text-transform-none: none;\n --neeto-ui-text-transform-capitalize: capitalize;\n --neeto-ui-text-transform-uppercase: uppercase;\n --neeto-ui-text-transform-lowercase: lowercase;\n --neeto-ui-text-transform-full-width: full-width;\n --neeto-ui-text-transform-inherit: inherit;\n --neeto-ui-text-transform-initial: initial;\n --neeto-ui-text-transform-revert: revert;\n --neeto-ui-text-transform-unset: unset;\n --neeto-ui-rounded-none: 0;\n --neeto-ui-rounded-sm: 3px;\n --neeto-ui-rounded: 5px;\n --neeto-ui-rounded-md: 6px;\n --neeto-ui-rounded-lg: 8px;\n --neeto-ui-rounded-xl: 12px;\n --neeto-ui-rounded-full: 999px;\n --neeto-ui-transition: all 0.3s linear;\n --neeto-ui-modal-z-index: 99999;\n}\n.neeto-ui-theme--dark {\n --neeto-ui-surface-bg: 18, 18, 18;\n background-color: rgb(18, 18, 18);\n --neeto-ui-white: 18, 18, 18;\n --neeto-ui-black: 224, 224, 224;\n --neeto-ui-gray-100: 30, 30, 30;\n --neeto-ui-gray-200: 44, 44, 44;\n --neeto-ui-gray-300: 57, 57, 57;\n --neeto-ui-gray-400: 73, 73, 73;\n --neeto-ui-gray-500: 92, 92, 92;\n --neeto-ui-gray-600: 124, 124, 124;\n --neeto-ui-gray-700: 162, 162, 162;\n --neeto-ui-gray-800: 200, 200, 200;\n --neeto-ui-primary-800: 209, 213, 254;\n --neeto-ui-primary-600: 181, 188, 253;\n --neeto-ui-primary-500: 125, 137, 251;\n --neeto-ui-primary-100: 27, 28, 37;\n --neeto-ui-error-800: 247, 109, 116;\n --neeto-ui-error-600: 236, 91, 98;\n --neeto-ui-error-500: 227, 72, 80;\n --neeto-ui-error-100: 129, 33, 38;\n --neeto-ui-success-800: 57, 185, 144;\n --neeto-ui-success-600: 51, 171, 132;\n --neeto-ui-success-500: 45, 157, 120;\n --neeto-ui-success-100: 23, 85, 65;\n --neeto-ui-warning-800: 249, 164, 63;\n --neeto-ui-warning-600: 242, 148, 35;\n --neeto-ui-warning-500: 230, 134, 25;\n --neeto-ui-warning-100: 131, 74, 11;\n --neeto-ui-info-800: 75, 156, 245;\n --neeto-ui-info-600: 55, 142, 240;\n --neeto-ui-info-500: 38, 128, 235;\n --neeto-ui-info-100: 11, 69, 137;\n --neeto-ui-pastel-silver: 167, 168, 170;\n --neeto-ui-pastel-red: 183, 164, 165;\n --neeto-ui-pastel-yellow: 182, 175, 143;\n --neeto-ui-pastel-green: 152, 179, 167;\n --neeto-ui-pastel-blue: 170, 175, 183;\n --neeto-ui-pastel-purple: 171, 169, 183;\n --neeto-ui-pastel-pink: 181, 162, 174;\n}\n@keyframes shake {\n 0% {\n transform: translateX(0);\n }\n 10% {\n transform: translateX(-4px);\n }\n 20% {\n transform: translateX(4px);\n }\n 30% {\n transform: translateX(-4px);\n }\n 40% {\n transform: translateX(4px);\n }\n 50% {\n transform: translateX(-4px);\n }\n 60% {\n transform: translateX(4px);\n }\n 70% {\n transform: translateX(-4px);\n }\n 80% {\n transform: translateX(4px);\n }\n 90% {\n transform: translateX(-4px);\n }\n 100% {\n transform: translateX(0);\n }\n}\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.ne-dropdown {\n margin: 6px 0;\n box-shadow: var(--neeto-ui-shadow-xs) !important;\n border-radius: var(--neeto-ui-rounded) !important;\n border: 1px solid rgb(var(--neeto-ui-gray-400));\n}\n.ne-dropdown .tippy-content {\n position: relative;\n padding: 0;\n z-index: 1;\n}\n.ne-dropdown__popup {\n width: auto;\n min-width: 168px;\n max-height: 360px;\n overflow-y: auto;\n background-color: rgb(var(--neeto-ui-white));\n border-radius: var(--neeto-ui-rounded);\n z-index: 99999;\n}\n.ne-dropdown__popup.ne-dropdown__popup--auto-width {\n min-width: auto;\n}\n.ne-dropdown__popup li,\n.ne-dropdown__popup .ne-dropdown--item {\n display: flex;\n cursor: pointer;\n position: relative;\n white-space: nowrap;\n transition: var(--neeto-ui-transition);\n font-size: var(--neeto-ui-text-sm);\n font-weight: var(--neeto-ui-font-normal);\n color: rgb(var(--neeto-ui-gray-800));\n padding: 6px 40px 6px 12px;\n text-decoration: none;\n outline-color: transparent;\n}\n.ne-dropdown__popup li.disabled,\n.ne-dropdown__popup .ne-dropdown--item.disabled {\n cursor: not-allowed;\n color: rgb(var(--neeto-ui-gray-500));\n}\n.ne-dropdown__popup li:hover, .ne-dropdown__popup li:focus,\n.ne-dropdown__popup .ne-dropdown--item:hover,\n.ne-dropdown__popup .ne-dropdown--item:focus {\n background-color: rgb(var(--neeto-ui-gray-200));\n}\n.ne-dropdown__popup li.loading:not(.active):after,\n.ne-dropdown__popup .ne-dropdown--item.loading:not(.active):after {\n content: "";\n position: absolute;\n right: 16px;\n top: 0;\n bottom: 0;\n margin: auto;\n width: 16px;\n height: 16px;\n display: block;\n border-radius: 50%;\n border: solid 2px rgb(var(--neeto-ui-gray-200));\n border-top-color: rgb(var(--neeto-ui-black));\n border-left-color: rgb(var(--neeto-ui-black));\n animation: theme("animation.spin");\n}\n.ne-dropdown__popup li.active,\n.ne-dropdown__popup .ne-dropdown--item.active {\n background-color: rgb(var(--neeto-ui-gray-800));\n color: rgb(var(--neeto-ui-white));\n}\n.ne-dropdown__popup .ne-dropdown__popup-menu {\n padding: 4px 0;\n}\n.ne-dropdown__popup .ne-dropdown__popup-menu-item {\n all: unset;\n}\n.ne-dropdown__popup .ne-dropdown__popup-menu-item-btn {\n width: 100%;\n display: flex;\n align-items: center;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n position: relative;\n white-space: nowrap;\n line-height: 1.143;\n transition: var(--neeto-ui-transition);\n font-size: var(--neeto-ui-text-sm);\n font-weight: var(--neeto-ui-font-normal);\n color: rgb(var(--neeto-ui-gray-800));\n padding: 6px 12px;\n min-height: 32px;\n gap: 8px;\n text-decoration: none;\n outline-color: transparent;\n border-radius: 0;\n}\n.ne-dropdown__popup .ne-dropdown__popup-menu-item-btn.disabled {\n cursor: not-allowed;\n color: rgb(var(--neeto-ui-gray-500));\n}\n.ne-dropdown__popup .ne-dropdown__popup-menu-item-btn:hover, .ne-dropdown__popup .ne-dropdown__popup-menu-item-btn:focus {\n background-color: rgb(var(--neeto-ui-gray-200));\n}\n.ne-dropdown__popup .ne-dropdown__popup-menu-item-btn.active {\n background-color: rgb(var(--neeto-ui-gray-800));\n color: rgb(var(--neeto-ui-white));\n}\n.ne-dropdown__popup .ne-dropdown__popup-menu-item-btn--style-danger {\n color: rgb(var(--neeto-ui-error-800));\n}\n.ne-dropdown__popup .ne-dropdown__popup-divider {\n all: unset;\n width: 100%;\n display: flex;\n height: 1px;\n background-color: rgb(var(--neeto-ui-gray-200));\n margin: 4px 0;\n pointer-events: none;\n}\n.ne-dropdown__popup .ne-dropdown__popup-menu-item-btn__suffix {\n margin-left: auto;\n}\n.ne-avatar--container {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--neeto-ui-rounded);\n position: relative;\n}\n.ne-avatar--container.ne-avatar--container-round {\n border-radius: var(--neeto-ui-rounded-full);\n}\n.ne-avatar--container .ne-avatar__text {\n font-weight: var(--neeto-ui-font-semibold);\n text-align: center;\n text-transform: capitalize;\n font-size: var(--neeto-ui-text-xxs);\n color: rgb(47, 57, 65);\n line-height: 1;\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-medium {\n font-size: var(--neeto-ui-text-xs);\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-large {\n font-size: var(--neeto-ui-text-sm);\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-xlarge {\n font-size: var(--neeto-ui-text-2xl);\n}\n.ne-avatar--container .ne-avatar__status {\n position: absolute;\n right: 0;\n top: 0;\n width: 0.4rem;\n height: 0.4rem;\n background-color: white;\n border: 0.5px solid white;\n border-radius: var(--neeto-ui-rounded-full);\n transform: translateX(-40%);\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-medium {\n width: 0.465rem;\n height: 0.465rem;\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-large {\n width: 0.563rem;\n height: 0.563rem;\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-xlarge {\n width: 0.75rem;\n height: 0.75rem;\n transform: translateX(-65%);\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-square {\n transform: translate(25%, -25%);\n}\n.ne-avatar--container .ne-avatar__status.online {\n background-color: rgb(var(--neeto-ui-success-500));\n}\n.ne-avatar--container .ne-avatar__status.idle {\n background-color: rgb(var(--neeto-ui-warning-500));\n}\n.ne-avatar--container .ne-avatar__status.offline {\n background-color: rgb(var(--neeto-ui-gray-300));\n}\n.ne-avatar--container .ne-avatar {\n display: inline-block;\n border-radius: var(--neeto-ui-rounded-sm);\n height: 1.5rem;\n width: 1.5rem;\n -o-object-fit: cover;\n object-fit: cover;\n}\n.ne-avatar--container .ne-avatar.hidden {\n display: none;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--medium {\n height: 2rem;\n width: 2rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--large {\n height: 2.5rem;\n width: 2.5rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--xlarge {\n height: 4rem;\n width: 4rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--round {\n border-radius: var(--neeto-ui-rounded-full);\n}\n.ne-avatar--container-bg-1 {\n background-color: rgb(var(--neeto-ui-pastel-silver));\n}\n.ne-avatar--container-bg-2 {\n background-color: rgb(var(--neeto-ui-pastel-red));\n}\n.ne-avatar--container-bg-3 {\n background-color: rgb(var(--neeto-ui-pastel-yellow));\n}\n.ne-avatar--container-bg-4 {\n background-color: rgb(var(--neeto-ui-pastel-green));\n}\n.ne-avatar--container-bg-5 {\n background-color: rgb(var(--neeto-ui-pastel-blue));\n}\n.ne-avatar--container-bg-6 {\n background-color: rgb(var(--neeto-ui-pastel-purple));\n}\n.ne-avatar--container-bg-7 {\n background-color: rgb(var(--neeto-ui-pastel-pink));\n}\n.ne-tab__wrapper {\n width: 100%;\n display: flex;\n border-bottom: 2px solid rgb(var(--neeto-ui-gray-300));\n}\n.ne-tab__wrapper--size-large .ne-tab {\n font-size: var(--neeto-ui-text-xl);\n padding-left: 12px;\n padding-right: 12px;\n}\n.ne-tab__wrapper--underline-none {\n border-bottom: none;\n}\n.ne-tab__wrapper--underline-none .ne-tab::before {\n display: none;\n}\n.ne-tab {\n display: flex;\n justify-content: center;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n color: rgb(var(--neeto-ui-gray-500));\n font-weight: var(--neeto-ui-font-semibold);\n font-size: var(--neeto-ui-text-sm);\n line-height: 1;\n padding: 12px 8px;\n transition: var(--neeto-ui-transition);\n position: relative;\n cursor: pointer;\n text-decoration: none;\n outline: none;\n}\n.ne-tab:hover, .ne-tab:focus, .ne-tab:focus-visible, .ne-tab:active {\n text-decoration: none;\n outline: none;\n}\n.ne-tab:focus, .ne-tab:focus-visible {\n color: rgb(var(--neeto-ui-gray-800));\n}\n.ne-tab__icon {\n margin-right: 12px;\n}\n.ne-tab svg {\n width: 16px;\n height: 16px;\n}\n.ne-tab:hover {\n color: rgb(var(--neeto-ui-gray-600));\n}\n.ne-tab:before {\n content: "";\n position: absolute;\n width: 100%;\n height: 2px;\n background-color: transparent;\n left: 0;\n right: 0;\n bottom: -2px;\n transition: var(--neeto-ui-transition);\n}\n.ne-tab.active {\n color: rgb(var(--neeto-ui-gray-800));\n}\n.ne-tab.active:before {\n background-color: rgb(var(--neeto-ui-gray-800));\n}\n.ne-btn {\n position: relative;\n display: inline-flex !important;\n align-items: center;\n padding: 6px 8px;\n gap: 4px;\n font-size: var(--neeto-ui-text-sm);\n font-weight: var(--neeto-ui-font-medium);\n line-height: 16px;\n transition: var(--neeto-ui-transition);\n border-radius: var(--neeto-ui-rounded);\n border: none;\n outline: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n min-width: 0;\n cursor: pointer;\n}\n.ne-btn.ne-btn--icon-only {\n padding: 6px;\n}\n.ne-btn.ne-btn--icon-only .ne-btn__icon,\n.ne-btn.ne-btn--icon-only .ne-btn__spinner svg {\n width: 16px !important;\n height: 16px !important;\n}\n.ne-btn--size-medium {\n font-size: var(--neeto-ui-text-sm);\n padding: 8px 16px;\n gap: 8px;\n}\n.ne-btn--size-medium.ne-btn--icon-only .ne-btn__icon,\n.ne-btn--size-medium.ne-btn--icon-only .ne-btn__spinner svg {\n width: 20px !important;\n height: 20px !important;\n}\n.ne-btn--size-large {\n font-size: var(--neeto-ui-text-base);\n padding: 12px 20px;\n gap: 10px;\n}\n.ne-btn--size-large.ne-btn--icon-only {\n padding: 8px;\n}\n.ne-btn--size-large.ne-btn--icon-only .ne-btn__icon,\n.ne-btn--size-large.ne-btn--icon-only .ne-btn__spinner svg {\n width: 24px !important;\n height: 24px !important;\n}\n.ne-btn:focus, .ne-btn:focus-visible {\n outline: none;\n}\n.ne-btn:hover {\n text-decoration: none;\n}\n.ne-btn.disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.ne-btn--icon-left {\n flex-direction: row-reverse;\n}\n.ne-btn__icon,\n.ne-btn__spinner,\n.ne-btn__spinner-wrapper {\n color: inherit;\n}\n.ne-btn__icon svg,\n.ne-btn__spinner svg,\n.ne-btn__spinner-wrapper svg {\n color: inherit !important;\n}\n.ne-btn--width-full {\n width: 100% !important;\n justify-content: center;\n}\n.ne-btn--style-primary {\n color: rgb(var(--neeto-ui-white));\n background-color: rgb(var(--neeto-ui-primary-500));\n}\n.ne-btn--style-primary:hover:not(:disabled), .ne-btn--style-primary:active {\n color: rgb(var(--neeto-ui-white));\n background-color: rgb(var(--neeto-ui-primary-600));\n}\n.ne-btn--style-primary:focus {\n color: rgb(var(--neeto-ui-white));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-primary-500), 15%);\n}\n.ne-btn--style-primary:focus-visible {\n color: rgb(var(--neeto-ui-white));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-primary-500), 15%);\n}\n.ne-btn--style-secondary {\n color: rgb(var(--neeto-ui-gray-800));\n background-color: rgb(var(--neeto-ui-gray-200));\n}\n.ne-btn--style-secondary:hover:not(:disabled), .ne-btn--style-secondary:active {\n color: rgb(var(--neeto-ui-gray-800));\n background-color: rgb(var(--neeto-ui-gray-300));\n}\n.ne-btn--style-secondary:focus {\n color: rgb(var(--neeto-ui-gray-800));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-gray-800), 25%);\n}\n.ne-btn--style-secondary:focus-visible {\n color: rgb(var(--neeto-ui-gray-800));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-gray-800), 25%);\n}\n.ne-btn--style-text {\n color: rgb(var(--neeto-ui-gray-800));\n}\n.ne-btn--style-text:hover:not(:disabled), .ne-btn--style-text:active {\n color: rgb(var(--neeto-ui-gray-800));\n background-color: rgb(var(--neeto-ui-gray-200));\n}\n.ne-btn--style-text:focus {\n color: rgb(var(--neeto-ui-gray-800));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-gray-800), 15%);\n}\n.ne-btn--style-text:focus-visible {\n color: rgb(var(--neeto-ui-gray-800));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-gray-800), 15%);\n}\n.ne-btn--style-link {\n color: rgb(var(--neeto-ui-primary-500));\n padding: 0;\n}\n.ne-btn--style-link:hover:not(:disabled), .ne-btn--style-link:active, .ne-btn--style-link:focus {\n opacity: 0.8;\n color: rgb(var(--neeto-ui-primary-500));\n}\n.ne-btn--style-link:focus {\n opacity: 0.8;\n color: rgb(var(--neeto-ui-primary-500));\n}\n.ne-btn--style-link:focus-visible {\n opacity: 0.8;\n color: rgb(var(--neeto-ui-primary-500));\n}\n.ne-btn--style-danger {\n color: rgb(var(--neeto-ui-white));\n background-color: rgb(var(--neeto-ui-error-500));\n}\n.ne-btn--style-danger:hover:not(:disabled), .ne-btn--style-danger:active {\n color: rgb(var(--neeto-ui-white));\n background-color: rgb(var(--neeto-ui-error-600));\n}\n.ne-btn--style-danger:focus {\n color: rgb(var(--neeto-ui-white));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-error-500), 15%);\n}\n.ne-btn--style-danger:focus-visible {\n color: rgb(var(--neeto-ui-white));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-error-500), 15%);\n}\n.ne-btn--style-danger-text {\n color: rgb(var(--neeto-ui-error-800));\n}\n.ne-btn--style-danger-text:hover:not(:disabled), .ne-btn--style-danger-text:active {\n color: rgb(var(--neeto-ui-error-800));\n background-color: rgb(var(--neeto-ui-error-100));\n}\n.ne-btn--style-danger-text:focus {\n color: rgb(var(--neeto-ui-error-800));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-error-500), 15%);\n}\n.ne-btn--style-danger-text:focus-visible {\n color: rgb(var(--neeto-ui-error-800));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-error-500), 15%);\n}\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0;\n}\n[data-tippy-root] {\n max-width: calc(100vw - 10px);\n}\n.tippy-box {\n position: relative;\n background-color: rgb(var(--neeto-ui-gray-800));\n color: rgb(var(--neeto-ui-white));\n border-radius: var(--neeto-ui-rounded);\n font-size: var(--neeto-ui-text-xs);\n line-height: 1.4;\n outline: 0;\n transition-property: transform, visibility, opacity;\n}\n.tippy-box[data-placement^=top] > .tippy-arrow {\n bottom: 0;\n}\n.tippy-box[data-placement^=top] > .tippy-arrow:before {\n bottom: -7px;\n left: 0;\n border-width: 8px 8px 0;\n border-top-color: initial;\n transform-origin: center top;\n}\n.tippy-box[data-placement^=bottom] > .tippy-arrow {\n top: 0;\n}\n.tippy-box[data-placement^=bottom] > .tippy-arrow:before {\n top: -7px;\n left: 0;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n transform-origin: center bottom;\n}\n.tippy-box[data-placement^=left] > .tippy-arrow {\n right: 0;\n}\n.tippy-box[data-placement^=left] > .tippy-arrow:before {\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n right: -7px;\n transform-origin: center left;\n}\n.tippy-box[data-placement^=right] > .tippy-arrow {\n left: 0;\n}\n.tippy-box[data-placement^=right] > .tippy-arrow:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n transform-origin: center right;\n}\n.tippy-box[data-inertia][data-state=visible] {\n transition-timing-function: cubic-bezier(0.54, 1.5, 0.38, 1.11);\n}\n.tippy-arrow {\n width: 16px;\n height: 16px;\n color: rgb(var(--neeto-ui-gray-800));\n}\n.tippy-arrow:before {\n content: "";\n position: absolute;\n border-color: transparent;\n border-style: solid;\n}\n.tippy-content {\n position: relative;\n padding: 4px 8px;\n z-index: 1;\n}\n[data-theme=neeto-editor-slash-menu] .tippy-content,\n[data-theme=neeto-editor-bubble-menu] .tippy-content {\n padding: 0 !important;\n}\n.tippy-box[data-placement^=top] > .tippy-svg-arrow {\n bottom: 0;\n}\n.tippy-box[data-placement^=top] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=top] > .tippy-svg-arrow > svg {\n top: 16px;\n transform: rotate(180deg);\n}\n.tippy-box[data-placement^=bottom] > .tippy-svg-arrow {\n top: 0;\n}\n.tippy-box[data-placement^=bottom] > .tippy-svg-arrow > svg {\n bottom: 16px;\n}\n.tippy-box[data-placement^=left] > .tippy-svg-arrow {\n right: 0;\n}\n.tippy-box[data-placement^=left] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=left] > .tippy-svg-arrow > svg {\n transform: rotate(90deg);\n top: calc(50% - 3px);\n left: 13px;\n}\n.tippy-box[data-placement^=right] > .tippy-svg-arrow {\n left: 0;\n}\n.tippy-box[data-placement^=right] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=right] > .tippy-svg-arrow > svg {\n transform: rotate(-90deg);\n top: calc(50% - 3px);\n right: 13px;\n}\n.tippy-svg-arrow {\n width: 16px;\n height: 16px;\n fill: rgb(var(--neeto-ui-gray-800));\n text-align: initial;\n}\n.tippy-svg-arrow,\n.tippy-svg-arrow > svg {\n position: absolute;\n}\n.tippy-svg-arrow > svg > path {\n fill: rgb(var(--neeto-ui-gray-800));\n}\n.tippy-box[data-theme~=light] .tippy-svg-arrow > svg > path {\n fill: rgb(var(--neeto-ui-white));\n}\n.tippy-box[data-theme~=light] {\n color: rgb(var(--neeto-ui-gray-800));\n box-shadow: var(--neeto-ui-shadow-s);\n background-color: rgb(var(--neeto-ui-white));\n}\n.tippy-box[data-theme~=light][data-placement^=top] > .tippy-arrow:before {\n border-top-color: rgb(var(--neeto-ui-white));\n}\n.tippy-box[data-theme~=light][data-placement^=bottom] > .tippy-arrow:before {\n border-bottom-color: rgb(var(--neeto-ui-white));\n}\n.tippy-box[data-theme~=light][data-placement^=left] > .tippy-arrow:before {\n border-left-color: rgb(var(--neeto-ui-white));\n}\n.tippy-box[data-theme~=light][data-placement^=right] > .tippy-arrow:before {\n border-right-color: rgb(var(--neeto-ui-white));\n}\n.tippy-box[data-theme~=light] > .tippy-backdrop {\n background-color: rgb(var(--neeto-ui-white));\n}\n.tippy-box[data-theme~=light] > .tippy-svg-arrow {\n fill: rgb(var(--neeto-ui-white));\n}\n.ne-input__wrapper {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n flex-grow: 1;\n}\n.ne-input__wrapper .ne-input__label-wrapper {\n display: flex;\n gap: 8px;\n justify-content: space-between;\n width: 100%;\n}\n.ne-input__wrapper .ne-input__label-wrapper .ne-label {\n flex-grow: 1;\n overflow-wrap: break-word;\n}\n.ne-input__wrapper .ne-input__label-wrapper .ne-input__max-length {\n color: rgb(var(--neeto-ui-gray-700));\n line-height: 1;\n margin-bottom: 8px;\n margin-left: auto;\n}\n.ne-input__wrapper .ne-input__label-wrapper .ne-input__max-length.ne-input__max-length--error {\n color: rgb(var(--neeto-ui-error-800));\n}\n.ne-input__wrapper .ne-label {\n margin-bottom: 8px;\n}\n.ne-input__wrapper .ne-input {\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n font-size: var(--neeto-ui-text-sm);\n transition: var(--neeto-ui-transition);\n border-radius: var(--neeto-ui-rounded);\n border: thin solid rgb(var(--neeto-ui-gray-400));\n background-color: rgb(var(--neeto-ui-white));\n color: rgb(var(--neeto-ui-gray-800));\n overflow: hidden;\n}\n.ne-input__wrapper .ne-input input,\n.ne-input__wrapper .ne-input textarea {\n width: 100%;\n background-color: transparent;\n color: inherit;\n border: none;\n font-size: inherit;\n box-shadow: none;\n outline: none;\n}\n.ne-input__wrapper .ne-input input::-moz-placeholder, .ne-input__wrapper .ne-input textarea::-moz-placeholder {\n color: rgb(var(--neeto-ui-gray-400));\n}\n.ne-input__wrapper .ne-input input::placeholder,\n.ne-input__wrapper .ne-input textarea::placeholder {\n color: rgb(var(--neeto-ui-gray-400));\n}\n.ne-input__wrapper .ne-input input:focus,\n.ne-input__wrapper .ne-input textarea:focus {\n outline-color: transparent;\n}\n.ne-input__wrapper .ne-input input {\n line-height: 1.2;\n}\n.ne-input__wrapper .ne-input textarea {\n padding: 0;\n max-height: 224px;\n overflow-y: auto;\n line-height: 1.5;\n}\n.ne-input__wrapper .ne-input:hover:not(.ne-input--naked, .ne-input--error, .ne-input--disabled) {\n border-color: rgb(var(--neeto-ui-gray-700));\n}\n.ne-input__wrapper .ne-input:focus-within:not(.ne-input--naked, .ne-input--error) {\n border-color: rgb(var(--neeto-ui-primary-500));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-primary-500), 15%);\n}\n.ne-input__wrapper .ne-input:focus-within:not(.ne-input--naked, .ne-input--error) .ne-input__prefix,\n.ne-input__wrapper .ne-input:focus-within:not(.ne-input--naked, .ne-input--error) .ne-input__suffix {\n color: rgb(var(--neeto-ui-gray-800));\n}\n.ne-input__wrapper .ne-input.ne-input--error {\n border-color: rgb(var(--neeto-ui-error-500));\n}\n.ne-input__wrapper .ne-input.ne-input--error:focus-within:not(.ne-input--naked) {\n box-shadow: 0 0 0 3px rgb(var(--neeto-ui-error-100));\n}\n.ne-input__wrapper .ne-input.ne-input--error textarea {\n resize: none;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled {\n background-color: rgb(var(--neeto-ui-gray-100));\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled input {\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled textarea {\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--small input {\n padding: 4px 8px;\n min-height: 26px;\n}\n.ne-input__wrapper .ne-input.ne-input--small .ne-input__prefix {\n margin-left: 8px;\n}\n.ne-input__wrapper .ne-input.ne-input--small .ne-input__suffix {\n margin-right: 8px;\n}\n.ne-input__wrapper .ne-input.ne-input--small.ne-input--textarea {\n padding: 8px;\n}\n.ne-input__wrapper .ne-input.ne-input--medium input {\n padding: 5px 8px;\n min-height: 30px;\n}\n.ne-input__wrapper .ne-input.ne-input--medium .ne-input__prefix {\n margin-left: 8px;\n}\n.ne-input__wrapper .ne-input.ne-input--medium .ne-input__suffix {\n margin-right: 8px;\n}\n.ne-input__wrapper .ne-input.ne-input--medium.ne-input--textarea {\n padding: 8px;\n}\n.ne-input__wrapper .ne-input.ne-input--large input {\n padding: 8px 12px;\n min-height: 38px;\n}\n.ne-input__wrapper .ne-input.ne-input--large .ne-input__prefix {\n margin-left: 12px;\n}\n.ne-input__wrapper .ne-input.ne-input--large .ne-input__suffix {\n margin-right: 12px;\n}\n.ne-input__wrapper .ne-input.ne-input--large.ne-input--textarea {\n padding: 12px;\n}\n.ne-input__wrapper .ne-input.ne-input--naked {\n border: none;\n box-shadow: none;\n padding-left: 0;\n padding-right: 0;\n}\n.ne-input__wrapper .ne-input.ne-input--naked input {\n padding-left: 0;\n padding-right: 0;\n}\n.ne-input__wrapper .ne-input.ne-input--naked .ne-input__prefix {\n margin-left: 0;\n}\n.ne-input__wrapper .ne-input.ne-input--naked .ne-input__suffix {\n margin-right: 0;\n}\n.ne-input__wrapper .ne-input__prefix,\n.ne-input__wrapper .ne-input__suffix {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n font-size: 14px;\n color: rgb(var(--neeto-ui-gray-700));\n}\n.ne-input__wrapper .ne-input__prefix svg,\n.ne-input__wrapper .ne-input__suffix svg {\n width: 16px;\n height: 16px;\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__prefix,\n.ne-input__wrapper .ne-input--block-add-on .ne-input__suffix {\n margin: 0;\n padding: 8px 12px;\n background-color: rgb(var(--neeto-ui-gray-100));\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__prefix {\n border-right: thin solid rgb(var(--neeto-ui-gray-400));\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__suffix {\n border-left: thin solid rgb(var(--neeto-ui-gray-400));\n}\n.ne-input__help-text {\n margin-top: 8px;\n font-size: var(--neeto-ui-text-xs);\n color: rgb(var(--neeto-ui-gray-600));\n line-height: 1.1;\n}\n.ne-input__error {\n margin-top: 8px;\n line-height: 1.1;\n font-size: var(--neeto-ui-text-xs);\n color: rgb(var(--neeto-ui-error-800));\n}\n.ne-label {\n display: flex;\n align-items: center;\n}\n:root {\n --neeto-ui-modal-spacing: 24px;\n}\n.ne-modal__backdrop {\n position: fixed;\n z-index: var(--neeto-ui-modal-z-index);\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n overflow-y: auto;\n overflow-x: hidden;\n display: grid;\n justify-content: center;\n align-items: center;\n transition: all 0.3s;\n background-color: rgba(27, 31, 35, 0.8666666667);\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n}\n.ne-modal__backdrop .ne-modal__wrapper {\n width: 50%;\n max-width: 100%;\n position: relative;\n background-color: rgb(var(--neeto-ui-white));\n border-radius: var(--neeto-ui-rounded-xl);\n opacity: 0;\n transform: scale(1.1);\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n animation: showModalWrapper 0.3s forwards;\n}\n@keyframes showModalWrapper {\n 0% {\n opacity: 0;\n transform: scale(1.1);\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n -webkit-backdrop-filter: blur(0px);\n backdrop-filter: blur(0px);\n }\n}\n.ne-modal__backdrop .ne-modal__wrapper .ne-modal__close {\n position: absolute;\n top: var(--neeto-ui-modal-spacing);\n right: var(--neeto-ui-modal-spacing);\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--small {\n width: 320px;\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--medium {\n width: 480px;\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--large {\n width: 720px;\n}\n.ne-modal__backdrop .ne-modal__wrapper .ne-modal__header {\n padding: var(--neeto-ui-modal-spacing) 64px 16px var(--neeto-ui-modal-spacing);\n overflow-wrap: break-word;\n}\n.ne-modal__backdrop .ne-modal__wrapper .ne-modal__header-desc {\n margin-top: 8px;\n color: rgb(var(--neeto-ui-gray-700));\n}\n.ne-modal__backdrop .ne-modal__wrapper .ne-modal__body {\n padding: 0 var(--neeto-ui-modal-spacing);\n font-size: var(--neeto-ui-text-sm);\n line-height: 1.5;\n}\n.ne-modal__backdrop .ne-modal__wrapper .ne-modal__footer {\n padding: var(--neeto-ui-modal-spacing);\n}\n.ne-modal__backdrop .ne-modal__wrapper .ne-alert__footer {\n padding: var(--neeto-ui-modal-spacing);\n display: flex;\n}\n.ne-modal__backdrop .ne-icon__wrapper {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n margin-bottom: var(--neeto-ui-modal-spacing);\n padding: 10px 0 0 2px;\n}\n.ne-modal-enter.ne-modal__backdrop {\n opacity: 0;\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n}\n.ne-modal-enter-active.ne-modal__backdrop,\n.ne-modal-enter-done.ne-modal__backdrop {\n opacity: 1;\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n}\n.ne-modal-exit.ne-modal__backdrop {\n opacity: 1;\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n}\n.ne-modal-exit-active.ne-modal__backdrop {\n opacity: 0;\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n}\n.neeto-editor-loader {\n width: 100%;\n height: 32px;\n display: flex;\n align-items: center;\n text-align: center;\n}\n.neeto-editor-loader__spinner-icon {\n width: 16px;\n height: 16px;\n display: inline-block;\n border-radius: var(--neeto-ui-rounded-full);\n border: solid 2px var(--neeto-ui-gray-200);\n border-top-color: var(--neeto-ui-gray-800);\n border-left-color: var(--neeto-ui-gray-800);\n animation: spin 600ms linear infinite;\n margin: 1px auto;\n}\n.neeto-editor-slash-commands__wrapper {\n padding: 12px;\n overflow-y: auto;\n max-height: 384px;\n width: 256px;\n max-width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n gap: 4px;\n}\n.neeto-editor-slash-commands__wrapper::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-slash-commands__wrapper::-webkit-scrollbar-thumb {\n background: rgb(var(--neeto-ui-gray-300));\n border-radius: 50px;\n}\n.neeto-editor-slash-commands__wrapper::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item {\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n padding: 8px 12px;\n gap: 12px;\n border-radius: var(--neeto-ui-rounded);\n transition: var(--neeto-ui-transition);\n cursor: pointer;\n color: rgb(var(--neeto-ui-white));\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item:hover, .neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item.active {\n background-color: rgb(var(--neeto-ui-gray-700));\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item .neeto-editor-slash-commands__item-content h5 {\n font-size: var(--neeto-ui-text-sm);\n font-weight: var(--neeto-ui-font-semibold);\n line-height: var(--neeto-ui-leading-normal);\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item .neeto-editor-slash-commands__item-content p {\n font-size: var(--neeto-ui-text-xs);\n color: rgb(var(--neeto-ui-gray-300));\n}\n.neeto-editor-mentions__wrapper {\n padding: 8px;\n width: 208px;\n max-height: 256px;\n overflow-y: auto;\n}\n.neeto-editor-mentions__wrapper::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-mentions__wrapper::-webkit-scrollbar-thumb {\n background: rgb(var(--neeto-ui-gray-300));\n border-radius: 50px;\n}\n.neeto-editor-mentions__wrapper::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n padding: 8px;\n transition: var(--neeto-ui-transition);\n cursor: pointer;\n font-size: var(--neeto-ui-text-xs);\n color: rgb(var(--neeto-ui-white));\n border-radius: var(--neeto-ui-rounded);\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item p {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item .ne-avatar--container {\n margin-right: 8px;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item:hover, .neeto-editor-mentions__wrapper .neeto-editor-mentions__item.active {\n background-color: rgb(var(--neeto-ui-gray-700));\n}\n.ProseMirror.slash-active p.is-empty:last-child::before {\n content: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkwIiBoZWlnaHQ9IjIzIiB2aWV3Qm94PSIwIDAgMTkwIDIz IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmci Pgo8cmVjdCB4PSIzNCIgeT0iNCIgd2lkdGg9IjE5IiBoZWlnaHQ9IjE5IiByeD0i NCIgZmlsbD0iI0YzRjRGNiIvPgo8cGF0aCBkPSJNNDEuNTA3OCAxOS45NzY2SDQw LjAxNTZMNDQuNDkyMiA3LjYyNUg0NS45ODQ0TDQxLjUwNzggMTkuOTc2NloiIGZp bGw9IiM2QjcyODAiLz4KPHBhdGggZD0iTTguMDMyMjMgOS4xMjY5NUg0LjgzMzAx VjE4SDMuNTI3MzRWOS4xMjY5NUgwLjMzNDk2MVY4LjA0Njg4SDguMDMyMjNWOS4x MjY5NVpNMTEuMjM4MyAxNi4xNDc1TDEyLjk2MDkgMTAuNjAzNUgxNC4zMTQ1TDEx LjM0MDggMTkuMTQxNkMxMC44ODA1IDIwLjM3MjEgMTAuMTQ5MSAyMC45ODczIDku MTQ2NDggMjAuOTg3M0w4LjkwNzIzIDIwLjk2NjhMOC40MzU1NSAyMC44Nzc5VjE5 Ljg1MjVMOC43NzczNCAxOS44Nzk5QzkuMjA1NzMgMTkuODc5OSA5LjUzODQxIDE5 Ljc5MzMgOS43NzUzOSAxOS42MjAxQzEwLjAxNjkgMTkuNDQ2OSAxMC4yMTUyIDE5 LjEzMDIgMTAuMzcwMSAxOC42Njk5TDEwLjY1MDQgMTcuOTE4TDguMDExNzIgMTAu NjAzNUg5LjM5MjU4TDExLjIzODMgMTYuMTQ3NVpNMjEuNjk3MyAxNC4zODM4QzIx LjY5NzMgMTUuNTA5NCAyMS40Mzk4IDE2LjQxNjMgMjAuOTI0OCAxNy4xMDQ1QzIw LjQwOTggMTcuNzkyNiAxOS43MTI2IDE4LjEzNjcgMTguODMzIDE4LjEzNjdDMTcu OTM1MiAxOC4xMzY3IDE3LjIyODggMTcuODUxOSAxNi43MTM5IDE3LjI4MjJWMjAu ODQzOEgxNS40NDkyVjEwLjYwMzVIMTYuNjA0NUwxNi42NjYgMTEuNDIzOEMxNy4x ODEgMTAuNzg1OCAxNy44OTY1IDEwLjQ2NjggMTguODEyNSAxMC40NjY4QzE5Ljcw MTIgMTAuNDY2OCAyMC40MDMgMTAuODAxOCAyMC45MTggMTEuNDcxN0MyMS40Mzc1 IDEyLjE0MTYgMjEuNjk3MyAxMy4wNzM2IDIxLjY5NzMgMTQuMjY3NlYxNC4zODM4 Wk0yMC40MzI2IDE0LjI0MDJDMjAuNDMyNiAxMy40MDYyIDIwLjI1NDkgMTIuNzQ3 NyAxOS44OTk0IDEyLjI2NDZDMTkuNTQzOSAxMS43ODE2IDE5LjA1NjMgMTEuNTQg MTguNDM2NSAxMS41NEMxNy42NzA5IDExLjU0IDE3LjA5NjcgMTEuODc5NiAxNi43 MTM5IDEyLjU1ODZWMTYuMDkyOEMxNy4wOTIxIDE2Ljc2NzMgMTcuNjcwOSAxNy4x MDQ1IDE4LjQ1MDIgMTcuMTA0NUMxOS4wNTYzIDE3LjEwNDUgMTkuNTM3MSAxNi44 NjUyIDE5Ljg5MjYgMTYuMzg2N0MyMC4yNTI2IDE1LjkwMzYgMjAuNDMyNiAxNS4x ODgyIDIwLjQzMjYgMTQuMjQwMlpNMjYuMzc5OSAxOC4xMzY3QzI1LjM3NzMgMTgu MTM2NyAyNC41NjE1IDE3LjgwODYgMjMuOTMyNiAxNy4xNTIzQzIzLjMwMzcgMTYu NDkxNSAyMi45ODkzIDE1LjYwOTcgMjIuOTg5MyAxNC41MDY4VjE0LjI3NDRDMjIu OTg5MyAxMy41NDA3IDIzLjEyODMgMTIuODg2NyAyMy40MDYyIDEyLjMxMjVDMjMu Njg4OCAxMS43MzM3IDI0LjA4MDcgMTEuMjgyNiAyNC41ODIgMTAuOTU5QzI1LjA4 NzkgMTAuNjMwOSAyNS42MzQ4IDEwLjQ2NjggMjYuMjIyNyAxMC40NjY4QzI3LjE4 NDIgMTAuNDY2OCAyNy45MzE2IDEwLjc4MzUgMjguNDY0OCAxMS40MTdDMjguOTk4 IDEyLjA1MDUgMjkuMjY0NiAxMi45NTc0IDI5LjI2NDYgMTQuMTM3N1YxNC42NjQx SDI0LjI1MzlDMjQuMjcyMSAxNS4zOTMyIDI0LjQ4NCAxNS45ODM0IDI0Ljg4OTYg MTYuNDM0NkMyNS4yOTk4IDE2Ljg4MTIgMjUuODE5MyAxNy4xMDQ1IDI2LjQ0ODIg MTcuMTA0NUMyNi44OTQ5IDE3LjEwNDUgMjcuMjczMSAxNy4wMTMzIDI3LjU4MyAx Ni44MzExQzI3Ljg5MjkgMTYuNjQ4OCAyOC4xNjQxIDE2LjQwNzIgMjguMzk2NSAx Ni4xMDY0TDI5LjE2ODkgMTYuNzA4QzI4LjU0OTIgMTcuNjYwNSAyNy42MTk1IDE4 LjEzNjcgMjYuMzc5OSAxOC4xMzY3Wk0yNi4yMjI3IDExLjUwNTlDMjUuNzEyMiAx MS41MDU5IDI1LjI4MzkgMTEuNjkyNyAyNC45Mzc1IDEyLjA2NjRDMjQuNTkxMSAx Mi40MzU1IDI0LjM3NyAxMi45NTUxIDI0LjI5NDkgMTMuNjI1SDI4VjEzLjUyOTND MjcuOTYzNSAxMi44ODY3IDI3Ljc5MDQgMTIuMzkgMjcuNDgwNSAxMi4wMzkxQzI3 LjE3MDYgMTEuNjgzNiAyNi43NTEzIDExLjUwNTkgMjYuMjIyNyAxMS41MDU5WiIg ZmlsbD0iIzZCNzI4MCIvPgo8cGF0aCBkPSJNNTkuNjcyOSA4LjgxMjVWMTAuNjAz NUg2MS4wNTM3VjExLjU4MTFINTkuNjcyOVYxNi4xNjhDNTkuNjcyOSAxNi40NjQy IDU5LjczNDQgMTYuNjg3NSA1OS44NTc0IDE2LjgzNzlDNTkuOTgwNSAxNi45ODM3 IDYwLjE5MDEgMTcuMDU2NiA2MC40ODYzIDE3LjA1NjZDNjAuNjMyMiAxNy4wNTY2 IDYwLjgzMjcgMTcuMDI5MyA2MS4wODc5IDE2Ljk3NDZWMThDNjAuNzU1MiAxOC4w OTExIDYwLjQzMTYgMTguMTM2NyA2MC4xMTcyIDE4LjEzNjdDNTkuNTUyMSAxOC4x MzY3IDU5LjEyNiAxNy45NjU4IDU4LjgzODkgMTcuNjI0QzU4LjU1MTggMTcuMjgy MiA1OC40MDgyIDE2Ljc5NjkgNTguNDA4MiAxNi4xNjhWMTEuNTgxMUg1Ny4wNjE1 VjEwLjYwMzVINTguNDA4MlY4LjgxMjVINTkuNjcyOVpNNjIuMDY1NCAxNC4yMzM0 QzYyLjA2NTQgMTMuNTA4OCA2Mi4yMDY3IDEyLjg1NzEgNjIuNDg5MyAxMi4yNzgz QzYyLjc3NjQgMTEuNjk5NSA2My4xNzI5IDExLjI1MjkgNjMuNjc4NyAxMC45Mzg1 QzY0LjE4OTEgMTAuNjI0IDY0Ljc3MDIgMTAuNDY2OCA2NS40MjE5IDEwLjQ2NjhD NjYuNDI5IDEwLjQ2NjggNjcuMjQyNSAxMC44MTU0IDY3Ljg2MjMgMTEuNTEyN0M2 OC40ODY3IDEyLjIxIDY4Ljc5ODggMTMuMTM3NCA2OC43OTg4IDE0LjI5NDlWMTQu MzgzOEM2OC43OTg4IDE1LjEwMzggNjguNjU5OCAxNS43NTEgNjguMzgxOCAxNi4z MjUyQzY4LjEwODQgMTYuODk0OSA2Ny43MTQyIDE3LjMzOTIgNjcuMTk5MiAxNy42 NTgyQzY2LjY4ODggMTcuOTc3MiA2Ni4xMDA5IDE4LjEzNjcgNjUuNDM1NSAxOC4x MzY3QzY0LjQzMjkgMTguMTM2NyA2My42MTk1IDE3Ljc4ODEgNjIuOTk1MSAxNy4w OTA4QzYyLjM3NTMgMTYuMzkzNiA2Mi4wNjU0IDE1LjQ3MDcgNjIuMDY1NCAxNC4z MjIzVjE0LjIzMzRaTTYzLjMzNjkgMTQuMzgzOEM2My4zMzY5IDE1LjIwNDEgNjMu NTI2IDE1Ljg2MjYgNjMuOTA0MyAxNi4zNTk0QzY0LjI4NzEgMTYuODU2MSA2NC43 OTc1IDE3LjEwNDUgNjUuNDM1NSAxNy4xMDQ1QzY2LjA3ODEgMTcuMTA0NSA2Ni41 ODg1IDE2Ljg1MzggNjYuOTY2OCAxNi4zNTI1QzY3LjM0NTEgMTUuODQ2NyA2Ny41 MzQyIDE1LjE0MDMgNjcuNTM0MiAxNC4yMzM0QzY3LjUzNDIgMTMuNDIyMiA2Ny4z NDA1IDEyLjc2NiA2Ni45NTMxIDEyLjI2NDZDNjYuNTcwMyAxMS43NTg4IDY2LjA1 OTkgMTEuNTA1OSA2NS40MjE5IDExLjUwNTlDNjQuNzk3NSAxMS41MDU5IDY0LjI5 MzkgMTEuNzU0MiA2My45MTExIDEyLjI1MUM2My41MjgzIDEyLjc0NzcgNjMuMzM2 OSAxMy40NTg3IDYzLjMzNjkgMTQuMzgzOFpNNzYuODI0MiAxNy4xMDQ1Qzc3LjI3 NTQgMTcuMTA0NSA3Ny42Njk2IDE2Ljk2NzggNzguMDA2OCAxNi42OTQzQzc4LjM0 NDEgMTYuNDIwOSA3OC41MzA5IDE2LjA3OTEgNzguNTY3NCAxNS42Njg5SDc5Ljc2 MzdDNzkuNzQwOSAxNi4wOTI4IDc5LjU5NTEgMTYuNDk2MSA3OS4zMjYyIDE2Ljg3 ODlDNzkuMDU3MyAxNy4yNjE3IDc4LjY5NzMgMTcuNTY3MSA3OC4yNDYxIDE3Ljc5 NDlDNzcuNzk5NSAxOC4wMjI4IDc3LjMyNTUgMTguMTM2NyA3Ni44MjQyIDE4LjEz NjdDNzUuODE3MSAxOC4xMzY3IDc1LjAxNSAxNy44MDE4IDc0LjQxOCAxNy4xMzE4 QzczLjgyNTUgMTYuNDU3NCA3My41MjkzIDE1LjUzNjggNzMuNTI5MyAxNC4zNzAx VjE0LjE1ODJDNzMuNTI5MyAxMy40MzgyIDczLjY2MTUgMTIuNzk3OSA3My45MjU4 IDEyLjIzNzNDNzQuMTkwMSAxMS42NzY4IDc0LjU2ODQgMTEuMjQxNSA3NS4wNjA1 IDEwLjkzMTZDNzUuNTU3MyAxMC42MjE3IDc2LjE0MjkgMTAuNDY2OCA3Ni44MTc0 IDEwLjQ2NjhDNzcuNjQ2OCAxMC40NjY4IDc4LjMzNSAxMC43MTUyIDc4Ljg4MTgg MTEuMjExOUM3OS40MzMzIDExLjcwODcgNzkuNzI3MiAxMi4zNTM1IDc5Ljc2Mzcg MTMuMTQ2NUg3OC41Njc0Qzc4LjUzMDkgMTIuNjY4IDc4LjM0ODYgMTIuMjc2IDc4 LjAyMDUgMTEuOTcwN0M3Ny42OTY5IDExLjY2MDggNzcuMjk1OSAxMS41MDU5IDc2 LjgxNzQgMTEuNTA1OUM3Ni4xNzQ4IDExLjUwNTkgNzUuNjc1OCAxMS43MzgzIDc1 LjMyMDMgMTIuMjAzMUM3NC45Njk0IDEyLjY2MzQgNzQuNzkzOSAxMy4zMzExIDc0 Ljc5MzkgMTQuMjA2MVYxNC40NDUzQzc0Ljc5MzkgMTUuMjk3NSA3NC45Njk0IDE1 Ljk1MzggNzUuMzIwMyAxNi40MTQxQzc1LjY3MTIgMTYuODc0MyA3Ni4xNzI1IDE3 LjEwNDUgNzYuODI0MiAxNy4xMDQ1Wk04Mi40NTAyIDExLjQ5OUM4My4wMTA3IDEw LjgxMDkgODMuNzM5OSAxMC40NjY4IDg0LjYzNzcgMTAuNDY2OEM4Ni4yMDA4IDEw LjQ2NjggODYuOTg5MyAxMS4zNDg2IDg3LjAwMjkgMTMuMTEyM1YxOEg4NS43Mzgz VjEzLjEwNTVDODUuNzMzNyAxMi41NzIzIDg1LjYxMDcgMTIuMTc4MSA4NS4zNjkx IDExLjkyMjlDODUuMTMyMiAxMS42Njc2IDg0Ljc2MDcgMTEuNTQgODQuMjU0OSAx MS41NEM4My44NDQ3IDExLjU0IDgzLjQ4NDcgMTEuNjQ5NCA4My4xNzQ4IDExLjg2 ODJDODIuODY0OSAxMi4wODY5IDgyLjYyMzQgMTIuMzc0IDgyLjQ1MDIgMTIuNzI5 NVYxOEg4MS4xODU1VjcuNUg4Mi40NTAyVjExLjQ5OVpNOTMuNDYyOSAxOEM5My4z OSAxNy44NTQyIDkzLjMzMDcgMTcuNTk0NCA5My4yODUyIDE3LjIyMDdDOTIuNjk3 MyAxNy44MzE0IDkxLjk5NTQgMTguMTM2NyA5MS4xNzk3IDE4LjEzNjdDOTAuNDUw NSAxOC4xMzY3IDg5Ljg1MTIgMTcuOTMxNiA4OS4zODE4IDE3LjUyMTVDODguOTE3 IDE3LjEwNjggODguNjg0NiAxNi41ODI3IDg4LjY4NDYgMTUuOTQ5MkM4OC42ODQ2 IDE1LjE3OSA4OC45NzYyIDE0LjU4MiA4OS41NTk2IDE0LjE1ODJDOTAuMTQ3NSAx My43Mjk4IDkwLjk3MjMgMTMuNTE1NiA5Mi4wMzQyIDEzLjUxNTZIOTMuMjY0NlYx Mi45MzQ2QzkzLjI2NDYgMTIuNDkyNSA5My4xMzI1IDEyLjE0MTYgOTIuODY4MiAx MS44ODE4QzkyLjYwMzggMTEuNjE3NSA5Mi4yMTQyIDExLjQ4NTQgOTEuNjk5MiAx MS40ODU0QzkxLjI0OCAxMS40ODU0IDkwLjg2OTggMTEuNTk5MyA5MC41NjQ1IDEx LjgyNzFDOTAuMjU5MSAxMi4wNTUgOTAuMTA2NCAxMi4zMzA3IDkwLjEwNjQgMTIu NjU0M0g4OC44MzVDODguODM1IDEyLjI4NTIgODguOTY0OCAxMS45Mjk3IDg5LjIy NDYgMTEuNTg3OUM4OS40ODg5IDExLjI0MTUgODkuODQ0NCAxMC45NjgxIDkwLjI5 MSAxMC43Njc2QzkwLjc0MjIgMTAuNTY3MSA5MS4yMzY3IDEwLjQ2NjggOTEuNzc0 NCAxMC40NjY4QzkyLjYyNjYgMTAuNDY2OCA5My4yOTQzIDEwLjY4MSA5My43Nzcz IDExLjEwOTRDOTQuMjYwNCAxMS41MzMyIDk0LjUxMTEgMTIuMTE4OCA5NC41Mjkz IDEyLjg2NjJWMTYuMjcwNUM5NC41MjkzIDE2Ljk0OTUgOTQuNjE1OSAxNy40ODk2 IDk0Ljc4OTEgMTcuODkwNlYxOEg5My40NjI5Wk05MS4zNjQzIDE3LjAzNjFDOTEu NzYwNyAxNy4wMzYxIDkyLjEzNjcgMTYuOTMzNiA5Mi40OTIyIDE2LjcyODVDOTIu ODQ3NyAxNi41MjM0IDkzLjEwNTEgMTYuMjU2OCA5My4yNjQ2IDE1LjkyODdWMTQu NDExMUg5Mi4yNzM0QzkwLjcyNCAxNC40MTExIDg5Ljk0OTIgMTQuODY0NiA4OS45 NDkyIDE1Ljc3MTVDODkuOTQ5MiAxNi4xNjggOTAuMDgxNCAxNi40Nzc5IDkwLjM0 NTcgMTYuNzAxMkM5MC42MSAxNi45MjQ1IDkwLjk0OTUgMTcuMDM2MSA5MS4zNjQz IDE3LjAzNjFaTTk3LjcwOCAxMC42MDM1TDk3Ljc0OSAxMS41MzMyQzk4LjMxNDEg MTAuODIyMyA5OS4wNTI0IDEwLjQ2NjggOTkuOTYzOSAxMC40NjY4QzEwMS41Mjcg MTAuNDY2OCAxMDIuMzE1IDExLjM0ODYgMTAyLjMyOSAxMy4xMTIzVjE4SDEwMS4w NjRWMTMuMTA1NUMxMDEuMDYgMTIuNTcyMyAxMDAuOTM3IDEyLjE3ODEgMTAwLjY5 NSAxMS45MjI5QzEwMC40NTggMTEuNjY3NiAxMDAuMDg3IDExLjU0IDk5LjU4MTEg MTEuNTRDOTkuMTcwOSAxMS41NCA5OC44MTA5IDExLjY0OTQgOTguNTAxIDExLjg2 ODJDOTguMTkxMSAxMi4wODY5IDk3Ljk0OTUgMTIuMzc0IDk3Ljc3NjQgMTIuNzI5 NVYxOEg5Ni41MTE3VjEwLjYwMzVIOTcuNzA4Wk0xMDMuOTM2IDE0LjI0MDJDMTAz LjkzNiAxMy4wODcyIDEwNC4yMDIgMTIuMTcxMiAxMDQuNzM1IDExLjQ5MjJDMTA1 LjI2OSAxMC44MDg2IDEwNS45NzUgMTAuNDY2OCAxMDYuODU0IDEwLjQ2NjhDMTA3 Ljc1NyAxMC40NjY4IDEwOC40NjEgMTAuNzg1OCAxMDguOTY3IDExLjQyMzhMMTA5 LjAyOCAxMC42MDM1SDExMC4xODRWMTcuODIyM0MxMTAuMTg0IDE4Ljc3OTMgMTA5 Ljg5OSAxOS41MzM1IDEwOS4zMjkgMjAuMDg1QzEwOC43NjQgMjAuNjM2NCAxMDgu MDAzIDIwLjkxMjEgMTA3LjA0NiAyMC45MTIxQzEwNi41MTMgMjAuOTEyMSAxMDUu OTkxIDIwLjc5ODIgMTA1LjQ4IDIwLjU3MDNDMTA0Ljk3IDIwLjM0MjQgMTA0LjU4 IDIwLjAzMDMgMTA0LjMxMiAxOS42MzM4TDEwNC45NjggMTguODc1QzEwNS41MSAx OS41NDQ5IDEwNi4xNzMgMTkuODc5OSAxMDYuOTU3IDE5Ljg3OTlDMTA3LjU3MiAx OS44Nzk5IDEwOC4wNTEgMTkuNzA2NyAxMDguMzkzIDE5LjM2MDRDMTA4LjczOSAx OS4wMTQgMTA4LjkxMiAxOC41MjY0IDEwOC45MTIgMTcuODk3NVYxNy4yNjE3QzEw OC40MDYgMTcuODQ1MSAxMDcuNzE2IDE4LjEzNjcgMTA2Ljg0MSAxOC4xMzY3QzEw NS45NzUgMTguMTM2NyAxMDUuMjczIDE3Ljc4ODEgMTA0LjczNSAxNy4wOTA4QzEw NC4yMDIgMTYuMzkzNiAxMDMuOTM2IDE1LjQ0MzQgMTAzLjkzNiAxNC4yNDAyWk0x MDUuMjA3IDE0LjM4MzhDMTA1LjIwNyAxNS4yMTc4IDEwNS4zNzggMTUuODc0IDEw NS43MiAxNi4zNTI1QzEwNi4wNjIgMTYuODI2NSAxMDYuNTQgMTcuMDYzNSAxMDcu MTU1IDE3LjA2MzVDMTA3Ljk1MyAxNy4wNjM1IDEwOC41MzggMTYuNzAxMiAxMDgu OTEyIDE1Ljk3NjZWMTIuNTk5NkMxMDguNTI1IDExLjg5MzIgMTA3Ljk0NCAxMS41 NCAxMDcuMTY5IDExLjU0QzEwNi41NTQgMTEuNTQgMTA2LjA3MyAxMS43NzkzIDEw NS43MjcgMTIuMjU3OEMxMDUuMzggMTIuNzM2MyAxMDUuMjA3IDEzLjQ0NSAxMDUu MjA3IDE0LjM4MzhaTTExNS4xNjcgMTguMTM2N0MxMTQuMTY0IDE4LjEzNjcgMTEz LjM0OSAxNy44MDg2IDExMi43MiAxNy4xNTIzQzExMi4wOTEgMTYuNDkxNSAxMTEu Nzc2IDE1LjYwOTcgMTExLjc3NiAxNC41MDY4VjE0LjI3NDRDMTExLjc3NiAxMy41 NDA3IDExMS45MTUgMTIuODg2NyAxMTIuMTkzIDEyLjMxMjVDMTEyLjQ3NiAxMS43 MzM3IDExMi44NjggMTEuMjgyNiAxMTMuMzY5IDEwLjk1OUMxMTMuODc1IDEwLjYz MDkgMTE0LjQyMiAxMC40NjY4IDExNS4wMSAxMC40NjY4QzExNS45NzEgMTAuNDY2 OCAxMTYuNzE5IDEwLjc4MzUgMTE3LjI1MiAxMS40MTdDMTE3Ljc4NSAxMi4wNTA1 IDExOC4wNTIgMTIuOTU3NCAxMTguMDUyIDE0LjEzNzdWMTQuNjY0MUgxMTMuMDQx QzExMy4wNTkgMTUuMzkzMiAxMTMuMjcxIDE1Ljk4MzQgMTEzLjY3NyAxNi40MzQ2 QzExNC4wODcgMTYuODgxMiAxMTQuNjA2IDE3LjEwNDUgMTE1LjIzNSAxNy4xMDQ1 QzExNS42ODIgMTcuMTA0NSAxMTYuMDYgMTcuMDEzMyAxMTYuMzcgMTYuODMxMUMx MTYuNjggMTYuNjQ4OCAxMTYuOTUxIDE2LjQwNzIgMTE3LjE4NCAxNi4xMDY0TDEx Ny45NTYgMTYuNzA4QzExNy4zMzYgMTcuNjYwNSAxMTYuNDA3IDE4LjEzNjcgMTE1 LjE2NyAxOC4xMzY3Wk0xMTUuMDEgMTEuNTA1OUMxMTQuNDk5IDExLjUwNTkgMTE0 LjA3MSAxMS42OTI3IDExMy43MjUgMTIuMDY2NEMxMTMuMzc4IDEyLjQzNTUgMTEz LjE2NCAxMi45NTUxIDExMy4wODIgMTMuNjI1SDExNi43ODdWMTMuNTI5M0MxMTYu NzUxIDEyLjg4NjcgMTE2LjU3NyAxMi4zOSAxMTYuMjY4IDEyLjAzOTFDMTE1Ljk1 OCAxMS42ODM2IDExNS41MzggMTEuNTA1OSAxMTUuMDEgMTEuNTA1OVpNMTI5LjI1 NiAxNC4zODM4QzEyOS4yNTYgMTUuNTE0IDEyOC45OTYgMTYuNDIzMiAxMjguNDc3 IDE3LjExMTNDMTI3Ljk1NyAxNy43OTQ5IDEyNy4yNiAxOC4xMzY3IDEyNi4zODUg MTguMTM2N0MxMjUuNDUxIDE4LjEzNjcgMTI0LjcyOCAxNy44MDYzIDEyNC4yMTgg MTcuMTQ1NUwxMjQuMTU2IDE4SDEyMi45OTRWNy41SDEyNC4yNTlWMTEuNDE3QzEy NC43NjkgMTAuNzgzNSAxMjUuNDczIDEwLjQ2NjggMTI2LjM3MSAxMC40NjY4QzEy Ny4yNjkgMTAuNDY2OCAxMjcuOTczIDEwLjgwNjMgMTI4LjQ4MyAxMS40ODU0QzEy OC45OTggMTIuMTY0NCAxMjkuMjU2IDEzLjA5NDEgMTI5LjI1NiAxNC4yNzQ0VjE0 LjM4MzhaTTEyNy45OTEgMTQuMjQwMkMxMjcuOTkxIDEzLjM3ODkgMTI3LjgyNSAx Mi43MTM1IDEyNy40OTIgMTIuMjQ0MUMxMjcuMTYgMTEuNzc0NyAxMjYuNjgxIDEx LjU0IDEyNi4wNTcgMTEuNTRDMTI1LjIyMyAxMS41NCAxMjQuNjIzIDExLjkyNzQg MTI0LjI1OSAxMi43MDIxVjE1LjkwMTRDMTI0LjY0NiAxNi42NzYxIDEyNS4yNSAx Ny4wNjM1IDEyNi4wNyAxNy4wNjM1QzEyNi42NzYgMTcuMDYzNSAxMjcuMTQ4IDE2 LjgyODggMTI3LjQ4NSAxNi4zNTk0QzEyNy44MjMgMTUuODkgMTI3Ljk5MSAxNS4x ODM2IDEyNy45OTEgMTQuMjQwMlpNMTMyLjIyOSAxOEgxMzAuOTY1VjcuNUgxMzIu MjI5VjE4Wk0xMzMuOTI1IDE0LjIzMzRDMTMzLjkyNSAxMy41MDg4IDEzNC4wNjYg MTIuODU3MSAxMzQuMzQ5IDEyLjI3ODNDMTM0LjYzNiAxMS42OTk1IDEzNS4wMzIg MTEuMjUyOSAxMzUuNTM4IDEwLjkzODVDMTM2LjA0OSAxMC42MjQgMTM2LjYzIDEw LjQ2NjggMTM3LjI4MSAxMC40NjY4QzEzOC4yODggMTAuNDY2OCAxMzkuMTAyIDEw LjgxNTQgMTM5LjcyMiAxMS41MTI3QzE0MC4zNDYgMTIuMjEgMTQwLjY1OCAxMy4x Mzc0IDE0MC42NTggMTQuMjk0OVYxNC4zODM4QzE0MC42NTggMTUuMTAzOCAxNDAu NTE5IDE1Ljc1MSAxNDAuMjQxIDE2LjMyNTJDMTM5Ljk2OCAxNi44OTQ5IDEzOS41 NzQgMTcuMzM5MiAxMzkuMDU5IDE3LjY1ODJDMTM4LjU0OCAxNy45NzcyIDEzNy45 NiAxOC4xMzY3IDEzNy4yOTUgMTguMTM2N0MxMzYuMjkyIDE4LjEzNjcgMTM1LjQ3 OSAxNy43ODgxIDEzNC44NTQgMTcuMDkwOEMxMzQuMjM1IDE2LjM5MzYgMTMzLjky NSAxNS40NzA3IDEzMy45MjUgMTQuMzIyM1YxNC4yMzM0Wk0xMzUuMTk2IDE0LjM4 MzhDMTM1LjE5NiAxNS4yMDQxIDEzNS4zODUgMTUuODYyNiAxMzUuNzY0IDE2LjM1 OTRDMTM2LjE0NiAxNi44NTYxIDEzNi42NTcgMTcuMTA0NSAxMzcuMjk1IDE3LjEw NDVDMTM3LjkzOCAxNy4xMDQ1IDEzOC40NDggMTYuODUzOCAxMzguODI2IDE2LjM1 MjVDMTM5LjIwNCAxNS44NDY3IDEzOS4zOTQgMTUuMTQwMyAxMzkuMzk0IDE0LjIz MzRDMTM5LjM5NCAxMy40MjIyIDEzOS4yIDEyLjc2NiAxMzguODEyIDEyLjI2NDZD MTM4LjQzIDExLjc1ODggMTM3LjkxOSAxMS41MDU5IDEzNy4yODEgMTEuNTA1OUMx MzYuNjU3IDExLjUwNTkgMTM2LjE1MyAxMS43NTQyIDEzNS43NzEgMTIuMjUxQzEz NS4zODggMTIuNzQ3NyAxMzUuMTk2IDEzLjQ1ODcgMTM1LjE5NiAxNC4zODM4Wk0x NDUuMjExIDE3LjEwNDVDMTQ1LjY2MiAxNy4xMDQ1IDE0Ni4wNTYgMTYuOTY3OCAx NDYuMzk0IDE2LjY5NDNDMTQ2LjczMSAxNi40MjA5IDE0Ni45MTggMTYuMDc5MSAx NDYuOTU0IDE1LjY2ODlIMTQ4LjE1QzE0OC4xMjggMTYuMDkyOCAxNDcuOTgyIDE2 LjQ5NjEgMTQ3LjcxMyAxNi44Nzg5QzE0Ny40NDQgMTcuMjYxNyAxNDcuMDg0IDE3 LjU2NzEgMTQ2LjYzMyAxNy43OTQ5QzE0Ni4xODYgMTguMDIyOCAxNDUuNzEyIDE4 LjEzNjcgMTQ1LjIxMSAxOC4xMzY3QzE0NC4yMDQgMTguMTM2NyAxNDMuNDAyIDE3 LjgwMTggMTQyLjgwNSAxNy4xMzE4QzE0Mi4yMTIgMTYuNDU3NCAxNDEuOTE2IDE1 LjUzNjggMTQxLjkxNiAxNC4zNzAxVjE0LjE1ODJDMTQxLjkxNiAxMy40MzgyIDE0 Mi4wNDggMTIuNzk3OSAxNDIuMzEyIDEyLjIzNzNDMTQyLjU3NyAxMS42NzY4IDE0 Mi45NTUgMTEuMjQxNSAxNDMuNDQ3IDEwLjkzMTZDMTQzLjk0NCAxMC42MjE3IDE0 NC41MyAxMC40NjY4IDE0NS4yMDQgMTAuNDY2OEMxNDYuMDM0IDEwLjQ2NjggMTQ2 LjcyMiAxMC43MTUyIDE0Ny4yNjkgMTEuMjExOUMxNDcuODIgMTEuNzA4NyAxNDgu MTE0IDEyLjM1MzUgMTQ4LjE1IDEzLjE0NjVIMTQ2Ljk1NEMxNDYuOTE4IDEyLjY2 OCAxNDYuNzM1IDEyLjI3NiAxNDYuNDA3IDExLjk3MDdDMTQ2LjA4NCAxMS42NjA4 IDE0NS42ODMgMTEuNTA1OSAxNDUuMjA0IDExLjUwNTlDMTQ0LjU2MiAxMS41MDU5 IDE0NC4wNjIgMTEuNzM4MyAxNDMuNzA3IDEyLjIwMzFDMTQzLjM1NiAxMi42NjM0 IDE0My4xODEgMTMuMzMxMSAxNDMuMTgxIDE0LjIwNjFWMTQuNDQ1M0MxNDMuMTgx IDE1LjI5NzUgMTQzLjM1NiAxNS45NTM4IDE0My43MDcgMTYuNDE0MUMxNDQuMDU4 IDE2Ljg3NDMgMTQ0LjU1OSAxNy4xMDQ1IDE0NS4yMTEgMTcuMTA0NVpNMTUxLjYz NyAxNC41NzUyTDE1MC44NDQgMTUuNDAyM1YxOEgxNDkuNTc5VjcuNUgxNTAuODQ0 VjEzLjg1MDZMMTUxLjUyMSAxMy4wMzcxTDE1My44MjQgMTAuNjAzNUgxNTUuMzYy TDE1Mi40ODQgMTMuNjkzNEwxNTUuNjk3IDE4SDE1NC4yMTRMMTUxLjYzNyAxNC41 NzUyWk0xNjEuODU2IDguODEyNVYxMC42MDM1SDE2My4yMzdWMTEuNTgxMUgxNjEu ODU2VjE2LjE2OEMxNjEuODU2IDE2LjQ2NDIgMTYxLjkxOCAxNi42ODc1IDE2Mi4w NDEgMTYuODM3OUMxNjIuMTY0IDE2Ljk4MzcgMTYyLjM3NCAxNy4wNTY2IDE2Mi42 NyAxNy4wNTY2QzE2Mi44MTYgMTcuMDU2NiAxNjMuMDE2IDE3LjAyOTMgMTYzLjI3 MSAxNi45NzQ2VjE4QzE2Mi45MzkgMTguMDkxMSAxNjIuNjE1IDE4LjEzNjcgMTYy LjMwMSAxOC4xMzY3QzE2MS43MzYgMTguMTM2NyAxNjEuMzEgMTcuOTY1OCAxNjEu MDIyIDE3LjYyNEMxNjAuNzM1IDE3LjI4MjIgMTYwLjU5MiAxNi43OTY5IDE2MC41 OTIgMTYuMTY4VjExLjU4MTFIMTU5LjI0NVYxMC42MDM1SDE2MC41OTJWOC44MTI1 SDE2MS44NTZaTTE2Ny4xNDEgMTYuMTQ3NUwxNjguODYzIDEwLjYwMzVIMTcwLjIx N0wxNjcuMjQzIDE5LjE0MTZDMTY2Ljc4MyAyMC4zNzIxIDE2Ni4wNTEgMjAuOTg3 MyAxNjUuMDQ5IDIwLjk4NzNMMTY0LjgxIDIwLjk2NjhMMTY0LjMzOCAyMC44Nzc5 VjE5Ljg1MjVMMTY0LjY4IDE5Ljg3OTlDMTY1LjEwOCAxOS44Nzk5IDE2NS40NDEg MTkuNzkzMyAxNjUuNjc4IDE5LjYyMDFDMTY1LjkxOSAxOS40NDY5IDE2Ni4xMTgg MTkuMTMwMiAxNjYuMjcyIDE4LjY2OTlMMTY2LjU1MyAxNy45MThMMTYzLjkxNCAx MC42MDM1SDE2NS4yOTVMMTY3LjE0MSAxNi4xNDc1Wk0xNzcuNiAxNC4zODM4QzE3 Ny42IDE1LjUwOTQgMTc3LjM0MiAxNi40MTYzIDE3Ni44MjcgMTcuMTA0NUMxNzYu MzEyIDE3Ljc5MjYgMTc1LjYxNSAxOC4xMzY3IDE3NC43MzUgMTguMTM2N0MxNzMu ODM4IDE4LjEzNjcgMTczLjEzMSAxNy44NTE5IDE3Mi42MTYgMTcuMjgyMlYyMC44 NDM4SDE3MS4zNTJWMTAuNjAzNUgxNzIuNTA3TDE3Mi41NjggMTEuNDIzOEMxNzMu MDgzIDEwLjc4NTggMTczLjc5OSAxMC40NjY4IDE3NC43MTUgMTAuNDY2OEMxNzUu NjA0IDEwLjQ2NjggMTc2LjMwNSAxMC44MDE4IDE3Ni44MiAxMS40NzE3QzE3Ny4z NCAxMi4xNDE2IDE3Ny42IDEzLjA3MzYgMTc3LjYgMTQuMjY3NlYxNC4zODM4Wk0x NzYuMzM1IDE0LjI0MDJDMTc2LjMzNSAxMy40MDYyIDE3Ni4xNTcgMTIuNzQ3NyAx NzUuODAyIDEyLjI2NDZDMTc1LjQ0NiAxMS43ODE2IDE3NC45NTkgMTEuNTQgMTc0 LjMzOSAxMS41NEMxNzMuNTczIDExLjU0IDE3Mi45OTkgMTEuODc5NiAxNzIuNjE2 IDEyLjU1ODZWMTYuMDkyOEMxNzIuOTk0IDE2Ljc2NzMgMTczLjU3MyAxNy4xMDQ1 IDE3NC4zNTMgMTcuMTA0NUMxNzQuOTU5IDE3LjEwNDUgMTc1LjQzOSAxNi44NjUy IDE3NS43OTUgMTYuMzg2N0MxNzYuMTU1IDE1LjkwMzYgMTc2LjMzNSAxNS4xODgy IDE3Ni4zMzUgMTQuMjQwMlpNMTgyLjI4MiAxOC4xMzY3QzE4MS4yOCAxOC4xMzY3 IDE4MC40NjQgMTcuODA4NiAxNzkuODM1IDE3LjE1MjNDMTc5LjIwNiAxNi40OTE1 IDE3OC44OTIgMTUuNjA5NyAxNzguODkyIDE0LjUwNjhWMTQuMjc0NEMxNzguODky IDEzLjU0MDcgMTc5LjAzMSAxMi44ODY3IDE3OS4zMDkgMTIuMzEyNUMxNzkuNTkx IDExLjczMzcgMTc5Ljk4MyAxMS4yODI2IDE4MC40ODQgMTAuOTU5QzE4MC45OSAx MC42MzA5IDE4MS41MzcgMTAuNDY2OCAxODIuMTI1IDEwLjQ2NjhDMTgzLjA4NyAx MC40NjY4IDE4My44MzQgMTAuNzgzNSAxODQuMzY3IDExLjQxN0MxODQuOSAxMi4w NTA1IDE4NS4xNjcgMTIuOTU3NCAxODUuMTY3IDE0LjEzNzdWMTQuNjY0MUgxODAu MTU2QzE4MC4xNzQgMTUuMzkzMiAxODAuMzg2IDE1Ljk4MzQgMTgwLjc5MiAxNi40 MzQ2QzE4MS4yMDIgMTYuODgxMiAxODEuNzIyIDE3LjEwNDUgMTgyLjM1MSAxNy4x MDQ1QzE4Mi43OTcgMTcuMTA0NSAxODMuMTc1IDE3LjAxMzMgMTgzLjQ4NSAxNi44 MzExQzE4My43OTUgMTYuNjQ4OCAxODQuMDY2IDE2LjQwNzIgMTg0LjI5OSAxNi4x MDY0TDE4NS4wNzEgMTYuNzA4QzE4NC40NTEgMTcuNjYwNSAxODMuNTIyIDE4LjEz NjcgMTgyLjI4MiAxOC4xMzY3Wk0xODIuMTI1IDExLjUwNTlDMTgxLjYxNSAxMS41 MDU5IDE4MS4xODYgMTEuNjkyNyAxODAuODQgMTIuMDY2NEMxODAuNDkzIDEyLjQz NTUgMTgwLjI3OSAxMi45NTUxIDE4MC4xOTcgMTMuNjI1SDE4My45MDJWMTMuNTI5 M0MxODMuODY2IDEyLjg4NjcgMTgzLjY5MyAxMi4zOSAxODMuMzgzIDEyLjAzOTFD MTgzLjA3MyAxMS42ODM2IDE4Mi42NTQgMTEuNTA1OSAxODIuMTI1IDExLjUwNTla IiBmaWxsPSIjNkI3MjgwIi8+Cjwvc3ZnPgo=");\n position: absolute;\n top: -2px;\n height: 0;\n pointer-events: none;\n}\n.neeto-editor {\n max-width: 100% !important;\n border-radius: var(--neeto-ui-rounded);\n white-space: pre-wrap;\n padding: 12px;\n color: rgb(var(--neeto-ui-gray-800));\n}\n.neeto-editor:focus {\n outline: none;\n}\n.neeto-editor a {\n pointer-events: none;\n}\n.neeto-editor mark {\n background: rgb(var(--neeto-ui-pastel-green));\n border-radius: var(--neeto-ui-rounded-sm);\n padding: 0px 4px;\n color: inherit;\n}\n.neeto-editor [data-variable] {\n display: inline-flex;\n color: rgb(var(--neeto-ui-gray-700));\n background-color: rgb(var(--neeto-ui-gray-200));\n border-radius: var(--neeto-ui-rounded-sm);\n line-height: 1;\n padding: 4px 6px;\n}\n.neeto-editor .ProseMirror-separator {\n display: none;\n}\n.neeto-editor.fixed-menu-active {\n border: thin solid rgb(var(--neeto-ui-gray-300));\n border-radius: 0px 0px var(--neeto-ui-rounded) var(--neeto-ui-rounded);\n}\n.neeto-editor .is-empty {\n position: relative;\n}\n.neeto-editor.placeholder-active:not(.force-title) .is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title h1:first-child {\n position: relative;\n margin-bottom: 20px;\n}\n.neeto-editor.force-title .is-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title.placeholder-active .is-empty:nth-child(2):last-child:before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title.force-title--error .is-empty:first-child::after {\n position: absolute;\n content: "Title can\'t be blank";\n left: 0;\n bottom: -12px;\n color: rgb(var(--neeto-ui-error));\n pointer-events: none;\n font-size: 12px;\n}\n.neeto-editor hr {\n margin: 8px 0;\n}\n.neeto-editor .ProseMirror-selectednode {\n outline: 3px solid rgb(var(--neeto-ui-pastel-blue));\n}\n.neeto-editor .has-focus {\n background: var(--focus-background-color);\n transition: background-color 200ms ease;\n}\n.neeto-editor-character-count {\n padding: 4px;\n color: rgb(var(--neeto-ui-gray-600));\n font-size: 12px;\n text-align: right;\n}\n.neeto-editor-error {\n color: rgb(var(--neeto-ui-error-500));\n border-width: 1px;\n border-color: rgb(var(--neeto-ui-error-500));\n border-radius: var(--neeto-ui-rounded);\n}\n.neeto-editor-error:focus-within {\n border-color: rgb(var(--neeto-ui-error-600));\n}\n.neeto-editor-content, .neeto-editor {\n white-space: pre-wrap;\n word-break: break-word;\n}\n.neeto-editor-content h1, .neeto-editor h1,\n.neeto-editor-content h2,\n.neeto-editor h2,\n.neeto-editor-content h3,\n.neeto-editor h3,\n.neeto-editor-content h4,\n.neeto-editor h4,\n.neeto-editor-content h5,\n.neeto-editor h5,\n.neeto-editor-content h6,\n.neeto-editor h6 {\n font-size: revert;\n margin: 16px 0;\n}\n.neeto-editor-content p, .neeto-editor p {\n line-height: var(--neeto-ui-leading-normal);\n color: rgb(var(--neeto-ui-gray-700));\n margin-bottom: 8px;\n}\n.neeto-editor-content p:empty::after, .neeto-editor p:empty::after {\n content: " ";\n}\n.neeto-editor-content p:last-child, .neeto-editor p:last-child {\n margin-bottom: 0;\n}\n.neeto-editor-content code, .neeto-editor code {\n padding: 0.2em 0.4em;\n font-size: 85%;\n border-radius: 6px;\n background-color: rgba(175, 184, 193, 0.2);\n font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;\n}\n.neeto-editor-content pre, .neeto-editor pre {\n background-color: #f6f8fa;\n overflow-x: auto;\n font-size: 14px;\n line-height: 20px;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: var(--neeto-ui-rounded-sm);\n padding: 16px;\n}\n.neeto-editor-content pre > code, .neeto-editor pre > code {\n background-color: transparent;\n border-width: 0;\n border-radius: 0;\n padding: 0;\n font-weight: 400;\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n line-height: inherit;\n}\n.neeto-editor-content blockquote, .neeto-editor blockquote {\n font-weight: var(--neeto-ui-font-medium);\n color: rgb(var(--neeto-ui-black));\n border-left-width: 4px;\n border-left-color: #e5e7eb;\n quotes: "“" "”" "‘" "’";\n margin: 8px 0;\n padding-left: 12px;\n}\n.neeto-editor-content blockquote > p::before, .neeto-editor blockquote > p::before {\n content: "" !important;\n}\n.neeto-editor-content blockquote > p::after, .neeto-editor blockquote > p::after {\n content: "" !important;\n}\n.neeto-editor-content ul, .neeto-editor ul,\n.neeto-editor-content ol,\n.neeto-editor ol {\n list-style: revert;\n margin: revert;\n padding: revert;\n}\n.neeto-editor-content ul > li > p, .neeto-editor ul > li > p,\n.neeto-editor-content ol > li > p,\n.neeto-editor ol > li > p {\n margin-top: 0 !important;\n margin-bottom: 0.375rem !important;\n}\n.neeto-editor-content ul li::before, .neeto-editor ul li::before,\n.neeto-editor-content ol li::before,\n.neeto-editor ol li::before {\n background-color: rgb(var(--neeto-ui-black));\n}\n.neeto-editor-content a[href], .neeto-editor a[href] {\n color: rgb(var(--neeto-ui-primary-800));\n font-weight: 500;\n}\n.neeto-editor-content .video-wrapper, .neeto-editor .video-wrapper {\n width: 560px;\n height: 315px;\n margin: auto;\n}\n.neeto-editor-content mark, .neeto-editor mark {\n background: rgb(var(--neeto-ui-pastel-green));\n border-radius: var(--neeto-ui-rounded-sm);\n padding: 0px 4px;\n color: inherit;\n}\n.neeto-editor-content [data-variable], .neeto-editor [data-variable] {\n display: inline-flex;\n color: rgb(var(--neeto-ui-gray-700));\n background-color: rgb(var(--neeto-ui-gray-200));\n border-radius: var(--neeto-ui-rounded-sm);\n line-height: 1;\n padding: 4px 6px;\n}\n.neeto-editor-content [data-type=mention], .neeto-editor [data-type=mention] {\n color: rgb(var(--neeto-ui-primary-800));\n}\n.neeto-editor-content--hidden {\n display: none;\n}\n.neeto-editor__image {\n display: inline-block;\n border: 1.5px solid rgb(var(--neeto-ui-pastel-blue));\n margin: 0 12px;\n}\n.neeto-editor__image figure {\n margin: 16px 12px;\n outline: none;\n}\n.neeto-editor__image figure img {\n height: 100%;\n width: 100%;\n -webkit-user-select: auto;\n -moz-user-select: auto;\n user-select: auto;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.neeto-editor__image figure figcaption {\n color: rgb(var(--neeto-ui-gray-700));\n text-align: center;\n}\n.neeto-editor__image-defaults {\n width: -moz-fit-content;\n width: fit-content;\n}\n.neeto-editor__image--none {\n display: flex;\n justify-content: center;\n}\n.neeto-editor__image--left {\n float: left;\n margin-left: 0;\n}\n.neeto-editor__image--right {\n float: right;\n margin-right: 0;\n}\n.neeto-editor__image--center {\n margin: 0 auto;\n}\n.neeto-editor-fixed-menu {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n overflow-x: auto;\n border: thin solid rgb(var(--neeto-ui-gray-300));\n border-bottom: none;\n border-radius: var(--neeto-ui-rounded) var(--neeto-ui-rounded) 0px 0px;\n background-color: rgb(var(--neeto-ui-gray-100));\n}\n.neeto-editor-fixed-menu::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-fixed-menu::-webkit-scrollbar-thumb {\n background: rgb(var(--neeto-ui-gray-300));\n border-radius: 50px;\n}\n.neeto-editor-fixed-menu::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding: 10px;\n cursor: pointer;\n transition: var(--neeto-ui-transition);\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item:hover, .neeto-editor-fixed-menu .neeto-editor-fixed-menu__item.active {\n background-color: rgb(var(--neeto-ui-gray-200));\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item input[type=color] {\n visibility: hidden;\n height: 0;\n width: 0;\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu-addons {\n display: flex;\n align-items: center;\n margin-left: auto;\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__emoji-dropdown {\n max-height: unset;\n}\n.neeto-editor-variables-suggestion {\n padding: 4px 0;\n}\n.neeto-editor-variables-list {\n padding: 4px 8px;\n min-width: 184px;\n max-width: 360px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block:not(:last-child) {\n margin-bottom: 12px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block h6 {\n font-size: var(--neeto-ui-text-xs);\n font-weight: var(--neeto-ui-font-medium);\n color: rgb(var(--neeto-ui-gray-600));\n margin-bottom: 4px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row .neeto-editor-variable {\n padding: 4px 6px;\n font-size: var(--neeto-ui-text-xs);\n color: rgb(var(--neeto-ui-gray-700));\n line-height: 1;\n background-color: rgb(var(--neeto-ui-pastel-blue));\n border-radius: var(--neeto-ui-rounded-sm);\n transition: var(--neeto-ui-transition);\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row .neeto-editor-variable:hover {\n background-color: rgb(var(--neeto-ui-info-100));\n}\n.neeto-editor-link-wrapper .ne-dropdown__popup {\n padding: 8px;\n width: 100%;\n max-width: 400px;\n}\n.neeto-editor-link-wrapper .ne-dropdown__popup .neeto-editor-link__item {\n display: flex !important;\n flex-direction: row;\n justify-content: flex-start;\n align-items: flex-start;\n gap: 8px;\n}\n.neeto-editor-font-size-wrapper .ne-dropdown__popup-menu {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n padding: 4px;\n}\n.neeto-editor-bubble-menu {\n position: relative;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n border-radius: var(--neeto-ui-rounded);\n background: rgb(var(--neeto-ui-gray-800));\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__item {\n padding: 8px;\n cursor: pointer;\n transition: var(--neeto-ui-transition);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__item:hover, .neeto-editor-bubble-menu .neeto-editor-bubble-menu__item:active, .neeto-editor-bubble-menu .neeto-editor-bubble-menu__item.active {\n background-color: rgb(var(--neeto-ui-gray-700));\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__item:first-child {\n border-top-left-radius: var(--neeto-ui-rounded);\n border-bottom-left-radius: var(--neeto-ui-rounded);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__item:last-child {\n border-top-right-radius: var(--neeto-ui-rounded);\n border-bottom-right-radius: var(--neeto-ui-rounded);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link {\n display: flex;\n align-items: center;\n padding: 8px;\n gap: 8px;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input {\n background-color: transparent;\n outline: none;\n line-height: 20px;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input::-moz-placeholder {\n color: rgba(var(--neeto-ui-white, 0.4));\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input::placeholder {\n color: rgba(var(--neeto-ui-white, 0.4));\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .ne-btn--icon-only {\n padding: 0;\n min-height: 0;\n opacity: 0.8;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .ne-btn--icon-only:hover {\n opacity: 1;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__dropdown-target {\n display: flex;\n align-items: center;\n gap: 4px;\n white-space: nowrap;\n font-size: var(--neeto-ui-text-sm);\n line-height: var(--neeto-ui-leading-normal);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__dropdown {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__dropdown .neeto-editor-bubble-menu__dropdown-item {\n width: 100%;\n text-align: left;\n padding: 8px 12px;\n font-size: var(--neeto-ui-text-xs);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__dropdown .neeto-editor-bubble-menu__dropdown-item:first-child {\n border-top-left-radius: var(--neeto-ui-rounded);\n border-top-right-radius: var(--neeto-ui-rounded);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__dropdown .neeto-editor-bubble-menu__dropdown-item:last-child {\n border-bottom-left-radius: var(--neeto-ui-rounded);\n border-bottom-right-radius: var(--neeto-ui-rounded);\n}\n.neeto-editor-bubble-menu-animate-shake {\n animation: 1s linear infinite alternate both shake;\n}\n.neeto-editor-image-uploader {\n display: flex;\n flex-direction: column;\n min-height: 184px;\n}\n.neeto-editor-image-uploader .ne-tab__wrapper .ne-tab {\n min-width: 88px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__content {\n flex-grow: 1;\n display: flex;\n padding: 16px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n text-align: center;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress-title, .neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-label {\n color: rgb(var(--neeto-ui-gray-700));\n font-size: var(--neeto-ui-text-sm);\n margin-bottom: 4px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress-file, .neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-note {\n color: rgb(var(--neeto-ui-gray-400));\n font-size: var(--neeto-ui-text-xs);\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n border: 1px dashed rgb(var(--neeto-ui-gray-400));\n box-sizing: border-box;\n border-radius: var(--neeto-ui-rounded);\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-Root {\n width: 100%;\n height: 100%;\n background-color: rgb(var(--neeto-ui-white));\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-Root::-moz-focus-inner {\n border: 0;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-inner {\n display: flex;\n flex-direction: column;\n justify-content: center;\n line-height: 1.4;\n text-align: center;\n font-weight: var(--neeto-ui-font-normal);\n margin: 0;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-arrow {\n visibility: hidden;\n display: none;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop--isDraggingOver {\n background-color: rgb(var(--neeto-ui-gray-200));\n border: 2px dashed rgb(var(--neeto-ui-secondary-indigo));\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-browse {\n color: rgb(var(--neeto-ui-secondary-indigo));\n font-size: var(--neeto-ui-text-sm);\n font-weight: var(--neeto-ui-font-semibold);\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd--error {\n color: rgb(var(--neeto-ui-error));\n font-size: var(--neeto-ui-text-xs);\n margin-top: 12px;\n text-align: center;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper {\n width: 100%;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .ne-input__wrapper {\n width: 100%;\n flex-grow: 0;\n margin-bottom: 16px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container {\n max-height: 50vh;\n overflow-y: auto;\n overflow-x: hidden;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container::-webkit-scrollbar-thumb {\n background: rgb(var(--neeto-ui-gray-300));\n border-radius: 50px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery {\n width: 100%;\n right: -8px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item {\n width: 33.3%;\n padding-right: 16px;\n padding-bottom: 16px;\n float: left;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder {\n width: 100%;\n position: relative;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner {\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: rgb(var(--neeto-ui-gray-100));\n border-radius: var(--neeto-ui-rounded-sm);\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner img {\n height: 100%;\n width: 100%;\n -o-object-fit: cover;\n object-fit: cover;\n animation: fade-in 1.2s 1s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n border-radius: var(--neeto-ui-rounded);\n position: relative;\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner a {\n opacity: 0;\n position: absolute;\n left: 8px;\n bottom: 8px;\n margin: auto;\n color: rgb(var(--neeto-ui-white));\n font-size: 12px;\n font-weight: var(--neeto-ui-font-normal);\n line-height: 1;\n text-transform: capitalize;\n transition: var(--neeto-ui-transition);\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner a:hover {\n text-decoration: underline;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner:hover a {\n opacity: 1;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__text {\n font-size: var(--neeto-ui-text-xs);\n color: rgb(var(--neeto-ui-gray-800));\n text-align: center;\n margin-top: 12px;\n}\n.neeto-editor-progress-bar__wrapper {\n width: 100%;\n max-width: 256px;\n margin-top: 10px;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__percent {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__percent p {\n font-size: var(--neeto-ui-text-xs);\n color: rgb(var(--neeto-ui-gray-800));\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__indicator {\n position: relative;\n width: 100%;\n height: 6px;\n border-radius: var(--neeto-ui-rounded-full);\n overflow: hidden;\n background-color: rgba(var(--neeto-ui-secondary-indigo, 0.2));\n margin-top: 4px;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__indicator-inner {\n height: 100%;\n background-color: rgb(var(--neeto-ui-secondary-indigo));\n}\n.neeto-editor-url-form__wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n padding: 0 24px;\n}\n.neeto-editor-url-form__wrapper .ne-input__wrapper {\n width: 100%;\n flex-grow: 0;\n margin-bottom: 16px;\n}\n.neeto-editor-emoji {\n font-family: apple color emoji, segoe ui emoji, noto color emoji, android emoji, emojisymbols, emojione mozilla, twemoji mozilla, segoe ui symbol;\n}\n.emoji-mart.emoji-mart-light {\n font-size: 14px;\n color: rgb(var(--neeto-ui-gray-800));\n border: none;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor {\n color: rgb(var(--neeto-ui-gray-500));\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor svg {\n margin: auto;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor .emoji-mart-anchor-bar {\n background-color: rgb(var(--neeto-ui-gray-800)) !important;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor.emoji-mart-anchor-selected {\n color: rgb(var(--neeto-ui-gray-800)) !important;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-search input {\n border-radius: var(--neeto-ui-rounded-sm);\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-category-label span {\n padding-top: 8px;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-emoji span {\n cursor: pointer;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-emoji:hover::before {\n background-color: rgb(var(--neeto-ui-gray-200));\n border-radius: var(--neeto-ui-rounded-sm);\n}\n.emoji-mart.emoji-mart-light .emoji-mart-scroll {\n height: 264px;\n padding-bottom: 0px;\n}\n.neeto-editor-emoji-suggestion {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n padding: 4px;\n gap: 2px;\n font-family: apple color emoji, segoe ui emoji, noto color emoji, android emoji, emojisymbols, emojione mozilla, twemoji mozilla, segoe ui symbol;\n}\n.neeto-editor-emoji-suggestion p {\n font-size: var(--neeto-ui-text-xs);\n color: rgb(var(--neeto-ui-gray-800));\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item {\n padding: 6px;\n font-size: var(--neeto-ui-text-2xl);\n transition: var(--neeto-ui-transition);\n border-radius: var(--neeto-ui-rounded-sm);\n line-height: 1;\n cursor: pointer;\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item:hover {\n background-color: rgb(var(--neeto-ui-gray-200));\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item--selected {\n background-color: rgb(var(--neeto-ui-gray-200));\n}\n.neeto-editor-image-editor {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1.25rem;\n}\n.neeto-editor-image-editor figure {\n display: flex;\n flex-direction: column;\n justify-content: center;\n min-height: 208px;\n max-height: 400px;\n height: -moz-fit-content;\n height: fit-content;\n}\n.neeto-editor-image-editor figure img {\n height: 100%;\n width: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.neeto-editor-image-editor__error {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n text-align: center;\n min-height: 288px;\n max-height: 400px;\n width: 100%;\n padding: 24px;\n background: rgb(var(--neeto-ui-gray-100));\n border-radius: var(--neeto-ui-rounded-sm);\n gap: 8px;\n}\n.neeto-editor-image-editor__error h2 {\n font-size: var(--neeto-ui-text-lg);\n font-weight: var(--neeto-ui-font-medium);\n}\n.neeto-editor-image-editor .ne-input__wrapper {\n width: 100%;\n}\n.neeto-editor-image-editor .neeto-editor-image-editor__footer {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 0.5rem;\n}\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;\n}\n.ProseMirror {\n overflow-y: auto;\n height: 100%;\n white-space: break-spaces;\n}\n.ProseMirror::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.ProseMirror::-webkit-scrollbar-thumb {\n background: rgb(var(--neeto-ui-gray-300));\n border-radius: 50px;\n}\n.ProseMirror::-webkit-scrollbar-track {\n background: "transparent";\n}\n.ProseMirror:focus {\n outline: none;\n}',{}),A.prototype={constructor:A,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var i=n&&n!=e?this.remove(n):this,o=i.find(e),r=i.content.slice();return-1==o?r.push(n||e,t):(r[o+1]=t,n&&(r[o]=n)),new A(r)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new A(n)},addToStart:function(e,t){return new A([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new A(n)},addBefore:function(e,t,n){var i=this.remove(t),o=i.content.slice(),r=i.find(e);return o.splice(-1==r?o.length:r,0,t,n),new A(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=A.from(e)).size?new A(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=A.from(e)).size?new A(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=A.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}},A.from=function(e){if(e instanceof A)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new A(t)};class z{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,i=0,o){for(let r=0,s=0;s<t;r++){let a=this.content[r],l=s+a.nodeSize;if(l>e&&!1!==n(a,i+s,o||null,r)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,e-o),Math.min(a.content.size,t-o),n,i+o)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let o="",r=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(o+=s.text.slice(Math.max(e,a)-a,t-a),r=!n):s.isLeaf?(i?o+="function"==typeof i?i(s):i:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),r=!n):!r&&s.isBlock&&(o+=n,r=!0)}),0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new z(i,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],i=0;if(t>e)for(let o=0,r=0;r<t;o++){let s=this.content[o],a=r+s.nodeSize;a>e&&((r<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-r),Math.min(s.text.length,t-r)):s.cut(Math.max(0,e-r-1),Math.min(s.content.size,t-r-1))),n.push(s),i+=s.nodeSize),r=a}return new z(n,i)}cutByIndex(e,t){return e==t?z.empty:0==e&&t==this.content.length?this:new z(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new z(i,o)}addToStart(e){return new z([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new z(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 i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return j(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return I(this,e,t,n)}findIndex(e,t=-1){if(0==e)return R(0,e);if(e==this.size)return R(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let o=i+this.child(n).nodeSize;if(o>=e)return o==e||t>0?R(n+1,o):R(n,i);i=o}}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 z.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new z(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return z.empty;let t,n=0;for(let i=0;i<e.length;i++){let o=e[i];n+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new z(t||e,n)}static from(e){if(!e)return z.empty;if(e instanceof z)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new z([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}z.empty=new z([],0);const L={index:0,offset:0};function R(e,t){return L.index=e,L.offset=t,L}function F(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(!F(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!F(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class P{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(o)}}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&&F(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 P.none;if(e instanceof P)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}P.none=[];class B extends Error{}class U{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=H(this.content,e+this.openStart,t);return n&&new U(n,this.openStart,this.openEnd)}removeBetween(e,t){return new U($(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 U.empty;let n=t.openStart||0,i=t.openEnd||0;if("number"!=typeof n||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new U(z.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)i++;return new U(e,n,i)}}function $(e,t,n){let{index:i,offset:o}=e.findIndex(t),r=e.maybeChild(i),{index:s,offset:a}=e.findIndex(n);if(o==t||r.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(i,r.copy($(r.content,t-o-1,n-o-1)))}function H(e,t,n,i){let{index:o,offset:r}=e.findIndex(t),s=e.maybeChild(o);if(r==t||s.isText)return i&&!i.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=H(s.content,t-r-1,n);return a&&e.replaceChild(o,s.copy(a))}function V(e,t,n){if(n.openStart>e.depth)throw new B("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new B("Inconsistent open depths");return q(e,t,n,0)}function q(e,t,n,i){let o=e.index(i),r=e.node(i);if(o==t.index(i)&&i<e.depth-n.openStart){let s=q(e,t,n,i+1);return r.copy(r.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=i||t.depth!=i){let{start:o,end:s}=function(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)i=t.node(e).copy(z.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}(n,e);return G(r,J(e,o,s,t,i))}{let i=e.parent,o=i.content;return G(i,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}}return G(r,Z(e,t,i))}function W(e,t){if(!t.type.compatibleContent(e.type))throw new B("Cannot join "+t.type.name+" onto "+e.type.name)}function K(e,t,n){let i=e.node(n);return W(i,t.node(n)),i}function Y(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 Q(e,t,n,i){let o=(t||e).node(n),r=0,s=t?t.index(n):o.childCount;e&&(r=e.index(n),e.depth>n?r++:e.textOffset&&(Y(e.nodeAfter,i),r++));for(let e=r;e<s;e++)Y(o.child(e),i);t&&t.depth==n&&t.textOffset&&Y(t.nodeBefore,i)}function G(e,t){if(!e.type.validContent(t))throw new B("Invalid content for node "+e.type.name);return e.copy(t)}function J(e,t,n,i,o){let r=e.depth>o&&K(e,t,o+1),s=i.depth>o&&K(n,i,o+1),a=[];return Q(null,e,o,a),r&&s&&t.index(o)==n.index(o)?(W(r,s),Y(G(r,J(e,t,n,i,o+1)),a)):(r&&Y(G(r,Z(e,t,o+1)),a),Q(t,n,o,a),s&&Y(G(s,Z(n,i,o+1)),a)),Q(i,null,o,a),new z(a)}function Z(e,t,n){let i=[];if(Q(null,e,n,i),e.depth>n){Y(G(K(e,t,n+1),Z(e,t,n+1)),i)}return Q(t,null,n,i),new z(i)}U.empty=new U(z.empty,0,0);class X{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],i=e.child(t);return n?e.child(t).cut(n):i}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],i=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)i+=n.child(t).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return P.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let e=n;n=i,i=e}let o=n.marks;for(var r=0;r<o.length;r++)!1!==o[r].type.spec.inclusive||i&&o[r].isInSet(i.marks)||(o=o[r--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||i&&n[o].isInSet(i.marks)||(n=n[o--].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 ie(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=[],i=0,o=t;for(let t=e;;){let{index:e,offset:r}=t.content.findIndex(o),s=o-r;if(n.push(t,e,i+r),!s)break;if(t=t.child(e),t.isText)break;o=s-1,i+=r+1}return new X(t,n,o)}static resolveCached(e,t){for(let n=0;n<ee.length;n++){let i=ee[n];if(i.pos==t&&i.doc==e)return i}let n=ee[te]=X.resolve(e,t);return te=(te+1)%ne,n}}let ee=[],te=0,ne=12;class ie{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 oe=Object.create(null);class re{constructor(e,t,n,i=P.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||z.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,i=0){this.content.nodesBetween(e,t,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,i){return this.content.textBetween(e,t,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&F(this.attrs,t||e.defaultAttrs||oe)&&P.sameSet(this.marks,n||P.none)}copy(e=null){return e==this.content?this:new re(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new re(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 U.empty;let i=this.resolve(e),o=this.resolve(t),r=n?0:i.sharedDepth(t),s=i.start(r),a=i.node(r).content.cut(i.pos-s,o.pos-s);return new U(a,i.depth-r,o.depth-r)}replace(e,t,n){return V(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+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 i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return X.resolveCached(this,e)}resolveNoCache(e){return X.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(i=!0),!i))),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),ae(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=z.empty,i=0,o=n.childCount){let r=this.contentMatchAt(e).matchFragment(n,i,o),s=r&&r.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=i;e<o;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(n),r=o&&o.matchFragment(this.content,t);return!!r&&r.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){if(!this.type.validContent(this.content))throw new RangeError(`Invalid content for node ${this.type.name}: ${this.content.toString().slice(0,50)}`);let e=P.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!P.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 i=z.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,n)}}re.prototype.text=void 0;class se extends re{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ae(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 se(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new se(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 ae(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class le{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new ce(e,t);if(null==n.next)return le.empty;let i=pe(n);n.next&&n.err("Unexpected trailing text");let o=function(e){let t=Object.create(null);return n(ge(e,0));function n(i){let o=[];i.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let i;for(let e=0;e<o.length;e++)o[e][0]==t&&(i=o[e][1]);ge(e,n).forEach((e=>{i||o.push([t,i=[]]),-1==i.indexOf(e)&&i.push(e)}))}))}));let r=t[i.join(",")]=new le(i.indexOf(e.length-1)>-1);for(let e=0;e<o.length;e++){let i=o[e][1].sort(fe);r.next.push({type:o[e][0],next:t[i.join(",")]||n(i)})}return r}}(function(e){let t=[[]];return o(r(e,0),n()),t;function n(){return t.push([])-1}function i(e,n,i){let o={term:i,to:n};return t[e].push(o),o}function o(e,t){e.forEach((e=>e.to=t))}function r(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(r(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return i(t,s),o(r(e.expr,s),s),[i(s)]}if("plus"==e.type){let s=n();return o(r(e.expr,t),s),o(r(e.expr,s),s),[i(s)]}if("opt"==e.type)return[i(t)].concat(r(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();o(r(e.expr,s),t),s=t}if(-1==e.max)o(r(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();i(s,t),o(r(e.expr,s),t),s=t}return[i(s)]}if("name"==e.type)return[i(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let i=0;;i++){let s=r(e.exprs[i],t);if(i==e.exprs.length-1)return s;o(s,t=n())}}}(i));return function(e,t){for(let n=0,i=[e];n<i.length;n++){let e=i[n],o=!e.validEnd,r=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];r.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==i.indexOf(s)&&i.push(s)}o&&t.err("Only non-generatable nodes ("+r.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}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 i=this;for(let o=t;i&&o<n;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return 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 i=[this];return function o(r,s){let a=r.matchFragment(e,n);if(a&&(!t||a.validEnd))return z.from(s.map((e=>e.createAndFill())));for(let e=0;e<r.next.length;e++){let{type:t,next:n}=r.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==i.indexOf(n)){i.push(n);let e=o(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),o=i.match;if(o.matchType(e)){let e=[];for(let t=i;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<o.next.length;e++){let{type:r,next:s}=o.next[e];r.isLeaf||r.hasRequiredAttrs()||r.name in t||i.type&&!s.validEnd||(n.push({match:r.contentMatch,type:r,via:i}),t[r.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 i=0;i<n.next.length;i++)-1==e.indexOf(n.next[i].next)&&t(n.next[i].next)}(this),e.map(((t,n)=>{let i=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)i+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return i})).join("\n")}}le.empty=new le(!0);class ce{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 pe(e){let t=[];do{t.push(ue(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function ue(e){let t=[];do{t.push(de(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function de(e){let t=function(e){if(e.eat("(")){let t=pe(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let o=[];for(let e in n){let i=n[e];i.groups.indexOf(t)>-1&&o.push(i)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(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=me(e,t)}return t}function he(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function me(e,t){let n=he(e),i=n;return e.eat(",")&&(i="}"!=e.next?he(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function fe(e,t){return t-e}function ge(e,t){let n=[];return function t(i){let o=e[i];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(i);for(let e=0;e<o.length;e++){let{term:i,to:r}=o[e];i||-1!=n.indexOf(r)||t(r)}}(t),n.sort(fe)}function be(e){let t=Object.create(null);for(let n in e){let i=e[n];if(!i.hasDefault)return null;t[n]=i.default}return t}function ve(e,t){let n=Object.create(null);for(let i in e){let o=t&&t[i];if(void 0===o){let t=e[i];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+i);o=t.default}n[i]=o}return n}function ye(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new we(e[n]);return t}class xe{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=ye(n.attrs),this.defaultAttrs=be(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==le.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:ve(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new re(this,this.computeAttrs(e),z.from(t),P.setFrom(n))}createChecked(e=null,t,n){if(t=z.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new re(this,this.computeAttrs(e),t,P.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=z.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(z.empty,!0);return o?new re(this,e,t.append(o),P.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}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:P.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,i)=>n[e]=new xe(e,t,i)));let i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");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 we{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class ke{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=ye(i.attrs),this.excluded=null;let o=be(this.attrs);this.instance=o?new P(this,o):null}create(e=null){return!e&&this.instance?this.instance:new P(this,ve(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach(((e,o)=>n[e]=new ke(e,i++,t,o))),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 Ee{constructor(e){this.cached=Object.create(null),this.spec={nodes:A.from(e.nodes),marks:A.from(e.marks||{}),topNode:e.topNode},this.nodes=xe.compile(this.spec.nodes,this),this.marks=ke.compile(this.spec.marks,this);let t=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 n=this.nodes[e],i=n.spec.content||"",o=n.spec.marks;n.contentMatch=t[i]||(t[i]=le.parse(i,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet="_"==o?null:o?_e(this,o.split(" ")):""!=o&&n.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:_e(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,i){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof xe))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,i)}text(e,t){let n=this.nodes.text;return new se(n,n.defaultAttrs,e,P.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return re.fromJSON(this,e)}markFromJSON(e){return P.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function _e(e,t){let n=[];for(let i=0;i<t.length;i++){let o=t[i],r=e.marks[o],s=r;if(r)n.push(r);else for(let t in e.marks){let i=e.marks[t];("_"==o||i.spec.group&&i.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=i)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}class Me{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 Ie(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Ie(this,t,!0);return n.addAll(e,t.from,t.to),U.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let n=this.tags[i];if(ze(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,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let i=this.styles[o],r=i.style;if(!(0!=r.indexOf(e)||i.context&&!n.matchesContext(i.context)||r.length>e.length&&(61!=r.charCodeAt(e.length)||r.slice(e.length+1)!=t))){if(i.getAttrs){let e=i.getAttrs(t);if(!1===e)continue;i.attrs=e||void 0}return i}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,i=0;for(;i<t.length;i++){let e=t[i];if((null==e.priority?50:e.priority)<n)break}t.splice(i,0,e)}for(let t in e.marks){let i=e.marks[t].spec.parseDOM;i&&i.forEach((e=>{n(e=Le(e)),e.mark=t}))}for(let t in e.nodes){let i=e.nodes[t].spec.parseDOM;i&&i.forEach((e=>{n(e=Le(e)),e.node=t}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Me(e,Me.schemaRules(e)))}}const Ce={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},De={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Oe={ol:!0,ul:!0},Te=1,Ne=2,Se=4;function Ae(e,t,n){return null!=t?(t?Te:0)|("full"===t?Ne:0):e&&"pre"==e.whitespace?Te|Ne:n&~Se}class je{constructor(e,t,n,i,o,r,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=i,this.solid=o,this.options=s,this.content=[],this.activeMarks=P.none,this.stashMarks=[],this.match=r||(s&Se?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(z.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(!(this.options&Te)){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=z.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(z.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 i=n[t];(this.type?this.type.allowsMarkType(i.type):Re(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ce.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ie{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let i,o=t.topNode,r=Ae(null,t.preserveWhitespace,0)|(n?Se:0);i=o?new je(o.type,o.attrs,P.none,P.none,!0,t.topMatch||o.type.contentMatch,r):new je(n?null:e.schema.topNodeType,null,P.none,P.none,!0,null,r),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){let t=e.getAttribute("style"),n=t?this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,i=[];for(;t=n.exec(e);)i.push(t[1],t[2].trim());return i}(t)):null,i=this.top;if(null!=n)for(let e=0;e<n.length;e++)this.addPendingMark(n[e]);if(this.addElement(e),null!=n)for(let e=0;e<n.length;e++)this.removePendingMark(n[e],i)}}addTextNode(e){let t=e.nodeValue,n=this.top;if(n.options&Ne||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(n.options&Te)t=n.options&Ne?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 i=n.content[n.content.length-1],o=e.previousSibling;(!i||o&&"BR"==o.nodeName||i.isText&&/[ \t\r\n\u000c]$/.test(i.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,i=e.nodeName.toLowerCase();Oe.hasOwnProperty(i)&&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&&Oe.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(o?o.ignore:De.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let t,n=this.top,r=this.needsBlock;if(Ce.hasOwnProperty(i))t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),t&&this.sync(n),this.needsBlock=r}else this.addElementByRule(e,o,!1===o.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=P.none;e:for(let n=0;n<e.length;n+=2)for(let i;;){let o=this.parser.matchStyle(e[n],e[n+1],this,i);if(!o)continue e;if(o.ignore)return null;if(t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),!1!==o.consuming)break;i=o}return t}addElementByRule(e,t,n){let i,o,r;if(t.node)o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace);else{r=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(r)}let s=this.top;if(o&&o.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)}i&&this.sync(s)&&this.open--,r&&this.removePendingMark(r,s)}addAll(e,t,n){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,r=null==n?null:e.childNodes[n];o!=r;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,n;for(let i=this.open;i>=0;i--){let o=this.nodes[i],r=o.findWrapping(e);if(r&&(!t||t.length>r.length)&&(t=r,n=o,!r.length))break;if(o.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 i=0;i<e.marks.length;i++)t.type&&!t.type.allowsMarkType(e.marks[i].type)||(n=e.marks[i].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,n),i}enterInner(e,t=null,n=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let r=Ae(e,i,o.options);o.options&Se&&0==o.content.length&&(r|=Se),this.nodes.push(new je(e,t,o.activeMarks,o.pendingMarks,n,null,r)),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 i=0;i<this.find.length;i++)if(null==this.find[i].pos&&1==e.nodeType&&e.contains(this.find[i].node)){t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].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,i=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(i?0:1),r=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=o;s--)if(r(e-1,s))return!0;return!1}{let e=s>0||0==s&&i?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return r(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 i=this.nodes[n];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let t=i.popFromStashMark(e);t&&i.type&&i.type.allowsMarkType(t.type)&&(i.activeMarks=t.addToSet(i.activeMarks))}if(i==t)break}}}function ze(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Le(e){let t={};for(let n in e)t[n]=e[n];return t}function Re(e,t){let n=t.schema.nodes;for(let i in n){let o=n[i];if(!o.allowsMarkType(e))continue;let r=[],s=e=>{r.push(e);for(let n=0;n<e.edgeCount;n++){let{type:i,next:o}=e.edge(n);if(i==t)return!0;if(r.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class Fe{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Be(t).createDocumentFragment());let i=n,o=[];return e.forEach((e=>{if(o.length||e.marks.length){let n=0,r=0;for(;n<o.length&&r<e.marks.length;){let t=e.marks[r];if(this.marks[t.type.name]){if(!t.eq(o[n][0])||!1===t.type.spec.spanning)break;n++,r++}else r++}for(;n<o.length;)i=o.pop()[1];for(;r<e.marks.length;){let n=e.marks[r++],s=this.serializeMark(n,e.isInline,t);s&&(o.push([n,i]),i.appendChild(s.dom),i=s.contentDOM||s.dom)}}i.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:i}=Fe.renderSpec(Be(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&Fe.renderSpec(Be(n),i(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 i,o=t[0],r=o.indexOf(" ");r>0&&(n=o.slice(0,r),o=o.slice(r+1));let s=n?e.createElementNS(n,o):e.createElement(o),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let o=l;o<t.length;o++){let r=t[o];if(0===r){if(o<t.length-1||o>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:o}=Fe.renderSpec(e,r,n);if(s.appendChild(t),o){if(i)throw new RangeError("Multiple content holes");i=o}}}return{dom:s,contentDOM:i}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Fe(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Pe(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return Pe(e.marks)}}function Pe(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function Be(e){return e.document||window.document}const Ue=65535,$e=Math.pow(2,16);function He(e,t){return e+t*$e}function Ve(e){return e&Ue}const qe=1,We=2,Ke=4,Ye=8;class Qe{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Ye)>0}get deletedBefore(){return(this.delInfo&(qe|Ke))>0}get deletedAfter(){return(this.delInfo&(We|Ke))>0}get deletedAcross(){return(this.delInfo&Ke)>0}}class Ge{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Ge.empty)return Ge.empty}recover(e){let t=0,n=Ve(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-(e&Ue))/$e}(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 i=0,o=this.inverted?2:1,r=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?i:0);if(a>e)break;let l=this.ranges[s+o],c=this.ranges[s+r],p=a+l;if(e<=p){let o=a+i+((l?e==a?-1:e==p?1:t:t)<0?0:c);if(n)return o;let r=e==(t<0?a:p)?null:He(s/3,e-a),u=e==a?We:e==p?qe:Ke;return(t<0?e!=a:e!=p)&&(u|=Ye),new Qe(o,u,r)}i+=c-l}return n?e+i:new Qe(e+i,0,null)}touches(e,t){let n=0,i=Ve(t),o=this.inverted?2:1,r=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let a=this.ranges[t+o];if(e<=s+a&&t==3*i)return!0;n+=this.ranges[t+r]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let r=this.ranges[i],s=r-(this.inverted?o:0),a=r+(this.inverted?0:o),l=this.ranges[i+t],c=this.ranges[i+n];e(s,s+l,a,a+c),o+=c-l}}invert(){return new Ge(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Ge.empty:new Ge(e<0?[0,-e,0]:[0,0,e])}}Ge.empty=new Ge([]);class Je{constructor(e=[],t,n=0,i=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=i}slice(e=0,t=this.maps.length){return new Je(this.maps,this.mirror,e,t)}copy(){return new Je(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 i=e.getMirror(t);this.appendMap(e.maps[t],null!=i&&i<t?n+i: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 i=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=i&&i>t?n-i-1:void 0)}}invert(){let e=new Je;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 i=0;for(let n=this.from;n<this.to;n++){let o=this.maps[n].mapResult(e,t);if(null!=o.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this.maps[t].recover(o.recover);continue}}i|=o.delInfo,e=o.pos}return n?e:new Qe(e,i,null)}}const Ze=Object.create(null);class Xe{getMap(){return Ge.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Ze[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 Ze)throw new RangeError("Duplicate use of step JSON ID "+e);return Ze[e]=t,t.prototype.jsonID=e,t}}class et{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new et(e,null)}static fail(e){return new et(null,e)}static fromReplace(e,t,n,i){try{return et.ok(e.replace(t,n,i))}catch(e){if(e instanceof B)return et.fail(e.message);throw e}}}function tt(e,t,n){let i=[];for(let o=0;o<e.childCount;o++){let r=e.child(o);r.content.size&&(r=r.copy(tt(r.content,t,r))),r.isInline&&(r=t(r,n,o)),i.push(r)}return z.fromArray(i)}class nt extends Xe{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),o=new U(tt(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),i),t.openStart,t.openEnd);return et.fromReplace(e,this.from,this.to,o)}invert(){return new it(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 nt(t.pos,n.pos,this.mark)}merge(e){return e instanceof nt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new nt(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 nt(t.from,t.to,e.markFromJSON(t.mark))}}Xe.jsonID("addMark",nt);class it extends Xe{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new U(tt(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return et.fromReplace(e,this.from,this.to,n)}invert(){return new nt(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 it(t.pos,n.pos,this.mark)}merge(e){return e instanceof it&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new it(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 it(t.from,t.to,e.markFromJSON(t.mark))}}Xe.jsonID("removeMark",it);class ot extends Xe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return et.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return et.fromReplace(e,this.pos,this.pos+1,new U(z.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 ot(this.pos,t.marks[n]);return new ot(this.pos,this.mark)}}return new rt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ot(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 ot(t.pos,e.markFromJSON(t.mark))}}Xe.jsonID("addNodeMark",ot);class rt extends Xe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return et.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return et.fromReplace(e,this.pos,this.pos+1,new U(z.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new ot(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new rt(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 rt(t.pos,e.markFromJSON(t.mark))}}Xe.jsonID("removeNodeMark",rt);class st extends Xe{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&<(e,this.from,this.to)?et.fail("Structure replace would overwrite content"):et.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ge([this.from,this.to-this.from,this.slice.size])}invert(e){return new st(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 st(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof st)||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?U.empty:new U(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new st(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?U.empty:new U(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new st(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 st(t.from,t.to,U.fromJSON(e,t.slice),!!t.structure)}}Xe.jsonID("replace",st);class at extends Xe{constructor(e,t,n,i,o,r,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=i,this.slice=o,this.insert=r,this.structure=s}apply(e){if(this.structure&&(lt(e,this.from,this.gapFrom)||lt(e,this.gapTo,this.to)))return et.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return et.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?et.fromReplace(e,this.from,this.to,n):et.fail("Content does not fit in gap")}getMap(){return new Ge([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 at(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),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||i<t.pos||o>n.pos?null:new at(t.pos,n.pos,i,o,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 at(t.from,t.to,t.gapFrom,t.gapTo,U.fromJSON(e,t.slice),t.insert,!!t.structure)}}function lt(e,t,n){let i=e.resolve(t),o=n-t,r=i.depth;for(;o>0&&r>0&&i.indexAfter(r)==i.node(r).childCount;)r--,o--;if(o>0){let e=i.node(r).maybeChild(i.indexAfter(r));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function ct(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function pt(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let i=e.$from.node(n),o=e.$from.index(n),r=e.$to.indexAfter(n);if(n<e.depth&&i.canReplace(o,r,t))return n;if(0==n||i.type.spec.isolating||!ct(i,o,r))break}return null}function ut(e,t,n=null,i=e){let o=function(e,t){let{parent:n,startIndex:i,endIndex:o}=e,r=n.contentMatchAt(i).findWrapping(t);if(!r)return null;let s=r.length?r[0]:t;return n.canReplaceWith(i,o,s)?r:null}(e,t),r=o&&function(e,t){let{parent:n,startIndex:i,endIndex:o}=e,r=n.child(i),s=t.contentMatch.findWrapping(r.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=i;a&&e<o;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null}(i,t);return r?o.map(dt).concat({type:t,attrs:n}).concat(r.map(dt)):null}function dt(e){return{type:e,attrs:null}}function ht(e,t,n=1,i){let o=e.resolve(t),r=o.depth-n,s=i&&i[i.length-1]||o.parent;if(r<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,t=n-2;e>r;e--,t--){let n=o.node(e),r=o.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(r,n.childCount),a=i&&i[t]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(r+1,n.childCount)||!a.type.validContent(s))return!1}let a=o.indexAfter(r),l=i&&i[0];return o.node(r).canReplaceWith(a,a,l?l.type:o.node(r+1).type)}function mt(e,t){let n=e.resolve(t),i=n.index();return function(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function ft(e,t,n){let i=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let e=0;e<n.openStart;e++)o=o.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=i.depth;t>=0;t--){let n=t==i.depth?0:i.pos<=(i.start(t+1)+i.end(t+1))/2?-1:1,r=i.index(t)+(n>0?1:0),s=i.node(t),a=!1;if(1==e)a=s.canReplace(r,r,o);else{let e=s.contentMatchAt(r).findWrapping(o.firstChild.type);a=e&&s.canReplaceWith(r,r,e[0])}if(a)return 0==n?i.pos:n<0?i.before(t+1):i.after(t+1)}return null}function gt(e,t,n=t,i=U.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),r=e.resolve(n);return bt(o,r,i)?new st(t,n,i):new vt(o,r,i).fit()}function bt(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Xe.jsonID("replaceAround",at);class vt{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=z.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=z.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let o=this.placed,r=n.depth,s=i.depth;for(;r&&s&&1==o.childCount;)o=o.firstChild.content,r--,s--;let a=new U(o,r,s);return e>-1?new at(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new st(n.pos,i.pos,a):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let n,i=null;t?(i=wt(this.unplaced.content,t-1).firstChild,n=i.content):n=this.unplaced.content;let o=n.firstChild;for(let n=this.depth;n>=0;n--){let r,{type:s,match:a}=this.frontier[n],l=null;if(1==e&&(o?a.matchType(o.type)||(l=a.fillBefore(z.from(o),!1)):i&&s.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:n,parent:i,inject:l};if(2==e&&o&&(r=a.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:n,parent:i,wrap:r};if(i&&a.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=wt(e,t);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new U(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=wt(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new U(yt(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new U(yt(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e<o.length;e++)this.openFrontierNode(o[e]);let r=this.unplaced,s=n?n.content:r.content,a=r.openStart-e,l=0,c=[],{match:p,type:u}=this.frontier[t];if(i){for(let e=0;e<i.childCount;e++)c.push(i.child(e));p=p.matchFragment(i)}let d=s.size+e-(r.content.size-r.openEnd);for(;l<s.childCount;){let e=s.child(l),t=p.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(p=t,c.push(kt(e.mark(u.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?d:-1)))}let h=l==s.childCount;h||(d=-1),this.placed=xt(this.placed,t,z.from(c)),this.frontier[t].match=p,h&&d<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<d;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=h?0==e?U.empty:new U(yt(r.content,e-1,1),e-1,d<0?r.openEnd:e-1):new U(yt(r.content,e,l),r.openStart,r.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Et(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,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),r=Et(e,t,i,n,o);if(r){for(let n=t-1;n>=0;n--){let{match:t,type:i}=this.frontier[n],o=Et(e,n,i,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:r,move:o?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=xt(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),i=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,i)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=xt(this.placed,this.depth,z.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(z.empty,!0);e.childCount&&(this.placed=xt(this.placed,this.frontier.length,e))}}function yt(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(yt(e.firstChild.content,t-1,n)))}function xt(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(xt(e.lastChild.content,t-1,n)))}function wt(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function kt(e,t,n){if(t<=0)return e;let i=e.content;return t>1&&(i=i.replaceChild(0,kt(i.firstChild,t-1,1==i.childCount?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(z.empty,!0)))),e.copy(i)}function Et(e,t,n,i,o){let r=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==r.childCount&&!n.compatibleContent(r.type))return null;let a=i.fillBefore(r.content,!0,s);return a&&!function(e,t,n){for(let i=n;i<t.childCount;i++)if(!e.allowsMarks(t.child(i).marks))return!0;return!1}(n,r.content,s)?a:null}function _t(e){return e.spec.defining||e.spec.definingForContent}function Mt(e,t,n,i,o){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(Mt(o.content,t+1,n,i,o)))}if(t>i){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(z.empty,!0))}return e}function Ct(e,t){let n=[];for(let i=Math.min(e.depth,t.depth);i>=0;i--){let o=e.start(i);if(o<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}class Dt extends Xe{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 et.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return et.fromReplace(e,this.pos,this.pos+1,new U(z.from(i),0,t.isLeaf?0:1))}getMap(){return Ge.empty}invert(e){return new Dt(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 Dt(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 Dt(t.pos,t.attr,t.value)}}Xe.jsonID("attr",Dt);let Ot=class extends Error{};Ot=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Ot.prototype=Object.create(Error.prototype)).constructor=Ot,Ot.prototype.name="TransformError";class Tt{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Je}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ot(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=U.empty){let i=gt(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new U(z.from(n),0,0))}delete(e,t){return this.replace(e,t,U.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,i){if(!i.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),r=e.doc.resolve(n);if(bt(o,r,i))return e.step(new st(t,n,i));let s=Ct(o,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:o.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),c=[],p=i.openStart;for(let e=i.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==i.openStart)break;e=n.content}for(let e=p-1;e>=0;e--){let t=c[e].type,n=_t(t);if(n&&o.node(l).type!=t)p=e;else if(n||!t.isTextblock)break}for(let t=i.openStart;t>=0;t--){let a=(t+p+1)%(i.openStart+1),u=c[a];if(u)for(let t=0;t<s.length;t++){let c=s[(t+l)%s.length],p=!0;c<0&&(p=!1,c=-c);let d=o.node(c-1),h=o.index(c-1);if(d.canReplaceWith(h,h,u.type,u.marks))return e.replace(o.before(c),p?r.after(c):n,new U(Mt(i.content,0,i.openStart,a),a,i.openEnd))}}let u=e.steps.length;for(let a=s.length-1;a>=0&&(e.replace(t,n,i),!(e.steps.length>u));a--){let e=s[a];e<0||(t=o.before(e),n=r.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=function(e,t,n){let i=e.resolve(t);if(i.parent.canReplaceWith(i.index(),i.index(),n))return t;if(0==i.parentOffset)for(let e=i.depth-1;e>=0;e--){let t=i.index(e);if(i.node(e).canReplaceWith(t,t,n))return i.before(e+1);if(t>0)return null}if(i.parentOffset==i.parent.content.size)for(let e=i.depth-1;e>=0;e--){let t=i.indexAfter(e);if(i.node(e).canReplaceWith(t,t,n))return i.after(e+1);if(t<i.node(e).childCount)return null}return null}(e.doc,t,i.type);null!=o&&(t=n=o)}e.replaceRange(t,n,new U(z.from(i),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let i=e.doc.resolve(t),o=e.doc.resolve(n),r=Ct(i,o);for(let t=0;t<r.length;t++){let n=r[t],s=t==r.length-1;if(s&&0==n||i.node(n).type.contentMatch.validEnd)return e.delete(i.start(n),o.end(n));if(n>0&&(s||i.node(n-1).canReplace(i.index(n-1),o.indexAfter(n-1))))return e.delete(i.before(n),o.after(n))}for(let r=1;r<=i.depth&&r<=o.depth;r++)if(t-i.start(r)==i.depth-r&&n>i.end(r)&&o.end(r)-n!=o.depth-r)return e.delete(i.before(r),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:i,$to:o,depth:r}=t,s=i.before(r+1),a=o.after(r+1),l=s,c=a,p=z.empty,u=0;for(let e=r,t=!1;e>n;e--)t||i.index(e)>0?(t=!0,p=z.from(i.node(e).copy(p)),u++):l--;let d=z.empty,h=0;for(let e=r,t=!1;e>n;e--)t||o.after(e+1)<o.end(e)?(t=!0,d=z.from(o.node(e).copy(d)),h++):c++;e.step(new at(l,c,s,a,new U(p.append(d),u,h),p.size-u,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let i=new st(t-n,t+n,U.empty,!0);e.step(i)}(this,e,t),this}wrap(e,t){return function(e,t,n){let i=z.empty;for(let e=n.length-1;e>=0;e--){if(i.size){let t=n[e].type.contentMatch.matchFragment(i);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=z.from(n[e].type.create(n[e].attrs,i))}let o=t.start,r=t.end;e.step(new at(o,r,o,r,new U(i,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,i=null){return function(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let r=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(i,o)&&function(e,t,n){let i=e.resolve(t),o=i.index();return i.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(r).map(n),i)){e.clearIncompatible(e.mapping.slice(r).map(n,1),i);let s=e.mapping.slice(r),a=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new at(a,l,a+1,l-1,new U(z.from(i.create(o,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i=[]){return function(e,t,n,i,o){let r=e.doc.nodeAt(t);if(!r)throw new RangeError("No node at given position");n||(n=r.type);let s=n.create(i,null,o||r.marks);if(r.isLeaf)return e.replaceWith(t,t+r.nodeSize,s);if(!n.validContent(r.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new at(t,t+r.nodeSize,t+1,t+r.nodeSize-1,new U(z.from(s),0,0),1,!0))}(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new Dt(e,t,n)),this}addNodeMark(e,t){return this.step(new ot(e,t)),this}removeNodeMark(e,t){if(!(t instanceof P)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t=t.isInSet(n.marks),!t)return this}return this.step(new rt(e,t)),this}split(e,t=1,n){return function(e,t,n=1,i){let o=e.doc.resolve(t),r=z.empty,s=z.empty;for(let e=o.depth,t=o.depth-n,a=n-1;e>t;e--,a--){r=z.from(o.node(e).copy(r));let t=i&&i[a];s=z.from(t?t.type.create(t.attrs,s):o.node(e).copy(s))}e.step(new st(t,t,new U(r.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,i){let o,r,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let p=e.marks;if(!i.isInSet(p)&&c.type.allowsMarkType(i.type)){let c=Math.max(l,t),u=Math.min(l+e.nodeSize,n),d=i.addToSet(p);for(let e=0;e<p.length;e++)p[e].isInSet(d)||(o&&o.to==c&&o.mark.eq(p[e])?o.to=u:s.push(o=new it(c,u,p[e])));r&&r.to==c?r.to=u:a.push(r=new nt(c,u,i))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,i){let o=[],r=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;r++;let a=null;if(i instanceof ke){let t,n=e.marks;for(;t=i.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else i?i.isInSet(e.marks)&&(a=[i]):a=e.marks;if(a&&a.length){let i=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<o.length;e++){let t=o[e];t.step==r-1&&l.eq(o[e].style)&&(n=t)}n?(n.to=i,n.step=r):o.push({style:l,from:Math.max(s,t),to:i,step:r})}}})),o.forEach((t=>e.step(new it(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,i=n.contentMatch){let o=e.doc.nodeAt(t),r=[],s=t+1;for(let t=0;t<o.childCount;t++){let a=o.child(t),l=s+a.nodeSize,c=i.matchType(a.type);if(c){i=c;for(let t=0;t<a.marks.length;t++)n.allowsMarkType(a.marks[t].type)||e.step(new it(s,l,a.marks[t]))}else r.push(new st(s,l,U.empty));s=l}if(!i.validEnd){let t=i.fillBefore(z.empty,!0);e.replace(s,s,new U(t,0,0))}for(let t=r.length-1;t>=0;t--)e.step(r[t])}(this,e,t,n),this}}const Nt=Object.create(null);class St{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new At(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=U.empty){let n=t.content.lastChild,i=null;for(let e=0;e<t.openEnd;e++)i=n,n=n.lastChild;let o=e.steps.length,r=this.ranges;for(let s=0;s<r.length;s++){let{$from:a,$to:l}=r[s],c=e.mapping.slice(o);e.replaceRange(c.map(a.pos),c.map(l.pos),s?U.empty:t),0==s&&$t(e,o,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:r,$to:s}=i[o],a=e.mapping.slice(n),l=a.map(r.pos),c=a.map(s.pos);o?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),$t(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let i=e.parent.inlineContent?new zt(e):Ut(e.node(0),e.parent,e.pos,e.index(),t,n);if(i)return i;for(let i=e.depth-1;i>=0;i--){let o=t<0?Ut(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):Ut(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Pt(e.node(0))}static atStart(e){return Ut(e,e,0,0,1)||new Pt(e)}static atEnd(e){return Ut(e,e,e.content.size,e.childCount,-1)||new Pt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Nt[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 Nt)throw new RangeError("Duplicate use of selection JSON ID "+e);return Nt[e]=t,t.prototype.jsonID=e,t}getBookmark(){return zt.between(this.$anchor,this.$head).getBookmark()}}St.prototype.visible=!0;class At{constructor(e,t){this.$from=e,this.$to=t}}let jt=!1;function It(e){jt||e.parent.inlineContent||(jt=!0,console["warn"]("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class zt extends St{constructor(e,t=e){It(e),It(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 St.near(n);let i=e.resolve(t.map(this.anchor));return new zt(i.parent.inlineContent?i:n,n)}replace(e,t=U.empty){if(super.replace(e,t),t==U.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof zt&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Lt(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 zt(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if(n&&!i||(n=i>=0?1:-1),!t.parent.inlineContent){let e=St.findFrom(t,n,!0)||St.findFrom(t,-n,!0);if(!e)return St.near(t,n);t=e.$head}return e.parent.inlineContent||(0==i||(e=(St.findFrom(e,-n,!0)||St.findFrom(e,n,!0)).$anchor).pos<t.pos!=i<0)&&(e=t),new zt(e,t)}}St.jsonID("text",zt);class Lt{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Lt(e.map(this.anchor),e.map(this.head))}resolve(e){return zt.between(e.resolve(this.anchor),e.resolve(this.head))}}class Rt extends St{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:i}=t.mapResult(this.anchor),o=e.resolve(i);return n?St.near(o):new Rt(o)}content(){return new U(z.from(this.node),0,0)}eq(e){return e instanceof Rt&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ft(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Rt(e.resolve(t.anchor))}static create(e,t){return new Rt(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}Rt.prototype.visible=!1,St.jsonID("node",Rt);class Ft{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new Lt(n,n):new Ft(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Rt.isSelectable(n)?new Rt(t):St.near(t)}}class Pt extends St{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=U.empty){if(t==U.empty){e.delete(0,e.doc.content.size);let t=St.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Pt(e)}map(e){return new Pt(e)}eq(e){return e instanceof Pt}getBookmark(){return Bt}}St.jsonID("all",Pt);const Bt={map(){return this},resolve:e=>new Pt(e)};function Ut(e,t,n,i,o,r=!1){if(t.inlineContent)return zt.create(e,n);for(let s=i-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let i=t.child(s);if(i.isAtom){if(!r&&Rt.isSelectable(i))return Rt.create(e,n-(o<0?i.nodeSize:0))}else{let t=Ut(e,i,n+o,o<0?i.childCount:0,o,r);if(t)return t}n+=i.nodeSize*o}return null}function $t(e,t,n){let i=e.steps.length-1;if(i<t)return;let o,r=e.steps[i];(r instanceof st||r instanceof at)&&(e.mapping.maps[i].forEach(((e,t,n,i)=>{null==o&&(o=i)})),e.setSelection(St.near(e.doc.resolve(o),n)))}const Ht=1,Vt=2,qt=4;class Wt extends Tt{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Ht)&~Vt,this.storedMarks=null,this}get selectionSet(){return(this.updated&Ht)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Vt,this}ensureMarks(e){return P.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Vt)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~Vt,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)||P.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let i=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,o)),this.selection.empty||this.setSelection(St.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|=qt,this}get scrolledIntoView(){return(this.updated&qt)>0}}function Kt(e,t){return t&&e?e.bind(t):e}class Yt{constructor(e,t,n){this.name=e,this.init=Kt(t.init,n),this.apply=Kt(t.apply,n)}}const Qt=[new Yt("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new Yt("selection",{init:(e,t)=>e.selection||St.atStart(t.doc),apply:e=>e.selection}),new Yt("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,i)=>i.selection.$cursor?e.storedMarks:null}),new Yt("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class Gt{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Qt.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 Yt(e.key,e.spec.state,e))}))}}class Jt{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),i=null;for(;;){let o=!1;for(let r=0;r<this.config.plugins.length;r++){let s=this.config.plugins[r];if(s.spec.appendTransaction){let a=i?i[r].n:0,l=i?i[r].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,r)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let e=0;e<this.config.plugins.length;e++)i.push(e<r?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}i&&(i[r]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Jt(this.config),n=this.config.fields;for(let i=0;i<n.length;i++){let o=n[i];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new Wt(this)}static create(e){let t=new Gt(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Jt(t);for(let i=0;i<t.fields.length;i++)n[t.fields[i].name]=t.fields[i].init(e,n);return n}reconfigure(e){let t=new Gt(this.schema,e.plugins),n=t.fields,i=new Jt(t);for(let t=0;t<n.length;t++){let o=n[t].name;i[o]=this.hasOwnProperty(o)?this[o]:n[t].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"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 i=e[n],o=i.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Gt(e.schema,e.plugins),o=new Jt(i);return i.fields.forEach((i=>{if("doc"==i.name)o.doc=re.fromJSON(e.schema,t.doc);else if("selection"==i.name)o.selection=St.fromJSON(o.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let r in n){let s=n[r],a=s.spec.state;if(s.key==i.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,r))return void(o[i.name]=a.fromJSON.call(s,e,t[r],o))}o[i.name]=i.init(e,o)}})),o}}function Zt(e,t,n){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(t):"handleDOMEvents"==i&&(o=Zt(o,t,{})),n[i]=o}return n}class Xt{constructor(e){this.spec=e,this.props={},e.props&&Zt(e.props,this,this.props),this.key=e.key?e.key.key:tn("plugin")}getState(e){return e[this.key]}}const en=Object.create(null);function tn(e){return e in en?e+"$"+ ++en[e]:(en[e]=0,e+"$")}class nn{constructor(e="key"){this.key=tn(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const on="undefined"!=typeof navigator?navigator:null,rn="undefined"!=typeof document?document:null,sn=on&&on.userAgent||"",an=/Edge\/(\d+)/.exec(sn),ln=/MSIE \d/.exec(sn),cn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(sn),pn=!!(ln||cn||an),un=ln?document.documentMode:cn?+cn[1]:an?+an[1]:0,dn=!pn&&/gecko\/(\d+)/i.test(sn);dn&&(/Firefox\/(\d+)/.exec(sn)||[0,0])[1];const hn=!pn&&/Chrome\/(\d+)/.exec(sn),mn=!!hn,fn=hn?+hn[1]:0,gn=!pn&&!!on&&/Apple Computer/.test(on.vendor),bn=gn&&(/Mobile\/\w+/.test(sn)||!!on&&on.maxTouchPoints>2),vn=bn||!!on&&/Mac/.test(on.platform),yn=/Android \d/.test(sn),xn=!!rn&&"webkitFontSmoothing"in rn.documentElement.style,wn=xn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,kn=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},En=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let _n=null;const Mn=function(e,t,n){let i=_n||(_n=document.createRange());return i.setEnd(e,null==n?e.nodeValue.length:n),i.setStart(e,t||0),i},Cn=function(e,t,n,i){return n&&(On(e,t,n,i,-1)||On(e,t,n,i,1))},Dn=/^(img|br|input|textarea|hr)$/i;function On(e,t,n,i,o){for(;;){if(e==n&&t==i)return!0;if(t==(o<0?0:Tn(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Nn(e)||Dn.test(e.nodeName)||"false"==e.contentEditable)return!1;t=kn(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?Tn(e):0}}}function Tn(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Nn(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 Sn=function(e){let t=e.isCollapsed;return t&&mn&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function An(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function jn(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function In(e,t){return"number"==typeof e?e:e[t]}function zn(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,i=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*i}}function Ln(e,t,n){let i=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,r=e.dom.ownerDocument;for(let s=n||e.dom;s;s=En(s)){if(1!=s.nodeType)continue;let e=s,n=e==r.body,a=n?jn(r):zn(e),l=0,c=0;if(t.top<a.top+In(i,"top")?c=-(a.top-t.top+In(o,"top")):t.bottom>a.bottom-In(i,"bottom")&&(c=t.bottom-a.bottom+In(o,"bottom")),t.left<a.left+In(i,"left")?l=-(a.left-t.left+In(o,"left")):t.right>a.right-In(i,"right")&&(l=t.right-a.right+In(o,"right")),l||c)if(n)r.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,i=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let o=e.scrollLeft-n,r=e.scrollTop-i;t={left:t.left-o,top:t.top-r,right:t.right-o,bottom:t.bottom-r}}if(n)break}}function Rn(e){let t=[],n=e.ownerDocument;for(let i=e;i&&(t.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),e!=n);i=En(i));return t}function Fn(e,t){for(let n=0;n<e.length;n++){let{dom:i,top:o,left:r}=e[n];i.scrollTop!=o+t&&(i.scrollTop=o+t),i.scrollLeft!=r&&(i.scrollLeft=r)}}let Pn=null;function Bn(e,t){let n,i,o=2e8,r=0,s=t.top,a=t.top;for(let l=e.firstChild,c=0;l;l=l.nextSibling,c++){let e;if(1==l.nodeType)e=l.getClientRects();else{if(3!=l.nodeType)continue;e=Mn(l).getClientRects()}for(let p=0;p<e.length;p++){let u=e[p];if(u.top<=s&&u.bottom>=a){s=Math.max(u.bottom,s),a=Math.min(u.top,a);let e=u.left>t.left?u.left-t.left:u.right<t.left?t.left-u.right:0;if(e<o){n=l,o=e,i=e&&3==n.nodeType?{left:u.right<t.left?u.right:u.left,top:t.top}:t,1==l.nodeType&&e&&(r=c+(t.left>=(u.left+u.right)/2?1:0));continue}}!n&&(t.left>=u.right&&t.top>=u.top||t.left>=u.left&&t.top>=u.bottom)&&(r=c+1)}}return n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,i=document.createRange();for(let o=0;o<n;o++){i.setEnd(e,o+1),i.setStart(e,o);let n=Vn(i,1);if(n.top!=n.bottom&&Un(t,n))return{node:e,offset:o+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,i):!n||o&&1==n.nodeType?{node:e,offset:r}:Bn(n,i)}function Un(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function $n(e,t,n){let i=e.childNodes.length;if(i&&n.top<n.bottom)for(let o=Math.max(0,Math.min(i-1,Math.floor(i*(t.top-n.top)/(n.bottom-n.top))-2)),r=o;;){let n=e.childNodes[r];if(1==n.nodeType){let e=n.getClientRects();for(let i=0;i<e.length;i++){let o=e[i];if(Un(t,o))return $n(n,t,o)}}if((r=(r+1)%i)==o)break}return e}function Hn(e,t){let n,i=e.dom.ownerDocument,o=0;if(i.caretPositionFromPoint)try{let e=i.caretPositionFromPoint(t.left,t.top);e&&({offsetNode:n,offset:o}=e)}catch(e){}if(!n&&i.caretRangeFromPoint){let e=i.caretRangeFromPoint(t.left,t.top);e&&({startContainer:n,startOffset:o}=e)}let r,s=(e.root.elementFromPoint?e.root:i).elementFromPoint(t.left,t.top);if(!s||!e.dom.contains(1!=s.nodeType?s.parentNode:s)){let n=e.dom.getBoundingClientRect();if(!Un(t,n))return null;if(s=$n(e.dom,t,n),!s)return null}if(gn)for(let e=s;n&&e;e=En(e))e.draggable&&(n=void 0);if(s=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(s,t),n){if(dn&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let e,i=n.childNodes[o];"IMG"==i.nodeName&&(e=i.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&o++}n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?r=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(r=function(e,t,n,i){let o=-1;for(let n=t;n!=e.dom;){let t=e.docView.nearestDesc(n,!0);if(!t)return null;if(t.node.isBlock&&t.parent){let e=t.dom.getBoundingClientRect();if(e.left>i.left||e.top>i.top)o=t.posBefore;else{if(!(e.right<i.left||e.bottom<i.top))break;o=t.posAfter}}n=t.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,1)}(e,n,o,t))}null==r&&(r=function(e,t,n){let{node:i,offset:o}=Bn(t,n),r=-1;if(1==i.nodeType&&!i.firstChild){let e=i.getBoundingClientRect();r=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(i,o,r)}(e,s,t));let a=e.docView.nearestDesc(s,!0);return{pos:r,inside:a?a.posAtStart-a.border:-1}}function Vn(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const qn=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Wn(e,t,n){let{node:i,offset:o,atom:r}=e.docView.domFromPos(t,n<0?-1:1),s=xn||dn;if(3==i.nodeType){if(!s||!qn.test(i.nodeValue)&&(n<0?o:o!=i.nodeValue.length)){let e=o,t=o,r=n<0?1:-1;return n<0&&!o?(t++,r=-1):n>=0&&o==i.nodeValue.length?(e--,r=1):n<0?e--:t++,Kn(Vn(Mn(i,e,t),1),r<0)}{let e=Vn(Mn(i,o,o),n);if(dn&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){let t=Vn(Mn(i,o-1,o-1),-1);if(t.top==e.top){let n=Vn(Mn(i,o,o+1),-1);if(n.top!=e.top)return Kn(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(r||0)).parent.inlineContent){if(null==r&&o&&(n<0||o==Tn(i))){let e=i.childNodes[o-1];if(1==e.nodeType)return Yn(e.getBoundingClientRect(),!1)}if(null==r&&o<Tn(i)){let e=i.childNodes[o];if(1==e.nodeType)return Yn(e.getBoundingClientRect(),!0)}return Yn(i.getBoundingClientRect(),n>=0)}if(null==r&&o&&(n<0||o==Tn(i))){let e=i.childNodes[o-1],t=3==e.nodeType?Mn(e,Tn(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return Kn(Vn(t,1),!1)}if(null==r&&o<Tn(i)){let e=i.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?Mn(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return Kn(Vn(t,-1),!0)}return Kn(Vn(3==i.nodeType?Mn(i):i,-n),n>=0)}function Kn(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 Yn(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 Qn(e,t,n){let i=e.state,o=e.root.activeElement;i!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{i!=t&&e.updateState(i),o!=e.dom&&o&&o.focus()}}const Gn=/[\u0590-\u08ac]/;let Jn=null,Zn=null,Xn=!1;function ei(e,t,n){return Jn==t&&Zn==n?Xn:(Jn=t,Zn=n,Xn="up"==n||"down"==n?function(e,t,n){let i=t.selection,o="up"==n?i.$from:i.$to;return Qn(e,t,(()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.dom;break}t=n.dom.parentNode}let i=Wn(e,o.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=Mn(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==n?i.top-o.top>2*(o.bottom-i.top):o.bottom-i.bottom>2*(i.bottom-o.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:i}=t.selection;if(!i.parent.isTextblock)return!1;let o=i.parentOffset,r=!o,s=o==i.parent.content.size,a=e.domSelection();return Gn.test(i.parent.textContent)&&a.modify?Qn(e,t,(()=>{let t=a.getRangeAt(0),o=a.focusNode,r=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");let l=!(i.depth?e.docView.domAfterPos(i.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||o==a.focusNode&&r==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?r:s}(e,t,n))}const ti=0,ni=1,ii=2,oi=3;class ri{constructor(e,t,n,i){this.parent=e,this.children=t,this.dom=n,this.contentDOM=i,this.dirty=ti,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 i=this.children[t];if(i==e)return n;n+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,i;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(i=n.pmViewDesc)||i.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(i)+i.size:this.posAtStart}{let n,i;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(i=n.pmViewDesc)||i.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(i):this.posAtEnd}}let i;if(e==this.dom&&this.contentDOM)i=t>kn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){i=!1;break}if(t.previousSibling)break}if(null==i&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){i=!0;break}if(t.nextSibling)break}}return(null==i?n>0:i)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,i=e;i;i=i.parentNode){let o,r=this.getDesc(i);if(r&&(!t||r.node)){if(!n||!(o=r.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return r;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 i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let i=this.children[t],o=n+i.size;if(n==e&&o!=n){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-n-i.border);n=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n,i=0,o=0;for(let t=0;i<this.children.length;i++){let n=this.children[i],r=t+n.size;if(r>e||n instanceof di){o=e-t;break}t=r}if(o)return this.children[i].domFromPos(o-this.children[i].border,t);for(;i&&!(n=this.children[i-1]).size&&n instanceof si&&n.side>=0;i--);if(t<=0){let e,n=!0;for(;e=i?this.children[i-1]:null,e&&e.dom.parentNode!=this.contentDOM;i--,n=!1);return e&&t&&n&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?kn(e.dom)+1:0}}{let e,n=!0;for(;e=i<this.children.length?this.children[i]:null,e&&e.dom.parentNode!=this.contentDOM;i++,n=!1);return e&&n&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?kn(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 i=-1,o=-1;for(let r=n,s=0;;s++){let n=this.children[s],a=r+n.size;if(-1==i&&e<=a){let o=r+n.border;if(e>=o&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,o);e=r;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){i=kn(n.dom)+1;break}e-=n.size}-1==i&&(i=0)}if(i>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=kn(n.dom);break}t+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}r=a}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:o}}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,i=!1){let o=Math.min(e,t),r=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(o>a&&r<c)return l.setSelection(e-a-l.border,t-a-l.border,n,i);a=c}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.getSelection(),c=!1;if((dn||gn)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(c=!(!t||"\n"!=e.nodeValue[t-1]),c&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(s=a={node:t.parentNode,offset:kn(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(dn&&l.focusNode&&l.focusNode!=a.node&&1==l.focusNode.nodeType){let e=l.focusNode.childNodes[l.focusOffset];e&&"false"==e.contentEditable&&(i=!0)}if(!(i||c&&gn)&&Cn(s.node,s.offset,l.anchorNode,l.anchorOffset)&&Cn(a.node,a.offset,l.focusNode,l.focusOffset))return;let p=!1;if((l.extend||e==t)&&!c){l.collapse(s.node,s.offset);try{if(e!=t)try{l.extend(a.node,a.offset)}catch(e){}p=!0}catch(e){if(!(e instanceof DOMException))throw e}}if(!p){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,i=0;i<this.children.length;i++){let o=this.children[i],r=n+o.size;if(n==r?e<=r&&t>=n:e<r&&t>n){let i=n+o.border,s=r-o.border;if(e>=i&&t<=s)return this.dirty=e==n||t==r?ii:ni,void(e!=i||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-i,t-i):o.dirty=oi);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?oi:ii}n=r}this.dirty=ii}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?ii:ni;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class si extends ri{constructor(e,t,n,i){let o,r=t.type.toDOM;if("function"==typeof r&&(r=r(n,(()=>o?o.parent?o.parent.posBeforeChild(o):void 0:i))),!t.type.spec.raw){if(1!=r.nodeType){let e=document.createElement("span");e.appendChild(r),r=e}r.contentEditable="false",r.classList.add("ProseMirror-widget")}super(e,[],r,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==ti&&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 ai extends ri{constructor(e,t,n,i){super(e,[],t,null),this.textDOM=n,this.text=i}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 li extends ri{constructor(e,t,n,i){super(e,[],n,i),this.mark=t}static create(e,t,n,i){let o=i.nodeViews[t.type.name],r=o&&o(t,i,n);return r&&r.dom||(r=Fe.renderSpec(document,t.type.spec.toDOM(t,n))),new li(e,t,r.dom,r.contentDOM||r.dom)}parseRule(){return this.dirty&oi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return this.dirty!=oi&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=ti){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=ti}}slice(e,t,n){let i=li.create(this.parent,this.mark,!0,n),o=this.children,r=this.size;t<r&&(o=Mi(o,t,r,n)),e>0&&(o=Mi(o,0,e,n));for(let e=0;e<o.length;e++)o[e].parent=i;return i.children=o,i}}class ci extends ri{constructor(e,t,n,i,o,r,s,a,l){super(e,[],o,r),this.node=t,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=s,r&&this.updateChildren(a,l)}static create(e,t,n,i,o,r){let s,a=o.nodeViews[t.type.name],l=a&&a(t,o,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:r),n,i),c=l&&l.dom,p=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else c||({dom:c,contentDOM:p}=Fe.renderSpec(document,t.type.spec.toDOM(t)));p||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let u=c;return c=xi(c,n,t),l?s=new hi(e,t,n,i,c,p||null,u,l,o,r+1):t.isText?new ui(e,t,n,i,c,u,o):new ci(e,t,n,i,c,p||null,u,o,r+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=()=>z.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return this.dirty==ti&&e.eq(this.node)&&wi(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,i=t,o=e.composing?this.localCompositionInfo(e,t):null,r=o&&o.pos>-1?o:null,s=o&&o.pos<0,a=new Ei(this,r&&r.node,e);!function(e,t,n,i){let o=t.locals(e),r=0;if(0==o.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);i(s,o,t.forChild(r,s),n),r+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){if(s<o.length&&o[s].to==r){let e,t=o[s++];for(;s<o.length&&o[s].to==r;)(e||(e=[t])).push(o[s++]);if(e){e.sort(_i);for(let t=0;t<e.length;t++)n(e[t],c,!!l)}else n(t,c,!!l)}let p,u;if(l)u=-1,p=l,l=null;else{if(!(c<e.childCount))break;u=c,p=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=r&&a.splice(e--,1);for(;s<o.length&&o[s].from<=r&&o[s].to>r;)a.push(o[s++]);let d=r+p.nodeSize;if(p.isText){let e=d;s<o.length&&o[s].from<e&&(e=o[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<d&&(l=p.cut(e-r),p=p.cut(0,e-r),d=e,u=-1)}let h=p.isInline&&!p.isLeaf?a.filter((e=>!e.inline)):a.slice();i(p,h,t.forChild(r,p),u),r=d}}(this.node,this.innerDeco,((t,o,r)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!r&&a.syncToMarks(o==this.node.childCount?P.none:this.node.child(o).marks,n,e),a.placeWidget(t,e,i)}),((t,r,l,c)=>{let p;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,r,l,c)||s&&e.state.selection.from>i&&e.state.selection.to<i+t.nodeSize&&(p=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(t,r,l,p,e)||a.updateNextNode(t,r,l,e,c)||a.addNode(t,r,l,e,i),i+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==ii)&&(r&&this.protectLocalComposition(e,r),mi(this.contentDOM,this.children,e),bn&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof zt)||n<t||i>t+this.node.content.size)return null;let o=e.domSelection(),r=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=Tn(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(o.focusNode,o.focusOffset);if(!r||!this.dom.contains(r.parentNode))return null;if(this.node.inlineContent){let e=r.nodeValue,o=function(e,t,n,i){for(let o=0,r=0;o<e.childCount&&r<=i;){let s=e.child(o++),a=r;if(r+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<e.childCount;){let t=e.child(o++);if(r+=t.nodeSize,!t.isText)break;l+=t.text}if(r>=n){let e=a<i?l.lastIndexOf(t,i-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==i&&l.length>=i+t.length-a&&l.slice(i-a,i-a+t.length)==t)return i}}return-1}(this.node.content,e,n-t,i-t);return o<0?null:{node:r,pos:o,text:e}}return{node:r,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let r=new ai(this,o,t,i);e.input.compositionNodes.push(r),this.children=Mi(this.children,n,n+i.length,e,r)}update(e,t,n,i){return!(this.dirty==oi||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,i),!0)}updateInner(e,t,n,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=ti}updateOuterDeco(e){if(wi(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=vi(this.dom,this.nodeDOM,bi(this.outerDeco,this.node,t),bi(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 pi(e,t,n,i,o){return xi(i,t,e),new ci(void 0,e,t,n,i,i,i,o,0)}class ui extends ci{constructor(e,t,n,i,o,r,s){super(e,t,n,i,o,null,r,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,i){return!(this.dirty==oi||this.dirty!=ti&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),this.dirty==ti&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=ti,!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 i=this.node.cut(e,t),o=document.createTextNode(i.text);return new ui(this.parent,i,this.outerDeco,this.innerDeco,o,o,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=oi)}get domAtom(){return!1}}class di extends ri{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ti&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class hi extends ci{constructor(e,t,n,i,o,r,s,a,l,c){super(e,t,n,i,o,r,s,l,c),this.spec=a}update(e,t,n,i){if(this.dirty==oi)return!1;if(this.spec.update){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,i),o}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,i){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,i)}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 mi(e,t,n){let i=e.firstChild,o=!1;for(let r=0;r<t.length;r++){let s=t[r],a=s.dom;if(a.parentNode==e){for(;a!=i;)i=ki(i),o=!0;i=i.nextSibling}else o=!0,e.insertBefore(a,i);if(s instanceof li){let t=i?i.previousSibling:e.lastChild;mi(s.contentDOM,s.children,n),i=t?t.nextSibling:e.firstChild}}for(;i;)i=ki(i),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}const fi=function(e){e&&(this.nodeName=e)};fi.prototype=Object.create(null);const gi=[new fi];function bi(e,t,n){if(0==e.length)return gi;let i=n?gi[0]:new fi,o=[i];for(let r=0;r<e.length;r++){let s=e[r].type.attrs;if(s){s.nodeName&&o.push(i=new fi(s.nodeName));for(let e in s){let r=s[e];null!=r&&(n&&1==o.length&&o.push(i=new fi(t.isInline?"span":"div")),"class"==e?i.class=(i.class?i.class+" ":"")+r:"style"==e?i.style=(i.style?i.style+";":"")+r:"nodeName"!=e&&(i[e]=r))}}}return o}function vi(e,t,n,i){if(n==gi&&i==gi)return t;let o=t;for(let t=0;t<i.length;t++){let r=i[t],s=n[t];if(t){let t;s&&s.nodeName==r.nodeName&&o!=e&&(t=o.parentNode)&&t.nodeName.toLowerCase()==r.nodeName||(t=document.createElement(r.nodeName),t.pmIsDeco=!0,t.appendChild(o),s=gi[0]),o=t}yi(o,s||gi[0],r)}return o}function yi(e,t,n){for(let i in t)"class"==i||"style"==i||"nodeName"==i||i in n||e.removeAttribute(i);for(let i in n)"class"!=i&&"style"!=i&&"nodeName"!=i&&n[i]!=t[i]&&e.setAttribute(i,n[i]);if(t.class!=n.class){let i=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<i.length;t++)-1==o.indexOf(i[t])&&e.classList.remove(i[t]);for(let t=0;t<o.length;t++)-1==i.indexOf(o[t])&&e.classList.add(o[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,i=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=i.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function xi(e,t,n){return vi(e,e,gi,bi(t,n,1!=e.nodeType))}function wi(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 ki(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Ei{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,i=n.children.length,o=e.childCount,r=new Map,s=[];e:for(;o>0;){let a;for(;;)if(i){let e=n.children[i-1];if(!(e instanceof li)){a=e,i--;break}n=e,i=e.children.length}else{if(n==t)break e;i=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(o-1))break;--o,r.set(a,o),s.push(a)}}return{index:o,matched:r,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let i=0,o=this.stack.length>>1,r=Math.min(o,e.length);for(;i<r&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&!1!==e[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=ti,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let i=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++)if(this.top.children[t].matchesMark(e[o])){i=t;break}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let i=li.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,i),this.top=i,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,i){let o,r=-1;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))r=this.top.children.indexOf(o,this.index);else for(let i=this.index,o=Math.min(this.top.children.length,i+5);i<o;i++){let o=this.top.children[i];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){r=i;break}}return!(r<0)&&(this.destroyBetween(this.index,r),this.index++,!0)}updateNodeAt(e,t,n,i,o){let r=this.top.children[i];return r.dirty==oi&&r.dom==r.contentDOM&&(r.dirty=ii),!!r.update(e,t,n,o)&&(this.destroyBetween(this.index,i),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,i,o){for(let r=this.index;r<this.top.children.length;r++){let s=this.top.children[r];if(s instanceof ci){let a=this.preMatch.matched.get(s);if(null!=a&&a!=o)return!1;let l=s.dom;if(!(this.lock&&(l==this.lock||1==l.nodeType&&l.contains(this.lock.parentNode))&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=oi&&wi(t,s.outerDeco)))&&s.update(e,t,n,i))return this.destroyBetween(this.index,r),s.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(e,t,n,i,o){this.top.children.splice(this.index++,0,ci.create(this.top,e,t,n,i,o)),this.changed=!0}placeWidget(e,t,n){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(!i||!i.matchesWidget(e)||e!=i.widget&&i.widget.type.toDOM.parentNode){let i=new si(this.top,e,t,n);this.top.children.splice(this.index++,0,i),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof li;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof ui)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((gn||mn)&&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 i=new di(this.top,[],n,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}}function _i(e,t){return e.type.side-t.type.side}function Mi(e,t,n,i,o){let r=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,p=a+=l.size;c>=n||p<=t?r.push(l):(c<t&&r.push(l.slice(0,t-c,i)),o&&(r.push(o),o=void 0),p>n&&r.push(l.slice(n-c,l.size,i)))}return r}function Ci(e,t=null){let n=e.domSelection(),i=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),r=o&&0==o.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=i.resolve(s);if(Sn(n)){for(a=c;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&Rt.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let i=0==t,o=t==Tn(e);i||o;){if(e==n)return!0;let t=kn(e);if(!(e=e.parentNode))return!1;i=i&&0==t,o=o&&t==Tn(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;l=new Rt(s==e?c:i.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=i.resolve(t)}if(!l){l=zi(e,a,c,"pointer"==t||e.state.selection.head<c.pos&&!r?1:-1)}return l}function Di(e){return e.editable?e.hasFocus():Ri(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Oi(e,t=!1){let n=e.state.selection;if(ji(e,n),Di(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&mn){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Cn(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(),i=e.cursorWrapper.dom,o="IMG"==i.nodeName;o?n.setEnd(i.parentNode,kn(i)+1):n.setEnd(i,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&pn&&un<=11&&(i.disabled=!0,i.disabled=!1)}(e);else{let i,o,{anchor:r,head:s}=n;!Ti||n instanceof zt||(n.$from.parent.inlineContent||(i=Ni(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=Ni(e,n.to))),e.docView.setSelection(r,s,e.root,t),Ti&&(i&&Ai(i),o&&Ai(o)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),i=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==i&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Di(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Ti=gn||mn&&fn<63;function Ni(e,t){let{node:n,offset:i}=e.docView.domFromPos(t,0),o=i<n.childNodes.length?n.childNodes[i]:null,r=i?n.childNodes[i-1]:null;if(gn&&o&&"false"==o.contentEditable)return Si(o);if(!(o&&"false"!=o.contentEditable||r&&"false"!=r.contentEditable)){if(o)return Si(o);if(r)return Si(r)}}function Si(e){return e.contentEditable="true",gn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Ai(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function ji(e,t){if(t instanceof Rt){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Ii(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Ii(e)}function Ii(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function zi(e,t,n,i){return e.someProp("createSelectionBetween",(i=>i(e,t,n)))||zt.between(t,n,i)}function Li(e){return!(e.editable&&!e.hasFocus())&&Ri(e)}function Ri(e){let t=e.domSelection();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 Fi(e,t){let{$anchor:n,$head:i}=e.selection,o=t>0?n.max(i):n.min(i),r=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return r&&St.findFrom(r,t)}function Pi(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Bi(e,t,n){let i=e.state.selection;if(!(i instanceof zt)){if(i instanceof Rt&&i.node.isInline)return Pi(e,new zt(t>0?i.$to:i.$from));{let n=Fi(e.state,t);return!!n&&Pi(e,n)}}if(!i.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=Fi(e.state,t);return!!(n&&n instanceof Rt)&&Pi(e,n)}if(!(vn&&n.indexOf("m")>-1)){let n,o=i.$head,r=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!r||r.isText)return!1;let s=t<0?o.pos-r.nodeSize:o.pos;return!!(r.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(Rt.isSelectable(r)?Pi(e,new Rt(t<0?e.state.doc.resolve(o.pos-r.nodeSize):o)):!!xn&&Pi(e,new zt(e.state.doc.resolve(t<0?s:s+r.nodeSize))))}}function Ui(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function $i(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function Hi(e){let t=e.domSelection(),n=t.focusNode,i=t.focusOffset;if(!n)return;let o,r,s=!1;for(dn&&1==n.nodeType&&i<Ui(n)&&$i(n.childNodes[i])&&(s=!0);;)if(i>0){if(1!=n.nodeType)break;{let e=n.childNodes[i-1];if($i(e))o=n,r=--i;else{if(3!=e.nodeType)break;n=e,i=n.nodeValue.length}}}else{if(qi(n))break;{let t=n.previousSibling;for(;t&&$i(t);)o=n.parentNode,r=kn(t),t=t.previousSibling;if(t)n=t,i=Ui(n);else{if(n=n.parentNode,n==e.dom)break;i=0}}}s?Wi(e,t,n,i):o&&Wi(e,t,o,r)}function Vi(e){let t=e.domSelection(),n=t.focusNode,i=t.focusOffset;if(!n)return;let o,r,s=Ui(n);for(;;)if(i<s){if(1!=n.nodeType)break;if(!$i(n.childNodes[i]))break;o=n,r=++i}else{if(qi(n))break;{let t=n.nextSibling;for(;t&&$i(t);)o=t.parentNode,r=kn(t)+1,t=t.nextSibling;if(t)n=t,i=0,s=Ui(n);else{if(n=n.parentNode,n==e.dom)break;i=s=0}}}o&&Wi(e,t,o,r)}function qi(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Wi(e,t,n,i){if(Sn(t)){let e=document.createRange();e.setEnd(n,i),e.setStart(n,i),t.removeAllRanges(),t.addRange(e)}else t.extend&&t.extend(n,i);e.domObserver.setCurSelection();let{state:o}=e;setTimeout((()=>{e.state==o&&Oi(e)}),50)}function Ki(e,t,n){let i=e.state.selection;if(i instanceof zt&&!i.empty||n.indexOf("s")>-1)return!1;if(vn&&n.indexOf("m")>-1)return!1;let{$from:o,$to:r}=i;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Fi(e.state,t);if(n&&n instanceof Rt)return Pi(e,n)}if(!o.parent.inlineContent){let n=t<0?o:r,s=i instanceof Pt?St.near(n,t):St.findFrom(n,t);return!!s&&Pi(e,s)}return!1}function Yi(e,t){if(!(e.state.selection instanceof zt))return!0;let{$head:n,$anchor:i,empty:o}=e.state.selection;if(!n.sameParent(i))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let r=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(r&&!r.isText){let i=e.state.tr;return t<0?i.delete(n.pos-r.nodeSize,n.pos):i.delete(n.pos,n.pos+r.nodeSize),e.dispatch(i),!0}return!1}function Qi(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Gi(e,t){let n=t.keyCode,i=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||vn&&72==n&&"c"==i?Yi(e,-1)||Hi(e):46==n||vn&&68==n&&"c"==i?Yi(e,1)||Vi(e):13==n||27==n||(37==n||vn&&66==n&&"c"==i?Bi(e,-1,i)||Hi(e):39==n||vn&&70==n&&"c"==i?Bi(e,1,i)||Vi(e):38==n||vn&&80==n&&"c"==i?Ki(e,-1,i)||Hi(e):40==n||vn&&78==n&&"c"==i?function(e){if(!gn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Qi(e,n,"true"),setTimeout((()=>Qi(e,n,"false")),20)}return!1}(e)||Ki(e,1,i)||Vi(e):i==(vn?"m":"c")&&(66==n||73==n||89==n||90==n))}function Ji(e,t){e.someProp("transformCopied",(e=>{t=e(t)}));let n=[],{content:i,openStart:o,openEnd:r}=t;for(;o>1&&r>1&&1==i.childCount&&1==i.firstChild.childCount;){o--,r--;let e=i.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),i=e.content}let s=e.someProp("clipboardSerializer")||Fe.fromSchema(e.state.schema),a=ao(),l=a.createElement("div");l.appendChild(s.serializeFragment(i,{document:a}));let c,p=l.firstChild,u=0;for(;p&&1==p.nodeType&&(c=ro[p.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),u++}p=l.firstChild}p&&1==p.nodeType&&p.setAttribute("data-pm-slice",`${o} ${r}${u?` -${u}`:""} ${JSON.stringify(n)}`);let d=e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n");return{dom:l,text:d}}function Zi(e,t,n,i,o){let r,s,a=o.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(i||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||i)})),a)return t?new U(z.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):U.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,o,i)));if(n)s=n;else{let n=o.marks(),{schema:i}=e.state,s=Fe.fromSchema(i);r=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=r.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(i.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),r=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,i=ao().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&ro[o[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(i.innerHTML=e,n)for(let e=0;e<n.length;e++)i=i.querySelector(n[e])||i;return i}(n),xn&&function(e){let t=e.querySelectorAll(mn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let i=t[n];1==i.childNodes.length&&" "==i.textContent&&i.parentNode&&i.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),i)}}(r);let c=r&&r.querySelector("[data-pm-slice]"),p=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let e=+p[3];e>0&&r.firstChild;e--)r=r.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Me.fromSchema(e.state.schema);s=t.parseSlice(r,{preserveWhitespace:!(!l&&!p),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Xi.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(p)s=function(e,t){if(!e.size)return e;let n,i=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:o,openStart:r,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=i.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;o=z.from(t.create(n[e+1],o)),r++,s++}return new U(o,r,s)}(oo(s,+p[1],+p[2]),p[4]);else if(s=U.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i,o=t.node(n).contentMatchAt(t.index(n)),r=[];if(e.forEach((e=>{if(!r)return;let t,n=o.findWrapping(e.type);if(!n)return r=null;if(t=r.length&&i.length&&to(n,i,e,r[r.length-1],0))r[r.length-1]=t;else{r.length&&(r[r.length-1]=no(r[r.length-1],i.length));let t=eo(e,n);r.push(t),o=o.matchType(t.type),i=n}})),r)return z.from(r)}return e}(s.content,o),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=oo(s,e,t)}return e.someProp("transformPasted",(e=>{s=e(s)})),s}const Xi=/^(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 eo(e,t,n=0){for(let i=t.length-1;i>=n;i--)e=t[i].create(null,z.from(e));return e}function to(e,t,n,i,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let r=to(e,t,n,i.lastChild,o+1);if(r)return i.copy(i.content.replaceChild(i.childCount-1,r));if(i.contentMatchAt(i.childCount).matchType(o==e.length-1?n.type:e[o+1]))return i.copy(i.content.append(z.from(eo(n,e,o+1))))}}function no(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,no(e.lastChild,t-1)),i=e.contentMatchAt(e.childCount).fillBefore(z.empty,!0);return e.copy(n.append(i))}function io(e,t,n,i,o,r){let s=t<0?e.firstChild:e.lastChild,a=s.content;return o<i-1&&(a=io(a,t,n,i,o+1,r)),o>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||r<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(z.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function oo(e,t,n){return t<e.openStart&&(e=new U(io(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new U(io(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const ro={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 so=null;function ao(){return so||(so=document.implementation.createHTMLDocument("title"))}const lo={},co={},po={touchstart:!0,touchmove:!0};class uo{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.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function ho(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function mo(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>fo(e,t))}))}function fo(e,t){return e.someProp("handleDOMEvents",(n=>{let i=n[t.type];return!!i&&(i(e,t)||t.defaultPrevented)}))}function go(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 bo(e){return{left:e.clientX,top:e.clientY}}function vo(e,t,n,i,o){if(-1==i)return!1;let r=e.state.doc.resolve(i);for(let i=r.depth+1;i>0;i--)if(e.someProp(t,(t=>i>r.depth?t(e,n,r.nodeAfter,r.before(i),o,!0):t(e,n,r.node(i),r.before(i),o,!1))))return!0;return!1}function yo(e,t,n){e.focused||e.focus();let i=e.state.tr.setSelection(t);"pointer"==n&&i.setMeta("pointer",!0),e.dispatch(i)}function xo(e,t,n,i,o){return vo(e,"handleClickOn",t,n,i)||e.someProp("handleClick",(n=>n(e,t,i)))||(o?function(e,t){if(-1==t)return!1;let n,i,o=e.state.selection;o instanceof Rt&&(n=o.node);let r=e.state.doc.resolve(t);for(let e=r.depth+1;e>0;e--){let t=e>r.depth?r.nodeAfter:r.node(e);if(Rt.isSelectable(t)){i=n&&o.$from.depth>0&&e>=o.$from.depth&&r.before(o.$from.depth+1)==o.$from.pos?r.before(o.$from.depth):r.before(e);break}}return null!=i&&(yo(e,Rt.create(e.state.doc,i),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return!!(i&&i.isAtom&&Rt.isSelectable(i))&&(yo(e,new Rt(n),"pointer"),!0)}(e,n))}function wo(e,t,n,i){return vo(e,"handleDoubleClickOn",t,n,i)||e.someProp("handleDoubleClick",(n=>n(e,t,i)))}function ko(e,t,n,i){return vo(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",(n=>n(e,t,i)))||function(e,t,n){if(0!=n.button)return!1;let i=e.state.doc;if(-1==t)return!!i.inlineContent&&(yo(e,zt.create(i,0,i.content.size),"pointer"),!0);let o=i.resolve(t);for(let t=o.depth+1;t>0;t--){let n=t>o.depth?o.nodeAfter:o.node(t),r=o.before(t);if(n.inlineContent)yo(e,zt.create(i,r+1,r+1+n.content.size),"pointer");else{if(!Rt.isSelectable(n))continue;yo(e,Rt.create(i,r),"pointer")}return!0}}(e,n,i)}function Eo(e){return No(e)}co.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Co(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!yn||!mn||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!bn||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||Gi(e,n)?n.preventDefault():ho(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,An(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},co.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},co.keypress=(e,t)=>{let n=t;if(Co(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||vn&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let i=e.state.selection;if(!(i instanceof zt&&i.$from.sameParent(i.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,i.$from.pos,i.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const _o=vn?"metaKey":"ctrlKey";lo.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let i=Eo(e),o=Date.now(),r="singleClick";o-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,i=t.y-e.clientY;return n*n+i*i<100}(n,e.input.lastClick)&&!n[_o]&&("singleClick"==e.input.lastClick.type?r="doubleClick":"doubleClick"==e.input.lastClick.type&&(r="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:r};let s=e.posAtCoords(bo(n));s&&("singleClick"==r?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Mo(e,s,n,!!i)):("doubleClick"==r?wo:ko)(e,s.pos,s.inside,n)?n.preventDefault():ho(e,"pointer"))};class Mo{constructor(e,t,n,i){let o,r;if(this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[_o],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),r=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,r=n.depth?n.before():0}const s=i?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof Rt&&l.from<=r&&l.to>r)&&(this.mightDrag={node:o,pos:r,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!dn||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)),ho(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((()=>Oi(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(bo(e))),this.updateAllowDefault(e),this.allowDefault||!t?ho(this.view,"pointer"):xo(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||gn&&this.mightDrag&&!this.mightDrag.node.isAtom||mn&&!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)?(yo(this.view,St.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):ho(this.view,"pointer")}move(e){this.updateAllowDefault(e),ho(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 Co(e,t){return!!e.composing||!!(gn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}lo.touchstart=e=>{e.input.lastTouch=Date.now(),Eo(e),ho(e,"pointer")},lo.touchmove=e=>{e.input.lastTouch=Date.now(),ho(e,"pointer")},lo.contextmenu=e=>Eo(e);const Do=yn?5e3:-1;function Oo(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>No(e)),t))}function To(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 No(e,t=!1){if(!(yn&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),To(e),t||e.docView&&e.docView.dirty){let t=Ci(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}co.compositionstart=co.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(),No(e,!0),e.markCursor=null;else if(No(e),dn&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let i=n<0?e.lastChild:e.childNodes[n-1];if(!i)break;if(3==i.nodeType){t.collapse(i,i.nodeValue.length);break}e=i,n=-1}}e.input.composing=!0}Oo(e,Do)},co.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Oo(e,20))};const So=pn&&un<15||bn&&wn<604;function Ao(e,t,n,i){let o=Zi(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,i,o||U.empty))))return!0;if(!o)return!1;let r=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),s=r?e.state.tr.replaceSelectionWith(r,e.input.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}lo.copy=co.cut=(e,t)=>{let n=t,i=e.state.selection,o="cut"==n.type;if(i.empty)return;let r=So?null:n.clipboardData,s=i.content(),{dom:a,text:l}=Ji(e,s);r?(n.preventDefault(),r.clearData(),r.setData("text/html",a.innerHTML),r.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 i=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),i.removeAllRanges(),i.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},co.paste=(e,t)=>{let n=t;if(e.composing&&!yn)return;let i=So?null:n.clipboardData;i&&Ao(e,i.getData("text/plain"),i.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,i=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout((()=>{e.focus(),i.parentNode&&i.parentNode.removeChild(i),n?Ao(e,i.value,null,t):Ao(e,i.textContent,i.innerHTML,t)}),50)}(e,n)};class jo{constructor(e,t){this.slice=e,this.move=t}}const Io=vn?"altKey":"ctrlKey";lo.dragstart=(e,t)=>{let n=t,i=e.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let o=e.state.selection,r=o.empty?null:e.posAtCoords(bo(n));if(r&&r.pos>=o.from&&r.pos<=(o instanceof Rt?o.to-1:o.to));else if(i&&i.mightDrag)e.dispatch(e.state.tr.setSelection(Rt.create(e.state.doc,i.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(Rt.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=Ji(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(So?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",So||n.dataTransfer.setData("text/plain",l),e.dragging=new jo(s,!n[Io])},lo.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},co.dragover=co.dragenter=(e,t)=>t.preventDefault(),co.drop=(e,t)=>{let n=t,i=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(bo(n));if(!o)return;let r=e.state.doc.resolve(o.pos),s=i&&i.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=Zi(e,n.dataTransfer.getData(So?"Text":"text/plain"),So?null:n.dataTransfer.getData("text/html"),!1,r);let a=!(!i||n[Io]);if(e.someProp("handleDrop",(t=>t(e,n,s||U.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?ft(e.state.doc,r.pos,s):r.pos;null==l&&(l=r.pos);let c=e.state.tr;a&&c.deleteSelection();let p=c.mapping.map(l),u=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,d=c.doc;if(u?c.replaceRangeWith(p,p,s.content.firstChild):c.replaceRange(p,p,s),c.doc.eq(d))return;let h=c.doc.resolve(p);if(u&&Rt.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Rt(h));else{let t=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,n,i,o)=>t=o)),c.setSelection(zi(e,h,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},lo.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.domSelection())&&Oi(e)}),20))},lo.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)},lo.beforeinput=(e,t)=>{if(mn&&yn&&"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,An(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 co)lo[e]=co[e];function zo(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 Lo{constructor(e,t){this.toDOM=e,this.spec=t||Uo,this.side=this.spec.side||0}map(e,t,n,i){let{pos:o,deleted:r}=e.mapResult(t.from+i,this.side<0?-1:1);return r?null:new Po(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Lo&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&zo(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Ro{constructor(e,t){this.attrs=e,this.spec=t||Uo}map(e,t,n,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-n,r=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-n;return o>=r?null:new Po(o,r,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Ro&&zo(this.attrs,e.attrs)&&zo(this.spec,e.spec)}static is(e){return e.type instanceof Ro}destroy(){}}class Fo{constructor(e,t){this.attrs=e,this.spec=t||Uo}map(e,t,n,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let r=e.mapResult(t.to+i,-1);return r.deleted||r.pos<=o.pos?null:new Po(o.pos-n,r.pos-n,this)}valid(e,t){let n,{index:i,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(n=e.child(i)).isText&&o+n.nodeSize==t.to}eq(e){return this==e||e instanceof Fo&&zo(this.attrs,e.attrs)&&zo(this.spec,e.spec)}destroy(){}}class Po{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new Po(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 Po(e,e,new Lo(t,n))}static inline(e,t,n,i){return new Po(e,t,new Ro(n,i))}static node(e,t,n,i){return new Po(e,t,new Fo(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ro}}const Bo=[],Uo={};class $o{constructor(e,t){this.local=e.length?e:Bo,this.children=t.length?t:Bo}static create(e,t){return t.length?Yo(t,e,0,Uo):Ho}find(e,t,n){let i=[];return this.findInner(null==e?0:e,null==t?1e9:t,i,0,n),i}findInner(e,t,n,i,o){for(let r=0;r<this.local.length;r++){let s=this.local[r];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+i,s.to+i))}for(let r=0;r<this.children.length;r+=3)if(this.children[r]<t&&this.children[r+1]>e){let s=this.children[r]+1;this.children[r+2].findInner(e-s,t-s,n,i+s,o)}}map(e,t,n){return this==Ho||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Uo)}mapInner(e,t,n,i,o){let r;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,i);a&&a.type.valid(t,a)?(r||(r=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,i,o,r,s){let a=e.slice();for(let e=0,t=r;e<n.maps.length;e++){let i=0;n.maps[e].forEach(((e,n,r,s)=>{let l=s-r-(n-e);for(let s=0;s<a.length;s+=3){let c=a[s+1];if(c<0||e>c+t-i)continue;let p=a[s]+t-i;n>=p?a[s+1]=e<=p?-2:-1:r>=o&&l&&(a[s]+=l,a[s+1]+=l)}i+=l})),t=n.maps[e].map(t,-1)}let l=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){l=!0,a[t+1]=-1;continue}let c=n.map(e[t]+r),p=c-o;if(p<0||p>=i.content.size){l=!0;continue}let u=n.map(e[t+1]+r,-1)-o,{index:d,offset:h}=i.content.findIndex(p),m=i.maybeChild(d);if(m&&h==p&&h+m.nodeSize==u){let i=a[t+2].mapInner(n,m,c+1,e[t]+r+1,s);i!=Ho?(a[t]=p,a[t+1]=u,a[t+2]=i):(a[t+1]=-2,l=!0)}else l=!0}if(l){let l=function(e,t,n,i,o,r,s){function a(e,t){for(let r=0;r<e.local.length;r++){let a=e.local[r].map(i,o,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[r].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]+r+1);return n}(a,e,t,n,o,r,s),c=Yo(l,i,0,s);t=c.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new $o(t.sort(Qo),a)}(this.children,r||[],e,t,n,i,o):r?new $o(r.sort(Qo),Bo):Ho}add(e,t){return t.length?this==Ho?$o.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let i,o=0;e.forEach(((e,r)=>{let s,a=r+n;if(s=Wo(t,e,a)){for(i||(i=this.children.slice());o<i.length&&i[o]<r;)o+=3;i[o]==r?i[o+2]=i[o+2].addInner(e,s,a+1):i.splice(o,0,r,r+e.nodeSize,Yo(s,e,a+1,Uo)),o+=3}}));let r=qo(o?Ko(t):t,-n);for(let t=0;t<r.length;t++)r[t].type.valid(e,r[t])||r.splice(t--,1);return new $o(r.length?this.local.concat(r).sort(Qo):this.local,i||this.children)}remove(e){return 0==e.length||this==Ho?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,i=this.local;for(let i=0;i<n.length;i+=3){let o,r=n[i]+t,s=n[i+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>r&&t.to<s&&(e[n]=null,(o||(o=[])).push(t));if(!o)continue;n==this.children&&(n=this.children.slice());let a=n[i+2].removeInner(o,r+1);a!=Ho?n[i+2]=a:(n.splice(i,3),i-=3)}if(i.length)for(let n,o=0;o<e.length;o++)if(n=e[o])for(let e=0;e<i.length;e++)i[e].eq(n,t)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1));return n==this.children&&i==this.local?this:i.length||n.length?new $o(i,n):Ho}forChild(e,t){if(this==Ho)return this;if(t.isLeaf)return $o.empty;let n,i;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 o=e+1,r=o+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<r&&t.to>o&&t.type instanceof Ro){let e=Math.max(o,t.from)-o,n=Math.min(r,t.to)-o;e<n&&(i||(i=[])).push(t.copy(e,n))}}if(i){let e=new $o(i.sort(Qo),Bo);return n?new Vo([e,n]):e}return n||Ho}eq(e){if(this==e)return!0;if(!(e instanceof $o)||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 Go(this.localsInner(e))}localsInner(e){if(this==Ho)return Bo;if(e.inlineContent||!this.local.some(Ro.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Ro||t.push(this.local[e]);return t}}$o.empty=new $o([],[]),$o.removeOverlap=Go;const Ho=$o.empty;class Vo{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,Uo)));return Vo.from(n)}forChild(e,t){if(t.isLeaf)return $o.empty;let n=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=Ho&&(o instanceof Vo?n=n.concat(o.members):n.push(o))}return Vo.from(n)}eq(e){if(!(e instanceof Vo)||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 i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?Go(n?t:t.sort(Qo)):Bo}static from(e){switch(e.length){case 0:return Ho;case 1:return e[0];default:return new Vo(e)}}}function qo(e,t){if(!t||!e.length)return e;let n=[];for(let i=0;i<e.length;i++){let o=e[i];n.push(new Po(o.from+t,o.to+t,o.type))}return n}function Wo(e,t,n){if(t.isLeaf)return null;let i=n+t.nodeSize,o=null;for(let t,r=0;r<e.length;r++)(t=e[r])&&t.from>n&&t.to<i&&((o||(o=[])).push(t),e[r]=null);return o}function Ko(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Yo(e,t,n,i){let o=[],r=!1;t.forEach(((t,s)=>{let a=Wo(e,t,s+n);if(a){r=!0;let e=Yo(a,t,n+s+1,i);e!=Ho&&o.push(s,s+t.nodeSize,e)}}));let s=qo(r?Ko(e):e,-n).sort(Qo);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(i.onRemove&&i.onRemove(s[e].spec),s.splice(e--,1));return s.length||o.length?new $o(s,o):Ho}function Qo(e,t){return e.from-t.from||e.to-t.to}function Go(e){let t=e;for(let n=0;n<t.length-1;n++){let i=t[n];if(i.from!=i.to)for(let o=n+1;o<t.length;o++){let r=t[o];if(r.from!=i.from){r.from<i.to&&(t==e&&(t=e.slice()),t[n]=i.copy(i.from,r.from),Jo(t,o,i.copy(r.from,i.to)));break}r.to!=i.to&&(t==e&&(t=e.slice()),t[o]=r.copy(r.from,i.to),Jo(t,o+1,r.copy(i.to,r.to)))}}return t}function Jo(e,t,n){for(;t<e.length&&Qo(n,e[t])>0;)t++;e.splice(t,0,n)}function Zo(e){let t=[];return e.someProp("decorations",(n=>{let i=n(e.state);i&&i!=Ho&&t.push(i)})),e.cursorWrapper&&t.push($o.create(e.state.doc,[e.cursorWrapper.deco])),Vo.from(t)}const Xo={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},er=pn&&un<=11;class tr{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 nr{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new tr,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]);pn&&un<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),er&&(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,Xo)),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(Li(this.view)){if(this.suppressingSelectionUpdates)return Oi(this.view);if(pn&&un<=11&&!this.view.state.selection.empty){let e=this.view.domSelection();if(e.focusNode&&Cn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(e){if(0==e.rangeCount)return!0;let t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let n=e.domSelection(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Li(e)&&!this.ignoreSelectionChange(n),o=-1,r=-1,s=!1,a=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],a);n&&(o=o<0?n.from:Math.min(n.from,o),r=r<0?n.to:Math.max(n.to,r),n.typeOver&&(s=!0))}if(dn&&a.length>1){let e=a.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 l=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&e.input.lastTouch<Date.now()-300&&Sn(n)&&(l=Ci(e))&&l.eq(St.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Oi(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,r),function(e){if(ir.has(e))return;if(ir.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=dn,or)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."),or=!0}}(e)),this.handleDOMChange(o,r,s,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Oi(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 i=e.previousSibling,o=e.nextSibling;if(pn&&un<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:r}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(i=n),(!r||Array.prototype.indexOf.call(e.addedNodes,r)<0)&&(o=r)}let r=i&&i.parentNode==e.target?kn(i)+1:0,s=n.localPosFromDOM(e.target,r,-1),a=o&&o.parentNode==e.target?kn(o):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,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 ir=new WeakMap,or=!1;function rr(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(gn&&/^(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||gn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function sr(e,t,n,i,o){if(t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Ci(e,t);if(n&&!e.state.selection.eq(n)){let i=e.state.tr.setSelection(n);"pointer"==t?i.setMeta("pointer",!0):"key"==t&&i.scrollIntoView(),e.dispatch(i)}return}let r=e.state.doc.resolve(t),s=r.sharedDepth(n);t=r.before(s+1),n=e.state.doc.resolve(n).after(s+1);let a,l,c=e.state.selection,p=function(e,t,n){let i,{node:o,fromOffset:r,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelection(),p=c.anchorNode;if(p&&e.dom.contains(1==p.nodeType?p:p.parentNode)&&(i=[{node:p,offset:c.anchorOffset}],Sn(c)||i.push({node:c.focusNode,offset:c.focusOffset})),mn&&8===e.input.lastKeyCode)for(let e=s;e>r;e--){let t=o.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let u=e.state.doc,d=e.someProp("domParser")||Me.fromSchema(e.state.schema),h=u.resolve(a),m=null,f=d.parse(o,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:r,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:i,ruleFromNode:rr,context:h});if(i&&null!=i[0].pos){let e=i[0].pos,t=i[1]&&i[1].pos;null==t&&(t=e),m={anchor:e+a,head:t+a}}return{doc:f,sel:m,from:a,to:l}}(e,t,n),u=e.state.doc,d=u.slice(p.from,p.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(a=e.state.selection.to,l="end"):(a=e.state.selection.from,l="start"),e.input.lastKeyCode=null;let h=function(e,t,n,i,o){let r=e.findDiffStart(t,n);if(null==r)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==o){i-=s+Math.max(0,r-Math.min(s,a))-r}if(s<r&&e.size<t.size){r-=i<=r&&i>=s?r-i:0,a=r+(a-s),s=r}else if(a<r){r-=i<=r&&i>=a?r-i:0,s=r+(s-a),a=r}return{start:r,endA:s,endB:a}}(d.content,p.doc.content,p.from,a,l);if((bn&&e.input.lastIOSEnter>Date.now()-225||yn)&&o.some((e=>"DIV"==e.nodeName||"P"==e.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",(t=>t(e,An(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!h){if(!(i&&c instanceof zt&&!c.empty&&c.$head.sameParent(c.$anchor))||e.composing||p.sel&&p.sel.anchor!=p.sel.head){if(p.sel){let t=ar(e,e.state.doc,p.sel);t&&!t.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(t))}return}h={start:c.from,endA:c.to,endB:c.to}}if(mn&&e.cursorWrapper&&p.sel&&p.sel.anchor==e.cursorWrapper.deco.from&&p.sel.head==p.sel.anchor){let e=h.endB-h.start;p.sel={anchor:p.sel.anchor+e,head:p.sel.anchor+e}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&h.start==h.endB&&e.state.selection instanceof zt&&(h.start>e.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=p.from?h.start=e.state.selection.from:h.endA<e.state.selection.to&&h.endA>=e.state.selection.to-2&&e.state.selection.to<=p.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),pn&&un<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>p.from&&" "==p.doc.textBetween(h.start-p.from-1,h.start-p.from+1)&&(h.start--,h.endA--,h.endB--);let m,f=p.doc.resolveNoCache(h.start-p.from),g=p.doc.resolveNoCache(h.endB-p.from),b=u.resolve(h.start),v=f.sameParent(g)&&f.parent.inlineContent&&b.end()>=h.endA;if((bn&&e.input.lastIOSEnter>Date.now()-225&&(!v||o.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!v&&f.pos<p.doc.content.size&&(m=St.findFrom(p.doc.resolve(f.pos+1),1,!0))&&m.head==g.pos)&&e.someProp("handleKeyDown",(t=>t(e,An(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>h.start&&function(e,t,n,i,o){if(!i.parent.isTextblock||n-t<=o.pos-i.pos||lr(i,!0,!1)<o.pos)return!1;let r=e.resolve(t);if(r.parentOffset<r.parent.content.size||!r.parent.isTextblock)return!1;let s=e.resolve(lr(r,!0,!0));return!(!s.parent.isTextblock||s.pos>n||lr(s,!0,!1)<n)&&i.parent.content.cut(i.parentOffset).eq(s.parent.content)}(u,h.start,h.endA,f,g)&&e.someProp("handleKeyDown",(t=>t(e,An(8,"Backspace")))))return void(yn&&mn&&e.domObserver.suppressSelectionUpdates());mn&&yn&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),yn&&!v&&f.start()!=g.start()&&0==g.parentOffset&&f.depth==g.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==h.endA&&(h.endB-=2,g=p.doc.resolveNoCache(h.endB-p.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,An(13,"Enter"))}))}),20));let y,x,w,k=h.start,E=h.endA;if(v)if(f.pos==g.pos)pn&&un<=11&&0==f.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Oi(e)),20)),y=e.state.tr.delete(k,E),x=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(w=function(e,t){let n,i,o,r=e.firstChild.marks,s=t.firstChild.marks,a=r,l=s;for(let e=0;e<s.length;e++)a=s[e].removeFromSet(a);for(let e=0;e<r.length;e++)l=r[e].removeFromSet(l);if(1==a.length&&0==l.length)i=a[0],n="add",o=e=>e.mark(i.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;i=l[0],n="remove",o=e=>e.mark(i.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(o(t.child(e)));if(z.from(c).eq(e))return{mark:i,type:n}}(f.parent.content.cut(f.parentOffset,g.parentOffset),b.parent.content.cut(b.parentOffset,h.endA-b.start()))))y=e.state.tr,"add"==w.type?y.addMark(k,E,w.mark):y.removeMark(k,E,w.mark);else if(f.parent.child(f.index()).isText&&f.index()==g.index()-(g.textOffset?0:1)){let t=f.parent.textBetween(f.parentOffset,g.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,k,E,t))))return;y=e.state.tr.insertText(t,k,E)}if(y||(y=e.state.tr.replace(k,E,p.doc.slice(h.start-p.from,h.endB-p.from))),p.sel){let t=ar(e,y.doc,p.sel);t&&!(mn&&yn&&e.composing&&t.empty&&(h.start!=h.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==k||t.head==y.mapping.map(E)-1)||pn&&t.empty&&t.head==k)&&y.setSelection(t)}x&&y.ensureMarks(x),e.dispatch(y.scrollIntoView())}function ar(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:zi(e,t.resolve(n.anchor),t.resolve(n.head))}function lr(e,t,n){let i=e.depth,o=t?e.end():e.pos;for(;i>0&&(t||e.indexAfter(i)==e.node(i).childCount);)i--,o++,t=!1;if(n){let t=e.node(i).maybeChild(e.indexAfter(i));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}class cr{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 uo,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(mr),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=dr(this),ur(this),this.nodeViews=hr(this),this.docView=pi(this.state.doc,pr(this),Zo(this),this.dom,this),this.domObserver=new nr(this,((e,t,n,i)=>sr(this,e,t,n,i))),this.domObserver.start(),function(e){for(let t in lo){let n=lo[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!go(e,t)||fo(e,t)||!e.editable&&t.type in co||n(e,t)},po[t]?{passive:!0}:void 0)}gn&&e.dom.addEventListener("input",(()=>null)),mo(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&&mo(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(mr),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(To(this),o=!0),this.state=e;let r=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(r||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=hr(this);(function(e,t){let n=0,i=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let e in t)i++;return n!=i})(e,this.nodeViews)&&(this.nodeViews=e,i=!0)}(r||t.handleDOMEvents!=this._props.handleDOMEvents)&&mo(this),this.editable=dr(this),ur(this);let s=Zo(this),a=pr(this),l=n.plugins==e.plugins||n.doc.eq(e.doc)?e.scrollToSelection>n.scrollToSelection?"to selection":"preserve":"reset",c=i||!this.docView.matchesNode(e.doc,a,s);!c&&e.selection.eq(n.selection)||(o=!0);let p="preserve"==l&&o&&null==this.dom.style.overflowAnchor&&function(e){let t,n,i=e.dom.getBoundingClientRect(),o=Math.max(0,i.top);for(let r=(i.left+i.right)/2,s=o+1;s<Math.min(innerHeight,i.bottom);s+=5){let i=e.root.elementFromPoint(r,s);if(!i||i==e.dom||!e.dom.contains(i))continue;let a=i.getBoundingClientRect();if(a.top>=o-20){t=i,n=a.top;break}}return{refDOM:t,refTop:n,stack:Rn(e.dom)}}(this);if(o){this.domObserver.stop();let t=c&&(pn||mn)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(c){let n=mn?this.trackWrites=this.domSelection().focusNode:null;!i&&this.docView.update(e.doc,a,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=pi(e.doc,a,s,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return Cn(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Oi(this,t):(ji(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():p&&function({refDOM:e,refTop:t,stack:n}){let i=e?e.getBoundingClientRect().top:0;Fn(n,0==i?0:i-t)}(p)}scrollToSelection(){let e=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof Rt){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&Ln(this,t.getBoundingClientRect(),e)}else Ln(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}someProp(e,t){let n,i=this._props&&this._props[e];if(null!=i&&(n=t?t(i):i))return n;for(let i=0;i<this.directPlugins.length;i++){let o=this.directPlugins[i].props[e];if(null!=o&&(n=t?t(o):o))return n}let o=this.state.plugins;if(o)for(let i=0;i<o.length;i++){let r=o[i].props[e];if(null!=r&&(n=t?t(r):r))return n}}hasFocus(){if(pn){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(Pn)return e.focus(Pn);let t=Rn(e);e.focus(null==Pn?{get preventScroll(){return Pn={preventScroll:!0},!0}}:void 0),Pn||(Pn=!1,Fn(t,0))}(this.dom),Oi(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}posAtCoords(e){return Hn(this,e)}coordsAtPos(e,t=1){return Wn(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 i=this.docView.posFromDOM(e,t,n);if(null==i)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return ei(this,t||this.state,e)}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,[],Zo(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){fo(e,t)||!lo[t.type]||!e.editable&&t.type in co||lo[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelection(){return this.root.getSelection()}}function pr(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",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]))})),[Po.node(0,e.state.doc.content.size,t)]}function ur(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:Po.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function dr(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function hr(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 mr(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var fr={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:"'"},gr={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},br="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent);"undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent);for(var vr="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),yr="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),xr=vr||br&&+br[1]<57,wr=0;wr<10;wr++)fr[48+wr]=fr[96+wr]=String(wr);for(wr=1;wr<=24;wr++)fr[wr+111]="F"+wr;for(wr=65;wr<=90;wr++)fr[wr]=String.fromCharCode(wr+32),gr[wr]=String.fromCharCode(wr);for(var kr in fr)gr.hasOwnProperty(kr)||(gr[kr]=fr[kr]);const Er="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function _r(e){let t,n,i,o,r=e.split(/-(?!$)/),s=r[r.length-1];"Space"==s&&(s=" ");for(let e=0;e<r.length-1;e++){let s=r[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))i=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);Er?o=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),i&&(s="Shift-"+s),s}function Mr(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function Cr(e){let t=function(e){let t=Object.create(null);for(let n in e)t[_r(n)]=e[n];return t}(e);return function(e,n){let i,o=function(e){var t=!(xr&&(e.ctrlKey||e.altKey||e.metaKey)||yr&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?gr:fr)[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),r=1==o.length&&" "!=o,s=t[Mr(o,n,!r)];if(s&&s(e.state,e.dispatch,e))return!0;if(r&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(i=fr[n.keyCode])&&i!=o){let o=t[Mr(i,n,!0)];if(o&&o(e.state,e.dispatch,e))return!0}else if(r&&n.shiftKey){let i=t[Mr(o,n,!0)];if(i&&i(e.state,e.dispatch,e))return!0}return!1}}function Dr(e,t,n=!1){for(let i=e;i;i="start"==t?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(n&&1!=i.childCount)return!1}return!1}function Or(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 Tr(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function Nr(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Sr(e,t,n){let i,o,r=t.nodeBefore,s=t.nodeAfter;if(r.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){let i=t.nodeBefore,o=t.nodeAfter,r=t.index();return!(!(i&&o&&i.type.compatibleContent(o.type))||(!i.content.size&&t.parent.canReplace(r-1,r)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(r,r+1)||!o.isTextblock&&!mt(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,i.type,i.contentMatchAt(i.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(o=r.contentMatchAt(r.childCount)).findWrapping(s.type))&&o.matchType(i[0]||s.type).validEnd){if(n){let o=t.pos+s.nodeSize,a=z.empty;for(let e=i.length-1;e>=0;e--)a=z.from(i[e].create(null,a));a=z.from(r.copy(a));let l=e.tr.step(new at(t.pos-1,o,t.pos,o,new U(a,1,0),i.length,!0)),c=o+2*i.length;mt(l.doc,c)&&l.join(c),n(l.scrollIntoView())}return!0}let l=St.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),p=c&&pt(c);if(null!=p&&p>=t.depth)return n&&n(e.tr.lift(c,p).scrollIntoView()),!0;if(a&&Dr(s,"start",!0)&&Dr(r,"end")){let i=r,o=[];for(;o.push(i),!i.isTextblock;)i=i.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(i.canReplace(i.childCount,i.childCount,a.content)){if(n){let i=z.empty;for(let e=o.length-1;e>=0;e--)i=z.from(o[e].copy(i));n(e.tr.step(new at(t.pos-o.length,t.pos+s.nodeSize,t.pos+l,t.pos+s.nodeSize-l,new U(i,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Ar(e){return function(t,n){let i=t.selection,o=e<0?i.$from:i.$to,r=o.depth;for(;o.node(r).isInline;){if(!r)return!1;r--}return!!o.node(r).isTextblock&&(n&&n(t.tr.setSelection(zt.create(t.doc,e<0?o.start(r):o.end(r)))),!0)}}const jr=Ar(-1),Ir=Ar(1);function zr(e,t=null){return function(n,i){let{from:o,to:r}=n.selection,s=!1;return n.doc.nodesBetween(o,r,((i,o)=>{if(s)return!1;if(i.isTextblock&&!i.hasMarkup(e,t))if(i.type==e)s=!0;else{let t=n.doc.resolve(o),i=t.index();s=t.parent.canReplaceWith(i,i+1,e)}})),!!s&&(i&&i(n.tr.setBlockType(o,r,e,t).scrollIntoView()),!0)}}function Lr(e,t=null){return function(n,i){let{$from:o,$to:r}=n.selection,s=o.blockRange(r),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;let e=n.doc.resolve(s.start-2);l=new ie(e,e,s.depth),s.endIndex<s.parent.childCount&&(s=new ie(o,n.doc.resolve(r.end(s.depth)),s.depth)),a=!0}let c=ut(l,e,t,s);return!!c&&(i&&i(function(e,t,n,i,o){let r=z.empty;for(let e=n.length-1;e>=0;e--)r=z.from(n[e].type.create(n[e].attrs,r));e.step(new at(t.start-(i?2:0),t.end,t.start,t.end,new U(r,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==o&&(s=e+1);let a=n.length-s,l=t.start+n.length-(i?2:0),c=t.parent;for(let n=t.startIndex,i=t.endIndex,o=!0;n<i;n++,o=!1)!o&&ht(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(n).nodeSize;return e}(n.tr,s,c,a,e).scrollIntoView()),!0)}}function Rr(e){return function(t,n){let{$from:i,$to:o}=t.selection,r=i.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));return!!r&&(!n||(i.node(r.depth-1).type==e?function(e,t,n,i){let o=e.tr,r=i.end,s=i.$to.end(i.depth);r<s&&(o.step(new at(r-1,s,r,s,new U(z.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new ie(o.doc.resolve(i.$from.pos),o.doc.resolve(s),i.depth));const a=pt(i);if(null==a)return!1;o.lift(i,a);let l=o.mapping.map(r,-1)-1;mt(o.doc,l)&&o.join(l);return t(o.scrollIntoView()),!0}(t,n,e,r):function(e,t,n){let i=e.tr,o=n.parent;for(let e=n.end,t=n.endIndex-1,r=n.startIndex;t>r;t--)e-=o.child(t).nodeSize,i.delete(e-1,e+1);let r=i.doc.resolve(n.start),s=r.nodeAfter;if(i.mapping.map(n.end)!=n.start+r.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==o.childCount,c=r.node(-1),p=r.index(-1);if(!c.canReplace(p+(a?0:1),p+1,s.content.append(l?z.empty:z.from(o))))return!1;let u=r.pos,d=u+s.nodeSize;return i.step(new at(u-(a?1:0),d+(l?1:0),u+1,d-1,new U((a?z.empty:z.from(o.copy(z.empty))).append(l?z.empty:z.from(o.copy(z.empty))),a?0:1,l?0:1),a?0:1)),t(i.scrollIntoView()),!0}(t,n,r)))}}function Fr(e){const{state:t,transaction:n}=e;let{selection:i}=n,{doc:o}=n,{storedMarks:r}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return r},get selection(){return i},get doc(){return o},get tr(){return i=n.selection,o=n.doc,r=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class Pr{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:i}=t,{tr:o}=n,r=this.buildProps(o);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(r);return o.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(o),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:i,state:o}=this,{view:r}=i,s=[],a=!!e,l=e||o.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const i=this.buildProps(l,t),o=n(...e)(i);return s.push(o),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(l),s.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,i=!1,o=e||n.tr,r=this.buildProps(o,i),s=Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...r,dispatch:void 0})])));return{...s,chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:n,editor:i,state:o}=this,{view:r}=i;o.storedMarks&&e.setStoredMarks(o.storedMarks);const s={tr:e,editor:i,view:r,state:Fr({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map((([e,t])=>[e,(...e)=>t(...e)(s)])))}};return s}}function Br(e,t,n){if(void 0===e.config[t]&&e.parent)return Br(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?Br(e.parent,t,n):null})}return e.config[t]}function Ur(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function $r(e){const t=[],{nodeExtensions:n,markExtensions:i}=Ur(e),o=[...n,...i],r={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=Br(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,i])=>{t.push({type:n,name:e,attribute:{...r,...i}})}))}))}))})),o.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},i=Br(e,"addAttributes",n);if(!i)return;const o=i();Object.entries(o).forEach((([n,i])=>{const o={...r,...i};(null==i?void 0:i.isRequired)&&void 0===(null==i?void 0:i.default)&&delete o.default,t.push({type:e.name,name:n,attribute:o})}))})),t}function Hr(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 Vr(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]="class"===e?[n[e],t].join(" "):"style"===e?[n[e],t].join("; "):t:n[e]=t})),n}),{})}function qr(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)=>Vr(e,t)),{})}function Wr(e){return"function"==typeof e}function Kr(e,t=void 0,...n){return Wr(e)?t?e.bind(t)(...n):e(...n):e}function Yr(e,t){return e.style?e:{...e,getAttrs:n=>{const i=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===i)return!1;const o=t.reduce(((e,t)=>{const i=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==i?e:{...e,[t.name]:i}}),{});return{...i,...o}}}}function Qr(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 Gr(e,t){return t.nodes[e]||t.marks[e]||null}function Jr(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function Zr(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class Xr{constructor(e){this.find=e.find,this.handler=e.handler}}function es(e){var t;const{editor:n,from:i,to:o,text:r,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(i);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 p=!1;const u=((e,t=500)=>{let n="";const i=e.parentOffset;return e.parent.nodesBetween(Math.max(0,i-t),i,((e,t,o,r)=>{var s,a;const l=(null===(a=(s=e.type.spec).toText)||void 0===a?void 0:a.call(s,{node:e,pos:t,parent:o,index:r}))||e.textContent||"%leaf%";n+=l.slice(0,Math.max(0,i-t))})),n})(c)+r;return s.forEach((e=>{if(p)return;const t=((e,t)=>{if(Zr(t))return t.exec(e);const n=t(e);if(!n)return null;const i=[];return i.push(n.text),i.index=n.index,i.input=e,i.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),i.push(n.replaceWith)),i})(u,e.find);if(!t)return;const s=l.state.tr,c=Fr({state:l.state,transaction:s}),d={from:i-(t[0].length-r.length),to:o},{commands:h,chain:m,can:f}=new Pr({editor:n,state:c});null!==e.handler({state:c,range:d,match:t,commands:h,chain:m,can:f})&&s.steps.length&&(s.setMeta(a,{transform:s,from:i,to:o,text:r}),l.dispatch(s),p=!0)})),p}function ts(e){const{editor:t,rules:n}=e,i=new Xt({state:{init:()=>null,apply(e,t){const n=e.getMeta(i);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(e,o,r,s)=>es({editor:t,from:o,to:r,text:s,rules:n,plugin:i}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:o}=e.state.selection;o&&es({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:i})})),!1)},handleKeyDown(e,o){if("Enter"!==o.key)return!1;const{$cursor:r}=e.state.selection;return!!r&&es({editor:t,from:r.pos,to:r.pos,text:"\n",rules:n,plugin:i})}},isInputRules:!0});return i}class ns{constructor(e){this.find=e.find,this.handler=e.handler}}function is(e){const{editor:t,state:n,from:i,to:o,rule:r}=e,{commands:s,chain:a,can:l}=new Pr({editor:t,state:n}),c=[];n.doc.nodesBetween(i,o,((e,t)=>{if(!e.isTextblock||e.type.spec.code)return;const p=Math.max(i,t),u=Math.min(o,t+e.content.size),d=((e,t)=>{if(Zr(t))return[...e.matchAll(t)];const n=t(e);return n?n.map((t=>{const n=[];return n.push(t.text),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(p-t,u-t,void 0,""),r.find);d.forEach((e=>{if(void 0===e.index)return;const t=p+e.index+1,i=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(i)},u=r.handler({state:n,range:o,match:e,commands:s,chain:a,can:l});c.push(u)}))}));return c.every((e=>null!==e))}function rs(e){const{editor:t,rules:n}=e;let i=null,o=!1,r=!1;const s=n.map((e=>new Xt({view(e){const t=t=>{var n;i=(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=>(r=i===e.dom.parentElement,!1),paste:(e,t)=>{var n;const i=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return o=!!(null==i?void 0:i.includes("data-pm-slice")),!1}}},appendTransaction:(n,i,s)=>{const a=n[0],l="paste"===a.getMeta("uiEvent")&&!o,c="drop"===a.getMeta("uiEvent")&&!r;if(!l&&!c)return;const p=i.doc.content.findDiffStart(s.doc.content),u=i.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof p||!u||p===u.b)return;const d=s.tr,h=Fr({state:s,transaction:d});return is({editor:t,state:h,from:Math.max(p-1,0),to:u.b-1,rule:e})&&d.steps.length?d:void 0}})));return s}class ss{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=ss.resolve(e),this.schema=function(e){var t;const n=$r(e),{nodeExtensions:i,markExtensions:o}=Ur(e),r=null===(t=i.find((e=>Br(e,"topNode"))))||void 0===t?void 0:t.name,s=Object.fromEntries(i.map((t=>{const i=n.filter((e=>e.type===t.name)),o={name:t.name,options:t.options,storage:t.storage},r=e.reduce(((e,n)=>{const i=Br(n,"extendNodeSchema",o);return{...e,...i?i(t):{}}}),{}),s=Qr({...r,content:Kr(Br(t,"content",o)),marks:Kr(Br(t,"marks",o)),group:Kr(Br(t,"group",o)),inline:Kr(Br(t,"inline",o)),atom:Kr(Br(t,"atom",o)),selectable:Kr(Br(t,"selectable",o)),draggable:Kr(Br(t,"draggable",o)),code:Kr(Br(t,"code",o)),defining:Kr(Br(t,"defining",o)),isolating:Kr(Br(t,"isolating",o)),attrs:Object.fromEntries(i.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=Kr(Br(t,"parseHTML",o));a&&(s.parseDOM=a.map((e=>Yr(e,i))));const l=Br(t,"renderHTML",o);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:qr(e,i)}));const c=Br(t,"renderText",o);return c&&(s.toText=c),[t.name,s]}))),a=Object.fromEntries(o.map((t=>{const i=n.filter((e=>e.type===t.name)),o={name:t.name,options:t.options,storage:t.storage},r=e.reduce(((e,n)=>{const i=Br(n,"extendMarkSchema",o);return{...e,...i?i(t):{}}}),{}),s=Qr({...r,inclusive:Kr(Br(t,"inclusive",o)),excludes:Kr(Br(t,"excludes",o)),group:Kr(Br(t,"group",o)),spanning:Kr(Br(t,"spanning",o)),code:Kr(Br(t,"code",o)),attrs:Object.fromEntries(i.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=Kr(Br(t,"parseHTML",o));a&&(s.parseDOM=a.map((e=>Yr(e,i))));const l=Br(t,"renderHTML",o);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:qr(e,i)})),[t.name,s]})));return new Ee({topNode:r,nodes:s,marks:a})}(this.extensions),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:Gr(e.name,this.schema)};if("mark"===e.type){(null===(t=Kr(Br(e,"keepOnSplit",n)))||void 0===t||t)&&this.splittableMarks.push(e.name)}const i=Br(e,"onBeforeCreate",n);i&&this.editor.on("beforeCreate",i);const o=Br(e,"onCreate",n);o&&this.editor.on("create",o);const r=Br(e,"onUpdate",n);r&&this.editor.on("update",r);const s=Br(e,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=Br(e,"onTransaction",n);a&&this.editor.on("transaction",a);const l=Br(e,"onFocus",n);l&&this.editor.on("focus",l);const c=Br(e,"onBlur",n);c&&this.editor.on("blur",c);const p=Br(e,"onDestroy",n);p&&this.editor.on("destroy",p)}))}static resolve(e){const t=ss.sort(ss.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=Br(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...this.flatten(t())]:e})).flat(10)}static sort(e){const t=100;return e.sort(((e,n)=>{const i=Br(e,"priority")||t,o=Br(n,"priority")||t;return i>o?-1:i<o?1:0}))}get commands(){return this.extensions.reduce(((e,t)=>{const n=Br(t,"addCommands",{name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Gr(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=ss.sort([...this.extensions].reverse()),n=[],i=[],o=t.map((t=>{const o={name:t.name,options:t.options,storage:t.storage,editor:e,type:Gr(t.name,this.schema)},r=[],s=Br(t,"addKeyboardShortcuts",o);let a={};if("mark"===t.type&&t.config.exitable&&(a.ArrowRight=()=>ea.handleExit({editor:e,mark:t})),s){const t=Object.fromEntries(Object.entries(s()).map((([t,n])=>[t,()=>n({editor:e})])));a={...a,...t}}const l=new Xt({props:{handleKeyDown:Cr(a)}});r.push(l);const c=Br(t,"addInputRules",o);Jr(t,e.options.enableInputRules)&&c&&n.push(...c());const p=Br(t,"addPasteRules",o);Jr(t,e.options.enablePasteRules)&&p&&i.push(...p());const u=Br(t,"addProseMirrorPlugins",o);if(u){const e=u();r.push(...e)}return r})).flat();return[ts({editor:e,rules:n}),...rs({editor:e,rules:i}),...o]}get attributes(){return $r(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Ur(this.extensions);return Object.fromEntries(t.filter((e=>!!Br(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),i={name:t.name,options:t.options,storage:t.storage,editor:e,type:Hr(t.name,this.schema)},o=Br(t,"addNodeView",i);if(!o)return[];return[t.name,(i,r,s,a)=>{const l=qr(i,n);return o()({editor:e,node:i,getPos:s,decorations:a,HTMLAttributes:l,extension:t})}]})))}}function as(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function ls(e,t){const n={...e};return as(e)&&as(t)&&Object.keys(t).forEach((i=>{as(t[i])?i in e?n[i]=ls(e[i],t[i]):Object.assign(n,{[i]:t[i]}):Object.assign(n,{[i]:t[i]})})),n}class cs{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&&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=Kr(Br(this,"addOptions",{name:this.name}))),this.storage=Kr(Br(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new cs(e)}configure(e={}){const t=this.extend();return t.options=ls(this.options,e),t.storage=Kr(Br(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new cs(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=Kr(Br(t,"addOptions",{name:t.name})),t.storage=Kr(Br(t,"addStorage",{name:t.name,options:t.options})),t}}function ps(e,t,n){const{from:i,to:o}=t,{blockSeparator:r="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return e.nodesBetween(i,o,((e,n,c,p)=>{var u;const d=null==s?void 0:s[e.type.name];d?(e.isBlock&&!l&&(a+=r,l=!0),c&&(a+=d({node:e,pos:n,parent:c,index:p,range:t}))):e.isText?(a+=null===(u=null==e?void 0:e.text)||void 0===u?void 0:u.slice(Math.max(i,n)-n,o-n),l=!1):e.isBlock&&!l&&(a+=r,l=!0)})),a}function us(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}const ds=cs.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Xt({key:new nn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:i,selection:o}=t,{ranges:r}=o,s=Math.min(...r.map((e=>e.$from.pos))),a=Math.max(...r.map((e=>e.$to.pos)));return ps(i,{from:s,to:a},{textSerializers:us(n)})}}})]}});function hs(e,t,n={strict:!0}){const i=Object.keys(t);return!i.length||i.every((i=>n.strict?t[i]===e[i]:Zr(t[i])?t[i].test(e[i]):t[i]===e[i]))}function ms(e,t,n={}){return e.find((e=>e.type===t&&hs(e.attrs,n)))}function fs(e,t,n={}){return!!ms(e,t,n)}function gs(e,t,n={}){if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if(e.parentOffset===i.offset&&0!==i.offset&&(i=e.parent.childBefore(e.parentOffset)),!i.node)return;const o=ms([...i.node.marks],t,n);if(!o)return;let r=i.index,s=e.start()+i.offset,a=r+1,l=s+i.node.nodeSize;for(ms([...i.node.marks],t,n);r>0&&o.isInSet(e.parent.child(r-1).marks);)r-=1,s-=e.parent.child(r).nodeSize;for(;a<e.parent.childCount&&fs([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function bs(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 vs(e){return e instanceof zt}function ys(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function xs(e,t=null){if(!t)return null;const n=St.atStart(e),i=St.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return i;const o=n.from,r=i.to;return"all"===t?zt.create(e,ys(0,o,r),ys(e.content.size,o,r)):zt.create(e,ys(t,o,r),ys(t,o,r))}function ws(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function ks(e){const t=`<body>${e}</body>`;return(new window.DOMParser).parseFromString(t,"text/html").body}function Es(e,t,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof e&&null!==e)try{return Array.isArray(e)?z.fromArray(e.map((e=>t.nodeFromJSON(e)))):t.nodeFromJSON(e)}catch(i){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",i),Es("",t,n)}if("string"==typeof e){const i=Me.fromSchema(t);return n.slice?i.parseSlice(ks(e),n.parseOptions).content:i.parse(ks(e),n.parseOptions)}return Es("",t,n)}function _s(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function Ms(e,t,n={}){const{from:i,to:o,empty:r}=e.selection,s=t?Hr(t,e.schema):null,a=[];e.doc.nodesBetween(i,o,((e,t)=>{if(e.isText)return;const n=Math.max(i,t),r=Math.min(o,t+e.nodeSize);a.push({node:e,from:n,to:r})}));const l=o-i,c=a.filter((e=>!s||s.name===e.node.type.name)).filter((e=>hs(e.node.attrs,n,{strict:!1})));if(r)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=l}function Cs(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Ds(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,i)=>(n.includes(i)||(t[i]=e[i]),t)),{})}function Os(e,t,n={}){return Es(e,t,{slice:!1,parseOptions:n})}function Ts(e,t){const n=[];return e.descendants(((e,i)=>{t(e)&&n.push({node:e,pos:i})})),n}function Ns(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const i=e.node(n);if(t(i))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:i}}}(t.$from,e)}function Ss(e,t){const n=bs(t,e.schema),{from:i,to:o,empty:r}=e.selection,s=[];r?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(i,o,(e=>{s.push(...e.marks)}));const a=s.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function As(e,t){const n=Cs("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=Hr(t,e.schema),{from:i,to:o}=e.selection,r=[];e.doc.nodesBetween(i,o,(e=>{r.push(e)}));const s=r.reverse().find((e=>e.type.name===n.name));return s?{...s.attrs}:{}}(e,t):"mark"===n?Ss(e,t):{}}function js(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const i=t(e);return!Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const i=t.filter(((e,t)=>t!==n));return!i.some((t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}))}function Is(e,t,n){const i=[];return e===t?n.resolve(e).marks().forEach((t=>{const o=gs(n.resolve(e-1),t.type);o&&i.push({mark:t,...o})})):n.nodesBetween(e,t,((e,t)=>{i.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),i}function zs(e,t,n={}){const{empty:i,ranges:o}=e.selection,r=t?bs(t,e.schema):null;if(i)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!r||r.name===e.type.name)).find((e=>hs(e.attrs,n,{strict:!1})));let s=0;const a=[];if(o.forEach((({$from:t,$to:n})=>{const i=t.pos,o=n.pos;e.doc.nodesBetween(i,o,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(i,t),r=Math.min(o,t+e.nodeSize);s+=r-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:r}))))}))})),0===s)return!1;const l=a.filter((e=>!r||r.name===e.mark.type.name)).filter((e=>hs(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!r||e.mark.type!==r&&e.mark.type.excludes(r))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=s}function Ls(e,t){const{nodeExtensions:n}=Ur(t),i=n.find((t=>t.name===e));if(!i)return!1;const o=Kr(Br(i,"group",{name:i.name,options:i.options,storage:i.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function Rs(e,t,n){const i=0,o=e.state.doc.content.size,r=ys(t,i,o),s=ys(n,i,o),a=e.coordsAtPos(r),l=e.coordsAtPos(s,-1),c=Math.min(a.top,l.top),p=Math.max(a.bottom,l.bottom),u=Math.min(a.left,l.left),d=Math.max(a.right,l.right),h={top:c,bottom:p,left:u,right:d,width:d-u,height:p-c,x:u,y:c};return{...h,toJSON:()=>h}}function Fs(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const i=e.find((e=>e.type===t&&e.name===n));return!!i&&i.attribute.keepOnSplit})))}function Ps(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const i=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(i)}}const Bs=(e,t)=>{const n=Ns((e=>e.type===t))(e.selection);if(!n)return!0;const i=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===i)return!0;const o=e.doc.nodeAt(i);return n.node.type!==(null==o?void 0:o.type)||!mt(e.doc,n.pos)||(e.join(n.pos),!0)},Us=(e,t)=>{const n=Ns((e=>e.type===t))(e.selection);if(!n)return!0;const i=e.doc.resolve(n.start).after(n.depth);if(void 0===i)return!0;const o=e.doc.nodeAt(i);return n.node.type!==(null==o?void 0:o.type)||!mt(e.doc,i)||(e.join(i),!0)};var $s=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:i}=t,{ranges:o}=i;return!n||(o.forEach((({$from:n,$to:i})=>{e.doc.nodesBetween(n.pos,i.pos,((e,n)=>{if(e.type.isText)return;const{doc:i,mapping:o}=t,r=i.resolve(o.map(n)),s=i.resolve(o.map(n+e.nodeSize)),a=r.blockRange(s);if(!a)return;const l=pt(a);if(e.type.isTextblock){const{defaultType:e}=r.parent.contentMatchAt(r.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,{$from:i,$to:o}=n;if(n instanceof Pt||i.parent.inlineContent||o.parent.inlineContent)return!1;let r=Nr(o.parent.contentMatchAt(o.indexAfter()));if(!r||!r.isTextblock)return!1;if(t){let n=(!i.parentOffset&&o.index()<o.parent.childCount?i:o).pos,s=e.tr.insert(n,r.createAndFill());s.setSelection(zt.create(s.doc,n+1)),t(s.scrollIntoView())}return!0})(e,t),deleteNode:e=>({tr:t,state:n,dispatch:i})=>{const o=Hr(e,n.schema),r=t.selection.$anchor;for(let e=r.depth;e>0;e-=1){if(r.node(e).type===o){if(i){const n=r.before(e),i=r.after(e);t.delete(n,i).scrollIntoView()}return!0}}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{const{from:i,to:o}=e;return n&&t.delete(i,o),!0},deleteSelection:()=>({state:e,dispatch:t})=>((e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0))(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:i}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let o=n.node(-1),r=n.indexAfter(-1),s=Nr(o.contentMatchAt(r));if(!s||!o.canReplaceWith(r,r,s))return!1;if(t){let i=n.after(),o=e.tr.replaceWith(i,i,s.createAndFill());o.setSelection(St.near(o.doc.resolve(i),1)),t(o.scrollIntoView())}return!0})(e,t),extendMarkRange:(e,t={})=>({tr:n,state:i,dispatch:o})=>{const r=bs(e,i.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:p}=a;if(o){const e=gs(l,r,t);if(e&&e.from<=c&&e.to>=p){const t=zt.create(s,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:i,tr:o,dispatch:r})=>{t={scrollIntoView:!0,...t};const s=()=>{ws()&&i.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(i.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(i.hasFocus()&&null===e||!1===e)return!0;if(r&&null===e&&!vs(n.state.selection))return s(),!0;const a=xs(o.doc,e)||n.state.selection,l=n.state.selection.eq(a);return r&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},forEach:(e,t)=>n=>e.every(((e,i)=>t(e,{...n,index:i}))),insertContent:(e,t)=>({tr:n,commands:i})=>i.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),insertContentAt:(e,t,n)=>({tr:i,dispatch:o,editor:r})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const o=Es(t,r.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===o.toString())return!0;let{from:s,to:a}="number"==typeof e?{from:e,to:e}:e,l=!0,c=!0;if((o.toString().startsWith("<")?o:[o]).forEach((e=>{e.check(),l=!!l&&(e.isText&&0===e.marks.length),c=!!c&&e.isBlock})),s===a&&c){const{parent:e}=i.doc.resolve(s);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(s-=1,a+=1)}l?i.insertText(t,s,a):i.replaceWith(s,a,o),n.updateSelection&&function(e,t,n){const i=e.steps.length-1;if(i<t)return;const o=e.steps[i];if(!(o instanceof st||o instanceof at))return;const r=e.mapping.maps[i];let s=0;r.forEach(((e,t,n,i)=>{0===s&&(s=i)})),e.setSelection(St.near(e.doc.resolve(s),n))}(i,i.steps.length-1,-1)}return!0},joinBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:i}=e.selection;if(!i||(n?!n.endOfTextblock("backward",e):i.parentOffset>0))return!1;let o=Or(i);if(!o){let n=i.blockRange(),o=n&&pt(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let r=o.nodeBefore;if(!r.type.spec.isolating&&Sr(e,o,t))return!0;if(0==i.parent.content.size&&(Dr(r,"end")||Rt.isSelectable(r))){let n=gt(e.doc,i.before(),i.after(),U.empty);if(n&&n.slice.size<n.to-n.from){if(t){let i=e.tr.step(n);i.setSelection(Dr(r,"end")?St.findFrom(i.doc.resolve(i.mapping.map(o.pos,-1)),-1):Rt.create(i.doc,o.pos-r.nodeSize)),t(i.scrollIntoView())}return!0}}return!(!r.isAtom||o.depth!=i.depth-1||(t&&t(e.tr.delete(o.pos-r.nodeSize,o.pos).scrollIntoView()),0))})(e,t),joinForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:i}=e.selection;if(!i||(n?!n.endOfTextblock("forward",e):i.parentOffset<i.parent.content.size))return!1;let o=Tr(i);if(!o)return!1;let r=o.nodeAfter;if(Sr(e,o,t))return!0;if(0==i.parent.content.size&&(Dr(r,"start")||Rt.isSelectable(r))){let n=gt(e.doc,i.before(),i.after(),U.empty);if(n&&n.slice.size<n.to-n.from){if(t){let i=e.tr.step(n);i.setSelection(Dr(r,"start")?St.findFrom(i.doc.resolve(i.mapping.map(o.pos)),1):Rt.create(i.doc,i.mapping.map(o.pos))),t(i.scrollIntoView())}return!0}}return!(!r.isAtom||o.depth!=i.depth-1||(t&&t(e.tr.delete(o.pos,o.pos+r.nodeSize).scrollIntoView()),0))})(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:i,dispatch:o})=>{const r=function(e){const t=e.split(/-(?!$)/);let n,i,o,r,s=t[t.length-1];"Space"===s&&(s=" ");for(let e=0;e<t.length-1;e+=1){const s=t[e];if(/^(cmd|meta|m)$/i.test(s))r=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))i=!0;else if(/^s(hift)?$/i.test(s))o=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);ws()||_s()?r=!0:i=!0}}return n&&(s=`Alt-${s}`),i&&(s=`Ctrl-${s}`),r&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(e).split(/-(?!$)/),s=r.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:r.includes("Alt"),ctrlKey:r.includes("Ctrl"),metaKey:r.includes("Meta"),shiftKey:r.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(i.mapping);t&&o&&i.maybeStep(t)})),!0},lift:(e,t={})=>({state:n,dispatch:i})=>!!Ms(n,Hr(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:i}=e.selection,o=n.blockRange(i),r=o&&pt(o);return null!=r&&(t&&t(e.tr.lift(o,r).scrollIntoView()),!0)})(n,i),liftEmptyBlock:()=>({state:e,dispatch:t})=>((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(ht(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),o=i&&pt(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)})(e,t),liftListItem:e=>({state:t,dispatch:n})=>Rr(Hr(e,t.schema))(t,n),newlineInCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:i}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(i)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))})(e,t),resetAttributes:(e,t)=>({tr:n,state:i,dispatch:o})=>{let r=null,s=null;const a=Cs("string"==typeof e?e:e.name,i.schema);return!!a&&("node"===a&&(r=Hr(e,i.schema)),"mark"===a&&(s=bs(e,i.schema)),o&&n.selection.ranges.forEach((e=>{i.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,i)=>{r&&r===e.type&&n.setNodeMarkup(i,void 0,Ds(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((o=>{s===o.type&&n.addMark(i,i+e.nodeSize,s.create(Ds(o.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})=>((e,t,n)=>{let{$head:i,empty:o}=e.selection,r=i;if(!o)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):i.parentOffset>0)return!1;r=Or(i)}let s=r&&r.nodeBefore;return!(!s||!Rt.isSelectable(s)||(t&&t(e.tr.setSelection(Rt.create(e.doc,r.pos-s.nodeSize)).scrollIntoView()),0))})(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:i,empty:o}=e.selection,r=i;if(!o)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):i.parentOffset<i.parent.content.size)return!1;r=Tr(i)}let s=r&&r.nodeAfter;return!(!s||!Rt.isSelectable(s)||(t&&t(e.tr.setSelection(Rt.create(e.doc,r.pos)).scrollIntoView()),0))})(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:i,to:o}=e.selection,r=i.sharedDepth(o);return 0!=r&&(n=i.before(r),t&&t(e.tr.setSelection(Rt.create(e.doc,n))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>Ir(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>jr(e,t),setContent:(e,t=!1,n={})=>({tr:i,editor:o,dispatch:r})=>{const{doc:s}=i,a=Os(e,o.schema,n);return r&&i.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!t),!0},setMark:(e,t={})=>({tr:n,state:i,dispatch:o})=>{const{selection:r}=n,{empty:s,ranges:a}=r,l=bs(e,i.schema);if(o)if(s){const e=Ss(i,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const o=e.$from.pos,r=e.$to.pos;i.doc.nodesBetween(o,r,((e,i)=>{const s=Math.max(i,o),a=Math.min(i+e.nodeSize,r);e.marks.find((e=>e.type===l))?e.marks.forEach((e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))})):n.addMark(s,a,l.create(t))}))}));return function(e,t,n){var i;const{selection:o}=t;let r=null;if(vs(o)&&(r=o.$cursor),r){const t=null!==(i=e.storedMarks)&&void 0!==i?i:r.marks();return!!n.isInSet(t)||!t.some((e=>e.type.excludes(n)))}const{ranges:s}=o;return s.some((({$from:t,$to:i})=>{let o=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,i.pos,((e,t,i)=>{if(o)return!1;if(e.isInline){const t=!i||i.type.allowsMarkType(n),r=!!n.isInSet(e.marks)||!e.marks.some((e=>e.type.excludes(n)));o=t&&r}return!o})),o}))}(i,n,l)},setMeta:(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:i,chain:o})=>{const r=Hr(e,n.schema);return r.isTextblock?o().command((({commands:e})=>!!zr(r,t)(n)||e.clearNodes())).command((({state:e})=>zr(r,t)(e,i))).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,i=ys(e,0,n.content.size),o=Rt.create(n,i);t.setSelection(o)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:i,to:o}="number"==typeof e?{from:e,to:e}:e,r=zt.atStart(n).from,s=zt.atEnd(n).to,a=ys(i,r,s),l=ys(o,r,s),c=zt.create(n,a,l);t.setSelection(c)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{const i=Hr(e,t.schema);return(o=i,function(e,t){let{$from:n,$to:i}=e.selection,r=n.blockRange(i,(e=>e.childCount>0&&e.firstChild.type==o));if(!r)return!1;let s=r.startIndex;if(0==s)return!1;let a=r.parent,l=a.child(s-1);if(l.type!=o)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,i=z.from(n?o.create():null),s=new U(z.from(o.create(null,z.from(a.type.create(null,i)))),n?3:1,0),c=r.start,p=r.end;t(e.tr.step(new at(c-(n?3:1),p,c,p,s,1,!0)).scrollIntoView())}return!0})(t,n);var o},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:i,editor:o})=>{const{selection:r,doc:s}=t,{$from:a,$to:l}=r,c=Fs(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(r instanceof Rt&&r.node.isBlock)return!(!a.parentOffset||!ht(s,a.pos))&&(i&&(e&&Ps(n,o.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(i){const i=l.parentOffset===l.parent.content.size;r instanceof zt&&t.deleteSelection();const s=0===a.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}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=i&&s?[{type:s,attrs:c}]:void 0,u=ht(t.doc,t.mapping.map(a.pos),1,p);if(p||u||!ht(t.doc,t.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(u=!0,p=s?[{type:s,attrs:c}]:void 0),u&&(t.split(t.mapping.map(a.pos),1,p),s&&!i&&!a.parentOffset&&a.parent.type!==s)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,s)&&t.setNodeMarkup(t.mapping.map(a.before()),s)}e&&Ps(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return!0},splitListItem:e=>({tr:t,state:n,dispatch:i,editor:o})=>{var r;const s=Hr(e,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const p=a.node(-1);if(p.type!==s)return!1;const u=o.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(i){let e=z.empty;const n=a.index(-1)?1:a.index(-2)?2:3;for(let t=a.depth-n;t>=a.depth-3;t-=1)e=z.from(a.node(t).copy(e));const i=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,o=Fs(u,a.node().type.name,a.node().attrs),l=(null===(r=s.contentMatch.defaultType)||void 0===r?void 0:r.createAndFill(o))||void 0;e=e.append(z.from(s.createAndFill(null,l)||void 0));const c=a.before(a.depth-(n-1));t.replace(c,a.after(-i),new U(e,4-n,0));let p=-1;t.doc.nodesBetween(c,t.doc.content.size,((e,t)=>{if(p>-1)return!1;e.isTextblock&&0===e.content.size&&(p=t+1)})),p>-1&&t.setSelection(zt.near(t.doc.resolve(p))),t.scrollIntoView()}return!0}const d=l.pos===a.end()?p.contentMatchAt(0).defaultType:null,h=Fs(u,p.type.name,p.attrs),m=Fs(u,a.node().type.name,a.node().attrs);t.delete(a.pos,l.pos);const f=d?[{type:s,attrs:h},{type:d,attrs:m}]:[{type:s,attrs:h}];return!!ht(t.doc,a.pos,2)&&(i&&t.split(a.pos,2,f).scrollIntoView(),!0)},toggleList:(e,t)=>({editor:n,tr:i,state:o,dispatch:r,chain:s,commands:a,can:l})=>{const{extensions:c}=n.extensionManager,p=Hr(e,o.schema),u=Hr(t,o.schema),{selection:d}=o,{$from:h,$to:m}=d,f=h.blockRange(m);if(!f)return!1;const g=Ns((e=>Ls(e.type.name,c)))(d);if(f.depth>=1&&g&&f.depth-g.depth<=1){if(g.node.type===p)return a.liftListItem(u);if(Ls(g.node.type.name,c)&&p.validContent(g.node.content)&&r)return s().command((()=>(i.setNodeMarkup(g.pos,p),!0))).command((()=>Bs(i,p))).command((()=>Us(i,p))).run()}return s().command((()=>!!l().wrapInList(p)||a.clearNodes())).wrapInList(p).command((()=>Bs(i,p))).command((()=>Us(i,p))).run()},toggleMark:(e,t={},n={})=>({state:i,commands:o})=>{const{extendEmptyMarkRange:r=!1}=n,s=bs(e,i.schema);return zs(i,s,t)?o.unsetMark(s,{extendEmptyMarkRange:r}):o.setMark(s,t)},toggleNode:(e,t,n={})=>({state:i,commands:o})=>{const r=Hr(e,i.schema),s=Hr(t,i.schema);return Ms(i,r,n)?o.setNode(s):o.setNode(r,n)},toggleWrap:(e,t={})=>({state:n,commands:i})=>{const o=Hr(e,n.schema);return Ms(n,o,t)?i.lift(o):i.wrapIn(o,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let i=0;i<n.length;i+=1){const o=n[i];let r;if(o.spec.isInputRules&&(r=o.getState(e))){if(t){const t=e.tr,n=r.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(r.text){const n=t.doc.resolve(r.from).marks();t.replaceWith(r.from,r.to,e.schema.text(r.text,n))}else t.delete(r.from,r.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:i,ranges:o}=n;return i||t&&o.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},unsetMark:(e,t={})=>({tr:n,state:i,dispatch:o})=>{var r;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=bs(e,i.schema),{$from:c,empty:p,ranges:u}=a;if(!o)return!0;if(p&&s){let{from:e,to:t}=a;const i=null===(r=c.marks().find((e=>e.type===l)))||void 0===r?void 0:r.attrs,o=gs(c,l,i);o&&(e=o.from,t=o.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:i,dispatch:o})=>{let r=null,s=null;const a=Cs("string"==typeof e?e:e.name,i.schema);return!!a&&("node"===a&&(r=Hr(e,i.schema)),"mark"===a&&(s=bs(e,i.schema)),o&&n.selection.ranges.forEach((e=>{const o=e.$from.pos,a=e.$to.pos;i.doc.nodesBetween(o,a,((e,i)=>{r&&r===e.type&&n.setNodeMarkup(i,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach((r=>{if(s===r.type){const l=Math.max(i,o),c=Math.min(i+e.nodeSize,a);n.addMark(l,c,s.create({...r.attrs,...t}))}}))}))})),!0)},wrapIn:(e,t={})=>({state:n,dispatch:i})=>function(e,t=null){return function(n,i){let{$from:o,$to:r}=n.selection,s=o.blockRange(r),a=s&&ut(s,e,t);return!!a&&(i&&i(n.tr.wrap(s,a).scrollIntoView()),!0)}}(Hr(e,n.schema),t)(n,i),wrapInList:(e,t={})=>({state:n,dispatch:i})=>Lr(Hr(e,n.schema),t)(n,i)});const Hs=cs.create({name:"commands",addCommands:()=>({...$s})}),Vs=cs.create({name:"editable",addProseMirrorPlugins(){return[new Xt({key:new nn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),qs=cs.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Xt({key:new nn("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const i=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(i),!1},blur:(t,n)=>{e.isFocused=!1;const i=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(i),!1}}}})]}}),Ws=cs.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:i}=t,{empty:o,$anchor:r}=n,{pos:s,parent:a}=r,l=St.atStart(i).from===s;return!(!(o&&l&&a.type.isTextblock)||a.textContent.length)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()])),t=()=>this.editor.commands.first((({commands:e})=>[()=>e.deleteSelection(),()=>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()},i={...n},o={...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 ws()||_s()?o:i},addProseMirrorPlugins(){return[new Xt({key:new nn("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some((e=>e.docChanged))&&!t.doc.eq(n.doc)))return;const{empty:i,from:o,to:r}=t.selection,s=St.atStart(t.doc).from,a=St.atEnd(t.doc).to,l=o===s&&r===a,c=0===n.doc.textBetween(0,n.doc.content.size," "," ").length;if(i||!l||!c)return;const p=n.tr,u=Fr({state:n,transaction:p}),{commands:d}=new Pr({editor:this.editor,state:u});return d.clearNodes(),p.steps.length?p:void 0}})]}}),Ks=cs.create({name:"tabindex",addProseMirrorPlugins(){return[new Xt({key:new nn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var Ys=Object.freeze({__proto__:null,ClipboardTextSerializer:ds,Commands:Hs,Editable:Vs,FocusEvents:qs,Keymap:Ws,Tabindex:Ks});const Qs=`.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}`;function Gs(e){return new Xr({find:e.find,handler:({state:t,range:n,match:i})=>{const o=Kr(e.getAttributes,void 0,i);if(!1===o||null===o)return null;const{tr:r}=t,s=i[i.length-1],a=i[0];let l=n.to;if(s){const i=a.search(/\S/),c=n.from+a.indexOf(s),p=c+s.length,u=Is(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>c));if(u.length)return null;p<n.to&&r.delete(p,n.to),c>n.from&&r.delete(n.from+i,c),l=n.from+i+s.length,r.addMark(n.from+i,l,e.type.create(o||{})),r.removeStoredMark(e.type)}}})}function Js(e){return new Xr({find:e.find,handler:({state:t,range:n,match:i})=>{const o=Kr(e.getAttributes,void 0,i)||{},{tr:r}=t,s=n.from;let a=n.to;if(i[1]){let t=s+i[0].lastIndexOf(i[1]);t>a?t=a:a=t+i[1].length;const n=i[0][i[0].length-1];r.insertText(n,s+i[0].length-1),r.replaceWith(t,a,e.type.create(o))}else i[0]&&r.replaceWith(s,a,e.type.create(o))}})}function Zs(e){return new Xr({find:e.find,handler:({state:t,range:n,match:i})=>{const o=t.doc.resolve(n.from),r=Kr(e.getAttributes,void 0,i)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,r)}})}function Xs(e){return new Xr({find:e.find,handler:({state:t,range:n,match:i})=>{const o=Kr(e.getAttributes,void 0,i)||{},r=t.tr.delete(n.from,n.to),s=r.doc.resolve(n.from).blockRange(),a=s&&ut(s,e.type,o);if(!a)return null;r.wrap(s,a);const l=r.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&mt(r.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(i,l))&&r.join(n.from-1)}})}class ea{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&&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=Kr(Br(this,"addOptions",{name:this.name}))),this.storage=Kr(Br(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ea(e)}configure(e={}){const t=this.extend();return t.options=ls(this.options,e),t.storage=Kr(Br(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new ea(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=Kr(Br(t,"addOptions",{name:t.name})),t.storage=Kr(Br(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks(),r=!!o.find((e=>(null==e?void 0:e.type.name)===t.name));if(!r)return!1;const s=o.find((e=>(null==e?void 0:e.type.name)===t.name));return s&&n.removeStoredMark(s),n.insertText(" ",i.pos),e.view.dispatch(n),!0}return!1}}class ta{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&&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=Kr(Br(this,"addOptions",{name:this.name}))),this.storage=Kr(Br(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ta(e)}configure(e={}){const t=this.extend();return t.options=ls(this.options,e),t.storage=Kr(Br(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new ta(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=Kr(Br(t,"addOptions",{name:t.name})),t.storage=Kr(Br(t,"addStorage",{name:t.name,options:t.options})),t}}function na(e){return new ns({find:e.find,handler:({state:t,range:n,match:i})=>{const o=Kr(e.getAttributes,void 0,i);if(!1===o||null===o)return null;const{tr:r}=t,s=i[i.length-1],a=i[0];let l=n.to;if(s){const i=a.search(/\S/),c=n.from+a.indexOf(s),p=c+s.length,u=Is(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>c));if(u.length)return null;p<n.to&&r.delete(p,n.to),c>n.from&&r.delete(n.from+i,c),l=n.from+i+s.length,r.addMark(n.from+i,l,e.type.create(o||{})),r.removeStoredMark(e.type)}}})}function ia(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var oa="top",ra="bottom",sa="right",aa="left",la="auto",ca=[oa,ra,sa,aa],pa="start",ua="end",da="clippingParents",ha="viewport",ma="popper",fa="reference",ga=ca.reduce((function(e,t){return e.concat([t+"-"+pa,t+"-"+ua])}),[]),ba=[].concat(ca,[la]).reduce((function(e,t){return e.concat([t,t+"-"+pa,t+"-"+ua])}),[]),va=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ya(e){return e?(e.nodeName||"").toLowerCase():null}function xa(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function wa(e){return e instanceof xa(e).Element||e instanceof Element}function ka(e){return e instanceof xa(e).HTMLElement||e instanceof HTMLElement}function Ea(e){return"undefined"!=typeof ShadowRoot&&(e instanceof xa(e).ShadowRoot||e instanceof ShadowRoot)}var _a={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},o=t.elements[e];ka(o)&&ya(o)&&(Object.assign(o.style,n),Object.keys(i).forEach((function(e){var t=i[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var i=t.elements[e],o=t.attributes[e]||{},r=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});ka(i)&&ya(i)&&(Object.assign(i.style,r),Object.keys(o).forEach((function(e){i.removeAttribute(e)})))}))}},requires:["computeStyles"]};function Ma(e){return e.split("-")[0]}var Ca=Math.max,Da=Math.min,Oa=Math.round;function Ta(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Na(){return!/^((?!chrome|android).)*safari/i.test(Ta())}function Sa(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var i=e.getBoundingClientRect(),o=1,r=1;t&&ka(e)&&(o=e.offsetWidth>0&&Oa(i.width)/e.offsetWidth||1,r=e.offsetHeight>0&&Oa(i.height)/e.offsetHeight||1);var s=(wa(e)?xa(e):window).visualViewport,a=!Na()&&n,l=(i.left+(a&&s?s.offsetLeft:0))/o,c=(i.top+(a&&s?s.offsetTop:0))/r,p=i.width/o,u=i.height/r;return{width:p,height:u,top:c,right:l+p,bottom:c+u,left:l,x:l,y:c}}function Aa(e){var t=Sa(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function ja(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ea(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ia(e){return xa(e).getComputedStyle(e)}function za(e){return["table","td","th"].indexOf(ya(e))>=0}function La(e){return((wa(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ra(e){return"html"===ya(e)?e:e.assignedSlot||e.parentNode||(Ea(e)?e.host:null)||La(e)}function Fa(e){return ka(e)&&"fixed"!==Ia(e).position?e.offsetParent:null}function Pa(e){for(var t=xa(e),n=Fa(e);n&&za(n)&&"static"===Ia(n).position;)n=Fa(n);return n&&("html"===ya(n)||"body"===ya(n)&&"static"===Ia(n).position)?t:n||function(e){var t=/firefox/i.test(Ta());if(/Trident/i.test(Ta())&&ka(e)&&"fixed"===Ia(e).position)return null;var n=Ra(e);for(Ea(n)&&(n=n.host);ka(n)&&["html","body"].indexOf(ya(n))<0;){var i=Ia(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}function Ba(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ua(e,t,n){return Ca(e,Da(t,n))}function $a(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Ha(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var Va={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,o=e.options,r=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ma(n.placement),l=Ba(a),c=[aa,sa].indexOf(a)>=0?"height":"width";if(r&&s){var p=function(e,t){return $a("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Ha(e,ca))}(o.padding,n),u=Aa(r),d="y"===l?oa:aa,h="y"===l?ra:sa,m=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],f=s[l]-n.rects.reference[l],g=Pa(r),b=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,v=m/2-f/2,y=p[d],x=b-u[c]-p[h],w=b/2-u[c]/2+v,k=Ua(y,w,x),E=l;n.modifiersData[i]=((t={})[E]=k,t.centerOffset=k-w,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&ja(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qa(e){return e.split("-")[1]}var Wa={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ka(e){var t,n=e.popper,i=e.popperRect,o=e.placement,r=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,p=e.roundOffsets,u=e.isFixed,d=s.x,h=void 0===d?0:d,m=s.y,f=void 0===m?0:m,g="function"==typeof p?p({x:h,y:f}):{x:h,y:f};h=g.x,f=g.y;var b=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),y=aa,x=oa,w=window;if(c){var k=Pa(n),E="clientHeight",_="clientWidth";if(k===xa(n)&&"static"!==Ia(k=La(n)).position&&"absolute"===a&&(E="scrollHeight",_="scrollWidth"),o===oa||(o===aa||o===sa)&&r===ua)x=ra,f-=(u&&k===w&&w.visualViewport?w.visualViewport.height:k[E])-i.height,f*=l?1:-1;if(o===aa||(o===oa||o===ra)&&r===ua)y=sa,h-=(u&&k===w&&w.visualViewport?w.visualViewport.width:k[_])-i.width,h*=l?1:-1}var M,C=Object.assign({position:a},c&&Wa),D=!0===p?function(e){var t=e.x,n=e.y,i=window.devicePixelRatio||1;return{x:Oa(t*i)/i||0,y:Oa(n*i)/i||0}}({x:h,y:f}):{x:h,y:f};return h=D.x,f=D.y,l?Object.assign({},C,((M={})[x]=v?"0":"",M[y]=b?"0":"",M.transform=(w.devicePixelRatio||1)<=1?"translate("+h+"px, "+f+"px)":"translate3d("+h+"px, "+f+"px, 0)",M)):Object.assign({},C,((t={})[x]=v?f+"px":"",t[y]=b?h+"px":"",t.transform="",t))}var Ya={passive:!0};var Qa={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,i=e.options,o=i.scroll,r=void 0===o||o,s=i.resize,a=void 0===s||s,l=xa(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach((function(e){e.addEventListener("scroll",n.update,Ya)})),a&&l.addEventListener("resize",n.update,Ya),function(){r&&c.forEach((function(e){e.removeEventListener("scroll",n.update,Ya)})),a&&l.removeEventListener("resize",n.update,Ya)}},data:{}},Ga={left:"right",right:"left",bottom:"top",top:"bottom"};function Ja(e){return e.replace(/left|right|bottom|top/g,(function(e){return Ga[e]}))}var Za={start:"end",end:"start"};function Xa(e){return e.replace(/start|end/g,(function(e){return Za[e]}))}function el(e){var t=xa(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function tl(e){return Sa(La(e)).left+el(e).scrollLeft}function nl(e){var t=Ia(e),n=t.overflow,i=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+i)}function il(e){return["html","body","#document"].indexOf(ya(e))>=0?e.ownerDocument.body:ka(e)&&nl(e)?e:il(Ra(e))}function ol(e,t){var n;void 0===t&&(t=[]);var i=il(e),o=i===(null==(n=e.ownerDocument)?void 0:n.body),r=xa(i),s=o?[r].concat(r.visualViewport||[],nl(i)?i:[]):i,a=t.concat(s);return o?a:a.concat(ol(Ra(s)))}function rl(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function sl(e,t,n){return t===ha?rl(function(e,t){var n=xa(e),i=La(e),o=n.visualViewport,r=i.clientWidth,s=i.clientHeight,a=0,l=0;if(o){r=o.width,s=o.height;var c=Na();(c||!c&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:r,height:s,x:a+tl(e),y:l}}(e,n)):wa(t)?function(e,t){var n=Sa(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):rl(function(e){var t,n=La(e),i=el(e),o=null==(t=e.ownerDocument)?void 0:t.body,r=Ca(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=Ca(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-i.scrollLeft+tl(e),l=-i.scrollTop;return"rtl"===Ia(o||n).direction&&(a+=Ca(n.clientWidth,o?o.clientWidth:0)-r),{width:r,height:s,x:a,y:l}}(La(e)))}function al(e,t,n,i){var o="clippingParents"===t?function(e){var t=ol(Ra(e)),n=["absolute","fixed"].indexOf(Ia(e).position)>=0&&ka(e)?Pa(e):e;return wa(n)?t.filter((function(e){return wa(e)&&ja(e,n)&&"body"!==ya(e)})):[]}(e):[].concat(t),r=[].concat(o,[n]),s=r[0],a=r.reduce((function(t,n){var o=sl(e,n,i);return t.top=Ca(o.top,t.top),t.right=Da(o.right,t.right),t.bottom=Da(o.bottom,t.bottom),t.left=Ca(o.left,t.left),t}),sl(e,s,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ll(e){var t,n=e.reference,i=e.element,o=e.placement,r=o?Ma(o):null,s=o?qa(o):null,a=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(r){case oa:t={x:a,y:n.y-i.height};break;case ra:t={x:a,y:n.y+n.height};break;case sa:t={x:n.x+n.width,y:l};break;case aa:t={x:n.x-i.width,y:l};break;default:t={x:n.x,y:n.y}}var c=r?Ba(r):null;if(null!=c){var p="y"===c?"height":"width";switch(s){case pa:t[c]=t[c]-(n[p]/2-i[p]/2);break;case ua:t[c]=t[c]+(n[p]/2-i[p]/2)}}return t}function cl(e,t){void 0===t&&(t={});var n=t,i=n.placement,o=void 0===i?e.placement:i,r=n.strategy,s=void 0===r?e.strategy:r,a=n.boundary,l=void 0===a?da:a,c=n.rootBoundary,p=void 0===c?ha:c,u=n.elementContext,d=void 0===u?ma:u,h=n.altBoundary,m=void 0!==h&&h,f=n.padding,g=void 0===f?0:f,b=$a("number"!=typeof g?g:Ha(g,ca)),v=d===ma?fa:ma,y=e.rects.popper,x=e.elements[m?v:d],w=al(wa(x)?x:x.contextElement||La(e.elements.popper),l,p,s),k=Sa(e.elements.reference),E=ll({reference:k,element:y,strategy:"absolute",placement:o}),_=rl(Object.assign({},y,E)),M=d===ma?_:k,C={top:w.top-M.top+b.top,bottom:M.bottom-w.bottom+b.bottom,left:w.left-M.left+b.left,right:M.right-w.right+b.right},D=e.modifiersData.offset;if(d===ma&&D){var O=D[o];Object.keys(C).forEach((function(e){var t=[sa,ra].indexOf(e)>=0?1:-1,n=[oa,ra].indexOf(e)>=0?"y":"x";C[e]+=O[n]*t}))}return C}function pl(e,t){void 0===t&&(t={});var n=t,i=n.placement,o=n.boundary,r=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?ba:l,p=qa(i),u=p?a?ga:ga.filter((function(e){return qa(e)===p})):ca,d=u.filter((function(e){return c.indexOf(e)>=0}));0===d.length&&(d=u);var h=d.reduce((function(t,n){return t[n]=cl(e,{placement:n,boundary:o,rootBoundary:r,padding:s})[Ma(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var ul={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var o=n.mainAxis,r=void 0===o||o,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,p=n.boundary,u=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,m=void 0===h||h,f=n.allowedAutoPlacements,g=t.options.placement,b=Ma(g),v=l||(b===g||!m?[Ja(g)]:function(e){if(Ma(e)===la)return[];var t=Ja(e);return[Xa(e),t,Xa(t)]}(g)),y=[g].concat(v).reduce((function(e,n){return e.concat(Ma(n)===la?pl(t,{placement:n,boundary:p,rootBoundary:u,padding:c,flipVariations:m,allowedAutoPlacements:f}):n)}),[]),x=t.rects.reference,w=t.rects.popper,k=new Map,E=!0,_=y[0],M=0;M<y.length;M++){var C=y[M],D=Ma(C),O=qa(C)===pa,T=[oa,ra].indexOf(D)>=0,N=T?"width":"height",S=cl(t,{placement:C,boundary:p,rootBoundary:u,altBoundary:d,padding:c}),A=T?O?sa:aa:O?ra:oa;x[N]>w[N]&&(A=Ja(A));var j=Ja(A),I=[];if(r&&I.push(S[D]<=0),a&&I.push(S[A]<=0,S[j]<=0),I.every((function(e){return e}))){_=C,E=!1;break}k.set(C,I)}if(E)for(var z=function(e){var t=y.find((function(t){var n=k.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return _=t,"break"},L=m?3:1;L>0;L--){if("break"===z(L))break}t.placement!==_&&(t.modifiersData[i]._skip=!0,t.placement=_,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function dl(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function hl(e){return[oa,sa,ra,aa].some((function(t){return e[t]>=0}))}var ml={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,o=t.rects.popper,r=t.modifiersData.preventOverflow,s=cl(t,{elementContext:"reference"}),a=cl(t,{altBoundary:!0}),l=dl(s,i),c=dl(a,o,r),p=hl(l),u=hl(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}};var fl={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,o=n.offset,r=void 0===o?[0,0]:o,s=ba.reduce((function(e,n){return e[n]=function(e,t,n){var i=Ma(e),o=[aa,oa].indexOf(i)>=0?-1:1,r="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=r[0],a=r[1];return s=s||0,a=(a||0)*o,[aa,sa].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,r),e}),{}),a=s[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=s}};var gl={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ll({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var bl={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,o=n.mainAxis,r=void 0===o||o,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,p=n.altBoundary,u=n.padding,d=n.tether,h=void 0===d||d,m=n.tetherOffset,f=void 0===m?0:m,g=cl(t,{boundary:l,rootBoundary:c,padding:u,altBoundary:p}),b=Ma(t.placement),v=qa(t.placement),y=!v,x=Ba(b),w="x"===x?"y":"x",k=t.modifiersData.popperOffsets,E=t.rects.reference,_=t.rects.popper,M="function"==typeof f?f(Object.assign({},t.rects,{placement:t.placement})):f,C="number"==typeof M?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(k){if(r){var T,N="y"===x?oa:aa,S="y"===x?ra:sa,A="y"===x?"height":"width",j=k[x],I=j+g[N],z=j-g[S],L=h?-_[A]/2:0,R=v===pa?E[A]:_[A],F=v===pa?-_[A]:-E[A],P=t.elements.arrow,B=h&&P?Aa(P):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},$=U[N],H=U[S],V=Ua(0,E[A],B[A]),q=y?E[A]/2-L-V-$-C.mainAxis:R-V-$-C.mainAxis,W=y?-E[A]/2+L+V+H+C.mainAxis:F+V+H+C.mainAxis,K=t.elements.arrow&&Pa(t.elements.arrow),Y=K?"y"===x?K.clientTop||0:K.clientLeft||0:0,Q=null!=(T=null==D?void 0:D[x])?T:0,G=j+W-Q,J=Ua(h?Da(I,j+q-Q-Y):I,j,h?Ca(z,G):z);k[x]=J,O[x]=J-j}if(a){var Z,X="x"===x?oa:aa,ee="x"===x?ra:sa,te=k[w],ne="y"===w?"height":"width",ie=te+g[X],oe=te-g[ee],re=-1!==[oa,aa].indexOf(b),se=null!=(Z=null==D?void 0:D[w])?Z:0,ae=re?ie:te-E[ne]-_[ne]-se+C.altAxis,le=re?te+E[ne]+_[ne]-se-C.altAxis:oe,ce=h&&re?function(e,t,n){var i=Ua(e,t,n);return i>n?n:i}(ae,te,le):Ua(h?ae:ie,te,h?le:oe);k[w]=ce,O[w]=ce-te}t.modifiersData[i]=O}},requiresIfExists:["offset"]};function vl(e,t,n){void 0===n&&(n=!1);var i=ka(t),o=ka(t)&&function(e){var t=e.getBoundingClientRect(),n=Oa(t.width)/e.offsetWidth||1,i=Oa(t.height)/e.offsetHeight||1;return 1!==n||1!==i}(t),r=La(t),s=Sa(e,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&(("body"!==ya(t)||nl(r))&&(a=function(e){return e!==xa(e)&&ka(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:el(e);var t}(t)),ka(t)?((l=Sa(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=tl(r))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function yl(e){var t=new Map,n=new Set,i=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&o(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),i}var xl={placement:"bottom",modifiers:[],strategy:"absolute"};function wl(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function kl(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,i=void 0===n?[]:n,o=t.defaultOptions,r=void 0===o?xl:o;return function(e,t,n){void 0===n&&(n=r);var o,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},xl,r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,p={state:a,setOptions:function(n){var o="function"==typeof n?n(a.options):n;u(),a.options=Object.assign({},r,a.options,o),a.scrollParents={reference:wa(e)?ol(e):e.contextElement?ol(e.contextElement):[],popper:ol(t)};var s=function(e){var t=yl(e);return va.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(i,a.options.modifiers)));return a.orderedModifiers=s.filter((function(e){return e.enabled})),a.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,i=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var r=o({state:a,name:t,instance:p,options:i}),s=function(){};l.push(r||s)}})),p.update()},forceUpdate:function(){if(!c){var e=a.elements,t=e.reference,n=e.popper;if(wl(t,n)){a.rects={reference:vl(t,Pa(n),"fixed"===a.options.strategy),popper:Aa(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(e){return a.modifiersData[e.name]=Object.assign({},e.data)}));for(var i=0;i<a.orderedModifiers.length;i++)if(!0!==a.reset){var o=a.orderedModifiers[i],r=o.fn,s=o.options,l=void 0===s?{}:s,u=o.name;"function"==typeof r&&(a=r({state:a,options:l,name:u,instance:p})||a)}else a.reset=!1,i=-1}}},update:(o=function(){return new Promise((function(e){p.forceUpdate(),e(a)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(o())}))}))),s}),destroy:function(){u(),c=!0}};if(!wl(e,t))return p;function u(){l.forEach((function(e){return e()})),l=[]}return p.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),p}}var El=kl({defaultModifiers:[Qa,gl,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,o=void 0===i||i,r=n.adaptive,s=void 0===r||r,a=n.roundOffsets,l=void 0===a||a,c={placement:Ma(t.placement),variation:qa(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Ka(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ka(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},_a,fl,ul,bl,Va,ml]}),_l='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',Ml="tippy-box",Cl="tippy-content",Dl="tippy-backdrop",Ol="tippy-arrow",Tl="tippy-svg-arrow",Nl={passive:!0,capture:!0},Sl=function(){return document.body};function Al(e,t,n){if(Array.isArray(e)){var i=e[t];return null==i?Array.isArray(n)?n[t]:n:i}return e}function jl(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Il(e,t){return"function"==typeof e?e.apply(void 0,t):e}function zl(e,t){return 0===t?e:function(i){clearTimeout(n),n=setTimeout((function(){e(i)}),t)};var n}function Ll(e){return[].concat(e)}function Rl(e,t){-1===e.indexOf(t)&&e.push(t)}function Fl(e){return[].slice.call(e)}function Pl(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function Bl(){return document.createElement("div")}function Ul(e){return["Element","Fragment"].some((function(t){return jl(e,t)}))}function $l(e){return jl(e,"MouseEvent")}function Hl(e){return Ul(e)?[e]:function(e){return jl(e,"NodeList")}(e)?Fl(e):Array.isArray(e)?e:Fl(document.querySelectorAll(e))}function Vl(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function ql(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Wl(e){var t,n=Ll(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function Kl(e,t,n){var i=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[i](t,n)}))}function Yl(e,t){for(var n=t;n;){var i;if(e.contains(n))return!0;n=null==n.getRootNode||null==(i=n.getRootNode())?void 0:i.host}return!1}var Ql={isTouch:!1},Gl=0;function Jl(){Ql.isTouch||(Ql.isTouch=!0,window.performance&&document.addEventListener("mousemove",Zl))}function Zl(){var e=performance.now();e-Gl<20&&(Ql.isTouch=!1,document.removeEventListener("mousemove",Zl)),Gl=e}function Xl(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var ec=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,tc=Object.assign({appendTo:Sl,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),nc=Object.keys(tc);function ic(e){var t=(e.plugins||[]).reduce((function(t,n){var i,o=n.name,r=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(i=tc[o])?i:r);return t}),{});return Object.assign({},e,t)}function oc(e,t){var n=Object.assign({},t,{content:Il(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(ic(Object.assign({},tc,{plugins:t}))):nc).reduce((function(t,n){var i=(e.getAttribute("data-tippy-"+n)||"").trim();if(!i)return t;if("content"===n)t[n]=i;else try{t[n]=JSON.parse(i)}catch(e){t[n]=i}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},tc.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function rc(e,t){e["innerHTML"]=t}function sc(e){var t=Bl();return!0===e?t.className=Ol:(t.className=Tl,Ul(e)?t.appendChild(e):rc(t,e)),t}function ac(e,t){Ul(t.content)?(rc(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?rc(e,t.content):e.textContent=t.content)}function lc(e){var t=e.firstElementChild,n=Fl(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(Cl)})),arrow:n.find((function(e){return e.classList.contains(Ol)||e.classList.contains(Tl)})),backdrop:n.find((function(e){return e.classList.contains(Dl)}))}}function cc(e){var t=Bl(),n=Bl();n.className=Ml,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var i=Bl();function o(n,i){var o=lc(t),r=o.box,s=o.content,a=o.arrow;i.theme?r.setAttribute("data-theme",i.theme):r.removeAttribute("data-theme"),"string"==typeof i.animation?r.setAttribute("data-animation",i.animation):r.removeAttribute("data-animation"),i.inertia?r.setAttribute("data-inertia",""):r.removeAttribute("data-inertia"),r.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?r.setAttribute("role",i.role):r.removeAttribute("role"),n.content===i.content&&n.allowHTML===i.allowHTML||ac(s,e.props),i.arrow?a?n.arrow!==i.arrow&&(r.removeChild(a),r.appendChild(sc(i.arrow))):r.appendChild(sc(i.arrow)):a&&r.removeChild(a)}return i.className=Cl,i.setAttribute("data-state","hidden"),ac(i,e.props),t.appendChild(n),n.appendChild(i),o(e.props,e.props),{popper:t,onUpdate:o}}cc.$$tippy=!0;var pc=1,uc=[],dc=[];function hc(e,t){var n,i,o,r,s,a,l,c,p=oc(e,Object.assign({},tc,ic(Pl(t)))),u=!1,d=!1,h=!1,m=!1,f=[],g=zl(K,p.interactiveDebounce),b=pc++,v=(c=p.plugins).filter((function(e,t){return c.indexOf(e)===t})),y={id:b,reference:e,popper:Bl(),popperInstance:null,props:p,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(i),cancelAnimationFrame(o)},setProps:function(t){if(y.state.isDestroyed)return;j("onBeforeUpdate",[y,t]),q();var n=y.props,i=oc(e,Object.assign({},n,Pl(t),{ignoreAttributes:!0}));y.props=i,V(),n.interactiveDebounce!==i.interactiveDebounce&&(L(),g=zl(K,i.interactiveDebounce));n.triggerTarget&&!i.triggerTarget?Ll(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):i.triggerTarget&&e.removeAttribute("aria-expanded");z(),A(),k&&k(n,i);y.popperInstance&&(J(),X().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));j("onAfterUpdate",[y,t])},setContent:function(e){y.setProps({content:e})},show:function(){var e=y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,i=Ql.isTouch&&!y.props.touch,o=Al(y.props.duration,0,tc.duration);if(e||t||n||i)return;if(O().hasAttribute("disabled"))return;if(j("onShow",[y],!1),!1===y.props.onShow(y))return;y.state.isVisible=!0,D()&&(w.style.visibility="visible");A(),B(),y.state.isMounted||(w.style.transition="none");if(D()){var r=N(),s=r.box,l=r.content;Vl([s,l],0)}a=function(){var e;if(y.state.isVisible&&!m){if(m=!0,w.offsetHeight,w.style.transition=y.props.moveTransition,D()&&y.props.animation){var t=N(),n=t.box,i=t.content;Vl([n,i],o),ql([n,i],"visible")}I(),z(),Rl(dc,y),null==(e=y.popperInstance)||e.forceUpdate(),j("onMount",[y]),y.props.animation&&D()&&function(e,t){$(e,t)}(o,(function(){y.state.isShown=!0,j("onShown",[y])}))}},function(){var e,t=y.props.appendTo,n=O();e=y.props.interactive&&t===Sl||"parent"===t?n.parentNode:Il(t,[n]);e.contains(w)||e.appendChild(w);y.state.isMounted=!0,J()}()},hide:function(){var e=!y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,i=Al(y.props.duration,1,tc.duration);if(e||t||n)return;if(j("onHide",[y],!1),!1===y.props.onHide(y))return;y.state.isVisible=!1,y.state.isShown=!1,m=!1,u=!1,D()&&(w.style.visibility="hidden");if(L(),U(),A(!0),D()){var o=N(),r=o.box,s=o.content;y.props.animation&&(Vl([r,s],i),ql([r,s],"hidden"))}I(),z(),y.props.animation?D()&&function(e,t){$(e,(function(){!y.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&t()}))}(i,y.unmount):y.unmount()},hideWithInteractivity:function(e){T().addEventListener("mousemove",g),Rl(uc,g),g(e)},enable:function(){y.state.isEnabled=!0},disable:function(){y.hide(),y.state.isEnabled=!1},unmount:function(){y.state.isVisible&&y.hide();if(!y.state.isMounted)return;Z(),X().forEach((function(e){e._tippy.unmount()})),w.parentNode&&w.parentNode.removeChild(w);dc=dc.filter((function(e){return e!==y})),y.state.isMounted=!1,j("onHidden",[y])},destroy:function(){if(y.state.isDestroyed)return;y.clearDelayTimeouts(),y.unmount(),q(),delete e._tippy,y.state.isDestroyed=!0,j("onDestroy",[y])}};if(!p.render)return y;var x=p.render(y),w=x.popper,k=x.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+y.id,y.popper=w,e._tippy=y,w._tippy=y;var E=v.map((function(e){return e.fn(y)})),_=e.hasAttribute("aria-expanded");return V(),z(),A(),j("onCreate",[y]),p.showOnCreate&&ee(),w.addEventListener("mouseenter",(function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()})),w.addEventListener("mouseleave",(function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&T().addEventListener("mousemove",g)})),y;function M(){var e=y.props.touch;return Array.isArray(e)?e:[e,0]}function C(){return"hold"===M()[0]}function D(){var e;return!(null==(e=y.props.render)||!e.$$tippy)}function O(){return l||e}function T(){var e=O().parentNode;return e?Wl(e):document}function N(){return lc(w)}function S(e){return y.state.isMounted&&!y.state.isVisible||Ql.isTouch||r&&"focus"===r.type?0:Al(y.props.delay,e?0:1,tc.delay)}function A(e){void 0===e&&(e=!1),w.style.pointerEvents=y.props.interactive&&!e?"":"none",w.style.zIndex=""+y.props.zIndex}function j(e,t,n){var i;(void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(i=y.props)[e].apply(i,t)}function I(){var t=y.props.aria;if(t.content){var n="aria-"+t.content,i=w.id;Ll(y.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(y.state.isVisible)e.setAttribute(n,t?t+" "+i:i);else{var o=t&&t.replace(i,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function z(){!_&&y.props.aria.expanded&&Ll(y.props.triggerTarget||e).forEach((function(e){y.props.interactive?e.setAttribute("aria-expanded",y.state.isVisible&&e===O()?"true":"false"):e.removeAttribute("aria-expanded")}))}function L(){T().removeEventListener("mousemove",g),uc=uc.filter((function(e){return e!==g}))}function R(t){if(!Ql.isTouch||!h&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!y.props.interactive||!Yl(w,n)){if(Ll(y.props.triggerTarget||e).some((function(e){return Yl(e,n)}))){if(Ql.isTouch)return;if(y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else j("onClickOutside",[y,t]);!0===y.props.hideOnClick&&(y.clearDelayTimeouts(),y.hide(),d=!0,setTimeout((function(){d=!1})),y.state.isMounted||U())}}}function F(){h=!0}function P(){h=!1}function B(){var e=T();e.addEventListener("mousedown",R,!0),e.addEventListener("touchend",R,Nl),e.addEventListener("touchstart",P,Nl),e.addEventListener("touchmove",F,Nl)}function U(){var e=T();e.removeEventListener("mousedown",R,!0),e.removeEventListener("touchend",R,Nl),e.removeEventListener("touchstart",P,Nl),e.removeEventListener("touchmove",F,Nl)}function $(e,t){var n=N().box;function i(e){e.target===n&&(Kl(n,"remove",i),t())}if(0===e)return t();Kl(n,"remove",s),Kl(n,"add",i),s=i}function H(t,n,i){void 0===i&&(i=!1),Ll(y.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,i),f.push({node:e,eventType:t,handler:n,options:i})}))}function V(){var e;C()&&(H("touchstart",W,{passive:!0}),H("touchend",Y,{passive:!0})),(e=y.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(H(e,W),e){case"mouseenter":H("mouseleave",Y);break;case"focus":H(ec?"focusout":"blur",Q);break;case"focusin":H("focusout",Q)}}))}function q(){f.forEach((function(e){var t=e.node,n=e.eventType,i=e.handler,o=e.options;t.removeEventListener(n,i,o)})),f=[]}function W(e){var t,n=!1;if(y.state.isEnabled&&!G(e)&&!d){var i="focus"===(null==(t=r)?void 0:t.type);r=e,l=e.currentTarget,z(),!y.state.isVisible&&$l(e)&&uc.forEach((function(t){return t(e)})),"click"===e.type&&(y.props.trigger.indexOf("mouseenter")<0||u)&&!1!==y.props.hideOnClick&&y.state.isVisible?n=!0:ee(e),"click"===e.type&&(u=!n),n&&!i&&te(e)}}function K(e){var t=e.target,n=O().contains(t)||w.contains(t);if("mousemove"!==e.type||!n){var i=X().concat(w).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:p}:null})).filter(Boolean);(function(e,t){var n=t.clientX,i=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,r=e.props.interactiveBorder,s=o.placement.split("-")[0],a=o.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,c="top"===s?a.bottom.y:0,p="right"===s?a.left.x:0,u="left"===s?a.right.x:0,d=t.top-i+l>r,h=i-t.bottom-c>r,m=t.left-n+p>r,f=n-t.right-u>r;return d||h||m||f}))})(i,e)&&(L(),te(e))}}function Y(e){G(e)||y.props.trigger.indexOf("click")>=0&&u||(y.props.interactive?y.hideWithInteractivity(e):te(e))}function Q(e){y.props.trigger.indexOf("focusin")<0&&e.target!==O()||y.props.interactive&&e.relatedTarget&&w.contains(e.relatedTarget)||te(e)}function G(e){return!!Ql.isTouch&&C()!==e.type.indexOf("touch")>=0}function J(){Z();var t=y.props,n=t.popperOptions,i=t.placement,o=t.offset,r=t.getReferenceClientRect,s=t.moveTransition,l=D()?lc(w).arrow:null,c=r?{getBoundingClientRect:r,contextElement:r.contextElement||O()}:e,p={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(D()){var n=N().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},u=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},p];D()&&l&&u.push({name:"arrow",options:{element:l,padding:3}}),u.push.apply(u,(null==n?void 0:n.modifiers)||[]),y.popperInstance=El(c,w,Object.assign({},n,{placement:i,onFirstUpdate:a,modifiers:u}))}function Z(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function X(){return Fl(w.querySelectorAll("[data-tippy-root]"))}function ee(e){y.clearDelayTimeouts(),e&&j("onTrigger",[y,e]),B();var t=S(!0),i=M(),o=i[0],r=i[1];Ql.isTouch&&"hold"===o&&r&&(t=r),t?n=setTimeout((function(){y.show()}),t):y.show()}function te(e){if(y.clearDelayTimeouts(),j("onUntrigger",[y,e]),y.state.isVisible){if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&u)){var t=S(!1);t?i=setTimeout((function(){y.state.isVisible&&y.hide()}),t):o=requestAnimationFrame((function(){y.hide()}))}}else U()}}function mc(e,t){void 0===t&&(t={});var n=tc.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Jl,Nl),window.addEventListener("blur",Xl);var i=Object.assign({},t,{plugins:n}),o=Hl(e).reduce((function(e,t){var n=t&&hc(t,i);return n&&e.push(n),e}),[]);return Ul(e)?o[0]:o}mc.defaultProps=tc,mc.setDefaultProps=function(e){Object.keys(e).forEach((function(t){tc[t]=e[t]}))},mc.currentInput=Ql,Object.assign({},_a,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});var fc={clientX:0,clientY:0},gc=[];function bc(e){var t=e.clientX,n=e.clientY;fc={clientX:t,clientY:n}}var vc={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,n=Wl(e.props.triggerTarget||t),i=!1,o=!1,r=!0,s=e.props;function a(){return"initial"===e.props.followCursor&&e.state.isVisible}function l(){n.addEventListener("mousemove",u)}function c(){n.removeEventListener("mousemove",u)}function p(){i=!0,e.setProps({getReferenceClientRect:null}),i=!1}function u(n){var i=!n.target||t.contains(n.target),o=e.props.followCursor,r=n.clientX,s=n.clientY,a=t.getBoundingClientRect(),l=r-a.left,c=s-a.top;!i&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),n=r,i=s;"initial"===o&&(n=e.left+l,i=e.top+c);var a="horizontal"===o?e.top:i,p="vertical"===o?e.right:n,u="horizontal"===o?e.bottom:i,d="vertical"===o?e.left:n;return{width:p-d,height:u-a,top:a,right:p,bottom:u,left:d}}})}function d(){e.props.followCursor&&(gc.push({instance:e,doc:n}),function(e){e.addEventListener("mousemove",bc)}(n))}function h(){gc=gc.filter((function(t){return t.instance!==e})),0===gc.filter((function(e){return e.doc===n})).length&&function(e){e.removeEventListener("mousemove",bc)}(n)}return{onCreate:d,onDestroy:h,onBeforeUpdate:function(){s=e.props},onAfterUpdate:function(t,n){var r=n.followCursor;i||void 0!==r&&s.followCursor!==r&&(h(),r?(d(),!e.state.isMounted||o||a()||l()):(c(),p()))},onMount:function(){e.props.followCursor&&!o&&(r&&(u(fc),r=!1),a()||l())},onTrigger:function(e,t){$l(t)&&(fc={clientX:t.clientX,clientY:t.clientY}),o="focus"===t.type},onHidden:function(){e.props.followCursor&&(p(),c(),r=!0)}}}};mc.setDefaultProps({render:cc});class yc{constructor({editor:e,element:t,view:n,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:e,state:t,from:n,to:i})=>{const{doc:o,selection:r}=t,{empty:s}=r,a=!o.textBetween(n,i).length&&vs(t.selection),l=this.element.contains(document.activeElement);return!(!e.hasFocus()&&!l||s||a||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=mc(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,i,o;const{state:r,composing:s}=e,{doc:a,selection:l}=r,c=t&&t.doc.eq(a)&&t.selection.eq(l);if(s||c)return;this.createTooltip();const{ranges:p}=l,u=Math.min(...p.map((e=>e.$from.pos))),d=Math.max(...p.map((e=>e.$to.pos)));(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:r,oldState:t,from:u,to:d}))?(null===(i=this.tippy)||void 0===i||i.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||(()=>{if(r.selection instanceof Rt){const t=e.nodeDOM(u);if(t)return t.getBoundingClientRect()}return Rs(e,u,d)})}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const xc=e=>new Xt({key:"string"==typeof e.pluginKey?new nn(e.pluginKey):e.pluginKey,view:t=>new yc({view:t,...e})});cs.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[xc({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});class wc{constructor({editor:e,element:t,view:n,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:e,state:t})=>{const{selection:n}=t,{$anchor:i,empty:o}=n,r=1===i.depth,s=i.parent.isTextblock&&!i.parent.type.spec.code&&!i.parent.textContent;return!!(e.hasFocus()&&o&&r&&s&&this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=mc(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,i,o;const{state:r}=e,{doc:s,selection:a}=r,{from:l,to:c}=a;if(t&&t.doc.eq(s)&&t.selection.eq(a))return;this.createTooltip();(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:r,oldState:t}))?(null===(i=this.tippy)||void 0===i||i.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||(()=>Rs(e,l,c))}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}cs.create({name:"floatingMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[(e={pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow},new Xt({key:"string"==typeof e.pluginKey?new nn(e.pluginKey):e.pluginKey,view:t=>new wc({view:t,...e})}))]:[];var e}});const kc=e=>{const[n,i]=o(null);return r((()=>{if(!n)return;if(e.editor.isDestroyed)return;const{pluginKey:t="bubbleMenu",editor:i,tippyOptions:o={},shouldShow:r=null}=e,s=xc({pluginKey:t,editor:i,element:n,tippyOptions:o,shouldShow:r});return i.registerPlugin(s),()=>i.unregisterPlugin(t)}),[e.editor,n]),t.createElement("div",{ref:i,className:e.className,style:{visibility:"hidden"}},e.children)};class Ec extends class extends class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach((e=>e.apply(this,t))),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((e=>e!==t)):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))}),0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(e,t){const n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;const i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style",""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}(Qs,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e){this.setOptions({editable:e}),this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const n=Wr(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:n});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const t="string"==typeof e?`${e}$`:e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((e=>!e.key.startsWith(t)))});this.view.updateState(n)}createExtensionManager(){const e=[...this.options.enableCoreExtensions?Object.values(Ys):[],...this.options.extensions].filter((e=>["extension","node","mark"].includes(null==e?void 0:e.type)));this.extensionManager=new ss(e,this)}createCommandManager(){this.commandManager=new Pr({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Os(this.options.content,this.schema,this.options.parseOptions),t=xs(e,this.options.autofocus);this.view=new cr(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Jt.create({doc:e,selection:t||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews();this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((e=>{var t;return null===(t=this.capturedTransaction)||void 0===t?void 0:t.step(e)})):void(this.capturedTransaction=e);const t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return As(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,i="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return Ms(e,null,n)||zs(e,null,n);const i=Cs(t,e.schema);return"node"===i?Ms(e,t,n):"mark"===i&&zs(e,t,n)}(this.state,n,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(e,t){const n=Fe.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){return ps(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...n,...us(this.schema)}})}get isEmpty(){return function(e){var t;const n=null===(t=e.type.createAndFill())||void 0===t?void 0:t.toJSON(),i=e.toJSON();return JSON.stringify(n)===JSON.stringify(i)}(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(null===(e=this.view)||void 0===e?void 0:e.docView)}}{constructor(){super(...arguments),this.contentComponent=null}}const _c=({renderers:e})=>t.createElement(t.Fragment,null,Array.from(e).map((([e,t])=>h.createPortal(t.reactElement,t.element,e))));class Mc extends t.Component{constructor(e){super(e),this.editorContentRef=t.createRef(),this.state={renderers:new Map}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:e}=this.props;if(e&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=this,e.createNodeViews()}}componentWillUnmount(){const{editor:e}=this.props;if(!e)return;if(e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild)return;const t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){const{editor:e,...n}=this.props;return t.createElement(t.Fragment,null,t.createElement("div",{ref:this.editorContentRef,...n}),t.createElement(_c,{renderers:this.state.renderers}))}}const Cc=t.memo(Mc),Dc=n({onDragStart:void 0}),Oc=()=>i(Dc),Tc=e=>{const n=e.as||"div",{nodeViewContentRef:i}=Oc();return t.createElement(n,{...e,ref:i,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style}})},Nc=t.forwardRef(((e,n)=>{const{onDragStart:i}=Oc(),o=e.as||"div";return t.createElement(o,{...e,ref:n,"data-node-view-wrapper":"",onDragStart:i,style:{whiteSpace:"normal",...e.style}})}));class Sc{constructor(e,{editor:t,props:n={},as:i="div",className:o=""}){this.ref=null,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.render()}render(){const e=this.component,n=this.props;(function(e){return!("function"!=typeof e||!e.prototype||!e.prototype.isReactComponent)}(e)||function(e){var t;return!("object"!=typeof e||"Symbol(react.forward_ref)"!==(null===(t=e.$$typeof)||void 0===t?void 0:t.toString()))}(e))&&(n.ref=e=>{this.ref=e}),this.reactElement=t.createElement(e,{...n}),m((()=>{var e;(null===(e=this.editor)||void 0===e?void 0:e.contentComponent)&&this.editor.contentComponent.setState({renderers:this.editor.contentComponent.state.renderers.set(this.id,this)})}))}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){m((()=>{var e;if(null===(e=this.editor)||void 0===e?void 0:e.contentComponent){const{renderers:e}=this.editor.contentComponent.state;e.delete(this.id),this.editor.contentComponent.setState({renderers:e})}}))}}class Ac extends class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,i,o,r,s,a;const{view:l}=this.editor,c=e.target,p=3===c.nodeType?null===(t=c.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(c))||!p)return;let u=0,d=0;if(this.dom!==p){const t=this.dom.getBoundingClientRect(),n=p.getBoundingClientRect(),a=null!==(i=e.offsetX)&&void 0!==i?i:null===(o=e.nativeEvent)||void 0===o?void 0:o.offsetX,l=null!==(r=e.offsetY)&&void 0!==r?r:null===(s=e.nativeEvent)||void 0===s?void 0:s.offsetY;u=n.x-t.x+a,d=n.y-t.y+l}null===(a=e.dataTransfer)||void 0===a||a.setDragImage(this.dom,u,d);const h=Rt.create(l.state.doc,this.getPos()),m=l.state.tr.setSelection(h);l.dispatch(m)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!(null===(t=this.contentDOM)||void 0===t?void 0:t.contains(n))))return!1;const i="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!i)return!0;const{isEditable:o}=this.editor,{isDragging:r}=this,s=!!this.node.type.spec.draggable,a=Rt.isSelectable(this.node),l="copy"===e.type,c="paste"===e.type,p="cut"===e.type,u="mousedown"===e.type,d=e.type.startsWith("drag");if(!s&&a&&d&&e.preventDefault(),s&&d&&!r)return e.preventDefault(),!1;if(s&&o&&!r&&u){const e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",(()=>{this.isDragging=!1}),{once:!0}),document.addEventListener("mouseup",(()=>{this.isDragging=!1}),{once:!0}))}return!(r||i||l||c||p||u&&a)}ignoreMutation(e){if(!this.dom||!this.contentDOM)return!0;if("function"==typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:e});if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&ws()&&this.editor.isFocused){if([...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every((e=>e.isContentEditable)))return!1}return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command((({tr:t})=>{const n=this.getPos();return t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0}))}deleteNode(){const e=this.getPos(),t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}const n=e=>{const n=this.component,i=this.onDragStart.bind(this);return t.createElement(Dc.Provider,{value:{onDragStart:i,nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&e.appendChild(this.contentDOMElement)}}},t.createElement(n,{...e}))};n.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let i=this.node.isInline?"span":"div";this.options.as&&(i=this.options.as);const{className:o=""}=this.options;this.renderer=new Sc(n,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${o}`.trim()})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(null===(e=this.renderer.element.firstElementChild)||void 0===e?void 0:e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(e,t){const n=e=>{this.renderer.updateProps(e)};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){const i=this.node,o=this.decorations;return this.node=e,this.decorations=t,this.options.update({oldNode:i,oldDecorations:o,newNode:e,newDecorations:t,updateProps:()=>n({node:e,decorations:t})})}return e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,n({node:e,decorations:t})),!0}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}}function jc(e,t){return n=>n.editor.contentComponent?new Ac(e,n,t):{}}const Ic=(e={},t=[])=>{const[n,i]=o(null),s=function(){const[,e]=o(0);return()=>e((e=>e+1))}();return r((()=>{let t=!0;const n=new Ec(e);return i(n),n.on("transaction",(()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t&&s()}))}))})),()=>{n.destroy(),t=!1}}),t),n};var zc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Lc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function Rc(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})})),n}var Fc,Pc={exports:{}};
|
|
1
|
+
import*as e from"react";import t,{createContext as n,useContext as i,useState as o,useEffect as r,useRef as s,useCallback as a,Children as l,isValidElement as c,cloneElement as p,forwardRef as u,useLayoutEffect as d}from"react";import h,{flushSync as m,createPortal as f}from"react-dom";import g from"http";import b from"https";import v from"url";import y from"stream";import x from"assert";import w from"tty";import k from"util";import E from"os";import _ from"zlib";import M from"path";import C from"fs";import{renderToString as D}from"react-dom/server";var O=[],T=[];function N(e,t){if(e&&"undefined"!=typeof document){var n,i=!0===t.prepend?"prepend":"append",o=!0===t.singleTag,r="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var s=O.indexOf(r);-1===s&&(s=O.push(r)-1,T[s]={}),n=T[s]&&T[s][i]?T[s][i]:T[s][i]=a()}else n=a();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function a(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),o=0;o<n.length;o++)e.setAttribute(n[o],t.attributes[n[o]]);var s="prepend"===i?"afterbegin":"beforeend";return r.insertAdjacentElement(s,e),e}}function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},S.apply(this,arguments)}function A(e){this.content=e}function j(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(i),r=t.child(i);if(o!=r){if(!o.sameMarkup(r))return n;if(o.isText&&o.text!=r.text){for(let e=0;o.text[e]==r.text[e];e++)n++;return n}if(o.content.size||r.content.size){let e=j(o.content,r.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function I(e,t,n,i){for(let o=e.childCount,r=t.childCount;;){if(0==o||0==r)return o==r?null:{a:n,b:i};let s=e.child(--o),a=t.child(--r),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:i};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,i--;return{a:n,b:i}}if(s.content.size||a.content.size){let e=I(s.content,a.content,n-1,i-1);if(e)return e}n-=l,i-=l}else n-=l,i-=l}}N('@charset "UTF-8";\n@import url("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/github.min.css");\n/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n/* Document\n ========================================================================== */\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n/* Sections\n ========================================================================== */\n/**\n * Remove the margin in all browsers.\n */\nbody {\n margin: 0;\n}\n/**\n * Render the `main` element consistently in IE.\n */\nmain {\n display: block;\n}\n/**\n * Correct the font size and margin on `h1` elements within `section` and\n * `article` contexts in Chrome, Firefox, and Safari.\n */\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n/* Grouping content\n ========================================================================== */\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\npre {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n/* Text-level semantics\n ========================================================================== */\n/**\n * Remove the gray background on active links in IE 10.\n */\na {\n background-color: transparent;\n}\n/**\n * 1. Remove the bottom border in Chrome 57-\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted; /* 2 */\n}\n/**\n * Add the correct font weight in Chrome, Edge, and Safari.\n */\nb,\nstrong {\n font-weight: bolder;\n}\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n/**\n * Add the correct font size in all browsers.\n */\nsmall {\n font-size: 80%;\n}\n/**\n * Prevent `sub` and `sup` elements from affecting the line height in\n * all browsers.\n */\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\nsub {\n bottom: -0.25em;\n}\nsup {\n top: -0.5em;\n}\n/* Embedded content\n ========================================================================== */\n/**\n * Remove the border on images inside links in IE 10.\n */\nimg {\n border-style: none;\n}\n/* Forms\n ========================================================================== */\n/**\n * 1. Change the font styles in all browsers.\n * 2. Remove the margin in Firefox and Safari.\n */\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\nbutton,\ninput {\n /* 1 */\n overflow: visible;\n}\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\nbutton,\nselect {\n /* 1 */\n text-transform: none;\n}\n/**\n * Correct the inability to style clickable types in iOS and Safari.\n */\nbutton,\n[type=button],\n[type=reset],\n[type=submit] {\n -webkit-appearance: button;\n}\n/**\n * Remove the inner border and padding in Firefox.\n */\nbutton::-moz-focus-inner,\n[type=button]::-moz-focus-inner,\n[type=reset]::-moz-focus-inner,\n[type=submit]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n/**\n * Restore the focus styles unset by the previous rule.\n */\nbutton:-moz-focusring,\n[type=button]:-moz-focusring,\n[type=reset]:-moz-focusring,\n[type=submit]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n/**\n * Correct the padding in Firefox.\n */\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from `fieldset` elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * `fieldset` elements in all browsers.\n */\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\nprogress {\n vertical-align: baseline;\n}\n/**\n * Remove the default vertical scrollbar in IE 10+.\n */\ntextarea {\n overflow: auto;\n}\n/**\n * 1. Add the correct box sizing in IE 10.\n * 2. Remove the padding in IE 10.\n */\n[type=checkbox],\n[type=radio] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n[type=number]::-webkit-inner-spin-button,\n[type=number]::-webkit-outer-spin-button {\n height: auto;\n}\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n[type=search] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n/**\n * Remove the inner padding in Chrome and Safari on macOS.\n */\n[type=search]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to `inherit` in Safari.\n */\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n/* Interactive\n ========================================================================== */\n/*\n * Add the correct display in Edge, IE 10+, and Firefox.\n */\ndetails {\n display: block;\n}\n/*\n * Add the correct display in all browsers.\n */\nsummary {\n display: list-item;\n}\n/* Misc\n ========================================================================== */\n/**\n * Add the correct display in IE 10+.\n */\ntemplate {\n display: none;\n}\n/**\n * Add the correct display in IE 10.\n */\n[hidden] {\n display: none;\n}\naudio,\ncanvas,\nembed,\niframe,\nimg,\nobject,\nsvg,\nvideo {\n display: block;\n}\nbutton {\n background-color: transparent;\n background-image: none;\n border: none;\n}\nfieldset,\nol,\nul {\n margin: 0;\n padding: 0;\n}\nblockquote,\ndd,\ndl,\nfigure,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\np,\npre {\n margin: 0;\n}\n[type=checkbox],\n[type=radio] {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: 0;\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n display: inline-block;\n vertical-align: middle;\n background-origin: border-box;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n flex-shrink: 0;\n height: 1rem;\n width: 1rem;\n color: #2563eb;\n background-color: rgb(var(--neeto-ui-white));\n border-color: #6b7280;\n border-width: 1px;\n}\n[type=checkbox]:checked,\n[type=radio]:checked {\n border-color: transparent;\n background-color: currentColor;\n background-size: auto;\n background-position: center;\n background-repeat: no-repeat;\n}\n[type=radio]:checked {\n background-image: url("data:image/svg+xml,%3Csvg width=\'6\' height=\'6\' viewBox=\'0 0 6 6\' fill=\'none\' xmlns=\'http://www.w3.org/2000/svg\'%3E%3Ccircle cx=\'3\' cy=\'3\' r=\'3\' fill=\'white\'/%3E%3C/svg%3E%0A");\n}\n[type=checkbox]:checked {\n background-image: url("data:image/svg+xml,%3Csvg width=\'11\' height=\'8\' viewBox=\'0 0 11 8\' fill=\'none\' xmlns=\'http://www.w3.org/2000/svg\'%3E%3Cpath d=\'M9.66671 1L4.00004 6.66667L1.33337 4\' stroke=\'white\' stroke-width=\'1.5\' stroke-linecap=\'round\' stroke-linejoin=\'round\'/%3E%3C/svg%3E%0A");\n}\n[type=radio] {\n border-radius: 100%;\n}\nbody {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif !important;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.3;\n color: #222;\n}\nbody *,\nbody *::after,\nbody *::before {\n box-sizing: border-box;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\nbody {\n color: rgb(var(--neeto-ui-gray-800));\n}\nh1 {\n font-size: var(--neeto-ui-text-3xl);\n font-weight: var(--neeto-ui-font-semibold);\n line-height: var(--neeto-ui-leading-tight);\n}\nh2 {\n font-size: var(--neeto-ui-text-2xl);\n font-weight: var(--neeto-ui-font-semibold);\n line-height: var(--neeto-ui-leading-tight);\n}\nh3 {\n font-size: var(--neeto-ui-text-xl);\n font-weight: var(--neeto-ui-font-semibold);\n line-height: var(--neeto-ui-leading-tight);\n}\nh4 {\n font-size: var(--neeto-ui-text-base);\n font-weight: var(--neeto-ui-font-semibold);\n line-height: var(--neeto-ui-leading-tight);\n}\nh5 {\n font-size: var(--neeto-ui-text-sm);\n font-weight: var(--neeto-ui-font-semibold);\n line-height: var(--neeto-ui-leading-tight);\n}\nh6 {\n font-size: var(--neeto-ui-text-xs);\n font-weight: var(--neeto-ui-font-semibold);\n line-height: var(--neeto-ui-leading-tight);\n}\np {\n font-size: var(--neeto-ui-text-sm);\n line-height: var(--neeto-ui-leading-normal);\n}\n:root {\n --neeto-ui-black: 27, 31, 35;\n --neeto-ui-white: 255, 255, 255;\n --neeto-ui-gray-800: 47, 57, 65;\n --neeto-ui-gray-700: 73, 84, 92;\n --neeto-ui-gray-600: 104, 115, 125;\n --neeto-ui-gray-500: 135, 146, 157;\n --neeto-ui-gray-400: 194, 200, 204;\n --neeto-ui-gray-300: 216, 220, 222;\n --neeto-ui-gray-200: 233, 235, 237;\n --neeto-ui-gray-100: 248, 249, 249;\n --neeto-ui-primary-800: 45, 54, 212;\n --neeto-ui-primary-600: 54, 66, 223;\n --neeto-ui-primary-500: 69, 88, 249;\n --neeto-ui-primary-100: 235, 236, 254;\n --neeto-ui-error-800: 187, 18, 26;\n --neeto-ui-error-600: 201, 37, 45;\n --neeto-ui-error-500: 215, 55, 63;\n --neeto-ui-error-100: 254, 236, 240;\n --neeto-ui-success-800: 16, 113, 84;\n --neeto-ui-success-600: 18, 128, 92;\n --neeto-ui-success-500: 38, 142, 108;\n --neeto-ui-success-100: 225, 243, 238;\n --neeto-ui-warning-800: 189, 100, 13;\n --neeto-ui-warning-600: 203, 111, 16;\n --neeto-ui-warning-500: 218, 123, 17;\n --neeto-ui-warning-100: 251, 242, 225;\n --neeto-ui-info-800: 9, 90, 186;\n --neeto-ui-info-600: 13, 102, 208;\n --neeto-ui-info-500: 20, 115, 230;\n --neeto-ui-info-100: 226, 242, 255;\n --neeto-ui-pastel-silver: 232, 233, 237;\n --neeto-ui-pastel-red: 255, 229, 229;\n --neeto-ui-pastel-yellow: 254, 243, 197;\n --neeto-ui-pastel-green: 211, 249, 232;\n --neeto-ui-pastel-blue: 236, 244, 255;\n --neeto-ui-pastel-purple: 238, 235, 255;\n --neeto-ui-pastel-pink: 253, 226, 241;\n --neeto-ui-pastel-silver: 232, 233, 237;\n --neeto-ui-pastel-red: 255, 229, 229;\n --neeto-ui-pastel-yellow: 254, 243, 197;\n --neeto-ui-pastel-green: 211, 249, 232;\n --neeto-ui-pastel-blue: 236, 244, 255;\n --neeto-ui-pastel-purple: 238, 235, 255;\n --neeto-ui-pastel-pink: 253, 226, 241;\n --neeto-ui-surface-bg: 255, 255, 255;\n --neeto-ui-shadow-xs: 0px 1px 4px -1px rgba(28, 48, 74, 0.12);\n --neeto-ui-shadow-s: 0px 3px 12px -1px rgba(28, 52, 84, 0.12), 0px 2px 4px -1px rgba(28, 55, 90, 0.08);\n --neeto-ui-shadow-m: 0px 8px 24px -4px rgba(28, 50, 79, 0.12), 0px 2px 6px -1px rgba(28, 55, 90, 0.08);\n --neeto-ui-shadow-l: 0px 12px 48px -6px rgba(28, 50, 79, 0.12), 0px 3px 18px -2px rgba(28, 55, 90, 0.08);\n --neeto-ui-text-h1: 32px;\n --neeto-ui-text-h2: 24px;\n --neeto-ui-text-h3: 20px;\n --neeto-ui-text-h4: 16px;\n --neeto-ui-text-h5: 14px;\n --neeto-ui-text-h6: 12px;\n --neeto-ui-text-body1: 16px;\n --neeto-ui-text-body2: 14px;\n --neeto-ui-text-body3: 12px;\n --neeto-ui-text-nano: 10px;\n --neeto-ui-text-xxs: 10px;\n --neeto-ui-text-xs: 12px;\n --neeto-ui-text-sm: 14px;\n --neeto-ui-text-base: 16px;\n --neeto-ui-text-lg: 18px;\n --neeto-ui-text-xl: 20px;\n --neeto-ui-text-2xl: 24px;\n --neeto-ui-text-3xl: 32px;\n --neeto-ui-text-4xl: 48px;\n --neeto-ui-font-thin: 100;\n --neeto-ui-font-extralight: 200;\n --neeto-ui-font-light: 300;\n --neeto-ui-font-normal: 400;\n --neeto-ui-font-medium: 500;\n --neeto-ui-font-semibold: 600;\n --neeto-ui-font-bold: 700;\n --neeto-ui-font-extrabold: 800;\n --neeto-ui-font-black: 900;\n --neeto-ui-leading-none: 1;\n --neeto-ui-leading-tight: 1.25;\n --neeto-ui-leading-snug: 1.375;\n --neeto-ui-leading-normal: 1.5;\n --neeto-ui-leading-relaxed: 1.625;\n --neeto-ui-leading-loose: 2;\n --neeto-ui-text-transform-none: none;\n --neeto-ui-text-transform-capitalize: capitalize;\n --neeto-ui-text-transform-uppercase: uppercase;\n --neeto-ui-text-transform-lowercase: lowercase;\n --neeto-ui-text-transform-full-width: full-width;\n --neeto-ui-text-transform-inherit: inherit;\n --neeto-ui-text-transform-initial: initial;\n --neeto-ui-text-transform-revert: revert;\n --neeto-ui-text-transform-unset: unset;\n --neeto-ui-rounded-none: 0;\n --neeto-ui-rounded-sm: 3px;\n --neeto-ui-rounded: 5px;\n --neeto-ui-rounded-md: 6px;\n --neeto-ui-rounded-lg: 8px;\n --neeto-ui-rounded-xl: 12px;\n --neeto-ui-rounded-full: 999px;\n --neeto-ui-transition: all 0.3s linear;\n --neeto-ui-modal-z-index: 99999;\n}\n.neeto-ui-theme--dark {\n --neeto-ui-surface-bg: 18, 18, 18;\n background-color: rgb(18, 18, 18);\n --neeto-ui-white: 18, 18, 18;\n --neeto-ui-black: 224, 224, 224;\n --neeto-ui-gray-100: 30, 30, 30;\n --neeto-ui-gray-200: 44, 44, 44;\n --neeto-ui-gray-300: 57, 57, 57;\n --neeto-ui-gray-400: 73, 73, 73;\n --neeto-ui-gray-500: 92, 92, 92;\n --neeto-ui-gray-600: 124, 124, 124;\n --neeto-ui-gray-700: 162, 162, 162;\n --neeto-ui-gray-800: 200, 200, 200;\n --neeto-ui-primary-800: 209, 213, 254;\n --neeto-ui-primary-600: 181, 188, 253;\n --neeto-ui-primary-500: 125, 137, 251;\n --neeto-ui-primary-100: 27, 28, 37;\n --neeto-ui-error-800: 247, 109, 116;\n --neeto-ui-error-600: 236, 91, 98;\n --neeto-ui-error-500: 227, 72, 80;\n --neeto-ui-error-100: 129, 33, 38;\n --neeto-ui-success-800: 57, 185, 144;\n --neeto-ui-success-600: 51, 171, 132;\n --neeto-ui-success-500: 45, 157, 120;\n --neeto-ui-success-100: 23, 85, 65;\n --neeto-ui-warning-800: 249, 164, 63;\n --neeto-ui-warning-600: 242, 148, 35;\n --neeto-ui-warning-500: 230, 134, 25;\n --neeto-ui-warning-100: 131, 74, 11;\n --neeto-ui-info-800: 75, 156, 245;\n --neeto-ui-info-600: 55, 142, 240;\n --neeto-ui-info-500: 38, 128, 235;\n --neeto-ui-info-100: 11, 69, 137;\n --neeto-ui-pastel-silver: 167, 168, 170;\n --neeto-ui-pastel-red: 183, 164, 165;\n --neeto-ui-pastel-yellow: 182, 175, 143;\n --neeto-ui-pastel-green: 152, 179, 167;\n --neeto-ui-pastel-blue: 170, 175, 183;\n --neeto-ui-pastel-purple: 171, 169, 183;\n --neeto-ui-pastel-pink: 181, 162, 174;\n}\n@keyframes shake {\n 0% {\n transform: translateX(0);\n }\n 10% {\n transform: translateX(-4px);\n }\n 20% {\n transform: translateX(4px);\n }\n 30% {\n transform: translateX(-4px);\n }\n 40% {\n transform: translateX(4px);\n }\n 50% {\n transform: translateX(-4px);\n }\n 60% {\n transform: translateX(4px);\n }\n 70% {\n transform: translateX(-4px);\n }\n 80% {\n transform: translateX(4px);\n }\n 90% {\n transform: translateX(-4px);\n }\n 100% {\n transform: translateX(0);\n }\n}\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.ne-dropdown {\n margin: 6px 0;\n box-shadow: var(--neeto-ui-shadow-xs) !important;\n border-radius: var(--neeto-ui-rounded) !important;\n border: 1px solid rgb(var(--neeto-ui-gray-400));\n}\n.ne-dropdown .tippy-content {\n position: relative;\n padding: 0;\n z-index: 1;\n}\n.ne-dropdown__popup {\n width: auto;\n min-width: 168px;\n max-height: 360px;\n overflow-y: auto;\n background-color: rgb(var(--neeto-ui-white));\n border-radius: var(--neeto-ui-rounded);\n z-index: 99999;\n}\n.ne-dropdown__popup.ne-dropdown__popup--auto-width {\n min-width: auto;\n}\n.ne-dropdown__popup li,\n.ne-dropdown__popup .ne-dropdown--item {\n display: flex;\n cursor: pointer;\n position: relative;\n white-space: nowrap;\n transition: var(--neeto-ui-transition);\n font-size: var(--neeto-ui-text-sm);\n font-weight: var(--neeto-ui-font-normal);\n color: rgb(var(--neeto-ui-gray-800));\n padding: 6px 40px 6px 12px;\n text-decoration: none;\n outline-color: transparent;\n}\n.ne-dropdown__popup li.disabled,\n.ne-dropdown__popup .ne-dropdown--item.disabled {\n cursor: not-allowed;\n color: rgb(var(--neeto-ui-gray-500));\n}\n.ne-dropdown__popup li:hover, .ne-dropdown__popup li:focus,\n.ne-dropdown__popup .ne-dropdown--item:hover,\n.ne-dropdown__popup .ne-dropdown--item:focus {\n background-color: rgb(var(--neeto-ui-gray-200));\n}\n.ne-dropdown__popup li.loading:not(.active):after,\n.ne-dropdown__popup .ne-dropdown--item.loading:not(.active):after {\n content: "";\n position: absolute;\n right: 16px;\n top: 0;\n bottom: 0;\n margin: auto;\n width: 16px;\n height: 16px;\n display: block;\n border-radius: 50%;\n border: solid 2px rgb(var(--neeto-ui-gray-200));\n border-top-color: rgb(var(--neeto-ui-black));\n border-left-color: rgb(var(--neeto-ui-black));\n animation: theme("animation.spin");\n}\n.ne-dropdown__popup li.active,\n.ne-dropdown__popup .ne-dropdown--item.active {\n background-color: rgb(var(--neeto-ui-gray-800));\n color: rgb(var(--neeto-ui-white));\n}\n.ne-dropdown__popup .ne-dropdown__popup-menu {\n padding: 4px 0;\n}\n.ne-dropdown__popup .ne-dropdown__popup-menu-item {\n all: unset;\n}\n.ne-dropdown__popup .ne-dropdown__popup-menu-item-btn {\n width: 100%;\n display: flex;\n align-items: center;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n position: relative;\n white-space: nowrap;\n line-height: 1.143;\n transition: var(--neeto-ui-transition);\n font-size: var(--neeto-ui-text-sm);\n font-weight: var(--neeto-ui-font-normal);\n color: rgb(var(--neeto-ui-gray-800));\n padding: 6px 12px;\n min-height: 32px;\n gap: 8px;\n text-decoration: none;\n outline-color: transparent;\n border-radius: 0;\n}\n.ne-dropdown__popup .ne-dropdown__popup-menu-item-btn.disabled {\n cursor: not-allowed;\n color: rgb(var(--neeto-ui-gray-500));\n}\n.ne-dropdown__popup .ne-dropdown__popup-menu-item-btn:hover, .ne-dropdown__popup .ne-dropdown__popup-menu-item-btn:focus {\n background-color: rgb(var(--neeto-ui-gray-200));\n}\n.ne-dropdown__popup .ne-dropdown__popup-menu-item-btn.active {\n background-color: rgb(var(--neeto-ui-gray-800));\n color: rgb(var(--neeto-ui-white));\n}\n.ne-dropdown__popup .ne-dropdown__popup-menu-item-btn--style-danger {\n color: rgb(var(--neeto-ui-error-800));\n}\n.ne-dropdown__popup .ne-dropdown__popup-divider {\n all: unset;\n width: 100%;\n display: flex;\n height: 1px;\n background-color: rgb(var(--neeto-ui-gray-200));\n margin: 4px 0;\n pointer-events: none;\n}\n.ne-dropdown__popup .ne-dropdown__popup-menu-item-btn__suffix {\n margin-left: auto;\n}\n.ne-avatar--container {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--neeto-ui-rounded);\n position: relative;\n}\n.ne-avatar--container.ne-avatar--container-round {\n border-radius: var(--neeto-ui-rounded-full);\n}\n.ne-avatar--container .ne-avatar__text {\n font-weight: var(--neeto-ui-font-semibold);\n text-align: center;\n text-transform: capitalize;\n font-size: var(--neeto-ui-text-xxs);\n color: rgb(47, 57, 65);\n line-height: 1;\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-medium {\n font-size: var(--neeto-ui-text-xs);\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-large {\n font-size: var(--neeto-ui-text-sm);\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-xlarge {\n font-size: var(--neeto-ui-text-2xl);\n}\n.ne-avatar--container .ne-avatar__status {\n position: absolute;\n right: 0;\n top: 0;\n width: 0.4rem;\n height: 0.4rem;\n background-color: white;\n border: 0.5px solid white;\n border-radius: var(--neeto-ui-rounded-full);\n transform: translateX(-40%);\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-medium {\n width: 0.465rem;\n height: 0.465rem;\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-large {\n width: 0.563rem;\n height: 0.563rem;\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-xlarge {\n width: 0.75rem;\n height: 0.75rem;\n transform: translateX(-65%);\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-square {\n transform: translate(25%, -25%);\n}\n.ne-avatar--container .ne-avatar__status.online {\n background-color: rgb(var(--neeto-ui-success-500));\n}\n.ne-avatar--container .ne-avatar__status.idle {\n background-color: rgb(var(--neeto-ui-warning-500));\n}\n.ne-avatar--container .ne-avatar__status.offline {\n background-color: rgb(var(--neeto-ui-gray-300));\n}\n.ne-avatar--container .ne-avatar {\n display: inline-block;\n border-radius: var(--neeto-ui-rounded-sm);\n height: 1.5rem;\n width: 1.5rem;\n -o-object-fit: cover;\n object-fit: cover;\n}\n.ne-avatar--container .ne-avatar.hidden {\n display: none;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--medium {\n height: 2rem;\n width: 2rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--large {\n height: 2.5rem;\n width: 2.5rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--xlarge {\n height: 4rem;\n width: 4rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--round {\n border-radius: var(--neeto-ui-rounded-full);\n}\n.ne-avatar--container-bg-1 {\n background-color: rgb(var(--neeto-ui-pastel-silver));\n}\n.ne-avatar--container-bg-2 {\n background-color: rgb(var(--neeto-ui-pastel-red));\n}\n.ne-avatar--container-bg-3 {\n background-color: rgb(var(--neeto-ui-pastel-yellow));\n}\n.ne-avatar--container-bg-4 {\n background-color: rgb(var(--neeto-ui-pastel-green));\n}\n.ne-avatar--container-bg-5 {\n background-color: rgb(var(--neeto-ui-pastel-blue));\n}\n.ne-avatar--container-bg-6 {\n background-color: rgb(var(--neeto-ui-pastel-purple));\n}\n.ne-avatar--container-bg-7 {\n background-color: rgb(var(--neeto-ui-pastel-pink));\n}\n.ne-tab__wrapper {\n width: 100%;\n display: flex;\n border-bottom: 2px solid rgb(var(--neeto-ui-gray-300));\n}\n.ne-tab__wrapper--size-large .ne-tab {\n font-size: var(--neeto-ui-text-xl);\n padding-left: 12px;\n padding-right: 12px;\n}\n.ne-tab__wrapper--underline-none {\n border-bottom: none;\n}\n.ne-tab__wrapper--underline-none .ne-tab::before {\n display: none;\n}\n.ne-tab {\n display: flex;\n justify-content: center;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n color: rgb(var(--neeto-ui-gray-500));\n font-weight: var(--neeto-ui-font-semibold);\n font-size: var(--neeto-ui-text-sm);\n line-height: 1;\n padding: 12px 8px;\n transition: var(--neeto-ui-transition);\n position: relative;\n cursor: pointer;\n text-decoration: none;\n outline: none;\n}\n.ne-tab:hover, .ne-tab:focus, .ne-tab:focus-visible, .ne-tab:active {\n text-decoration: none;\n outline: none;\n}\n.ne-tab:focus, .ne-tab:focus-visible {\n color: rgb(var(--neeto-ui-gray-800));\n}\n.ne-tab__icon {\n margin-right: 12px;\n}\n.ne-tab svg {\n width: 16px;\n height: 16px;\n}\n.ne-tab:hover {\n color: rgb(var(--neeto-ui-gray-600));\n}\n.ne-tab:before {\n content: "";\n position: absolute;\n width: 100%;\n height: 2px;\n background-color: transparent;\n left: 0;\n right: 0;\n bottom: -2px;\n transition: var(--neeto-ui-transition);\n}\n.ne-tab.active {\n color: rgb(var(--neeto-ui-gray-800));\n}\n.ne-tab.active:before {\n background-color: rgb(var(--neeto-ui-gray-800));\n}\n.ne-btn {\n position: relative;\n display: inline-flex !important;\n align-items: center;\n padding: 6px 8px;\n gap: 4px;\n font-size: var(--neeto-ui-text-sm);\n font-weight: var(--neeto-ui-font-medium);\n line-height: 16px;\n transition: var(--neeto-ui-transition);\n border-radius: var(--neeto-ui-rounded);\n border: none;\n outline: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n min-width: 0;\n cursor: pointer;\n}\n.ne-btn.ne-btn--icon-only {\n padding: 6px;\n}\n.ne-btn.ne-btn--icon-only .ne-btn__icon,\n.ne-btn.ne-btn--icon-only .ne-btn__spinner svg {\n width: 16px !important;\n height: 16px !important;\n}\n.ne-btn--size-medium {\n font-size: var(--neeto-ui-text-sm);\n padding: 8px 16px;\n gap: 8px;\n}\n.ne-btn--size-medium.ne-btn--icon-only .ne-btn__icon,\n.ne-btn--size-medium.ne-btn--icon-only .ne-btn__spinner svg {\n width: 20px !important;\n height: 20px !important;\n}\n.ne-btn--size-large {\n font-size: var(--neeto-ui-text-base);\n padding: 12px 20px;\n gap: 10px;\n}\n.ne-btn--size-large.ne-btn--icon-only {\n padding: 8px;\n}\n.ne-btn--size-large.ne-btn--icon-only .ne-btn__icon,\n.ne-btn--size-large.ne-btn--icon-only .ne-btn__spinner svg {\n width: 24px !important;\n height: 24px !important;\n}\n.ne-btn:focus, .ne-btn:focus-visible {\n outline: none;\n}\n.ne-btn:hover {\n text-decoration: none;\n}\n.ne-btn.disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.ne-btn--icon-left {\n flex-direction: row-reverse;\n}\n.ne-btn__icon,\n.ne-btn__spinner,\n.ne-btn__spinner-wrapper {\n color: inherit;\n}\n.ne-btn__icon svg,\n.ne-btn__spinner svg,\n.ne-btn__spinner-wrapper svg {\n color: inherit !important;\n}\n.ne-btn--width-full {\n width: 100% !important;\n justify-content: center;\n}\n.ne-btn--style-primary {\n color: rgb(var(--neeto-ui-white));\n background-color: rgb(var(--neeto-ui-primary-500));\n}\n.ne-btn--style-primary:hover:not(:disabled), .ne-btn--style-primary:active {\n color: rgb(var(--neeto-ui-white));\n background-color: rgb(var(--neeto-ui-primary-600));\n}\n.ne-btn--style-primary:focus {\n color: rgb(var(--neeto-ui-white));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-primary-500), 15%);\n}\n.ne-btn--style-primary:focus-visible {\n color: rgb(var(--neeto-ui-white));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-primary-500), 15%);\n}\n.ne-btn--style-secondary {\n color: rgb(var(--neeto-ui-gray-800));\n background-color: rgb(var(--neeto-ui-gray-200));\n}\n.ne-btn--style-secondary:hover:not(:disabled), .ne-btn--style-secondary:active {\n color: rgb(var(--neeto-ui-gray-800));\n background-color: rgb(var(--neeto-ui-gray-300));\n}\n.ne-btn--style-secondary:focus {\n color: rgb(var(--neeto-ui-gray-800));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-gray-800), 25%);\n}\n.ne-btn--style-secondary:focus-visible {\n color: rgb(var(--neeto-ui-gray-800));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-gray-800), 25%);\n}\n.ne-btn--style-text {\n color: rgb(var(--neeto-ui-gray-800));\n}\n.ne-btn--style-text:hover:not(:disabled), .ne-btn--style-text:active {\n color: rgb(var(--neeto-ui-gray-800));\n background-color: rgb(var(--neeto-ui-gray-200));\n}\n.ne-btn--style-text:focus {\n color: rgb(var(--neeto-ui-gray-800));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-gray-800), 15%);\n}\n.ne-btn--style-text:focus-visible {\n color: rgb(var(--neeto-ui-gray-800));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-gray-800), 15%);\n}\n.ne-btn--style-link {\n color: rgb(var(--neeto-ui-primary-500));\n padding: 0;\n}\n.ne-btn--style-link:hover:not(:disabled), .ne-btn--style-link:active, .ne-btn--style-link:focus {\n opacity: 0.8;\n color: rgb(var(--neeto-ui-primary-500));\n}\n.ne-btn--style-link:focus {\n opacity: 0.8;\n color: rgb(var(--neeto-ui-primary-500));\n}\n.ne-btn--style-link:focus-visible {\n opacity: 0.8;\n color: rgb(var(--neeto-ui-primary-500));\n}\n.ne-btn--style-danger {\n color: rgb(var(--neeto-ui-white));\n background-color: rgb(var(--neeto-ui-error-500));\n}\n.ne-btn--style-danger:hover:not(:disabled), .ne-btn--style-danger:active {\n color: rgb(var(--neeto-ui-white));\n background-color: rgb(var(--neeto-ui-error-600));\n}\n.ne-btn--style-danger:focus {\n color: rgb(var(--neeto-ui-white));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-error-500), 15%);\n}\n.ne-btn--style-danger:focus-visible {\n color: rgb(var(--neeto-ui-white));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-error-500), 15%);\n}\n.ne-btn--style-danger-text {\n color: rgb(var(--neeto-ui-error-800));\n}\n.ne-btn--style-danger-text:hover:not(:disabled), .ne-btn--style-danger-text:active {\n color: rgb(var(--neeto-ui-error-800));\n background-color: rgb(var(--neeto-ui-error-100));\n}\n.ne-btn--style-danger-text:focus {\n color: rgb(var(--neeto-ui-error-800));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-error-500), 15%);\n}\n.ne-btn--style-danger-text:focus-visible {\n color: rgb(var(--neeto-ui-error-800));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-error-500), 15%);\n}\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0;\n}\n[data-tippy-root] {\n max-width: calc(100vw - 10px);\n}\n.tippy-box {\n position: relative;\n background-color: rgb(var(--neeto-ui-gray-800));\n color: rgb(var(--neeto-ui-white));\n border-radius: var(--neeto-ui-rounded);\n font-size: var(--neeto-ui-text-xs);\n line-height: 1.4;\n outline: 0;\n transition-property: transform, visibility, opacity;\n}\n.tippy-box[data-placement^=top] > .tippy-arrow {\n bottom: 0;\n}\n.tippy-box[data-placement^=top] > .tippy-arrow:before {\n bottom: -7px;\n left: 0;\n border-width: 8px 8px 0;\n border-top-color: initial;\n transform-origin: center top;\n}\n.tippy-box[data-placement^=bottom] > .tippy-arrow {\n top: 0;\n}\n.tippy-box[data-placement^=bottom] > .tippy-arrow:before {\n top: -7px;\n left: 0;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n transform-origin: center bottom;\n}\n.tippy-box[data-placement^=left] > .tippy-arrow {\n right: 0;\n}\n.tippy-box[data-placement^=left] > .tippy-arrow:before {\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n right: -7px;\n transform-origin: center left;\n}\n.tippy-box[data-placement^=right] > .tippy-arrow {\n left: 0;\n}\n.tippy-box[data-placement^=right] > .tippy-arrow:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n transform-origin: center right;\n}\n.tippy-box[data-inertia][data-state=visible] {\n transition-timing-function: cubic-bezier(0.54, 1.5, 0.38, 1.11);\n}\n.tippy-arrow {\n width: 16px;\n height: 16px;\n color: rgb(var(--neeto-ui-gray-800));\n}\n.tippy-arrow:before {\n content: "";\n position: absolute;\n border-color: transparent;\n border-style: solid;\n}\n.tippy-content {\n position: relative;\n padding: 4px 8px;\n z-index: 1;\n}\n[data-theme=neeto-editor-slash-menu] .tippy-content,\n[data-theme=neeto-editor-bubble-menu] .tippy-content {\n padding: 0 !important;\n}\n.tippy-box[data-placement^=top] > .tippy-svg-arrow {\n bottom: 0;\n}\n.tippy-box[data-placement^=top] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=top] > .tippy-svg-arrow > svg {\n top: 16px;\n transform: rotate(180deg);\n}\n.tippy-box[data-placement^=bottom] > .tippy-svg-arrow {\n top: 0;\n}\n.tippy-box[data-placement^=bottom] > .tippy-svg-arrow > svg {\n bottom: 16px;\n}\n.tippy-box[data-placement^=left] > .tippy-svg-arrow {\n right: 0;\n}\n.tippy-box[data-placement^=left] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=left] > .tippy-svg-arrow > svg {\n transform: rotate(90deg);\n top: calc(50% - 3px);\n left: 13px;\n}\n.tippy-box[data-placement^=right] > .tippy-svg-arrow {\n left: 0;\n}\n.tippy-box[data-placement^=right] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=right] > .tippy-svg-arrow > svg {\n transform: rotate(-90deg);\n top: calc(50% - 3px);\n right: 13px;\n}\n.tippy-svg-arrow {\n width: 16px;\n height: 16px;\n fill: rgb(var(--neeto-ui-gray-800));\n text-align: initial;\n}\n.tippy-svg-arrow,\n.tippy-svg-arrow > svg {\n position: absolute;\n}\n.tippy-svg-arrow > svg > path {\n fill: rgb(var(--neeto-ui-gray-800));\n}\n.tippy-box[data-theme~=light] .tippy-svg-arrow > svg > path {\n fill: rgb(var(--neeto-ui-white));\n}\n.tippy-box[data-theme~=light] {\n color: rgb(var(--neeto-ui-gray-800));\n box-shadow: var(--neeto-ui-shadow-s);\n background-color: rgb(var(--neeto-ui-white));\n}\n.tippy-box[data-theme~=light][data-placement^=top] > .tippy-arrow:before {\n border-top-color: rgb(var(--neeto-ui-white));\n}\n.tippy-box[data-theme~=light][data-placement^=bottom] > .tippy-arrow:before {\n border-bottom-color: rgb(var(--neeto-ui-white));\n}\n.tippy-box[data-theme~=light][data-placement^=left] > .tippy-arrow:before {\n border-left-color: rgb(var(--neeto-ui-white));\n}\n.tippy-box[data-theme~=light][data-placement^=right] > .tippy-arrow:before {\n border-right-color: rgb(var(--neeto-ui-white));\n}\n.tippy-box[data-theme~=light] > .tippy-backdrop {\n background-color: rgb(var(--neeto-ui-white));\n}\n.tippy-box[data-theme~=light] > .tippy-svg-arrow {\n fill: rgb(var(--neeto-ui-white));\n}\n.ne-input__wrapper {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n flex-grow: 1;\n}\n.ne-input__wrapper .ne-input__label-wrapper {\n display: flex;\n gap: 8px;\n justify-content: space-between;\n width: 100%;\n}\n.ne-input__wrapper .ne-input__label-wrapper .ne-label {\n flex-grow: 1;\n overflow-wrap: break-word;\n}\n.ne-input__wrapper .ne-input__label-wrapper .ne-input__max-length {\n color: rgb(var(--neeto-ui-gray-700));\n line-height: 1;\n margin-bottom: 8px;\n margin-left: auto;\n}\n.ne-input__wrapper .ne-input__label-wrapper .ne-input__max-length.ne-input__max-length--error {\n color: rgb(var(--neeto-ui-error-800));\n}\n.ne-input__wrapper .ne-label {\n margin-bottom: 8px;\n}\n.ne-input__wrapper .ne-input {\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n font-size: var(--neeto-ui-text-sm);\n transition: var(--neeto-ui-transition);\n border-radius: var(--neeto-ui-rounded);\n border: thin solid rgb(var(--neeto-ui-gray-400));\n background-color: rgb(var(--neeto-ui-white));\n color: rgb(var(--neeto-ui-gray-800));\n overflow: hidden;\n}\n.ne-input__wrapper .ne-input input,\n.ne-input__wrapper .ne-input textarea {\n width: 100%;\n background-color: transparent;\n color: inherit;\n border: none;\n font-size: inherit;\n box-shadow: none;\n outline: none;\n}\n.ne-input__wrapper .ne-input input::-moz-placeholder, .ne-input__wrapper .ne-input textarea::-moz-placeholder {\n color: rgb(var(--neeto-ui-gray-400));\n}\n.ne-input__wrapper .ne-input input::placeholder,\n.ne-input__wrapper .ne-input textarea::placeholder {\n color: rgb(var(--neeto-ui-gray-400));\n}\n.ne-input__wrapper .ne-input input:focus,\n.ne-input__wrapper .ne-input textarea:focus {\n outline-color: transparent;\n}\n.ne-input__wrapper .ne-input input {\n line-height: 1.2;\n}\n.ne-input__wrapper .ne-input textarea {\n padding: 0;\n max-height: 224px;\n overflow-y: auto;\n line-height: 1.5;\n}\n.ne-input__wrapper .ne-input:hover:not(.ne-input--naked, .ne-input--error, .ne-input--disabled) {\n border-color: rgb(var(--neeto-ui-gray-700));\n}\n.ne-input__wrapper .ne-input:focus-within:not(.ne-input--naked, .ne-input--error) {\n border-color: rgb(var(--neeto-ui-primary-500));\n box-shadow: 0 0 0 3px rgba(var(--neeto-ui-primary-500), 15%);\n}\n.ne-input__wrapper .ne-input:focus-within:not(.ne-input--naked, .ne-input--error) .ne-input__prefix,\n.ne-input__wrapper .ne-input:focus-within:not(.ne-input--naked, .ne-input--error) .ne-input__suffix {\n color: rgb(var(--neeto-ui-gray-800));\n}\n.ne-input__wrapper .ne-input.ne-input--error {\n border-color: rgb(var(--neeto-ui-error-500));\n}\n.ne-input__wrapper .ne-input.ne-input--error:focus-within:not(.ne-input--naked) {\n box-shadow: 0 0 0 3px rgb(var(--neeto-ui-error-100));\n}\n.ne-input__wrapper .ne-input.ne-input--error textarea {\n resize: none;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled {\n background-color: rgb(var(--neeto-ui-gray-100));\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled input {\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled textarea {\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--small input {\n padding: 4px 8px;\n min-height: 26px;\n}\n.ne-input__wrapper .ne-input.ne-input--small .ne-input__prefix {\n margin-left: 8px;\n}\n.ne-input__wrapper .ne-input.ne-input--small .ne-input__suffix {\n margin-right: 8px;\n}\n.ne-input__wrapper .ne-input.ne-input--small.ne-input--textarea {\n padding: 8px;\n}\n.ne-input__wrapper .ne-input.ne-input--medium input {\n padding: 5px 8px;\n min-height: 30px;\n}\n.ne-input__wrapper .ne-input.ne-input--medium .ne-input__prefix {\n margin-left: 8px;\n}\n.ne-input__wrapper .ne-input.ne-input--medium .ne-input__suffix {\n margin-right: 8px;\n}\n.ne-input__wrapper .ne-input.ne-input--medium.ne-input--textarea {\n padding: 8px;\n}\n.ne-input__wrapper .ne-input.ne-input--large input {\n padding: 8px 12px;\n min-height: 38px;\n}\n.ne-input__wrapper .ne-input.ne-input--large .ne-input__prefix {\n margin-left: 12px;\n}\n.ne-input__wrapper .ne-input.ne-input--large .ne-input__suffix {\n margin-right: 12px;\n}\n.ne-input__wrapper .ne-input.ne-input--large.ne-input--textarea {\n padding: 12px;\n}\n.ne-input__wrapper .ne-input.ne-input--naked {\n border: none;\n box-shadow: none;\n padding-left: 0;\n padding-right: 0;\n}\n.ne-input__wrapper .ne-input.ne-input--naked input {\n padding-left: 0;\n padding-right: 0;\n}\n.ne-input__wrapper .ne-input.ne-input--naked .ne-input__prefix {\n margin-left: 0;\n}\n.ne-input__wrapper .ne-input.ne-input--naked .ne-input__suffix {\n margin-right: 0;\n}\n.ne-input__wrapper .ne-input__prefix,\n.ne-input__wrapper .ne-input__suffix {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n font-size: 14px;\n color: rgb(var(--neeto-ui-gray-700));\n}\n.ne-input__wrapper .ne-input__prefix svg,\n.ne-input__wrapper .ne-input__suffix svg {\n width: 16px;\n height: 16px;\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__prefix,\n.ne-input__wrapper .ne-input--block-add-on .ne-input__suffix {\n margin: 0;\n padding: 8px 12px;\n background-color: rgb(var(--neeto-ui-gray-100));\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__prefix {\n border-right: thin solid rgb(var(--neeto-ui-gray-400));\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__suffix {\n border-left: thin solid rgb(var(--neeto-ui-gray-400));\n}\n.ne-input__help-text {\n margin-top: 8px;\n font-size: var(--neeto-ui-text-xs);\n color: rgb(var(--neeto-ui-gray-600));\n line-height: 1.1;\n}\n.ne-input__error {\n margin-top: 8px;\n line-height: 1.1;\n font-size: var(--neeto-ui-text-xs);\n color: rgb(var(--neeto-ui-error-800));\n}\n.ne-label {\n display: flex;\n align-items: center;\n}\n:root {\n --neeto-ui-modal-spacing: 24px;\n}\n.ne-modal__backdrop {\n position: fixed;\n z-index: var(--neeto-ui-modal-z-index);\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n overflow-y: auto;\n overflow-x: hidden;\n display: grid;\n justify-content: center;\n align-items: center;\n transition: all 0.3s;\n background-color: rgba(27, 31, 35, 0.8666666667);\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n}\n.ne-modal__backdrop .ne-modal__wrapper {\n width: 50%;\n max-width: 100%;\n position: relative;\n background-color: rgb(var(--neeto-ui-white));\n border-radius: var(--neeto-ui-rounded-xl);\n opacity: 0;\n transform: scale(1.1);\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n animation: showModalWrapper 0.3s forwards;\n}\n@keyframes showModalWrapper {\n 0% {\n opacity: 0;\n transform: scale(1.1);\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n -webkit-backdrop-filter: blur(0px);\n backdrop-filter: blur(0px);\n }\n}\n.ne-modal__backdrop .ne-modal__wrapper .ne-modal__close {\n position: absolute;\n top: var(--neeto-ui-modal-spacing);\n right: var(--neeto-ui-modal-spacing);\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--small {\n width: 320px;\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--medium {\n width: 480px;\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--large {\n width: 720px;\n}\n.ne-modal__backdrop .ne-modal__wrapper .ne-modal__header {\n padding: var(--neeto-ui-modal-spacing) 64px 16px var(--neeto-ui-modal-spacing);\n overflow-wrap: break-word;\n}\n.ne-modal__backdrop .ne-modal__wrapper .ne-modal__header-desc {\n margin-top: 8px;\n color: rgb(var(--neeto-ui-gray-700));\n}\n.ne-modal__backdrop .ne-modal__wrapper .ne-modal__body {\n padding: 0 var(--neeto-ui-modal-spacing);\n font-size: var(--neeto-ui-text-sm);\n line-height: 1.5;\n}\n.ne-modal__backdrop .ne-modal__wrapper .ne-modal__footer {\n padding: var(--neeto-ui-modal-spacing);\n}\n.ne-modal__backdrop .ne-modal__wrapper .ne-alert__footer {\n padding: var(--neeto-ui-modal-spacing);\n display: flex;\n}\n.ne-modal__backdrop .ne-icon__wrapper {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n margin-bottom: var(--neeto-ui-modal-spacing);\n padding: 10px 0 0 2px;\n}\n.ne-modal-enter.ne-modal__backdrop {\n opacity: 0;\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n}\n.ne-modal-enter-active.ne-modal__backdrop,\n.ne-modal-enter-done.ne-modal__backdrop {\n opacity: 1;\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n}\n.ne-modal-exit.ne-modal__backdrop {\n opacity: 1;\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n}\n.ne-modal-exit-active.ne-modal__backdrop {\n opacity: 0;\n -webkit-backdrop-filter: blur(2px);\n backdrop-filter: blur(2px);\n}\n.neeto-editor-loader {\n width: 100%;\n height: 32px;\n display: flex;\n align-items: center;\n text-align: center;\n}\n.neeto-editor-loader__spinner-icon {\n width: 16px;\n height: 16px;\n display: inline-block;\n border-radius: var(--neeto-ui-rounded-full);\n border: solid 2px var(--neeto-ui-gray-200);\n border-top-color: var(--neeto-ui-gray-800);\n border-left-color: var(--neeto-ui-gray-800);\n animation: spin 600ms linear infinite;\n margin: 1px auto;\n}\n.neeto-editor-slash-commands__wrapper {\n padding: 12px;\n overflow-y: auto;\n max-height: 384px;\n width: 256px;\n max-width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n gap: 4px;\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item {\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n padding: 8px 12px;\n gap: 12px;\n border-radius: var(--neeto-ui-rounded);\n transition: var(--neeto-ui-transition);\n cursor: pointer;\n color: rgb(var(--neeto-ui-white));\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item:hover, .neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item.active {\n background-color: rgb(var(--neeto-ui-gray-700));\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item .neeto-editor-slash-commands__item-content h5 {\n font-size: var(--neeto-ui-text-sm);\n font-weight: var(--neeto-ui-font-semibold);\n line-height: var(--neeto-ui-leading-normal);\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item .neeto-editor-slash-commands__item-content p {\n font-size: var(--neeto-ui-text-xs);\n color: rgb(var(--neeto-ui-gray-300));\n}\n.neeto-editor-mentions__wrapper {\n padding: 8px;\n width: 208px;\n max-height: 256px;\n overflow-y: auto;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n padding: 8px;\n transition: var(--neeto-ui-transition);\n cursor: pointer;\n font-size: var(--neeto-ui-text-xs);\n color: rgb(var(--neeto-ui-white));\n border-radius: var(--neeto-ui-rounded);\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item p {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item .ne-avatar--container {\n margin-right: 8px;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item:hover, .neeto-editor-mentions__wrapper .neeto-editor-mentions__item.active {\n background-color: rgb(var(--neeto-ui-gray-700));\n}\n.ProseMirror.slash-active p.is-empty:last-child::before {\n content: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkwIiBoZWlnaHQ9IjIzIiB2aWV3Qm94PSIwIDAgMTkwIDIz IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmci Pgo8cmVjdCB4PSIzNCIgeT0iNCIgd2lkdGg9IjE5IiBoZWlnaHQ9IjE5IiByeD0i NCIgZmlsbD0iI0YzRjRGNiIvPgo8cGF0aCBkPSJNNDEuNTA3OCAxOS45NzY2SDQw LjAxNTZMNDQuNDkyMiA3LjYyNUg0NS45ODQ0TDQxLjUwNzggMTkuOTc2NloiIGZp bGw9IiM2QjcyODAiLz4KPHBhdGggZD0iTTguMDMyMjMgOS4xMjY5NUg0LjgzMzAx VjE4SDMuNTI3MzRWOS4xMjY5NUgwLjMzNDk2MVY4LjA0Njg4SDguMDMyMjNWOS4x MjY5NVpNMTEuMjM4MyAxNi4xNDc1TDEyLjk2MDkgMTAuNjAzNUgxNC4zMTQ1TDEx LjM0MDggMTkuMTQxNkMxMC44ODA1IDIwLjM3MjEgMTAuMTQ5MSAyMC45ODczIDku MTQ2NDggMjAuOTg3M0w4LjkwNzIzIDIwLjk2NjhMOC40MzU1NSAyMC44Nzc5VjE5 Ljg1MjVMOC43NzczNCAxOS44Nzk5QzkuMjA1NzMgMTkuODc5OSA5LjUzODQxIDE5 Ljc5MzMgOS43NzUzOSAxOS42MjAxQzEwLjAxNjkgMTkuNDQ2OSAxMC4yMTUyIDE5 LjEzMDIgMTAuMzcwMSAxOC42Njk5TDEwLjY1MDQgMTcuOTE4TDguMDExNzIgMTAu NjAzNUg5LjM5MjU4TDExLjIzODMgMTYuMTQ3NVpNMjEuNjk3MyAxNC4zODM4QzIx LjY5NzMgMTUuNTA5NCAyMS40Mzk4IDE2LjQxNjMgMjAuOTI0OCAxNy4xMDQ1QzIw LjQwOTggMTcuNzkyNiAxOS43MTI2IDE4LjEzNjcgMTguODMzIDE4LjEzNjdDMTcu OTM1MiAxOC4xMzY3IDE3LjIyODggMTcuODUxOSAxNi43MTM5IDE3LjI4MjJWMjAu ODQzOEgxNS40NDkyVjEwLjYwMzVIMTYuNjA0NUwxNi42NjYgMTEuNDIzOEMxNy4x ODEgMTAuNzg1OCAxNy44OTY1IDEwLjQ2NjggMTguODEyNSAxMC40NjY4QzE5Ljcw MTIgMTAuNDY2OCAyMC40MDMgMTAuODAxOCAyMC45MTggMTEuNDcxN0MyMS40Mzc1 IDEyLjE0MTYgMjEuNjk3MyAxMy4wNzM2IDIxLjY5NzMgMTQuMjY3NlYxNC4zODM4 Wk0yMC40MzI2IDE0LjI0MDJDMjAuNDMyNiAxMy40MDYyIDIwLjI1NDkgMTIuNzQ3 NyAxOS44OTk0IDEyLjI2NDZDMTkuNTQzOSAxMS43ODE2IDE5LjA1NjMgMTEuNTQg MTguNDM2NSAxMS41NEMxNy42NzA5IDExLjU0IDE3LjA5NjcgMTEuODc5NiAxNi43 MTM5IDEyLjU1ODZWMTYuMDkyOEMxNy4wOTIxIDE2Ljc2NzMgMTcuNjcwOSAxNy4x MDQ1IDE4LjQ1MDIgMTcuMTA0NUMxOS4wNTYzIDE3LjEwNDUgMTkuNTM3MSAxNi44 NjUyIDE5Ljg5MjYgMTYuMzg2N0MyMC4yNTI2IDE1LjkwMzYgMjAuNDMyNiAxNS4x ODgyIDIwLjQzMjYgMTQuMjQwMlpNMjYuMzc5OSAxOC4xMzY3QzI1LjM3NzMgMTgu MTM2NyAyNC41NjE1IDE3LjgwODYgMjMuOTMyNiAxNy4xNTIzQzIzLjMwMzcgMTYu NDkxNSAyMi45ODkzIDE1LjYwOTcgMjIuOTg5MyAxNC41MDY4VjE0LjI3NDRDMjIu OTg5MyAxMy41NDA3IDIzLjEyODMgMTIuODg2NyAyMy40MDYyIDEyLjMxMjVDMjMu Njg4OCAxMS43MzM3IDI0LjA4MDcgMTEuMjgyNiAyNC41ODIgMTAuOTU5QzI1LjA4 NzkgMTAuNjMwOSAyNS42MzQ4IDEwLjQ2NjggMjYuMjIyNyAxMC40NjY4QzI3LjE4 NDIgMTAuNDY2OCAyNy45MzE2IDEwLjc4MzUgMjguNDY0OCAxMS40MTdDMjguOTk4 IDEyLjA1MDUgMjkuMjY0NiAxMi45NTc0IDI5LjI2NDYgMTQuMTM3N1YxNC42NjQx SDI0LjI1MzlDMjQuMjcyMSAxNS4zOTMyIDI0LjQ4NCAxNS45ODM0IDI0Ljg4OTYg MTYuNDM0NkMyNS4yOTk4IDE2Ljg4MTIgMjUuODE5MyAxNy4xMDQ1IDI2LjQ0ODIg MTcuMTA0NUMyNi44OTQ5IDE3LjEwNDUgMjcuMjczMSAxNy4wMTMzIDI3LjU4MyAx Ni44MzExQzI3Ljg5MjkgMTYuNjQ4OCAyOC4xNjQxIDE2LjQwNzIgMjguMzk2NSAx Ni4xMDY0TDI5LjE2ODkgMTYuNzA4QzI4LjU0OTIgMTcuNjYwNSAyNy42MTk1IDE4 LjEzNjcgMjYuMzc5OSAxOC4xMzY3Wk0yNi4yMjI3IDExLjUwNTlDMjUuNzEyMiAx MS41MDU5IDI1LjI4MzkgMTEuNjkyNyAyNC45Mzc1IDEyLjA2NjRDMjQuNTkxMSAx Mi40MzU1IDI0LjM3NyAxMi45NTUxIDI0LjI5NDkgMTMuNjI1SDI4VjEzLjUyOTND MjcuOTYzNSAxMi44ODY3IDI3Ljc5MDQgMTIuMzkgMjcuNDgwNSAxMi4wMzkxQzI3 LjE3MDYgMTEuNjgzNiAyNi43NTEzIDExLjUwNTkgMjYuMjIyNyAxMS41MDU5WiIg ZmlsbD0iIzZCNzI4MCIvPgo8cGF0aCBkPSJNNTkuNjcyOSA4LjgxMjVWMTAuNjAz NUg2MS4wNTM3VjExLjU4MTFINTkuNjcyOVYxNi4xNjhDNTkuNjcyOSAxNi40NjQy IDU5LjczNDQgMTYuNjg3NSA1OS44NTc0IDE2LjgzNzlDNTkuOTgwNSAxNi45ODM3 IDYwLjE5MDEgMTcuMDU2NiA2MC40ODYzIDE3LjA1NjZDNjAuNjMyMiAxNy4wNTY2 IDYwLjgzMjcgMTcuMDI5MyA2MS4wODc5IDE2Ljk3NDZWMThDNjAuNzU1MiAxOC4w OTExIDYwLjQzMTYgMTguMTM2NyA2MC4xMTcyIDE4LjEzNjdDNTkuNTUyMSAxOC4x MzY3IDU5LjEyNiAxNy45NjU4IDU4LjgzODkgMTcuNjI0QzU4LjU1MTggMTcuMjgy MiA1OC40MDgyIDE2Ljc5NjkgNTguNDA4MiAxNi4xNjhWMTEuNTgxMUg1Ny4wNjE1 VjEwLjYwMzVINTguNDA4MlY4LjgxMjVINTkuNjcyOVpNNjIuMDY1NCAxNC4yMzM0 QzYyLjA2NTQgMTMuNTA4OCA2Mi4yMDY3IDEyLjg1NzEgNjIuNDg5MyAxMi4yNzgz QzYyLjc3NjQgMTEuNjk5NSA2My4xNzI5IDExLjI1MjkgNjMuNjc4NyAxMC45Mzg1 QzY0LjE4OTEgMTAuNjI0IDY0Ljc3MDIgMTAuNDY2OCA2NS40MjE5IDEwLjQ2NjhD NjYuNDI5IDEwLjQ2NjggNjcuMjQyNSAxMC44MTU0IDY3Ljg2MjMgMTEuNTEyN0M2 OC40ODY3IDEyLjIxIDY4Ljc5ODggMTMuMTM3NCA2OC43OTg4IDE0LjI5NDlWMTQu MzgzOEM2OC43OTg4IDE1LjEwMzggNjguNjU5OCAxNS43NTEgNjguMzgxOCAxNi4z MjUyQzY4LjEwODQgMTYuODk0OSA2Ny43MTQyIDE3LjMzOTIgNjcuMTk5MiAxNy42 NTgyQzY2LjY4ODggMTcuOTc3MiA2Ni4xMDA5IDE4LjEzNjcgNjUuNDM1NSAxOC4x MzY3QzY0LjQzMjkgMTguMTM2NyA2My42MTk1IDE3Ljc4ODEgNjIuOTk1MSAxNy4w OTA4QzYyLjM3NTMgMTYuMzkzNiA2Mi4wNjU0IDE1LjQ3MDcgNjIuMDY1NCAxNC4z MjIzVjE0LjIzMzRaTTYzLjMzNjkgMTQuMzgzOEM2My4zMzY5IDE1LjIwNDEgNjMu NTI2IDE1Ljg2MjYgNjMuOTA0MyAxNi4zNTk0QzY0LjI4NzEgMTYuODU2MSA2NC43 OTc1IDE3LjEwNDUgNjUuNDM1NSAxNy4xMDQ1QzY2LjA3ODEgMTcuMTA0NSA2Ni41 ODg1IDE2Ljg1MzggNjYuOTY2OCAxNi4zNTI1QzY3LjM0NTEgMTUuODQ2NyA2Ny41 MzQyIDE1LjE0MDMgNjcuNTM0MiAxNC4yMzM0QzY3LjUzNDIgMTMuNDIyMiA2Ny4z NDA1IDEyLjc2NiA2Ni45NTMxIDEyLjI2NDZDNjYuNTcwMyAxMS43NTg4IDY2LjA1 OTkgMTEuNTA1OSA2NS40MjE5IDExLjUwNTlDNjQuNzk3NSAxMS41MDU5IDY0LjI5 MzkgMTEuNzU0MiA2My45MTExIDEyLjI1MUM2My41MjgzIDEyLjc0NzcgNjMuMzM2 OSAxMy40NTg3IDYzLjMzNjkgMTQuMzgzOFpNNzYuODI0MiAxNy4xMDQ1Qzc3LjI3 NTQgMTcuMTA0NSA3Ny42Njk2IDE2Ljk2NzggNzguMDA2OCAxNi42OTQzQzc4LjM0 NDEgMTYuNDIwOSA3OC41MzA5IDE2LjA3OTEgNzguNTY3NCAxNS42Njg5SDc5Ljc2 MzdDNzkuNzQwOSAxNi4wOTI4IDc5LjU5NTEgMTYuNDk2MSA3OS4zMjYyIDE2Ljg3 ODlDNzkuMDU3MyAxNy4yNjE3IDc4LjY5NzMgMTcuNTY3MSA3OC4yNDYxIDE3Ljc5 NDlDNzcuNzk5NSAxOC4wMjI4IDc3LjMyNTUgMTguMTM2NyA3Ni44MjQyIDE4LjEz NjdDNzUuODE3MSAxOC4xMzY3IDc1LjAxNSAxNy44MDE4IDc0LjQxOCAxNy4xMzE4 QzczLjgyNTUgMTYuNDU3NCA3My41MjkzIDE1LjUzNjggNzMuNTI5MyAxNC4zNzAx VjE0LjE1ODJDNzMuNTI5MyAxMy40MzgyIDczLjY2MTUgMTIuNzk3OSA3My45MjU4 IDEyLjIzNzNDNzQuMTkwMSAxMS42NzY4IDc0LjU2ODQgMTEuMjQxNSA3NS4wNjA1 IDEwLjkzMTZDNzUuNTU3MyAxMC42MjE3IDc2LjE0MjkgMTAuNDY2OCA3Ni44MTc0 IDEwLjQ2NjhDNzcuNjQ2OCAxMC40NjY4IDc4LjMzNSAxMC43MTUyIDc4Ljg4MTgg MTEuMjExOUM3OS40MzMzIDExLjcwODcgNzkuNzI3MiAxMi4zNTM1IDc5Ljc2Mzcg MTMuMTQ2NUg3OC41Njc0Qzc4LjUzMDkgMTIuNjY4IDc4LjM0ODYgMTIuMjc2IDc4 LjAyMDUgMTEuOTcwN0M3Ny42OTY5IDExLjY2MDggNzcuMjk1OSAxMS41MDU5IDc2 LjgxNzQgMTEuNTA1OUM3Ni4xNzQ4IDExLjUwNTkgNzUuNjc1OCAxMS43MzgzIDc1 LjMyMDMgMTIuMjAzMUM3NC45Njk0IDEyLjY2MzQgNzQuNzkzOSAxMy4zMzExIDc0 Ljc5MzkgMTQuMjA2MVYxNC40NDUzQzc0Ljc5MzkgMTUuMjk3NSA3NC45Njk0IDE1 Ljk1MzggNzUuMzIwMyAxNi40MTQxQzc1LjY3MTIgMTYuODc0MyA3Ni4xNzI1IDE3 LjEwNDUgNzYuODI0MiAxNy4xMDQ1Wk04Mi40NTAyIDExLjQ5OUM4My4wMTA3IDEw LjgxMDkgODMuNzM5OSAxMC40NjY4IDg0LjYzNzcgMTAuNDY2OEM4Ni4yMDA4IDEw LjQ2NjggODYuOTg5MyAxMS4zNDg2IDg3LjAwMjkgMTMuMTEyM1YxOEg4NS43Mzgz VjEzLjEwNTVDODUuNzMzNyAxMi41NzIzIDg1LjYxMDcgMTIuMTc4MSA4NS4zNjkx IDExLjkyMjlDODUuMTMyMiAxMS42Njc2IDg0Ljc2MDcgMTEuNTQgODQuMjU0OSAx MS41NEM4My44NDQ3IDExLjU0IDgzLjQ4NDcgMTEuNjQ5NCA4My4xNzQ4IDExLjg2 ODJDODIuODY0OSAxMi4wODY5IDgyLjYyMzQgMTIuMzc0IDgyLjQ1MDIgMTIuNzI5 NVYxOEg4MS4xODU1VjcuNUg4Mi40NTAyVjExLjQ5OVpNOTMuNDYyOSAxOEM5My4z OSAxNy44NTQyIDkzLjMzMDcgMTcuNTk0NCA5My4yODUyIDE3LjIyMDdDOTIuNjk3 MyAxNy44MzE0IDkxLjk5NTQgMTguMTM2NyA5MS4xNzk3IDE4LjEzNjdDOTAuNDUw NSAxOC4xMzY3IDg5Ljg1MTIgMTcuOTMxNiA4OS4zODE4IDE3LjUyMTVDODguOTE3 IDE3LjEwNjggODguNjg0NiAxNi41ODI3IDg4LjY4NDYgMTUuOTQ5MkM4OC42ODQ2 IDE1LjE3OSA4OC45NzYyIDE0LjU4MiA4OS41NTk2IDE0LjE1ODJDOTAuMTQ3NSAx My43Mjk4IDkwLjk3MjMgMTMuNTE1NiA5Mi4wMzQyIDEzLjUxNTZIOTMuMjY0NlYx Mi45MzQ2QzkzLjI2NDYgMTIuNDkyNSA5My4xMzI1IDEyLjE0MTYgOTIuODY4MiAx MS44ODE4QzkyLjYwMzggMTEuNjE3NSA5Mi4yMTQyIDExLjQ4NTQgOTEuNjk5MiAx MS40ODU0QzkxLjI0OCAxMS40ODU0IDkwLjg2OTggMTEuNTk5MyA5MC41NjQ1IDEx LjgyNzFDOTAuMjU5MSAxMi4wNTUgOTAuMTA2NCAxMi4zMzA3IDkwLjEwNjQgMTIu NjU0M0g4OC44MzVDODguODM1IDEyLjI4NTIgODguOTY0OCAxMS45Mjk3IDg5LjIy NDYgMTEuNTg3OUM4OS40ODg5IDExLjI0MTUgODkuODQ0NCAxMC45NjgxIDkwLjI5 MSAxMC43Njc2QzkwLjc0MjIgMTAuNTY3MSA5MS4yMzY3IDEwLjQ2NjggOTEuNzc0 NCAxMC40NjY4QzkyLjYyNjYgMTAuNDY2OCA5My4yOTQzIDEwLjY4MSA5My43Nzcz IDExLjEwOTRDOTQuMjYwNCAxMS41MzMyIDk0LjUxMTEgMTIuMTE4OCA5NC41Mjkz IDEyLjg2NjJWMTYuMjcwNUM5NC41MjkzIDE2Ljk0OTUgOTQuNjE1OSAxNy40ODk2 IDk0Ljc4OTEgMTcuODkwNlYxOEg5My40NjI5Wk05MS4zNjQzIDE3LjAzNjFDOTEu NzYwNyAxNy4wMzYxIDkyLjEzNjcgMTYuOTMzNiA5Mi40OTIyIDE2LjcyODVDOTIu ODQ3NyAxNi41MjM0IDkzLjEwNTEgMTYuMjU2OCA5My4yNjQ2IDE1LjkyODdWMTQu NDExMUg5Mi4yNzM0QzkwLjcyNCAxNC40MTExIDg5Ljk0OTIgMTQuODY0NiA4OS45 NDkyIDE1Ljc3MTVDODkuOTQ5MiAxNi4xNjggOTAuMDgxNCAxNi40Nzc5IDkwLjM0 NTcgMTYuNzAxMkM5MC42MSAxNi45MjQ1IDkwLjk0OTUgMTcuMDM2MSA5MS4zNjQz IDE3LjAzNjFaTTk3LjcwOCAxMC42MDM1TDk3Ljc0OSAxMS41MzMyQzk4LjMxNDEg MTAuODIyMyA5OS4wNTI0IDEwLjQ2NjggOTkuOTYzOSAxMC40NjY4QzEwMS41Mjcg MTAuNDY2OCAxMDIuMzE1IDExLjM0ODYgMTAyLjMyOSAxMy4xMTIzVjE4SDEwMS4w NjRWMTMuMTA1NUMxMDEuMDYgMTIuNTcyMyAxMDAuOTM3IDEyLjE3ODEgMTAwLjY5 NSAxMS45MjI5QzEwMC40NTggMTEuNjY3NiAxMDAuMDg3IDExLjU0IDk5LjU4MTEg MTEuNTRDOTkuMTcwOSAxMS41NCA5OC44MTA5IDExLjY0OTQgOTguNTAxIDExLjg2 ODJDOTguMTkxMSAxMi4wODY5IDk3Ljk0OTUgMTIuMzc0IDk3Ljc3NjQgMTIuNzI5 NVYxOEg5Ni41MTE3VjEwLjYwMzVIOTcuNzA4Wk0xMDMuOTM2IDE0LjI0MDJDMTAz LjkzNiAxMy4wODcyIDEwNC4yMDIgMTIuMTcxMiAxMDQuNzM1IDExLjQ5MjJDMTA1 LjI2OSAxMC44MDg2IDEwNS45NzUgMTAuNDY2OCAxMDYuODU0IDEwLjQ2NjhDMTA3 Ljc1NyAxMC40NjY4IDEwOC40NjEgMTAuNzg1OCAxMDguOTY3IDExLjQyMzhMMTA5 LjAyOCAxMC42MDM1SDExMC4xODRWMTcuODIyM0MxMTAuMTg0IDE4Ljc3OTMgMTA5 Ljg5OSAxOS41MzM1IDEwOS4zMjkgMjAuMDg1QzEwOC43NjQgMjAuNjM2NCAxMDgu MDAzIDIwLjkxMjEgMTA3LjA0NiAyMC45MTIxQzEwNi41MTMgMjAuOTEyMSAxMDUu OTkxIDIwLjc5ODIgMTA1LjQ4IDIwLjU3MDNDMTA0Ljk3IDIwLjM0MjQgMTA0LjU4 IDIwLjAzMDMgMTA0LjMxMiAxOS42MzM4TDEwNC45NjggMTguODc1QzEwNS41MSAx OS41NDQ5IDEwNi4xNzMgMTkuODc5OSAxMDYuOTU3IDE5Ljg3OTlDMTA3LjU3MiAx OS44Nzk5IDEwOC4wNTEgMTkuNzA2NyAxMDguMzkzIDE5LjM2MDRDMTA4LjczOSAx OS4wMTQgMTA4LjkxMiAxOC41MjY0IDEwOC45MTIgMTcuODk3NVYxNy4yNjE3QzEw OC40MDYgMTcuODQ1MSAxMDcuNzE2IDE4LjEzNjcgMTA2Ljg0MSAxOC4xMzY3QzEw NS45NzUgMTguMTM2NyAxMDUuMjczIDE3Ljc4ODEgMTA0LjczNSAxNy4wOTA4QzEw NC4yMDIgMTYuMzkzNiAxMDMuOTM2IDE1LjQ0MzQgMTAzLjkzNiAxNC4yNDAyWk0x MDUuMjA3IDE0LjM4MzhDMTA1LjIwNyAxNS4yMTc4IDEwNS4zNzggMTUuODc0IDEw NS43MiAxNi4zNTI1QzEwNi4wNjIgMTYuODI2NSAxMDYuNTQgMTcuMDYzNSAxMDcu MTU1IDE3LjA2MzVDMTA3Ljk1MyAxNy4wNjM1IDEwOC41MzggMTYuNzAxMiAxMDgu OTEyIDE1Ljk3NjZWMTIuNTk5NkMxMDguNTI1IDExLjg5MzIgMTA3Ljk0NCAxMS41 NCAxMDcuMTY5IDExLjU0QzEwNi41NTQgMTEuNTQgMTA2LjA3MyAxMS43NzkzIDEw NS43MjcgMTIuMjU3OEMxMDUuMzggMTIuNzM2MyAxMDUuMjA3IDEzLjQ0NSAxMDUu MjA3IDE0LjM4MzhaTTExNS4xNjcgMTguMTM2N0MxMTQuMTY0IDE4LjEzNjcgMTEz LjM0OSAxNy44MDg2IDExMi43MiAxNy4xNTIzQzExMi4wOTEgMTYuNDkxNSAxMTEu Nzc2IDE1LjYwOTcgMTExLjc3NiAxNC41MDY4VjE0LjI3NDRDMTExLjc3NiAxMy41 NDA3IDExMS45MTUgMTIuODg2NyAxMTIuMTkzIDEyLjMxMjVDMTEyLjQ3NiAxMS43 MzM3IDExMi44NjggMTEuMjgyNiAxMTMuMzY5IDEwLjk1OUMxMTMuODc1IDEwLjYz MDkgMTE0LjQyMiAxMC40NjY4IDExNS4wMSAxMC40NjY4QzExNS45NzEgMTAuNDY2 OCAxMTYuNzE5IDEwLjc4MzUgMTE3LjI1MiAxMS40MTdDMTE3Ljc4NSAxMi4wNTA1 IDExOC4wNTIgMTIuOTU3NCAxMTguMDUyIDE0LjEzNzdWMTQuNjY0MUgxMTMuMDQx QzExMy4wNTkgMTUuMzkzMiAxMTMuMjcxIDE1Ljk4MzQgMTEzLjY3NyAxNi40MzQ2 QzExNC4wODcgMTYuODgxMiAxMTQuNjA2IDE3LjEwNDUgMTE1LjIzNSAxNy4xMDQ1 QzExNS42ODIgMTcuMTA0NSAxMTYuMDYgMTcuMDEzMyAxMTYuMzcgMTYuODMxMUMx MTYuNjggMTYuNjQ4OCAxMTYuOTUxIDE2LjQwNzIgMTE3LjE4NCAxNi4xMDY0TDEx Ny45NTYgMTYuNzA4QzExNy4zMzYgMTcuNjYwNSAxMTYuNDA3IDE4LjEzNjcgMTE1 LjE2NyAxOC4xMzY3Wk0xMTUuMDEgMTEuNTA1OUMxMTQuNDk5IDExLjUwNTkgMTE0 LjA3MSAxMS42OTI3IDExMy43MjUgMTIuMDY2NEMxMTMuMzc4IDEyLjQzNTUgMTEz LjE2NCAxMi45NTUxIDExMy4wODIgMTMuNjI1SDExNi43ODdWMTMuNTI5M0MxMTYu NzUxIDEyLjg4NjcgMTE2LjU3NyAxMi4zOSAxMTYuMjY4IDEyLjAzOTFDMTE1Ljk1 OCAxMS42ODM2IDExNS41MzggMTEuNTA1OSAxMTUuMDEgMTEuNTA1OVpNMTI5LjI1 NiAxNC4zODM4QzEyOS4yNTYgMTUuNTE0IDEyOC45OTYgMTYuNDIzMiAxMjguNDc3 IDE3LjExMTNDMTI3Ljk1NyAxNy43OTQ5IDEyNy4yNiAxOC4xMzY3IDEyNi4zODUg MTguMTM2N0MxMjUuNDUxIDE4LjEzNjcgMTI0LjcyOCAxNy44MDYzIDEyNC4yMTgg MTcuMTQ1NUwxMjQuMTU2IDE4SDEyMi45OTRWNy41SDEyNC4yNTlWMTEuNDE3QzEy NC43NjkgMTAuNzgzNSAxMjUuNDczIDEwLjQ2NjggMTI2LjM3MSAxMC40NjY4QzEy Ny4yNjkgMTAuNDY2OCAxMjcuOTczIDEwLjgwNjMgMTI4LjQ4MyAxMS40ODU0QzEy OC45OTggMTIuMTY0NCAxMjkuMjU2IDEzLjA5NDEgMTI5LjI1NiAxNC4yNzQ0VjE0 LjM4MzhaTTEyNy45OTEgMTQuMjQwMkMxMjcuOTkxIDEzLjM3ODkgMTI3LjgyNSAx Mi43MTM1IDEyNy40OTIgMTIuMjQ0MUMxMjcuMTYgMTEuNzc0NyAxMjYuNjgxIDEx LjU0IDEyNi4wNTcgMTEuNTRDMTI1LjIyMyAxMS41NCAxMjQuNjIzIDExLjkyNzQg MTI0LjI1OSAxMi43MDIxVjE1LjkwMTRDMTI0LjY0NiAxNi42NzYxIDEyNS4yNSAx Ny4wNjM1IDEyNi4wNyAxNy4wNjM1QzEyNi42NzYgMTcuMDYzNSAxMjcuMTQ4IDE2 LjgyODggMTI3LjQ4NSAxNi4zNTk0QzEyNy44MjMgMTUuODkgMTI3Ljk5MSAxNS4x ODM2IDEyNy45OTEgMTQuMjQwMlpNMTMyLjIyOSAxOEgxMzAuOTY1VjcuNUgxMzIu MjI5VjE4Wk0xMzMuOTI1IDE0LjIzMzRDMTMzLjkyNSAxMy41MDg4IDEzNC4wNjYg MTIuODU3MSAxMzQuMzQ5IDEyLjI3ODNDMTM0LjYzNiAxMS42OTk1IDEzNS4wMzIg MTEuMjUyOSAxMzUuNTM4IDEwLjkzODVDMTM2LjA0OSAxMC42MjQgMTM2LjYzIDEw LjQ2NjggMTM3LjI4MSAxMC40NjY4QzEzOC4yODggMTAuNDY2OCAxMzkuMTAyIDEw LjgxNTQgMTM5LjcyMiAxMS41MTI3QzE0MC4zNDYgMTIuMjEgMTQwLjY1OCAxMy4x Mzc0IDE0MC42NTggMTQuMjk0OVYxNC4zODM4QzE0MC42NTggMTUuMTAzOCAxNDAu NTE5IDE1Ljc1MSAxNDAuMjQxIDE2LjMyNTJDMTM5Ljk2OCAxNi44OTQ5IDEzOS41 NzQgMTcuMzM5MiAxMzkuMDU5IDE3LjY1ODJDMTM4LjU0OCAxNy45NzcyIDEzNy45 NiAxOC4xMzY3IDEzNy4yOTUgMTguMTM2N0MxMzYuMjkyIDE4LjEzNjcgMTM1LjQ3 OSAxNy43ODgxIDEzNC44NTQgMTcuMDkwOEMxMzQuMjM1IDE2LjM5MzYgMTMzLjky NSAxNS40NzA3IDEzMy45MjUgMTQuMzIyM1YxNC4yMzM0Wk0xMzUuMTk2IDE0LjM4 MzhDMTM1LjE5NiAxNS4yMDQxIDEzNS4zODUgMTUuODYyNiAxMzUuNzY0IDE2LjM1 OTRDMTM2LjE0NiAxNi44NTYxIDEzNi42NTcgMTcuMTA0NSAxMzcuMjk1IDE3LjEw NDVDMTM3LjkzOCAxNy4xMDQ1IDEzOC40NDggMTYuODUzOCAxMzguODI2IDE2LjM1 MjVDMTM5LjIwNCAxNS44NDY3IDEzOS4zOTQgMTUuMTQwMyAxMzkuMzk0IDE0LjIz MzRDMTM5LjM5NCAxMy40MjIyIDEzOS4yIDEyLjc2NiAxMzguODEyIDEyLjI2NDZD MTM4LjQzIDExLjc1ODggMTM3LjkxOSAxMS41MDU5IDEzNy4yODEgMTEuNTA1OUMx MzYuNjU3IDExLjUwNTkgMTM2LjE1MyAxMS43NTQyIDEzNS43NzEgMTIuMjUxQzEz NS4zODggMTIuNzQ3NyAxMzUuMTk2IDEzLjQ1ODcgMTM1LjE5NiAxNC4zODM4Wk0x NDUuMjExIDE3LjEwNDVDMTQ1LjY2MiAxNy4xMDQ1IDE0Ni4wNTYgMTYuOTY3OCAx NDYuMzk0IDE2LjY5NDNDMTQ2LjczMSAxNi40MjA5IDE0Ni45MTggMTYuMDc5MSAx NDYuOTU0IDE1LjY2ODlIMTQ4LjE1QzE0OC4xMjggMTYuMDkyOCAxNDcuOTgyIDE2 LjQ5NjEgMTQ3LjcxMyAxNi44Nzg5QzE0Ny40NDQgMTcuMjYxNyAxNDcuMDg0IDE3 LjU2NzEgMTQ2LjYzMyAxNy43OTQ5QzE0Ni4xODYgMTguMDIyOCAxNDUuNzEyIDE4 LjEzNjcgMTQ1LjIxMSAxOC4xMzY3QzE0NC4yMDQgMTguMTM2NyAxNDMuNDAyIDE3 LjgwMTggMTQyLjgwNSAxNy4xMzE4QzE0Mi4yMTIgMTYuNDU3NCAxNDEuOTE2IDE1 LjUzNjggMTQxLjkxNiAxNC4zNzAxVjE0LjE1ODJDMTQxLjkxNiAxMy40MzgyIDE0 Mi4wNDggMTIuNzk3OSAxNDIuMzEyIDEyLjIzNzNDMTQyLjU3NyAxMS42NzY4IDE0 Mi45NTUgMTEuMjQxNSAxNDMuNDQ3IDEwLjkzMTZDMTQzLjk0NCAxMC42MjE3IDE0 NC41MyAxMC40NjY4IDE0NS4yMDQgMTAuNDY2OEMxNDYuMDM0IDEwLjQ2NjggMTQ2 LjcyMiAxMC43MTUyIDE0Ny4yNjkgMTEuMjExOUMxNDcuODIgMTEuNzA4NyAxNDgu MTE0IDEyLjM1MzUgMTQ4LjE1IDEzLjE0NjVIMTQ2Ljk1NEMxNDYuOTE4IDEyLjY2 OCAxNDYuNzM1IDEyLjI3NiAxNDYuNDA3IDExLjk3MDdDMTQ2LjA4NCAxMS42NjA4 IDE0NS42ODMgMTEuNTA1OSAxNDUuMjA0IDExLjUwNTlDMTQ0LjU2MiAxMS41MDU5 IDE0NC4wNjIgMTEuNzM4MyAxNDMuNzA3IDEyLjIwMzFDMTQzLjM1NiAxMi42NjM0 IDE0My4xODEgMTMuMzMxMSAxNDMuMTgxIDE0LjIwNjFWMTQuNDQ1M0MxNDMuMTgx IDE1LjI5NzUgMTQzLjM1NiAxNS45NTM4IDE0My43MDcgMTYuNDE0MUMxNDQuMDU4 IDE2Ljg3NDMgMTQ0LjU1OSAxNy4xMDQ1IDE0NS4yMTEgMTcuMTA0NVpNMTUxLjYz NyAxNC41NzUyTDE1MC44NDQgMTUuNDAyM1YxOEgxNDkuNTc5VjcuNUgxNTAuODQ0 VjEzLjg1MDZMMTUxLjUyMSAxMy4wMzcxTDE1My44MjQgMTAuNjAzNUgxNTUuMzYy TDE1Mi40ODQgMTMuNjkzNEwxNTUuNjk3IDE4SDE1NC4yMTRMMTUxLjYzNyAxNC41 NzUyWk0xNjEuODU2IDguODEyNVYxMC42MDM1SDE2My4yMzdWMTEuNTgxMUgxNjEu ODU2VjE2LjE2OEMxNjEuODU2IDE2LjQ2NDIgMTYxLjkxOCAxNi42ODc1IDE2Mi4w NDEgMTYuODM3OUMxNjIuMTY0IDE2Ljk4MzcgMTYyLjM3NCAxNy4wNTY2IDE2Mi42 NyAxNy4wNTY2QzE2Mi44MTYgMTcuMDU2NiAxNjMuMDE2IDE3LjAyOTMgMTYzLjI3 MSAxNi45NzQ2VjE4QzE2Mi45MzkgMTguMDkxMSAxNjIuNjE1IDE4LjEzNjcgMTYy LjMwMSAxOC4xMzY3QzE2MS43MzYgMTguMTM2NyAxNjEuMzEgMTcuOTY1OCAxNjEu MDIyIDE3LjYyNEMxNjAuNzM1IDE3LjI4MjIgMTYwLjU5MiAxNi43OTY5IDE2MC41 OTIgMTYuMTY4VjExLjU4MTFIMTU5LjI0NVYxMC42MDM1SDE2MC41OTJWOC44MTI1 SDE2MS44NTZaTTE2Ny4xNDEgMTYuMTQ3NUwxNjguODYzIDEwLjYwMzVIMTcwLjIx N0wxNjcuMjQzIDE5LjE0MTZDMTY2Ljc4MyAyMC4zNzIxIDE2Ni4wNTEgMjAuOTg3 MyAxNjUuMDQ5IDIwLjk4NzNMMTY0LjgxIDIwLjk2NjhMMTY0LjMzOCAyMC44Nzc5 VjE5Ljg1MjVMMTY0LjY4IDE5Ljg3OTlDMTY1LjEwOCAxOS44Nzk5IDE2NS40NDEg MTkuNzkzMyAxNjUuNjc4IDE5LjYyMDFDMTY1LjkxOSAxOS40NDY5IDE2Ni4xMTgg MTkuMTMwMiAxNjYuMjcyIDE4LjY2OTlMMTY2LjU1MyAxNy45MThMMTYzLjkxNCAx MC42MDM1SDE2NS4yOTVMMTY3LjE0MSAxNi4xNDc1Wk0xNzcuNiAxNC4zODM4QzE3 Ny42IDE1LjUwOTQgMTc3LjM0MiAxNi40MTYzIDE3Ni44MjcgMTcuMTA0NUMxNzYu MzEyIDE3Ljc5MjYgMTc1LjYxNSAxOC4xMzY3IDE3NC43MzUgMTguMTM2N0MxNzMu ODM4IDE4LjEzNjcgMTczLjEzMSAxNy44NTE5IDE3Mi42MTYgMTcuMjgyMlYyMC44 NDM4SDE3MS4zNTJWMTAuNjAzNUgxNzIuNTA3TDE3Mi41NjggMTEuNDIzOEMxNzMu MDgzIDEwLjc4NTggMTczLjc5OSAxMC40NjY4IDE3NC43MTUgMTAuNDY2OEMxNzUu NjA0IDEwLjQ2NjggMTc2LjMwNSAxMC44MDE4IDE3Ni44MiAxMS40NzE3QzE3Ny4z NCAxMi4xNDE2IDE3Ny42IDEzLjA3MzYgMTc3LjYgMTQuMjY3NlYxNC4zODM4Wk0x NzYuMzM1IDE0LjI0MDJDMTc2LjMzNSAxMy40MDYyIDE3Ni4xNTcgMTIuNzQ3NyAx NzUuODAyIDEyLjI2NDZDMTc1LjQ0NiAxMS43ODE2IDE3NC45NTkgMTEuNTQgMTc0 LjMzOSAxMS41NEMxNzMuNTczIDExLjU0IDE3Mi45OTkgMTEuODc5NiAxNzIuNjE2 IDEyLjU1ODZWMTYuMDkyOEMxNzIuOTk0IDE2Ljc2NzMgMTczLjU3MyAxNy4xMDQ1 IDE3NC4zNTMgMTcuMTA0NUMxNzQuOTU5IDE3LjEwNDUgMTc1LjQzOSAxNi44NjUy IDE3NS43OTUgMTYuMzg2N0MxNzYuMTU1IDE1LjkwMzYgMTc2LjMzNSAxNS4xODgy IDE3Ni4zMzUgMTQuMjQwMlpNMTgyLjI4MiAxOC4xMzY3QzE4MS4yOCAxOC4xMzY3 IDE4MC40NjQgMTcuODA4NiAxNzkuODM1IDE3LjE1MjNDMTc5LjIwNiAxNi40OTE1 IDE3OC44OTIgMTUuNjA5NyAxNzguODkyIDE0LjUwNjhWMTQuMjc0NEMxNzguODky IDEzLjU0MDcgMTc5LjAzMSAxMi44ODY3IDE3OS4zMDkgMTIuMzEyNUMxNzkuNTkx IDExLjczMzcgMTc5Ljk4MyAxMS4yODI2IDE4MC40ODQgMTAuOTU5QzE4MC45OSAx MC42MzA5IDE4MS41MzcgMTAuNDY2OCAxODIuMTI1IDEwLjQ2NjhDMTgzLjA4NyAx MC40NjY4IDE4My44MzQgMTAuNzgzNSAxODQuMzY3IDExLjQxN0MxODQuOSAxMi4w NTA1IDE4NS4xNjcgMTIuOTU3NCAxODUuMTY3IDE0LjEzNzdWMTQuNjY0MUgxODAu MTU2QzE4MC4xNzQgMTUuMzkzMiAxODAuMzg2IDE1Ljk4MzQgMTgwLjc5MiAxNi40 MzQ2QzE4MS4yMDIgMTYuODgxMiAxODEuNzIyIDE3LjEwNDUgMTgyLjM1MSAxNy4x MDQ1QzE4Mi43OTcgMTcuMTA0NSAxODMuMTc1IDE3LjAxMzMgMTgzLjQ4NSAxNi44 MzExQzE4My43OTUgMTYuNjQ4OCAxODQuMDY2IDE2LjQwNzIgMTg0LjI5OSAxNi4x MDY0TDE4NS4wNzEgMTYuNzA4QzE4NC40NTEgMTcuNjYwNSAxODMuNTIyIDE4LjEz NjcgMTgyLjI4MiAxOC4xMzY3Wk0xODIuMTI1IDExLjUwNTlDMTgxLjYxNSAxMS41 MDU5IDE4MS4xODYgMTEuNjkyNyAxODAuODQgMTIuMDY2NEMxODAuNDkzIDEyLjQz NTUgMTgwLjI3OSAxMi45NTUxIDE4MC4xOTcgMTMuNjI1SDE4My45MDJWMTMuNTI5 M0MxODMuODY2IDEyLjg4NjcgMTgzLjY5MyAxMi4zOSAxODMuMzgzIDEyLjAzOTFD MTgzLjA3MyAxMS42ODM2IDE4Mi42NTQgMTEuNTA1OSAxODIuMTI1IDExLjUwNTla IiBmaWxsPSIjNkI3MjgwIi8+Cjwvc3ZnPgo=");\n position: absolute;\n top: -2px;\n height: 0;\n pointer-events: none;\n}\n.neeto-editor {\n max-width: 100% !important;\n border-radius: var(--neeto-ui-rounded);\n white-space: pre-wrap;\n padding: 12px;\n color: rgb(var(--neeto-ui-gray-800));\n}\n.neeto-editor:focus {\n outline: none;\n}\n.neeto-editor a {\n pointer-events: none;\n}\n.neeto-editor mark {\n background: rgb(var(--neeto-ui-pastel-green));\n border-radius: var(--neeto-ui-rounded-sm);\n padding: 0px 4px;\n color: inherit;\n}\n.neeto-editor [data-variable] {\n display: inline-flex;\n color: rgb(var(--neeto-ui-gray-700));\n background-color: rgb(var(--neeto-ui-gray-200));\n border-radius: var(--neeto-ui-rounded-sm);\n line-height: 1;\n padding: 4px 6px;\n}\n.neeto-editor .ProseMirror-separator {\n display: none;\n}\n.neeto-editor.fixed-menu-active {\n border: thin solid rgb(var(--neeto-ui-gray-300));\n border-radius: 0px 0px var(--neeto-ui-rounded) var(--neeto-ui-rounded);\n}\n.neeto-editor .is-empty {\n position: relative;\n}\n.neeto-editor.placeholder-active:not(.force-title) .is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title h1:first-child {\n position: relative;\n margin-bottom: 20px;\n}\n.neeto-editor.force-title .is-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title.placeholder-active .is-empty:nth-child(2):last-child:before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title.force-title--error .is-empty:first-child::after {\n position: absolute;\n content: "Title can\'t be blank";\n left: 0;\n bottom: -12px;\n color: rgb(var(--neeto-ui-error));\n pointer-events: none;\n font-size: 12px;\n}\n.neeto-editor hr {\n margin: 8px 0;\n}\n.neeto-editor .ProseMirror-selectednode {\n outline: 3px solid rgb(var(--neeto-ui-pastel-blue));\n}\n.neeto-editor .has-focus {\n background: var(--focus-background-color);\n transition: background-color 200ms ease;\n}\n.neeto-editor-character-count {\n padding: 4px;\n color: rgb(var(--neeto-ui-gray-600));\n font-size: 12px;\n text-align: right;\n}\n.neeto-editor-error {\n color: rgb(var(--neeto-ui-error-500));\n border-width: 1px;\n border-color: rgb(var(--neeto-ui-error-500));\n border-radius: var(--neeto-ui-rounded);\n}\n.neeto-editor-error:focus-within {\n border-color: rgb(var(--neeto-ui-error-600));\n}\n.neeto-editor-content, .neeto-editor {\n white-space: pre-wrap;\n word-break: break-word;\n}\n.neeto-editor-content h1, .neeto-editor h1,\n.neeto-editor-content h2,\n.neeto-editor h2,\n.neeto-editor-content h3,\n.neeto-editor h3,\n.neeto-editor-content h4,\n.neeto-editor h4,\n.neeto-editor-content h5,\n.neeto-editor h5,\n.neeto-editor-content h6,\n.neeto-editor h6 {\n font-size: revert;\n margin: 16px 0;\n}\n.neeto-editor-content p, .neeto-editor p {\n line-height: var(--neeto-ui-leading-normal);\n color: rgb(var(--neeto-ui-gray-700));\n margin-bottom: 8px;\n}\n.neeto-editor-content p:empty::after, .neeto-editor p:empty::after {\n content: " ";\n}\n.neeto-editor-content p:last-child, .neeto-editor p:last-child {\n margin-bottom: 0;\n}\n.neeto-editor-content code, .neeto-editor code {\n padding: 0.2em 0.4em;\n font-size: 85%;\n border-radius: 6px;\n background-color: rgba(175, 184, 193, 0.2);\n font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;\n}\n.neeto-editor-content pre, .neeto-editor pre {\n background-color: #f6f8fa;\n overflow-x: auto;\n font-size: 14px;\n line-height: 20px;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: var(--neeto-ui-rounded-sm);\n padding: 16px;\n}\n.neeto-editor-content pre > code, .neeto-editor pre > code {\n background-color: transparent;\n border-width: 0;\n border-radius: 0;\n padding: 0;\n font-weight: 400;\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n line-height: inherit;\n}\n.neeto-editor-content blockquote, .neeto-editor blockquote {\n font-weight: var(--neeto-ui-font-medium);\n color: rgb(var(--neeto-ui-black));\n border-left-width: 4px;\n border-left-color: #e5e7eb;\n quotes: "“" "”" "‘" "’";\n margin: 8px 0;\n padding-left: 12px;\n}\n.neeto-editor-content blockquote > p::before, .neeto-editor blockquote > p::before {\n content: "" !important;\n}\n.neeto-editor-content blockquote > p::after, .neeto-editor blockquote > p::after {\n content: "" !important;\n}\n.neeto-editor-content ul, .neeto-editor ul,\n.neeto-editor-content ol,\n.neeto-editor ol {\n list-style: revert;\n margin: revert;\n padding: revert;\n}\n.neeto-editor-content ul > li > p, .neeto-editor ul > li > p,\n.neeto-editor-content ol > li > p,\n.neeto-editor ol > li > p {\n margin-top: 0 !important;\n margin-bottom: 0.375rem !important;\n}\n.neeto-editor-content ul li::before, .neeto-editor ul li::before,\n.neeto-editor-content ol li::before,\n.neeto-editor ol li::before {\n background-color: rgb(var(--neeto-ui-black));\n}\n.neeto-editor-content a[href], .neeto-editor a[href] {\n color: rgb(var(--neeto-ui-primary-800));\n font-weight: 500;\n}\n.neeto-editor-content .video-wrapper, .neeto-editor .video-wrapper {\n width: 560px;\n height: 315px;\n margin: auto;\n}\n.neeto-editor-content mark, .neeto-editor mark {\n background: rgb(var(--neeto-ui-pastel-green));\n border-radius: var(--neeto-ui-rounded-sm);\n padding: 0px 4px;\n color: inherit;\n}\n.neeto-editor-content [data-variable], .neeto-editor [data-variable] {\n display: inline-flex;\n color: rgb(var(--neeto-ui-gray-700));\n background-color: rgb(var(--neeto-ui-gray-200));\n border-radius: var(--neeto-ui-rounded-sm);\n line-height: 1;\n padding: 4px 6px;\n}\n.neeto-editor-content [data-type=mention], .neeto-editor [data-type=mention] {\n color: rgb(var(--neeto-ui-primary-800));\n}\n.neeto-editor-content--hidden {\n display: none;\n}\n.neeto-editor__image {\n display: inline-block;\n border: 1.5px solid rgb(var(--neeto-ui-pastel-blue));\n margin: 0 12px;\n}\n.neeto-editor__image figure {\n margin: 16px 12px;\n outline: none;\n}\n.neeto-editor__image figure img {\n height: 100%;\n width: 100%;\n -webkit-user-select: auto;\n -moz-user-select: auto;\n user-select: auto;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.neeto-editor__image figure figcaption {\n color: rgb(var(--neeto-ui-gray-700));\n text-align: center;\n}\n.neeto-editor__image-defaults {\n width: -moz-fit-content;\n width: fit-content;\n}\n.neeto-editor__image--none {\n display: flex;\n justify-content: center;\n}\n.neeto-editor__image--left {\n float: left;\n margin-left: 0;\n}\n.neeto-editor__image--right {\n float: right;\n margin-right: 0;\n}\n.neeto-editor__image--center {\n margin: 0 auto;\n}\n.neeto-editor-fixed-menu {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n overflow-x: auto;\n border: thin solid rgb(var(--neeto-ui-gray-300));\n border-bottom: none;\n border-radius: var(--neeto-ui-rounded) var(--neeto-ui-rounded) 0px 0px;\n background-color: rgb(var(--neeto-ui-gray-100));\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding: 10px;\n cursor: pointer;\n transition: var(--neeto-ui-transition);\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item:hover, .neeto-editor-fixed-menu .neeto-editor-fixed-menu__item.active {\n background-color: rgb(var(--neeto-ui-gray-200));\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item input[type=color] {\n visibility: hidden;\n height: 0;\n width: 0;\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu-addons {\n display: flex;\n align-items: center;\n margin-left: auto;\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__emoji-dropdown {\n max-height: unset;\n}\n.neeto-editor-variables-suggestion {\n padding: 4px 0;\n}\n.neeto-editor-variables-list {\n padding: 4px 8px;\n min-width: 184px;\n max-width: 360px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block:not(:last-child) {\n margin-bottom: 12px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block h6 {\n font-size: var(--neeto-ui-text-xs);\n font-weight: var(--neeto-ui-font-medium);\n color: rgb(var(--neeto-ui-gray-600));\n margin-bottom: 4px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row .neeto-editor-variable {\n padding: 4px 6px;\n font-size: var(--neeto-ui-text-xs);\n color: rgb(var(--neeto-ui-gray-700));\n line-height: 1;\n background-color: rgb(var(--neeto-ui-pastel-blue));\n border-radius: var(--neeto-ui-rounded-sm);\n transition: var(--neeto-ui-transition);\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row .neeto-editor-variable:hover {\n background-color: rgb(var(--neeto-ui-info-100));\n}\n.neeto-editor-link-wrapper .ne-dropdown__popup {\n padding: 8px;\n width: 100%;\n max-width: 400px;\n}\n.neeto-editor-link-wrapper .ne-dropdown__popup .neeto-editor-link__item {\n display: flex !important;\n flex-direction: row;\n justify-content: flex-start;\n align-items: flex-start;\n gap: 8px;\n}\n.neeto-editor-font-size-wrapper .ne-dropdown__popup-menu {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n padding: 4px;\n}\n.neeto-editor-bubble-menu {\n position: relative;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n border-radius: var(--neeto-ui-rounded);\n background: rgb(var(--neeto-ui-gray-800));\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__item {\n padding: 8px;\n cursor: pointer;\n transition: var(--neeto-ui-transition);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__item:hover, .neeto-editor-bubble-menu .neeto-editor-bubble-menu__item:active, .neeto-editor-bubble-menu .neeto-editor-bubble-menu__item.active {\n background-color: rgb(var(--neeto-ui-gray-700));\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__item:first-child {\n border-top-left-radius: var(--neeto-ui-rounded);\n border-bottom-left-radius: var(--neeto-ui-rounded);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__item:last-child {\n border-top-right-radius: var(--neeto-ui-rounded);\n border-bottom-right-radius: var(--neeto-ui-rounded);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link {\n display: flex;\n align-items: center;\n padding: 8px;\n gap: 8px;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input {\n background-color: transparent;\n outline: none;\n line-height: 20px;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input::-moz-placeholder {\n color: rgba(var(--neeto-ui-white, 0.4));\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input::placeholder {\n color: rgba(var(--neeto-ui-white, 0.4));\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .ne-btn--icon-only {\n padding: 0;\n min-height: 0;\n opacity: 0.8;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .ne-btn--icon-only:hover {\n opacity: 1;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__dropdown-target {\n display: flex;\n align-items: center;\n gap: 4px;\n white-space: nowrap;\n font-size: var(--neeto-ui-text-sm);\n line-height: var(--neeto-ui-leading-normal);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__dropdown {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__dropdown .neeto-editor-bubble-menu__dropdown-item {\n width: 100%;\n text-align: left;\n padding: 8px 12px;\n font-size: var(--neeto-ui-text-xs);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__dropdown .neeto-editor-bubble-menu__dropdown-item:first-child {\n border-top-left-radius: var(--neeto-ui-rounded);\n border-top-right-radius: var(--neeto-ui-rounded);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__dropdown .neeto-editor-bubble-menu__dropdown-item:last-child {\n border-bottom-left-radius: var(--neeto-ui-rounded);\n border-bottom-right-radius: var(--neeto-ui-rounded);\n}\n.neeto-editor-bubble-menu-animate-shake {\n animation: 1s linear infinite alternate both shake;\n}\n.neeto-editor-image-uploader {\n display: flex;\n flex-direction: column;\n min-height: 184px;\n}\n.neeto-editor-image-uploader .ne-tab__wrapper .ne-tab {\n min-width: 88px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__content {\n flex-grow: 1;\n display: flex;\n padding: 16px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n text-align: center;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress-title, .neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-label {\n color: rgb(var(--neeto-ui-gray-700));\n font-size: var(--neeto-ui-text-sm);\n margin-bottom: 4px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress-file, .neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-note {\n color: rgb(var(--neeto-ui-gray-400));\n font-size: var(--neeto-ui-text-xs);\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n border: 1px dashed rgb(var(--neeto-ui-gray-400));\n box-sizing: border-box;\n border-radius: var(--neeto-ui-rounded);\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-Root {\n width: 100%;\n height: 100%;\n background-color: rgb(var(--neeto-ui-white));\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-Root::-moz-focus-inner {\n border: 0;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-inner {\n display: flex;\n flex-direction: column;\n justify-content: center;\n line-height: 1.4;\n text-align: center;\n font-weight: var(--neeto-ui-font-normal);\n margin: 0;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-arrow {\n visibility: hidden;\n display: none;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop--isDraggingOver {\n background-color: rgb(var(--neeto-ui-gray-200));\n border: 2px dashed rgb(var(--neeto-ui-secondary-indigo));\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-browse {\n color: rgb(var(--neeto-ui-secondary-indigo));\n font-size: var(--neeto-ui-text-sm);\n font-weight: var(--neeto-ui-font-semibold);\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd--error {\n color: rgb(var(--neeto-ui-error));\n font-size: var(--neeto-ui-text-xs);\n margin-top: 12px;\n text-align: center;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper {\n width: 100%;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .ne-input__wrapper {\n width: 100%;\n flex-grow: 0;\n margin-bottom: 16px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container {\n max-height: 50vh;\n overflow-y: auto;\n overflow-x: hidden;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery {\n width: 100%;\n right: -8px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item {\n width: 33.3%;\n padding-right: 16px;\n padding-bottom: 16px;\n float: left;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder {\n width: 100%;\n position: relative;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner {\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: rgb(var(--neeto-ui-gray-100));\n border-radius: var(--neeto-ui-rounded-sm);\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner img {\n height: 100%;\n width: 100%;\n -o-object-fit: cover;\n object-fit: cover;\n animation: fade-in 1.2s 1s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n border-radius: var(--neeto-ui-rounded);\n position: relative;\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner a {\n opacity: 0;\n position: absolute;\n left: 8px;\n bottom: 8px;\n margin: auto;\n color: rgb(var(--neeto-ui-white));\n font-size: 12px;\n font-weight: var(--neeto-ui-font-normal);\n line-height: 1;\n text-transform: capitalize;\n transition: var(--neeto-ui-transition);\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner a:hover {\n text-decoration: underline;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner:hover a {\n opacity: 1;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__text {\n font-size: var(--neeto-ui-text-xs);\n color: rgb(var(--neeto-ui-gray-800));\n text-align: center;\n margin-top: 12px;\n}\n.neeto-editor-progress-bar__wrapper {\n width: 100%;\n max-width: 256px;\n margin-top: 10px;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__percent {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__percent p {\n font-size: var(--neeto-ui-text-xs);\n color: rgb(var(--neeto-ui-gray-800));\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__indicator {\n position: relative;\n width: 100%;\n height: 6px;\n border-radius: var(--neeto-ui-rounded-full);\n overflow: hidden;\n background-color: rgba(var(--neeto-ui-secondary-indigo, 0.2));\n margin-top: 4px;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__indicator-inner {\n height: 100%;\n background-color: rgb(var(--neeto-ui-secondary-indigo));\n}\n.neeto-editor-url-form__wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n padding: 0 24px;\n}\n.neeto-editor-url-form__wrapper .ne-input__wrapper {\n width: 100%;\n flex-grow: 0;\n margin-bottom: 16px;\n}\n.neeto-editor-emoji {\n font-family: apple color emoji, segoe ui emoji, noto color emoji, android emoji, emojisymbols, emojione mozilla, twemoji mozilla, segoe ui symbol;\n}\n.emoji-mart.emoji-mart-light {\n font-size: 14px;\n color: rgb(var(--neeto-ui-gray-800));\n border: none;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor {\n color: rgb(var(--neeto-ui-gray-500));\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor svg {\n margin: auto;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor .emoji-mart-anchor-bar {\n background-color: rgb(var(--neeto-ui-gray-800)) !important;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor.emoji-mart-anchor-selected {\n color: rgb(var(--neeto-ui-gray-800)) !important;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-search input {\n border-radius: var(--neeto-ui-rounded-sm);\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-category-label span {\n padding-top: 8px;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-emoji span {\n cursor: pointer;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-emoji:hover::before {\n background-color: rgb(var(--neeto-ui-gray-200));\n border-radius: var(--neeto-ui-rounded-sm);\n}\n.emoji-mart.emoji-mart-light .emoji-mart-scroll {\n height: 264px;\n padding-bottom: 0px;\n}\n.neeto-editor-emoji-suggestion {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n padding: 4px;\n gap: 2px;\n font-family: apple color emoji, segoe ui emoji, noto color emoji, android emoji, emojisymbols, emojione mozilla, twemoji mozilla, segoe ui symbol;\n}\n.neeto-editor-emoji-suggestion p {\n font-size: var(--neeto-ui-text-xs);\n color: rgb(var(--neeto-ui-gray-800));\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item {\n padding: 6px;\n font-size: var(--neeto-ui-text-2xl);\n transition: var(--neeto-ui-transition);\n border-radius: var(--neeto-ui-rounded-sm);\n line-height: 1;\n cursor: pointer;\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item:hover {\n background-color: rgb(var(--neeto-ui-gray-200));\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item--selected {\n background-color: rgb(var(--neeto-ui-gray-200));\n}\n.neeto-editor-image-editor {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1.25rem;\n}\n.neeto-editor-image-editor figure {\n display: flex;\n flex-direction: column;\n justify-content: center;\n min-height: 208px;\n max-height: 400px;\n height: -moz-fit-content;\n height: fit-content;\n}\n.neeto-editor-image-editor figure img {\n height: 100%;\n width: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.neeto-editor-image-editor__error {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n text-align: center;\n min-height: 288px;\n max-height: 400px;\n width: 100%;\n padding: 24px;\n background: rgb(var(--neeto-ui-gray-100));\n border-radius: var(--neeto-ui-rounded-sm);\n gap: 8px;\n}\n.neeto-editor-image-editor__error h2 {\n font-size: var(--neeto-ui-text-lg);\n font-weight: var(--neeto-ui-font-medium);\n}\n.neeto-editor-image-editor .ne-input__wrapper {\n width: 100%;\n}\n.neeto-editor-image-editor .neeto-editor-image-editor__footer {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 0.5rem;\n}\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;\n}\n.ProseMirror {\n overflow-y: auto;\n height: 100%;\n white-space: break-spaces;\n}\n.ProseMirror:focus {\n outline: none;\n}',{}),A.prototype={constructor:A,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var i=n&&n!=e?this.remove(n):this,o=i.find(e),r=i.content.slice();return-1==o?r.push(n||e,t):(r[o+1]=t,n&&(r[o]=n)),new A(r)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new A(n)},addToStart:function(e,t){return new A([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new A(n)},addBefore:function(e,t,n){var i=this.remove(t),o=i.content.slice(),r=i.find(e);return o.splice(-1==r?o.length:r,0,t,n),new A(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=A.from(e)).size?new A(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=A.from(e)).size?new A(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=A.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}},A.from=function(e){if(e instanceof A)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new A(t)};class z{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,i=0,o){for(let r=0,s=0;s<t;r++){let a=this.content[r],l=s+a.nodeSize;if(l>e&&!1!==n(a,i+s,o||null,r)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,e-o),Math.min(a.content.size,t-o),n,i+o)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let o="",r=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(o+=s.text.slice(Math.max(e,a)-a,t-a),r=!n):s.isLeaf?(i?o+="function"==typeof i?i(s):i:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),r=!n):!r&&s.isBlock&&(o+=n,r=!0)}),0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new z(i,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],i=0;if(t>e)for(let o=0,r=0;r<t;o++){let s=this.content[o],a=r+s.nodeSize;a>e&&((r<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-r),Math.min(s.text.length,t-r)):s.cut(Math.max(0,e-r-1),Math.min(s.content.size,t-r-1))),n.push(s),i+=s.nodeSize),r=a}return new z(n,i)}cutByIndex(e,t){return e==t?z.empty:0==e&&t==this.content.length?this:new z(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new z(i,o)}addToStart(e){return new z([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new z(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 i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return j(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return I(this,e,t,n)}findIndex(e,t=-1){if(0==e)return R(0,e);if(e==this.size)return R(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let o=i+this.child(n).nodeSize;if(o>=e)return o==e||t>0?R(n+1,o):R(n,i);i=o}}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 z.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new z(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return z.empty;let t,n=0;for(let i=0;i<e.length;i++){let o=e[i];n+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new z(t||e,n)}static from(e){if(!e)return z.empty;if(e instanceof z)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new z([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}z.empty=new z([],0);const L={index:0,offset:0};function R(e,t){return L.index=e,L.offset=t,L}function F(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(!F(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!F(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class P{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(o)}}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&&F(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 P.none;if(e instanceof P)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}P.none=[];class B extends Error{}class U{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=H(this.content,e+this.openStart,t);return n&&new U(n,this.openStart,this.openEnd)}removeBetween(e,t){return new U($(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 U.empty;let n=t.openStart||0,i=t.openEnd||0;if("number"!=typeof n||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new U(z.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)i++;return new U(e,n,i)}}function $(e,t,n){let{index:i,offset:o}=e.findIndex(t),r=e.maybeChild(i),{index:s,offset:a}=e.findIndex(n);if(o==t||r.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(i,r.copy($(r.content,t-o-1,n-o-1)))}function H(e,t,n,i){let{index:o,offset:r}=e.findIndex(t),s=e.maybeChild(o);if(r==t||s.isText)return i&&!i.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=H(s.content,t-r-1,n);return a&&e.replaceChild(o,s.copy(a))}function V(e,t,n){if(n.openStart>e.depth)throw new B("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new B("Inconsistent open depths");return q(e,t,n,0)}function q(e,t,n,i){let o=e.index(i),r=e.node(i);if(o==t.index(i)&&i<e.depth-n.openStart){let s=q(e,t,n,i+1);return r.copy(r.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=i||t.depth!=i){let{start:o,end:s}=function(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)i=t.node(e).copy(z.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}(n,e);return G(r,J(e,o,s,t,i))}{let i=e.parent,o=i.content;return G(i,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}}return G(r,Z(e,t,i))}function W(e,t){if(!t.type.compatibleContent(e.type))throw new B("Cannot join "+t.type.name+" onto "+e.type.name)}function K(e,t,n){let i=e.node(n);return W(i,t.node(n)),i}function Y(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 Q(e,t,n,i){let o=(t||e).node(n),r=0,s=t?t.index(n):o.childCount;e&&(r=e.index(n),e.depth>n?r++:e.textOffset&&(Y(e.nodeAfter,i),r++));for(let e=r;e<s;e++)Y(o.child(e),i);t&&t.depth==n&&t.textOffset&&Y(t.nodeBefore,i)}function G(e,t){if(!e.type.validContent(t))throw new B("Invalid content for node "+e.type.name);return e.copy(t)}function J(e,t,n,i,o){let r=e.depth>o&&K(e,t,o+1),s=i.depth>o&&K(n,i,o+1),a=[];return Q(null,e,o,a),r&&s&&t.index(o)==n.index(o)?(W(r,s),Y(G(r,J(e,t,n,i,o+1)),a)):(r&&Y(G(r,Z(e,t,o+1)),a),Q(t,n,o,a),s&&Y(G(s,Z(n,i,o+1)),a)),Q(i,null,o,a),new z(a)}function Z(e,t,n){let i=[];if(Q(null,e,n,i),e.depth>n){Y(G(K(e,t,n+1),Z(e,t,n+1)),i)}return Q(t,null,n,i),new z(i)}U.empty=new U(z.empty,0,0);class X{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],i=e.child(t);return n?e.child(t).cut(n):i}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],i=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)i+=n.child(t).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return P.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let e=n;n=i,i=e}let o=n.marks;for(var r=0;r<o.length;r++)!1!==o[r].type.spec.inclusive||i&&o[r].isInSet(i.marks)||(o=o[r--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||i&&n[o].isInSet(i.marks)||(n=n[o--].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 ie(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=[],i=0,o=t;for(let t=e;;){let{index:e,offset:r}=t.content.findIndex(o),s=o-r;if(n.push(t,e,i+r),!s)break;if(t=t.child(e),t.isText)break;o=s-1,i+=r+1}return new X(t,n,o)}static resolveCached(e,t){for(let n=0;n<ee.length;n++){let i=ee[n];if(i.pos==t&&i.doc==e)return i}let n=ee[te]=X.resolve(e,t);return te=(te+1)%ne,n}}let ee=[],te=0,ne=12;class ie{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 oe=Object.create(null);class re{constructor(e,t,n,i=P.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||z.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,i=0){this.content.nodesBetween(e,t,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,i){return this.content.textBetween(e,t,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&F(this.attrs,t||e.defaultAttrs||oe)&&P.sameSet(this.marks,n||P.none)}copy(e=null){return e==this.content?this:new re(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new re(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 U.empty;let i=this.resolve(e),o=this.resolve(t),r=n?0:i.sharedDepth(t),s=i.start(r),a=i.node(r).content.cut(i.pos-s,o.pos-s);return new U(a,i.depth-r,o.depth-r)}replace(e,t,n){return V(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+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 i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return X.resolveCached(this,e)}resolveNoCache(e){return X.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(i=!0),!i))),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),ae(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=z.empty,i=0,o=n.childCount){let r=this.contentMatchAt(e).matchFragment(n,i,o),s=r&&r.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=i;e<o;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(n),r=o&&o.matchFragment(this.content,t);return!!r&&r.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){if(!this.type.validContent(this.content))throw new RangeError(`Invalid content for node ${this.type.name}: ${this.content.toString().slice(0,50)}`);let e=P.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!P.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 i=z.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,n)}}re.prototype.text=void 0;class se extends re{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ae(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 se(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new se(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 ae(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class le{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new ce(e,t);if(null==n.next)return le.empty;let i=pe(n);n.next&&n.err("Unexpected trailing text");let o=function(e){let t=Object.create(null);return n(ge(e,0));function n(i){let o=[];i.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let i;for(let e=0;e<o.length;e++)o[e][0]==t&&(i=o[e][1]);ge(e,n).forEach((e=>{i||o.push([t,i=[]]),-1==i.indexOf(e)&&i.push(e)}))}))}));let r=t[i.join(",")]=new le(i.indexOf(e.length-1)>-1);for(let e=0;e<o.length;e++){let i=o[e][1].sort(fe);r.next.push({type:o[e][0],next:t[i.join(",")]||n(i)})}return r}}(function(e){let t=[[]];return o(r(e,0),n()),t;function n(){return t.push([])-1}function i(e,n,i){let o={term:i,to:n};return t[e].push(o),o}function o(e,t){e.forEach((e=>e.to=t))}function r(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(r(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return i(t,s),o(r(e.expr,s),s),[i(s)]}if("plus"==e.type){let s=n();return o(r(e.expr,t),s),o(r(e.expr,s),s),[i(s)]}if("opt"==e.type)return[i(t)].concat(r(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();o(r(e.expr,s),t),s=t}if(-1==e.max)o(r(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();i(s,t),o(r(e.expr,s),t),s=t}return[i(s)]}if("name"==e.type)return[i(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let i=0;;i++){let s=r(e.exprs[i],t);if(i==e.exprs.length-1)return s;o(s,t=n())}}}(i));return function(e,t){for(let n=0,i=[e];n<i.length;n++){let e=i[n],o=!e.validEnd,r=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];r.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==i.indexOf(s)&&i.push(s)}o&&t.err("Only non-generatable nodes ("+r.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}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 i=this;for(let o=t;i&&o<n;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return 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 i=[this];return function o(r,s){let a=r.matchFragment(e,n);if(a&&(!t||a.validEnd))return z.from(s.map((e=>e.createAndFill())));for(let e=0;e<r.next.length;e++){let{type:t,next:n}=r.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==i.indexOf(n)){i.push(n);let e=o(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),o=i.match;if(o.matchType(e)){let e=[];for(let t=i;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<o.next.length;e++){let{type:r,next:s}=o.next[e];r.isLeaf||r.hasRequiredAttrs()||r.name in t||i.type&&!s.validEnd||(n.push({match:r.contentMatch,type:r,via:i}),t[r.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 i=0;i<n.next.length;i++)-1==e.indexOf(n.next[i].next)&&t(n.next[i].next)}(this),e.map(((t,n)=>{let i=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)i+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return i})).join("\n")}}le.empty=new le(!0);class ce{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 pe(e){let t=[];do{t.push(ue(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function ue(e){let t=[];do{t.push(de(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function de(e){let t=function(e){if(e.eat("(")){let t=pe(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let o=[];for(let e in n){let i=n[e];i.groups.indexOf(t)>-1&&o.push(i)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(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=me(e,t)}return t}function he(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function me(e,t){let n=he(e),i=n;return e.eat(",")&&(i="}"!=e.next?he(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function fe(e,t){return t-e}function ge(e,t){let n=[];return function t(i){let o=e[i];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(i);for(let e=0;e<o.length;e++){let{term:i,to:r}=o[e];i||-1!=n.indexOf(r)||t(r)}}(t),n.sort(fe)}function be(e){let t=Object.create(null);for(let n in e){let i=e[n];if(!i.hasDefault)return null;t[n]=i.default}return t}function ve(e,t){let n=Object.create(null);for(let i in e){let o=t&&t[i];if(void 0===o){let t=e[i];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+i);o=t.default}n[i]=o}return n}function ye(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new we(e[n]);return t}class xe{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=ye(n.attrs),this.defaultAttrs=be(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==le.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:ve(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new re(this,this.computeAttrs(e),z.from(t),P.setFrom(n))}createChecked(e=null,t,n){if(t=z.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new re(this,this.computeAttrs(e),t,P.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=z.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(z.empty,!0);return o?new re(this,e,t.append(o),P.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}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:P.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,i)=>n[e]=new xe(e,t,i)));let i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");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 we{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class ke{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=ye(i.attrs),this.excluded=null;let o=be(this.attrs);this.instance=o?new P(this,o):null}create(e=null){return!e&&this.instance?this.instance:new P(this,ve(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach(((e,o)=>n[e]=new ke(e,i++,t,o))),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 Ee{constructor(e){this.cached=Object.create(null),this.spec={nodes:A.from(e.nodes),marks:A.from(e.marks||{}),topNode:e.topNode},this.nodes=xe.compile(this.spec.nodes,this),this.marks=ke.compile(this.spec.marks,this);let t=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 n=this.nodes[e],i=n.spec.content||"",o=n.spec.marks;n.contentMatch=t[i]||(t[i]=le.parse(i,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet="_"==o?null:o?_e(this,o.split(" ")):""!=o&&n.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:_e(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,i){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof xe))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,i)}text(e,t){let n=this.nodes.text;return new se(n,n.defaultAttrs,e,P.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return re.fromJSON(this,e)}markFromJSON(e){return P.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function _e(e,t){let n=[];for(let i=0;i<t.length;i++){let o=t[i],r=e.marks[o],s=r;if(r)n.push(r);else for(let t in e.marks){let i=e.marks[t];("_"==o||i.spec.group&&i.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=i)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}class Me{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 Ie(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Ie(this,t,!0);return n.addAll(e,t.from,t.to),U.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let n=this.tags[i];if(ze(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,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let i=this.styles[o],r=i.style;if(!(0!=r.indexOf(e)||i.context&&!n.matchesContext(i.context)||r.length>e.length&&(61!=r.charCodeAt(e.length)||r.slice(e.length+1)!=t))){if(i.getAttrs){let e=i.getAttrs(t);if(!1===e)continue;i.attrs=e||void 0}return i}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,i=0;for(;i<t.length;i++){let e=t[i];if((null==e.priority?50:e.priority)<n)break}t.splice(i,0,e)}for(let t in e.marks){let i=e.marks[t].spec.parseDOM;i&&i.forEach((e=>{n(e=Le(e)),e.mark=t}))}for(let t in e.nodes){let i=e.nodes[t].spec.parseDOM;i&&i.forEach((e=>{n(e=Le(e)),e.node=t}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Me(e,Me.schemaRules(e)))}}const Ce={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},De={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Oe={ol:!0,ul:!0},Te=1,Ne=2,Se=4;function Ae(e,t,n){return null!=t?(t?Te:0)|("full"===t?Ne:0):e&&"pre"==e.whitespace?Te|Ne:n&~Se}class je{constructor(e,t,n,i,o,r,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=i,this.solid=o,this.options=s,this.content=[],this.activeMarks=P.none,this.stashMarks=[],this.match=r||(s&Se?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(z.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(!(this.options&Te)){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=z.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(z.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 i=n[t];(this.type?this.type.allowsMarkType(i.type):Re(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ce.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ie{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let i,o=t.topNode,r=Ae(null,t.preserveWhitespace,0)|(n?Se:0);i=o?new je(o.type,o.attrs,P.none,P.none,!0,t.topMatch||o.type.contentMatch,r):new je(n?null:e.schema.topNodeType,null,P.none,P.none,!0,null,r),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){let t=e.getAttribute("style"),n=t?this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,i=[];for(;t=n.exec(e);)i.push(t[1],t[2].trim());return i}(t)):null,i=this.top;if(null!=n)for(let e=0;e<n.length;e++)this.addPendingMark(n[e]);if(this.addElement(e),null!=n)for(let e=0;e<n.length;e++)this.removePendingMark(n[e],i)}}addTextNode(e){let t=e.nodeValue,n=this.top;if(n.options&Ne||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(n.options&Te)t=n.options&Ne?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 i=n.content[n.content.length-1],o=e.previousSibling;(!i||o&&"BR"==o.nodeName||i.isText&&/[ \t\r\n\u000c]$/.test(i.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,i=e.nodeName.toLowerCase();Oe.hasOwnProperty(i)&&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&&Oe.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(o?o.ignore:De.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let t,n=this.top,r=this.needsBlock;if(Ce.hasOwnProperty(i))t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),t&&this.sync(n),this.needsBlock=r}else this.addElementByRule(e,o,!1===o.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=P.none;e:for(let n=0;n<e.length;n+=2)for(let i;;){let o=this.parser.matchStyle(e[n],e[n+1],this,i);if(!o)continue e;if(o.ignore)return null;if(t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),!1!==o.consuming)break;i=o}return t}addElementByRule(e,t,n){let i,o,r;if(t.node)o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace);else{r=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(r)}let s=this.top;if(o&&o.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)}i&&this.sync(s)&&this.open--,r&&this.removePendingMark(r,s)}addAll(e,t,n){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,r=null==n?null:e.childNodes[n];o!=r;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,n;for(let i=this.open;i>=0;i--){let o=this.nodes[i],r=o.findWrapping(e);if(r&&(!t||t.length>r.length)&&(t=r,n=o,!r.length))break;if(o.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 i=0;i<e.marks.length;i++)t.type&&!t.type.allowsMarkType(e.marks[i].type)||(n=e.marks[i].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,n),i}enterInner(e,t=null,n=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let r=Ae(e,i,o.options);o.options&Se&&0==o.content.length&&(r|=Se),this.nodes.push(new je(e,t,o.activeMarks,o.pendingMarks,n,null,r)),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 i=0;i<this.find.length;i++)if(null==this.find[i].pos&&1==e.nodeType&&e.contains(this.find[i].node)){t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].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,i=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(i?0:1),r=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=o;s--)if(r(e-1,s))return!0;return!1}{let e=s>0||0==s&&i?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return r(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 i=this.nodes[n];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let t=i.popFromStashMark(e);t&&i.type&&i.type.allowsMarkType(t.type)&&(i.activeMarks=t.addToSet(i.activeMarks))}if(i==t)break}}}function ze(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Le(e){let t={};for(let n in e)t[n]=e[n];return t}function Re(e,t){let n=t.schema.nodes;for(let i in n){let o=n[i];if(!o.allowsMarkType(e))continue;let r=[],s=e=>{r.push(e);for(let n=0;n<e.edgeCount;n++){let{type:i,next:o}=e.edge(n);if(i==t)return!0;if(r.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class Fe{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Be(t).createDocumentFragment());let i=n,o=[];return e.forEach((e=>{if(o.length||e.marks.length){let n=0,r=0;for(;n<o.length&&r<e.marks.length;){let t=e.marks[r];if(this.marks[t.type.name]){if(!t.eq(o[n][0])||!1===t.type.spec.spanning)break;n++,r++}else r++}for(;n<o.length;)i=o.pop()[1];for(;r<e.marks.length;){let n=e.marks[r++],s=this.serializeMark(n,e.isInline,t);s&&(o.push([n,i]),i.appendChild(s.dom),i=s.contentDOM||s.dom)}}i.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:i}=Fe.renderSpec(Be(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&Fe.renderSpec(Be(n),i(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 i,o=t[0],r=o.indexOf(" ");r>0&&(n=o.slice(0,r),o=o.slice(r+1));let s=n?e.createElementNS(n,o):e.createElement(o),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let o=l;o<t.length;o++){let r=t[o];if(0===r){if(o<t.length-1||o>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:o}=Fe.renderSpec(e,r,n);if(s.appendChild(t),o){if(i)throw new RangeError("Multiple content holes");i=o}}}return{dom:s,contentDOM:i}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Fe(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Pe(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return Pe(e.marks)}}function Pe(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function Be(e){return e.document||window.document}const Ue=65535,$e=Math.pow(2,16);function He(e,t){return e+t*$e}function Ve(e){return e&Ue}const qe=1,We=2,Ke=4,Ye=8;class Qe{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Ye)>0}get deletedBefore(){return(this.delInfo&(qe|Ke))>0}get deletedAfter(){return(this.delInfo&(We|Ke))>0}get deletedAcross(){return(this.delInfo&Ke)>0}}class Ge{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Ge.empty)return Ge.empty}recover(e){let t=0,n=Ve(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-(e&Ue))/$e}(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 i=0,o=this.inverted?2:1,r=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?i:0);if(a>e)break;let l=this.ranges[s+o],c=this.ranges[s+r],p=a+l;if(e<=p){let o=a+i+((l?e==a?-1:e==p?1:t:t)<0?0:c);if(n)return o;let r=e==(t<0?a:p)?null:He(s/3,e-a),u=e==a?We:e==p?qe:Ke;return(t<0?e!=a:e!=p)&&(u|=Ye),new Qe(o,u,r)}i+=c-l}return n?e+i:new Qe(e+i,0,null)}touches(e,t){let n=0,i=Ve(t),o=this.inverted?2:1,r=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let a=this.ranges[t+o];if(e<=s+a&&t==3*i)return!0;n+=this.ranges[t+r]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let r=this.ranges[i],s=r-(this.inverted?o:0),a=r+(this.inverted?0:o),l=this.ranges[i+t],c=this.ranges[i+n];e(s,s+l,a,a+c),o+=c-l}}invert(){return new Ge(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Ge.empty:new Ge(e<0?[0,-e,0]:[0,0,e])}}Ge.empty=new Ge([]);class Je{constructor(e=[],t,n=0,i=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=i}slice(e=0,t=this.maps.length){return new Je(this.maps,this.mirror,e,t)}copy(){return new Je(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 i=e.getMirror(t);this.appendMap(e.maps[t],null!=i&&i<t?n+i: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 i=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=i&&i>t?n-i-1:void 0)}}invert(){let e=new Je;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 i=0;for(let n=this.from;n<this.to;n++){let o=this.maps[n].mapResult(e,t);if(null!=o.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this.maps[t].recover(o.recover);continue}}i|=o.delInfo,e=o.pos}return n?e:new Qe(e,i,null)}}const Ze=Object.create(null);class Xe{getMap(){return Ge.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Ze[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 Ze)throw new RangeError("Duplicate use of step JSON ID "+e);return Ze[e]=t,t.prototype.jsonID=e,t}}class et{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new et(e,null)}static fail(e){return new et(null,e)}static fromReplace(e,t,n,i){try{return et.ok(e.replace(t,n,i))}catch(e){if(e instanceof B)return et.fail(e.message);throw e}}}function tt(e,t,n){let i=[];for(let o=0;o<e.childCount;o++){let r=e.child(o);r.content.size&&(r=r.copy(tt(r.content,t,r))),r.isInline&&(r=t(r,n,o)),i.push(r)}return z.fromArray(i)}class nt extends Xe{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),o=new U(tt(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),i),t.openStart,t.openEnd);return et.fromReplace(e,this.from,this.to,o)}invert(){return new it(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 nt(t.pos,n.pos,this.mark)}merge(e){return e instanceof nt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new nt(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 nt(t.from,t.to,e.markFromJSON(t.mark))}}Xe.jsonID("addMark",nt);class it extends Xe{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new U(tt(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return et.fromReplace(e,this.from,this.to,n)}invert(){return new nt(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 it(t.pos,n.pos,this.mark)}merge(e){return e instanceof it&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new it(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 it(t.from,t.to,e.markFromJSON(t.mark))}}Xe.jsonID("removeMark",it);class ot extends Xe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return et.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return et.fromReplace(e,this.pos,this.pos+1,new U(z.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 ot(this.pos,t.marks[n]);return new ot(this.pos,this.mark)}}return new rt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ot(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 ot(t.pos,e.markFromJSON(t.mark))}}Xe.jsonID("addNodeMark",ot);class rt extends Xe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return et.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return et.fromReplace(e,this.pos,this.pos+1,new U(z.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new ot(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new rt(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 rt(t.pos,e.markFromJSON(t.mark))}}Xe.jsonID("removeNodeMark",rt);class st extends Xe{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&<(e,this.from,this.to)?et.fail("Structure replace would overwrite content"):et.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ge([this.from,this.to-this.from,this.slice.size])}invert(e){return new st(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 st(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof st)||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?U.empty:new U(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new st(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?U.empty:new U(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new st(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 st(t.from,t.to,U.fromJSON(e,t.slice),!!t.structure)}}Xe.jsonID("replace",st);class at extends Xe{constructor(e,t,n,i,o,r,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=i,this.slice=o,this.insert=r,this.structure=s}apply(e){if(this.structure&&(lt(e,this.from,this.gapFrom)||lt(e,this.gapTo,this.to)))return et.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return et.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?et.fromReplace(e,this.from,this.to,n):et.fail("Content does not fit in gap")}getMap(){return new Ge([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 at(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),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||i<t.pos||o>n.pos?null:new at(t.pos,n.pos,i,o,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 at(t.from,t.to,t.gapFrom,t.gapTo,U.fromJSON(e,t.slice),t.insert,!!t.structure)}}function lt(e,t,n){let i=e.resolve(t),o=n-t,r=i.depth;for(;o>0&&r>0&&i.indexAfter(r)==i.node(r).childCount;)r--,o--;if(o>0){let e=i.node(r).maybeChild(i.indexAfter(r));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function ct(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function pt(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let i=e.$from.node(n),o=e.$from.index(n),r=e.$to.indexAfter(n);if(n<e.depth&&i.canReplace(o,r,t))return n;if(0==n||i.type.spec.isolating||!ct(i,o,r))break}return null}function ut(e,t,n=null,i=e){let o=function(e,t){let{parent:n,startIndex:i,endIndex:o}=e,r=n.contentMatchAt(i).findWrapping(t);if(!r)return null;let s=r.length?r[0]:t;return n.canReplaceWith(i,o,s)?r:null}(e,t),r=o&&function(e,t){let{parent:n,startIndex:i,endIndex:o}=e,r=n.child(i),s=t.contentMatch.findWrapping(r.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=i;a&&e<o;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null}(i,t);return r?o.map(dt).concat({type:t,attrs:n}).concat(r.map(dt)):null}function dt(e){return{type:e,attrs:null}}function ht(e,t,n=1,i){let o=e.resolve(t),r=o.depth-n,s=i&&i[i.length-1]||o.parent;if(r<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,t=n-2;e>r;e--,t--){let n=o.node(e),r=o.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(r,n.childCount),a=i&&i[t]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(r+1,n.childCount)||!a.type.validContent(s))return!1}let a=o.indexAfter(r),l=i&&i[0];return o.node(r).canReplaceWith(a,a,l?l.type:o.node(r+1).type)}function mt(e,t){let n=e.resolve(t),i=n.index();return function(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function ft(e,t,n){let i=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let e=0;e<n.openStart;e++)o=o.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=i.depth;t>=0;t--){let n=t==i.depth?0:i.pos<=(i.start(t+1)+i.end(t+1))/2?-1:1,r=i.index(t)+(n>0?1:0),s=i.node(t),a=!1;if(1==e)a=s.canReplace(r,r,o);else{let e=s.contentMatchAt(r).findWrapping(o.firstChild.type);a=e&&s.canReplaceWith(r,r,e[0])}if(a)return 0==n?i.pos:n<0?i.before(t+1):i.after(t+1)}return null}function gt(e,t,n=t,i=U.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),r=e.resolve(n);return bt(o,r,i)?new st(t,n,i):new vt(o,r,i).fit()}function bt(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Xe.jsonID("replaceAround",at);class vt{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=z.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=z.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let o=this.placed,r=n.depth,s=i.depth;for(;r&&s&&1==o.childCount;)o=o.firstChild.content,r--,s--;let a=new U(o,r,s);return e>-1?new at(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new st(n.pos,i.pos,a):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let n,i=null;t?(i=wt(this.unplaced.content,t-1).firstChild,n=i.content):n=this.unplaced.content;let o=n.firstChild;for(let n=this.depth;n>=0;n--){let r,{type:s,match:a}=this.frontier[n],l=null;if(1==e&&(o?a.matchType(o.type)||(l=a.fillBefore(z.from(o),!1)):i&&s.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:n,parent:i,inject:l};if(2==e&&o&&(r=a.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:n,parent:i,wrap:r};if(i&&a.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=wt(e,t);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new U(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=wt(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new U(yt(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new U(yt(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e<o.length;e++)this.openFrontierNode(o[e]);let r=this.unplaced,s=n?n.content:r.content,a=r.openStart-e,l=0,c=[],{match:p,type:u}=this.frontier[t];if(i){for(let e=0;e<i.childCount;e++)c.push(i.child(e));p=p.matchFragment(i)}let d=s.size+e-(r.content.size-r.openEnd);for(;l<s.childCount;){let e=s.child(l),t=p.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(p=t,c.push(kt(e.mark(u.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?d:-1)))}let h=l==s.childCount;h||(d=-1),this.placed=xt(this.placed,t,z.from(c)),this.frontier[t].match=p,h&&d<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<d;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=h?0==e?U.empty:new U(yt(r.content,e-1,1),e-1,d<0?r.openEnd:e-1):new U(yt(r.content,e,l),r.openStart,r.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Et(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,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),r=Et(e,t,i,n,o);if(r){for(let n=t-1;n>=0;n--){let{match:t,type:i}=this.frontier[n],o=Et(e,n,i,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:r,move:o?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=xt(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),i=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,i)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=xt(this.placed,this.depth,z.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(z.empty,!0);e.childCount&&(this.placed=xt(this.placed,this.frontier.length,e))}}function yt(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(yt(e.firstChild.content,t-1,n)))}function xt(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(xt(e.lastChild.content,t-1,n)))}function wt(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function kt(e,t,n){if(t<=0)return e;let i=e.content;return t>1&&(i=i.replaceChild(0,kt(i.firstChild,t-1,1==i.childCount?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(z.empty,!0)))),e.copy(i)}function Et(e,t,n,i,o){let r=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==r.childCount&&!n.compatibleContent(r.type))return null;let a=i.fillBefore(r.content,!0,s);return a&&!function(e,t,n){for(let i=n;i<t.childCount;i++)if(!e.allowsMarks(t.child(i).marks))return!0;return!1}(n,r.content,s)?a:null}function _t(e){return e.spec.defining||e.spec.definingForContent}function Mt(e,t,n,i,o){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(Mt(o.content,t+1,n,i,o)))}if(t>i){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(z.empty,!0))}return e}function Ct(e,t){let n=[];for(let i=Math.min(e.depth,t.depth);i>=0;i--){let o=e.start(i);if(o<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}class Dt extends Xe{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 et.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return et.fromReplace(e,this.pos,this.pos+1,new U(z.from(i),0,t.isLeaf?0:1))}getMap(){return Ge.empty}invert(e){return new Dt(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 Dt(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 Dt(t.pos,t.attr,t.value)}}Xe.jsonID("attr",Dt);let Ot=class extends Error{};Ot=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Ot.prototype=Object.create(Error.prototype)).constructor=Ot,Ot.prototype.name="TransformError";class Tt{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Je}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ot(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=U.empty){let i=gt(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new U(z.from(n),0,0))}delete(e,t){return this.replace(e,t,U.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,i){if(!i.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),r=e.doc.resolve(n);if(bt(o,r,i))return e.step(new st(t,n,i));let s=Ct(o,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:o.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),c=[],p=i.openStart;for(let e=i.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==i.openStart)break;e=n.content}for(let e=p-1;e>=0;e--){let t=c[e].type,n=_t(t);if(n&&o.node(l).type!=t)p=e;else if(n||!t.isTextblock)break}for(let t=i.openStart;t>=0;t--){let a=(t+p+1)%(i.openStart+1),u=c[a];if(u)for(let t=0;t<s.length;t++){let c=s[(t+l)%s.length],p=!0;c<0&&(p=!1,c=-c);let d=o.node(c-1),h=o.index(c-1);if(d.canReplaceWith(h,h,u.type,u.marks))return e.replace(o.before(c),p?r.after(c):n,new U(Mt(i.content,0,i.openStart,a),a,i.openEnd))}}let u=e.steps.length;for(let a=s.length-1;a>=0&&(e.replace(t,n,i),!(e.steps.length>u));a--){let e=s[a];e<0||(t=o.before(e),n=r.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=function(e,t,n){let i=e.resolve(t);if(i.parent.canReplaceWith(i.index(),i.index(),n))return t;if(0==i.parentOffset)for(let e=i.depth-1;e>=0;e--){let t=i.index(e);if(i.node(e).canReplaceWith(t,t,n))return i.before(e+1);if(t>0)return null}if(i.parentOffset==i.parent.content.size)for(let e=i.depth-1;e>=0;e--){let t=i.indexAfter(e);if(i.node(e).canReplaceWith(t,t,n))return i.after(e+1);if(t<i.node(e).childCount)return null}return null}(e.doc,t,i.type);null!=o&&(t=n=o)}e.replaceRange(t,n,new U(z.from(i),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let i=e.doc.resolve(t),o=e.doc.resolve(n),r=Ct(i,o);for(let t=0;t<r.length;t++){let n=r[t],s=t==r.length-1;if(s&&0==n||i.node(n).type.contentMatch.validEnd)return e.delete(i.start(n),o.end(n));if(n>0&&(s||i.node(n-1).canReplace(i.index(n-1),o.indexAfter(n-1))))return e.delete(i.before(n),o.after(n))}for(let r=1;r<=i.depth&&r<=o.depth;r++)if(t-i.start(r)==i.depth-r&&n>i.end(r)&&o.end(r)-n!=o.depth-r)return e.delete(i.before(r),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:i,$to:o,depth:r}=t,s=i.before(r+1),a=o.after(r+1),l=s,c=a,p=z.empty,u=0;for(let e=r,t=!1;e>n;e--)t||i.index(e)>0?(t=!0,p=z.from(i.node(e).copy(p)),u++):l--;let d=z.empty,h=0;for(let e=r,t=!1;e>n;e--)t||o.after(e+1)<o.end(e)?(t=!0,d=z.from(o.node(e).copy(d)),h++):c++;e.step(new at(l,c,s,a,new U(p.append(d),u,h),p.size-u,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let i=new st(t-n,t+n,U.empty,!0);e.step(i)}(this,e,t),this}wrap(e,t){return function(e,t,n){let i=z.empty;for(let e=n.length-1;e>=0;e--){if(i.size){let t=n[e].type.contentMatch.matchFragment(i);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=z.from(n[e].type.create(n[e].attrs,i))}let o=t.start,r=t.end;e.step(new at(o,r,o,r,new U(i,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,i=null){return function(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let r=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(i,o)&&function(e,t,n){let i=e.resolve(t),o=i.index();return i.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(r).map(n),i)){e.clearIncompatible(e.mapping.slice(r).map(n,1),i);let s=e.mapping.slice(r),a=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new at(a,l,a+1,l-1,new U(z.from(i.create(o,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i=[]){return function(e,t,n,i,o){let r=e.doc.nodeAt(t);if(!r)throw new RangeError("No node at given position");n||(n=r.type);let s=n.create(i,null,o||r.marks);if(r.isLeaf)return e.replaceWith(t,t+r.nodeSize,s);if(!n.validContent(r.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new at(t,t+r.nodeSize,t+1,t+r.nodeSize-1,new U(z.from(s),0,0),1,!0))}(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new Dt(e,t,n)),this}addNodeMark(e,t){return this.step(new ot(e,t)),this}removeNodeMark(e,t){if(!(t instanceof P)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t=t.isInSet(n.marks),!t)return this}return this.step(new rt(e,t)),this}split(e,t=1,n){return function(e,t,n=1,i){let o=e.doc.resolve(t),r=z.empty,s=z.empty;for(let e=o.depth,t=o.depth-n,a=n-1;e>t;e--,a--){r=z.from(o.node(e).copy(r));let t=i&&i[a];s=z.from(t?t.type.create(t.attrs,s):o.node(e).copy(s))}e.step(new st(t,t,new U(r.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,i){let o,r,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let p=e.marks;if(!i.isInSet(p)&&c.type.allowsMarkType(i.type)){let c=Math.max(l,t),u=Math.min(l+e.nodeSize,n),d=i.addToSet(p);for(let e=0;e<p.length;e++)p[e].isInSet(d)||(o&&o.to==c&&o.mark.eq(p[e])?o.to=u:s.push(o=new it(c,u,p[e])));r&&r.to==c?r.to=u:a.push(r=new nt(c,u,i))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,i){let o=[],r=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;r++;let a=null;if(i instanceof ke){let t,n=e.marks;for(;t=i.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else i?i.isInSet(e.marks)&&(a=[i]):a=e.marks;if(a&&a.length){let i=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<o.length;e++){let t=o[e];t.step==r-1&&l.eq(o[e].style)&&(n=t)}n?(n.to=i,n.step=r):o.push({style:l,from:Math.max(s,t),to:i,step:r})}}})),o.forEach((t=>e.step(new it(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,i=n.contentMatch){let o=e.doc.nodeAt(t),r=[],s=t+1;for(let t=0;t<o.childCount;t++){let a=o.child(t),l=s+a.nodeSize,c=i.matchType(a.type);if(c){i=c;for(let t=0;t<a.marks.length;t++)n.allowsMarkType(a.marks[t].type)||e.step(new it(s,l,a.marks[t]))}else r.push(new st(s,l,U.empty));s=l}if(!i.validEnd){let t=i.fillBefore(z.empty,!0);e.replace(s,s,new U(t,0,0))}for(let t=r.length-1;t>=0;t--)e.step(r[t])}(this,e,t,n),this}}const Nt=Object.create(null);class St{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new At(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=U.empty){let n=t.content.lastChild,i=null;for(let e=0;e<t.openEnd;e++)i=n,n=n.lastChild;let o=e.steps.length,r=this.ranges;for(let s=0;s<r.length;s++){let{$from:a,$to:l}=r[s],c=e.mapping.slice(o);e.replaceRange(c.map(a.pos),c.map(l.pos),s?U.empty:t),0==s&&$t(e,o,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:r,$to:s}=i[o],a=e.mapping.slice(n),l=a.map(r.pos),c=a.map(s.pos);o?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),$t(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let i=e.parent.inlineContent?new zt(e):Ut(e.node(0),e.parent,e.pos,e.index(),t,n);if(i)return i;for(let i=e.depth-1;i>=0;i--){let o=t<0?Ut(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):Ut(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Pt(e.node(0))}static atStart(e){return Ut(e,e,0,0,1)||new Pt(e)}static atEnd(e){return Ut(e,e,e.content.size,e.childCount,-1)||new Pt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Nt[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 Nt)throw new RangeError("Duplicate use of selection JSON ID "+e);return Nt[e]=t,t.prototype.jsonID=e,t}getBookmark(){return zt.between(this.$anchor,this.$head).getBookmark()}}St.prototype.visible=!0;class At{constructor(e,t){this.$from=e,this.$to=t}}let jt=!1;function It(e){jt||e.parent.inlineContent||(jt=!0,console["warn"]("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class zt extends St{constructor(e,t=e){It(e),It(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 St.near(n);let i=e.resolve(t.map(this.anchor));return new zt(i.parent.inlineContent?i:n,n)}replace(e,t=U.empty){if(super.replace(e,t),t==U.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof zt&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Lt(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 zt(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if(n&&!i||(n=i>=0?1:-1),!t.parent.inlineContent){let e=St.findFrom(t,n,!0)||St.findFrom(t,-n,!0);if(!e)return St.near(t,n);t=e.$head}return e.parent.inlineContent||(0==i||(e=(St.findFrom(e,-n,!0)||St.findFrom(e,n,!0)).$anchor).pos<t.pos!=i<0)&&(e=t),new zt(e,t)}}St.jsonID("text",zt);class Lt{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Lt(e.map(this.anchor),e.map(this.head))}resolve(e){return zt.between(e.resolve(this.anchor),e.resolve(this.head))}}class Rt extends St{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:i}=t.mapResult(this.anchor),o=e.resolve(i);return n?St.near(o):new Rt(o)}content(){return new U(z.from(this.node),0,0)}eq(e){return e instanceof Rt&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ft(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Rt(e.resolve(t.anchor))}static create(e,t){return new Rt(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}Rt.prototype.visible=!1,St.jsonID("node",Rt);class Ft{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new Lt(n,n):new Ft(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Rt.isSelectable(n)?new Rt(t):St.near(t)}}class Pt extends St{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=U.empty){if(t==U.empty){e.delete(0,e.doc.content.size);let t=St.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Pt(e)}map(e){return new Pt(e)}eq(e){return e instanceof Pt}getBookmark(){return Bt}}St.jsonID("all",Pt);const Bt={map(){return this},resolve:e=>new Pt(e)};function Ut(e,t,n,i,o,r=!1){if(t.inlineContent)return zt.create(e,n);for(let s=i-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let i=t.child(s);if(i.isAtom){if(!r&&Rt.isSelectable(i))return Rt.create(e,n-(o<0?i.nodeSize:0))}else{let t=Ut(e,i,n+o,o<0?i.childCount:0,o,r);if(t)return t}n+=i.nodeSize*o}return null}function $t(e,t,n){let i=e.steps.length-1;if(i<t)return;let o,r=e.steps[i];(r instanceof st||r instanceof at)&&(e.mapping.maps[i].forEach(((e,t,n,i)=>{null==o&&(o=i)})),e.setSelection(St.near(e.doc.resolve(o),n)))}const Ht=1,Vt=2,qt=4;class Wt extends Tt{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Ht)&~Vt,this.storedMarks=null,this}get selectionSet(){return(this.updated&Ht)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Vt,this}ensureMarks(e){return P.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Vt)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~Vt,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)||P.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let i=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,o)),this.selection.empty||this.setSelection(St.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|=qt,this}get scrolledIntoView(){return(this.updated&qt)>0}}function Kt(e,t){return t&&e?e.bind(t):e}class Yt{constructor(e,t,n){this.name=e,this.init=Kt(t.init,n),this.apply=Kt(t.apply,n)}}const Qt=[new Yt("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new Yt("selection",{init:(e,t)=>e.selection||St.atStart(t.doc),apply:e=>e.selection}),new Yt("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,i)=>i.selection.$cursor?e.storedMarks:null}),new Yt("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class Gt{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Qt.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 Yt(e.key,e.spec.state,e))}))}}class Jt{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),i=null;for(;;){let o=!1;for(let r=0;r<this.config.plugins.length;r++){let s=this.config.plugins[r];if(s.spec.appendTransaction){let a=i?i[r].n:0,l=i?i[r].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,r)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let e=0;e<this.config.plugins.length;e++)i.push(e<r?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}i&&(i[r]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Jt(this.config),n=this.config.fields;for(let i=0;i<n.length;i++){let o=n[i];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new Wt(this)}static create(e){let t=new Gt(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Jt(t);for(let i=0;i<t.fields.length;i++)n[t.fields[i].name]=t.fields[i].init(e,n);return n}reconfigure(e){let t=new Gt(this.schema,e.plugins),n=t.fields,i=new Jt(t);for(let t=0;t<n.length;t++){let o=n[t].name;i[o]=this.hasOwnProperty(o)?this[o]:n[t].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"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 i=e[n],o=i.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Gt(e.schema,e.plugins),o=new Jt(i);return i.fields.forEach((i=>{if("doc"==i.name)o.doc=re.fromJSON(e.schema,t.doc);else if("selection"==i.name)o.selection=St.fromJSON(o.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let r in n){let s=n[r],a=s.spec.state;if(s.key==i.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,r))return void(o[i.name]=a.fromJSON.call(s,e,t[r],o))}o[i.name]=i.init(e,o)}})),o}}function Zt(e,t,n){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(t):"handleDOMEvents"==i&&(o=Zt(o,t,{})),n[i]=o}return n}class Xt{constructor(e){this.spec=e,this.props={},e.props&&Zt(e.props,this,this.props),this.key=e.key?e.key.key:tn("plugin")}getState(e){return e[this.key]}}const en=Object.create(null);function tn(e){return e in en?e+"$"+ ++en[e]:(en[e]=0,e+"$")}class nn{constructor(e="key"){this.key=tn(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const on="undefined"!=typeof navigator?navigator:null,rn="undefined"!=typeof document?document:null,sn=on&&on.userAgent||"",an=/Edge\/(\d+)/.exec(sn),ln=/MSIE \d/.exec(sn),cn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(sn),pn=!!(ln||cn||an),un=ln?document.documentMode:cn?+cn[1]:an?+an[1]:0,dn=!pn&&/gecko\/(\d+)/i.test(sn);dn&&(/Firefox\/(\d+)/.exec(sn)||[0,0])[1];const hn=!pn&&/Chrome\/(\d+)/.exec(sn),mn=!!hn,fn=hn?+hn[1]:0,gn=!pn&&!!on&&/Apple Computer/.test(on.vendor),bn=gn&&(/Mobile\/\w+/.test(sn)||!!on&&on.maxTouchPoints>2),vn=bn||!!on&&/Mac/.test(on.platform),yn=/Android \d/.test(sn),xn=!!rn&&"webkitFontSmoothing"in rn.documentElement.style,wn=xn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,kn=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},En=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let _n=null;const Mn=function(e,t,n){let i=_n||(_n=document.createRange());return i.setEnd(e,null==n?e.nodeValue.length:n),i.setStart(e,t||0),i},Cn=function(e,t,n,i){return n&&(On(e,t,n,i,-1)||On(e,t,n,i,1))},Dn=/^(img|br|input|textarea|hr)$/i;function On(e,t,n,i,o){for(;;){if(e==n&&t==i)return!0;if(t==(o<0?0:Tn(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Nn(e)||Dn.test(e.nodeName)||"false"==e.contentEditable)return!1;t=kn(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?Tn(e):0}}}function Tn(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Nn(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 Sn=function(e){let t=e.isCollapsed;return t&&mn&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function An(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function jn(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function In(e,t){return"number"==typeof e?e:e[t]}function zn(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,i=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*i}}function Ln(e,t,n){let i=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,r=e.dom.ownerDocument;for(let s=n||e.dom;s;s=En(s)){if(1!=s.nodeType)continue;let e=s,n=e==r.body,a=n?jn(r):zn(e),l=0,c=0;if(t.top<a.top+In(i,"top")?c=-(a.top-t.top+In(o,"top")):t.bottom>a.bottom-In(i,"bottom")&&(c=t.bottom-a.bottom+In(o,"bottom")),t.left<a.left+In(i,"left")?l=-(a.left-t.left+In(o,"left")):t.right>a.right-In(i,"right")&&(l=t.right-a.right+In(o,"right")),l||c)if(n)r.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,i=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let o=e.scrollLeft-n,r=e.scrollTop-i;t={left:t.left-o,top:t.top-r,right:t.right-o,bottom:t.bottom-r}}if(n)break}}function Rn(e){let t=[],n=e.ownerDocument;for(let i=e;i&&(t.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),e!=n);i=En(i));return t}function Fn(e,t){for(let n=0;n<e.length;n++){let{dom:i,top:o,left:r}=e[n];i.scrollTop!=o+t&&(i.scrollTop=o+t),i.scrollLeft!=r&&(i.scrollLeft=r)}}let Pn=null;function Bn(e,t){let n,i,o=2e8,r=0,s=t.top,a=t.top;for(let l=e.firstChild,c=0;l;l=l.nextSibling,c++){let e;if(1==l.nodeType)e=l.getClientRects();else{if(3!=l.nodeType)continue;e=Mn(l).getClientRects()}for(let p=0;p<e.length;p++){let u=e[p];if(u.top<=s&&u.bottom>=a){s=Math.max(u.bottom,s),a=Math.min(u.top,a);let e=u.left>t.left?u.left-t.left:u.right<t.left?t.left-u.right:0;if(e<o){n=l,o=e,i=e&&3==n.nodeType?{left:u.right<t.left?u.right:u.left,top:t.top}:t,1==l.nodeType&&e&&(r=c+(t.left>=(u.left+u.right)/2?1:0));continue}}!n&&(t.left>=u.right&&t.top>=u.top||t.left>=u.left&&t.top>=u.bottom)&&(r=c+1)}}return n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,i=document.createRange();for(let o=0;o<n;o++){i.setEnd(e,o+1),i.setStart(e,o);let n=Vn(i,1);if(n.top!=n.bottom&&Un(t,n))return{node:e,offset:o+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,i):!n||o&&1==n.nodeType?{node:e,offset:r}:Bn(n,i)}function Un(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function $n(e,t,n){let i=e.childNodes.length;if(i&&n.top<n.bottom)for(let o=Math.max(0,Math.min(i-1,Math.floor(i*(t.top-n.top)/(n.bottom-n.top))-2)),r=o;;){let n=e.childNodes[r];if(1==n.nodeType){let e=n.getClientRects();for(let i=0;i<e.length;i++){let o=e[i];if(Un(t,o))return $n(n,t,o)}}if((r=(r+1)%i)==o)break}return e}function Hn(e,t){let n,i=e.dom.ownerDocument,o=0;if(i.caretPositionFromPoint)try{let e=i.caretPositionFromPoint(t.left,t.top);e&&({offsetNode:n,offset:o}=e)}catch(e){}if(!n&&i.caretRangeFromPoint){let e=i.caretRangeFromPoint(t.left,t.top);e&&({startContainer:n,startOffset:o}=e)}let r,s=(e.root.elementFromPoint?e.root:i).elementFromPoint(t.left,t.top);if(!s||!e.dom.contains(1!=s.nodeType?s.parentNode:s)){let n=e.dom.getBoundingClientRect();if(!Un(t,n))return null;if(s=$n(e.dom,t,n),!s)return null}if(gn)for(let e=s;n&&e;e=En(e))e.draggable&&(n=void 0);if(s=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(s,t),n){if(dn&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let e,i=n.childNodes[o];"IMG"==i.nodeName&&(e=i.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&o++}n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?r=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(r=function(e,t,n,i){let o=-1;for(let n=t;n!=e.dom;){let t=e.docView.nearestDesc(n,!0);if(!t)return null;if(t.node.isBlock&&t.parent){let e=t.dom.getBoundingClientRect();if(e.left>i.left||e.top>i.top)o=t.posBefore;else{if(!(e.right<i.left||e.bottom<i.top))break;o=t.posAfter}}n=t.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,1)}(e,n,o,t))}null==r&&(r=function(e,t,n){let{node:i,offset:o}=Bn(t,n),r=-1;if(1==i.nodeType&&!i.firstChild){let e=i.getBoundingClientRect();r=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(i,o,r)}(e,s,t));let a=e.docView.nearestDesc(s,!0);return{pos:r,inside:a?a.posAtStart-a.border:-1}}function Vn(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const qn=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Wn(e,t,n){let{node:i,offset:o,atom:r}=e.docView.domFromPos(t,n<0?-1:1),s=xn||dn;if(3==i.nodeType){if(!s||!qn.test(i.nodeValue)&&(n<0?o:o!=i.nodeValue.length)){let e=o,t=o,r=n<0?1:-1;return n<0&&!o?(t++,r=-1):n>=0&&o==i.nodeValue.length?(e--,r=1):n<0?e--:t++,Kn(Vn(Mn(i,e,t),1),r<0)}{let e=Vn(Mn(i,o,o),n);if(dn&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){let t=Vn(Mn(i,o-1,o-1),-1);if(t.top==e.top){let n=Vn(Mn(i,o,o+1),-1);if(n.top!=e.top)return Kn(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(r||0)).parent.inlineContent){if(null==r&&o&&(n<0||o==Tn(i))){let e=i.childNodes[o-1];if(1==e.nodeType)return Yn(e.getBoundingClientRect(),!1)}if(null==r&&o<Tn(i)){let e=i.childNodes[o];if(1==e.nodeType)return Yn(e.getBoundingClientRect(),!0)}return Yn(i.getBoundingClientRect(),n>=0)}if(null==r&&o&&(n<0||o==Tn(i))){let e=i.childNodes[o-1],t=3==e.nodeType?Mn(e,Tn(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return Kn(Vn(t,1),!1)}if(null==r&&o<Tn(i)){let e=i.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?Mn(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return Kn(Vn(t,-1),!0)}return Kn(Vn(3==i.nodeType?Mn(i):i,-n),n>=0)}function Kn(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 Yn(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 Qn(e,t,n){let i=e.state,o=e.root.activeElement;i!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{i!=t&&e.updateState(i),o!=e.dom&&o&&o.focus()}}const Gn=/[\u0590-\u08ac]/;let Jn=null,Zn=null,Xn=!1;function ei(e,t,n){return Jn==t&&Zn==n?Xn:(Jn=t,Zn=n,Xn="up"==n||"down"==n?function(e,t,n){let i=t.selection,o="up"==n?i.$from:i.$to;return Qn(e,t,(()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.dom;break}t=n.dom.parentNode}let i=Wn(e,o.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=Mn(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==n?i.top-o.top>2*(o.bottom-i.top):o.bottom-i.bottom>2*(i.bottom-o.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:i}=t.selection;if(!i.parent.isTextblock)return!1;let o=i.parentOffset,r=!o,s=o==i.parent.content.size,a=e.domSelection();return Gn.test(i.parent.textContent)&&a.modify?Qn(e,t,(()=>{let t=a.getRangeAt(0),o=a.focusNode,r=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");let l=!(i.depth?e.docView.domAfterPos(i.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||o==a.focusNode&&r==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?r:s}(e,t,n))}const ti=0,ni=1,ii=2,oi=3;class ri{constructor(e,t,n,i){this.parent=e,this.children=t,this.dom=n,this.contentDOM=i,this.dirty=ti,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 i=this.children[t];if(i==e)return n;n+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,i;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(i=n.pmViewDesc)||i.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(i)+i.size:this.posAtStart}{let n,i;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(i=n.pmViewDesc)||i.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(i):this.posAtEnd}}let i;if(e==this.dom&&this.contentDOM)i=t>kn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){i=!1;break}if(t.previousSibling)break}if(null==i&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){i=!0;break}if(t.nextSibling)break}}return(null==i?n>0:i)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,i=e;i;i=i.parentNode){let o,r=this.getDesc(i);if(r&&(!t||r.node)){if(!n||!(o=r.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return r;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 i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let i=this.children[t],o=n+i.size;if(n==e&&o!=n){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-n-i.border);n=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n,i=0,o=0;for(let t=0;i<this.children.length;i++){let n=this.children[i],r=t+n.size;if(r>e||n instanceof di){o=e-t;break}t=r}if(o)return this.children[i].domFromPos(o-this.children[i].border,t);for(;i&&!(n=this.children[i-1]).size&&n instanceof si&&n.side>=0;i--);if(t<=0){let e,n=!0;for(;e=i?this.children[i-1]:null,e&&e.dom.parentNode!=this.contentDOM;i--,n=!1);return e&&t&&n&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?kn(e.dom)+1:0}}{let e,n=!0;for(;e=i<this.children.length?this.children[i]:null,e&&e.dom.parentNode!=this.contentDOM;i++,n=!1);return e&&n&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?kn(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 i=-1,o=-1;for(let r=n,s=0;;s++){let n=this.children[s],a=r+n.size;if(-1==i&&e<=a){let o=r+n.border;if(e>=o&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,o);e=r;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){i=kn(n.dom)+1;break}e-=n.size}-1==i&&(i=0)}if(i>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=kn(n.dom);break}t+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}r=a}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:o}}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,i=!1){let o=Math.min(e,t),r=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(o>a&&r<c)return l.setSelection(e-a-l.border,t-a-l.border,n,i);a=c}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.getSelection(),c=!1;if((dn||gn)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(c=!(!t||"\n"!=e.nodeValue[t-1]),c&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(s=a={node:t.parentNode,offset:kn(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(dn&&l.focusNode&&l.focusNode!=a.node&&1==l.focusNode.nodeType){let e=l.focusNode.childNodes[l.focusOffset];e&&"false"==e.contentEditable&&(i=!0)}if(!(i||c&&gn)&&Cn(s.node,s.offset,l.anchorNode,l.anchorOffset)&&Cn(a.node,a.offset,l.focusNode,l.focusOffset))return;let p=!1;if((l.extend||e==t)&&!c){l.collapse(s.node,s.offset);try{if(e!=t)try{l.extend(a.node,a.offset)}catch(e){}p=!0}catch(e){if(!(e instanceof DOMException))throw e}}if(!p){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,i=0;i<this.children.length;i++){let o=this.children[i],r=n+o.size;if(n==r?e<=r&&t>=n:e<r&&t>n){let i=n+o.border,s=r-o.border;if(e>=i&&t<=s)return this.dirty=e==n||t==r?ii:ni,void(e!=i||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-i,t-i):o.dirty=oi);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?oi:ii}n=r}this.dirty=ii}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?ii:ni;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class si extends ri{constructor(e,t,n,i){let o,r=t.type.toDOM;if("function"==typeof r&&(r=r(n,(()=>o?o.parent?o.parent.posBeforeChild(o):void 0:i))),!t.type.spec.raw){if(1!=r.nodeType){let e=document.createElement("span");e.appendChild(r),r=e}r.contentEditable="false",r.classList.add("ProseMirror-widget")}super(e,[],r,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==ti&&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 ai extends ri{constructor(e,t,n,i){super(e,[],t,null),this.textDOM=n,this.text=i}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 li extends ri{constructor(e,t,n,i){super(e,[],n,i),this.mark=t}static create(e,t,n,i){let o=i.nodeViews[t.type.name],r=o&&o(t,i,n);return r&&r.dom||(r=Fe.renderSpec(document,t.type.spec.toDOM(t,n))),new li(e,t,r.dom,r.contentDOM||r.dom)}parseRule(){return this.dirty&oi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return this.dirty!=oi&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=ti){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=ti}}slice(e,t,n){let i=li.create(this.parent,this.mark,!0,n),o=this.children,r=this.size;t<r&&(o=Mi(o,t,r,n)),e>0&&(o=Mi(o,0,e,n));for(let e=0;e<o.length;e++)o[e].parent=i;return i.children=o,i}}class ci extends ri{constructor(e,t,n,i,o,r,s,a,l){super(e,[],o,r),this.node=t,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=s,r&&this.updateChildren(a,l)}static create(e,t,n,i,o,r){let s,a=o.nodeViews[t.type.name],l=a&&a(t,o,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:r),n,i),c=l&&l.dom,p=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else c||({dom:c,contentDOM:p}=Fe.renderSpec(document,t.type.spec.toDOM(t)));p||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let u=c;return c=xi(c,n,t),l?s=new hi(e,t,n,i,c,p||null,u,l,o,r+1):t.isText?new ui(e,t,n,i,c,u,o):new ci(e,t,n,i,c,p||null,u,o,r+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=()=>z.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return this.dirty==ti&&e.eq(this.node)&&wi(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,i=t,o=e.composing?this.localCompositionInfo(e,t):null,r=o&&o.pos>-1?o:null,s=o&&o.pos<0,a=new Ei(this,r&&r.node,e);!function(e,t,n,i){let o=t.locals(e),r=0;if(0==o.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);i(s,o,t.forChild(r,s),n),r+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){if(s<o.length&&o[s].to==r){let e,t=o[s++];for(;s<o.length&&o[s].to==r;)(e||(e=[t])).push(o[s++]);if(e){e.sort(_i);for(let t=0;t<e.length;t++)n(e[t],c,!!l)}else n(t,c,!!l)}let p,u;if(l)u=-1,p=l,l=null;else{if(!(c<e.childCount))break;u=c,p=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=r&&a.splice(e--,1);for(;s<o.length&&o[s].from<=r&&o[s].to>r;)a.push(o[s++]);let d=r+p.nodeSize;if(p.isText){let e=d;s<o.length&&o[s].from<e&&(e=o[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<d&&(l=p.cut(e-r),p=p.cut(0,e-r),d=e,u=-1)}let h=p.isInline&&!p.isLeaf?a.filter((e=>!e.inline)):a.slice();i(p,h,t.forChild(r,p),u),r=d}}(this.node,this.innerDeco,((t,o,r)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!r&&a.syncToMarks(o==this.node.childCount?P.none:this.node.child(o).marks,n,e),a.placeWidget(t,e,i)}),((t,r,l,c)=>{let p;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,r,l,c)||s&&e.state.selection.from>i&&e.state.selection.to<i+t.nodeSize&&(p=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(t,r,l,p,e)||a.updateNextNode(t,r,l,e,c)||a.addNode(t,r,l,e,i),i+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==ii)&&(r&&this.protectLocalComposition(e,r),mi(this.contentDOM,this.children,e),bn&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof zt)||n<t||i>t+this.node.content.size)return null;let o=e.domSelection(),r=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=Tn(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(o.focusNode,o.focusOffset);if(!r||!this.dom.contains(r.parentNode))return null;if(this.node.inlineContent){let e=r.nodeValue,o=function(e,t,n,i){for(let o=0,r=0;o<e.childCount&&r<=i;){let s=e.child(o++),a=r;if(r+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<e.childCount;){let t=e.child(o++);if(r+=t.nodeSize,!t.isText)break;l+=t.text}if(r>=n){let e=a<i?l.lastIndexOf(t,i-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==i&&l.length>=i+t.length-a&&l.slice(i-a,i-a+t.length)==t)return i}}return-1}(this.node.content,e,n-t,i-t);return o<0?null:{node:r,pos:o,text:e}}return{node:r,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let r=new ai(this,o,t,i);e.input.compositionNodes.push(r),this.children=Mi(this.children,n,n+i.length,e,r)}update(e,t,n,i){return!(this.dirty==oi||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,i),!0)}updateInner(e,t,n,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=ti}updateOuterDeco(e){if(wi(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=vi(this.dom,this.nodeDOM,bi(this.outerDeco,this.node,t),bi(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 pi(e,t,n,i,o){return xi(i,t,e),new ci(void 0,e,t,n,i,i,i,o,0)}class ui extends ci{constructor(e,t,n,i,o,r,s){super(e,t,n,i,o,null,r,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,i){return!(this.dirty==oi||this.dirty!=ti&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),this.dirty==ti&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=ti,!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 i=this.node.cut(e,t),o=document.createTextNode(i.text);return new ui(this.parent,i,this.outerDeco,this.innerDeco,o,o,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=oi)}get domAtom(){return!1}}class di extends ri{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ti&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class hi extends ci{constructor(e,t,n,i,o,r,s,a,l,c){super(e,t,n,i,o,r,s,l,c),this.spec=a}update(e,t,n,i){if(this.dirty==oi)return!1;if(this.spec.update){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,i),o}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,i){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,i)}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 mi(e,t,n){let i=e.firstChild,o=!1;for(let r=0;r<t.length;r++){let s=t[r],a=s.dom;if(a.parentNode==e){for(;a!=i;)i=ki(i),o=!0;i=i.nextSibling}else o=!0,e.insertBefore(a,i);if(s instanceof li){let t=i?i.previousSibling:e.lastChild;mi(s.contentDOM,s.children,n),i=t?t.nextSibling:e.firstChild}}for(;i;)i=ki(i),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}const fi=function(e){e&&(this.nodeName=e)};fi.prototype=Object.create(null);const gi=[new fi];function bi(e,t,n){if(0==e.length)return gi;let i=n?gi[0]:new fi,o=[i];for(let r=0;r<e.length;r++){let s=e[r].type.attrs;if(s){s.nodeName&&o.push(i=new fi(s.nodeName));for(let e in s){let r=s[e];null!=r&&(n&&1==o.length&&o.push(i=new fi(t.isInline?"span":"div")),"class"==e?i.class=(i.class?i.class+" ":"")+r:"style"==e?i.style=(i.style?i.style+";":"")+r:"nodeName"!=e&&(i[e]=r))}}}return o}function vi(e,t,n,i){if(n==gi&&i==gi)return t;let o=t;for(let t=0;t<i.length;t++){let r=i[t],s=n[t];if(t){let t;s&&s.nodeName==r.nodeName&&o!=e&&(t=o.parentNode)&&t.nodeName.toLowerCase()==r.nodeName||(t=document.createElement(r.nodeName),t.pmIsDeco=!0,t.appendChild(o),s=gi[0]),o=t}yi(o,s||gi[0],r)}return o}function yi(e,t,n){for(let i in t)"class"==i||"style"==i||"nodeName"==i||i in n||e.removeAttribute(i);for(let i in n)"class"!=i&&"style"!=i&&"nodeName"!=i&&n[i]!=t[i]&&e.setAttribute(i,n[i]);if(t.class!=n.class){let i=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<i.length;t++)-1==o.indexOf(i[t])&&e.classList.remove(i[t]);for(let t=0;t<o.length;t++)-1==i.indexOf(o[t])&&e.classList.add(o[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,i=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=i.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function xi(e,t,n){return vi(e,e,gi,bi(t,n,1!=e.nodeType))}function wi(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 ki(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Ei{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,i=n.children.length,o=e.childCount,r=new Map,s=[];e:for(;o>0;){let a;for(;;)if(i){let e=n.children[i-1];if(!(e instanceof li)){a=e,i--;break}n=e,i=e.children.length}else{if(n==t)break e;i=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(o-1))break;--o,r.set(a,o),s.push(a)}}return{index:o,matched:r,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let i=0,o=this.stack.length>>1,r=Math.min(o,e.length);for(;i<r&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&!1!==e[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=ti,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let i=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++)if(this.top.children[t].matchesMark(e[o])){i=t;break}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let i=li.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,i),this.top=i,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,i){let o,r=-1;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))r=this.top.children.indexOf(o,this.index);else for(let i=this.index,o=Math.min(this.top.children.length,i+5);i<o;i++){let o=this.top.children[i];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){r=i;break}}return!(r<0)&&(this.destroyBetween(this.index,r),this.index++,!0)}updateNodeAt(e,t,n,i,o){let r=this.top.children[i];return r.dirty==oi&&r.dom==r.contentDOM&&(r.dirty=ii),!!r.update(e,t,n,o)&&(this.destroyBetween(this.index,i),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,i,o){for(let r=this.index;r<this.top.children.length;r++){let s=this.top.children[r];if(s instanceof ci){let a=this.preMatch.matched.get(s);if(null!=a&&a!=o)return!1;let l=s.dom;if(!(this.lock&&(l==this.lock||1==l.nodeType&&l.contains(this.lock.parentNode))&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=oi&&wi(t,s.outerDeco)))&&s.update(e,t,n,i))return this.destroyBetween(this.index,r),s.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(e,t,n,i,o){this.top.children.splice(this.index++,0,ci.create(this.top,e,t,n,i,o)),this.changed=!0}placeWidget(e,t,n){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(!i||!i.matchesWidget(e)||e!=i.widget&&i.widget.type.toDOM.parentNode){let i=new si(this.top,e,t,n);this.top.children.splice(this.index++,0,i),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof li;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof ui)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((gn||mn)&&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 i=new di(this.top,[],n,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}}function _i(e,t){return e.type.side-t.type.side}function Mi(e,t,n,i,o){let r=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,p=a+=l.size;c>=n||p<=t?r.push(l):(c<t&&r.push(l.slice(0,t-c,i)),o&&(r.push(o),o=void 0),p>n&&r.push(l.slice(n-c,l.size,i)))}return r}function Ci(e,t=null){let n=e.domSelection(),i=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),r=o&&0==o.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=i.resolve(s);if(Sn(n)){for(a=c;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&Rt.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let i=0==t,o=t==Tn(e);i||o;){if(e==n)return!0;let t=kn(e);if(!(e=e.parentNode))return!1;i=i&&0==t,o=o&&t==Tn(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;l=new Rt(s==e?c:i.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=i.resolve(t)}if(!l){l=zi(e,a,c,"pointer"==t||e.state.selection.head<c.pos&&!r?1:-1)}return l}function Di(e){return e.editable?e.hasFocus():Ri(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Oi(e,t=!1){let n=e.state.selection;if(ji(e,n),Di(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&mn){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Cn(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(),i=e.cursorWrapper.dom,o="IMG"==i.nodeName;o?n.setEnd(i.parentNode,kn(i)+1):n.setEnd(i,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&pn&&un<=11&&(i.disabled=!0,i.disabled=!1)}(e);else{let i,o,{anchor:r,head:s}=n;!Ti||n instanceof zt||(n.$from.parent.inlineContent||(i=Ni(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=Ni(e,n.to))),e.docView.setSelection(r,s,e.root,t),Ti&&(i&&Ai(i),o&&Ai(o)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),i=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==i&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Di(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Ti=gn||mn&&fn<63;function Ni(e,t){let{node:n,offset:i}=e.docView.domFromPos(t,0),o=i<n.childNodes.length?n.childNodes[i]:null,r=i?n.childNodes[i-1]:null;if(gn&&o&&"false"==o.contentEditable)return Si(o);if(!(o&&"false"!=o.contentEditable||r&&"false"!=r.contentEditable)){if(o)return Si(o);if(r)return Si(r)}}function Si(e){return e.contentEditable="true",gn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Ai(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function ji(e,t){if(t instanceof Rt){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Ii(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Ii(e)}function Ii(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function zi(e,t,n,i){return e.someProp("createSelectionBetween",(i=>i(e,t,n)))||zt.between(t,n,i)}function Li(e){return!(e.editable&&!e.hasFocus())&&Ri(e)}function Ri(e){let t=e.domSelection();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 Fi(e,t){let{$anchor:n,$head:i}=e.selection,o=t>0?n.max(i):n.min(i),r=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return r&&St.findFrom(r,t)}function Pi(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Bi(e,t,n){let i=e.state.selection;if(!(i instanceof zt)){if(i instanceof Rt&&i.node.isInline)return Pi(e,new zt(t>0?i.$to:i.$from));{let n=Fi(e.state,t);return!!n&&Pi(e,n)}}if(!i.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=Fi(e.state,t);return!!(n&&n instanceof Rt)&&Pi(e,n)}if(!(vn&&n.indexOf("m")>-1)){let n,o=i.$head,r=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!r||r.isText)return!1;let s=t<0?o.pos-r.nodeSize:o.pos;return!!(r.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(Rt.isSelectable(r)?Pi(e,new Rt(t<0?e.state.doc.resolve(o.pos-r.nodeSize):o)):!!xn&&Pi(e,new zt(e.state.doc.resolve(t<0?s:s+r.nodeSize))))}}function Ui(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function $i(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function Hi(e){let t=e.domSelection(),n=t.focusNode,i=t.focusOffset;if(!n)return;let o,r,s=!1;for(dn&&1==n.nodeType&&i<Ui(n)&&$i(n.childNodes[i])&&(s=!0);;)if(i>0){if(1!=n.nodeType)break;{let e=n.childNodes[i-1];if($i(e))o=n,r=--i;else{if(3!=e.nodeType)break;n=e,i=n.nodeValue.length}}}else{if(qi(n))break;{let t=n.previousSibling;for(;t&&$i(t);)o=n.parentNode,r=kn(t),t=t.previousSibling;if(t)n=t,i=Ui(n);else{if(n=n.parentNode,n==e.dom)break;i=0}}}s?Wi(e,t,n,i):o&&Wi(e,t,o,r)}function Vi(e){let t=e.domSelection(),n=t.focusNode,i=t.focusOffset;if(!n)return;let o,r,s=Ui(n);for(;;)if(i<s){if(1!=n.nodeType)break;if(!$i(n.childNodes[i]))break;o=n,r=++i}else{if(qi(n))break;{let t=n.nextSibling;for(;t&&$i(t);)o=t.parentNode,r=kn(t)+1,t=t.nextSibling;if(t)n=t,i=0,s=Ui(n);else{if(n=n.parentNode,n==e.dom)break;i=s=0}}}o&&Wi(e,t,o,r)}function qi(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Wi(e,t,n,i){if(Sn(t)){let e=document.createRange();e.setEnd(n,i),e.setStart(n,i),t.removeAllRanges(),t.addRange(e)}else t.extend&&t.extend(n,i);e.domObserver.setCurSelection();let{state:o}=e;setTimeout((()=>{e.state==o&&Oi(e)}),50)}function Ki(e,t,n){let i=e.state.selection;if(i instanceof zt&&!i.empty||n.indexOf("s")>-1)return!1;if(vn&&n.indexOf("m")>-1)return!1;let{$from:o,$to:r}=i;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Fi(e.state,t);if(n&&n instanceof Rt)return Pi(e,n)}if(!o.parent.inlineContent){let n=t<0?o:r,s=i instanceof Pt?St.near(n,t):St.findFrom(n,t);return!!s&&Pi(e,s)}return!1}function Yi(e,t){if(!(e.state.selection instanceof zt))return!0;let{$head:n,$anchor:i,empty:o}=e.state.selection;if(!n.sameParent(i))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let r=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(r&&!r.isText){let i=e.state.tr;return t<0?i.delete(n.pos-r.nodeSize,n.pos):i.delete(n.pos,n.pos+r.nodeSize),e.dispatch(i),!0}return!1}function Qi(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Gi(e,t){let n=t.keyCode,i=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||vn&&72==n&&"c"==i?Yi(e,-1)||Hi(e):46==n||vn&&68==n&&"c"==i?Yi(e,1)||Vi(e):13==n||27==n||(37==n||vn&&66==n&&"c"==i?Bi(e,-1,i)||Hi(e):39==n||vn&&70==n&&"c"==i?Bi(e,1,i)||Vi(e):38==n||vn&&80==n&&"c"==i?Ki(e,-1,i)||Hi(e):40==n||vn&&78==n&&"c"==i?function(e){if(!gn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Qi(e,n,"true"),setTimeout((()=>Qi(e,n,"false")),20)}return!1}(e)||Ki(e,1,i)||Vi(e):i==(vn?"m":"c")&&(66==n||73==n||89==n||90==n))}function Ji(e,t){e.someProp("transformCopied",(e=>{t=e(t)}));let n=[],{content:i,openStart:o,openEnd:r}=t;for(;o>1&&r>1&&1==i.childCount&&1==i.firstChild.childCount;){o--,r--;let e=i.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),i=e.content}let s=e.someProp("clipboardSerializer")||Fe.fromSchema(e.state.schema),a=ao(),l=a.createElement("div");l.appendChild(s.serializeFragment(i,{document:a}));let c,p=l.firstChild,u=0;for(;p&&1==p.nodeType&&(c=ro[p.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),u++}p=l.firstChild}p&&1==p.nodeType&&p.setAttribute("data-pm-slice",`${o} ${r}${u?` -${u}`:""} ${JSON.stringify(n)}`);let d=e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n");return{dom:l,text:d}}function Zi(e,t,n,i,o){let r,s,a=o.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(i||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||i)})),a)return t?new U(z.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):U.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,o,i)));if(n)s=n;else{let n=o.marks(),{schema:i}=e.state,s=Fe.fromSchema(i);r=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=r.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(i.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),r=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,i=ao().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&ro[o[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(i.innerHTML=e,n)for(let e=0;e<n.length;e++)i=i.querySelector(n[e])||i;return i}(n),xn&&function(e){let t=e.querySelectorAll(mn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let i=t[n];1==i.childNodes.length&&" "==i.textContent&&i.parentNode&&i.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),i)}}(r);let c=r&&r.querySelector("[data-pm-slice]"),p=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let e=+p[3];e>0&&r.firstChild;e--)r=r.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Me.fromSchema(e.state.schema);s=t.parseSlice(r,{preserveWhitespace:!(!l&&!p),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Xi.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(p)s=function(e,t){if(!e.size)return e;let n,i=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:o,openStart:r,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=i.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;o=z.from(t.create(n[e+1],o)),r++,s++}return new U(o,r,s)}(oo(s,+p[1],+p[2]),p[4]);else if(s=U.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i,o=t.node(n).contentMatchAt(t.index(n)),r=[];if(e.forEach((e=>{if(!r)return;let t,n=o.findWrapping(e.type);if(!n)return r=null;if(t=r.length&&i.length&&to(n,i,e,r[r.length-1],0))r[r.length-1]=t;else{r.length&&(r[r.length-1]=no(r[r.length-1],i.length));let t=eo(e,n);r.push(t),o=o.matchType(t.type),i=n}})),r)return z.from(r)}return e}(s.content,o),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=oo(s,e,t)}return e.someProp("transformPasted",(e=>{s=e(s)})),s}const Xi=/^(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 eo(e,t,n=0){for(let i=t.length-1;i>=n;i--)e=t[i].create(null,z.from(e));return e}function to(e,t,n,i,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let r=to(e,t,n,i.lastChild,o+1);if(r)return i.copy(i.content.replaceChild(i.childCount-1,r));if(i.contentMatchAt(i.childCount).matchType(o==e.length-1?n.type:e[o+1]))return i.copy(i.content.append(z.from(eo(n,e,o+1))))}}function no(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,no(e.lastChild,t-1)),i=e.contentMatchAt(e.childCount).fillBefore(z.empty,!0);return e.copy(n.append(i))}function io(e,t,n,i,o,r){let s=t<0?e.firstChild:e.lastChild,a=s.content;return o<i-1&&(a=io(a,t,n,i,o+1,r)),o>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||r<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(z.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function oo(e,t,n){return t<e.openStart&&(e=new U(io(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new U(io(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const ro={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 so=null;function ao(){return so||(so=document.implementation.createHTMLDocument("title"))}const lo={},co={},po={touchstart:!0,touchmove:!0};class uo{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.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function ho(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function mo(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>fo(e,t))}))}function fo(e,t){return e.someProp("handleDOMEvents",(n=>{let i=n[t.type];return!!i&&(i(e,t)||t.defaultPrevented)}))}function go(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 bo(e){return{left:e.clientX,top:e.clientY}}function vo(e,t,n,i,o){if(-1==i)return!1;let r=e.state.doc.resolve(i);for(let i=r.depth+1;i>0;i--)if(e.someProp(t,(t=>i>r.depth?t(e,n,r.nodeAfter,r.before(i),o,!0):t(e,n,r.node(i),r.before(i),o,!1))))return!0;return!1}function yo(e,t,n){e.focused||e.focus();let i=e.state.tr.setSelection(t);"pointer"==n&&i.setMeta("pointer",!0),e.dispatch(i)}function xo(e,t,n,i,o){return vo(e,"handleClickOn",t,n,i)||e.someProp("handleClick",(n=>n(e,t,i)))||(o?function(e,t){if(-1==t)return!1;let n,i,o=e.state.selection;o instanceof Rt&&(n=o.node);let r=e.state.doc.resolve(t);for(let e=r.depth+1;e>0;e--){let t=e>r.depth?r.nodeAfter:r.node(e);if(Rt.isSelectable(t)){i=n&&o.$from.depth>0&&e>=o.$from.depth&&r.before(o.$from.depth+1)==o.$from.pos?r.before(o.$from.depth):r.before(e);break}}return null!=i&&(yo(e,Rt.create(e.state.doc,i),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return!!(i&&i.isAtom&&Rt.isSelectable(i))&&(yo(e,new Rt(n),"pointer"),!0)}(e,n))}function wo(e,t,n,i){return vo(e,"handleDoubleClickOn",t,n,i)||e.someProp("handleDoubleClick",(n=>n(e,t,i)))}function ko(e,t,n,i){return vo(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",(n=>n(e,t,i)))||function(e,t,n){if(0!=n.button)return!1;let i=e.state.doc;if(-1==t)return!!i.inlineContent&&(yo(e,zt.create(i,0,i.content.size),"pointer"),!0);let o=i.resolve(t);for(let t=o.depth+1;t>0;t--){let n=t>o.depth?o.nodeAfter:o.node(t),r=o.before(t);if(n.inlineContent)yo(e,zt.create(i,r+1,r+1+n.content.size),"pointer");else{if(!Rt.isSelectable(n))continue;yo(e,Rt.create(i,r),"pointer")}return!0}}(e,n,i)}function Eo(e){return No(e)}co.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Co(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!yn||!mn||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!bn||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||Gi(e,n)?n.preventDefault():ho(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,An(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},co.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},co.keypress=(e,t)=>{let n=t;if(Co(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||vn&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let i=e.state.selection;if(!(i instanceof zt&&i.$from.sameParent(i.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,i.$from.pos,i.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const _o=vn?"metaKey":"ctrlKey";lo.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let i=Eo(e),o=Date.now(),r="singleClick";o-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,i=t.y-e.clientY;return n*n+i*i<100}(n,e.input.lastClick)&&!n[_o]&&("singleClick"==e.input.lastClick.type?r="doubleClick":"doubleClick"==e.input.lastClick.type&&(r="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:r};let s=e.posAtCoords(bo(n));s&&("singleClick"==r?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Mo(e,s,n,!!i)):("doubleClick"==r?wo:ko)(e,s.pos,s.inside,n)?n.preventDefault():ho(e,"pointer"))};class Mo{constructor(e,t,n,i){let o,r;if(this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[_o],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),r=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,r=n.depth?n.before():0}const s=i?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof Rt&&l.from<=r&&l.to>r)&&(this.mightDrag={node:o,pos:r,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!dn||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)),ho(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((()=>Oi(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(bo(e))),this.updateAllowDefault(e),this.allowDefault||!t?ho(this.view,"pointer"):xo(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||gn&&this.mightDrag&&!this.mightDrag.node.isAtom||mn&&!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)?(yo(this.view,St.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):ho(this.view,"pointer")}move(e){this.updateAllowDefault(e),ho(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 Co(e,t){return!!e.composing||!!(gn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}lo.touchstart=e=>{e.input.lastTouch=Date.now(),Eo(e),ho(e,"pointer")},lo.touchmove=e=>{e.input.lastTouch=Date.now(),ho(e,"pointer")},lo.contextmenu=e=>Eo(e);const Do=yn?5e3:-1;function Oo(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>No(e)),t))}function To(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 No(e,t=!1){if(!(yn&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),To(e),t||e.docView&&e.docView.dirty){let t=Ci(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}co.compositionstart=co.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(),No(e,!0),e.markCursor=null;else if(No(e),dn&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let i=n<0?e.lastChild:e.childNodes[n-1];if(!i)break;if(3==i.nodeType){t.collapse(i,i.nodeValue.length);break}e=i,n=-1}}e.input.composing=!0}Oo(e,Do)},co.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Oo(e,20))};const So=pn&&un<15||bn&&wn<604;function Ao(e,t,n,i){let o=Zi(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,i,o||U.empty))))return!0;if(!o)return!1;let r=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),s=r?e.state.tr.replaceSelectionWith(r,e.input.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}lo.copy=co.cut=(e,t)=>{let n=t,i=e.state.selection,o="cut"==n.type;if(i.empty)return;let r=So?null:n.clipboardData,s=i.content(),{dom:a,text:l}=Ji(e,s);r?(n.preventDefault(),r.clearData(),r.setData("text/html",a.innerHTML),r.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 i=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),i.removeAllRanges(),i.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},co.paste=(e,t)=>{let n=t;if(e.composing&&!yn)return;let i=So?null:n.clipboardData;i&&Ao(e,i.getData("text/plain"),i.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,i=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout((()=>{e.focus(),i.parentNode&&i.parentNode.removeChild(i),n?Ao(e,i.value,null,t):Ao(e,i.textContent,i.innerHTML,t)}),50)}(e,n)};class jo{constructor(e,t){this.slice=e,this.move=t}}const Io=vn?"altKey":"ctrlKey";lo.dragstart=(e,t)=>{let n=t,i=e.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let o=e.state.selection,r=o.empty?null:e.posAtCoords(bo(n));if(r&&r.pos>=o.from&&r.pos<=(o instanceof Rt?o.to-1:o.to));else if(i&&i.mightDrag)e.dispatch(e.state.tr.setSelection(Rt.create(e.state.doc,i.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(Rt.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=Ji(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(So?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",So||n.dataTransfer.setData("text/plain",l),e.dragging=new jo(s,!n[Io])},lo.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},co.dragover=co.dragenter=(e,t)=>t.preventDefault(),co.drop=(e,t)=>{let n=t,i=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(bo(n));if(!o)return;let r=e.state.doc.resolve(o.pos),s=i&&i.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=Zi(e,n.dataTransfer.getData(So?"Text":"text/plain"),So?null:n.dataTransfer.getData("text/html"),!1,r);let a=!(!i||n[Io]);if(e.someProp("handleDrop",(t=>t(e,n,s||U.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?ft(e.state.doc,r.pos,s):r.pos;null==l&&(l=r.pos);let c=e.state.tr;a&&c.deleteSelection();let p=c.mapping.map(l),u=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,d=c.doc;if(u?c.replaceRangeWith(p,p,s.content.firstChild):c.replaceRange(p,p,s),c.doc.eq(d))return;let h=c.doc.resolve(p);if(u&&Rt.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Rt(h));else{let t=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,n,i,o)=>t=o)),c.setSelection(zi(e,h,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},lo.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.domSelection())&&Oi(e)}),20))},lo.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)},lo.beforeinput=(e,t)=>{if(mn&&yn&&"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,An(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 co)lo[e]=co[e];function zo(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 Lo{constructor(e,t){this.toDOM=e,this.spec=t||Uo,this.side=this.spec.side||0}map(e,t,n,i){let{pos:o,deleted:r}=e.mapResult(t.from+i,this.side<0?-1:1);return r?null:new Po(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Lo&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&zo(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Ro{constructor(e,t){this.attrs=e,this.spec=t||Uo}map(e,t,n,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-n,r=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-n;return o>=r?null:new Po(o,r,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Ro&&zo(this.attrs,e.attrs)&&zo(this.spec,e.spec)}static is(e){return e.type instanceof Ro}destroy(){}}class Fo{constructor(e,t){this.attrs=e,this.spec=t||Uo}map(e,t,n,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let r=e.mapResult(t.to+i,-1);return r.deleted||r.pos<=o.pos?null:new Po(o.pos-n,r.pos-n,this)}valid(e,t){let n,{index:i,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(n=e.child(i)).isText&&o+n.nodeSize==t.to}eq(e){return this==e||e instanceof Fo&&zo(this.attrs,e.attrs)&&zo(this.spec,e.spec)}destroy(){}}class Po{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new Po(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 Po(e,e,new Lo(t,n))}static inline(e,t,n,i){return new Po(e,t,new Ro(n,i))}static node(e,t,n,i){return new Po(e,t,new Fo(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ro}}const Bo=[],Uo={};class $o{constructor(e,t){this.local=e.length?e:Bo,this.children=t.length?t:Bo}static create(e,t){return t.length?Yo(t,e,0,Uo):Ho}find(e,t,n){let i=[];return this.findInner(null==e?0:e,null==t?1e9:t,i,0,n),i}findInner(e,t,n,i,o){for(let r=0;r<this.local.length;r++){let s=this.local[r];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+i,s.to+i))}for(let r=0;r<this.children.length;r+=3)if(this.children[r]<t&&this.children[r+1]>e){let s=this.children[r]+1;this.children[r+2].findInner(e-s,t-s,n,i+s,o)}}map(e,t,n){return this==Ho||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Uo)}mapInner(e,t,n,i,o){let r;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,i);a&&a.type.valid(t,a)?(r||(r=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,i,o,r,s){let a=e.slice();for(let e=0,t=r;e<n.maps.length;e++){let i=0;n.maps[e].forEach(((e,n,r,s)=>{let l=s-r-(n-e);for(let s=0;s<a.length;s+=3){let c=a[s+1];if(c<0||e>c+t-i)continue;let p=a[s]+t-i;n>=p?a[s+1]=e<=p?-2:-1:r>=o&&l&&(a[s]+=l,a[s+1]+=l)}i+=l})),t=n.maps[e].map(t,-1)}let l=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){l=!0,a[t+1]=-1;continue}let c=n.map(e[t]+r),p=c-o;if(p<0||p>=i.content.size){l=!0;continue}let u=n.map(e[t+1]+r,-1)-o,{index:d,offset:h}=i.content.findIndex(p),m=i.maybeChild(d);if(m&&h==p&&h+m.nodeSize==u){let i=a[t+2].mapInner(n,m,c+1,e[t]+r+1,s);i!=Ho?(a[t]=p,a[t+1]=u,a[t+2]=i):(a[t+1]=-2,l=!0)}else l=!0}if(l){let l=function(e,t,n,i,o,r,s){function a(e,t){for(let r=0;r<e.local.length;r++){let a=e.local[r].map(i,o,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[r].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]+r+1);return n}(a,e,t,n,o,r,s),c=Yo(l,i,0,s);t=c.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new $o(t.sort(Qo),a)}(this.children,r||[],e,t,n,i,o):r?new $o(r.sort(Qo),Bo):Ho}add(e,t){return t.length?this==Ho?$o.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let i,o=0;e.forEach(((e,r)=>{let s,a=r+n;if(s=Wo(t,e,a)){for(i||(i=this.children.slice());o<i.length&&i[o]<r;)o+=3;i[o]==r?i[o+2]=i[o+2].addInner(e,s,a+1):i.splice(o,0,r,r+e.nodeSize,Yo(s,e,a+1,Uo)),o+=3}}));let r=qo(o?Ko(t):t,-n);for(let t=0;t<r.length;t++)r[t].type.valid(e,r[t])||r.splice(t--,1);return new $o(r.length?this.local.concat(r).sort(Qo):this.local,i||this.children)}remove(e){return 0==e.length||this==Ho?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,i=this.local;for(let i=0;i<n.length;i+=3){let o,r=n[i]+t,s=n[i+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>r&&t.to<s&&(e[n]=null,(o||(o=[])).push(t));if(!o)continue;n==this.children&&(n=this.children.slice());let a=n[i+2].removeInner(o,r+1);a!=Ho?n[i+2]=a:(n.splice(i,3),i-=3)}if(i.length)for(let n,o=0;o<e.length;o++)if(n=e[o])for(let e=0;e<i.length;e++)i[e].eq(n,t)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1));return n==this.children&&i==this.local?this:i.length||n.length?new $o(i,n):Ho}forChild(e,t){if(this==Ho)return this;if(t.isLeaf)return $o.empty;let n,i;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 o=e+1,r=o+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<r&&t.to>o&&t.type instanceof Ro){let e=Math.max(o,t.from)-o,n=Math.min(r,t.to)-o;e<n&&(i||(i=[])).push(t.copy(e,n))}}if(i){let e=new $o(i.sort(Qo),Bo);return n?new Vo([e,n]):e}return n||Ho}eq(e){if(this==e)return!0;if(!(e instanceof $o)||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 Go(this.localsInner(e))}localsInner(e){if(this==Ho)return Bo;if(e.inlineContent||!this.local.some(Ro.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Ro||t.push(this.local[e]);return t}}$o.empty=new $o([],[]),$o.removeOverlap=Go;const Ho=$o.empty;class Vo{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,Uo)));return Vo.from(n)}forChild(e,t){if(t.isLeaf)return $o.empty;let n=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=Ho&&(o instanceof Vo?n=n.concat(o.members):n.push(o))}return Vo.from(n)}eq(e){if(!(e instanceof Vo)||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 i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?Go(n?t:t.sort(Qo)):Bo}static from(e){switch(e.length){case 0:return Ho;case 1:return e[0];default:return new Vo(e)}}}function qo(e,t){if(!t||!e.length)return e;let n=[];for(let i=0;i<e.length;i++){let o=e[i];n.push(new Po(o.from+t,o.to+t,o.type))}return n}function Wo(e,t,n){if(t.isLeaf)return null;let i=n+t.nodeSize,o=null;for(let t,r=0;r<e.length;r++)(t=e[r])&&t.from>n&&t.to<i&&((o||(o=[])).push(t),e[r]=null);return o}function Ko(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Yo(e,t,n,i){let o=[],r=!1;t.forEach(((t,s)=>{let a=Wo(e,t,s+n);if(a){r=!0;let e=Yo(a,t,n+s+1,i);e!=Ho&&o.push(s,s+t.nodeSize,e)}}));let s=qo(r?Ko(e):e,-n).sort(Qo);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(i.onRemove&&i.onRemove(s[e].spec),s.splice(e--,1));return s.length||o.length?new $o(s,o):Ho}function Qo(e,t){return e.from-t.from||e.to-t.to}function Go(e){let t=e;for(let n=0;n<t.length-1;n++){let i=t[n];if(i.from!=i.to)for(let o=n+1;o<t.length;o++){let r=t[o];if(r.from!=i.from){r.from<i.to&&(t==e&&(t=e.slice()),t[n]=i.copy(i.from,r.from),Jo(t,o,i.copy(r.from,i.to)));break}r.to!=i.to&&(t==e&&(t=e.slice()),t[o]=r.copy(r.from,i.to),Jo(t,o+1,r.copy(i.to,r.to)))}}return t}function Jo(e,t,n){for(;t<e.length&&Qo(n,e[t])>0;)t++;e.splice(t,0,n)}function Zo(e){let t=[];return e.someProp("decorations",(n=>{let i=n(e.state);i&&i!=Ho&&t.push(i)})),e.cursorWrapper&&t.push($o.create(e.state.doc,[e.cursorWrapper.deco])),Vo.from(t)}const Xo={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},er=pn&&un<=11;class tr{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 nr{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new tr,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]);pn&&un<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),er&&(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,Xo)),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(Li(this.view)){if(this.suppressingSelectionUpdates)return Oi(this.view);if(pn&&un<=11&&!this.view.state.selection.empty){let e=this.view.domSelection();if(e.focusNode&&Cn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(e){if(0==e.rangeCount)return!0;let t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let n=e.domSelection(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Li(e)&&!this.ignoreSelectionChange(n),o=-1,r=-1,s=!1,a=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],a);n&&(o=o<0?n.from:Math.min(n.from,o),r=r<0?n.to:Math.max(n.to,r),n.typeOver&&(s=!0))}if(dn&&a.length>1){let e=a.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 l=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&e.input.lastTouch<Date.now()-300&&Sn(n)&&(l=Ci(e))&&l.eq(St.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Oi(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,r),function(e){if(ir.has(e))return;if(ir.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=dn,or)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."),or=!0}}(e)),this.handleDOMChange(o,r,s,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Oi(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 i=e.previousSibling,o=e.nextSibling;if(pn&&un<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:r}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(i=n),(!r||Array.prototype.indexOf.call(e.addedNodes,r)<0)&&(o=r)}let r=i&&i.parentNode==e.target?kn(i)+1:0,s=n.localPosFromDOM(e.target,r,-1),a=o&&o.parentNode==e.target?kn(o):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,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 ir=new WeakMap,or=!1;function rr(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(gn&&/^(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||gn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function sr(e,t,n,i,o){if(t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Ci(e,t);if(n&&!e.state.selection.eq(n)){let i=e.state.tr.setSelection(n);"pointer"==t?i.setMeta("pointer",!0):"key"==t&&i.scrollIntoView(),e.dispatch(i)}return}let r=e.state.doc.resolve(t),s=r.sharedDepth(n);t=r.before(s+1),n=e.state.doc.resolve(n).after(s+1);let a,l,c=e.state.selection,p=function(e,t,n){let i,{node:o,fromOffset:r,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelection(),p=c.anchorNode;if(p&&e.dom.contains(1==p.nodeType?p:p.parentNode)&&(i=[{node:p,offset:c.anchorOffset}],Sn(c)||i.push({node:c.focusNode,offset:c.focusOffset})),mn&&8===e.input.lastKeyCode)for(let e=s;e>r;e--){let t=o.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let u=e.state.doc,d=e.someProp("domParser")||Me.fromSchema(e.state.schema),h=u.resolve(a),m=null,f=d.parse(o,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:r,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:i,ruleFromNode:rr,context:h});if(i&&null!=i[0].pos){let e=i[0].pos,t=i[1]&&i[1].pos;null==t&&(t=e),m={anchor:e+a,head:t+a}}return{doc:f,sel:m,from:a,to:l}}(e,t,n),u=e.state.doc,d=u.slice(p.from,p.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(a=e.state.selection.to,l="end"):(a=e.state.selection.from,l="start"),e.input.lastKeyCode=null;let h=function(e,t,n,i,o){let r=e.findDiffStart(t,n);if(null==r)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==o){i-=s+Math.max(0,r-Math.min(s,a))-r}if(s<r&&e.size<t.size){r-=i<=r&&i>=s?r-i:0,a=r+(a-s),s=r}else if(a<r){r-=i<=r&&i>=a?r-i:0,s=r+(s-a),a=r}return{start:r,endA:s,endB:a}}(d.content,p.doc.content,p.from,a,l);if((bn&&e.input.lastIOSEnter>Date.now()-225||yn)&&o.some((e=>"DIV"==e.nodeName||"P"==e.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",(t=>t(e,An(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!h){if(!(i&&c instanceof zt&&!c.empty&&c.$head.sameParent(c.$anchor))||e.composing||p.sel&&p.sel.anchor!=p.sel.head){if(p.sel){let t=ar(e,e.state.doc,p.sel);t&&!t.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(t))}return}h={start:c.from,endA:c.to,endB:c.to}}if(mn&&e.cursorWrapper&&p.sel&&p.sel.anchor==e.cursorWrapper.deco.from&&p.sel.head==p.sel.anchor){let e=h.endB-h.start;p.sel={anchor:p.sel.anchor+e,head:p.sel.anchor+e}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&h.start==h.endB&&e.state.selection instanceof zt&&(h.start>e.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=p.from?h.start=e.state.selection.from:h.endA<e.state.selection.to&&h.endA>=e.state.selection.to-2&&e.state.selection.to<=p.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),pn&&un<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>p.from&&" "==p.doc.textBetween(h.start-p.from-1,h.start-p.from+1)&&(h.start--,h.endA--,h.endB--);let m,f=p.doc.resolveNoCache(h.start-p.from),g=p.doc.resolveNoCache(h.endB-p.from),b=u.resolve(h.start),v=f.sameParent(g)&&f.parent.inlineContent&&b.end()>=h.endA;if((bn&&e.input.lastIOSEnter>Date.now()-225&&(!v||o.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!v&&f.pos<p.doc.content.size&&(m=St.findFrom(p.doc.resolve(f.pos+1),1,!0))&&m.head==g.pos)&&e.someProp("handleKeyDown",(t=>t(e,An(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>h.start&&function(e,t,n,i,o){if(!i.parent.isTextblock||n-t<=o.pos-i.pos||lr(i,!0,!1)<o.pos)return!1;let r=e.resolve(t);if(r.parentOffset<r.parent.content.size||!r.parent.isTextblock)return!1;let s=e.resolve(lr(r,!0,!0));return!(!s.parent.isTextblock||s.pos>n||lr(s,!0,!1)<n)&&i.parent.content.cut(i.parentOffset).eq(s.parent.content)}(u,h.start,h.endA,f,g)&&e.someProp("handleKeyDown",(t=>t(e,An(8,"Backspace")))))return void(yn&&mn&&e.domObserver.suppressSelectionUpdates());mn&&yn&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),yn&&!v&&f.start()!=g.start()&&0==g.parentOffset&&f.depth==g.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==h.endA&&(h.endB-=2,g=p.doc.resolveNoCache(h.endB-p.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,An(13,"Enter"))}))}),20));let y,x,w,k=h.start,E=h.endA;if(v)if(f.pos==g.pos)pn&&un<=11&&0==f.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Oi(e)),20)),y=e.state.tr.delete(k,E),x=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(w=function(e,t){let n,i,o,r=e.firstChild.marks,s=t.firstChild.marks,a=r,l=s;for(let e=0;e<s.length;e++)a=s[e].removeFromSet(a);for(let e=0;e<r.length;e++)l=r[e].removeFromSet(l);if(1==a.length&&0==l.length)i=a[0],n="add",o=e=>e.mark(i.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;i=l[0],n="remove",o=e=>e.mark(i.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(o(t.child(e)));if(z.from(c).eq(e))return{mark:i,type:n}}(f.parent.content.cut(f.parentOffset,g.parentOffset),b.parent.content.cut(b.parentOffset,h.endA-b.start()))))y=e.state.tr,"add"==w.type?y.addMark(k,E,w.mark):y.removeMark(k,E,w.mark);else if(f.parent.child(f.index()).isText&&f.index()==g.index()-(g.textOffset?0:1)){let t=f.parent.textBetween(f.parentOffset,g.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,k,E,t))))return;y=e.state.tr.insertText(t,k,E)}if(y||(y=e.state.tr.replace(k,E,p.doc.slice(h.start-p.from,h.endB-p.from))),p.sel){let t=ar(e,y.doc,p.sel);t&&!(mn&&yn&&e.composing&&t.empty&&(h.start!=h.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==k||t.head==y.mapping.map(E)-1)||pn&&t.empty&&t.head==k)&&y.setSelection(t)}x&&y.ensureMarks(x),e.dispatch(y.scrollIntoView())}function ar(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:zi(e,t.resolve(n.anchor),t.resolve(n.head))}function lr(e,t,n){let i=e.depth,o=t?e.end():e.pos;for(;i>0&&(t||e.indexAfter(i)==e.node(i).childCount);)i--,o++,t=!1;if(n){let t=e.node(i).maybeChild(e.indexAfter(i));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}class cr{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 uo,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(mr),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=dr(this),ur(this),this.nodeViews=hr(this),this.docView=pi(this.state.doc,pr(this),Zo(this),this.dom,this),this.domObserver=new nr(this,((e,t,n,i)=>sr(this,e,t,n,i))),this.domObserver.start(),function(e){for(let t in lo){let n=lo[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!go(e,t)||fo(e,t)||!e.editable&&t.type in co||n(e,t)},po[t]?{passive:!0}:void 0)}gn&&e.dom.addEventListener("input",(()=>null)),mo(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&&mo(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(mr),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(To(this),o=!0),this.state=e;let r=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(r||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=hr(this);(function(e,t){let n=0,i=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let e in t)i++;return n!=i})(e,this.nodeViews)&&(this.nodeViews=e,i=!0)}(r||t.handleDOMEvents!=this._props.handleDOMEvents)&&mo(this),this.editable=dr(this),ur(this);let s=Zo(this),a=pr(this),l=n.plugins==e.plugins||n.doc.eq(e.doc)?e.scrollToSelection>n.scrollToSelection?"to selection":"preserve":"reset",c=i||!this.docView.matchesNode(e.doc,a,s);!c&&e.selection.eq(n.selection)||(o=!0);let p="preserve"==l&&o&&null==this.dom.style.overflowAnchor&&function(e){let t,n,i=e.dom.getBoundingClientRect(),o=Math.max(0,i.top);for(let r=(i.left+i.right)/2,s=o+1;s<Math.min(innerHeight,i.bottom);s+=5){let i=e.root.elementFromPoint(r,s);if(!i||i==e.dom||!e.dom.contains(i))continue;let a=i.getBoundingClientRect();if(a.top>=o-20){t=i,n=a.top;break}}return{refDOM:t,refTop:n,stack:Rn(e.dom)}}(this);if(o){this.domObserver.stop();let t=c&&(pn||mn)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(c){let n=mn?this.trackWrites=this.domSelection().focusNode:null;!i&&this.docView.update(e.doc,a,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=pi(e.doc,a,s,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return Cn(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Oi(this,t):(ji(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():p&&function({refDOM:e,refTop:t,stack:n}){let i=e?e.getBoundingClientRect().top:0;Fn(n,0==i?0:i-t)}(p)}scrollToSelection(){let e=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof Rt){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&Ln(this,t.getBoundingClientRect(),e)}else Ln(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}someProp(e,t){let n,i=this._props&&this._props[e];if(null!=i&&(n=t?t(i):i))return n;for(let i=0;i<this.directPlugins.length;i++){let o=this.directPlugins[i].props[e];if(null!=o&&(n=t?t(o):o))return n}let o=this.state.plugins;if(o)for(let i=0;i<o.length;i++){let r=o[i].props[e];if(null!=r&&(n=t?t(r):r))return n}}hasFocus(){if(pn){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(Pn)return e.focus(Pn);let t=Rn(e);e.focus(null==Pn?{get preventScroll(){return Pn={preventScroll:!0},!0}}:void 0),Pn||(Pn=!1,Fn(t,0))}(this.dom),Oi(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}posAtCoords(e){return Hn(this,e)}coordsAtPos(e,t=1){return Wn(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 i=this.docView.posFromDOM(e,t,n);if(null==i)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return ei(this,t||this.state,e)}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,[],Zo(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){fo(e,t)||!lo[t.type]||!e.editable&&t.type in co||lo[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelection(){return this.root.getSelection()}}function pr(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",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]))})),[Po.node(0,e.state.doc.content.size,t)]}function ur(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:Po.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function dr(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function hr(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 mr(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var fr={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:"'"},gr={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},br="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent);"undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent);for(var vr="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),yr="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),xr=vr||br&&+br[1]<57,wr=0;wr<10;wr++)fr[48+wr]=fr[96+wr]=String(wr);for(wr=1;wr<=24;wr++)fr[wr+111]="F"+wr;for(wr=65;wr<=90;wr++)fr[wr]=String.fromCharCode(wr+32),gr[wr]=String.fromCharCode(wr);for(var kr in fr)gr.hasOwnProperty(kr)||(gr[kr]=fr[kr]);const Er="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function _r(e){let t,n,i,o,r=e.split(/-(?!$)/),s=r[r.length-1];"Space"==s&&(s=" ");for(let e=0;e<r.length-1;e++){let s=r[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))i=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);Er?o=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),i&&(s="Shift-"+s),s}function Mr(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function Cr(e){let t=function(e){let t=Object.create(null);for(let n in e)t[_r(n)]=e[n];return t}(e);return function(e,n){let i,o=function(e){var t=!(xr&&(e.ctrlKey||e.altKey||e.metaKey)||yr&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?gr:fr)[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),r=1==o.length&&" "!=o,s=t[Mr(o,n,!r)];if(s&&s(e.state,e.dispatch,e))return!0;if(r&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(i=fr[n.keyCode])&&i!=o){let o=t[Mr(i,n,!0)];if(o&&o(e.state,e.dispatch,e))return!0}else if(r&&n.shiftKey){let i=t[Mr(o,n,!0)];if(i&&i(e.state,e.dispatch,e))return!0}return!1}}function Dr(e,t,n=!1){for(let i=e;i;i="start"==t?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(n&&1!=i.childCount)return!1}return!1}function Or(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 Tr(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function Nr(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Sr(e,t,n){let i,o,r=t.nodeBefore,s=t.nodeAfter;if(r.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){let i=t.nodeBefore,o=t.nodeAfter,r=t.index();return!(!(i&&o&&i.type.compatibleContent(o.type))||(!i.content.size&&t.parent.canReplace(r-1,r)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(r,r+1)||!o.isTextblock&&!mt(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,i.type,i.contentMatchAt(i.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(o=r.contentMatchAt(r.childCount)).findWrapping(s.type))&&o.matchType(i[0]||s.type).validEnd){if(n){let o=t.pos+s.nodeSize,a=z.empty;for(let e=i.length-1;e>=0;e--)a=z.from(i[e].create(null,a));a=z.from(r.copy(a));let l=e.tr.step(new at(t.pos-1,o,t.pos,o,new U(a,1,0),i.length,!0)),c=o+2*i.length;mt(l.doc,c)&&l.join(c),n(l.scrollIntoView())}return!0}let l=St.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),p=c&&pt(c);if(null!=p&&p>=t.depth)return n&&n(e.tr.lift(c,p).scrollIntoView()),!0;if(a&&Dr(s,"start",!0)&&Dr(r,"end")){let i=r,o=[];for(;o.push(i),!i.isTextblock;)i=i.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(i.canReplace(i.childCount,i.childCount,a.content)){if(n){let i=z.empty;for(let e=o.length-1;e>=0;e--)i=z.from(o[e].copy(i));n(e.tr.step(new at(t.pos-o.length,t.pos+s.nodeSize,t.pos+l,t.pos+s.nodeSize-l,new U(i,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Ar(e){return function(t,n){let i=t.selection,o=e<0?i.$from:i.$to,r=o.depth;for(;o.node(r).isInline;){if(!r)return!1;r--}return!!o.node(r).isTextblock&&(n&&n(t.tr.setSelection(zt.create(t.doc,e<0?o.start(r):o.end(r)))),!0)}}const jr=Ar(-1),Ir=Ar(1);function zr(e,t=null){return function(n,i){let{from:o,to:r}=n.selection,s=!1;return n.doc.nodesBetween(o,r,((i,o)=>{if(s)return!1;if(i.isTextblock&&!i.hasMarkup(e,t))if(i.type==e)s=!0;else{let t=n.doc.resolve(o),i=t.index();s=t.parent.canReplaceWith(i,i+1,e)}})),!!s&&(i&&i(n.tr.setBlockType(o,r,e,t).scrollIntoView()),!0)}}function Lr(e,t=null){return function(n,i){let{$from:o,$to:r}=n.selection,s=o.blockRange(r),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;let e=n.doc.resolve(s.start-2);l=new ie(e,e,s.depth),s.endIndex<s.parent.childCount&&(s=new ie(o,n.doc.resolve(r.end(s.depth)),s.depth)),a=!0}let c=ut(l,e,t,s);return!!c&&(i&&i(function(e,t,n,i,o){let r=z.empty;for(let e=n.length-1;e>=0;e--)r=z.from(n[e].type.create(n[e].attrs,r));e.step(new at(t.start-(i?2:0),t.end,t.start,t.end,new U(r,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==o&&(s=e+1);let a=n.length-s,l=t.start+n.length-(i?2:0),c=t.parent;for(let n=t.startIndex,i=t.endIndex,o=!0;n<i;n++,o=!1)!o&&ht(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(n).nodeSize;return e}(n.tr,s,c,a,e).scrollIntoView()),!0)}}function Rr(e){return function(t,n){let{$from:i,$to:o}=t.selection,r=i.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));return!!r&&(!n||(i.node(r.depth-1).type==e?function(e,t,n,i){let o=e.tr,r=i.end,s=i.$to.end(i.depth);r<s&&(o.step(new at(r-1,s,r,s,new U(z.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new ie(o.doc.resolve(i.$from.pos),o.doc.resolve(s),i.depth));const a=pt(i);if(null==a)return!1;o.lift(i,a);let l=o.mapping.map(r,-1)-1;mt(o.doc,l)&&o.join(l);return t(o.scrollIntoView()),!0}(t,n,e,r):function(e,t,n){let i=e.tr,o=n.parent;for(let e=n.end,t=n.endIndex-1,r=n.startIndex;t>r;t--)e-=o.child(t).nodeSize,i.delete(e-1,e+1);let r=i.doc.resolve(n.start),s=r.nodeAfter;if(i.mapping.map(n.end)!=n.start+r.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==o.childCount,c=r.node(-1),p=r.index(-1);if(!c.canReplace(p+(a?0:1),p+1,s.content.append(l?z.empty:z.from(o))))return!1;let u=r.pos,d=u+s.nodeSize;return i.step(new at(u-(a?1:0),d+(l?1:0),u+1,d-1,new U((a?z.empty:z.from(o.copy(z.empty))).append(l?z.empty:z.from(o.copy(z.empty))),a?0:1,l?0:1),a?0:1)),t(i.scrollIntoView()),!0}(t,n,r)))}}function Fr(e){const{state:t,transaction:n}=e;let{selection:i}=n,{doc:o}=n,{storedMarks:r}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return r},get selection(){return i},get doc(){return o},get tr(){return i=n.selection,o=n.doc,r=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class Pr{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:i}=t,{tr:o}=n,r=this.buildProps(o);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(r);return o.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(o),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:i,state:o}=this,{view:r}=i,s=[],a=!!e,l=e||o.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const i=this.buildProps(l,t),o=n(...e)(i);return s.push(o),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(l),s.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,i=!1,o=e||n.tr,r=this.buildProps(o,i),s=Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...r,dispatch:void 0})])));return{...s,chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:n,editor:i,state:o}=this,{view:r}=i;o.storedMarks&&e.setStoredMarks(o.storedMarks);const s={tr:e,editor:i,view:r,state:Fr({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map((([e,t])=>[e,(...e)=>t(...e)(s)])))}};return s}}function Br(e,t,n){if(void 0===e.config[t]&&e.parent)return Br(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?Br(e.parent,t,n):null})}return e.config[t]}function Ur(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function $r(e){const t=[],{nodeExtensions:n,markExtensions:i}=Ur(e),o=[...n,...i],r={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=Br(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,i])=>{t.push({type:n,name:e,attribute:{...r,...i}})}))}))}))})),o.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},i=Br(e,"addAttributes",n);if(!i)return;const o=i();Object.entries(o).forEach((([n,i])=>{const o={...r,...i};(null==i?void 0:i.isRequired)&&void 0===(null==i?void 0:i.default)&&delete o.default,t.push({type:e.name,name:n,attribute:o})}))})),t}function Hr(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 Vr(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]="class"===e?[n[e],t].join(" "):"style"===e?[n[e],t].join("; "):t:n[e]=t})),n}),{})}function qr(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)=>Vr(e,t)),{})}function Wr(e){return"function"==typeof e}function Kr(e,t=void 0,...n){return Wr(e)?t?e.bind(t)(...n):e(...n):e}function Yr(e,t){return e.style?e:{...e,getAttrs:n=>{const i=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===i)return!1;const o=t.reduce(((e,t)=>{const i=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==i?e:{...e,[t.name]:i}}),{});return{...i,...o}}}}function Qr(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 Gr(e,t){return t.nodes[e]||t.marks[e]||null}function Jr(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function Zr(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class Xr{constructor(e){this.find=e.find,this.handler=e.handler}}function es(e){var t;const{editor:n,from:i,to:o,text:r,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(i);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 p=!1;const u=((e,t=500)=>{let n="";const i=e.parentOffset;return e.parent.nodesBetween(Math.max(0,i-t),i,((e,t,o,r)=>{var s,a;const l=(null===(a=(s=e.type.spec).toText)||void 0===a?void 0:a.call(s,{node:e,pos:t,parent:o,index:r}))||e.textContent||"%leaf%";n+=l.slice(0,Math.max(0,i-t))})),n})(c)+r;return s.forEach((e=>{if(p)return;const t=((e,t)=>{if(Zr(t))return t.exec(e);const n=t(e);if(!n)return null;const i=[];return i.push(n.text),i.index=n.index,i.input=e,i.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),i.push(n.replaceWith)),i})(u,e.find);if(!t)return;const s=l.state.tr,c=Fr({state:l.state,transaction:s}),d={from:i-(t[0].length-r.length),to:o},{commands:h,chain:m,can:f}=new Pr({editor:n,state:c});null!==e.handler({state:c,range:d,match:t,commands:h,chain:m,can:f})&&s.steps.length&&(s.setMeta(a,{transform:s,from:i,to:o,text:r}),l.dispatch(s),p=!0)})),p}function ts(e){const{editor:t,rules:n}=e,i=new Xt({state:{init:()=>null,apply(e,t){const n=e.getMeta(i);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(e,o,r,s)=>es({editor:t,from:o,to:r,text:s,rules:n,plugin:i}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:o}=e.state.selection;o&&es({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:i})})),!1)},handleKeyDown(e,o){if("Enter"!==o.key)return!1;const{$cursor:r}=e.state.selection;return!!r&&es({editor:t,from:r.pos,to:r.pos,text:"\n",rules:n,plugin:i})}},isInputRules:!0});return i}class ns{constructor(e){this.find=e.find,this.handler=e.handler}}function is(e){const{editor:t,state:n,from:i,to:o,rule:r}=e,{commands:s,chain:a,can:l}=new Pr({editor:t,state:n}),c=[];n.doc.nodesBetween(i,o,((e,t)=>{if(!e.isTextblock||e.type.spec.code)return;const p=Math.max(i,t),u=Math.min(o,t+e.content.size),d=((e,t)=>{if(Zr(t))return[...e.matchAll(t)];const n=t(e);return n?n.map((t=>{const n=[];return n.push(t.text),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(p-t,u-t,void 0,""),r.find);d.forEach((e=>{if(void 0===e.index)return;const t=p+e.index+1,i=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(i)},u=r.handler({state:n,range:o,match:e,commands:s,chain:a,can:l});c.push(u)}))}));return c.every((e=>null!==e))}function rs(e){const{editor:t,rules:n}=e;let i=null,o=!1,r=!1;const s=n.map((e=>new Xt({view(e){const t=t=>{var n;i=(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=>(r=i===e.dom.parentElement,!1),paste:(e,t)=>{var n;const i=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return o=!!(null==i?void 0:i.includes("data-pm-slice")),!1}}},appendTransaction:(n,i,s)=>{const a=n[0],l="paste"===a.getMeta("uiEvent")&&!o,c="drop"===a.getMeta("uiEvent")&&!r;if(!l&&!c)return;const p=i.doc.content.findDiffStart(s.doc.content),u=i.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof p||!u||p===u.b)return;const d=s.tr,h=Fr({state:s,transaction:d});return is({editor:t,state:h,from:Math.max(p-1,0),to:u.b-1,rule:e})&&d.steps.length?d:void 0}})));return s}class ss{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=ss.resolve(e),this.schema=function(e){var t;const n=$r(e),{nodeExtensions:i,markExtensions:o}=Ur(e),r=null===(t=i.find((e=>Br(e,"topNode"))))||void 0===t?void 0:t.name,s=Object.fromEntries(i.map((t=>{const i=n.filter((e=>e.type===t.name)),o={name:t.name,options:t.options,storage:t.storage},r=e.reduce(((e,n)=>{const i=Br(n,"extendNodeSchema",o);return{...e,...i?i(t):{}}}),{}),s=Qr({...r,content:Kr(Br(t,"content",o)),marks:Kr(Br(t,"marks",o)),group:Kr(Br(t,"group",o)),inline:Kr(Br(t,"inline",o)),atom:Kr(Br(t,"atom",o)),selectable:Kr(Br(t,"selectable",o)),draggable:Kr(Br(t,"draggable",o)),code:Kr(Br(t,"code",o)),defining:Kr(Br(t,"defining",o)),isolating:Kr(Br(t,"isolating",o)),attrs:Object.fromEntries(i.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=Kr(Br(t,"parseHTML",o));a&&(s.parseDOM=a.map((e=>Yr(e,i))));const l=Br(t,"renderHTML",o);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:qr(e,i)}));const c=Br(t,"renderText",o);return c&&(s.toText=c),[t.name,s]}))),a=Object.fromEntries(o.map((t=>{const i=n.filter((e=>e.type===t.name)),o={name:t.name,options:t.options,storage:t.storage},r=e.reduce(((e,n)=>{const i=Br(n,"extendMarkSchema",o);return{...e,...i?i(t):{}}}),{}),s=Qr({...r,inclusive:Kr(Br(t,"inclusive",o)),excludes:Kr(Br(t,"excludes",o)),group:Kr(Br(t,"group",o)),spanning:Kr(Br(t,"spanning",o)),code:Kr(Br(t,"code",o)),attrs:Object.fromEntries(i.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=Kr(Br(t,"parseHTML",o));a&&(s.parseDOM=a.map((e=>Yr(e,i))));const l=Br(t,"renderHTML",o);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:qr(e,i)})),[t.name,s]})));return new Ee({topNode:r,nodes:s,marks:a})}(this.extensions),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:Gr(e.name,this.schema)};if("mark"===e.type){(null===(t=Kr(Br(e,"keepOnSplit",n)))||void 0===t||t)&&this.splittableMarks.push(e.name)}const i=Br(e,"onBeforeCreate",n);i&&this.editor.on("beforeCreate",i);const o=Br(e,"onCreate",n);o&&this.editor.on("create",o);const r=Br(e,"onUpdate",n);r&&this.editor.on("update",r);const s=Br(e,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=Br(e,"onTransaction",n);a&&this.editor.on("transaction",a);const l=Br(e,"onFocus",n);l&&this.editor.on("focus",l);const c=Br(e,"onBlur",n);c&&this.editor.on("blur",c);const p=Br(e,"onDestroy",n);p&&this.editor.on("destroy",p)}))}static resolve(e){const t=ss.sort(ss.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=Br(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...this.flatten(t())]:e})).flat(10)}static sort(e){const t=100;return e.sort(((e,n)=>{const i=Br(e,"priority")||t,o=Br(n,"priority")||t;return i>o?-1:i<o?1:0}))}get commands(){return this.extensions.reduce(((e,t)=>{const n=Br(t,"addCommands",{name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Gr(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=ss.sort([...this.extensions].reverse()),n=[],i=[],o=t.map((t=>{const o={name:t.name,options:t.options,storage:t.storage,editor:e,type:Gr(t.name,this.schema)},r=[],s=Br(t,"addKeyboardShortcuts",o);let a={};if("mark"===t.type&&t.config.exitable&&(a.ArrowRight=()=>ea.handleExit({editor:e,mark:t})),s){const t=Object.fromEntries(Object.entries(s()).map((([t,n])=>[t,()=>n({editor:e})])));a={...a,...t}}const l=new Xt({props:{handleKeyDown:Cr(a)}});r.push(l);const c=Br(t,"addInputRules",o);Jr(t,e.options.enableInputRules)&&c&&n.push(...c());const p=Br(t,"addPasteRules",o);Jr(t,e.options.enablePasteRules)&&p&&i.push(...p());const u=Br(t,"addProseMirrorPlugins",o);if(u){const e=u();r.push(...e)}return r})).flat();return[ts({editor:e,rules:n}),...rs({editor:e,rules:i}),...o]}get attributes(){return $r(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Ur(this.extensions);return Object.fromEntries(t.filter((e=>!!Br(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),i={name:t.name,options:t.options,storage:t.storage,editor:e,type:Hr(t.name,this.schema)},o=Br(t,"addNodeView",i);if(!o)return[];return[t.name,(i,r,s,a)=>{const l=qr(i,n);return o()({editor:e,node:i,getPos:s,decorations:a,HTMLAttributes:l,extension:t})}]})))}}function as(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function ls(e,t){const n={...e};return as(e)&&as(t)&&Object.keys(t).forEach((i=>{as(t[i])?i in e?n[i]=ls(e[i],t[i]):Object.assign(n,{[i]:t[i]}):Object.assign(n,{[i]:t[i]})})),n}class cs{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&&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=Kr(Br(this,"addOptions",{name:this.name}))),this.storage=Kr(Br(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new cs(e)}configure(e={}){const t=this.extend();return t.options=ls(this.options,e),t.storage=Kr(Br(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new cs(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=Kr(Br(t,"addOptions",{name:t.name})),t.storage=Kr(Br(t,"addStorage",{name:t.name,options:t.options})),t}}function ps(e,t,n){const{from:i,to:o}=t,{blockSeparator:r="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return e.nodesBetween(i,o,((e,n,c,p)=>{var u;const d=null==s?void 0:s[e.type.name];d?(e.isBlock&&!l&&(a+=r,l=!0),c&&(a+=d({node:e,pos:n,parent:c,index:p,range:t}))):e.isText?(a+=null===(u=null==e?void 0:e.text)||void 0===u?void 0:u.slice(Math.max(i,n)-n,o-n),l=!1):e.isBlock&&!l&&(a+=r,l=!0)})),a}function us(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}const ds=cs.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Xt({key:new nn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:i,selection:o}=t,{ranges:r}=o,s=Math.min(...r.map((e=>e.$from.pos))),a=Math.max(...r.map((e=>e.$to.pos)));return ps(i,{from:s,to:a},{textSerializers:us(n)})}}})]}});function hs(e,t,n={strict:!0}){const i=Object.keys(t);return!i.length||i.every((i=>n.strict?t[i]===e[i]:Zr(t[i])?t[i].test(e[i]):t[i]===e[i]))}function ms(e,t,n={}){return e.find((e=>e.type===t&&hs(e.attrs,n)))}function fs(e,t,n={}){return!!ms(e,t,n)}function gs(e,t,n={}){if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if(e.parentOffset===i.offset&&0!==i.offset&&(i=e.parent.childBefore(e.parentOffset)),!i.node)return;const o=ms([...i.node.marks],t,n);if(!o)return;let r=i.index,s=e.start()+i.offset,a=r+1,l=s+i.node.nodeSize;for(ms([...i.node.marks],t,n);r>0&&o.isInSet(e.parent.child(r-1).marks);)r-=1,s-=e.parent.child(r).nodeSize;for(;a<e.parent.childCount&&fs([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function bs(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 vs(e){return e instanceof zt}function ys(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function xs(e,t=null){if(!t)return null;const n=St.atStart(e),i=St.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return i;const o=n.from,r=i.to;return"all"===t?zt.create(e,ys(0,o,r),ys(e.content.size,o,r)):zt.create(e,ys(t,o,r),ys(t,o,r))}function ws(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function ks(e){const t=`<body>${e}</body>`;return(new window.DOMParser).parseFromString(t,"text/html").body}function Es(e,t,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof e&&null!==e)try{return Array.isArray(e)?z.fromArray(e.map((e=>t.nodeFromJSON(e)))):t.nodeFromJSON(e)}catch(i){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",i),Es("",t,n)}if("string"==typeof e){const i=Me.fromSchema(t);return n.slice?i.parseSlice(ks(e),n.parseOptions).content:i.parse(ks(e),n.parseOptions)}return Es("",t,n)}function _s(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function Ms(e,t,n={}){const{from:i,to:o,empty:r}=e.selection,s=t?Hr(t,e.schema):null,a=[];e.doc.nodesBetween(i,o,((e,t)=>{if(e.isText)return;const n=Math.max(i,t),r=Math.min(o,t+e.nodeSize);a.push({node:e,from:n,to:r})}));const l=o-i,c=a.filter((e=>!s||s.name===e.node.type.name)).filter((e=>hs(e.node.attrs,n,{strict:!1})));if(r)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=l}function Cs(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Ds(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,i)=>(n.includes(i)||(t[i]=e[i]),t)),{})}function Os(e,t,n={}){return Es(e,t,{slice:!1,parseOptions:n})}function Ts(e,t){const n=[];return e.descendants(((e,i)=>{t(e)&&n.push({node:e,pos:i})})),n}function Ns(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const i=e.node(n);if(t(i))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:i}}}(t.$from,e)}function Ss(e,t){const n=bs(t,e.schema),{from:i,to:o,empty:r}=e.selection,s=[];r?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(i,o,(e=>{s.push(...e.marks)}));const a=s.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function As(e,t){const n=Cs("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=Hr(t,e.schema),{from:i,to:o}=e.selection,r=[];e.doc.nodesBetween(i,o,(e=>{r.push(e)}));const s=r.reverse().find((e=>e.type.name===n.name));return s?{...s.attrs}:{}}(e,t):"mark"===n?Ss(e,t):{}}function js(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const i=t(e);return!Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const i=t.filter(((e,t)=>t!==n));return!i.some((t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}))}function Is(e,t,n){const i=[];return e===t?n.resolve(e).marks().forEach((t=>{const o=gs(n.resolve(e-1),t.type);o&&i.push({mark:t,...o})})):n.nodesBetween(e,t,((e,t)=>{i.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),i}function zs(e,t,n={}){const{empty:i,ranges:o}=e.selection,r=t?bs(t,e.schema):null;if(i)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!r||r.name===e.type.name)).find((e=>hs(e.attrs,n,{strict:!1})));let s=0;const a=[];if(o.forEach((({$from:t,$to:n})=>{const i=t.pos,o=n.pos;e.doc.nodesBetween(i,o,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(i,t),r=Math.min(o,t+e.nodeSize);s+=r-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:r}))))}))})),0===s)return!1;const l=a.filter((e=>!r||r.name===e.mark.type.name)).filter((e=>hs(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!r||e.mark.type!==r&&e.mark.type.excludes(r))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=s}function Ls(e,t){const{nodeExtensions:n}=Ur(t),i=n.find((t=>t.name===e));if(!i)return!1;const o=Kr(Br(i,"group",{name:i.name,options:i.options,storage:i.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function Rs(e,t,n){const i=0,o=e.state.doc.content.size,r=ys(t,i,o),s=ys(n,i,o),a=e.coordsAtPos(r),l=e.coordsAtPos(s,-1),c=Math.min(a.top,l.top),p=Math.max(a.bottom,l.bottom),u=Math.min(a.left,l.left),d=Math.max(a.right,l.right),h={top:c,bottom:p,left:u,right:d,width:d-u,height:p-c,x:u,y:c};return{...h,toJSON:()=>h}}function Fs(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const i=e.find((e=>e.type===t&&e.name===n));return!!i&&i.attribute.keepOnSplit})))}function Ps(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const i=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(i)}}const Bs=(e,t)=>{const n=Ns((e=>e.type===t))(e.selection);if(!n)return!0;const i=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===i)return!0;const o=e.doc.nodeAt(i);return n.node.type!==(null==o?void 0:o.type)||!mt(e.doc,n.pos)||(e.join(n.pos),!0)},Us=(e,t)=>{const n=Ns((e=>e.type===t))(e.selection);if(!n)return!0;const i=e.doc.resolve(n.start).after(n.depth);if(void 0===i)return!0;const o=e.doc.nodeAt(i);return n.node.type!==(null==o?void 0:o.type)||!mt(e.doc,i)||(e.join(i),!0)};var $s=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:i}=t,{ranges:o}=i;return!n||(o.forEach((({$from:n,$to:i})=>{e.doc.nodesBetween(n.pos,i.pos,((e,n)=>{if(e.type.isText)return;const{doc:i,mapping:o}=t,r=i.resolve(o.map(n)),s=i.resolve(o.map(n+e.nodeSize)),a=r.blockRange(s);if(!a)return;const l=pt(a);if(e.type.isTextblock){const{defaultType:e}=r.parent.contentMatchAt(r.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,{$from:i,$to:o}=n;if(n instanceof Pt||i.parent.inlineContent||o.parent.inlineContent)return!1;let r=Nr(o.parent.contentMatchAt(o.indexAfter()));if(!r||!r.isTextblock)return!1;if(t){let n=(!i.parentOffset&&o.index()<o.parent.childCount?i:o).pos,s=e.tr.insert(n,r.createAndFill());s.setSelection(zt.create(s.doc,n+1)),t(s.scrollIntoView())}return!0})(e,t),deleteNode:e=>({tr:t,state:n,dispatch:i})=>{const o=Hr(e,n.schema),r=t.selection.$anchor;for(let e=r.depth;e>0;e-=1){if(r.node(e).type===o){if(i){const n=r.before(e),i=r.after(e);t.delete(n,i).scrollIntoView()}return!0}}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{const{from:i,to:o}=e;return n&&t.delete(i,o),!0},deleteSelection:()=>({state:e,dispatch:t})=>((e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0))(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:i}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let o=n.node(-1),r=n.indexAfter(-1),s=Nr(o.contentMatchAt(r));if(!s||!o.canReplaceWith(r,r,s))return!1;if(t){let i=n.after(),o=e.tr.replaceWith(i,i,s.createAndFill());o.setSelection(St.near(o.doc.resolve(i),1)),t(o.scrollIntoView())}return!0})(e,t),extendMarkRange:(e,t={})=>({tr:n,state:i,dispatch:o})=>{const r=bs(e,i.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:p}=a;if(o){const e=gs(l,r,t);if(e&&e.from<=c&&e.to>=p){const t=zt.create(s,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:i,tr:o,dispatch:r})=>{t={scrollIntoView:!0,...t};const s=()=>{ws()&&i.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(i.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(i.hasFocus()&&null===e||!1===e)return!0;if(r&&null===e&&!vs(n.state.selection))return s(),!0;const a=xs(o.doc,e)||n.state.selection,l=n.state.selection.eq(a);return r&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},forEach:(e,t)=>n=>e.every(((e,i)=>t(e,{...n,index:i}))),insertContent:(e,t)=>({tr:n,commands:i})=>i.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),insertContentAt:(e,t,n)=>({tr:i,dispatch:o,editor:r})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const o=Es(t,r.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===o.toString())return!0;let{from:s,to:a}="number"==typeof e?{from:e,to:e}:e,l=!0,c=!0;if((o.toString().startsWith("<")?o:[o]).forEach((e=>{e.check(),l=!!l&&(e.isText&&0===e.marks.length),c=!!c&&e.isBlock})),s===a&&c){const{parent:e}=i.doc.resolve(s);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(s-=1,a+=1)}l?i.insertText(t,s,a):i.replaceWith(s,a,o),n.updateSelection&&function(e,t,n){const i=e.steps.length-1;if(i<t)return;const o=e.steps[i];if(!(o instanceof st||o instanceof at))return;const r=e.mapping.maps[i];let s=0;r.forEach(((e,t,n,i)=>{0===s&&(s=i)})),e.setSelection(St.near(e.doc.resolve(s),n))}(i,i.steps.length-1,-1)}return!0},joinBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:i}=e.selection;if(!i||(n?!n.endOfTextblock("backward",e):i.parentOffset>0))return!1;let o=Or(i);if(!o){let n=i.blockRange(),o=n&&pt(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let r=o.nodeBefore;if(!r.type.spec.isolating&&Sr(e,o,t))return!0;if(0==i.parent.content.size&&(Dr(r,"end")||Rt.isSelectable(r))){let n=gt(e.doc,i.before(),i.after(),U.empty);if(n&&n.slice.size<n.to-n.from){if(t){let i=e.tr.step(n);i.setSelection(Dr(r,"end")?St.findFrom(i.doc.resolve(i.mapping.map(o.pos,-1)),-1):Rt.create(i.doc,o.pos-r.nodeSize)),t(i.scrollIntoView())}return!0}}return!(!r.isAtom||o.depth!=i.depth-1||(t&&t(e.tr.delete(o.pos-r.nodeSize,o.pos).scrollIntoView()),0))})(e,t),joinForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:i}=e.selection;if(!i||(n?!n.endOfTextblock("forward",e):i.parentOffset<i.parent.content.size))return!1;let o=Tr(i);if(!o)return!1;let r=o.nodeAfter;if(Sr(e,o,t))return!0;if(0==i.parent.content.size&&(Dr(r,"start")||Rt.isSelectable(r))){let n=gt(e.doc,i.before(),i.after(),U.empty);if(n&&n.slice.size<n.to-n.from){if(t){let i=e.tr.step(n);i.setSelection(Dr(r,"start")?St.findFrom(i.doc.resolve(i.mapping.map(o.pos)),1):Rt.create(i.doc,i.mapping.map(o.pos))),t(i.scrollIntoView())}return!0}}return!(!r.isAtom||o.depth!=i.depth-1||(t&&t(e.tr.delete(o.pos,o.pos+r.nodeSize).scrollIntoView()),0))})(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:i,dispatch:o})=>{const r=function(e){const t=e.split(/-(?!$)/);let n,i,o,r,s=t[t.length-1];"Space"===s&&(s=" ");for(let e=0;e<t.length-1;e+=1){const s=t[e];if(/^(cmd|meta|m)$/i.test(s))r=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))i=!0;else if(/^s(hift)?$/i.test(s))o=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);ws()||_s()?r=!0:i=!0}}return n&&(s=`Alt-${s}`),i&&(s=`Ctrl-${s}`),r&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(e).split(/-(?!$)/),s=r.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:r.includes("Alt"),ctrlKey:r.includes("Ctrl"),metaKey:r.includes("Meta"),shiftKey:r.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(i.mapping);t&&o&&i.maybeStep(t)})),!0},lift:(e,t={})=>({state:n,dispatch:i})=>!!Ms(n,Hr(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:i}=e.selection,o=n.blockRange(i),r=o&&pt(o);return null!=r&&(t&&t(e.tr.lift(o,r).scrollIntoView()),!0)})(n,i),liftEmptyBlock:()=>({state:e,dispatch:t})=>((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(ht(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),o=i&&pt(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)})(e,t),liftListItem:e=>({state:t,dispatch:n})=>Rr(Hr(e,t.schema))(t,n),newlineInCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:i}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(i)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))})(e,t),resetAttributes:(e,t)=>({tr:n,state:i,dispatch:o})=>{let r=null,s=null;const a=Cs("string"==typeof e?e:e.name,i.schema);return!!a&&("node"===a&&(r=Hr(e,i.schema)),"mark"===a&&(s=bs(e,i.schema)),o&&n.selection.ranges.forEach((e=>{i.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,i)=>{r&&r===e.type&&n.setNodeMarkup(i,void 0,Ds(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((o=>{s===o.type&&n.addMark(i,i+e.nodeSize,s.create(Ds(o.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})=>((e,t,n)=>{let{$head:i,empty:o}=e.selection,r=i;if(!o)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):i.parentOffset>0)return!1;r=Or(i)}let s=r&&r.nodeBefore;return!(!s||!Rt.isSelectable(s)||(t&&t(e.tr.setSelection(Rt.create(e.doc,r.pos-s.nodeSize)).scrollIntoView()),0))})(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:i,empty:o}=e.selection,r=i;if(!o)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):i.parentOffset<i.parent.content.size)return!1;r=Tr(i)}let s=r&&r.nodeAfter;return!(!s||!Rt.isSelectable(s)||(t&&t(e.tr.setSelection(Rt.create(e.doc,r.pos)).scrollIntoView()),0))})(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:i,to:o}=e.selection,r=i.sharedDepth(o);return 0!=r&&(n=i.before(r),t&&t(e.tr.setSelection(Rt.create(e.doc,n))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>Ir(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>jr(e,t),setContent:(e,t=!1,n={})=>({tr:i,editor:o,dispatch:r})=>{const{doc:s}=i,a=Os(e,o.schema,n);return r&&i.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!t),!0},setMark:(e,t={})=>({tr:n,state:i,dispatch:o})=>{const{selection:r}=n,{empty:s,ranges:a}=r,l=bs(e,i.schema);if(o)if(s){const e=Ss(i,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const o=e.$from.pos,r=e.$to.pos;i.doc.nodesBetween(o,r,((e,i)=>{const s=Math.max(i,o),a=Math.min(i+e.nodeSize,r);e.marks.find((e=>e.type===l))?e.marks.forEach((e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))})):n.addMark(s,a,l.create(t))}))}));return function(e,t,n){var i;const{selection:o}=t;let r=null;if(vs(o)&&(r=o.$cursor),r){const t=null!==(i=e.storedMarks)&&void 0!==i?i:r.marks();return!!n.isInSet(t)||!t.some((e=>e.type.excludes(n)))}const{ranges:s}=o;return s.some((({$from:t,$to:i})=>{let o=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,i.pos,((e,t,i)=>{if(o)return!1;if(e.isInline){const t=!i||i.type.allowsMarkType(n),r=!!n.isInSet(e.marks)||!e.marks.some((e=>e.type.excludes(n)));o=t&&r}return!o})),o}))}(i,n,l)},setMeta:(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:i,chain:o})=>{const r=Hr(e,n.schema);return r.isTextblock?o().command((({commands:e})=>!!zr(r,t)(n)||e.clearNodes())).command((({state:e})=>zr(r,t)(e,i))).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,i=ys(e,0,n.content.size),o=Rt.create(n,i);t.setSelection(o)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:i,to:o}="number"==typeof e?{from:e,to:e}:e,r=zt.atStart(n).from,s=zt.atEnd(n).to,a=ys(i,r,s),l=ys(o,r,s),c=zt.create(n,a,l);t.setSelection(c)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{const i=Hr(e,t.schema);return(o=i,function(e,t){let{$from:n,$to:i}=e.selection,r=n.blockRange(i,(e=>e.childCount>0&&e.firstChild.type==o));if(!r)return!1;let s=r.startIndex;if(0==s)return!1;let a=r.parent,l=a.child(s-1);if(l.type!=o)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,i=z.from(n?o.create():null),s=new U(z.from(o.create(null,z.from(a.type.create(null,i)))),n?3:1,0),c=r.start,p=r.end;t(e.tr.step(new at(c-(n?3:1),p,c,p,s,1,!0)).scrollIntoView())}return!0})(t,n);var o},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:i,editor:o})=>{const{selection:r,doc:s}=t,{$from:a,$to:l}=r,c=Fs(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(r instanceof Rt&&r.node.isBlock)return!(!a.parentOffset||!ht(s,a.pos))&&(i&&(e&&Ps(n,o.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(i){const i=l.parentOffset===l.parent.content.size;r instanceof zt&&t.deleteSelection();const s=0===a.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}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=i&&s?[{type:s,attrs:c}]:void 0,u=ht(t.doc,t.mapping.map(a.pos),1,p);if(p||u||!ht(t.doc,t.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(u=!0,p=s?[{type:s,attrs:c}]:void 0),u&&(t.split(t.mapping.map(a.pos),1,p),s&&!i&&!a.parentOffset&&a.parent.type!==s)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,s)&&t.setNodeMarkup(t.mapping.map(a.before()),s)}e&&Ps(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return!0},splitListItem:e=>({tr:t,state:n,dispatch:i,editor:o})=>{var r;const s=Hr(e,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const p=a.node(-1);if(p.type!==s)return!1;const u=o.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(i){let e=z.empty;const n=a.index(-1)?1:a.index(-2)?2:3;for(let t=a.depth-n;t>=a.depth-3;t-=1)e=z.from(a.node(t).copy(e));const i=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,o=Fs(u,a.node().type.name,a.node().attrs),l=(null===(r=s.contentMatch.defaultType)||void 0===r?void 0:r.createAndFill(o))||void 0;e=e.append(z.from(s.createAndFill(null,l)||void 0));const c=a.before(a.depth-(n-1));t.replace(c,a.after(-i),new U(e,4-n,0));let p=-1;t.doc.nodesBetween(c,t.doc.content.size,((e,t)=>{if(p>-1)return!1;e.isTextblock&&0===e.content.size&&(p=t+1)})),p>-1&&t.setSelection(zt.near(t.doc.resolve(p))),t.scrollIntoView()}return!0}const d=l.pos===a.end()?p.contentMatchAt(0).defaultType:null,h=Fs(u,p.type.name,p.attrs),m=Fs(u,a.node().type.name,a.node().attrs);t.delete(a.pos,l.pos);const f=d?[{type:s,attrs:h},{type:d,attrs:m}]:[{type:s,attrs:h}];return!!ht(t.doc,a.pos,2)&&(i&&t.split(a.pos,2,f).scrollIntoView(),!0)},toggleList:(e,t)=>({editor:n,tr:i,state:o,dispatch:r,chain:s,commands:a,can:l})=>{const{extensions:c}=n.extensionManager,p=Hr(e,o.schema),u=Hr(t,o.schema),{selection:d}=o,{$from:h,$to:m}=d,f=h.blockRange(m);if(!f)return!1;const g=Ns((e=>Ls(e.type.name,c)))(d);if(f.depth>=1&&g&&f.depth-g.depth<=1){if(g.node.type===p)return a.liftListItem(u);if(Ls(g.node.type.name,c)&&p.validContent(g.node.content)&&r)return s().command((()=>(i.setNodeMarkup(g.pos,p),!0))).command((()=>Bs(i,p))).command((()=>Us(i,p))).run()}return s().command((()=>!!l().wrapInList(p)||a.clearNodes())).wrapInList(p).command((()=>Bs(i,p))).command((()=>Us(i,p))).run()},toggleMark:(e,t={},n={})=>({state:i,commands:o})=>{const{extendEmptyMarkRange:r=!1}=n,s=bs(e,i.schema);return zs(i,s,t)?o.unsetMark(s,{extendEmptyMarkRange:r}):o.setMark(s,t)},toggleNode:(e,t,n={})=>({state:i,commands:o})=>{const r=Hr(e,i.schema),s=Hr(t,i.schema);return Ms(i,r,n)?o.setNode(s):o.setNode(r,n)},toggleWrap:(e,t={})=>({state:n,commands:i})=>{const o=Hr(e,n.schema);return Ms(n,o,t)?i.lift(o):i.wrapIn(o,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let i=0;i<n.length;i+=1){const o=n[i];let r;if(o.spec.isInputRules&&(r=o.getState(e))){if(t){const t=e.tr,n=r.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(r.text){const n=t.doc.resolve(r.from).marks();t.replaceWith(r.from,r.to,e.schema.text(r.text,n))}else t.delete(r.from,r.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:i,ranges:o}=n;return i||t&&o.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},unsetMark:(e,t={})=>({tr:n,state:i,dispatch:o})=>{var r;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=bs(e,i.schema),{$from:c,empty:p,ranges:u}=a;if(!o)return!0;if(p&&s){let{from:e,to:t}=a;const i=null===(r=c.marks().find((e=>e.type===l)))||void 0===r?void 0:r.attrs,o=gs(c,l,i);o&&(e=o.from,t=o.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:i,dispatch:o})=>{let r=null,s=null;const a=Cs("string"==typeof e?e:e.name,i.schema);return!!a&&("node"===a&&(r=Hr(e,i.schema)),"mark"===a&&(s=bs(e,i.schema)),o&&n.selection.ranges.forEach((e=>{const o=e.$from.pos,a=e.$to.pos;i.doc.nodesBetween(o,a,((e,i)=>{r&&r===e.type&&n.setNodeMarkup(i,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach((r=>{if(s===r.type){const l=Math.max(i,o),c=Math.min(i+e.nodeSize,a);n.addMark(l,c,s.create({...r.attrs,...t}))}}))}))})),!0)},wrapIn:(e,t={})=>({state:n,dispatch:i})=>function(e,t=null){return function(n,i){let{$from:o,$to:r}=n.selection,s=o.blockRange(r),a=s&&ut(s,e,t);return!!a&&(i&&i(n.tr.wrap(s,a).scrollIntoView()),!0)}}(Hr(e,n.schema),t)(n,i),wrapInList:(e,t={})=>({state:n,dispatch:i})=>Lr(Hr(e,n.schema),t)(n,i)});const Hs=cs.create({name:"commands",addCommands:()=>({...$s})}),Vs=cs.create({name:"editable",addProseMirrorPlugins(){return[new Xt({key:new nn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),qs=cs.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Xt({key:new nn("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const i=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(i),!1},blur:(t,n)=>{e.isFocused=!1;const i=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(i),!1}}}})]}}),Ws=cs.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:i}=t,{empty:o,$anchor:r}=n,{pos:s,parent:a}=r,l=St.atStart(i).from===s;return!(!(o&&l&&a.type.isTextblock)||a.textContent.length)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()])),t=()=>this.editor.commands.first((({commands:e})=>[()=>e.deleteSelection(),()=>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()},i={...n},o={...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 ws()||_s()?o:i},addProseMirrorPlugins(){return[new Xt({key:new nn("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some((e=>e.docChanged))&&!t.doc.eq(n.doc)))return;const{empty:i,from:o,to:r}=t.selection,s=St.atStart(t.doc).from,a=St.atEnd(t.doc).to,l=o===s&&r===a,c=0===n.doc.textBetween(0,n.doc.content.size," "," ").length;if(i||!l||!c)return;const p=n.tr,u=Fr({state:n,transaction:p}),{commands:d}=new Pr({editor:this.editor,state:u});return d.clearNodes(),p.steps.length?p:void 0}})]}}),Ks=cs.create({name:"tabindex",addProseMirrorPlugins(){return[new Xt({key:new nn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var Ys=Object.freeze({__proto__:null,ClipboardTextSerializer:ds,Commands:Hs,Editable:Vs,FocusEvents:qs,Keymap:Ws,Tabindex:Ks});const Qs=`.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}`;function Gs(e){return new Xr({find:e.find,handler:({state:t,range:n,match:i})=>{const o=Kr(e.getAttributes,void 0,i);if(!1===o||null===o)return null;const{tr:r}=t,s=i[i.length-1],a=i[0];let l=n.to;if(s){const i=a.search(/\S/),c=n.from+a.indexOf(s),p=c+s.length,u=Is(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>c));if(u.length)return null;p<n.to&&r.delete(p,n.to),c>n.from&&r.delete(n.from+i,c),l=n.from+i+s.length,r.addMark(n.from+i,l,e.type.create(o||{})),r.removeStoredMark(e.type)}}})}function Js(e){return new Xr({find:e.find,handler:({state:t,range:n,match:i})=>{const o=Kr(e.getAttributes,void 0,i)||{},{tr:r}=t,s=n.from;let a=n.to;if(i[1]){let t=s+i[0].lastIndexOf(i[1]);t>a?t=a:a=t+i[1].length;const n=i[0][i[0].length-1];r.insertText(n,s+i[0].length-1),r.replaceWith(t,a,e.type.create(o))}else i[0]&&r.replaceWith(s,a,e.type.create(o))}})}function Zs(e){return new Xr({find:e.find,handler:({state:t,range:n,match:i})=>{const o=t.doc.resolve(n.from),r=Kr(e.getAttributes,void 0,i)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,r)}})}function Xs(e){return new Xr({find:e.find,handler:({state:t,range:n,match:i})=>{const o=Kr(e.getAttributes,void 0,i)||{},r=t.tr.delete(n.from,n.to),s=r.doc.resolve(n.from).blockRange(),a=s&&ut(s,e.type,o);if(!a)return null;r.wrap(s,a);const l=r.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&mt(r.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(i,l))&&r.join(n.from-1)}})}class ea{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&&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=Kr(Br(this,"addOptions",{name:this.name}))),this.storage=Kr(Br(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ea(e)}configure(e={}){const t=this.extend();return t.options=ls(this.options,e),t.storage=Kr(Br(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new ea(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=Kr(Br(t,"addOptions",{name:t.name})),t.storage=Kr(Br(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks(),r=!!o.find((e=>(null==e?void 0:e.type.name)===t.name));if(!r)return!1;const s=o.find((e=>(null==e?void 0:e.type.name)===t.name));return s&&n.removeStoredMark(s),n.insertText(" ",i.pos),e.view.dispatch(n),!0}return!1}}class ta{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&&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=Kr(Br(this,"addOptions",{name:this.name}))),this.storage=Kr(Br(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ta(e)}configure(e={}){const t=this.extend();return t.options=ls(this.options,e),t.storage=Kr(Br(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new ta(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=Kr(Br(t,"addOptions",{name:t.name})),t.storage=Kr(Br(t,"addStorage",{name:t.name,options:t.options})),t}}function na(e){return new ns({find:e.find,handler:({state:t,range:n,match:i})=>{const o=Kr(e.getAttributes,void 0,i);if(!1===o||null===o)return null;const{tr:r}=t,s=i[i.length-1],a=i[0];let l=n.to;if(s){const i=a.search(/\S/),c=n.from+a.indexOf(s),p=c+s.length,u=Is(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>c));if(u.length)return null;p<n.to&&r.delete(p,n.to),c>n.from&&r.delete(n.from+i,c),l=n.from+i+s.length,r.addMark(n.from+i,l,e.type.create(o||{})),r.removeStoredMark(e.type)}}})}function ia(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var oa="top",ra="bottom",sa="right",aa="left",la="auto",ca=[oa,ra,sa,aa],pa="start",ua="end",da="clippingParents",ha="viewport",ma="popper",fa="reference",ga=ca.reduce((function(e,t){return e.concat([t+"-"+pa,t+"-"+ua])}),[]),ba=[].concat(ca,[la]).reduce((function(e,t){return e.concat([t,t+"-"+pa,t+"-"+ua])}),[]),va=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ya(e){return e?(e.nodeName||"").toLowerCase():null}function xa(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function wa(e){return e instanceof xa(e).Element||e instanceof Element}function ka(e){return e instanceof xa(e).HTMLElement||e instanceof HTMLElement}function Ea(e){return"undefined"!=typeof ShadowRoot&&(e instanceof xa(e).ShadowRoot||e instanceof ShadowRoot)}var _a={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},o=t.elements[e];ka(o)&&ya(o)&&(Object.assign(o.style,n),Object.keys(i).forEach((function(e){var t=i[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var i=t.elements[e],o=t.attributes[e]||{},r=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});ka(i)&&ya(i)&&(Object.assign(i.style,r),Object.keys(o).forEach((function(e){i.removeAttribute(e)})))}))}},requires:["computeStyles"]};function Ma(e){return e.split("-")[0]}var Ca=Math.max,Da=Math.min,Oa=Math.round;function Ta(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Na(){return!/^((?!chrome|android).)*safari/i.test(Ta())}function Sa(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var i=e.getBoundingClientRect(),o=1,r=1;t&&ka(e)&&(o=e.offsetWidth>0&&Oa(i.width)/e.offsetWidth||1,r=e.offsetHeight>0&&Oa(i.height)/e.offsetHeight||1);var s=(wa(e)?xa(e):window).visualViewport,a=!Na()&&n,l=(i.left+(a&&s?s.offsetLeft:0))/o,c=(i.top+(a&&s?s.offsetTop:0))/r,p=i.width/o,u=i.height/r;return{width:p,height:u,top:c,right:l+p,bottom:c+u,left:l,x:l,y:c}}function Aa(e){var t=Sa(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function ja(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ea(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ia(e){return xa(e).getComputedStyle(e)}function za(e){return["table","td","th"].indexOf(ya(e))>=0}function La(e){return((wa(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ra(e){return"html"===ya(e)?e:e.assignedSlot||e.parentNode||(Ea(e)?e.host:null)||La(e)}function Fa(e){return ka(e)&&"fixed"!==Ia(e).position?e.offsetParent:null}function Pa(e){for(var t=xa(e),n=Fa(e);n&&za(n)&&"static"===Ia(n).position;)n=Fa(n);return n&&("html"===ya(n)||"body"===ya(n)&&"static"===Ia(n).position)?t:n||function(e){var t=/firefox/i.test(Ta());if(/Trident/i.test(Ta())&&ka(e)&&"fixed"===Ia(e).position)return null;var n=Ra(e);for(Ea(n)&&(n=n.host);ka(n)&&["html","body"].indexOf(ya(n))<0;){var i=Ia(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}function Ba(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ua(e,t,n){return Ca(e,Da(t,n))}function $a(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Ha(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var Va={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,o=e.options,r=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ma(n.placement),l=Ba(a),c=[aa,sa].indexOf(a)>=0?"height":"width";if(r&&s){var p=function(e,t){return $a("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Ha(e,ca))}(o.padding,n),u=Aa(r),d="y"===l?oa:aa,h="y"===l?ra:sa,m=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],f=s[l]-n.rects.reference[l],g=Pa(r),b=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,v=m/2-f/2,y=p[d],x=b-u[c]-p[h],w=b/2-u[c]/2+v,k=Ua(y,w,x),E=l;n.modifiersData[i]=((t={})[E]=k,t.centerOffset=k-w,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&ja(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qa(e){return e.split("-")[1]}var Wa={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ka(e){var t,n=e.popper,i=e.popperRect,o=e.placement,r=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,p=e.roundOffsets,u=e.isFixed,d=s.x,h=void 0===d?0:d,m=s.y,f=void 0===m?0:m,g="function"==typeof p?p({x:h,y:f}):{x:h,y:f};h=g.x,f=g.y;var b=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),y=aa,x=oa,w=window;if(c){var k=Pa(n),E="clientHeight",_="clientWidth";if(k===xa(n)&&"static"!==Ia(k=La(n)).position&&"absolute"===a&&(E="scrollHeight",_="scrollWidth"),o===oa||(o===aa||o===sa)&&r===ua)x=ra,f-=(u&&k===w&&w.visualViewport?w.visualViewport.height:k[E])-i.height,f*=l?1:-1;if(o===aa||(o===oa||o===ra)&&r===ua)y=sa,h-=(u&&k===w&&w.visualViewport?w.visualViewport.width:k[_])-i.width,h*=l?1:-1}var M,C=Object.assign({position:a},c&&Wa),D=!0===p?function(e){var t=e.x,n=e.y,i=window.devicePixelRatio||1;return{x:Oa(t*i)/i||0,y:Oa(n*i)/i||0}}({x:h,y:f}):{x:h,y:f};return h=D.x,f=D.y,l?Object.assign({},C,((M={})[x]=v?"0":"",M[y]=b?"0":"",M.transform=(w.devicePixelRatio||1)<=1?"translate("+h+"px, "+f+"px)":"translate3d("+h+"px, "+f+"px, 0)",M)):Object.assign({},C,((t={})[x]=v?f+"px":"",t[y]=b?h+"px":"",t.transform="",t))}var Ya={passive:!0};var Qa={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,i=e.options,o=i.scroll,r=void 0===o||o,s=i.resize,a=void 0===s||s,l=xa(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach((function(e){e.addEventListener("scroll",n.update,Ya)})),a&&l.addEventListener("resize",n.update,Ya),function(){r&&c.forEach((function(e){e.removeEventListener("scroll",n.update,Ya)})),a&&l.removeEventListener("resize",n.update,Ya)}},data:{}},Ga={left:"right",right:"left",bottom:"top",top:"bottom"};function Ja(e){return e.replace(/left|right|bottom|top/g,(function(e){return Ga[e]}))}var Za={start:"end",end:"start"};function Xa(e){return e.replace(/start|end/g,(function(e){return Za[e]}))}function el(e){var t=xa(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function tl(e){return Sa(La(e)).left+el(e).scrollLeft}function nl(e){var t=Ia(e),n=t.overflow,i=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+i)}function il(e){return["html","body","#document"].indexOf(ya(e))>=0?e.ownerDocument.body:ka(e)&&nl(e)?e:il(Ra(e))}function ol(e,t){var n;void 0===t&&(t=[]);var i=il(e),o=i===(null==(n=e.ownerDocument)?void 0:n.body),r=xa(i),s=o?[r].concat(r.visualViewport||[],nl(i)?i:[]):i,a=t.concat(s);return o?a:a.concat(ol(Ra(s)))}function rl(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function sl(e,t,n){return t===ha?rl(function(e,t){var n=xa(e),i=La(e),o=n.visualViewport,r=i.clientWidth,s=i.clientHeight,a=0,l=0;if(o){r=o.width,s=o.height;var c=Na();(c||!c&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:r,height:s,x:a+tl(e),y:l}}(e,n)):wa(t)?function(e,t){var n=Sa(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):rl(function(e){var t,n=La(e),i=el(e),o=null==(t=e.ownerDocument)?void 0:t.body,r=Ca(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=Ca(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-i.scrollLeft+tl(e),l=-i.scrollTop;return"rtl"===Ia(o||n).direction&&(a+=Ca(n.clientWidth,o?o.clientWidth:0)-r),{width:r,height:s,x:a,y:l}}(La(e)))}function al(e,t,n,i){var o="clippingParents"===t?function(e){var t=ol(Ra(e)),n=["absolute","fixed"].indexOf(Ia(e).position)>=0&&ka(e)?Pa(e):e;return wa(n)?t.filter((function(e){return wa(e)&&ja(e,n)&&"body"!==ya(e)})):[]}(e):[].concat(t),r=[].concat(o,[n]),s=r[0],a=r.reduce((function(t,n){var o=sl(e,n,i);return t.top=Ca(o.top,t.top),t.right=Da(o.right,t.right),t.bottom=Da(o.bottom,t.bottom),t.left=Ca(o.left,t.left),t}),sl(e,s,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ll(e){var t,n=e.reference,i=e.element,o=e.placement,r=o?Ma(o):null,s=o?qa(o):null,a=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(r){case oa:t={x:a,y:n.y-i.height};break;case ra:t={x:a,y:n.y+n.height};break;case sa:t={x:n.x+n.width,y:l};break;case aa:t={x:n.x-i.width,y:l};break;default:t={x:n.x,y:n.y}}var c=r?Ba(r):null;if(null!=c){var p="y"===c?"height":"width";switch(s){case pa:t[c]=t[c]-(n[p]/2-i[p]/2);break;case ua:t[c]=t[c]+(n[p]/2-i[p]/2)}}return t}function cl(e,t){void 0===t&&(t={});var n=t,i=n.placement,o=void 0===i?e.placement:i,r=n.strategy,s=void 0===r?e.strategy:r,a=n.boundary,l=void 0===a?da:a,c=n.rootBoundary,p=void 0===c?ha:c,u=n.elementContext,d=void 0===u?ma:u,h=n.altBoundary,m=void 0!==h&&h,f=n.padding,g=void 0===f?0:f,b=$a("number"!=typeof g?g:Ha(g,ca)),v=d===ma?fa:ma,y=e.rects.popper,x=e.elements[m?v:d],w=al(wa(x)?x:x.contextElement||La(e.elements.popper),l,p,s),k=Sa(e.elements.reference),E=ll({reference:k,element:y,strategy:"absolute",placement:o}),_=rl(Object.assign({},y,E)),M=d===ma?_:k,C={top:w.top-M.top+b.top,bottom:M.bottom-w.bottom+b.bottom,left:w.left-M.left+b.left,right:M.right-w.right+b.right},D=e.modifiersData.offset;if(d===ma&&D){var O=D[o];Object.keys(C).forEach((function(e){var t=[sa,ra].indexOf(e)>=0?1:-1,n=[oa,ra].indexOf(e)>=0?"y":"x";C[e]+=O[n]*t}))}return C}function pl(e,t){void 0===t&&(t={});var n=t,i=n.placement,o=n.boundary,r=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?ba:l,p=qa(i),u=p?a?ga:ga.filter((function(e){return qa(e)===p})):ca,d=u.filter((function(e){return c.indexOf(e)>=0}));0===d.length&&(d=u);var h=d.reduce((function(t,n){return t[n]=cl(e,{placement:n,boundary:o,rootBoundary:r,padding:s})[Ma(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var ul={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var o=n.mainAxis,r=void 0===o||o,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,p=n.boundary,u=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,m=void 0===h||h,f=n.allowedAutoPlacements,g=t.options.placement,b=Ma(g),v=l||(b===g||!m?[Ja(g)]:function(e){if(Ma(e)===la)return[];var t=Ja(e);return[Xa(e),t,Xa(t)]}(g)),y=[g].concat(v).reduce((function(e,n){return e.concat(Ma(n)===la?pl(t,{placement:n,boundary:p,rootBoundary:u,padding:c,flipVariations:m,allowedAutoPlacements:f}):n)}),[]),x=t.rects.reference,w=t.rects.popper,k=new Map,E=!0,_=y[0],M=0;M<y.length;M++){var C=y[M],D=Ma(C),O=qa(C)===pa,T=[oa,ra].indexOf(D)>=0,N=T?"width":"height",S=cl(t,{placement:C,boundary:p,rootBoundary:u,altBoundary:d,padding:c}),A=T?O?sa:aa:O?ra:oa;x[N]>w[N]&&(A=Ja(A));var j=Ja(A),I=[];if(r&&I.push(S[D]<=0),a&&I.push(S[A]<=0,S[j]<=0),I.every((function(e){return e}))){_=C,E=!1;break}k.set(C,I)}if(E)for(var z=function(e){var t=y.find((function(t){var n=k.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return _=t,"break"},L=m?3:1;L>0;L--){if("break"===z(L))break}t.placement!==_&&(t.modifiersData[i]._skip=!0,t.placement=_,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function dl(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function hl(e){return[oa,sa,ra,aa].some((function(t){return e[t]>=0}))}var ml={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,o=t.rects.popper,r=t.modifiersData.preventOverflow,s=cl(t,{elementContext:"reference"}),a=cl(t,{altBoundary:!0}),l=dl(s,i),c=dl(a,o,r),p=hl(l),u=hl(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}};var fl={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,o=n.offset,r=void 0===o?[0,0]:o,s=ba.reduce((function(e,n){return e[n]=function(e,t,n){var i=Ma(e),o=[aa,oa].indexOf(i)>=0?-1:1,r="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=r[0],a=r[1];return s=s||0,a=(a||0)*o,[aa,sa].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,r),e}),{}),a=s[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=s}};var gl={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ll({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var bl={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,o=n.mainAxis,r=void 0===o||o,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,p=n.altBoundary,u=n.padding,d=n.tether,h=void 0===d||d,m=n.tetherOffset,f=void 0===m?0:m,g=cl(t,{boundary:l,rootBoundary:c,padding:u,altBoundary:p}),b=Ma(t.placement),v=qa(t.placement),y=!v,x=Ba(b),w="x"===x?"y":"x",k=t.modifiersData.popperOffsets,E=t.rects.reference,_=t.rects.popper,M="function"==typeof f?f(Object.assign({},t.rects,{placement:t.placement})):f,C="number"==typeof M?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(k){if(r){var T,N="y"===x?oa:aa,S="y"===x?ra:sa,A="y"===x?"height":"width",j=k[x],I=j+g[N],z=j-g[S],L=h?-_[A]/2:0,R=v===pa?E[A]:_[A],F=v===pa?-_[A]:-E[A],P=t.elements.arrow,B=h&&P?Aa(P):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},$=U[N],H=U[S],V=Ua(0,E[A],B[A]),q=y?E[A]/2-L-V-$-C.mainAxis:R-V-$-C.mainAxis,W=y?-E[A]/2+L+V+H+C.mainAxis:F+V+H+C.mainAxis,K=t.elements.arrow&&Pa(t.elements.arrow),Y=K?"y"===x?K.clientTop||0:K.clientLeft||0:0,Q=null!=(T=null==D?void 0:D[x])?T:0,G=j+W-Q,J=Ua(h?Da(I,j+q-Q-Y):I,j,h?Ca(z,G):z);k[x]=J,O[x]=J-j}if(a){var Z,X="x"===x?oa:aa,ee="x"===x?ra:sa,te=k[w],ne="y"===w?"height":"width",ie=te+g[X],oe=te-g[ee],re=-1!==[oa,aa].indexOf(b),se=null!=(Z=null==D?void 0:D[w])?Z:0,ae=re?ie:te-E[ne]-_[ne]-se+C.altAxis,le=re?te+E[ne]+_[ne]-se-C.altAxis:oe,ce=h&&re?function(e,t,n){var i=Ua(e,t,n);return i>n?n:i}(ae,te,le):Ua(h?ae:ie,te,h?le:oe);k[w]=ce,O[w]=ce-te}t.modifiersData[i]=O}},requiresIfExists:["offset"]};function vl(e,t,n){void 0===n&&(n=!1);var i=ka(t),o=ka(t)&&function(e){var t=e.getBoundingClientRect(),n=Oa(t.width)/e.offsetWidth||1,i=Oa(t.height)/e.offsetHeight||1;return 1!==n||1!==i}(t),r=La(t),s=Sa(e,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&(("body"!==ya(t)||nl(r))&&(a=function(e){return e!==xa(e)&&ka(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:el(e);var t}(t)),ka(t)?((l=Sa(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=tl(r))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function yl(e){var t=new Map,n=new Set,i=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&o(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),i}var xl={placement:"bottom",modifiers:[],strategy:"absolute"};function wl(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function kl(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,i=void 0===n?[]:n,o=t.defaultOptions,r=void 0===o?xl:o;return function(e,t,n){void 0===n&&(n=r);var o,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},xl,r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,p={state:a,setOptions:function(n){var o="function"==typeof n?n(a.options):n;u(),a.options=Object.assign({},r,a.options,o),a.scrollParents={reference:wa(e)?ol(e):e.contextElement?ol(e.contextElement):[],popper:ol(t)};var s=function(e){var t=yl(e);return va.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(i,a.options.modifiers)));return a.orderedModifiers=s.filter((function(e){return e.enabled})),a.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,i=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var r=o({state:a,name:t,instance:p,options:i}),s=function(){};l.push(r||s)}})),p.update()},forceUpdate:function(){if(!c){var e=a.elements,t=e.reference,n=e.popper;if(wl(t,n)){a.rects={reference:vl(t,Pa(n),"fixed"===a.options.strategy),popper:Aa(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(e){return a.modifiersData[e.name]=Object.assign({},e.data)}));for(var i=0;i<a.orderedModifiers.length;i++)if(!0!==a.reset){var o=a.orderedModifiers[i],r=o.fn,s=o.options,l=void 0===s?{}:s,u=o.name;"function"==typeof r&&(a=r({state:a,options:l,name:u,instance:p})||a)}else a.reset=!1,i=-1}}},update:(o=function(){return new Promise((function(e){p.forceUpdate(),e(a)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(o())}))}))),s}),destroy:function(){u(),c=!0}};if(!wl(e,t))return p;function u(){l.forEach((function(e){return e()})),l=[]}return p.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),p}}var El=kl({defaultModifiers:[Qa,gl,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,o=void 0===i||i,r=n.adaptive,s=void 0===r||r,a=n.roundOffsets,l=void 0===a||a,c={placement:Ma(t.placement),variation:qa(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Ka(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ka(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},_a,fl,ul,bl,Va,ml]}),_l='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',Ml="tippy-box",Cl="tippy-content",Dl="tippy-backdrop",Ol="tippy-arrow",Tl="tippy-svg-arrow",Nl={passive:!0,capture:!0},Sl=function(){return document.body};function Al(e,t,n){if(Array.isArray(e)){var i=e[t];return null==i?Array.isArray(n)?n[t]:n:i}return e}function jl(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Il(e,t){return"function"==typeof e?e.apply(void 0,t):e}function zl(e,t){return 0===t?e:function(i){clearTimeout(n),n=setTimeout((function(){e(i)}),t)};var n}function Ll(e){return[].concat(e)}function Rl(e,t){-1===e.indexOf(t)&&e.push(t)}function Fl(e){return[].slice.call(e)}function Pl(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function Bl(){return document.createElement("div")}function Ul(e){return["Element","Fragment"].some((function(t){return jl(e,t)}))}function $l(e){return jl(e,"MouseEvent")}function Hl(e){return Ul(e)?[e]:function(e){return jl(e,"NodeList")}(e)?Fl(e):Array.isArray(e)?e:Fl(document.querySelectorAll(e))}function Vl(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function ql(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Wl(e){var t,n=Ll(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function Kl(e,t,n){var i=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[i](t,n)}))}function Yl(e,t){for(var n=t;n;){var i;if(e.contains(n))return!0;n=null==n.getRootNode||null==(i=n.getRootNode())?void 0:i.host}return!1}var Ql={isTouch:!1},Gl=0;function Jl(){Ql.isTouch||(Ql.isTouch=!0,window.performance&&document.addEventListener("mousemove",Zl))}function Zl(){var e=performance.now();e-Gl<20&&(Ql.isTouch=!1,document.removeEventListener("mousemove",Zl)),Gl=e}function Xl(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var ec=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,tc=Object.assign({appendTo:Sl,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),nc=Object.keys(tc);function ic(e){var t=(e.plugins||[]).reduce((function(t,n){var i,o=n.name,r=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(i=tc[o])?i:r);return t}),{});return Object.assign({},e,t)}function oc(e,t){var n=Object.assign({},t,{content:Il(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(ic(Object.assign({},tc,{plugins:t}))):nc).reduce((function(t,n){var i=(e.getAttribute("data-tippy-"+n)||"").trim();if(!i)return t;if("content"===n)t[n]=i;else try{t[n]=JSON.parse(i)}catch(e){t[n]=i}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},tc.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function rc(e,t){e["innerHTML"]=t}function sc(e){var t=Bl();return!0===e?t.className=Ol:(t.className=Tl,Ul(e)?t.appendChild(e):rc(t,e)),t}function ac(e,t){Ul(t.content)?(rc(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?rc(e,t.content):e.textContent=t.content)}function lc(e){var t=e.firstElementChild,n=Fl(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(Cl)})),arrow:n.find((function(e){return e.classList.contains(Ol)||e.classList.contains(Tl)})),backdrop:n.find((function(e){return e.classList.contains(Dl)}))}}function cc(e){var t=Bl(),n=Bl();n.className=Ml,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var i=Bl();function o(n,i){var o=lc(t),r=o.box,s=o.content,a=o.arrow;i.theme?r.setAttribute("data-theme",i.theme):r.removeAttribute("data-theme"),"string"==typeof i.animation?r.setAttribute("data-animation",i.animation):r.removeAttribute("data-animation"),i.inertia?r.setAttribute("data-inertia",""):r.removeAttribute("data-inertia"),r.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?r.setAttribute("role",i.role):r.removeAttribute("role"),n.content===i.content&&n.allowHTML===i.allowHTML||ac(s,e.props),i.arrow?a?n.arrow!==i.arrow&&(r.removeChild(a),r.appendChild(sc(i.arrow))):r.appendChild(sc(i.arrow)):a&&r.removeChild(a)}return i.className=Cl,i.setAttribute("data-state","hidden"),ac(i,e.props),t.appendChild(n),n.appendChild(i),o(e.props,e.props),{popper:t,onUpdate:o}}cc.$$tippy=!0;var pc=1,uc=[],dc=[];function hc(e,t){var n,i,o,r,s,a,l,c,p=oc(e,Object.assign({},tc,ic(Pl(t)))),u=!1,d=!1,h=!1,m=!1,f=[],g=zl(K,p.interactiveDebounce),b=pc++,v=(c=p.plugins).filter((function(e,t){return c.indexOf(e)===t})),y={id:b,reference:e,popper:Bl(),popperInstance:null,props:p,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(i),cancelAnimationFrame(o)},setProps:function(t){if(y.state.isDestroyed)return;j("onBeforeUpdate",[y,t]),q();var n=y.props,i=oc(e,Object.assign({},n,Pl(t),{ignoreAttributes:!0}));y.props=i,V(),n.interactiveDebounce!==i.interactiveDebounce&&(L(),g=zl(K,i.interactiveDebounce));n.triggerTarget&&!i.triggerTarget?Ll(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):i.triggerTarget&&e.removeAttribute("aria-expanded");z(),A(),k&&k(n,i);y.popperInstance&&(J(),X().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));j("onAfterUpdate",[y,t])},setContent:function(e){y.setProps({content:e})},show:function(){var e=y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,i=Ql.isTouch&&!y.props.touch,o=Al(y.props.duration,0,tc.duration);if(e||t||n||i)return;if(O().hasAttribute("disabled"))return;if(j("onShow",[y],!1),!1===y.props.onShow(y))return;y.state.isVisible=!0,D()&&(w.style.visibility="visible");A(),B(),y.state.isMounted||(w.style.transition="none");if(D()){var r=N(),s=r.box,l=r.content;Vl([s,l],0)}a=function(){var e;if(y.state.isVisible&&!m){if(m=!0,w.offsetHeight,w.style.transition=y.props.moveTransition,D()&&y.props.animation){var t=N(),n=t.box,i=t.content;Vl([n,i],o),ql([n,i],"visible")}I(),z(),Rl(dc,y),null==(e=y.popperInstance)||e.forceUpdate(),j("onMount",[y]),y.props.animation&&D()&&function(e,t){$(e,t)}(o,(function(){y.state.isShown=!0,j("onShown",[y])}))}},function(){var e,t=y.props.appendTo,n=O();e=y.props.interactive&&t===Sl||"parent"===t?n.parentNode:Il(t,[n]);e.contains(w)||e.appendChild(w);y.state.isMounted=!0,J()}()},hide:function(){var e=!y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,i=Al(y.props.duration,1,tc.duration);if(e||t||n)return;if(j("onHide",[y],!1),!1===y.props.onHide(y))return;y.state.isVisible=!1,y.state.isShown=!1,m=!1,u=!1,D()&&(w.style.visibility="hidden");if(L(),U(),A(!0),D()){var o=N(),r=o.box,s=o.content;y.props.animation&&(Vl([r,s],i),ql([r,s],"hidden"))}I(),z(),y.props.animation?D()&&function(e,t){$(e,(function(){!y.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&t()}))}(i,y.unmount):y.unmount()},hideWithInteractivity:function(e){T().addEventListener("mousemove",g),Rl(uc,g),g(e)},enable:function(){y.state.isEnabled=!0},disable:function(){y.hide(),y.state.isEnabled=!1},unmount:function(){y.state.isVisible&&y.hide();if(!y.state.isMounted)return;Z(),X().forEach((function(e){e._tippy.unmount()})),w.parentNode&&w.parentNode.removeChild(w);dc=dc.filter((function(e){return e!==y})),y.state.isMounted=!1,j("onHidden",[y])},destroy:function(){if(y.state.isDestroyed)return;y.clearDelayTimeouts(),y.unmount(),q(),delete e._tippy,y.state.isDestroyed=!0,j("onDestroy",[y])}};if(!p.render)return y;var x=p.render(y),w=x.popper,k=x.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+y.id,y.popper=w,e._tippy=y,w._tippy=y;var E=v.map((function(e){return e.fn(y)})),_=e.hasAttribute("aria-expanded");return V(),z(),A(),j("onCreate",[y]),p.showOnCreate&&ee(),w.addEventListener("mouseenter",(function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()})),w.addEventListener("mouseleave",(function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&T().addEventListener("mousemove",g)})),y;function M(){var e=y.props.touch;return Array.isArray(e)?e:[e,0]}function C(){return"hold"===M()[0]}function D(){var e;return!(null==(e=y.props.render)||!e.$$tippy)}function O(){return l||e}function T(){var e=O().parentNode;return e?Wl(e):document}function N(){return lc(w)}function S(e){return y.state.isMounted&&!y.state.isVisible||Ql.isTouch||r&&"focus"===r.type?0:Al(y.props.delay,e?0:1,tc.delay)}function A(e){void 0===e&&(e=!1),w.style.pointerEvents=y.props.interactive&&!e?"":"none",w.style.zIndex=""+y.props.zIndex}function j(e,t,n){var i;(void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(i=y.props)[e].apply(i,t)}function I(){var t=y.props.aria;if(t.content){var n="aria-"+t.content,i=w.id;Ll(y.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(y.state.isVisible)e.setAttribute(n,t?t+" "+i:i);else{var o=t&&t.replace(i,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function z(){!_&&y.props.aria.expanded&&Ll(y.props.triggerTarget||e).forEach((function(e){y.props.interactive?e.setAttribute("aria-expanded",y.state.isVisible&&e===O()?"true":"false"):e.removeAttribute("aria-expanded")}))}function L(){T().removeEventListener("mousemove",g),uc=uc.filter((function(e){return e!==g}))}function R(t){if(!Ql.isTouch||!h&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!y.props.interactive||!Yl(w,n)){if(Ll(y.props.triggerTarget||e).some((function(e){return Yl(e,n)}))){if(Ql.isTouch)return;if(y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else j("onClickOutside",[y,t]);!0===y.props.hideOnClick&&(y.clearDelayTimeouts(),y.hide(),d=!0,setTimeout((function(){d=!1})),y.state.isMounted||U())}}}function F(){h=!0}function P(){h=!1}function B(){var e=T();e.addEventListener("mousedown",R,!0),e.addEventListener("touchend",R,Nl),e.addEventListener("touchstart",P,Nl),e.addEventListener("touchmove",F,Nl)}function U(){var e=T();e.removeEventListener("mousedown",R,!0),e.removeEventListener("touchend",R,Nl),e.removeEventListener("touchstart",P,Nl),e.removeEventListener("touchmove",F,Nl)}function $(e,t){var n=N().box;function i(e){e.target===n&&(Kl(n,"remove",i),t())}if(0===e)return t();Kl(n,"remove",s),Kl(n,"add",i),s=i}function H(t,n,i){void 0===i&&(i=!1),Ll(y.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,i),f.push({node:e,eventType:t,handler:n,options:i})}))}function V(){var e;C()&&(H("touchstart",W,{passive:!0}),H("touchend",Y,{passive:!0})),(e=y.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(H(e,W),e){case"mouseenter":H("mouseleave",Y);break;case"focus":H(ec?"focusout":"blur",Q);break;case"focusin":H("focusout",Q)}}))}function q(){f.forEach((function(e){var t=e.node,n=e.eventType,i=e.handler,o=e.options;t.removeEventListener(n,i,o)})),f=[]}function W(e){var t,n=!1;if(y.state.isEnabled&&!G(e)&&!d){var i="focus"===(null==(t=r)?void 0:t.type);r=e,l=e.currentTarget,z(),!y.state.isVisible&&$l(e)&&uc.forEach((function(t){return t(e)})),"click"===e.type&&(y.props.trigger.indexOf("mouseenter")<0||u)&&!1!==y.props.hideOnClick&&y.state.isVisible?n=!0:ee(e),"click"===e.type&&(u=!n),n&&!i&&te(e)}}function K(e){var t=e.target,n=O().contains(t)||w.contains(t);if("mousemove"!==e.type||!n){var i=X().concat(w).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:p}:null})).filter(Boolean);(function(e,t){var n=t.clientX,i=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,r=e.props.interactiveBorder,s=o.placement.split("-")[0],a=o.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,c="top"===s?a.bottom.y:0,p="right"===s?a.left.x:0,u="left"===s?a.right.x:0,d=t.top-i+l>r,h=i-t.bottom-c>r,m=t.left-n+p>r,f=n-t.right-u>r;return d||h||m||f}))})(i,e)&&(L(),te(e))}}function Y(e){G(e)||y.props.trigger.indexOf("click")>=0&&u||(y.props.interactive?y.hideWithInteractivity(e):te(e))}function Q(e){y.props.trigger.indexOf("focusin")<0&&e.target!==O()||y.props.interactive&&e.relatedTarget&&w.contains(e.relatedTarget)||te(e)}function G(e){return!!Ql.isTouch&&C()!==e.type.indexOf("touch")>=0}function J(){Z();var t=y.props,n=t.popperOptions,i=t.placement,o=t.offset,r=t.getReferenceClientRect,s=t.moveTransition,l=D()?lc(w).arrow:null,c=r?{getBoundingClientRect:r,contextElement:r.contextElement||O()}:e,p={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(D()){var n=N().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},u=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},p];D()&&l&&u.push({name:"arrow",options:{element:l,padding:3}}),u.push.apply(u,(null==n?void 0:n.modifiers)||[]),y.popperInstance=El(c,w,Object.assign({},n,{placement:i,onFirstUpdate:a,modifiers:u}))}function Z(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function X(){return Fl(w.querySelectorAll("[data-tippy-root]"))}function ee(e){y.clearDelayTimeouts(),e&&j("onTrigger",[y,e]),B();var t=S(!0),i=M(),o=i[0],r=i[1];Ql.isTouch&&"hold"===o&&r&&(t=r),t?n=setTimeout((function(){y.show()}),t):y.show()}function te(e){if(y.clearDelayTimeouts(),j("onUntrigger",[y,e]),y.state.isVisible){if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&u)){var t=S(!1);t?i=setTimeout((function(){y.state.isVisible&&y.hide()}),t):o=requestAnimationFrame((function(){y.hide()}))}}else U()}}function mc(e,t){void 0===t&&(t={});var n=tc.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Jl,Nl),window.addEventListener("blur",Xl);var i=Object.assign({},t,{plugins:n}),o=Hl(e).reduce((function(e,t){var n=t&&hc(t,i);return n&&e.push(n),e}),[]);return Ul(e)?o[0]:o}mc.defaultProps=tc,mc.setDefaultProps=function(e){Object.keys(e).forEach((function(t){tc[t]=e[t]}))},mc.currentInput=Ql,Object.assign({},_a,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});var fc={clientX:0,clientY:0},gc=[];function bc(e){var t=e.clientX,n=e.clientY;fc={clientX:t,clientY:n}}var vc={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,n=Wl(e.props.triggerTarget||t),i=!1,o=!1,r=!0,s=e.props;function a(){return"initial"===e.props.followCursor&&e.state.isVisible}function l(){n.addEventListener("mousemove",u)}function c(){n.removeEventListener("mousemove",u)}function p(){i=!0,e.setProps({getReferenceClientRect:null}),i=!1}function u(n){var i=!n.target||t.contains(n.target),o=e.props.followCursor,r=n.clientX,s=n.clientY,a=t.getBoundingClientRect(),l=r-a.left,c=s-a.top;!i&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),n=r,i=s;"initial"===o&&(n=e.left+l,i=e.top+c);var a="horizontal"===o?e.top:i,p="vertical"===o?e.right:n,u="horizontal"===o?e.bottom:i,d="vertical"===o?e.left:n;return{width:p-d,height:u-a,top:a,right:p,bottom:u,left:d}}})}function d(){e.props.followCursor&&(gc.push({instance:e,doc:n}),function(e){e.addEventListener("mousemove",bc)}(n))}function h(){gc=gc.filter((function(t){return t.instance!==e})),0===gc.filter((function(e){return e.doc===n})).length&&function(e){e.removeEventListener("mousemove",bc)}(n)}return{onCreate:d,onDestroy:h,onBeforeUpdate:function(){s=e.props},onAfterUpdate:function(t,n){var r=n.followCursor;i||void 0!==r&&s.followCursor!==r&&(h(),r?(d(),!e.state.isMounted||o||a()||l()):(c(),p()))},onMount:function(){e.props.followCursor&&!o&&(r&&(u(fc),r=!1),a()||l())},onTrigger:function(e,t){$l(t)&&(fc={clientX:t.clientX,clientY:t.clientY}),o="focus"===t.type},onHidden:function(){e.props.followCursor&&(p(),c(),r=!0)}}}};mc.setDefaultProps({render:cc});class yc{constructor({editor:e,element:t,view:n,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:e,state:t,from:n,to:i})=>{const{doc:o,selection:r}=t,{empty:s}=r,a=!o.textBetween(n,i).length&&vs(t.selection),l=this.element.contains(document.activeElement);return!(!e.hasFocus()&&!l||s||a||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=mc(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,i,o;const{state:r,composing:s}=e,{doc:a,selection:l}=r,c=t&&t.doc.eq(a)&&t.selection.eq(l);if(s||c)return;this.createTooltip();const{ranges:p}=l,u=Math.min(...p.map((e=>e.$from.pos))),d=Math.max(...p.map((e=>e.$to.pos)));(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:r,oldState:t,from:u,to:d}))?(null===(i=this.tippy)||void 0===i||i.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||(()=>{if(r.selection instanceof Rt){const t=e.nodeDOM(u);if(t)return t.getBoundingClientRect()}return Rs(e,u,d)})}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const xc=e=>new Xt({key:"string"==typeof e.pluginKey?new nn(e.pluginKey):e.pluginKey,view:t=>new yc({view:t,...e})});cs.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[xc({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});class wc{constructor({editor:e,element:t,view:n,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:e,state:t})=>{const{selection:n}=t,{$anchor:i,empty:o}=n,r=1===i.depth,s=i.parent.isTextblock&&!i.parent.type.spec.code&&!i.parent.textContent;return!!(e.hasFocus()&&o&&r&&s&&this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=mc(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,i,o;const{state:r}=e,{doc:s,selection:a}=r,{from:l,to:c}=a;if(t&&t.doc.eq(s)&&t.selection.eq(a))return;this.createTooltip();(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:r,oldState:t}))?(null===(i=this.tippy)||void 0===i||i.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||(()=>Rs(e,l,c))}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}cs.create({name:"floatingMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[(e={pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow},new Xt({key:"string"==typeof e.pluginKey?new nn(e.pluginKey):e.pluginKey,view:t=>new wc({view:t,...e})}))]:[];var e}});const kc=e=>{const[n,i]=o(null);return r((()=>{if(!n)return;if(e.editor.isDestroyed)return;const{pluginKey:t="bubbleMenu",editor:i,tippyOptions:o={},shouldShow:r=null}=e,s=xc({pluginKey:t,editor:i,element:n,tippyOptions:o,shouldShow:r});return i.registerPlugin(s),()=>i.unregisterPlugin(t)}),[e.editor,n]),t.createElement("div",{ref:i,className:e.className,style:{visibility:"hidden"}},e.children)};class Ec extends class extends class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach((e=>e.apply(this,t))),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((e=>e!==t)):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))}),0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(e,t){const n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;const i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style",""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}(Qs,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e){this.setOptions({editable:e}),this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const n=Wr(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:n});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const t="string"==typeof e?`${e}$`:e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((e=>!e.key.startsWith(t)))});this.view.updateState(n)}createExtensionManager(){const e=[...this.options.enableCoreExtensions?Object.values(Ys):[],...this.options.extensions].filter((e=>["extension","node","mark"].includes(null==e?void 0:e.type)));this.extensionManager=new ss(e,this)}createCommandManager(){this.commandManager=new Pr({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Os(this.options.content,this.schema,this.options.parseOptions),t=xs(e,this.options.autofocus);this.view=new cr(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Jt.create({doc:e,selection:t||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews();this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((e=>{var t;return null===(t=this.capturedTransaction)||void 0===t?void 0:t.step(e)})):void(this.capturedTransaction=e);const t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return As(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,i="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return Ms(e,null,n)||zs(e,null,n);const i=Cs(t,e.schema);return"node"===i?Ms(e,t,n):"mark"===i&&zs(e,t,n)}(this.state,n,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(e,t){const n=Fe.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){return ps(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...n,...us(this.schema)}})}get isEmpty(){return function(e){var t;const n=null===(t=e.type.createAndFill())||void 0===t?void 0:t.toJSON(),i=e.toJSON();return JSON.stringify(n)===JSON.stringify(i)}(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(null===(e=this.view)||void 0===e?void 0:e.docView)}}{constructor(){super(...arguments),this.contentComponent=null}}const _c=({renderers:e})=>t.createElement(t.Fragment,null,Array.from(e).map((([e,t])=>h.createPortal(t.reactElement,t.element,e))));class Mc extends t.Component{constructor(e){super(e),this.editorContentRef=t.createRef(),this.state={renderers:new Map}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:e}=this.props;if(e&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=this,e.createNodeViews()}}componentWillUnmount(){const{editor:e}=this.props;if(!e)return;if(e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild)return;const t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){const{editor:e,...n}=this.props;return t.createElement(t.Fragment,null,t.createElement("div",{ref:this.editorContentRef,...n}),t.createElement(_c,{renderers:this.state.renderers}))}}const Cc=t.memo(Mc),Dc=n({onDragStart:void 0}),Oc=()=>i(Dc),Tc=e=>{const n=e.as||"div",{nodeViewContentRef:i}=Oc();return t.createElement(n,{...e,ref:i,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style}})},Nc=t.forwardRef(((e,n)=>{const{onDragStart:i}=Oc(),o=e.as||"div";return t.createElement(o,{...e,ref:n,"data-node-view-wrapper":"",onDragStart:i,style:{whiteSpace:"normal",...e.style}})}));class Sc{constructor(e,{editor:t,props:n={},as:i="div",className:o=""}){this.ref=null,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.render()}render(){const e=this.component,n=this.props;(function(e){return!("function"!=typeof e||!e.prototype||!e.prototype.isReactComponent)}(e)||function(e){var t;return!("object"!=typeof e||"Symbol(react.forward_ref)"!==(null===(t=e.$$typeof)||void 0===t?void 0:t.toString()))}(e))&&(n.ref=e=>{this.ref=e}),this.reactElement=t.createElement(e,{...n}),m((()=>{var e;(null===(e=this.editor)||void 0===e?void 0:e.contentComponent)&&this.editor.contentComponent.setState({renderers:this.editor.contentComponent.state.renderers.set(this.id,this)})}))}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){m((()=>{var e;if(null===(e=this.editor)||void 0===e?void 0:e.contentComponent){const{renderers:e}=this.editor.contentComponent.state;e.delete(this.id),this.editor.contentComponent.setState({renderers:e})}}))}}class Ac extends class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,i,o,r,s,a;const{view:l}=this.editor,c=e.target,p=3===c.nodeType?null===(t=c.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(c))||!p)return;let u=0,d=0;if(this.dom!==p){const t=this.dom.getBoundingClientRect(),n=p.getBoundingClientRect(),a=null!==(i=e.offsetX)&&void 0!==i?i:null===(o=e.nativeEvent)||void 0===o?void 0:o.offsetX,l=null!==(r=e.offsetY)&&void 0!==r?r:null===(s=e.nativeEvent)||void 0===s?void 0:s.offsetY;u=n.x-t.x+a,d=n.y-t.y+l}null===(a=e.dataTransfer)||void 0===a||a.setDragImage(this.dom,u,d);const h=Rt.create(l.state.doc,this.getPos()),m=l.state.tr.setSelection(h);l.dispatch(m)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!(null===(t=this.contentDOM)||void 0===t?void 0:t.contains(n))))return!1;const i="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!i)return!0;const{isEditable:o}=this.editor,{isDragging:r}=this,s=!!this.node.type.spec.draggable,a=Rt.isSelectable(this.node),l="copy"===e.type,c="paste"===e.type,p="cut"===e.type,u="mousedown"===e.type,d=e.type.startsWith("drag");if(!s&&a&&d&&e.preventDefault(),s&&d&&!r)return e.preventDefault(),!1;if(s&&o&&!r&&u){const e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",(()=>{this.isDragging=!1}),{once:!0}),document.addEventListener("mouseup",(()=>{this.isDragging=!1}),{once:!0}))}return!(r||i||l||c||p||u&&a)}ignoreMutation(e){if(!this.dom||!this.contentDOM)return!0;if("function"==typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:e});if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&ws()&&this.editor.isFocused){if([...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every((e=>e.isContentEditable)))return!1}return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command((({tr:t})=>{const n=this.getPos();return t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0}))}deleteNode(){const e=this.getPos(),t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}const n=e=>{const n=this.component,i=this.onDragStart.bind(this);return t.createElement(Dc.Provider,{value:{onDragStart:i,nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&e.appendChild(this.contentDOMElement)}}},t.createElement(n,{...e}))};n.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let i=this.node.isInline?"span":"div";this.options.as&&(i=this.options.as);const{className:o=""}=this.options;this.renderer=new Sc(n,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${o}`.trim()})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(null===(e=this.renderer.element.firstElementChild)||void 0===e?void 0:e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(e,t){const n=e=>{this.renderer.updateProps(e)};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){const i=this.node,o=this.decorations;return this.node=e,this.decorations=t,this.options.update({oldNode:i,oldDecorations:o,newNode:e,newDecorations:t,updateProps:()=>n({node:e,decorations:t})})}return e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,n({node:e,decorations:t})),!0}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}}function jc(e,t){return n=>n.editor.contentComponent?new Ac(e,n,t):{}}const Ic=(e={},t=[])=>{const[n,i]=o(null),s=function(){const[,e]=o(0);return()=>e((e=>e+1))}();return r((()=>{let t=!0;const n=new Ec(e);return i(n),n.on("transaction",(()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t&&s()}))}))})),()=>{n.destroy(),t=!1}}),t),n};var zc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Lc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function Rc(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})})),n}var Fc,Pc={exports:{}};
|
|
2
2
|
/*!
|
|
3
3
|
Copyright (c) 2018 Jed Watson.
|
|
4
4
|
Licensed under the MIT License (MIT), see
|