@bigbinary/neeto-editor 0.12.12 → 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 +10 -3
- package/build/index.js +2 -2
- 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
|
|
@@ -58,4 +58,4 @@ return e.mode.CTRGladman=function(){var t=e.lib.BlockCipherMode.extend();functio
|
|
|
58
58
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
59
59
|
*/
|
|
60
60
|
return function(t){var n=e,i=n.lib,o=i.WordArray,r=i.Hasher,s=n.algo,a=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),l=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),p=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=o.create([0,1518500249,1859775393,2400959708,2840853838]),d=o.create([1352829926,1548603684,1836072691,2053994217,0]),h=s.RIPEMD160=r.extend({_doReset:function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var i=t+n,o=e[i];e[i]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var r,s,h,x,w,k,E,_,M,C,D,O=this._hash.words,T=u.words,N=d.words,S=a.words,A=l.words,j=c.words,I=p.words;for(k=r=O[0],E=s=O[1],_=h=O[2],M=x=O[3],C=w=O[4],n=0;n<80;n+=1)D=r+e[t+S[n]]|0,D+=n<16?m(s,h,x)+T[0]:n<32?f(s,h,x)+T[1]:n<48?g(s,h,x)+T[2]:n<64?b(s,h,x)+T[3]:v(s,h,x)+T[4],D=(D=y(D|=0,j[n]))+w|0,r=w,w=x,x=y(h,10),h=s,s=D,D=k+e[t+A[n]]|0,D+=n<16?v(E,_,M)+N[0]:n<32?b(E,_,M)+N[1]:n<48?g(E,_,M)+N[2]:n<64?f(E,_,M)+N[3]:m(E,_,M)+N[4],D=(D=y(D|=0,I[n]))+C|0,k=C,C=M,M=y(_,10),_=E,E=D;D=O[1]+h+M|0,O[1]=O[2]+x+C|0,O[2]=O[3]+w+k|0,O[3]=O[4]+r+E|0,O[4]=O[0]+s+_|0,O[0]=D},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32,t[(i+64>>>9<<4)+14]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,r=o.words,s=0;s<5;s++){var a=r[s];r[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return o},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});function m(e,t,n){return e^t^n}function f(e,t,n){return e&t|~e&n}function g(e,t,n){return(e|~t)^n}function b(e,t,n){return e&n|t&~n}function v(e,t,n){return e^(t|~n)}function y(e,t){return e<<t|e>>>32-t}n.RIPEMD160=r._createHelper(h),n.HmacRIPEMD160=r._createHmacHelper(h)}(),e.RIPEMD160}(EA())),lj(),cj||(cj=1,pj.exports=function(e){return function(){var t=e,n=t.lib,i=n.Base,o=n.WordArray,r=t.algo,s=r.SHA1,a=r.HMAC,l=r.PBKDF2=i.extend({cfg:i.extend({keySize:128/32,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,i=a.create(n.hasher,e),r=o.create(),s=o.create([1]),l=r.words,c=s.words,p=n.keySize,u=n.iterations;l.length<p;){var d=i.update(t).finalize(s);i.reset();for(var h=d.words,m=h.length,f=d,g=1;g<u;g++){f=i.finalize(f),i.reset();for(var b=f.words,v=0;v<m;v++)h[v]^=b[v]}r.concat(d),c[0]++}return r.sigBytes=4*p,r}});t.PBKDF2=function(e,t,n){return l.create(n).compute(e,t)}}(),e.PBKDF2}(EA(),VA(),lj())),hj(),gj(),yj(),kj(),Mj(),Oj(),Tj||(Tj=1,Nj.exports=function(e){return e.mode.ECB=((t=e.lib.BlockCipherMode.extend()).Encryptor=t.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),t.Decryptor=t.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),t),e.mode.ECB;var t}(EA(),gj())),Sj||(Sj=1,Aj.exports=function(e){return e.pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,i=4*t,o=i-n%i,r=n+o-1;e.clamp(),e.words[r>>>2]|=o<<24-r%4*8,e.sigBytes+=o},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923}(EA(),gj())),jj||(jj=1,Ij.exports=function(e){return e.pad.Iso10126={pad:function(t,n){var i=4*n,o=i-t.sigBytes%i;t.concat(e.lib.WordArray.random(o-1)).concat(e.lib.WordArray.create([o<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Iso10126}(EA(),gj())),zj||(zj=1,Lj.exports=function(e){return e.pad.Iso97971={pad:function(t,n){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,n)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971}(EA(),gj())),Rj||(Rj=1,Fj.exports=function(e){return e.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},e.pad.ZeroPadding}(EA(),gj())),Pj||(Pj=1,Bj.exports=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding}(EA(),gj())),Uj||(Uj=1,$j.exports=function(e){return function(t){var n=e,i=n.lib.CipherParams,o=n.enc.Hex;n.format.Hex={stringify:function(e){return e.ciphertext.toString(o)},parse:function(e){var t=o.parse(e);return i.create({ciphertext:t})}}}(),e.format.Hex}(EA(),gj())),Hj||(Hj=1,Vj.exports=function(e){return function(){var t=e,n=t.lib.BlockCipher,i=t.algo,o=[],r=[],s=[],a=[],l=[],c=[],p=[],u=[],d=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,i=0;for(t=0;t<256;t++){var m=i^i<<1^i<<2^i<<3^i<<4;m=m>>>8^255&m^99,o[n]=m,r[m]=n;var f=e[n],g=e[f],b=e[g],v=257*e[m]^16843008*m;s[n]=v<<24|v>>>8,a[n]=v<<16|v>>>16,l[n]=v<<8|v>>>24,c[n]=v,v=16843009*b^65537*g^257*f^16843008*n,p[m]=v<<24|v>>>8,u[m]=v<<16|v>>>16,d[m]=v<<8|v>>>24,h[m]=v,n?(n=f^e[e[e[b^f]]],i^=e[e[i]]):n=i=1}}();var m=[0,1,2,4,8,16,32,64,128,27,54],f=i.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,i=4*((this._nRounds=n+6)+1),r=this._keySchedule=[],s=0;s<i;s++)s<n?r[s]=t[s]:(c=r[s-1],s%n?n>6&&s%n==4&&(c=o[c>>>24]<<24|o[c>>>16&255]<<16|o[c>>>8&255]<<8|o[255&c]):(c=o[(c=c<<8|c>>>24)>>>24]<<24|o[c>>>16&255]<<16|o[c>>>8&255]<<8|o[255&c],c^=m[s/n|0]<<24),r[s]=r[s-n]^c);for(var a=this._invKeySchedule=[],l=0;l<i;l++){if(s=i-l,l%4)var c=r[s];else c=r[s-4];a[l]=l<4||s<=4?c:p[o[c>>>24]]^u[o[c>>>16&255]]^d[o[c>>>8&255]]^h[o[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,l,c,o)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,p,u,d,h,r),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,i,o,r,s,a){for(var l=this._nRounds,c=e[t]^n[0],p=e[t+1]^n[1],u=e[t+2]^n[2],d=e[t+3]^n[3],h=4,m=1;m<l;m++){var f=i[c>>>24]^o[p>>>16&255]^r[u>>>8&255]^s[255&d]^n[h++],g=i[p>>>24]^o[u>>>16&255]^r[d>>>8&255]^s[255&c]^n[h++],b=i[u>>>24]^o[d>>>16&255]^r[c>>>8&255]^s[255&p]^n[h++],v=i[d>>>24]^o[c>>>16&255]^r[p>>>8&255]^s[255&u]^n[h++];c=f,p=g,u=b,d=v}f=(a[c>>>24]<<24|a[p>>>16&255]<<16|a[u>>>8&255]<<8|a[255&d])^n[h++],g=(a[p>>>24]<<24|a[u>>>16&255]<<16|a[d>>>8&255]<<8|a[255&c])^n[h++],b=(a[u>>>24]<<24|a[d>>>16&255]<<16|a[c>>>8&255]<<8|a[255&p])^n[h++],v=(a[d>>>24]<<24|a[c>>>16&255]<<16|a[p>>>8&255]<<8|a[255&u])^n[h++],e[t]=f,e[t+1]=g,e[t+2]=b,e[t+3]=v},keySize:256/32});t.AES=n._createHelper(f)}(),e.AES}(EA(),zA(),UA(),hj(),gj())),Kj(),Yj||(Yj=1,Qj.exports=function(e){return function(){var t=e,n=t.lib.StreamCipher,i=t.algo,o=i.RC4=n.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,i=this._S=[],o=0;o<256;o++)i[o]=o;o=0;for(var r=0;o<256;o++){var s=o%n,a=t[s>>>2]>>>24-s%4*8&255;r=(r+i[o]+a)%256;var l=i[o];i[o]=i[r],i[r]=l}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=r.call(this)},keySize:256/32,ivSize:0});function r(){for(var e=this._S,t=this._i,n=this._j,i=0,o=0;o<4;o++){n=(n+e[t=(t+1)%256])%256;var r=e[t];e[t]=e[n],e[n]=r,i|=e[(e[t]+e[n])%256]<<24-8*o}return this._i=t,this._j=n,i}t.RC4=n._createHelper(o);var s=i.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)r.call(this)}});t.RC4Drop=n._createHelper(s)}(),e.RC4}(EA(),zA(),UA(),hj(),gj())),Gj||(Gj=1,Jj.exports=function(e){return function(){var t=e,n=t.lib.StreamCipher,i=t.algo,o=[],r=[],s=[],a=i.Rabbit=n.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var i=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)l.call(this);for(n=0;n<8;n++)o[n]^=i[n+4&7];if(t){var r=t.words,s=r[0],a=r[1],c=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),p=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=c>>>16|4294901760&p,d=p<<16|65535&c;for(o[0]^=c,o[1]^=u,o[2]^=p,o[3]^=d,o[4]^=c,o[5]^=u,o[6]^=p,o[7]^=d,n=0;n<4;n++)l.call(this)}},_doProcessBlock:function(e,t){var n=this._X;l.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)o[i]=16711935&(o[i]<<8|o[i]>>>24)|4278255360&(o[i]<<24|o[i]>>>8),e[t+i]^=o[i]},blockSize:128/32,ivSize:64/32});function l(){for(var e=this._X,t=this._C,n=0;n<8;n++)r[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<r[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<r[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<r[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<r[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<r[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<r[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<r[6]>>>0?1:0)|0,this._b=t[7]>>>0<r[7]>>>0?1:0,n=0;n<8;n++){var i=e[n]+t[n],o=65535&i,a=i>>>16,l=((o*o>>>17)+o*a>>>15)+a*a,c=((4294901760&i)*i|0)+((65535&i)*i|0);s[n]=l^c}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.Rabbit=n._createHelper(a)}(),e.Rabbit}(EA(),zA(),UA(),hj(),gj())),Zj||(Zj=1,Xj.exports=function(e){return function(){var t=e,n=t.lib.StreamCipher,i=t.algo,o=[],r=[],s=[],a=i.RabbitLegacy=n.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var o=0;o<4;o++)l.call(this);for(o=0;o<8;o++)i[o]^=n[o+4&7];if(t){var r=t.words,s=r[0],a=r[1],c=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),p=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=c>>>16|4294901760&p,d=p<<16|65535&c;for(i[0]^=c,i[1]^=u,i[2]^=p,i[3]^=d,i[4]^=c,i[5]^=u,i[6]^=p,i[7]^=d,o=0;o<4;o++)l.call(this)}},_doProcessBlock:function(e,t){var n=this._X;l.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)o[i]=16711935&(o[i]<<8|o[i]>>>24)|4278255360&(o[i]<<24|o[i]>>>8),e[t+i]^=o[i]},blockSize:128/32,ivSize:64/32});function l(){for(var e=this._X,t=this._C,n=0;n<8;n++)r[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<r[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<r[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<r[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<r[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<r[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<r[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<r[6]>>>0?1:0)|0,this._b=t[7]>>>0<r[7]>>>0?1:0,n=0;n<8;n++){var i=e[n]+t[n],o=65535&i,a=i>>>16,l=((o*o>>>17)+o*a>>>15)+a*a,c=((4294901760&i)*i|0)+((65535&i)*i|0);s[n]=l^c}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.RabbitLegacy=n._createHelper(a)}(),e.RabbitLegacy}(EA(),zA(),UA(),hj(),gj())));const tI=async e=>{const t=await(e=>new Promise(((t,n)=>{const i=new FileReader;i.onload=e=>{const n=eI.lib.WordArray.create(e.target.result);t(eI.MD5(n))},i.onerror=()=>n(new Error("Corrupted file")),i.readAsArrayBuffer(e)})))(e);return t.toString(eI.enc.Base64)};class nI{constructor(e){let{url:t,file:n,progress:i=Sd}=e;Eb(this,"create",(async()=>{const{data:e}=await this.generateUrl(),{direct_upload:{url:t,headers:n}}=e;return await this.uploadToCloud(t,n),e})),Eb(this,"generateUrl",(async()=>{const e={blob:{filename:this.file.name,byte_size:this.file.size,content_type:this.file.type,checksum:await tI(this.file)}};return bA(this.url,e)})),Eb(this,"abort",(()=>this.abortController.abort())),Eb(this,"uploadToCloud",((e,t)=>{const n={headers:t,onUploadProgress:this.progress,signal:this.abortController.signal};return vA(e,this.file,n)})),this.url=t,this.file=n,this.progress=i,this.abortController=new AbortController}}class iI extends vE.exports.BasePlugin{constructor(e,t){super(e,t),Eb(this,"upload",(e=>{if(0===e.length)return Promise.resolve();const t=e.map((e=>this.uploadFile(this.uppy.getFile(e))));return Promise.all(t)})),Eb(this,"uploadFile",(async e=>{this.uppy.on("file-removed",(n=>{n.id===e.id&&t.abort()})),this.uppy.on("upload-cancel",(n=>{n===e.id&&t.abort()})),this.uppy.on("cancel-all",(()=>t.abort()));const t=new nI({file:e.data,url:this.opts.directUploadUrl,progress:t=>{t.lengthComputable&&this.uppy.emit("upload-progress",e,{uploader:this,bytesUploaded:t.loaded,bytesTotal:t.total})}});try{const n=await t.create();return this.uppy.setFileState(e.id,{response:{status:"success"}}),this.uppy.emit("upload-success",e,n),e}catch(t){throw this.uppy.setFileState(e.id,{response:{status:"error"}}),this.uppy.emit("upload-error",e,t),t}})),this.type="uploader",this.id=t.id||"ActiveStorageUpload",this.title=t.title||"Active Storage Upload"}install(){this.uppy.addUploader(this.upload)}uninstall(){this.uppy.removeUploader(this.upload)}}const oI=e=>{var n;let{uppy:i}=e;const[s,a]=o(0);r((()=>{i.on("progress",a)}),[i]);const l=`${s}%`;return t.createElement("div",{className:"neeto-editor-image-uploader__progress"},t.createElement("p",{className:"neeto-editor-image-uploader__progress-title"},"Uploading..."),t.createElement("p",{className:"neeto-editor-image-uploader__progress-file"},null===(n=i.getFiles()[0])||void 0===n?void 0:n.name),t.createElement("div",{className:"neeto-editor-progress-bar__wrapper","data-cy":"neeto-editor-image-upload-progress-bar"},t.createElement("div",{className:"neeto-editor-progress-bar__percent"},t.createElement("p",null,l),t.createElement(Vg,{icon:Rm,onClick:()=>i.cancelAll(),size:"small",style:"text"})),t.createElement("div",{className:"neeto-editor-progress-bar__indicator"},t.createElement("div",{style:{width:l},className:"neeto-editor-progress-bar__indicator-inner"}))))},rI=e=>{const t=["B","KB","MB","GB"];let n=0;for(;e>=1024&&n<t.length;)e/=1024,++n;return`${e.toFixed(1)} ${t[n]}`},sI=e=>{let{endpoint:n,onSuccess:i,uploadConfig:r}=e;const[s,a]=o(!1),[l,c]=o(""),p={...fE,...r},u=function(e){if("function"!=typeof e)throw new TypeError("useUppy: expected a function that returns a new Uppy instance");const t=fA(void 0);if(void 0===t.current&&(t.current=e(),!(t.current instanceof gA)))throw new TypeError(`useUppy: factory function must return an Uppy instance, got ${typeof t.current}`);return mA((()=>()=>{t.current.close({reason:"unmount"}),t.current=void 0}),[t]),t.current}((()=>new hC({...p,onBeforeFileAdded:e=>{const{maxFileSize:t,allowedFileTypes:n}=p.restrictions;return e.size>t?(c(`File size is too large. Max size is ${rI(p.restrictions.maxFileSize)}.`),!1):!!n.includes(`.${e.extension}`)||(c(`File type is not permitted. Allowed file types are: ${n.join(", ")}.`),!1)}}).use(iI,{directUploadUrl:n,...gE}).on("upload",(()=>a(!0))).on("upload-success",((e,t)=>{let{blob_url:n}=t;return i(n)})).on("cancel-all",(()=>a(!1))).on("complete",(()=>a(!1)))));return s?t.createElement(oI,{uppy:u}):t.createElement("div",{className:"neeto-editor-image-uploader__dnd-wrapper"},t.createElement(zS,{className:"neeto-editor-image-uploader__dnd",note:`Max. File Size: ${rI(p.restrictions.maxFileSize)}`,locale:{strings:{dropHereOr:"Drop your file(s) here or %{browse}",browse:"Browse"}},uppy:u,"data-cy":"neeto-editor-image-local-uploader"}),l&&t.createElement("p",{className:"neeto-editor-image-uploader__dnd--error"},l))},aI=()=>t.createElement("div",{className:"neeto-editor-loader"},t.createElement("span",{className:"neeto-editor-loader__spinner-icon"}));var lI={},cI=Object.assign||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},pI=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.create(null);function n(e,n){return t[e]=t[e]||[],t[e].push(n),this}function i(e,t){return t._once=!0,n(e,t),this}function o(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n?t[e].splice(t[e].indexOf(n),1):delete t[e],this}function r(e){for(var n=this,i=arguments.length,r=Array(i>1?i-1:0),s=1;s<i;s++)r[s-1]=arguments[s];var a=t[e]&&t[e].slice();return a&&a.forEach((function(t){t._once&&o(e,t),t.apply(n,r)})),this}return cI({},e,{on:n,once:i,off:o,emit:r})},uI=Object.freeze({__proto__:null,default:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=void 0,n=void 0,i=void 0,o=void 0,r=void 0,s=void 0,a=void 0,l=void 0,c=void 0,p=void 0,u=void 0,d=void 0,h=void 0,m=0===e.packed.indexOf("data-")?e.packed:"data-"+e.packed,f=e.sizes.slice().reverse(),g=!1!==e.position,b=e.container.nodeType?e.container:document.querySelector(e.container),v={all:function(){return E(b.children)},new:function(){return E(b.children).filter((function(e){return!e.hasAttribute(""+m)}))}},y=[C,D,O],x=[T,N,S,A],w=pI({pack:z,update:L,resize:R});return w;function k(e){e.forEach((function(e){return e()}))}function E(e){return Array.prototype.slice.call(e)}function _(e){return Array.apply(null,Array(e)).map((function(){return 0}))}function M(){return f.map((function(e){return e.mq&&window.matchMedia("(min-width: "+e.mq+")").matches})).indexOf(!0)}function C(){i=M()}function D(){o=-1===i?f[f.length-1]:f[i]}function O(){s=_(o.columns)}function T(){u=v[t?"new":"all"]()}function N(){0!==u.length&&(d=u.map((function(e){return e.clientWidth})),h=u.map((function(e){return e.clientHeight})))}function S(){u.forEach((function(e,t){r=s.indexOf(Math.min.apply(Math,s)),e.style.position="absolute",a=s[r]+"px",l=r*d[t]+r*o.gutter+"px",g?(e.style.top=a,e.style.left=l):e.style.transform="translate3d("+l+", "+a+", 0)",e.setAttribute(m,""),c=d[t],p=h[t],c&&p&&(s[r]+=p+o.gutter)}))}function A(){b.style.position="relative",b.style.width=o.columns*c+(o.columns-1)*o.gutter+"px",b.style.height=Math.max.apply(Math,s)-o.gutter+"px"}function j(){n||(window.requestAnimationFrame(I),n=!0)}function I(){i!==M()&&(z(),w.emit("resize",o)),n=!1}function z(){return t=!1,k(y.concat(x)),w.emit("pack")}function L(){return t=!0,k(x),w.emit("update")}function R(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?"addEventListener":"removeEventListener";return window[t]("resize",j),w}}}),dI=Rc(uI),hI={exports:{}},mI={exports:{}};!function(e,n){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=t,r=a(o),s=a(Rf.exports);function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.scrollListener=n.scrollListener.bind(n),n.eventListenerOptions=n.eventListenerOptions.bind(n),n.mousewheelListener=n.mousewheelListener.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var e=this.getParentElement(this.scrollComponent);e.scrollTop=e.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var e=!1,t={get passive(){e=!0}};try{document.addEventListener("test",null,t),document.removeEventListener("test",null,t)}catch(e){}return e}},{key:"eventListenerOptions",value:function(){this.props.useCapture;return this.isPassiveSupported()?{useCapture:this.props.useCapture,passive:!0}:{passive:!1}}},{key:"setDefaultLoader",value:function(e){this.defaultLoader=e}},{key:"detachMousewheelListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.scrollComponent.parentNode),e.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.getParentElement(this.scrollComponent)),e.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),e.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(e){var t=this.props.getScrollParent&&this.props.getScrollParent();return null!=t?t:e&&e.parentNode}},{key:"filterProps",value:function(e){return e}},{key:"attachScrollListener",value:function(){var e=this.getParentElement(this.scrollComponent);if(this.props.hasMore&&e){var t=window;!1===this.props.useWindow&&(t=e),t.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),t.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(e){1!==e.deltaY||this.isPassiveSupported()||e.preventDefault()}},{key:"scrollListener",value:function(){var e=this.scrollComponent,t=window,n=this.getParentElement(e),i=void 0;if(this.props.useWindow){var o=document.documentElement||document.body.parentNode||document.body,r=void 0!==t.pageYOffset?t.pageYOffset:o.scrollTop;i=this.props.isReverse?r:this.calculateOffset(e,r)}else i=this.props.isReverse?n.scrollTop:e.scrollHeight-n.scrollTop-n.clientHeight;i<Number(this.props.threshold)&&e&&null!==e.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=n.scrollHeight,this.beforeScrollTop=n.scrollTop,"function"==typeof this.props.loadMore&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(e,t){return e?this.calculateTopPosition(e)+(e.offsetHeight-t-window.innerHeight):0}},{key:"calculateTopPosition",value:function(e){return e?e.offsetTop+this.calculateTopPosition(e.offsetParent):0}},{key:"render",value:function(){var e=this,t=this.filterProps(this.props),n=t.children,i=t.element,o=t.hasMore;t.initialLoad;var s=t.isReverse,a=t.loader;t.loadMore,t.pageStart;var l=t.ref;t.threshold,t.useCapture,t.useWindow,t.getScrollParent;var c=function(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}(t,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);c.ref=function(t){e.scrollComponent=t,l&&l(t)};var p=[n];return o&&(a?s?p.unshift(a):p.push(a):this.defaultLoader&&(s?p.unshift(this.defaultLoader):p.push(this.defaultLoader))),r.default.createElement(i,c,p)}}]),t}(o.Component);l.propTypes={children:s.default.node.isRequired,element:s.default.node,hasMore:s.default.bool,initialLoad:s.default.bool,isReverse:s.default.bool,loader:s.default.node,loadMore:s.default.func.isRequired,pageStart:s.default.number,ref:s.default.func,getScrollParent:s.default.func,threshold:s.default.number,useCapture:s.default.bool,useWindow:s.default.bool},l.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},n.default=l,e.exports=n["default"]}(mI,mI.exports),hI.exports=mI.exports,Object.defineProperty(lI,"__esModule",{value:!0});var fI,gI,bI=lI.default=void 0,vI=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),yI=t,xI=_I(yI),wI=_I(Rf.exports),kI=_I(dI),EI=_I(hI.exports);function _I(e){return e&&e.__esModule?e:{default:e}}function MI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CI(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var DI=(gI=fI=function(e){function t(){var e,n,i;MI(this,t);for(var o=arguments.length,r=Array(o),s=0;s<o;s++)r[s]=arguments[s];return n=i=CI(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r))),i.setContainerRef=function(e){i.masonryContainer=e},i.forcePack=function(){i.masonryContainer&&i.state.instance.pack()},i.forceUpdate=function(){i.masonryContainer&&i.state.instance.update()},i.createNewInstance=function(){var e=i.props,t=e.packed,n=e.sizes,o=e.children,r=e.position,s=(0,kI.default)({container:i.masonryContainer,packed:t,sizes:n,position:r});s.resize(!0),o.length>0&&s.pack(),i.setState((function(){return{instance:s}}))},CI(i,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,yI.Component),vI(t,[{key:"componentDidMount",value:function(){this.createNewInstance()}},{key:"componentDidUpdate",value:function(e){var t=this.props.children,n=this.state.instance;if(0!==e.children.length||0!==t.length)return 0===e.children.length&&t.length>0?n.pack():e.children.length!==t.length?this.props.pack?n.pack():n.update():void 0}},{key:"componentWillUnmount",value:function(){this.state&&this.state.instance.resize(!1)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,i=e.style;e.pack,e.packed,e.position,e.sizes;var o=function(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}(e,["children","className","style","pack","packed","position","sizes"]);return xI.default.createElement(EI.default,o,xI.default.createElement("div",{ref:this.setContainerRef,className:n,style:i},t))}}]),t}(),fI.propTypes={children:wI.default.arrayOf(wI.default.element).isRequired,className:wI.default.string,initialLoad:wI.default.bool,pack:wI.default.bool,packed:wI.default.string,position:wI.default.bool,sizes:wI.default.array,style:wI.default.object},fI.defaultProps={className:"",initialLoad:!0,pack:!1,packed:"data-packed",position:!0,sizes:[{columns:1,gutter:20},{mq:"768px",columns:2,gutter:20},{mq:"1024px",columns:3,gutter:20}],style:{}},gI);bI=lI.default=DI;const OI=e=>{let{onSubmit:n,unsplashApiKey:i}=e;const a=s(null),[l,c]=o(""),[p,u]=o(!1),[d,h]=o([]),[m,f]=o(1),[g,b]=o(!0),[v,y]=o(!1),x=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:800;const[n,i]=o(e);return r((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e]),n}(l||"latest");r((()=>{w(1)}),[x]);const w=async e=>{try{y(!0),u(!1);const t=await(e=>{let{pageNo:t,query:n,apiKey:i}=e;return Kx.get(Fd,{headers:{Authorization:`Client-ID ${i}`},params:{page:t,per_page:30,order_by:"popular",query:n}})})({page:e,query:x,apiKey:i}),{data:{results:n,total_pages:o}}=t;h(1===e?n:[...d,...n]),f(e+1),b(e<o)}catch(e){u(!0)}finally{y(!1)}};return t.createElement("div",{className:"neeto-editor-unsplash-wrapper"},t.createElement(Qg,{autoFocus:!0,name:"text",value:l,placeholder:"Search Unsplash",onChange:e=>{let{target:{value:t}}=e;c(t)},"data-cy":"neeto-editor-unsplash-image-picker-search-input"}),p&&t.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-error"},"Something went wrong! Please try again later."),!p&&!v&&Nd(d)&&t.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-no-results-error"},"No results"),!p&&t.createElement("div",{className:"neeto-editor-unsplash-container"},t.createElement(bI,{ref:a,pack:!0,style:{width:"100%"},sizes:[{columns:3,gutter:0},{mq:"768px",columns:3,gutter:0},{mq:"1024px",columns:3,gutter:0}],hasMore:g,loadMore:()=>{!v&&g&&m>1&&w(m)},position:!0,useWindow:!1,className:"neeto-editor-unsplash-gallery",loader:t.createElement(aI,{key:0})},d&&d.map(((e,i)=>t.createElement("div",{key:i,className:"neeto-editor-unsplash-gallery__item","data-cy":`neeto-editor-unsplash-image-picker-result-${i}`},t.createElement("div",{className:"neeto-editor-unsplash-gallery__item-placeholder",style:{paddingBottom:`${e.height/e.width*100}%`}},t.createElement("div",{className:"neeto-editor-unsplash-gallery__item-inner",id:`unsplashImage${i}`},t.createElement("img",{src:e.urls.regular,onClick:()=>n(e.urls.small)}),t.createElement("a",{href:`https://unsplash.com/@${e.user.username}`,target:"_blank",rel:"noreferrer"},e.user.name," "))))))),!g&&t.createElement("p",{className:"neeto-editor-unsplash-gallery__text"},"End of results")))},TI=e=>{let{buttonLabel:n="Submit",placeholder:i,onSubmit:r,className:s}=e;const[a,l]=o(""),[c,p]=o("");return t.createElement("div",{className:Bc("neeto-editor-url-form__wrapper",{[s]:s})},t.createElement(Qg,{autoFocus:!0,name:"url",value:a,placeholder:i,onFocus:()=>p(""),error:c,onChange:e=>{let{target:{value:t}}=e;return l(t)},"data-cy":"neeto-editor-image-upload-url-input"}),t.createElement(Vg,{label:n,onClick:e=>{e.preventDefault(),tb.test(a)?r(a):p("Please enter a valid url")},disabled:!a,"data-cy":"neeto-editor-image-upload-url-submit"}))},NI=e=>{let{editor:n,imageUploadUrl:i,uploadConfig:r,isVisible:s,setIsVisible:a,unsplashApiKey:l,isUnsplashImageUploadActive:c}=e;const[p,u]=(e=>{var t;const[n,i]=o(null===(t=e[0])||void 0===t?void 0:t.key);return[n,e=>i(e.key)]})(bE),[d,h]=o(""),m=e=>{h(e)},f={local:()=>t.createElement(sI,{endpoint:i,onSuccess:m,uploadConfig:r}),link:()=>t.createElement(TI,{onSubmit:m,buttonLabel:"Upload Image",placeholder:"Paste the image link"}),unsplash:()=>t.createElement(OI,{unsplashApiKey:l,onSubmit:m})}[p];return t.createElement(Kg,{isOpen:s,onClose:()=>{a(!1),u(bE[0])},closeButton:!1},t.createElement("div",{className:"neeto-editor-image-uploader"},t.createElement(mE,null,bE.filter((e=>"unsplash"!==e.key||c)).map((e=>t.createElement(mE.Item,{key:e.key,active:p===e.key,onClick:()=>u(e)},e.title)))),t.createElement("div",{className:"neeto-editor-image-uploader__content"},d?t.createElement(Gg,{url:d,editor:n,onClose:()=>{h(null),a(!1)}}):t.createElement(f,null))))},SI=cs.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize"}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){return t.textBetween(0,t.content.size,void 0," ").length}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;return t.textBetween(0,t.content.size," "," ").split(" ").filter((e=>""!==e)).length}},addProseMirrorPlugins(){return[new Xt({key:new nn("characterCount"),filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const i=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=n)return!0;if(i>n&&o>n&&o<=i)return!0;if(i>n&&o>n&&o>i)return!1;if(!e.getMeta("paste"))return!1;const r=e.selection.$head.pos,s=r-(o-n),a=r;e.deleteRange(s,a);return!(this.storage.characters({node:e.doc})>n)}})]}}),AI=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,jI=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,II=ea.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",Vr(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Gs({find:AI,type:this.type})]},addPasteRules(){return[na({find:jI,type:this.type})]}}),zI=cs.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new Xt({key:new nn("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:i}=this.editor,{anchor:o}=t,r=[];if(!n||!i)return yu.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants(((e,t)=>{if(e.isText)return;if(!(o>=t&&o<=t+e.nodeSize-1))return!1;s+=1}));let a=0;return e.descendants(((e,t)=>{if(e.isText)return!1;if(!(o>=t&&o<=t+e.nodeSize-1))return!1;a+=1;if("deepest"===this.options.mode&&s-a>0||"shallowest"===this.options.mode&&a>1)return"deepest"===this.options.mode;r.push(gu.node(t,t+e.nodeSize,{class:this.options.className}))})),yu.create(e,r)}}})]}}),LI=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,RI=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,FI=ea.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}`}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",Vr(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Gs({find:LI,type:this.type})]},addPasteRules(){return[na({find:RI,type:this.type})]}});function PI(e){this.j={},this.jr=[],this.jd=null,this.t=e}PI.prototype={accepts:function(){return!!this.t},tt:function(e,t){if(t&&t.j)return this.j[e]=t,t;var n=t,i=this.j[e];if(i)return n&&(i.t=n),i;i=BI();var o=VI(this,e);return o?(Object.assign(i.j,o.j),i.jr.append(o.jr),i.jr=o.jd,i.t=n||o.t):i.t=n,this.j[e]=i,i}};var BI=function(){return new PI},UI=function(e){return new PI(e)},$I=function(e,t,n){e.j[t]||(e.j[t]=n)},HI=function(e,t,n){e.jr.push([t,n])},VI=function(e,t){var n=e.j[t];if(n)return n;for(var i=0;i<e.jr.length;i++){var o=e.jr[i][0],r=e.jr[i][1];if(o.test(t))return r}return e.jd},qI=function(e,t,n){for(var i=0;i<t.length;i++)$I(e,t[i],n)},WI=function(e,t){for(var n=0;n<t.length;n++){var i=t[n][0],o=t[n][1];$I(e,i,o)}},KI=function(e,t,n,i){for(var o,r=0,s=t.length;r<s&&(o=e.j[t[r]]);)e=o,r++;if(r>=s)return[];for(;r<s-1;)o=i(),$I(e,t[r],o),e=o,r++;$I(e,t[s-1],n)},YI="DOMAIN",QI="LOCALHOST",GI="TLD",JI="NUM",ZI="PROTOCOL",XI="MAILTO",ez="WS",tz="NL",nz="OPENBRACE",iz="OPENBRACKET",oz="OPENANGLEBRACKET",rz="OPENPAREN",sz="CLOSEBRACE",az="CLOSEBRACKET",lz="CLOSEANGLEBRACKET",cz="CLOSEPAREN",pz="AMPERSAND",uz="APOSTROPHE",dz="ASTERISK",hz="AT",mz="BACKSLASH",fz="BACKTICK",gz="CARET",bz="COLON",vz="COMMA",yz="DOLLAR",xz="DOT",wz="EQUALS",kz="EXCLAMATION",Ez="HYPHEN",_z="PERCENT",Mz="PIPE",Cz="PLUS",Dz="POUND",Oz="QUERY",Tz="QUOTE",Nz="SEMI",Sz="SLASH",Az="TILDE",jz="UNDERSCORE",Iz="SYM",zz=Object.freeze({__proto__:null,DOMAIN:YI,LOCALHOST:QI,TLD:GI,NUM:JI,PROTOCOL:ZI,MAILTO:XI,WS:ez,NL:tz,OPENBRACE:nz,OPENBRACKET:iz,OPENANGLEBRACKET:oz,OPENPAREN:rz,CLOSEBRACE:sz,CLOSEBRACKET:az,CLOSEANGLEBRACKET:lz,CLOSEPAREN:cz,AMPERSAND:pz,APOSTROPHE:uz,ASTERISK:dz,AT:hz,BACKSLASH:mz,BACKTICK:fz,CARET:gz,COLON:bz,COMMA:vz,DOLLAR:yz,DOT:xz,EQUALS:wz,EXCLAMATION:kz,HYPHEN:Ez,PERCENT:_z,PIPE:Mz,PLUS:Cz,POUND:Dz,QUERY:Oz,QUOTE:Tz,SEMI:Nz,SLASH:Sz,TILDE:Az,UNDERSCORE:jz,SYM:Iz}),Lz="aaa aarp abarth abb abbott abbvie abc able abogado abudhabi ac academy accenture accountant accountants aco actor ad adac ads adult ae aeg aero aetna af afamilycompany afl africa ag agakhan agency ai aig airbus airforce airtel akdn al alfaromeo alibaba alipay allfinanz allstate ally alsace alstom am amazon americanexpress americanfamily amex amfam amica amsterdam analytics android anquan anz ao aol apartments app apple aq aquarelle ar arab aramco archi army arpa art arte as asda asia associates at athleta attorney au auction audi audible audio auspost author auto autos avianca aw aws ax axa az azure ba baby baidu banamex bananarepublic band bank bar barcelona barclaycard barclays barefoot bargains baseball basketball bauhaus bayern bb bbc bbt bbva bcg bcn bd be beats beauty beer bentley berlin best bestbuy bet bf bg bh bharti bi bible bid bike bing bingo bio biz bj black blackfriday blockbuster blog bloomberg blue bm bms bmw bn bnpparibas bo boats boehringer bofa bom bond boo book booking bosch bostik boston bot boutique box br bradesco bridgestone broadway broker brother brussels bs bt budapest bugatti build builders business buy buzz bv bw by bz bzh ca cab cafe cal call calvinklein cam camera camp cancerresearch canon capetown capital capitalone car caravan cards care career careers cars casa case cash casino cat catering catholic cba cbn cbre cbs cc cd center ceo cern cf cfa cfd cg ch chanel channel charity chase chat cheap chintai christmas chrome church ci cipriani circle cisco citadel citi citic city cityeats ck cl claims cleaning click clinic clinique clothing cloud club clubmed cm cn co coach codes coffee college cologne com comcast commbank community company compare computer comsec condos construction consulting contact contractors cooking cookingchannel cool coop corsica country coupon coupons courses cpa cr credit creditcard creditunion cricket crown crs cruise cruises csc cu cuisinella cv cw cx cy cymru cyou cz dabur dad dance data date dating datsun day dclk dds de deal dealer deals degree delivery dell deloitte delta democrat dental dentist desi design dev dhl diamonds diet digital direct directory discount discover dish diy dj dk dm dnp do docs doctor dog domains dot download drive dtv dubai duck dunlop dupont durban dvag dvr dz earth eat ec eco edeka edu education ee eg email emerck energy engineer engineering enterprises epson equipment er ericsson erni es esq estate et etisalat eu eurovision eus events exchange expert exposed express extraspace fage fail fairwinds faith family fan fans farm farmers fashion fast fedex feedback ferrari ferrero fi fiat fidelity fido film final finance financial fire firestone firmdale fish fishing fit fitness fj fk flickr flights flir florist flowers fly fm fo foo food foodnetwork football ford forex forsale forum foundation fox fr free fresenius frl frogans frontdoor frontier ftr fujitsu fujixerox fun fund furniture futbol fyi ga gal gallery gallo gallup game games gap garden gay gb gbiz gd gdn ge gea gent genting george gf gg ggee gh gi gift gifts gives giving gl glade glass gle global globo gm gmail gmbh gmo gmx gn godaddy gold goldpoint golf goo goodyear goog google gop got gov gp gq gr grainger graphics gratis green gripe grocery group gs gt gu guardian gucci guge guide guitars guru gw gy hair hamburg hangout haus hbo hdfc hdfcbank health healthcare help helsinki here hermes hgtv hiphop hisamitsu hitachi hiv hk hkt hm hn hockey holdings holiday homedepot homegoods homes homesense honda horse hospital host hosting hot hoteles hotels hotmail house how hr hsbc ht hu hughes hyatt hyundai ibm icbc ice icu id ie ieee ifm ikano il im imamat imdb immo immobilien in inc industries infiniti info ing ink institute insurance insure int international intuit investments io ipiranga iq ir irish is ismaili ist istanbul it itau itv iveco jaguar java jcb je jeep jetzt jewelry jio jll jm jmp jnj jo jobs joburg jot joy jp jpmorgan jprs juegos juniper kaufen kddi ke kerryhotels kerrylogistics kerryproperties kfh kg kh ki kia kim kinder kindle kitchen kiwi km kn koeln komatsu kosher kp kpmg kpn kr krd kred kuokgroup kw ky kyoto kz la lacaixa lamborghini lamer lancaster lancia land landrover lanxess lasalle lat latino latrobe law lawyer lb lc lds lease leclerc lefrak legal lego lexus lgbt li lidl life lifeinsurance lifestyle lighting like lilly limited limo lincoln linde link lipsy live living lixil lk llc llp loan loans locker locus loft lol london lotte lotto love lpl lplfinancial lr ls lt ltd ltda lu lundbeck luxe luxury lv ly ma macys madrid maif maison makeup man management mango map market marketing markets marriott marshalls maserati mattel mba mc mckinsey md me med media meet melbourne meme memorial men menu merckmsd mg mh miami microsoft mil mini mint mit mitsubishi mk ml mlb mls mm mma mn mo mobi mobile moda moe moi mom monash money monster mormon mortgage moscow moto motorcycles mov movie mp mq mr ms msd mt mtn mtr mu museum mutual mv mw mx my mz na nab nagoya name nationwide natura navy nba nc ne nec net netbank netflix network neustar new news next nextdirect nexus nf nfl ng ngo nhk ni nico nike nikon ninja nissan nissay nl no nokia northwesternmutual norton now nowruz nowtv np nr nra nrw ntt nu nyc nz obi observer off office okinawa olayan olayangroup oldnavy ollo om omega one ong onl online onyourside ooo open oracle orange org organic origins osaka otsuka ott ovh pa page panasonic paris pars partners parts party passagens pay pccw pe pet pf pfizer pg ph pharmacy phd philips phone photo photography photos physio pics pictet pictures pid pin ping pink pioneer pizza pk pl place play playstation plumbing plus pm pn pnc pohl poker politie porn post pr pramerica praxi press prime pro prod productions prof progressive promo properties property protection pru prudential ps pt pub pw pwc py qa qpon quebec quest qvc racing radio raid re read realestate realtor realty recipes red redstone redumbrella rehab reise reisen reit reliance ren rent rentals repair report republican rest restaurant review reviews rexroth rich richardli ricoh ril rio rip rmit ro rocher rocks rodeo rogers room rs rsvp ru rugby ruhr run rw rwe ryukyu sa saarland safe safety sakura sale salon samsclub samsung sandvik sandvikcoromant sanofi sap sarl sas save saxo sb sbi sbs sc sca scb schaeffler schmidt scholarships school schule schwarz science scjohnson scot sd se search seat secure security seek select sener services ses seven sew sex sexy sfr sg sh shangrila sharp shaw shell shia shiksha shoes shop shopping shouji show showtime si silk sina singles site sj sk ski skin sky skype sl sling sm smart smile sn sncf so soccer social softbank software sohu solar solutions song sony soy spa space sport spot spreadbetting sr srl ss st stada staples star statebank statefarm stc stcgroup stockholm storage store stream studio study style su sucks supplies supply support surf surgery suzuki sv swatch swiftcover swiss sx sy sydney systems sz tab taipei talk taobao target tatamotors tatar tattoo tax taxi tc tci td tdk team tech technology tel temasek tennis teva tf tg th thd theater theatre tiaa tickets tienda tiffany tips tires tirol tj tjmaxx tjx tk tkmaxx tl tm tmall tn to today tokyo tools top toray toshiba total tours town toyota toys tr trade trading training travel travelchannel travelers travelersinsurance trust trv tt tube tui tunes tushu tv tvs tw tz ua ubank ubs ug uk unicom university uno uol ups us uy uz va vacations vana vanguard vc ve vegas ventures verisign versicherung vet vg vi viajes video vig viking villas vin vip virgin visa vision viva vivo vlaanderen vn vodka volkswagen volvo vote voting voto voyage vu vuelos wales walmart walter wang wanggou watch watches weather weatherchannel webcam weber website wed wedding weibo weir wf whoswho wien wiki williamhill win windows wine winners wme wolterskluwer woodside work works world wow ws wtc wtf xbox xerox xfinity xihuan xin xxx xyz yachts yahoo yamaxun yandex ye yodobashi yoga yokohama you youtube yt yun za zappos zara zero zip zm zone zuerich zw vermögensberater-ctb vermögensberatung-pwb ελ ευ бг бел дети ею католик ком қаз мкд мон москва онлайн орг рус рф сайт срб укр გე հայ ישראל קום ابوظبي اتصالات ارامكو الاردن البحرين الجزائر السعودية العليان المغرب امارات ایران بارت بازار بھارت بيتك پاکستان ڀارت تونس سودان سورية شبكة عراق عرب عمان فلسطين قطر كاثوليك كوم مصر مليسيا موريتانيا موقع همراه कॉम नेट भारत भारतम् भारोत संगठन বাংলা ভারত ভাৰত ਭਾਰਤ ભારત ଭାରତ இந்தியா இலங்கை சிங்கப்பூர் భారత్ ಭಾರತ ഭാരതം ලංකා คอม ไทย ລາວ 닷넷 닷컴 삼성 한국 アマゾン グーグル クラウド コム ストア セール ファッション ポイント みんな 世界 中信 中国 中國 中文网 亚马逊 企业 佛山 信息 健康 八卦 公司 公益 台湾 台灣 商城 商店 商标 嘉里 嘉里大酒店 在线 大众汽车 大拿 天主教 娱乐 家電 广东 微博 慈善 我爱你 手机 招聘 政务 政府 新加坡 新闻 时尚 書籍 机构 淡马锡 游戏 澳門 点看 移动 组织机构 网址 网店 网站 网络 联通 诺基亚 谷歌 购物 通販 集团 電訊盈科 飞利浦 食品 餐厅 香格里拉 香港".split(" "),Rz=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/,Fz=/(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEDD-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDDFF\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC5\uDED0-\uDED9\uDEE0-\uDEE7\uDEF0-\uDEF6])/,Pz=/\uFE0F/,Bz=/\d/,Uz=/\s/;function $z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=BI(),n=UI(JI),i=UI(YI),o=BI(),r=UI(ez),s=[[Bz,i],[Rz,i],[Fz,i],[Pz,i]],a=function(){var e=UI(YI);return e.j={"-":o},e.jr=[].concat(s),e},l=function(e){var t=a();return t.t=e,t};WI(t,[["'",UI(uz)],["{",UI(nz)],["[",UI(iz)],["<",UI(oz)],["(",UI(rz)],["}",UI(sz)],["]",UI(az)],[">",UI(lz)],[")",UI(cz)],["&",UI(pz)],["*",UI(dz)],["@",UI(hz)],["`",UI(fz)],["^",UI(gz)],[":",UI(bz)],[",",UI(vz)],["$",UI(yz)],[".",UI(xz)],["=",UI(wz)],["!",UI(kz)],["-",UI(Ez)],["%",UI(_z)],["|",UI(Mz)],["+",UI(Cz)],["#",UI(Dz)],["?",UI(Oz)],['"',UI(Tz)],["/",UI(Sz)],[";",UI(Nz)],["~",UI(Az)],["_",UI(jz)],["\\",UI(mz)]]),$I(t,"\n",UI(tz)),HI(t,Uz,r),$I(r,"\n",BI()),HI(r,Uz,r);for(var c=0;c<Lz.length;c++)KI(t,Lz[c],l(GI),a);var p=a(),u=a(),d=a(),h=a();KI(t,"file",p,a),KI(t,"ftp",u,a),KI(t,"http",d,a),KI(t,"mailto",h,a);var m=a(),f=UI(ZI),g=UI(XI);$I(u,"s",m),$I(u,":",f),$I(d,"s",m),$I(d,":",f),$I(p,":",f),$I(m,":",f),$I(h,":",g);for(var b=a(),v=0;v<e.length;v++)KI(t,e[v],b,a);return $I(b,":",f),KI(t,"localhost",l(QI),a),HI(t,Bz,n),HI(t,Rz,i),HI(t,Fz,i),HI(t,Pz,i),HI(n,Bz,n),HI(n,Rz,i),HI(n,Fz,i),HI(n,Pz,i),$I(n,"-",o),$I(i,"-",o),$I(o,"-",o),HI(i,Bz,i),HI(i,Rz,i),HI(i,Fz,i),HI(i,Pz,i),HI(o,Bz,i),HI(o,Rz,i),HI(o,Fz,i),HI(o,Pz,i),t.jd=UI(Iz),t}var Hz={defaultProtocol:"http",events:null,format:Vz,formatHref:Vz,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:0,className:null,attributes:null,ignoreTags:[]};function Vz(e){return e}function qz(){}function Wz(e,t){function n(t,n){this.t=e,this.v=t,this.tk=n}return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Object.create(e.prototype);for(var o in n)i[o]=n[o];i.constructor=t,t.prototype=i}(qz,n,t),n}qz.prototype={t:"token",isLink:!1,toString:function(){return this.v},toHref:function(){return this.toString()},startIndex:function(){return this.tk[0].s},endIndex:function(){return this.tk[this.tk.length-1].e},toObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Hz.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}}};var Kz=Wz("email",{isLink:!0}),Yz=Wz("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),Qz=Wz("text"),Gz=Wz("nl"),Jz=Wz("url",{isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Hz.defaultProtocol,t=this.tk,n=!1,i=!1,o=[],r=0;t[r].t===ZI;)n=!0,o.push(t[r].v),r++;for(;t[r].t===Sz;)i=!0,o.push(t[r].v),r++;for(;r<t.length;r++)o.push(t[r].v);return o=o.join(""),n||i||(o="".concat(e,"://").concat(o)),o},hasProtocol:function(){return this.tk[0].t===ZI}}),Zz=Object.freeze({__proto__:null,MultiToken:qz,Base:qz,createTokenClass:Wz,MailtoEmail:Kz,Email:Yz,Text:Qz,Nl:Gz,Url:Jz});function Xz(){var e=BI(),t=BI(),n=BI(),i=BI(),o=BI(),r=BI(),s=BI(),a=UI(Jz),l=BI(),c=UI(Jz),p=UI(Jz),u=BI(),d=BI(),h=BI(),m=BI(),f=BI(),g=UI(Jz),b=UI(Jz),v=UI(Jz),y=UI(Jz),x=BI(),w=BI(),k=BI(),E=BI(),_=BI(),M=BI(),C=UI(Yz),D=BI(),O=UI(Yz),T=UI(Kz),N=BI(),S=BI(),A=BI(),j=BI(),I=UI(Gz);$I(e,tz,I),$I(e,ZI,t),$I(e,XI,n),$I(t,Sz,i),$I(i,Sz,o),$I(e,GI,r),$I(e,YI,r),$I(e,QI,a),$I(e,JI,r),$I(o,GI,p),$I(o,YI,p),$I(o,JI,p),$I(o,QI,p),$I(r,xz,s),$I(_,xz,M),$I(s,GI,a),$I(s,YI,r),$I(s,JI,r),$I(s,QI,r),$I(M,GI,C),$I(M,YI,_),$I(M,JI,_),$I(M,QI,_),$I(a,xz,s),$I(C,xz,M),$I(a,bz,l),$I(a,Sz,p),$I(l,JI,c),$I(c,Sz,p),$I(C,bz,D),$I(D,JI,O);var z=[pz,dz,hz,mz,fz,gz,yz,YI,wz,Ez,QI,JI,_z,Mz,Cz,Dz,ZI,Sz,Iz,Az,GI,jz],L=[uz,lz,sz,az,cz,bz,vz,xz,kz,oz,nz,iz,rz,Oz,Tz,Nz];$I(p,nz,d),$I(p,iz,h),$I(p,oz,m),$I(p,rz,f),$I(u,nz,d),$I(u,iz,h),$I(u,oz,m),$I(u,rz,f),$I(d,sz,p),$I(h,az,p),$I(m,lz,p),$I(f,cz,p),$I(g,sz,p),$I(b,az,p),$I(v,lz,p),$I(y,cz,p),$I(x,sz,p),$I(w,az,p),$I(k,lz,p),$I(E,cz,p),qI(d,z,g),qI(h,z,b),qI(m,z,v),qI(f,z,y),qI(d,L,x),qI(h,L,w),qI(m,L,k),qI(f,L,E),qI(g,z,g),qI(b,z,b),qI(v,z,v),qI(y,z,y),qI(g,L,g),qI(b,L,b),qI(v,L,v),qI(y,L,y),qI(x,z,g),qI(w,z,b),qI(k,z,v),qI(E,z,y),qI(x,L,x),qI(w,L,w),qI(k,L,k),qI(E,L,E),qI(p,z,p),qI(u,z,p),qI(p,L,u),qI(u,L,u),$I(n,GI,T),$I(n,YI,T),$I(n,JI,T),$I(n,QI,T),qI(T,z,T),qI(T,L,N),qI(N,z,T),qI(N,L,N);var R=[pz,uz,dz,mz,fz,gz,sz,yz,YI,wz,Ez,JI,nz,_z,Mz,Cz,Dz,Oz,Sz,Iz,Az,GI,jz];return qI(r,R,S),$I(r,hz,A),qI(a,R,S),$I(a,hz,A),qI(s,R,S),qI(S,R,S),$I(S,hz,A),$I(S,xz,j),qI(j,R,S),$I(A,GI,_),$I(A,YI,_),$I(A,JI,_),$I(A,QI,C),e}function eL(e,t,n){var i=n[0].s,o=n[n.length-1].e;return new e(t.substr(i,o-i),n)}var tL="undefined"!=typeof console&&console&&console.warn||function(){},nL={scanner:null,parser:null,pluginQueue:[],customProtocols:[],initialized:!1};function iL(e){if(nL.initialized&&tL('linkifyjs: already initialized - will not register custom protocol "'.concat(e,'" until you manually call linkify.init(). To avoid this warning, please register all custom protocols before invoking linkify the first time.')),!/^[a-z-]+$/.test(e))throw Error("linkifyjs: protocols containing characters other than a-z or - (hyphen) are not supported");nL.customProtocols.push(e)}function oL(e){return nL.initialized||function(){nL.scanner={start:$z(nL.customProtocols),tokens:zz},nL.parser={start:Xz(),tokens:Zz};for(var e={createTokenClass:Wz},t=0;t<nL.pluginQueue.length;t++)nL.pluginQueue[t][1]({scanner:nL.scanner,parser:nL.parser,utils:e});nL.initialized=!0}(),function(e,t,n){for(var i=n.length,o=0,r=[],s=[];o<i;){for(var a=e,l=null,c=null,p=0,u=null,d=-1;o<i&&!(l=VI(a,n[o].t));)s.push(n[o++]);for(;o<i&&(c=l||VI(a,n[o].t));)l=null,(a=c).accepts()?(d=0,u=a):d>=0&&d++,o++,p++;if(d<0)for(var h=o-p;h<o;h++)s.push(n[h]);else{s.length>0&&(r.push(eL(Qz,t,s)),s=[]),o-=d,p-=d;var m=u.t,f=n.slice(o-p,o);r.push(eL(m,t,f))}}return s.length>0&&r.push(eL(Qz,t,s)),r}(nL.parser.start,e,function(e,t){for(var n=function(e){for(var t=[],n=e.length,i=0;i<n;){var o=e.charCodeAt(i),r=void 0,s=o<55296||o>56319||i+1===n||(r=e.charCodeAt(i+1))<56320||r>57343?e[i]:e.slice(i,i+2);t.push(s),i+=s.length}return t}(t.replace(/[A-Z]/g,(function(e){return e.toLowerCase()}))),i=n.length,o=[],r=0,s=0;s<i;){for(var a=e,l=null,c=0,p=null,u=-1,d=-1;s<i&&(l=VI(a,n[s]));)(a=l).accepts()?(u=0,d=0,p=a):u>=0&&(u+=n[s].length,d++),c+=n[s].length,r+=n[s].length,s++;r-=u,s-=d,c-=u,o.push({t:p.t,v:t.substr(r-c,c),s:r-c,e:r})}return o}(nL.scanner.start,e))}function rL(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=oL(e),i=[],o=0;o<n.length;o++){var r=n[o];!r.isLink||t&&r.t!==t||i.push(r.toObject())}return i}function sL(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=oL(e);return 1===n.length&&n[0].isLink&&(!t||n[0].t===t)}function aL(e){return new Xt({key:new nn("autolink"),appendTransaction:(t,n,i)=>{const o=t.some((e=>e.docChanged))&&!n.doc.eq(i.doc),r=t.some((e=>e.getMeta("preventAutolink")));if(!o||r)return;const{tr:s}=i,a=function(e,t){const n=new Tt(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}(n.doc,[...t]),{mapping:l}=a,c=function(e){const{mapping:t,steps:n}=e,i=[];return t.maps.forEach(((e,o)=>{const r=[];if(e.ranges.length)e.forEach(((e,t)=>{r.push({from:e,to:t})}));else{const{from:e,to:t}=n[o];if(void 0===e||void 0===t)return;r.push({from:e,to:t})}r.forEach((({from:e,to:n})=>{const r=t.slice(o).map(e,-1),s=t.slice(o).map(n),a=t.invert().map(r,-1),l=t.invert().map(s);i.push({oldRange:{from:a,to:l},newRange:{from:r,to:s}})}))})),js(i)}(a);return c.forEach((({oldRange:t,newRange:o})=>{Is(t.from,t.to,n.doc).filter((t=>t.mark.type===e.type)).forEach((t=>{const o=Is(l.map(t.from),l.map(t.to),i.doc).filter((t=>t.mark.type===e.type));if(!o.length)return;const r=o[0],a=n.doc.textBetween(t.from,t.to,void 0," "),c=i.doc.textBetween(r.from,r.to,void 0," "),p=sL(a),u=sL(c);p&&!u&&s.removeMark(r.from,r.to,e.type)})),function(e,t,n){const i=[];return e.nodesBetween(t.from,t.to,((e,t)=>{n(e)&&i.push({node:e,pos:t})})),i}(i.doc,o,(e=>e.isTextblock)).forEach((t=>{rL(i.doc.textBetween(t.pos,t.pos+t.node.nodeSize,void 0," ")).filter((e=>e.isLink)).filter((t=>!e.validate||e.validate(t.value))).map((e=>({...e,from:t.pos+e.start+1,to:t.pos+e.end+1}))).filter((e=>{const t=o.from>=e.from&&o.from<=e.to,n=o.to>=e.from&&o.to<=e.to;return t||n})).forEach((t=>{s.addMark(t.from,t.to,e.type.create({href:t.href}))}))}))})),s.steps.length?s:void 0}})}const lL=ea.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(iL)},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},class:{default:this.options.HTMLAttributes.class}}},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:e}){return["a",Vr(this.options.HTMLAttributes,e),0]},addCommands(){return{setLink:e=>({chain:t})=>t().setMark(this.name,e).setMeta("preventAutolink",!0).run(),toggleLink:e=>({chain:t})=>t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[na({find:e=>rL(e).filter((e=>!this.options.validate||this.options.validate(e.value))).filter((e=>e.isLink)).map((e=>({text:e.value,index:e.start,data:e}))),type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[];var t;return this.options.autolink&&e.push(aL({type:this.type,validate:this.options.validate})),this.options.openOnClick&&e.push((t={type:this.type},new Xt({key:new nn("handleClickLink"),props:{handleClick:(e,n,i)=>{var o;const r=As(e.state,t.type.name);return!(!(null===(o=i.target)||void 0===o?void 0:o.closest("a"))||!r.href||(window.open(r.href,r.target),0))}}}))),this.options.linkOnPaste&&e.push(function(e){return new Xt({key:new nn("handlePasteLink"),props:{handlePaste:(t,n,i)=>{const{state:o}=t,{selection:r}=o,{empty:s}=r;if(s)return!1;let a="";i.content.forEach((e=>{a+=e.textContent}));const l=rL(a).find((e=>e.isLink&&e.value===a));return!(!a||!l||(e.editor.commands.setMark(e.type,{href:l.href}),0))}}})}({editor:this.editor,type:this.type})),e}}),cL=ea.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",Vr(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),pL=/^\s*>\s$/,uL=ta.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",Vr(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Xs({find:pL,type:this.type})]}}),dL=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,hL=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,mL=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,fL=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,gL=ea.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",Vr(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Gs({find:dL,type:this.type}),Gs({find:mL,type:this.type})]},addPasteRules(){return[na({find:hL,type:this.type}),na({find:fL,type:this.type})]}}),bL=/^\s*([-+*])\s$/,vL=ta.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",Vr(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[Xs({find:bL,type:this.type})]}}),yL=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,xL=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,wL=ea.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",Vr(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Gs({find:yL,type:this.type})]},addPasteRules(){return[na({find:xL,type:this.type})]}}),kL=/^```([a-z]+)?[\s\n]$/,EL=/^~~~([a-z]+)?[\s\n]$/,_L=ta.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,i=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter((e=>e.startsWith(n))).map((e=>e.replace(n,"")))[0];return i||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",Vr(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type)return!1;const r=i.parentOffset===i.parent.nodeSize-2,s=i.parent.textContent.endsWith("\n\n");return!(!r||!s)&&e.chain().command((({tr:e})=>(e.delete(i.pos-2,i.pos),!0))).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:i}=t,{$from:o,empty:r}=n;if(!r||o.parent.type!==this.type)return!1;if(!(o.parentOffset===o.parent.nodeSize-2))return!1;const s=o.after();if(void 0===s)return!1;return!i.nodeAt(s)&&e.commands.exitCode()}}},addInputRules(){return[Zs({find:kL,type:this.type,getAttributes:e=>({language:e[1]})}),Zs({find:EL,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Xt({key:new nn("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),i=t.clipboardData.getData("vscode-editor-data"),o=i?JSON.parse(i):void 0,r=null==o?void 0:o.mode;if(!n||!r)return!1;const{tr:s}=e.state;return s.replaceSelectionWith(this.type.create({language:r})),s.setSelection(zt.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,"\n")),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),ML=ta.create({name:"doc",topNode:!0,content:"block+"});function CL(e={}){return new Xt({view:t=>new DL(t,e)})}class DL{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map((t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}destroy(){this.handlers.forEach((({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t)))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){let n=t.nodeBefore,i=t.nodeAfter;if(n||i){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),o=n?t.bottom:t.top;n&&i&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:t.left,right:t.right,top:o-this.width/2,bottom:o+this.width/2}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos);e={left:t.left-this.width/2,right:t.left+this.width/2,top:t.top,bottom:t.bottom}}let n,i,o=this.editorView.dom.offsetParent;if(this.element||(this.element=o.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!o||o==document.body&&"static"==getComputedStyle(o).position)n=-pageXOffset,i=-pageYOffset;else{let e=o.getBoundingClientRect();n=e.left-o.scrollLeft,i=e.top-o.scrollTop}this.element.style.left=e.left-n+"px",this.element.style.top=e.top-i+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,o="function"==typeof i?i(this.editorView,t):i;if(t&&!o){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&(e=ft(this.editorView.state.doc,e,this.editorView.dragging.slice),null==e))return this.setCursor(null);this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const OL=cs.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[CL(this.options)]}}),TL="undefined"!=typeof navigator?navigator:null,NL="undefined"!=typeof document?document:null,SL=TL&&TL.userAgent||"",AL=/Edge\/(\d+)/.exec(SL),jL=/MSIE \d/.exec(SL),IL=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(SL),zL=!!(jL||IL||AL),LL=jL?document.documentMode:IL?+IL[1]:AL?+AL[1]:0,RL=!zL&&/gecko\/(\d+)/i.test(SL);RL&&(/Firefox\/(\d+)/.exec(SL)||[0,0])[1];const FL=!zL&&/Chrome\/(\d+)/.exec(SL),PL=!!FL,BL=FL?+FL[1]:0,UL=!zL&&!!TL&&/Apple Computer/.test(TL.vendor),$L=UL&&(/Mobile\/\w+/.test(SL)||!!TL&&TL.maxTouchPoints>2),HL=$L||!!TL&&/Mac/.test(TL.platform),VL=/Android \d/.test(SL),qL=!!NL&&"webkitFontSmoothing"in NL.documentElement.style,WL=qL?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,KL=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},YL=/^(img|br|input|textarea|hr)$/i;function QL(e,t,n,i,o){for(;;){if(e==n&&t==i)return!0;if(t==(o<0?0:GL(e))){let n=e.parentNode;if(!n||1!=n.nodeType||JL(e)||YL.test(e.nodeName)||"false"==e.contentEditable)return!1;t=KL(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?GL(e):0}}}function GL(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function JL(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 ZL=function(e){let t=e.isCollapsed;return t&&PL&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function XL(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function eR(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(ZL(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==GL(e);i||o;){if(e==n)return!0;let t=KL(e);if(!(e=e.parentNode))return!1;i=i&&0==t,o=o&&t==GL(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=lR(e,a,c,"pointer"==t||e.state.selection.head<c.pos&&!r?1:-1)}return l}function tR(e){return e.editable?e.hasFocus():function(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}}(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function nR(e,t=!1){let n=e.state.selection;if(function(e,t){if(t instanceof Rt){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(aR(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else aR(e)}(e,n),tR(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&PL){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&function(e,t,n,i){return n&&(QL(e,t,n,i,-1)||QL(e,t,n,i,1))}(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,KL(i)+1):n.setEnd(i,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&zL&&LL<=11&&(i.disabled=!0,i.disabled=!1)}(e);else{let i,o,{anchor:r,head:s}=n;!iR||n instanceof zt||(n.$from.parent.inlineContent||(i=oR(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=oR(e,n.to))),e.docView.setSelection(r,s,e.root,t),iR&&(i&&sR(i),o&&sR(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((()=>{tR(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const iR=UL||PL&&BL<63;function oR(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(UL&&o&&"false"==o.contentEditable)return rR(o);if(!(o&&"false"!=o.contentEditable||r&&"false"!=r.contentEditable)){if(o)return rR(o);if(r)return rR(r)}}function rR(e){return e.contentEditable="true",UL&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function sR(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function aR(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function lR(e,t,n,i){return e.someProp("createSelectionBetween",(i=>i(e,t,n)))||zt.between(t,n,i)}function cR(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 pR(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function uR(e,t,n){let i=e.state.selection;if(!(i instanceof zt)){if(i instanceof Rt&&i.node.isInline)return pR(e,new zt(t>0?i.$to:i.$from));{let n=cR(e.state,t);return!!n&&pR(e,n)}}if(!i.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=cR(e.state,t);return!!(n&&n instanceof Rt)&&pR(e,n)}if(!(HL&&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)?pR(e,new Rt(t<0?e.state.doc.resolve(o.pos-r.nodeSize):o)):!!qL&&pR(e,new zt(e.state.doc.resolve(t<0?s:s+r.nodeSize))))}}function dR(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function hR(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function mR(e){let t=e.domSelection(),n=t.focusNode,i=t.focusOffset;if(!n)return;let o,r,s=!1;for(RL&&1==n.nodeType&&i<dR(n)&&hR(n.childNodes[i])&&(s=!0);;)if(i>0){if(1!=n.nodeType)break;{let e=n.childNodes[i-1];if(hR(e))o=n,r=--i;else{if(3!=e.nodeType)break;n=e,i=n.nodeValue.length}}}else{if(gR(n))break;{let t=n.previousSibling;for(;t&&hR(t);)o=n.parentNode,r=KL(t),t=t.previousSibling;if(t)n=t,i=dR(n);else{if(n=n.parentNode,n==e.dom)break;i=0}}}s?bR(e,t,n,i):o&&bR(e,t,o,r)}function fR(e){let t=e.domSelection(),n=t.focusNode,i=t.focusOffset;if(!n)return;let o,r,s=dR(n);for(;;)if(i<s){if(1!=n.nodeType)break;if(!hR(n.childNodes[i]))break;o=n,r=++i}else{if(gR(n))break;{let t=n.nextSibling;for(;t&&hR(t);)o=t.parentNode,r=KL(t)+1,t=t.nextSibling;if(t)n=t,i=0,s=dR(n);else{if(n=n.parentNode,n==e.dom)break;i=s=0}}}o&&bR(e,t,o,r)}function gR(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function bR(e,t,n,i){if(ZL(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&&nR(e)}),50)}function vR(e,t,n){let i=e.state.selection;if(i instanceof zt&&!i.empty||n.indexOf("s")>-1)return!1;if(HL&&n.indexOf("m")>-1)return!1;let{$from:o,$to:r}=i;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=cR(e.state,t);if(n&&n instanceof Rt)return pR(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&&pR(e,s)}return!1}function yR(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 xR(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function wR(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||HL&&72==n&&"c"==i?yR(e,-1)||mR(e):46==n||HL&&68==n&&"c"==i?yR(e,1)||fR(e):13==n||27==n||(37==n||HL&&66==n&&"c"==i?uR(e,-1,i)||mR(e):39==n||HL&&70==n&&"c"==i?uR(e,1,i)||fR(e):38==n||HL&&80==n&&"c"==i?vR(e,-1,i)||mR(e):40==n||HL&&78==n&&"c"==i?function(e){if(!UL||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;xR(e,n,"true"),setTimeout((()=>xR(e,n,"false")),20)}return!1}(e)||vR(e,1,i)||fR(e):i==(HL?"m":"c")&&(66==n||73==n||89==n||90==n))}function kR(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=AR(),l=a.createElement("div");l.appendChild(s.serializeFragment(i,{document:a}));let c,p=l.firstChild,u=0;for(;p&&1==p.nodeType&&(c=NR[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 ER(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=AR().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&NR[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),qL&&function(e){let t=e.querySelectorAll(PL?"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||_R.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)}(TR(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&&CR(n,i,e,r[r.length-1],0))r[r.length-1]=t;else{r.length&&(r[r.length-1]=DR(r[r.length-1],i.length));let t=MR(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=TR(s,e,t)}return e.someProp("transformPasted",(e=>{s=e(s)})),s}const _R=/^(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 MR(e,t,n=0){for(let i=t.length-1;i>=n;i--)e=t[i].create(null,z.from(e));return e}function CR(e,t,n,i,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let r=CR(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(MR(n,e,o+1))))}}function DR(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,DR(e.lastChild,t-1)),i=e.contentMatchAt(e.childCount).fillBefore(z.empty,!0);return e.copy(n.append(i))}function OR(e,t,n,i,o,r){let s=t<0?e.firstChild:e.lastChild,a=s.content;return o<i-1&&(a=OR(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 TR(e,t,n){return t<e.openStart&&(e=new U(OR(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new U(OR(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const NR={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 SR=null;function AR(){return SR||(SR=document.implementation.createHTMLDocument("title"))}const jR={},IR={};function zR(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function LR(e){return{left:e.clientX,top:e.clientY}}function RR(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 FR(e,t,n){e.focused||e.focus();let i=e.state.tr.setSelection(t);"pointer"==n&&i.setMeta("pointer",!0),e.dispatch(i)}function PR(e,t,n,i,o){return RR(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&&(FR(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))&&(FR(e,new Rt(n),"pointer"),!0)}(e,n))}function BR(e,t,n,i){return RR(e,"handleDoubleClickOn",t,n,i)||e.someProp("handleDoubleClick",(n=>n(e,t,i)))}function UR(e,t,n,i){return RR(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&&(FR(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)FR(e,zt.create(i,r+1,r+1+n.content.size),"pointer");else{if(!Rt.isSelectable(n))continue;FR(e,Rt.create(i,r),"pointer")}return!0}}(e,n,i)}function $R(e){return QR(e)}IR.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!qR(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!VL||!PL||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!$L||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||wR(e,n)?n.preventDefault():zR(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,XL(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},IR.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},IR.keypress=(e,t)=>{let n=t;if(qR(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||HL&&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 HR=HL?"metaKey":"ctrlKey";jR.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let i=$R(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[HR]&&("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(LR(n));s&&("singleClick"==r?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new VR(e,s,n,!!i)):("doubleClick"==r?BR:UR)(e,s.pos,s.inside,n)?n.preventDefault():zR(e,"pointer"))};class VR{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[HR],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||!RL||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)),zR(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((()=>nR(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(LR(e))),this.updateAllowDefault(e),this.allowDefault||!t?zR(this.view,"pointer"):PR(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||UL&&this.mightDrag&&!this.mightDrag.node.isAtom||PL&&!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)?(FR(this.view,St.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):zR(this.view,"pointer")}move(e){this.updateAllowDefault(e),zR(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 qR(e,t){return!!e.composing||!!(UL&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}jR.touchstart=e=>{e.input.lastTouch=Date.now(),$R(e),zR(e,"pointer")},jR.touchmove=e=>{e.input.lastTouch=Date.now(),zR(e,"pointer")},jR.contextmenu=e=>$R(e);const WR=VL?5e3:-1;function KR(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>QR(e)),t))}function YR(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 QR(e,t=!1){if(!(VL&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),YR(e),t||e.docView&&e.docView.dirty){let t=eR(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}IR.compositionstart=IR.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(),QR(e,!0),e.markCursor=null;else if(QR(e),RL&&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}KR(e,WR)},IR.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,KR(e,20))};const GR=zL&&LL<15||$L&&WL<604;function JR(e,t,n,i){let o=ER(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}jR.copy=IR.cut=(e,t)=>{let n=t,i=e.state.selection,o="cut"==n.type;if(i.empty)return;let r=GR?null:n.clipboardData,s=i.content(),{dom:a,text:l}=kR(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"))},IR.paste=(e,t)=>{let n=t;if(e.composing&&!VL)return;let i=GR?null:n.clipboardData;i&&JR(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?JR(e,i.value,null,t):JR(e,i.textContent,i.innerHTML,t)}),50)}(e,n)};class ZR{constructor(e,t){this.slice=e,this.move=t}}const XR=HL?"altKey":"ctrlKey";jR.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(LR(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}=kR(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(GR?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",GR||n.dataTransfer.setData("text/plain",l),e.dragging=new ZR(s,!n[XR])},jR.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},IR.dragover=IR.dragenter=(e,t)=>t.preventDefault(),IR.drop=(e,t)=>{let n=t,i=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(LR(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=ER(e,n.dataTransfer.getData(GR?"Text":"text/plain"),GR?null:n.dataTransfer.getData("text/html"),!1,r);let a=!(!i||n[XR]);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(lR(e,h,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},jR.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())&&nR(e)}),20))},jR.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)},jR.beforeinput=(e,t)=>{if(PL&&VL&&"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,XL(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 IR)jR[e]=IR[e];function eF(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 tF{constructor(e,t){this.toDOM=e,this.spec=t||sF,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 oF(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof tF&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&eF(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class nF{constructor(e,t){this.attrs=e,this.spec=t||sF}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 oF(o,r,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof nF&&eF(this.attrs,e.attrs)&&eF(this.spec,e.spec)}static is(e){return e.type instanceof nF}destroy(){}}class iF{constructor(e,t){this.attrs=e,this.spec=t||sF}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 oF(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 iF&&eF(this.attrs,e.attrs)&&eF(this.spec,e.spec)}destroy(){}}class oF{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new oF(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 oF(e,e,new tF(t,n))}static inline(e,t,n,i){return new oF(e,t,new nF(n,i))}static node(e,t,n,i){return new oF(e,t,new iF(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof nF}}const rF=[],sF={};class aF{constructor(e,t){this.local=e.length?e:rF,this.children=t.length?t:rF}static create(e,t){return t.length?hF(t,e,0,sF):lF}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==lF||0==e.maps.length?this:this.mapInner(e,t,0,0,n||sF)}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!=lF?(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=hF(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 aF(t.sort(mF),a)}(this.children,r||[],e,t,n,i,o):r?new aF(r.sort(mF),rF):lF}add(e,t){return t.length?this==lF?aF.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=uF(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,hF(s,e,a+1,sF)),o+=3}}));let r=pF(o?dF(t):t,-n);for(let t=0;t<r.length;t++)r[t].type.valid(e,r[t])||r.splice(t--,1);return new aF(r.length?this.local.concat(r).sort(mF):this.local,i||this.children)}remove(e){return 0==e.length||this==lF?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!=lF?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 aF(i,n):lF}forChild(e,t){if(this==lF)return this;if(t.isLeaf)return aF.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 nF){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 aF(i.sort(mF),rF);return n?new cF([e,n]):e}return n||lF}eq(e){if(this==e)return!0;if(!(e instanceof aF)||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 fF(this.localsInner(e))}localsInner(e){if(this==lF)return rF;if(e.inlineContent||!this.local.some(nF.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof nF||t.push(this.local[e]);return t}}aF.empty=new aF([],[]),aF.removeOverlap=fF;const lF=aF.empty;class cF{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,sF)));return cF.from(n)}forChild(e,t){if(t.isLeaf)return aF.empty;let n=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=lF&&(o instanceof cF?n=n.concat(o.members):n.push(o))}return cF.from(n)}eq(e){if(!(e instanceof cF)||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?fF(n?t:t.sort(mF)):rF}static from(e){switch(e.length){case 0:return lF;case 1:return e[0];default:return new cF(e)}}}function pF(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 oF(o.from+t,o.to+t,o.type))}return n}function uF(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 dF(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function hF(e,t,n,i){let o=[],r=!1;t.forEach(((t,s)=>{let a=uF(e,t,s+n);if(a){r=!0;let e=hF(a,t,n+s+1,i);e!=lF&&o.push(s,s+t.nodeSize,e)}}));let s=pF(r?dF(e):e,-n).sort(mF);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 aF(s,o):lF}function mF(e,t){return e.from-t.from||e.to-t.to}function fF(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),gF(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),gF(t,o+1,r.copy(i.to,r.to)))}}return t}function gF(e,t,n){for(;t<e.length&&mF(n,e[t])>0;)t++;e.splice(t,0,n)}class bF extends St{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return bF.valid(n)?new bF(n):St.near(n)}content(){return U.empty}eq(e){return e instanceof bF&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new bF(e.resolve(t.pos))}getBookmark(){return new vF(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),i=e.node(t);if(0!=n)for(let e=i.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(i.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),i=e.node(t);if(n!=i.childCount)for(let e=i.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(i.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&bF.valid(e))return e;let i=e.pos,o=null;for(let n=e.depth;;n--){let r=e.node(n);if(t>0?e.indexAfter(n)<r.childCount:e.index(n)>0){o=r.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;i+=t;let s=e.doc.resolve(i);if(bF.valid(s))return s}for(;;){let r=t>0?o.firstChild:o.lastChild;if(!r){if(o.isAtom&&!o.isText&&!Rt.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*t),n=!1;continue e}break}o=r,i+=t;let s=e.doc.resolve(i);if(bF.valid(s))return s}return null}}}bF.prototype.visible=!1,bF.findFrom=bF.findGapCursorFrom,St.jsonID("gapcursor",bF);class vF{constructor(e){this.pos=e}map(e){return new vF(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return bF.valid(t)?new bF(t):St.near(t)}}const yF=Cr({ArrowLeft:xF("horiz",-1),ArrowRight:xF("horiz",1),ArrowUp:xF("vert",-1),ArrowDown:xF("vert",1)});function xF(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,i,o){let r=e.selection,s=t>0?r.$to:r.$from,a=r.empty;if(r instanceof zt){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=bF.findGapCursorFrom(s,t,a);return!!l&&(i&&i(e.tr.setSelection(new bF(l))),!0)}}function wF(e,t,n){if(!e||!e.editable)return!1;let i=e.state.doc.resolve(t);if(!bF.valid(i))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&Rt.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new bF(i))),!0)}function kF(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof bF))return!1;let{$from:n}=e.state.selection,i=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!i)return!1;let o=z.empty;for(let e=i.length-1;e>=0;e--)o=z.from(i[e].createAndFill(null,o));let r=e.state.tr.replace(n.pos,n.pos,new U(o,0,0));return r.setSelection(zt.near(r.doc.resolve(n.pos+1))),e.dispatch(r),!1}function EF(e){if(!(e.selection instanceof bF))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",aF.create(e.doc,[oF.widget(e.selection.head,t,{key:"gapcursor"})])}const _F=cs.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Xt({props:{decorations:EF,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&bF.valid(n)?new bF(n):null,handleClick:wF,handleKeyDown:yF,handleDOMEvents:{beforeinput:kF}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=Kr(Br(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),MF=ta.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",Vr(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:i})=>e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:e,storedMarks:o}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:r}=this.options,{splittableMarks:s}=i.extensionManager,a=o||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{if(t&&a&&r){const t=a.filter((e=>s.includes(e.type.name)));e.ensureMarks(t)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),CF=ta.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((e=>({tag:`h${e}`,attrs:{level:e}})))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Vr(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce(((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})})),{})},addInputRules(){return this.options.levels.map((e=>Zs({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}})))}});var DF=200,OF=function(){};OF.prototype.append=function(e){return e.length?(e=OF.from(e),!this.length&&e||e.length<DF&&this.leafAppend(e)||this.length<DF&&e.leafPrepend(this)||this.appendInner(e)):this},OF.prototype.prepend=function(e){return e.length?OF.from(e).append(this):this},OF.prototype.appendInner=function(e){return new NF(this,e)},OF.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?OF.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},OF.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},OF.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},OF.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var i=[];return this.forEach((function(t,n){return i.push(e(t,n))}),t,n),i},OF.from=function(e){return e instanceof OF?e:e&&e.length?new TF(e):OF.empty};var TF=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,i){for(var o=t;o<n;o++)if(!1===e(this.values[o],i+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,i){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],i+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=DF)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=DF)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(OF);OF.empty=new TF([]);var NF=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,i){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),i))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,i+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,i){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,i+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,i))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(OF),SF=OF;const AF=500;class jF{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,i,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}t&&(n=this.remapping(o,this.items.length),i=n.maps.length);let r,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(o,t+1),i=n.maps.length),i--,void c.push(e);if(n){c.push(new IF(e.map));let t,o=e.step.map(n.slice(i));o&&a.maybeStep(o).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new IF(t,void 0,void 0,l.length+c.length))),i--,t&&n.appendMap(t,i)}else a.maybeStep(e.step);return e.selection?(r=n?e.selection.map(n.slice(i)):e.selection,s=new jF(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:r}}addTransform(e,t,n,i){let o=[],r=this.eventCount,s=this.items,a=!i&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let l,c=e.steps[n].invert(e.docs[n]),p=new IF(e.mapping.maps[n],c,t);(l=a&&a.merge(p))&&(p=l,n?o.pop():s=s.slice(0,s.length-1)),o.push(p),t&&(r++,t=void 0),i||(a=p)}let l=r-n.depth;return l>LF&&(s=function(e,t){let n;return e.forEach(((e,i)=>{if(e.selection&&0==t--)return n=i,!1})),e.slice(n)}(s,l),r-=l),new jF(s.append(o),r)}remapping(e,t){let n=new Je;return this.items.forEach(((t,i)=>{let o=null!=t.mirrorOffset&&i-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new jF(this.items.append(e.map((e=>new IF(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),o=e.mapping,r=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),i);let a=t;this.items.forEach((t=>{let i=o.getMirror(--a);if(null==i)return;r=Math.min(r,i);let l=o.maps[i];if(t.step){let r=e.steps[i].invert(e.docs[i]),c=t.selection&&t.selection.map(o.slice(a+1,i));c&&s++,n.push(new IF(l,r,c))}else n.push(new IF(l))}),i);let l=[];for(let e=t;e<r;e++)l.push(new IF(o.maps[e]));let c=this.items.slice(0,i).append(l).append(n),p=new jF(c,s);return p.emptyItemCount()>AF&&(p=p.compress(this.items.length-n.length)),p}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],o=0;return this.items.forEach(((r,s)=>{if(s>=e)i.push(r),r.selection&&o++;else if(r.step){let e=r.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=r.selection&&r.selection.map(t.slice(n));a&&o++;let l,c=new IF(s.invert(),e,a),p=i.length-1;(l=i.length&&i[p].merge(c))?i[p]=l:i.push(c)}}else r.map&&n--}),this.items.length,0),new jF(SF.from(i.reverse()),o)}}jF.empty=new jF(SF.empty,0);class IF{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new IF(t.getMap().invert(),t,this.selection)}}}class zF{constructor(e,t,n,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i}}const LF=20;function RF(e){let t=[];return e.forEach(((e,n,i,o)=>t.push(i,o))),t}function FF(e,t){if(!e)return null;let n=[];for(let i=0;i<e.length;i+=2){let o=t.map(e[i],1),r=t.map(e[i+1],-1);o<=r&&n.push(o,r)}return n}function PF(e,t,n,i){let o=$F(t),r=HF.get(t).spec.config,s=(i?e.undone:e.done).popEvent(t,o);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(i?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),r,o),c=new zF(i?l:s.remaining,i?s.remaining:l,null,0);n(s.transform.setSelection(a).setMeta(HF,{redo:i,historyState:c}).scrollIntoView())}let BF=!1,UF=null;function $F(e){let t=e.plugins;if(UF!=t){BF=!1,UF=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){BF=!0;break}}return BF}const HF=new nn("history"),VF=new nn("closeHistory");function qF(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Xt({key:HF,state:{init:()=>new zF(jF.empty,jF.empty,null,0),apply:(t,n,i)=>function(e,t,n,i){let o,r=n.getMeta(HF);if(r)return r.historyState;n.getMeta(VF)&&(e=new zF(e.done,e.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(HF))return s.getMeta(HF).redo?new zF(e.done.addTransform(n,void 0,i,$F(t)),e.undone,RF(n.mapping.maps[n.steps.length-1]),e.prevTime):new zF(e.done,e.undone.addTransform(n,void 0,i,$F(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new zF(e.done.rebased(n,o),e.undone.rebased(n,o),FF(e.prevRanges,n.mapping),e.prevTime):new zF(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),FF(e.prevRanges,n.mapping),e.prevTime);{let o=0==e.prevTime||!s&&(e.prevTime<(n.time||0)-i.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,i)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&i>=t[o]&&(n=!0)})),n}(n,e.prevRanges)),r=s?FF(e.prevRanges,n.mapping):RF(n.mapping.maps[n.steps.length-1]);return new zF(e.done.addTransform(n,o?t.selection.getBookmark():void 0,i,$F(t)),jF.empty,r,n.time)}}(n,i,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,i="historyUndo"==n?WF:"historyRedo"==n?KF:null;return!!i&&(t.preventDefault(),i(e.state,e.dispatch))}}}})}const WF=(e,t)=>{let n=HF.getState(e);return!(!n||0==n.done.eventCount)&&(t&&PF(n,e,t,!1),!0)},KF=(e,t)=>{let n=HF.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&PF(n,e,t,!0),!0)},YF=cs.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>WF(e,t),redo:()=>({state:e,dispatch:t})=>KF(e,t)}),addProseMirrorPlugins(){return[qF(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),QF=ta.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",Vr(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{var n;if(t){const{$to:t}=e.selection,i=t.end();if(t.nodeAfter)e.setSelection(zt.create(e.doc,t.pos));else{const o=null===(n=t.parent.type.contentMatch.defaultType)||void 0===n?void 0:n.create();o&&(e.insert(i,o),e.setSelection(zt.create(e.doc,i)))}e.scrollIntoView()}return!0})).run()}},addInputRules(){return[Js({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),GF=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,JF=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,ZF=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,XF=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,eP=ea.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",Vr(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Gs({find:GF,type:this.type}),Gs({find:ZF,type:this.type})]},addPasteRules(){return[na({find:JF,type:this.type}),na({find:XF,type:this.type})]}}),tP=ta.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Vr(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),nP=/^(\d+)\.\s$/,iP=ta.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",Vr(this.options.HTMLAttributes,n),0]:["ol",Vr(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[Xs({find:nP,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),oP=ta.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",Vr(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),rP=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,sP=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,aP=ea.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",Vr(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Gs({find:rP,type:this.type})]},addPasteRules(){return[na({find:sP,type:this.type})]}}),lP=ta.create({name:"text",group:"inline"}),cP=cs.create({name:"starterKit",addExtensions(){var e,t,n,i,o,r,s,a,l,c,p,u,d,h,m,f,g,b;const v=[];return!1!==this.options.blockquote&&v.push(uL.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&v.push(gL.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&v.push(vL.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&v.push(wL.configure(null===(i=this.options)||void 0===i?void 0:i.code)),!1!==this.options.codeBlock&&v.push(_L.configure(null===(o=this.options)||void 0===o?void 0:o.codeBlock)),!1!==this.options.document&&v.push(ML.configure(null===(r=this.options)||void 0===r?void 0:r.document)),!1!==this.options.dropcursor&&v.push(OL.configure(null===(s=this.options)||void 0===s?void 0:s.dropcursor)),!1!==this.options.gapcursor&&v.push(_F.configure(null===(a=this.options)||void 0===a?void 0:a.gapcursor)),!1!==this.options.hardBreak&&v.push(MF.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&v.push(CF.configure(null===(c=this.options)||void 0===c?void 0:c.heading)),!1!==this.options.history&&v.push(YF.configure(null===(p=this.options)||void 0===p?void 0:p.history)),!1!==this.options.horizontalRule&&v.push(QF.configure(null===(u=this.options)||void 0===u?void 0:u.horizontalRule)),!1!==this.options.italic&&v.push(eP.configure(null===(d=this.options)||void 0===d?void 0:d.italic)),!1!==this.options.listItem&&v.push(tP.configure(null===(h=this.options)||void 0===h?void 0:h.listItem)),!1!==this.options.orderedList&&v.push(iP.configure(null===(m=this.options)||void 0===m?void 0:m.orderedList)),!1!==this.options.paragraph&&v.push(oP.configure(null===(f=this.options)||void 0===f?void 0:f.paragraph)),!1!==this.options.strike&&v.push(aP.configure(null===(g=this.options)||void 0===g?void 0:g.strike)),!1!==this.options.text&&v.push(lP.configure(null===(b=this.options)||void 0===b?void 0:b.text)),v}});function pP(e,t=[]){return e.map((e=>{const n=[...t,...e.properties?e.properties.className:[]];return e.children?pP(e.children,n):{text:e.value,classes:n}})).flat()}function uP(e){return e.value||e.children||[]}function dP({doc:e,name:t,lowlight:n,defaultLanguage:i}){const o=[];return Ts(e,(e=>e.type.name===t)).forEach((e=>{let t=e.pos+1;const r=e.node.attrs.language||i,s=n.listLanguages();pP(r&&s.includes(r)?uP(n.highlight(r,e.node.textContent)):uP(n.highlightAuto(e.node.textContent))).forEach((e=>{const n=t+e.text.length;if(e.classes.length){const i=gu.inline(t,n,{class:e.classes.join(" ")});o.push(i)}t=n}))})),yu.create(e,o)}function hP({name:e,lowlight:t,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every((e=>"function"==typeof t[e])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const i=new Xt({key:new nn("lowlight"),state:{init:(i,{doc:o})=>dP({doc:o,name:e,lowlight:t,defaultLanguage:n}),apply:(i,o,r,s)=>{const a=r.selection.$head.parent.type.name,l=s.selection.$head.parent.type.name,c=Ts(r.doc,(t=>t.type.name===e)),p=Ts(s.doc,(t=>t.type.name===e));return i.docChanged&&([a,l].includes(e)||p.length!==c.length||i.steps.some((e=>void 0!==e.from&&void 0!==e.to&&c.some((t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))))?dP({doc:i.doc,name:e,lowlight:t,defaultLanguage:n}):o.map(i.mapping,i.doc)}},props:{decorations:e=>i.getState(e)}});return i}const mP=_L.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:{},defaultLanguage:null}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],hP({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});const fP=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],gP=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],bP=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],vP=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],yP=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();var xP="[0-9](_*[0-9])*",wP=`\\.(${xP})`,kP="[0-9a-fA-F](_*[0-9a-fA-F])*",EP={className:"number",variants:[{begin:`(\\b(${xP})((${wP})|\\.)?|(${wP}))`+`[eE][+-]?(${xP})[fFdD]?\\b`},{begin:`\\b(${xP})((${wP})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${wP})[fFdD]?\\b`},{begin:`\\b(${xP})[fFdD]\\b`},{begin:`\\b0[xX]((${kP})\\.?|(${kP})?\\.(${kP}))`+`[pP][+-]?(${xP})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${kP})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function _P(e,t,n){return-1===n?"":e.replace(t,(i=>_P(e,t,n-1)))}const MP="[A-Za-z$_][0-9A-Za-z$_]*",CP=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],DP=["true","false","null","undefined","NaN","Infinity"],OP=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],TP=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],NP=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],SP=["arguments","this","super","console","window","document","localStorage","module","global"],AP=[].concat(NP,OP,TP);var jP="[0-9](_*[0-9])*",IP=`\\.(${jP})`,zP="[0-9a-fA-F](_*[0-9a-fA-F])*",LP={className:"number",variants:[{begin:`(\\b(${jP})((${IP})|\\.)?|(${IP}))`+`[eE][+-]?(${jP})[fFdD]?\\b`},{begin:`\\b(${jP})((${IP})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${IP})[fFdD]?\\b`},{begin:`\\b(${jP})[fFdD]\\b`},{begin:`\\b0[xX]((${zP})\\.?|(${zP})?\\.(${zP}))`+`[pP][+-]?(${jP})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${zP})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};const RP=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],FP=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],PP=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],BP=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],UP=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),$P=PP.concat(BP);const HP=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],VP=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],qP=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],WP=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],KP=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function YP(e){return e?"string"==typeof e?e:e.source:null}function QP(e){return GP("(?=",e,")")}function GP(...e){const t=e.map((e=>YP(e))).join("");return t}function JP(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e),n="("+(t.capture?"":"?:")+e.map((e=>YP(e))).join("|")+")";return n}const ZP=e=>GP(/\b/,e,/\w$/.test(e)?/\b/:/\B/),XP=["Protocol","Type"].map(ZP),eB=["init","self"].map(ZP),tB=["Any","Self"],nB=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],iB=["false","nil","true"],oB=["assignment","associativity","higherThan","left","lowerThan","none","right"],rB=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],sB=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],aB=JP(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),lB=JP(aB,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),cB=GP(aB,lB,"*"),pB=JP(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),uB=JP(pB,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),dB=GP(pB,uB,"*"),hB=GP(/[A-Z]/,uB,"*"),mB=["autoclosure",GP(/convention\(/,JP("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",GP(/objc\(/,dB,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],fB=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];const gB="[A-Za-z$_][0-9A-Za-z$_]*",bB=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],vB=["true","false","null","undefined","NaN","Infinity"],yB=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],xB=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],wB=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],kB=["arguments","this","super","console","window","document","localStorage","module","global"],EB=[].concat(wB,yB,xB);function _B(e){const t=e.regex,n=gB,i="<>",o="</>",r={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,i=e.input[n];if("<"===i||","===i)return void t.ignoreMatch();let o;">"===i&&(((e,{after:t})=>{const n="</"+e[0].slice(1);return-1!==e.input.indexOf(n,t)})(e,{after:n})||t.ignoreMatch());(o=e.input.substring(n).match(/^\s+extends\s+/))&&0===o.index&&t.ignoreMatch()}},s={$pattern:gB,keyword:bB,literal:vB,built_in:EB,"variable.language":kB},a="[0-9](_?[0-9])*",l=`\\.(${a})`,c=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,p={className:"number",variants:[{begin:`(\\b(${c})((${l})|\\.)?|(${l}))`+`[eE][+-]?(${a})\\b`},{begin:`\\b(${c})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},u={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},d={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"css"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,u]},f={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},g=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,h,m,p];u.contains=g.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(g)});const b=[].concat(f,u.contains),v=b.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(b)}]),y={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:v},x={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},w={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...yB,...xB]}},k={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[y],illegal:/%/};const E={match:t.concat(/\b/,(_=[...wB,"super"],t.concat("(?!",_.join("|"),")")),n,t.lookahead(/\(/)),className:"title.function",relevance:0};var _;const M={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},C={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},y]},D="(\\("+"[^()]*(\\("+"[^()]*(\\("+"[^()]*"+"\\)[^()]*)*"+"\\)[^()]*)*"+"\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",O={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[y]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:v,CLASS_REFERENCE:w},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,h,m,f,p,w,{className:"attr",begin:n+t.lookahead(":"),relevance:0},O,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[f,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:v}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i,end:o},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:r.begin,"on:begin":r.isTrulyOpeningTag,end:r.end}],subLanguage:"xml",contains:[{begin:r.begin,end:r.end,skip:!0,contains:["self"]}]}]},k,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\("+"[^()]*(\\("+"[^()]*(\\("+"[^()]*"+"\\)[^()]*)*"+"\\)[^()]*)*"+"\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[y,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},M,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[y]},E,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},x,C,{match:/\$[(.]/}]}}var MB={exports:{}};function CB(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var n=e[t];"object"!=typeof n||Object.isFrozen(n)||CB(n)})),e}MB.exports=CB,MB.exports.default=CB;class DB{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function OB(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function TB(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}const NB="</span>",SB=e=>!!e.scope||e.sublanguage&&e.language;class AB{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=OB(e)}openNode(e){if(!SB(e))return;let t="";t=e.sublanguage?`language-${e.language}`:((e,{prefix:t})=>{if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix}),this.span(t)}closeNode(e){SB(e)&&(this.buffer+=NB)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const jB=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class IB{constructor(){this.rootNode=jB(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=jB({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{IB._collapse(e)})))}}class zB extends IB{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.sublanguage=!0,n.language=t,this.add(n)}toHTML(){return new AB(this,this.options).value()}finalize(){return!0}}function LB(e){return e?"string"==typeof e?e:e.source:null}function RB(e){return BB("(?=",e,")")}function FB(e){return BB("(?:",e,")*")}function PB(e){return BB("(?:",e,")?")}function BB(...e){const t=e.map((e=>LB(e))).join("");return t}function UB(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e),n="("+(t.capture?"":"?:")+e.map((e=>LB(e))).join("|")+")";return n}function $B(e){return new RegExp(e.toString()+"|").exec("").length-1}const HB=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function VB(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n;let i=LB(e),o="";for(;i.length>0;){const e=HB.exec(i);if(!e){o+=i;break}o+=i.substring(0,e.index),i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?o+="\\"+String(Number(e[1])+t):(o+=e[0],"("===e[0]&&n++)}return o})).map((e=>`(${e})`)).join(t)}const qB="[a-zA-Z]\\w*",WB="[a-zA-Z_]\\w*",KB="\\b\\d+(\\.\\d+)?",YB="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",QB="\\b(0b[01]+)",GB={begin:"\\\\[\\s\\S]",relevance:0},JB={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[GB]},ZB={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[GB]},XB=function(e,t,n={}){const i=TB({scope:"comment",begin:e,end:t,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const o=UB("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:BB(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},eU=XB("//","$"),tU=XB("/\\*","\\*/"),nU=XB("#","$"),iU={scope:"number",begin:KB,relevance:0},oU={scope:"number",begin:YB,relevance:0},rU={scope:"number",begin:QB,relevance:0},sU={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[GB,{begin:/\[/,end:/\]/,relevance:0,contains:[GB]}]}]},aU={scope:"title",begin:qB,relevance:0},lU={scope:"title",begin:WB,relevance:0},cU={begin:"\\.\\s*"+WB,relevance:0};var pU=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:qB,UNDERSCORE_IDENT_RE:WB,NUMBER_RE:KB,C_NUMBER_RE:YB,BINARY_NUMBER_RE:QB,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=BB(t,/.*\b/,e.binary,/\b.*/)),TB({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:GB,APOS_STRING_MODE:JB,QUOTE_STRING_MODE:ZB,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},COMMENT:XB,C_LINE_COMMENT_MODE:eU,C_BLOCK_COMMENT_MODE:tU,HASH_COMMENT_MODE:nU,NUMBER_MODE:iU,C_NUMBER_MODE:oU,BINARY_NUMBER_MODE:rU,REGEXP_MODE:sU,TITLE_MODE:aU,UNDERSCORE_TITLE_MODE:lU,METHOD_GUARD:cU,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function uU(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function dU(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function hU(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=uU,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function mU(e,t){Array.isArray(e.illegal)&&(e.illegal=UB(...e.illegal))}function fU(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function gU(e,t){void 0===e.relevance&&(e.relevance=1)}const bU=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]})),e.keywords=n.keywords,e.begin=BB(n.beforeMatch,RB(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},vU=["of","and","for","in","not","or","if","then","parent","list","value"],yU="keyword";function xU(e,t,n=yU){const i=Object.create(null);return"string"==typeof e?o(n,e.split(" ")):Array.isArray(e)?o(n,e):Object.keys(e).forEach((function(n){Object.assign(i,xU(e[n],t,n))})),i;function o(e,n){t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((function(t){const n=t.split("|");i[n[0]]=[e,wU(n[0],n[1])]}))}}function wU(e,t){return t?Number(t):function(e){return vU.includes(e.toLowerCase())}(e)?0:1}const kU={},EU=e=>{console.error(e)},_U=(e,...t)=>{console.log(`WARN: ${e}`,...t)},MU=(e,t)=>{kU[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),kU[`${e}/${t}`]=!0)},CU=new Error;function DU(e,t,{key:n}){let i=0;const o=e[n],r={},s={};for(let e=1;e<=t.length;e++)s[e+i]=o[e],r[e+i]=!0,i+=$B(t[e-1]);e[n]=s,e[n]._emit=r,e[n]._multi=!0}function OU(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw EU("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),CU;if("object"!=typeof e.beginScope||null===e.beginScope)throw EU("beginScope must be object"),CU;DU(e,e.begin,{key:"beginScope"}),e.begin=VB(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw EU("skip, excludeEnd, returnEnd not compatible with endScope: {}"),CU;if("object"!=typeof e.endScope||null===e.endScope)throw EU("endScope must be object"),CU;DU(e,e.end,{key:"endScope"}),e.end=VB(e.end,{joinWith:""})}}(e)}function TU(e){function t(t,n){return new RegExp(LB(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=$B(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=t(VB(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,i)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=TB(e.classNameAliases||{}),function n(o,r){const s=o;if(o.isCompiled)return s;[dU,fU,OU,bU].forEach((e=>e(o,r))),e.compilerExtensions.forEach((e=>e(o,r))),o.__beforeBegin=null,[hU,mU,gU].forEach((e=>e(o,r))),o.isCompiled=!0;let a=null;return"object"==typeof o.keywords&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),a=o.keywords.$pattern,delete o.keywords.$pattern),a=a||/\w+/,o.keywords&&(o.keywords=xU(o.keywords,e.case_insensitive)),s.keywordPatternRe=t(a,!0),r&&(o.begin||(o.begin=/\B|\b/),s.beginRe=t(s.begin),o.end||o.endsWithParent||(o.end=/\B|\b/),o.end&&(s.endRe=t(s.end)),s.terminatorEnd=LB(s.end)||"",o.endsWithParent&&r.terminatorEnd&&(s.terminatorEnd+=(o.end?"|":"")+r.terminatorEnd)),o.illegal&&(s.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return TB(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(NU(e))return TB(e,{starts:e.starts?TB(e.starts):null});if(Object.isFrozen(e))return TB(e);return e}("self"===e?o:e)}))),o.contains.forEach((function(e){n(e,s)})),o.starts&&n(o.starts,r),s.matcher=function(e){const t=new i;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(s),s}(e)}function NU(e){return!!e&&(e.endsWithParent||NU(e.starts))}var SU="11.6.0";class AU extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const jU=OB,IU=TB,zU=Symbol("nomatch"),LU=7;var RU=function(e){const t=Object.create(null),n=Object.create(null),i=[];let o=!0;const r="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:zB};function l(e){return a.noHighlightRe.test(e)}function c(e,t,n){let i="",o="";"object"==typeof t?(i=e,n=t.ignoreIllegals,o=t.language):(MU("10.7.0","highlight(lang, code, ...args) has been deprecated."),MU("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),o=e,i=t),void 0===n&&(n=!0);const r={code:i,language:o};v("before:highlight",r);const s=r.result?r.result:p(r.language,r.code,n);return s.code=r.code,v("after:highlight",s),s}function p(e,n,i,s){const l=Object.create(null);function c(){if(!_.keywords)return void C.addText(D);let e=0;_.keywordPatternRe.lastIndex=0;let t=_.keywordPatternRe.exec(D),n="";for(;t;){n+=D.substring(e,t.index);const o=w.case_insensitive?t[0].toLowerCase():t[0],r=(i=o,_.keywords[i]);if(r){const[e,i]=r;if(C.addText(n),n="",l[o]=(l[o]||0)+1,l[o]<=LU&&(O+=i),e.startsWith("_"))n+=t[0];else{const n=w.classNameAliases[e]||e;C.addKeyword(t[0],n)}}else n+=t[0];e=_.keywordPatternRe.lastIndex,t=_.keywordPatternRe.exec(D)}var i;n+=D.substring(e),C.addText(n)}function d(){null!=_.subLanguage?function(){if(""===D)return;let e=null;if("string"==typeof _.subLanguage){if(!t[_.subLanguage])return void C.addText(D);e=p(_.subLanguage,D,!0,M[_.subLanguage]),M[_.subLanguage]=e._top}else e=u(D,_.subLanguage.length?_.subLanguage:null);_.relevance>0&&(O+=e.relevance),C.addSublanguage(e._emitter,e.language)}():c(),D=""}function h(e,t){let n=1;const i=t.length-1;for(;n<=i;){if(!e._emit[n]){n++;continue}const i=w.classNameAliases[e[n]]||e[n],o=t[n];i?C.addKeyword(o,i):(D=o,c(),D=""),n++}}function m(e,t){return e.scope&&"string"==typeof e.scope&&C.openNode(w.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(C.addKeyword(D,w.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),D=""):e.beginScope._multi&&(h(e.beginScope,t),D="")),_=Object.create(e,{parent:{value:_}}),_}function g(e,t,n){let i=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(e.endRe,n);if(i){if(e["on:end"]){const n=new DB(e);e["on:end"](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return g(e.parent,t,n)}function b(e){return 0===_.matcher.regexIndex?(D+=e[0],1):(S=!0,0)}function v(e){const t=e[0],i=n.substring(e.index),o=g(_,e,i);if(!o)return zU;const r=_;_.endScope&&_.endScope._wrap?(d(),C.addKeyword(t,_.endScope._wrap)):_.endScope&&_.endScope._multi?(d(),h(_.endScope,e)):r.skip?D+=t:(r.returnEnd||r.excludeEnd||(D+=t),d(),r.excludeEnd&&(D=t));do{_.scope&&C.closeNode(),_.skip||_.subLanguage||(O+=_.relevance),_=_.parent}while(_!==o.parent);return o.starts&&m(o.starts,e),r.returnEnd?0:t.length}let y={};function x(t,r){const s=r&&r[0];if(D+=t,null==s)return d(),0;if("begin"===y.type&&"end"===r.type&&y.index===r.index&&""===s){if(D+=n.slice(r.index,r.index+1),!o){const t=new Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=y.rule,t}return 1}if(y=r,"begin"===r.type)return function(e){const t=e[0],n=e.rule,i=new DB(n),o=[n.__beforeBegin,n["on:begin"]];for(const n of o)if(n&&(n(e,i),i.isMatchIgnored))return b(t);return n.skip?D+=t:(n.excludeBegin&&(D+=t),d(),n.returnBegin||n.excludeBegin||(D=t)),m(n,e),n.returnBegin?0:t.length}(r);if("illegal"===r.type&&!i){const e=new Error('Illegal lexeme "'+s+'" for mode "'+(_.scope||"<unnamed>")+'"');throw e.mode=_,e}if("end"===r.type){const e=v(r);if(e!==zU)return e}if("illegal"===r.type&&""===s)return 1;if(N>1e5&&N>3*r.index){throw new Error("potential infinite loop, way more iterations than matches")}return D+=s,s.length}const w=f(e);if(!w)throw EU(r.replace("{}",e)),new Error('Unknown language: "'+e+'"');const k=TU(w);let E="",_=s||k;const M={},C=new a.__emitter(a);!function(){const e=[];for(let t=_;t!==w;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach((e=>C.openNode(e)))}();let D="",O=0,T=0,N=0,S=!1;try{for(_.matcher.considerAll();;){N++,S?S=!1:_.matcher.considerAll(),_.matcher.lastIndex=T;const e=_.matcher.exec(n);if(!e)break;const t=x(n.substring(T,e.index),e);T=e.index+t}return x(n.substring(T)),C.closeAllNodes(),C.finalize(),E=C.toHTML(),{language:e,value:E,relevance:O,illegal:!1,_emitter:C,_top:_}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:jU(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:T,context:n.slice(T-100,T+100),mode:t.mode,resultSoFar:E},_emitter:C};if(o)return{language:e,value:jU(n),illegal:!1,relevance:0,errorRaised:t,_emitter:C,_top:_};throw t}}function u(e,n){n=n||a.languages||Object.keys(t);const i=function(e){const t={value:jU(e),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return t._emitter.addText(e),t}(e),o=n.filter(f).filter(b).map((t=>p(t,e,!1)));o.unshift(i);const r=o.sort(((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(f(e.language).supersetOf===t.language)return 1;if(f(t.language).supersetOf===e.language)return-1}return 0})),[l,c]=r,u=l;return u.secondBest=c,u}function d(e){let t=null;const i=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=a.languageDetectRe.exec(t);if(n){const t=f(n[1]);return t||(_U(r.replace("{}",n[1])),_U("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find((e=>l(e)||f(e)))}(e);if(l(i))return;if(v("before:highlightElement",{el:e,language:i}),e.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),a.throwUnescapedHTML)){throw new AU("One of your code blocks includes unescaped HTML.",e.innerHTML)}t=e;const o=t.textContent,s=i?c(o,{language:i,ignoreIllegals:!0}):u(o);e.innerHTML=s.value,function(e,t,i){const o=t&&n[t]||i;e.classList.add("hljs"),e.classList.add(`language-${o}`)}(e,i,s.language),e.result={language:s.language,re:s.relevance,relevance:s.relevance},s.secondBest&&(e.secondBest={language:s.secondBest.language,relevance:s.secondBest.relevance}),v("after:highlightElement",{el:e,result:s,text:o})}let h=!1;function m(){if("loading"===document.readyState)return void(h=!0);document.querySelectorAll(a.cssSelector).forEach(d)}function f(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function g(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{n[e.toLowerCase()]=t}))}function b(e){const t=f(e);return t&&!t.disableAutodetect}function v(e,t){const n=e;i.forEach((function(e){e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){h&&m()}),!1),Object.assign(e,{highlight:c,highlightAuto:u,highlightAll:m,highlightElement:d,highlightBlock:function(e){return MU("10.7.0","highlightBlock will be removed entirely in v12.0"),MU("10.7.0","Please use highlightElement now."),d(e)},configure:function(e){a=IU(a,e)},initHighlighting:()=>{m(),MU("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){m(),MU("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,i){let r=null;try{r=i(e)}catch(e){if(EU("Language definition for '{}' could not be registered.".replace("{}",n)),!o)throw e;EU(e),r=s}r.name||(r.name=n),t[n]=r,r.rawDefinition=i.bind(null,e),r.aliases&&g(r.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:f,registerAliases:g,autoDetection:b,inherit:IU,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),i.push(e)}}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=SU,e.regex={concat:BB,lookahead:RB,either:UB,optional:PB,anyNumberOfTimes:FB};for(const e in pU)"object"==typeof pU[e]&&MB.exports(pU[e]);return Object.assign(e,pU),e}({}),FU=RU;RU.HighlightJS=RU,RU.default=RU;var PU={exports:{}};!function(e){!function(){var t;function n(e){for(var t,n,i,o,r=1,s=[].slice.call(arguments),a=0,l=e.length,c="",p=!1,u=!1,d=function(){return s[r++]},h=function(){for(var n="";/\d/.test(e[a]);)n+=e[a++],t=e[a];return n.length>0?parseInt(n):null};a<l;++a)if(t=e[a],p)switch(p=!1,"."==t?(u=!1,t=e[++a]):"0"==t&&"."==e[a+1]?(u=!0,t=e[a+=2]):u=!0,o=h(),t){case"b":c+=parseInt(d(),10).toString(2);break;case"c":c+="string"==typeof(n=d())||n instanceof String?n:String.fromCharCode(parseInt(n,10));break;case"d":c+=parseInt(d(),10);break;case"f":i=String(parseFloat(d()).toFixed(o||6)),c+=u?i:i.replace(/^0/,"");break;case"j":c+=JSON.stringify(d());break;case"o":c+="0"+parseInt(d(),10).toString(8);break;case"s":c+=d();break;case"x":c+="0x"+parseInt(d(),10).toString(16);break;case"X":c+="0x"+parseInt(d(),10).toString(16).toUpperCase();break;default:c+=t}else"%"===t?p=!0:c+=t;return c}(t=e.exports=n).format=n,t.vsprintf=function(e,t){return n.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(n.apply(null,arguments))})}()}(PU);var BU=PU.exports;const UU=Object.assign($U(Error),{eval:$U(EvalError),range:$U(RangeError),reference:$U(ReferenceError),syntax:$U(SyntaxError),type:$U(TypeError),uri:$U(URIError)});function $U(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){const i=t?BU(t,...n):t;return new e(i)}}const HU={}.hasOwnProperty,VU="hljs-";function qU(e,t,n={}){let i=n.prefix;if("string"!=typeof e)throw UU("Expected `string` for name, got `%s`",e);if(!FU.getLanguage(e))throw UU("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw UU("Expected `string` for value, got `%s`",t);null==i&&(i=VU),FU.configure({__emitter:WU,classPrefix:i});const o=FU.highlight(t,{language:e,ignoreIllegals:!0});if(FU.configure({}),o.errorRaised)throw o.errorRaised;return o._emitter.root.data.language=o.language,o._emitter.root.data.relevance=o.relevance,o._emitter.root}class WU{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(""===e)return;const t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})}addKeyword(e,t){this.openNode(t),this.addText(e),this.closeNode()}addSublanguage(e,t){const n=this.stack[this.stack.length-1],i=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:i}):n.children.push(...i)}openNode(e){const t=e.split(".").map(((e,t)=>t?e+"_".repeat(t):this.options.classPrefix+e)),n={type:"element",tagName:"span",properties:{className:t},children:[]};this.stack[this.stack.length-1].children.push(n),this.stack.push(n)}closeNode(){this.stack.pop()}closeAllNodes(){}finalize(){}toHTML(){return""}}const KU={highlight:qU,highlightAuto:function(e,t={}){const n=t.subset||FU.listLanguages();t.prefix;let i=-1,o={type:"root",data:{language:null,relevance:0},children:[]};if("string"!=typeof e)throw UU("Expected `string` for value, got `%s`",e);for(;++i<n.length;){const r=n[i];if(!FU.getLanguage(r))continue;const s=qU(r,e,t);s.data.relevance>o.data.relevance&&(o=s)}return o},registerLanguage:function(e,t){FU.registerLanguage(e,t)},registered:function(e){return Boolean(FU.getLanguage(e))},listLanguages:function(){return FU.listLanguages()},registerAlias:function(e,t){if("string"==typeof e)FU.registerAliases(t,{languageName:e});else{let t;for(t in e)HU.call(e,t)&&FU.registerAliases(e[t],{languageName:t})}}};KU.registerLanguage("arduino",(function(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",r="(?!struct)("+i+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line "+"pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},u=t.optional(o)+e.IDENT_RE+"\\s*\\(",d={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},h={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},m=[h,c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],f={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:d,contains:m.concat([{begin:/\(/,end:/\)/,keywords:d,contains:m.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+r+"[\\*&\\s]+)+"+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:d,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:d,relevance:0},{begin:u,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[a,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:d,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(f,g,h,m,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:d,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:d},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}(e),i=n.keywords;return i.type=[...i.type,...t.type],i.literal=[...i.literal,...t.literal],i.built_in=[...i.built_in,...t.built_in],i._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n})),KU.registerLanguage("bash",(function(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},i]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},r={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,o]};o.contains.push(s);const a={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},l=e.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[l,e.SHEBANG(),c,a,e.HASH_COMMENT_MODE,r,{match:/(\/[a-z._-]+)+/},s,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},n]}})),KU.registerLanguage("c",(function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",r="("+i+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line "+"pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},u=t.optional(o)+e.IDENT_RE+"\\s*\\(",d={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream "+"auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set "+"unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos "+"asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp "+"fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper "+"isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow "+"printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp "+"strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan "+"vfprintf vprintf vsprintf endl initializer_list unique_ptr"},h=[c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:d,contains:h.concat([{begin:/\(/,end:/\)/,keywords:d,contains:h.concat(["self"]),relevance:0}]),relevance:0},f={begin:"("+r+"[\\*&\\s]+)+"+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:d,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:d,relevance:0},{begin:u,returnBegin:!0,contains:[e.inherit(p,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:d,disableAutodetect:!0,illegal:"</",contains:[].concat(m,f,h,[c,{begin:e.IDENT_RE+"::",keywords:d},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:a,keywords:d}}})),KU.registerLanguage("cpp",(function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",r="(?!struct)("+i+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line "+"pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},u=t.optional(o)+e.IDENT_RE+"\\s*\\(",d={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},h={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},m=[h,c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],f={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:d,contains:m.concat([{begin:/\(/,end:/\)/,keywords:d,contains:m.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+r+"[\\*&\\s]+)+"+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:d,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:d,relevance:0},{begin:u,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[a,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:d,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(f,g,h,m,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:d,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:d},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}})),KU.registerLanguage("csharp",(function(e){const t={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},n=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),i={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},o={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},r=e.inherit(o,{illegal:/\n/}),s={className:"subst",begin:/\{/,end:/\}/,keywords:t},a=e.inherit(s,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,a]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]},p=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},a]});s.contains=[c,l,o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,e.C_BLOCK_COMMENT_MODE],a.contains=[p,l,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const u={variants:[c,l,o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},d={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},h=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",m={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},u,i,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},n,d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+h+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"].join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,d],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[u,i,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},m]}})),KU.registerLanguage("css",(function(e){const t=e.regex,n=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"("+"%|em|ex|ch|rem"+"|vw|vh|vmin|vmax"+"|cm|mm|in|pt|pc|px"+"|deg|grad|rad|turn"+"|s|ms"+"|Hz|kHz"+"|dpi|dpcm|dppx"+")?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),i=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+"[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+bP.join("|")+")"},{begin:":(:)?("+vP.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+yP.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...i,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...i,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:gP.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...i,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+fP.join("|")+")\\b"}]}})),KU.registerLanguage("diff",(function(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}})),KU.registerLanguage("go",(function(e){const t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{begin:e.C_NUMBER_RE+"[i]",relevance:1},e.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}})),KU.registerLanguage("graphql",(function(e){const t=e.regex;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(/[_A-Za-z][_0-9A-Za-z]*/,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}})),KU.registerLanguage("ini",(function(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},i=e.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},r={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[i,r,o,s,n,"self"],relevance:0},l=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:t.concat(l,"(\\s*\\.\\s*",l,")*",t.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[i,a,r,o,s,n]}}]}})),KU.registerLanguage("java",(function(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+_P("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),o={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},r={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:o,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:o,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,EP,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},EP,r]}})),KU.registerLanguage("javascript",(function(e){const t=e.regex,n=MP,i="<>",o="</>",r={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,i=e.input[n];if("<"===i||","===i)return void t.ignoreMatch();let o;">"===i&&(((e,{after:t})=>{const n="</"+e[0].slice(1);return-1!==e.input.indexOf(n,t)})(e,{after:n})||t.ignoreMatch());(o=e.input.substring(n).match(/^\s+extends\s+/))&&0===o.index&&t.ignoreMatch()}},s={$pattern:MP,keyword:CP,literal:DP,built_in:AP,"variable.language":SP},a="[0-9](_?[0-9])*",l=`\\.(${a})`,c=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,p={className:"number",variants:[{begin:`(\\b(${c})((${l})|\\.)?|(${l}))`+`[eE][+-]?(${a})\\b`},{begin:`\\b(${c})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},u={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},d={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"css"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,u]},f={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},g=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,h,m,p];u.contains=g.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(g)});const b=[].concat(f,u.contains),v=b.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(b)}]),y={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:v},x={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},w={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...OP,...TP]}},k={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[y],illegal:/%/},E={match:t.concat(/\b/,(_=[...NP,"super"],t.concat("(?!",_.join("|"),")")),n,t.lookahead(/\(/)),className:"title.function",relevance:0};var _;const M={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},C={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},y]},D="(\\("+"[^()]*(\\("+"[^()]*(\\("+"[^()]*"+"\\)[^()]*)*"+"\\)[^()]*)*"+"\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",O={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[y]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:v,CLASS_REFERENCE:w},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,h,m,f,p,w,{className:"attr",begin:n+t.lookahead(":"),relevance:0},O,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[f,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:v}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i,end:o},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:r.begin,"on:begin":r.isTrulyOpeningTag,end:r.end}],subLanguage:"xml",contains:[{begin:r.begin,end:r.end,skip:!0,contains:["self"]}]}]},k,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\("+"[^()]*(\\("+"[^()]*(\\("+"[^()]*"+"\\)[^()]*)*"+"\\)[^()]*)*"+"\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[y,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},M,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[y]},E,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},x,C,{match:/\$[(.]/}]}})),KU.registerLanguage("json",(function(e){const t=["true","false","null"],n={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}})),KU.registerLanguage("kotlin",(function(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline "+"crossinline dynamic final enum if else do while for when throw try catch finally "+"import package is in fun override companion reified inline lateinit init "+"interface annotation data sealed internal infix operator out by constructor super "+"tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},r={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(r);const s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},a={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(r,{className:"string"}),"self"]}]},l=LP,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),p={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},u=p;return u.variants[1].contains=[p],p.variants[1].contains=[u],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n,s,a,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[p,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,s,a,r,e.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,a]},r,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},l]}})),KU.registerLanguage("less",(function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"("+"%|em|ex|ch|rem"+"|vw|vh|vmin|vmax"+"|cm|mm|in|pt|pc|px"+"|deg|grad|rad|turn"+"|s|ms"+"|Hz|kHz"+"|dpi|dpcm|dppx"+")?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),n=$P,i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",r=[],s=[],a=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},l=function(e,t,n){return{className:e,begin:t,relevance:n}},c={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:FP.join(" ")},p={begin:"\\(",end:"\\)",contains:s,keywords:c,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a("'"),a('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,p,l("variable","@@?"+i,10),l("variable","@\\{"+i+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const u=s.concat({begin:/\{/,end:/\}/,contains:r}),d={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},h={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+UP.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},m={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:s,relevance:0}},f={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:u}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,d,l("keyword","all\\b"),l("variable","@\\{"+i+"\\}"),{begin:"\\b("+RP.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,l("selector-tag",o,0),l("selector-id","#"+o),l("selector-class","\\."+o,0),l("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+PP.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+BP.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:u},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:i+":(:)?"+`(${n.join("|")})`,returnBegin:!0,contains:[g]};return r.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,f,b,h,g,d,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:r}})),KU.registerLanguage("lua",(function(e){const t="\\[=*\\[",n="\\]=*\\]",i={begin:t,end:n,contains:["self"]},o=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[i],relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len "+"__gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert "+"collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring "+"module next pairs pcall print rawequal rawget rawset require select setfenv "+"setmetatable tonumber tostring type unpack xpcall arg self "+"coroutine resume yield status wrap create running debug getupvalue "+"debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv "+"io lines write close flush open output type read stderr stdin input stdout popen tmpfile "+"math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan "+"os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall "+"string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower "+"table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[i],relevance:5}])}})),KU.registerLanguage("makefile",(function(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},i={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort "+"word wordlist firstword lastword dir notdir suffix basename "+"addsuffix addprefix join wildcard realpath abspath error warning "+"shell origin flavor foreach if or and call eval file value"},contains:[t]},o={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},r={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif "+"include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,i,o,{className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},r]}})),KU.registerLanguage("markdown",(function(e){const t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},i={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},o={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]},r=e.inherit(i,{contains:[]}),s=e.inherit(o,{contains:[]});i.contains.push(s),o.contains.push(r);let a=[t,n];return[i,o,r,s].forEach((e=>{e.contains=e.contains.concat(a)})),a=a.concat(i,o),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:a},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:a}]}]},t,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},i,o,{className:"quote",begin:"^>\\s+",contains:a,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},n,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}})),KU.registerLanguage("objectivec",(function(e){const t=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},illegal:"</",contains:[{className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line "+"pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+n.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}})),KU.registerLanguage("perl",(function(e){const t=e.regex,n=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"].join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},r={begin:/->\{/,end:/\}/},s={variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,`(?![A-Za-z])(?![@$%])`)},{begin:/[$%@][^\s\w{]/,relevance:0}]},a=[e.BACKSLASH_ESCAPE,o,s],l=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],c=(e,i,o="\\1")=>{const r="\\1"===o?o:t.concat(o,i);return t.concat(t.concat("(?:",e,")"),i,/(?:\\.|[^\\\/])*?/,r,/(?:\\.|[^\\\/])*?/,o,n)},p=(e,i,o)=>t.concat(t.concat("(?:",e,")"),i,/(?:\\.|[^\\\/])*?/,o,n),u=[s,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),r,{className:"string",contains:a,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:c("s|tr|y",t.either(...l,{capture:!0}))},{begin:c("s|tr|y","\\(","\\)")},{begin:c("s|tr|y","\\[","\\]")},{begin:c("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...l,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=u,r.contains=u,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:u}})),KU.registerLanguage("php",(function(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),o=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),r={scope:"variable",match:"\\$+"+i},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},a=e.inherit(e.APOS_STRING_MODE,{illegal:null}),l="[ \t\n]",c={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s)}),a,e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(s)})]},p={scope:"number",variants:[{begin:`\\b0[bB][01]+(?:_[01]+)*\\b`},{begin:`\\b0[oO][0-7]+(?:_[0-7]+)*\\b`},{begin:`\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b`},{begin:`(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?`}],relevance:0},u=["false","null","true"],d=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],h=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],m={keyword:d,literal:(e=>{const t=[];return e.forEach((e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())})),t})(u),built_in:h},f=e=>e.map((e=>e.replace(/\|\d+$/,""))),g={variants:[{match:[/new/,t.concat(l,"+"),t.concat("(?!",f(h).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},b=t.concat(i,"\\b(?!\\()"),v={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),b],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,t.concat(/::/,t.lookahead(/(?!class\b)/)),b],scope:{1:"title.class",3:"variable.constant"}},{match:[o,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},y={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},x={relevance:0,begin:/\(/,end:/\)/,keywords:m,contains:[y,r,v,e.C_BLOCK_COMMENT_MODE,c,p,g]},w={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",f(d).join("\\b|"),"|",f(h).join("\\b|"),"\\b)"),i,t.concat(l,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[x]};x.contains.push(w);const k=[y,v,e.C_BLOCK_COMMENT_MODE,c,p,g];return{case_insensitive:!1,keywords:m,contains:[{begin:t.concat(/#\[\s*/,o),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:u,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:u,keyword:["new","array"]},contains:["self",...k]},...k,{scope:"meta",match:o}]},e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},r,w,v,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},g,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:m,contains:["self",r,v,e.C_BLOCK_COMMENT_MODE,c,p]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},c,p]}})),KU.registerLanguage("php-template",(function(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}})),KU.registerLanguage("plaintext",(function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}})),KU.registerLanguage("python",(function(e){const t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},r={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},a={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,r],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,r],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,r,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,r,a,s]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,s]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",p=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,u=`\\b|${i.join("|")}`,d={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${p}))[eE][+-]?(${c})[jJ]?(?=${u})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${u})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${u})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${u})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${u})`},{begin:`\\b(${c})[jJ](?=${u})`}]},h={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",r,d,l,e.HASH_COMMENT_MODE]}]};return s.contains=[l,d,r],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|->|\?)|=>/,contains:[r,d,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},l,h,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[d,m,l]}]}})),KU.registerLanguage("python-repl",(function(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}})),KU.registerLanguage("r",(function(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,r=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 "+"NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F "+"abs acos acosh all any anyNA Arg as.call as.character "+"as.complex as.double as.environment as.integer as.logical "+"as.null.default as.numeric as.raw asin asinh atan atanh attr "+"attributes baseenv browser c call ceiling class Conj cos cosh "+"cospi cummax cummin cumprod cumsum digamma dim dimnames "+"emptyenv exp expression floor forceAndCall gamma gc.time "+"globalenv Im interactive invisible is.array is.atomic is.call "+"is.character is.complex is.double is.environment is.expression "+"is.finite is.function is.infinite is.integer is.language "+"is.list is.logical is.matrix is.na is.name is.nan is.null "+"is.numeric is.object is.pairlist is.raw is.recursive is.single "+"is.symbol lazyLoadDBfetch length lgamma list log max min "+"missing Mod names nargs nzchar oldClass on.exit pos.to.env "+"proc.time prod quote range Re rep retracemem return round "+"seq_along seq_len seq.int sign signif sin sinh sinpi sqrt "+"standardGeneric substitute sum switch tan tanh tanpi tracemem "+"trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[r,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:r},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}})),KU.registerLanguage("ruby",(function(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=t.concat(i,/(::\w+)*/),r={"variable.constant":["__FILE__","__LINE__"],"variable.language":["self","super"],keyword:["alias","and","attr_accessor","attr_reader","attr_writer","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","include","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield"],built_in:["proc","lambda"],literal:["true","false","nil"]},s={className:"doctag",begin:"@[A-Za-z]+"},a={begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:r},p={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},u="[0-9](_?[0-9])*",d={className:"number",relevance:0,variants:[{begin:`\\b(${"[1-9](_?[0-9])*|0"})(\\.(${u}))?([eE][+-]?(${u})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:r}]},m=[p,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/class\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:r},{relevance:0,match:[o,/\.new[ (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[h]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:n}],relevance:0},d,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])"+`(?![A-Za-z])(?![@$?'])`},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:r},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(a,l),relevance:0}].concat(a,l);c.contains=m,h.contains=m;const f=[{begin:/^\s*=>/,starts:{end:"$",contains:m}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:r,contains:m}}];return l.unshift(a),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:r,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(f).concat(l).concat(m)}})),KU.registerLanguage("rust",(function(e){const t=e.regex,n={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let\b)/,e.IDENT_RE,t.lookahead(/\s*\(/))},i="([ui](8|16|32|64|128|size)|f(32|64))?",o=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],r=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:r,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:o},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+i},{begin:"\\b0o([0-7_]+)"+i},{begin:"\\b0x([A-Fa-f0-9_]+)"+i},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+i}],relevance:0},{begin:[/fn/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,e.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:o,type:r}},{className:"punctuation",begin:"->"},n]}})),KU.registerLanguage("scss",(function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"("+"%|em|ex|ch|rem"+"|vw|vh|vmin|vmax"+"|cm|mm|in|pt|pc|px"+"|deg|grad|rad|turn"+"|s|ms"+"|Hz|kHz"+"|dpi|dpcm|dppx"+")?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),n=WP,i=qP,o="@[a-z-]+",r={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+HP.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},r,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+KP.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,r,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:VP.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},r,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}})),KU.registerLanguage("shell",(function(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}})),KU.registerLanguage("sql",(function(e){const t=e.regex,n=e.COMMENT("--","$"),i=["true","false","unknown"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],r=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],s=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],a=r,l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!r.includes(e))),c={begin:t.concat(/\b/,t.either(...a),/\s*\(/),relevance:0,keywords:{built_in:a}};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:n}={}){const i=n;return t=t||[],e.map((e=>e.match(/\|\d+$/)||t.includes(e)?e:i(e)?`${e}|0`:e))}(l,{when:e=>e.length<3}),literal:i,type:o,built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{begin:t.either(...s),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:l.concat(s),literal:i,type:o}},{className:"type",begin:t.either("double precision","large object","with timezone","without timezone")},c,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}})),KU.registerLanguage("swift",(function(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],o={match:[/\./,JP(...XP,...eB)],className:{2:"keyword"}},r={match:GP(/\./,JP(...nB)),relevance:0},s=nB.filter((e=>"string"==typeof e)).concat(["_|0"]),a={variants:[{className:"keyword",match:JP(...nB.filter((e=>"string"!=typeof e)).concat(tB).map(ZP),...eB)}]},l={$pattern:JP(/\b\w+/,/#\w+/),keyword:s.concat(rB),literal:iB},c=[o,r,a],p=[{match:GP(/\./,JP(...sB)),relevance:0},{className:"built_in",match:GP(/\b/,JP(...sB),/(?=\()/)}],u={match:/->/,relevance:0},d=[u,{className:"operator",relevance:0,variants:[{match:cB},{match:`\\.(\\.|${lB})+`}]}],h="([0-9]_*)+",m="([0-9a-fA-F]_*)+",f={className:"number",relevance:0,variants:[{match:`\\b(${h})(\\.(${h}))?`+`([eE][+-]?(${h}))?\\b`},{match:`\\b0x(${m})(\\.(${m}))?`+`([pP][+-]?(${h}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(e="")=>({className:"subst",variants:[{match:GP(/\\/,e,/[0\\tnr"']/)},{match:GP(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),b=(e="")=>({className:"subst",match:GP(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(e="")=>({className:"subst",label:"interpol",begin:GP(/\\/,e,/\(/),end:/\)/}),y=(e="")=>({begin:GP(e,/"""/),end:GP(/"""/,e),contains:[g(e),b(e),v(e)]}),x=(e="")=>({begin:GP(e,/"/),end:GP(/"/,e),contains:[g(e),v(e)]}),w={className:"string",variants:[y(),y("#"),y("##"),y("###"),x(),x("#"),x("##"),x("###")]},k={match:GP(/`/,dB,/`/)},E=[k,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${uB}+`}],_=[{match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:fB,contains:[...d,f,w]}]}},{className:"keyword",match:GP(/@/,JP(...mB))},{className:"meta",match:GP(/@/,dB)}],M={match:QP(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:GP(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,uB,"+")},{className:"type",match:hB,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:GP(/\s+&\s+/,QP(hB)),relevance:0}]},C={begin:/</,end:/>/,keywords:l,contains:[...i,...c,..._,u,M]};M.contains.push(C);const D={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:GP(dB,/\s*:/),keywords:"_|0",relevance:0},...i,...c,...p,...d,f,w,...E,..._,M]},O={begin:/</,end:/>/,contains:[...i,M]},T={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:JP(QP(GP(dB,/\s*:/)),QP(GP(dB,/\s+/,dB,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:dB}]},...i,...c,...d,f,w,..._,M,D],endsParent:!0,illegal:/["']/},N={match:[/func/,/\s+/,JP(k.match,dB,cB)],className:{1:"keyword",3:"title.function"},contains:[O,T,t],illegal:[/\[/,/%/]},S={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[O,T,t],illegal:/\[|%/},A={match:[/operator/,/\s+/,cB],className:{1:"keyword",3:"title"}},j={begin:[/precedencegroup/,/\s+/,hB],className:{1:"keyword",3:"title"},contains:[M],keywords:[...oB,...iB],end:/}/};for(const e of w.variants){const t=e.contains.find((e=>"interpol"===e.label));t.keywords=l;const n=[...c,...p,...d,f,w,...E];t.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:l,contains:[...i,N,S,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:l,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},A,j,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},...c,...p,...d,f,w,...E,..._,M,D]}})),KU.registerLanguage("typescript",(function(e){const t=_B(e),n=gB,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[t.exports.CLASS_REFERENCE]},r={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[t.exports.CLASS_REFERENCE]},s={$pattern:gB,keyword:bB.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]),literal:vB,built_in:EB.concat(i),"variable.language":kB},a={className:"meta",begin:"@"+n},l=(e,t,n)=>{const i=e.contains.findIndex((e=>e.label===t));if(-1===i)throw new Error("can not find mode to replace");e.contains.splice(i,1,n)};Object.assign(t.keywords,s),t.exports.PARAMS_CONTAINS.push(a),t.contains=t.contains.concat([a,o,r]),l(t,"shebang",e.SHEBANG()),l(t,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/});const c=t.contains.find((e=>"func.def"===e.label));return c.relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx"]}),t})),KU.registerLanguage("vbnet",(function(e){const t=e.regex,n=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,r=/\d{1,2}(:\d{1,2}){1,2}/,s={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,n),/ *#/)},{begin:t.concat(/# */,r,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(i,n),/ +/,t.either(o,r),/ *#/)}]},a=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval "+"call case catch class compare const continue custom declare default delegate dim distinct do "+"each equals else elseif end enum erase error event exit explicit finally for friend from function "+"get global goto group handles if implements imports in inherits interface into iterator "+"join key let lib loop me mid module mustinherit mustoverride mybase myclass "+"namespace narrowing new next notinheritable notoverridable "+"of off on operator option optional order overloads overridable overrides "+"paramarray partial preserve private property protected public "+"raiseevent readonly redim removehandler resume return "+"select set shadows shared skip static step stop structure strict sub synclock "+"take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor "+"cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s,{className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{className:"label",begin:/^\w+:/},a,l,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[l]}]}})),KU.registerLanguage("wasm",(function(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);return t.contains.push("self"),{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"]},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},{className:"variable",begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},{className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}})),KU.registerLanguage("xml",(function(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},r=e.inherit(o,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,a,s,r,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,r,a,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}})),KU.registerLanguage("yaml",(function(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},o=e.inherit(i,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),r={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},s={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},a={begin:/\{/,end:/\}/,contains:[s],illegal:"\\n",relevance:0},l={begin:"\\[",end:"\\]",contains:[s],illegal:"\\n",relevance:0},c=[{className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},r,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},a,l,i],p=[...c];return p.pop(),p.push(o),s.contains=p,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:c}}));const YU=()=>t.createElement(Nc,{"data-cy":"neeto-editor-code-block"},t.createElement("pre",null,t.createElement(Tc,{as:"code"})));var QU=mP.extend({addNodeView:()=>new jc(YU)}).configure({lowlight:KU}),GU=cs.create({name:"paste-unformatted",addCommands:()=>({pasteUnformatted:()=>async e=>{let{editor:t}=e;const n=await navigator.clipboard.readText();t.commands.insertContent(n)}})});var JU=ta.create({name:"doc",topNode:!0,content:"block+"}).extend({content:"root",addProseMirrorPlugins(){const{editor:e}=this;return[new Xt({key:new nn("eventHandler"),props:{handleClick(t,n){const{state:i}=t,o=i.doc.lastChild,r=i.doc.resolve(n).nodeBefore;if(o&&r){const t=o.eq(r),i=o.isInline,s=["paragraph","text"].includes(o.type.name);!t||i||s||e.commands.insertContentAt(n,{type:"paragraph",content:""})}}}})]}}),ZU=ta.create({name:"external-video",addOptions:()=>({inline:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},title:{default:null},frameborder:{default:"0"},allow:{default:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"},allowfullscreen:{default:"allowfullscreen"}}),parseHTML:()=>[{tag:"iframe[src]"}],renderHTML(e){let{HTMLAttributes:t}=e;return["iframe",Vr(this.options.HTMLAttributes,{...t,class:"video-wrapper"})]},addCommands(){return{setExternalVideo:e=>t=>{let{commands:n}=t;return n.insertContent({type:this.name,attrs:e})}}}});const XU=new nn("suggestion");function e$({pluginKey:e=XU,editor:t,char:n="@",allowSpaces:i=!1,allowedPrefixes:o=[" "],startOfLine:r=!1,decorationTag:s="span",decorationClass:a="suggestion",command:l=(()=>null),items:c=(()=>[]),render:p=(()=>({})),allow:u=(()=>!0)}){let d;const h=null==p?void 0:p(),m=new Xt({key:e,view(){return{update:async(e,n)=>{var i,o,r,s,a,p,u;const m=null===(i=this.key)||void 0===i?void 0:i.getState(n),f=null===(o=this.key)||void 0===o?void 0:o.getState(e.state),g=m.active&&f.active&&m.range.from!==f.range.from,b=!m.active&&f.active,v=m.active&&!f.active,y=b||g,x=!b&&!v&&m.query!==f.query&&!g,w=v||g;if(!y&&!x&&!w)return;const k=w&&!y?m:f,E=e.dom.querySelector(`[data-decoration-id="${k.decorationId}"]`);d={editor:t,range:k.range,query:k.query,text:k.text,items:[],command:e=>{l({editor:t,range:k.range,props:e})},decorationNode:E,clientRect:E?()=>{var n;const{decorationId:i}=null===(n=this.key)||void 0===n?void 0:n.getState(t.state),o=e.dom.querySelector(`[data-decoration-id="${i}"]`);return(null==o?void 0:o.getBoundingClientRect())||null}:null},y&&(null===(r=null==h?void 0:h.onBeforeStart)||void 0===r||r.call(h,d)),x&&(null===(s=null==h?void 0:h.onBeforeUpdate)||void 0===s||s.call(h,d)),(x||y)&&(d.items=await c({editor:t,query:k.query})),w&&(null===(a=null==h?void 0:h.onExit)||void 0===a||a.call(h,d)),x&&(null===(p=null==h?void 0:h.onUpdate)||void 0===p||p.call(h,d)),y&&(null===(u=null==h?void 0:h.onStart)||void 0===u||u.call(h,d))},destroy:()=>{var e;d&&(null===(e=null==h?void 0:h.onExit)||void 0===e||e.call(h,d))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(e,s,a,l){const{isEditable:c}=t,{composing:p}=t.view,{selection:d}=e,{empty:h,from:m}=d,f={...s};if(f.composing=p,c&&(h||t.view.composing)){!(m<s.range.from||m>s.range.to)||p||s.composing||(f.active=!1);const e=function(e){var t;const{char:n,allowSpaces:i,allowedPrefixes:o,startOfLine:r,$position:s}=e,a=ia(n),l=new RegExp(`\\s${a}$`),c=r?"^":"",p=i?new RegExp(`${c}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${c}(?:^)?${a}[^\\s${a}]*`,"gm"),u=(null===(t=s.nodeBefore)||void 0===t?void 0:t.isText)&&s.nodeBefore.text;if(!u)return null;const d=s.pos-u.length,h=Array.from(u.matchAll(p)).pop();if(!h||void 0===h.input||void 0===h.index)return null;const m=h.input.slice(Math.max(0,h.index-1),h.index),f=new RegExp(`^[${null==o?void 0:o.join("")}\0]?$`).test(m);if(null!==o&&!f)return null;const g=d+h.index;let b=g+h[0].length;return i&&l.test(u.slice(b-1,b+1))&&(h[0]+=" ",b+=1),g<s.pos&&b>=s.pos?{range:{from:g,to:b},query:h[0].slice(n.length),text:h[0]}:null}({char:n,allowSpaces:i,allowedPrefixes:o,startOfLine:r,$position:d.$from}),a=`id_${Math.floor(4294967295*Math.random())}`;e&&u({editor:t,state:l,range:e.range})?(f.active=!0,f.decorationId=s.decorationId?s.decorationId:a,f.range=e.range,f.query=e.query,f.text=e.text):f.active=!1}else f.active=!1;return f.active||(f.decorationId=null,f.range={from:0,to:0},f.query=null,f.text=null),f}},props:{handleKeyDown(e,t){var n;const{active:i,range:o}=m.getState(e.state);return i&&(null===(n=null==h?void 0:h.onKeyDown)||void 0===n?void 0:n.call(h,{view:e,event:t,range:o}))||!1},decorations(e){const{active:t,range:n,decorationId:i}=m.getState(e);return t?yu.create(e.doc,[gu.inline(n.from,n.to,{nodeName:s,class:a,"data-decoration-id":i})]):null}}});return m}const t$=new nn("emoji-picker"),n$=ta.create({name:"emojiPicker",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:()=>({suggestion:{char:"::",startOfLine:!1,pluginKey:t$,items:()=>[],render:()=>{let e,t;return{onStart(n){e=new Sc(Wk,{props:n,editor:n.editor}),t=mc("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onKeyDown(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit(){t[0].destroy(),e.destroy()}}}}}),addProseMirrorPlugins(){return[e$({editor:this.editor,...this.options.suggestion})]}});class i$ extends t.Component{constructor(){super(...arguments),Eb(this,"state",{isLoading:!1,selectedIndex:0,emojiSuggestions:[]}),Eb(this,"fetchEmojiData",(async()=>{this.setState({isLoading:!0});try{const{data:e}=await Kx.get("https://cdn.jsdelivr.net/npm/@emoji-mart/data");return this.setState({isLoading:!1}),e}catch(e){return this.setState({isLoading:!1}),{}}})),Eb(this,"searchEmoji",(async()=>{if(this.props.query)return(await Xw.search(this.props.query)).slice(0,5);return(await Promise.all(["+1","-1","smile","tada","heart"].map((e=>Xw.search(e))))).map((e=>e[0]))})),Eb(this,"searchEmojiAndSetState",(async()=>{const e=await this.searchEmoji();this.setState({emojiSuggestions:e})})),Eb(this,"setEditorState",(async()=>{const e=await this.searchEmoji();this.props.editor.chain().focus().deleteRange(this.props.range).setEmoji(e[0]).run()})),Eb(this,"onKeyDown",(e=>{let{event:t}=e;return"ArrowLeft"===t.key||"ArrowDown"===t.key?(this.setState((e=>{let{selectedIndex:t,emojiSuggestions:n}=e;return{selectedIndex:(t+n.length-1)%n.length}})),!0):"ArrowRight"===t.key||"ArrowUp"===t.key?(this.setState((e=>{let{selectedIndex:t,emojiSuggestions:n}=e;return{selectedIndex:(t+1)%n.length}})),!0):"Enter"===t.key?(this.selectItem(this.state.selectedIndex),!0):" "===t.key?(Nd(this.props.query)?this.props.editor.chain().focus().insertContent(" ").run():this.setEditorState(),!0):"Escape"===t.key&&(this.props.editor.chain().focus().insertContent(" ").run(),!0)})),Eb(this,"selectItem",(e=>{this.props.editor.chain().focus().deleteRange(this.props.range).setEmoji(this.state.emojiSuggestions[e]).run()}))}componentDidMount(){Qw({data:this.fetchEmojiData,theme:"light",previewPosition:"none"}),this.searchEmojiAndSetState()}componentDidUpdate(e){this.props.query!==e.query&&this.searchEmojiAndSetState()}render(){return t.createElement("div",{className:"neeto-editor-emoji-suggestion"},this.state.isLoading&&t.createElement(aI,null),!this.state.isLoading&&(this.state.emojiSuggestions.length>0?this.state.emojiSuggestions.map(((e,n)=>t.createElement("div",{key:e.id,onClick:()=>this.selectItem(n),className:Bc("neeto-editor-emoji-suggestion__item",{"neeto-editor-emoji-suggestion__item--selected":n===this.state.selectedIndex}),"data-cy":`neeto-editor-emoji-suggestion-${e.id}`},e.skins[0].native))):t.createElement("p",null,"No results")))}}const o$=new nn("emoji-suggestion"),r$=ta.create({name:"emojiSuggestion",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:()=>({HTMLAttributes:{class:"neeto-editor-emoji"},renderEmoji(e){let{node:t}=e;return t.attrs.label},suggestion:{}}),addAttributes:()=>({label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML:()=>[{tag:"span[data-emoji]"}],renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["span",Vr({"data-emoji":""},this.options.HTMLAttributes,n),this.options.renderEmoji({node:t})]},renderText(e){let{node:t}=e;return this.options.renderEmoji({node:t})},addCommands(){return{setEmoji:e=>t=>{var n;let{chain:i}=t;i().focus().insertContent([{type:this.name,attrs:{label:(null==e?void 0:e.native)||(null==e||null===(n=e.skins[0])||void 0===n?void 0:n.native)||""}},{type:"text",text:" "}]).run()}}},addProseMirrorPlugins(){return[e$({editor:this.editor,...this.options.suggestion})]}}),s$={char:":",startOfLine:!1,pluginKey:o$,command:e=>{let{editor:t,range:n,props:i}=e;t.chain().focus().deleteRange(n).setEmoji(i).run()},items:()=>[],render:()=>{let e,t;return{onStart(n){e=new Sc(i$,{props:n,editor:n.editor}),t=mc("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",zIndex:99999})},onUpdate(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit(){t[0].destroy(),e.destroy()}}}};var a$=r$.configure({suggestion:s$});const l$=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,c$=ta.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",Vr(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Js({find:l$,type:this.type,getAttributes:e=>{const[,,t,n,i]=e;return{src:n,alt:t,title:i}}})]}});var p$,u$=void 0&&(void 0).__extends||(p$=function(e,t){return p$=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},p$(e,t)},function(e,t){function n(){this.constructor=e}p$(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),d$=void 0&&(void 0).__assign||function(){return d$=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},d$.apply(this,arguments)},h$={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},m$={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},f$={width:"20px",height:"20px",position:"absolute"},g$={top:d$(d$({},h$),{top:"-5px"}),right:d$(d$({},m$),{left:void 0,right:"-5px"}),bottom:d$(d$({},h$),{top:void 0,bottom:"-5px"}),left:d$(d$({},m$),{left:"-5px"}),topRight:d$(d$({},f$),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:d$(d$({},f$),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:d$(d$({},f$),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:d$(d$({},f$),{left:"-10px",top:"-10px",cursor:"nw-resize"})},b$=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.onMouseDown=function(t){e.props.onResizeStart(t,e.props.direction)},e.onTouchStart=function(t){e.props.onResizeStart(t,e.props.direction)},e}return u$(n,t),n.prototype.render=function(){return e.createElement("div",{className:this.props.className||"",style:d$(d$({position:"absolute",userSelect:"none"},g$[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},n}(e.PureComponent),v$=void 0&&(void 0).__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),y$=void 0&&(void 0).__assign||function(){return y$=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},y$.apply(this,arguments)},x$={width:"auto",height:"auto"},w$=function(e,t,n){return Math.max(Math.min(e,n),t)},k$=function(e,t){return Math.round(e/t)*t},E$=function(e,t){return new RegExp(e,"i").test(t)},_$=function(e){return Boolean(e.touches&&e.touches.length)},M$=function(e,t,n){void 0===n&&(n=0);var i=t.reduce((function(n,i,o){return Math.abs(i-e)<Math.abs(t[n]-e)?o:n}),0),o=Math.abs(t[i]-e);return 0===n||o<n?t[i]:e},C$=function(e){return"auto"===(e=e.toString())||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:e+"px"},D$=function(e,t,n,i){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return t*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return n*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return i*(Number(e.replace("vh",""))/100)}return e},O$=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],T$="__resizable_base__",N$=function(t){function n(e){var n=t.call(this,e)||this;return n.ratio=1,n.resizable=null,n.parentLeft=0,n.parentTop=0,n.resizableLeft=0,n.resizableRight=0,n.resizableTop=0,n.resizableBottom=0,n.targetLeft=0,n.targetTop=0,n.appendBase=function(){if(!n.resizable||!n.window)return null;var e=n.parentNode;if(!e)return null;var t=n.window.document.createElement("div");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.transform="scale(0, 0)",t.style.left="0",t.style.flex="0 0 100%",t.classList?t.classList.add(T$):t.className+=T$,e.appendChild(t),t},n.removeBase=function(e){var t=n.parentNode;t&&t.removeChild(e)},n.ref=function(e){e&&(n.resizable=e)},n.state={isResizing:!1,width:void 0===(n.propsSize&&n.propsSize.width)?"auto":n.propsSize&&n.propsSize.width,height:void 0===(n.propsSize&&n.propsSize.height)?"auto":n.propsSize&&n.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},n.onResizeStart=n.onResizeStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n}return v$(n,t),Object.defineProperty(n.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||x$},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,i=this.resizable.offsetHeight,o=this.resizable.style.position;"relative"!==o&&(this.resizable.style.position="relative"),e="auto"!==this.resizable.style.width?this.resizable.offsetWidth:n,t="auto"!==this.resizable.style.height?this.resizable.offsetHeight:i,this.resizable.style.position=o}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,n=function(t){if(void 0===e.state[t]||"auto"===e.state[t])return"auto";if(e.propsSize&&e.propsSize[t]&&e.propsSize[t].toString().endsWith("%")){if(e.state[t].toString().endsWith("%"))return e.state[t].toString();var n=e.getParentSize();return Number(e.state[t].toString().replace("px",""))/n[t]*100+"%"}return C$(e.state[t])};return{width:t&&void 0!==t.width&&!this.state.isResizing?C$(t.width):n("width"),height:t&&void 0!==t.height&&!this.state.isResizing?C$(t.height):n("height")}},enumerable:!1,configurable:!0}),n.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,n=this.parentNode.style.flexWrap;"wrap"!==n&&(t=!0,this.parentNode.style.flexWrap="wrap"),e.style.position="relative",e.style.minWidth="100%",e.style.minHeight="100%";var i={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=n),this.removeBase(e),i},n.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},n.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},n.prototype.componentDidMount=function(){if(this.resizable&&this.window){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==e.flexBasis?e.flexBasis:void 0})}},n.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},n.prototype.createSizeForCssProperty=function(e,t){var n=this.propsSize&&this.propsSize[t];return"auto"!==this.state[t]||this.state.original[t]!==e||void 0!==n&&"auto"!==n?e:"auto"},n.prototype.calculateNewMaxFromBoundary=function(e,t){var n,i,o=this.props.boundsByDirection,r=this.state.direction,s=o&&E$("left",r),a=o&&E$("top",r);if("parent"===this.props.bounds){var l=this.parentNode;l&&(n=s?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),i=a?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(n=s?this.resizableRight:this.window.innerWidth-this.resizableLeft,i=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(n=s?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),i=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return n&&Number.isFinite(n)&&(e=e&&e<n?e:n),i&&Number.isFinite(i)&&(t=t&&t<i?t:i),{maxWidth:e,maxHeight:t}},n.prototype.calculateNewSizeFromDirection=function(e,t){var n=this.props.scale||1,i=this.props.resizeRatio||1,o=this.state,r=o.direction,s=o.original,a=this.props,l=a.lockAspectRatio,c=a.lockAspectRatioExtraHeight,p=a.lockAspectRatioExtraWidth,u=s.width,d=s.height,h=c||0,m=p||0;return E$("right",r)&&(u=s.width+(e-s.x)*i/n,l&&(d=(u-m)/this.ratio+h)),E$("left",r)&&(u=s.width-(e-s.x)*i/n,l&&(d=(u-m)/this.ratio+h)),E$("bottom",r)&&(d=s.height+(t-s.y)*i/n,l&&(u=(d-h)*this.ratio+m)),E$("top",r)&&(d=s.height-(t-s.y)*i/n,l&&(u=(d-h)*this.ratio+m)),{newWidth:u,newHeight:d}},n.prototype.calculateNewSizeFromAspectRatio=function(e,t,n,i){var o=this.props,r=o.lockAspectRatio,s=o.lockAspectRatioExtraHeight,a=o.lockAspectRatioExtraWidth,l=void 0===i.width?10:i.width,c=void 0===n.width||n.width<0?e:n.width,p=void 0===i.height?10:i.height,u=void 0===n.height||n.height<0?t:n.height,d=s||0,h=a||0;if(r){var m=(p-d)*this.ratio+h,f=(u-d)*this.ratio+h,g=(l-h)/this.ratio+d,b=(c-h)/this.ratio+d,v=Math.max(l,m),y=Math.min(c,f),x=Math.max(p,g),w=Math.min(u,b);e=w$(e,v,y),t=w$(t,x,w)}else e=w$(e,l,c),t=w$(t,p,u);return{newWidth:e,newHeight:t}},n.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var e=this.parentNode;if(e){var t=e.getBoundingClientRect();this.parentLeft=t.left,this.parentTop=t.top}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var n=this.props.bounds.getBoundingClientRect();this.targetLeft=n.left,this.targetTop=n.top}if(this.resizable){var i=this.resizable.getBoundingClientRect(),o=i.left,r=i.top,s=i.right,a=i.bottom;this.resizableLeft=o,this.resizableRight=s,this.resizableTop=r,this.resizableBottom=a}},n.prototype.onResizeStart=function(e,t){if(this.resizable&&this.window){var n,i=0,o=0;if(e.nativeEvent&&function(e){return Boolean((e.clientX||0===e.clientX)&&(e.clientY||0===e.clientY))}(e.nativeEvent)?(i=e.nativeEvent.clientX,o=e.nativeEvent.clientY):e.nativeEvent&&_$(e.nativeEvent)&&(i=e.nativeEvent.touches[0].clientX,o=e.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(e,t,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var r=this.window.getComputedStyle(this.resizable);if("auto"!==r.flexBasis){var s=this.parentNode;if(s){var a=this.window.getComputedStyle(s).flexDirection;this.flexDir=a.startsWith("row")?"row":"column",n=r.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:y$(y$({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:n};this.setState(l)}},n.prototype.onMouseMove=function(e){var t=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&_$(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var n=this.props,i=n.maxWidth,o=n.maxHeight,r=n.minWidth,s=n.minHeight,a=_$(e)?e.touches[0].clientX:e.clientX,l=_$(e)?e.touches[0].clientY:e.clientY,c=this.state,p=c.direction,u=c.original,d=c.width,h=c.height,f=this.getParentSize(),g=function(e,t,n,i,o,r,s){return i=D$(i,e.width,t,n),o=D$(o,e.height,t,n),r=D$(r,e.width,t,n),s=D$(s,e.height,t,n),{maxWidth:void 0===i?void 0:Number(i),maxHeight:void 0===o?void 0:Number(o),minWidth:void 0===r?void 0:Number(r),minHeight:void 0===s?void 0:Number(s)}}(f,this.window.innerWidth,this.window.innerHeight,i,o,r,s);i=g.maxWidth,o=g.maxHeight,r=g.minWidth,s=g.minHeight;var b=this.calculateNewSizeFromDirection(a,l),v=b.newHeight,y=b.newWidth,x=this.calculateNewMaxFromBoundary(i,o);this.props.snap&&this.props.snap.x&&(y=M$(y,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(v=M$(v,this.props.snap.y,this.props.snapGap));var w=this.calculateNewSizeFromAspectRatio(y,v,{width:x.maxWidth,height:x.maxHeight},{width:r,height:s});if(y=w.newWidth,v=w.newHeight,this.props.grid){var k=k$(y,this.props.grid[0]),E=k$(v,this.props.grid[1]),_=this.props.snapGap||0;y=0===_||Math.abs(k-y)<=_?k:y,v=0===_||Math.abs(E-v)<=_?E:v}var M={width:y-u.width,height:v-u.height};if(d&&"string"==typeof d)if(d.endsWith("%"))y=y/f.width*100+"%";else if(d.endsWith("vw")){y=y/this.window.innerWidth*100+"vw"}else if(d.endsWith("vh")){y=y/this.window.innerHeight*100+"vh"}if(h&&"string"==typeof h)if(h.endsWith("%"))v=v/f.height*100+"%";else if(h.endsWith("vw")){v=v/this.window.innerWidth*100+"vw"}else if(h.endsWith("vh")){v=v/this.window.innerHeight*100+"vh"}var C={width:this.createSizeForCssProperty(y,"width"),height:this.createSizeForCssProperty(v,"height")};"row"===this.flexDir?C.flexBasis=C.width:"column"===this.flexDir&&(C.flexBasis=C.height),m((function(){t.setState(C)})),this.props.onResize&&this.props.onResize(e,p,this.resizable,M)}},n.prototype.onMouseUp=function(e){var t=this.state,n=t.isResizing,i=t.direction,o=t.original;if(n&&this.resizable){var r={width:this.size.width-o.width,height:this.size.height-o.height};this.props.onResizeStop&&this.props.onResizeStop(e,i,this.resizable,r),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:y$(y$({},this.state.backgroundStyle),{cursor:"auto"})})}},n.prototype.updateSize=function(e){this.setState({width:e.width,height:e.height})},n.prototype.renderResizer=function(){var t=this,n=this.props,i=n.enable,o=n.handleStyles,r=n.handleClasses,s=n.handleWrapperStyle,a=n.handleWrapperClass,l=n.handleComponent;if(!i)return null;var c=Object.keys(i).map((function(n){return!1!==i[n]?e.createElement(b$,{key:n,direction:n,onResizeStart:t.onResizeStart,replaceStyles:o&&o[n],className:r&&r[n]},l&&l[n]?l[n]:null):null}));return e.createElement("div",{className:a,style:s},c)},n.prototype.render=function(){var t=this,n=Object.keys(this.props).reduce((function(e,n){return-1!==O$.indexOf(n)||(e[n]=t.props[n]),e}),{}),i=y$(y$(y$({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return e.createElement(o,y$({ref:this.ref,style:i,className:this.props.className},n),this.state.isResizing&&e.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},n.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},n}(e.PureComponent);const S$=e=>{let{node:n,editor:i,getPos:o}=e;const{alt:r,src:s,float:a,align:l,height:c,width:p}=n.attrs,u=r||"",{view:d}=i;return t.createElement(Nc,null,t.createElement(N$,{lockAspectRatio:!0,className:`neeto-editor__image neeto-editor__image--${a} neeto-editor__image--${l} neeto-editor__image-defaults`,size:{height:c,width:p},onResizeStop:(e,t,r)=>{d.dispatch(d.state.tr.setNodeMarkup(o(),void 0,{...n.attrs,height:r.offsetHeight,width:r.offsetWidth})),i.commands.focus()}},t.createElement("figure",null,t.createElement("img",S({alt:u,src:s},n.attrs)),t.createElement("figcaption",null,u))))},A$=c$.extend({name:"image",addAttributes:()=>({...c$.config.addAttributes(),height:{default:"auto",rendered:!1},width:{default:"fit-content",rendered:!1},float:{default:"none",rendered:!1},align:{default:"center",rendered:!1}}),addCommands(){return{setImage:e=>t=>{var n,i,o;let{tr:r,commands:s}=t;return"image"===(null===(n=r.selection)||void 0===n||null===(i=n.node)||void 0===i||null===(o=i.type)||void 0===o?void 0:o.name)?s.updateAttributes("image",e):s.insertContent({type:this.name,attrs:e})},setImageAttributes:e=>t=>{let{tr:n}=t;const{selection:i}=n,o={...i.node.attrs,...e},r=this.type.create(o);n.replaceRangeWith(i.from,i.to,r)}}},parseHTML:()=>[{tag:"img"}],renderHTML(e){let{node:t}=e;const{alt:n,src:i,float:o,align:r,height:s,width:a}=t.attrs,l=n||"";return["a",{class:`neeto-editor__image neeto-editor__image--${o} neeto-editor__image--${r} neeto-editor__image-defaults`,style:`height:${isNaN(s)?s:`${s}px`};width:${isNaN(a)?a:`${a}px`};`,href:i,target:"_blank",rel:"noopener noreferrer"},["figure",{},["img",Vr(t.attrs,{src:i,caption:l})],["figcaption",l]]]},addNodeView:()=>jc(S$)}),j$=async(e,t)=>{const n=new nI({file:e,url:t}),{blob_url:i}=await n.create();return i};var I$=e=>{let{uploadEndpoint:t}=e;return A$.extend({addProseMirrorPlugins:()=>[new Xt({props:{handleDOMEvents:{paste(e,n){var i,o;const{schema:r,selection:{$anchor:{pos:s}}}=e.state;if(!(null===(i=n.clipboardData)||void 0===i||null===(o=i.files)||void 0===o?void 0:o.length))return;const a=Array.from(n.clipboardData.files).filter((e=>/image/i.test(e.type)));a.length&&(n.preventDefault(),a.forEach((async n=>{const i=r.nodes.image.create({src:await j$(n,t)}),o=e.state.tr.insert(s,i);e.dispatch(o)})))}}}})]})},z$=ta.create({name:"figcaption",selectable:!1,draggable:!1,parseHTML:()=>[{tag:"figcaption"}]});const L$=e=>{let{handleSubmit:t,shortcuts:n}=e;return cs.create({name:"keyboard-shortcuts",addKeyboardShortcuts(){return{"Mod-Enter":()=>(null==t||t(this.editor.getHTML()),this.editor.commands.blur(),!0),...n}}})};var R$=e=>{let{handleSubmit:t,shortcuts:n}=e;return L$({handleSubmit:t,shortcuts:n})};const F$="undefined"!=typeof navigator?navigator:null,P$="undefined"!=typeof document?document:null,B$=F$&&F$.userAgent||"",U$=/Edge\/(\d+)/.exec(B$),$$=/MSIE \d/.exec(B$),H$=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(B$),V$=!!($$||H$||U$),q$=$$?document.documentMode:H$?+H$[1]:U$?+U$[1]:0,W$=!V$&&/gecko\/(\d+)/i.test(B$);W$&&(/Firefox\/(\d+)/.exec(B$)||[0,0])[1];const K$=!V$&&/Chrome\/(\d+)/.exec(B$),Y$=!!K$,Q$=K$?+K$[1]:0,G$=!V$&&!!F$&&/Apple Computer/.test(F$.vendor),J$=G$&&(/Mobile\/\w+/.test(B$)||!!F$&&F$.maxTouchPoints>2),Z$=J$||!!F$&&/Mac/.test(F$.platform),X$=/Android \d/.test(B$),eH=!!P$&&"webkitFontSmoothing"in P$.documentElement.style,tH=eH?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,nH=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},iH=/^(img|br|input|textarea|hr)$/i;function oH(e,t,n,i,o){for(;;){if(e==n&&t==i)return!0;if(t==(o<0?0:rH(e))){let n=e.parentNode;if(!n||1!=n.nodeType||sH(e)||iH.test(e.nodeName)||"false"==e.contentEditable)return!1;t=nH(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?rH(e):0}}}function rH(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function sH(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 aH=function(e){let t=e.isCollapsed;return t&&Y$&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function lH(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function cH(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(aH(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==rH(e);i||o;){if(e==n)return!0;let t=nH(e);if(!(e=e.parentNode))return!1;i=i&&0==t,o=o&&t==rH(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=bH(e,a,c,"pointer"==t||e.state.selection.head<c.pos&&!r?1:-1)}return l}function pH(e){return e.editable?e.hasFocus():function(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}}(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function uH(e,t=!1){let n=e.state.selection;if(function(e,t){if(t instanceof Rt){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(gH(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else gH(e)}(e,n),pH(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Y$){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&function(e,t,n,i){return n&&(oH(e,t,n,i,-1)||oH(e,t,n,i,1))}(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,nH(i)+1):n.setEnd(i,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&V$&&q$<=11&&(i.disabled=!0,i.disabled=!1)}(e);else{let i,o,{anchor:r,head:s}=n;!dH||n instanceof zt||(n.$from.parent.inlineContent||(i=hH(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=hH(e,n.to))),e.docView.setSelection(r,s,e.root,t),dH&&(i&&fH(i),o&&fH(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((()=>{pH(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const dH=G$||Y$&&Q$<63;function hH(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(G$&&o&&"false"==o.contentEditable)return mH(o);if(!(o&&"false"!=o.contentEditable||r&&"false"!=r.contentEditable)){if(o)return mH(o);if(r)return mH(r)}}function mH(e){return e.contentEditable="true",G$&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function fH(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function gH(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function bH(e,t,n,i){return e.someProp("createSelectionBetween",(i=>i(e,t,n)))||zt.between(t,n,i)}function vH(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 yH(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function xH(e,t,n){let i=e.state.selection;if(!(i instanceof zt)){if(i instanceof Rt&&i.node.isInline)return yH(e,new zt(t>0?i.$to:i.$from));{let n=vH(e.state,t);return!!n&&yH(e,n)}}if(!i.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=vH(e.state,t);return!!(n&&n instanceof Rt)&&yH(e,n)}if(!(Z$&&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)?yH(e,new Rt(t<0?e.state.doc.resolve(o.pos-r.nodeSize):o)):!!eH&&yH(e,new zt(e.state.doc.resolve(t<0?s:s+r.nodeSize))))}}function wH(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function kH(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function EH(e){let t=e.domSelection(),n=t.focusNode,i=t.focusOffset;if(!n)return;let o,r,s=!1;for(W$&&1==n.nodeType&&i<wH(n)&&kH(n.childNodes[i])&&(s=!0);;)if(i>0){if(1!=n.nodeType)break;{let e=n.childNodes[i-1];if(kH(e))o=n,r=--i;else{if(3!=e.nodeType)break;n=e,i=n.nodeValue.length}}}else{if(MH(n))break;{let t=n.previousSibling;for(;t&&kH(t);)o=n.parentNode,r=nH(t),t=t.previousSibling;if(t)n=t,i=wH(n);else{if(n=n.parentNode,n==e.dom)break;i=0}}}s?CH(e,t,n,i):o&&CH(e,t,o,r)}function _H(e){let t=e.domSelection(),n=t.focusNode,i=t.focusOffset;if(!n)return;let o,r,s=wH(n);for(;;)if(i<s){if(1!=n.nodeType)break;if(!kH(n.childNodes[i]))break;o=n,r=++i}else{if(MH(n))break;{let t=n.nextSibling;for(;t&&kH(t);)o=t.parentNode,r=nH(t)+1,t=t.nextSibling;if(t)n=t,i=0,s=wH(n);else{if(n=n.parentNode,n==e.dom)break;i=s=0}}}o&&CH(e,t,o,r)}function MH(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function CH(e,t,n,i){if(aH(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&&uH(e)}),50)}function DH(e,t,n){let i=e.state.selection;if(i instanceof zt&&!i.empty||n.indexOf("s")>-1)return!1;if(Z$&&n.indexOf("m")>-1)return!1;let{$from:o,$to:r}=i;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=vH(e.state,t);if(n&&n instanceof Rt)return yH(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&&yH(e,s)}return!1}function OH(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 TH(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function NH(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||Z$&&72==n&&"c"==i?OH(e,-1)||EH(e):46==n||Z$&&68==n&&"c"==i?OH(e,1)||_H(e):13==n||27==n||(37==n||Z$&&66==n&&"c"==i?xH(e,-1,i)||EH(e):39==n||Z$&&70==n&&"c"==i?xH(e,1,i)||_H(e):38==n||Z$&&80==n&&"c"==i?DH(e,-1,i)||EH(e):40==n||Z$&&78==n&&"c"==i?function(e){if(!G$||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;TH(e,n,"true"),setTimeout((()=>TH(e,n,"false")),20)}return!1}(e)||DH(e,1,i)||_H(e):i==(Z$?"m":"c")&&(66==n||73==n||89==n||90==n))}function SH(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=UH(),l=a.createElement("div");l.appendChild(s.serializeFragment(i,{document:a}));let c,p=l.firstChild,u=0;for(;p&&1==p.nodeType&&(c=PH[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 AH(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=UH().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&PH[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),eH&&function(e){let t=e.querySelectorAll(Y$?"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||jH.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)}(FH(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&&zH(n,i,e,r[r.length-1],0))r[r.length-1]=t;else{r.length&&(r[r.length-1]=LH(r[r.length-1],i.length));let t=IH(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=FH(s,e,t)}return e.someProp("transformPasted",(e=>{s=e(s)})),s}const jH=/^(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 IH(e,t,n=0){for(let i=t.length-1;i>=n;i--)e=t[i].create(null,z.from(e));return e}function zH(e,t,n,i,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let r=zH(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(IH(n,e,o+1))))}}function LH(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,LH(e.lastChild,t-1)),i=e.contentMatchAt(e.childCount).fillBefore(z.empty,!0);return e.copy(n.append(i))}function RH(e,t,n,i,o,r){let s=t<0?e.firstChild:e.lastChild,a=s.content;return o<i-1&&(a=RH(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 FH(e,t,n){return t<e.openStart&&(e=new U(RH(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new U(RH(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const PH={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 BH=null;function UH(){return BH||(BH=document.implementation.createHTMLDocument("title"))}const $H={},HH={};function VH(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function qH(e){return{left:e.clientX,top:e.clientY}}function WH(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 KH(e,t,n){e.focused||e.focus();let i=e.state.tr.setSelection(t);"pointer"==n&&i.setMeta("pointer",!0),e.dispatch(i)}function YH(e,t,n,i,o){return WH(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&&(KH(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))&&(KH(e,new Rt(n),"pointer"),!0)}(e,n))}function QH(e,t,n,i){return WH(e,"handleDoubleClickOn",t,n,i)||e.someProp("handleDoubleClick",(n=>n(e,t,i)))}function GH(e,t,n,i){return WH(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&&(KH(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)KH(e,zt.create(i,r+1,r+1+n.content.size),"pointer");else{if(!Rt.isSelectable(n))continue;KH(e,Rt.create(i,r),"pointer")}return!0}}(e,n,i)}function JH(e){return oV(e)}HH.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!eV(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!X$||!Y$||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!J$||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||NH(e,n)?n.preventDefault():VH(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,lH(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},HH.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},HH.keypress=(e,t)=>{let n=t;if(eV(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Z$&&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 ZH=Z$?"metaKey":"ctrlKey";$H.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let i=JH(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[ZH]&&("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(qH(n));s&&("singleClick"==r?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new XH(e,s,n,!!i)):("doubleClick"==r?QH:GH)(e,s.pos,s.inside,n)?n.preventDefault():VH(e,"pointer"))};class XH{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[ZH],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||!W$||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)),VH(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((()=>uH(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(qH(e))),this.updateAllowDefault(e),this.allowDefault||!t?VH(this.view,"pointer"):YH(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||G$&&this.mightDrag&&!this.mightDrag.node.isAtom||Y$&&!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)?(KH(this.view,St.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):VH(this.view,"pointer")}move(e){this.updateAllowDefault(e),VH(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 eV(e,t){return!!e.composing||!!(G$&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}$H.touchstart=e=>{e.input.lastTouch=Date.now(),JH(e),VH(e,"pointer")},$H.touchmove=e=>{e.input.lastTouch=Date.now(),VH(e,"pointer")},$H.contextmenu=e=>JH(e);const tV=X$?5e3:-1;function nV(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>oV(e)),t))}function iV(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 oV(e,t=!1){if(!(X$&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),iV(e),t||e.docView&&e.docView.dirty){let t=cH(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}HH.compositionstart=HH.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(),oV(e,!0),e.markCursor=null;else if(oV(e),W$&&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}nV(e,tV)},HH.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,nV(e,20))};const rV=V$&&q$<15||J$&&tH<604;function sV(e,t,n,i){let o=AH(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}$H.copy=HH.cut=(e,t)=>{let n=t,i=e.state.selection,o="cut"==n.type;if(i.empty)return;let r=rV?null:n.clipboardData,s=i.content(),{dom:a,text:l}=SH(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"))},HH.paste=(e,t)=>{let n=t;if(e.composing&&!X$)return;let i=rV?null:n.clipboardData;i&&sV(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?sV(e,i.value,null,t):sV(e,i.textContent,i.innerHTML,t)}),50)}(e,n)};class aV{constructor(e,t){this.slice=e,this.move=t}}const lV=Z$?"altKey":"ctrlKey";$H.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(qH(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}=SH(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(rV?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",rV||n.dataTransfer.setData("text/plain",l),e.dragging=new aV(s,!n[lV])},$H.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},HH.dragover=HH.dragenter=(e,t)=>t.preventDefault(),HH.drop=(e,t)=>{let n=t,i=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(qH(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=AH(e,n.dataTransfer.getData(rV?"Text":"text/plain"),rV?null:n.dataTransfer.getData("text/html"),!1,r);let a=!(!i||n[lV]);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(bH(e,h,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},$H.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())&&uH(e)}),20))},$H.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)},$H.beforeinput=(e,t)=>{if(Y$&&X$&&"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,lH(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 HH)$H[e]=HH[e];function cV(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 pV{constructor(e,t){this.toDOM=e,this.spec=t||fV,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 hV(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof pV&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&cV(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class uV{constructor(e,t){this.attrs=e,this.spec=t||fV}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 hV(o,r,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof uV&&cV(this.attrs,e.attrs)&&cV(this.spec,e.spec)}static is(e){return e.type instanceof uV}destroy(){}}class dV{constructor(e,t){this.attrs=e,this.spec=t||fV}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 hV(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 dV&&cV(this.attrs,e.attrs)&&cV(this.spec,e.spec)}destroy(){}}class hV{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new hV(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 hV(e,e,new pV(t,n))}static inline(e,t,n,i){return new hV(e,t,new uV(n,i))}static node(e,t,n,i){return new hV(e,t,new dV(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof uV}}const mV=[],fV={};class gV{constructor(e,t){this.local=e.length?e:mV,this.children=t.length?t:mV}static create(e,t){return t.length?kV(t,e,0,fV):bV}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==bV||0==e.maps.length?this:this.mapInner(e,t,0,0,n||fV)}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!=bV?(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=kV(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 gV(t.sort(EV),a)}(this.children,r||[],e,t,n,i,o):r?new gV(r.sort(EV),mV):bV}add(e,t){return t.length?this==bV?gV.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=xV(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,kV(s,e,a+1,fV)),o+=3}}));let r=yV(o?wV(t):t,-n);for(let t=0;t<r.length;t++)r[t].type.valid(e,r[t])||r.splice(t--,1);return new gV(r.length?this.local.concat(r).sort(EV):this.local,i||this.children)}remove(e){return 0==e.length||this==bV?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!=bV?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 gV(i,n):bV}forChild(e,t){if(this==bV)return this;if(t.isLeaf)return gV.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 uV){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 gV(i.sort(EV),mV);return n?new vV([e,n]):e}return n||bV}eq(e){if(this==e)return!0;if(!(e instanceof gV)||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 _V(this.localsInner(e))}localsInner(e){if(this==bV)return mV;if(e.inlineContent||!this.local.some(uV.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof uV||t.push(this.local[e]);return t}}gV.empty=new gV([],[]),gV.removeOverlap=_V;const bV=gV.empty;class vV{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,fV)));return vV.from(n)}forChild(e,t){if(t.isLeaf)return gV.empty;let n=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=bV&&(o instanceof vV?n=n.concat(o.members):n.push(o))}return vV.from(n)}eq(e){if(!(e instanceof vV)||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?_V(n?t:t.sort(EV)):mV}static from(e){switch(e.length){case 0:return bV;case 1:return e[0];default:return new vV(e)}}}function yV(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 hV(o.from+t,o.to+t,o.type))}return n}function xV(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 wV(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function kV(e,t,n,i){let o=[],r=!1;t.forEach(((t,s)=>{let a=xV(e,t,s+n);if(a){r=!0;let e=kV(a,t,n+s+1,i);e!=bV&&o.push(s,s+t.nodeSize,e)}}));let s=yV(r?wV(e):e,-n).sort(EV);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 gV(s,o):bV}function EV(e,t){return e.from-t.from||e.to-t.to}function _V(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),MV(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),MV(t,o+1,r.copy(i.to,r.to)))}}return t}function MV(e,t,n){for(;t<e.length&&EV(n,e[t])>0;)t++;e.splice(t,0,n)}const CV=new nn("suggestion");function DV({pluginKey:e=CV,editor:t,char:n="@",allowSpaces:i=!1,allowedPrefixes:o=null,startOfLine:r=!1,decorationTag:s="span",decorationClass:a="suggestion",command:l=(()=>null),items:c=(()=>[]),render:p=(()=>({})),allow:u=(()=>!0)}){let d;const h=null==p?void 0:p(),m=new Xt({key:e,view(){return{update:async(e,n)=>{var i,o,r,s,a,p,u;const m=null===(i=this.key)||void 0===i?void 0:i.getState(n),f=null===(o=this.key)||void 0===o?void 0:o.getState(e.state),g=m.active&&f.active&&m.range.from!==f.range.from,b=!m.active&&f.active,v=m.active&&!f.active,y=b||g,x=!b&&!v&&m.query!==f.query&&!g,w=v||g;if(!y&&!x&&!w)return;const k=w&&!y?m:f,E=e.dom.querySelector(`[data-decoration-id="${k.decorationId}"]`);d={editor:t,range:k.range,query:k.query,text:k.text,items:[],command:e=>{l({editor:t,range:k.range,props:e})},decorationNode:E,clientRect:E?()=>{var n;const{decorationId:i}=null===(n=this.key)||void 0===n?void 0:n.getState(t.state),o=e.dom.querySelector(`[data-decoration-id="${i}"]`);return(null==o?void 0:o.getBoundingClientRect())||null}:null},y&&(null===(r=null==h?void 0:h.onBeforeStart)||void 0===r||r.call(h,d)),x&&(null===(s=null==h?void 0:h.onBeforeUpdate)||void 0===s||s.call(h,d)),(x||y)&&(d.items=await c({editor:t,query:k.query})),w&&(null===(a=null==h?void 0:h.onExit)||void 0===a||a.call(h,d)),x&&(null===(p=null==h?void 0:h.onUpdate)||void 0===p||p.call(h,d)),y&&(null===(u=null==h?void 0:h.onStart)||void 0===u||u.call(h,d))},destroy:()=>{var e;d&&(null===(e=null==h?void 0:h.onExit)||void 0===e||e.call(h,d))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(e,s,a,l){const{isEditable:c}=t,{composing:p}=t.view,{selection:d}=e,{empty:h,from:m}=d,f={...s};if(f.composing=p,c&&(h||t.view.composing)){!(m<s.range.from||m>s.range.to)||p||s.composing||(f.active=!1);const e=function(e){var t;const{char:n,allowSpaces:i,allowedPrefixes:o,startOfLine:r,$position:s}=e,a=ia(n),l=new RegExp(`\\s${a}$`),c=r?"^":"",p=i?new RegExp(`${c}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${c}(?:^)?${a}[^\\s${a}]*`,"gm"),u=(null===(t=s.nodeBefore)||void 0===t?void 0:t.isText)&&s.nodeBefore.text;if(!u)return null;const d=s.pos-u.length,h=Array.from(u.matchAll(p)).pop();if(!h||void 0===h.input||void 0===h.index)return null;const m=h.input.slice(Math.max(0,h.index-1),h.index),f=new RegExp(`^[${null==o?void 0:o.join("")}\0]?$`).test(m);if(null!==o&&!f)return null;const g=d+h.index;let b=g+h[0].length;return i&&l.test(u.slice(b-1,b+1))&&(h[0]+=" ",b+=1),g<s.pos&&b>=s.pos?{range:{from:g,to:b},query:h[0].slice(n.length),text:h[0]}:null}({char:n,allowSpaces:i,allowedPrefixes:o,startOfLine:r,$position:d.$from}),a=`id_${Math.floor(4294967295*Math.random())}`;e&&u({editor:t,state:l,range:e.range})?(f.active=!0,f.decorationId=s.decorationId?s.decorationId:a,f.range=e.range,f.query=e.query,f.text=e.text):f.active=!1}else f.active=!1;return f.active||(f.decorationId=null,f.range={from:0,to:0},f.query=null,f.text=null),f}},props:{handleKeyDown(e,t){var n;const{active:i,range:o}=m.getState(e.state);return i&&(null===(n=null==h?void 0:h.onKeyDown)||void 0===n?void 0:n.call(h,{view:e,event:t,range:o}))||!1},decorations(e){const{active:t,range:n,decorationId:i}=m.getState(e);return t?gV.create(e.doc,[hV.inline(n.from,n.to,{nodeName:s,class:a,"data-decoration-id":i})]):null}}});return m}const OV=new nn("mention"),TV=ta.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var n;return`${e.suggestion.char}${null!==(n=t.attrs.label)&&void 0!==n?n:t.attrs.id}`},suggestion:{char:"@",pluginKey:OV,command:({editor:e,range:t,props:n})=>{var i,o;const r=e.view.state.selection.$to.nodeAfter;(null===(i=null==r?void 0:r.text)||void 0===i?void 0:i.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),null===(o=window.getSelection())||void 0===o||o.collapseToEnd()},allow:({state:e,range:t})=>{const n=e.doc.resolve(t.from),i=e.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(i)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Vr({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})]},renderText({node:e}){return this.options.renderLabel({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command((({tr:e,state:t})=>{let n=!1;const{selection:i}=t,{empty:o,anchor:r}=i;return!!o&&(t.doc.nodesBetween(r-1,r,((t,i)=>{if(t.type.name===this.name)return n=!0,e.insertText(this.options.suggestion.char||"",i,i+t.nodeSize),!1})),n)}))}},addProseMirrorPlugins(){return[DV({editor:this.editor,...this.options.suggestion})]}}),NV=e=>{let{wrapperRef:t,index:n}=e;if(!t.current||n>=t.current.children.length)return;const i=8,o=t.current,r=o.children[n],s=r.clientHeight+i;let a=o.scrollTop;r.offsetTop+s>a+o.clientHeight?a=r.offsetTop-o.clientHeight+s:a>r.offsetTop&&(a=r.offsetTop-i),t.current.scrollTop=a};class SV extends t.Component{constructor(e){super(e),Eb(this,"selectItem",(e=>{const{items:t,command:n}=this.props,i=t[e];i&&n({label:i.name,id:i.key})})),Eb(this,"upHandler",(()=>{const{items:e}=this.props;this.setState((t=>{const{selectedIndex:n}=t;return{selectedIndex:(n+e.length-1)%e.length}}))})),Eb(this,"downHandler",(()=>{const{items:e}=this.props;this.setState((t=>{const{selectedIndex:n}=t;return{selectedIndex:(n+1)%e.length}}))})),Eb(this,"enterHandler",(()=>{const{selectedIndex:e}=this.state;this.selectItem(e)})),Eb(this,"onKeyDown",(e=>{let{event:t}=e;const n={ArrowUp:this.upHandler,ArrowDown:this.downHandler,Enter:this.enterHandler};return!!Object.prototype.hasOwnProperty.call(n,t.key)&&(n[t.key](),!0)})),this.state={selectedIndex:0},this.mentionRef=t.createRef()}componentDidUpdate(e){const{items:t}=this.props;t!==e.items&&this.setState({selectedIndex:0}),NV({wrapperRef:this.mentionRef,index:this.state.selectedIndex})}render(){const{selectedIndex:e}=this.state,{items:n}=this.props;return 0===n.length?t.createElement("div",{className:"neeto-editor-mentions__wrapper"},t.createElement("p",{className:"neeto-editor-mentions__item"},"No Results")):t.createElement("div",{ref:this.mentionRef,className:"neeto-editor-mentions__wrapper","data-cy":"neeto-editor-mention-list"},n.map(((n,i)=>{let{key:o,name:r,imageUrl:s,showImage:a}=n;return t.createElement("button",{className:Bc("neeto-editor-mentions__item",{active:i===e}),key:o,onClick:()=>this.selectItem(i),type:"button","data-cy":`neeto-editor-mention-list-${r}`},a&&t.createElement(Zk,{user:{name:r,imageUrl:s}}),t.createElement("p",null,r))})))}}const AV={render:()=>{let e,t;return{onStart:n=>{e=new Sc(SV,{props:n,editor:n.editor}),t=mc("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var i;return"Escape"===n.event.key?(t[0].hide(),!0):null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(n)},onExit(){t[0].destroy(),e.destroy()}}}},jV=TV.extend({addCommands(){return{setMention:e=>{let{id:t,label:n}=e;return e=>{let{chain:i}=e;i().focus().insertContent([{type:this.name,attrs:{id:t,label:n}},{type:"text",text:" "}]).run()}}}}});var IV=e=>{let{suggestion:t={},...n}=e;return jV.configure({...n,suggestion:{...AV,...t}})},zV="[object Object]";var LV,RV,FV=Function.prototype,PV=Object.prototype,BV=FV.toString,UV=PV.hasOwnProperty,$V=BV.call(Object),HV=PV.toString,VV=(LV=Object.getPrototypeOf,RV=Object,function(e){return LV(RV(e))});var qV=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||HV.call(e)!=zV||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=VV(e);if(null===t)return!0;var n=UV.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&BV.call(n)==$V};const WV=e=>{const t=typeof e;return"string"===t||"funtion"===t?e:qV(e)?t=>{let{node:n}=t;const{name:i}=n.type;return e[i]}:""};var KV=cs.create({name:"placeholder",addOptions:()=>({excludeNodeTypes:["variable","codeBlock"],emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!1}),addProseMirrorPlugins(){return[new Xt({props:{decorations:e=>{let{doc:t,selection:n}=e;const i=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=n,r=[];return i?(t.descendants(((e,t)=>{const n=o>=t&&o<=t+e.nodeSize,i=!e.isLeaf&&!e.childCount,s=this.options.excludeNodeTypes.includes(e.type.name);if((n||!this.options.showOnlyCurrent)&&!s&&i){const n=[this.options.emptyNodeClass];this.editor.isEmpty&&n.push(this.options.emptyEditorClass);const i=gu.node(t,t+e.nodeSize,{class:n.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t}):this.options.placeholder});r.push(i)}return this.options.includeChildren})),yu.create(t,r)):null}}})]}});class YV extends t.Component{constructor(e){super(e),Eb(this,"keydownHandler",(e=>{const t={Enter:this.enterHandler,ArrowUp:this.upHandler,ArrowDown:this.downHandler,ArrowLeft:this.leftArrowHandler,ArrowRight:this.rightArrowHandler};e.key in t&&t[e.key](e)})),Eb(this,"selectItem",(e=>{const{items:t,editor:n,range:i}=this.props,o=t[e],r=o&&o.command,s=Nd(o.items);r&&s&&o.command({editor:n,range:i})})),Eb(this,"upHandler",(()=>{const{items:e}=this.props,{selectedIndex:t}=this.state;this.setState({selectedIndex:(t+e.length-1)%e.length})})),Eb(this,"downHandler",(()=>{const{items:e}=this.props,{selectedIndex:t}=this.state;this.setState({selectedIndex:(t+1)%e.length})})),Eb(this,"enterHandler",(()=>{const{selectedIndex:e}=this.state;this.selectItem(e)})),Eb(this,"leftArrowHandler",(()=>{const{menuIndex:e,setActiveMenuIndex:t}=this.props;e>0&&t(e-1)})),Eb(this,"rightArrowHandler",(()=>{const{menuIndex:e,setActiveMenuIndex:t,items:n}=this.props,{selectedIndex:i}=this.state,o=n[i];o&&!Nd(o.items)&&t(e+1)})),this.state={selectedIndex:0},this.menuRef=t.createRef()}componentDidMount(){const{menuIndex:e,activeMenuIndex:t}=this.props;e===t&&document.addEventListener("keydown",this.keydownHandler)}componentWillUnmount(){document.removeEventListener("keydown",this.keydownHandler)}componentDidUpdate(e){const{items:t,menuIndex:n,activeMenuIndex:i}=this.props,o=n===i;t!==e.items&&this.setState({selectedIndex:0}),NV({wrapperRef:this.menuRef,index:this.state.selectedIndex}),o?document.addEventListener("keydown",this.keydownHandler):document.removeEventListener("keydown",this.keydownHandler)}render(){const{items:e,menuIndex:n,activeMenuIndex:i}=this.props,{selectedIndex:o}=this.state,r=n===i;return t.createElement("div",{ref:this.menuRef,className:"neeto-editor-slash-commands__wrapper"},e.map(((e,i)=>{const s=Nd(e.items),a=t.createElement(QV,{key:e.title,item:e,index:i,selectedIndex:r?o:-1,selectItem:()=>s&&this.selectItem(i),onHover:()=>this.setState({selectedIndex:i})});return s?a:t.createElement($g,{key:e.title,interactive:!0,placement:"right",content:t.createElement(YV,S({},this.props,{items:e.items,menuIndex:n+1})),onCreate:e=>{let{popper:t}=e;return t.style.width="max-content"},visible:o===i,onShow:()=>{this.isSubmenuOpened=!0},onHide:()=>{this.isSubmenuOpened=!1}},a)})))}}const QV=u(((e,n)=>{let{item:i,selectedIndex:o,index:r,selectItem:s,onHover:a}=e;const{Icon:l}=i;return t.createElement("div",{className:Bc("neeto-editor-slash-commands__item",{active:r===o}),onClick:s,ref:n,"data-cy":`neeto-editor-command-list-item-${r}`,onMouseEnter:a},l&&t.createElement(l,{size:20}),t.createElement("div",{className:"neeto-editor-slash-commands__item-content"},t.createElement("h5",null,i.title),t.createElement("p",null,i.description)))}));class GV extends t.Component{constructor(){super(...arguments),Eb(this,"state",{activeMenuIndex:0}),Eb(this,"onKeyDown",(e=>{let{event:t}=e;return["Enter","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)})),Eb(this,"setActiveMenuIndex",(e=>this.setState({activeMenuIndex:e})))}render(){return t.createElement(YV,S({},this.props,{menuIndex:0,activeMenuIndex:this.state.activeMenuIndex,setActiveMenuIndex:this.setActiveMenuIndex}))}}const JV={PARAGRAPH:{optionName:Pd.PARAGRAPH,title:"Paragraph",description:"Add a plain text block.",Icon:df,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("paragraph").run()}},H1:{optionName:Pd.H1,title:"H1",description:"Add a big heading.",Icon:_f,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:1}).run()}},H2:{optionName:Pd.H2,title:"H2",description:"Add a sub-heading.",Icon:Cf,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:2}).run()}},H3:{optionName:Pd.H3,title:"H3",description:"Add a sub-heading of level 3.",Icon:Nf,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:3}).run()}},H4:{optionName:Pd.H4,title:"H4",description:"Add a sub-heading of level 4.",Icon:Nf,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:4}).run()}},H5:{optionName:Pd.H5,title:"H5",description:"Add a sub-heading of level 5.",Icon:Nf,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:5}).run()}},H6:{optionName:Pd.H6,title:"H6",description:"Add a sub-heading of level 6.",Icon:Nf,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:6}).run()}},LIST_ORDERED:{optionName:Pd.LIST_ORDERED,title:"Numbered list",description:"Add a list with numbering.",Icon:sf,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).toggleOrderedList().run()}},LIST_BULLETS:{optionName:Pd.LIST_BULLETS,title:"Bulleted list",description:"Add a list with bullets.",Icon:of,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).toggleBulletList().run()}},BLOCKQUOTE:{optionName:Pd.BLOCKQUOTE,title:"Blockquote",description:"Add a quote.",Icon:Sm,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).toggleBlockquote().run()}},IMAGE:{optionName:Pd.IMAGE_UPLOAD,title:"Image",description:"Add an image.",Icon:Qm,command:e=>{let{editor:t,range:n}=e;return t.chain().focus().deleteRange(n).run()}},CODE:{optionName:Pd.CODE_BLOCK,title:"Code block",description:"Add a code block with syntax highlighting.",Icon:Pm,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).toggleCodeBlock().run()}},EMOJI:{optionName:Pd.EMOJI,title:"Emoji",description:"Add an emoji.",Icon:vf,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).insertContent("::").run()}},DIVIDER:{optionName:Pd.DIVIDER,title:"Divider",description:"Add an horizontal line to separate sections.",Icon:lf,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setHorizontalRule().run()}},VIDEO:{optionName:Pd.VIDEO_EMBED,title:"Embed Youtube/Loom/Vimeo",description:"Embed a video from major services.",Icon:Lf,command:e=>{let{editor:t,range:n}=e;const i=prompt("Please enter Youtube/Loom/Vimeo embed URL."),o=(e=>{const t=e.match(nb);return t&&`https://www.youtube.com/embed/${t[5]}`})(i)||(e=>{const t=e.match(ob);return t&&`https://www.loom.com/embed/${t[4]}?t=${t[5]||""}`})(i)||(e=>{const t=e.match(ib);return t&&`https://player.vimeo.com/video/${t[4]}?h=${t[5]}`})(i);o?t.chain().focus().deleteRange(n).setExternalVideo({src:o}).run():t.chain().focus().deleteRange(n).insertContent("#invalid").run()}},PASTE_UNFORMATTED:{optionName:Pd.PASTE_UNFORMATTED,title:"Paste Unformatted",description:"Paste by removing all styles.",Icon:pf,command:e=>{let{editor:t,range:n}=e;return t.chain().focus().deleteRange(n).pasteUnformatted().run()}},NO_RESULT:{title:"No results",command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).run()}}},ZV=new nn("commands");var XV=e=>{let{setImageUploadVisible:t,addonCommands:n,options:i}=e,o=[JV.PARAGRAPH,JV.H1,JV.H2,JV.H3,JV.H4,JV.H5,JV.H6,JV.LIST_ORDERED,JV.LIST_BULLETS,JV.BLOCKQUOTE,{...JV.IMAGE,command:function(){t(!0),JV.IMAGE.command(...arguments)}},JV.CODE,JV.EMOJI,JV.DIVIDER,JV.VIDEO,JV.PASTE_UNFORMATTED];return Nd(i)||(o=o.filter((e=>{let{optionName:t}=e;return i.includes(t)}))),Nd(n)||(o=o.concat(n)),cs.create({name:"slash-commands",addOptions:()=>({HTMLAttributes:{class:"commands"},suggestion:{char:"/",startOfLine:!1,pluginKey:ZV,command:e=>{let{editor:t,range:n,props:i}=e;i.command({editor:t,range:n})},items:e=>{let{query:t}=e;const n=o.filter((e=>{let{title:n}=e;return n.toLowerCase().includes(t.toLowerCase())}));return Nd(n)?[JV.NO_RESULT]:n},render:()=>{let e,t;return{onStart:n=>{e=new Sc(GV,{props:n,editor:n.editor}),t=mc("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1,zIndex:99999,role:"dropdown",theme:"neeto-editor-slash-menu"}),cb()},onUpdate(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit(){t&&t[0].destroy(),e&&e.destroy(),pb()}}}}}),addProseMirrorPlugins(){return[e$({editor:this.editor,...this.options.suggestion})]}})},eq=CF.extend({name:"title",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML:()=>[{tag:`h1`}],renderHTML(e){let{_node:t,HTMLAttributes:n}=e;return[`h1`,Vr(this.options.HTMLAttributes,n),0]}});const tq=e=>{let{items:n,command:i}=e;return t.createElement("div",{className:"neeto-editor-variables-suggestion"},t.createElement(aE,{variables:n,onClickVariable:e=>{const{category_key:t,key:n}=e,o=t?`${t}.${n}`:n;i({label:o,id:o})}}))},nq=new nn("variables"),iq=ta.create({name:"variable",addOptions:()=>({HTMLAttributes:{class:"neeto-editor-variable"},charOpen:"{{",charClose:"}}",renderLabel(e){let{options:t,node:n}=e;return`${t.charOpen}${n.attrs.label||n.attrs.id}${t.charClose}`},suggestion:{}}),group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML:()=>[{tag:"span[data-variable]"}],renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["span",Vr({"data-variable":""},this.options.HTMLAttributes,n),this.options.renderLabel({options:this.options,node:t})]},renderText(e){let{node:t}=e;return this.options.renderLabel({options:this.options,node:t})},addCommands(){return{setVariable:e=>t=>{let{chain:n}=t;n().focus().insertContent([{type:this.name,attrs:e},{type:"text",text:" "}]).run()}}},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command((e=>{let{tr:t,state:n}=e,i=!1;const{selection:o}=n,{empty:r,anchor:s}=o;return!!r&&(n.doc.nodesBetween(s-1,s,((e,n)=>{if(e.type.name===this.name)return i=!0,t.insertText("",n,n+e.nodeSize),!1})),i)}))}},addProseMirrorPlugins(){return[e$({editor:this.editor,...this.options.suggestion})]}}),oq={char:"{{",startOfLine:!1,pluginKey:nq,command:e=>{let{editor:t,range:n,props:i}=e;t.chain().focus().deleteRange(n).setVariable(i).run()},items:()=>[],render:()=>{let e,t;return{onStart:n=>{e=new Sc(tq,{props:n,editor:n.editor}),t=mc("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onExit(){t[0].destroy(),e.destroy()}}}};var rq=e=>{let{suggestion:t={}}=e;return iq.configure({suggestion:{...oq,...t}})};const sq=(e,t)=>{const n=[];e.split(/\n/).forEach((e=>{const i={type:"paragraph"};e.length>0&&(i.content=[{type:"text",text:e}]);const o=re.fromJSON(t.doc.type.schema,i);n.push(o)}));const i=z.fromArray(n);return U.maxOpen(i)},aq=(e,n)=>{let{forceTitle:i=!1,titleError:s=!1,hideSlashCommands:a=!1,defaults:l=Hd,addons:c=[],addonCommands:p,className:u,uploadEndpoint:d=Ud,uploadConfig:h={},initialValue:m="",onChange:f=(()=>{}),onFocus:g=(()=>{}),onBlur:b=(()=>{}),menuType:v="fixed",variables:y,mentions:x,showImageInMention:w=!1,placeholder:k=(i?{title:"Untitled"}:null),extensions:E,contentClassName:_,characterLimit:M,editorSecrets:C,rows:D=6,autoFocus:O=!1,onSubmit:T,heightStrategy:N="fixed",characterCountStrategy:A="hidden",keyboardShortcuts:j=[],error:I=null,...z}=e;const[L,R]=o(!1),F="fixed"===v,P="bubble"===v,B=!a,U=(e=>{if(e){if("string"==typeof e&&e.length)return!0;if("object"==typeof e&&Object.keys(e).length)return!0;if("function"==typeof e)return!0}return!1})(k),$=!U&&B,H=c.includes("image-upload-unsplash"),V="hidden"!==A,q=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],{includeImageUpload:n}=arguments.length>2?arguments[2]:void 0;const i=t.map((e=>e.toLowerCase()));return n&&i.push(Pd.IMAGE_UPLOAD),[].concat(e,i)}(l,c,{includeImageUpload:H}),W=(e=>{let{forceTitle:t,placeholder:n,extensions:i,mentions:o,variables:r,isSlashCommandsActive:s,showImageInMention:a,setImageUploadVisible:l,options:c,addonCommands:p,characterLimit:u,onSubmit:d,keyboardShortcuts:h,uploadEndpoint:m}=e,f=[eq,JU.extend({content:t?"title block*":"block+"}),cP.configure({document:!1,codeBlock:!1,code:!1}),II,cL,FI,QU,I$({uploadEndpoint:m}),z$,ZU,lL,zI.configure({mode:"shallowest"}),KV.configure({placeholder:WV(n)}),a$,n$,GU,SI.configure({limit:u}),R$({handleSubmit:d,shortcuts:h})];return s&&f.push(XV({setImageUploadVisible:l,options:c,addonCommands:p})),Nd(o)||f.push(IV({suggestion:{items:rE(o,a)}})),Nd(r)||f.push(rq({suggestion:{items:()=>r}})),Nd(i)||(f=f.concat(i)),f})({contentClassName:_,forceTitle:i,placeholder:k,extensions:E,mentions:x,variables:y,isSlashCommandsActive:B,showImageInMention:w,setImageUploadVisible:R,options:q,addonCommands:p,characterLimit:M,keyboardShortcuts:j,onSubmit:T,uploadEndpoint:d}),K=Bc("neeto-editor",{"slash-active":$,"fixed-menu-active border":F,"bubble-menu-active":P,"force-title":i,"force-title--error":s,"placeholder-active":U,[u]:u}),Y=(e=>{let{heightStrategy:t,rows:n}=e;const i={},o=n*Rd+2*(zd+Ld);return"flexible"===t?i["min-height"]=`${o}px`:i.height=`${o}px`,i})({heightStrategy:N,rows:D}),Q=Ic({extensions:W,content:m,injectCSS:!1,autofocus:O&&"end",editorProps:{attributes:{class:K,style:Td(Y)},clipboardTextParser:sq},parseOptions:{preserveWhitespace:!0},onCreate:e=>{let{editor:t}=e;return!O&&(e=>{const{state:t,view:n}=e,i=St.atEnd(t.doc),o=t.tr;o.setSelection(i),n.dispatch(o)})(t)},onUpdate:e=>{let{editor:t}=e;return setTimeout((()=>f(t.getHTML())),0)},onFocus:g,onBlur:b});return t.useImperativeHandle(n,(()=>({editor:Q}))),r((()=>{![process.env.RAILS_ENV,"production"].includes("production")&&Nd(m)&&console.warn(`[neeto-editor]: Empty value of "initialValue" in needtoEditor is expected to be "<p></p>" instead of "${m}".`)}),[m]),t.createElement(jd,{error:I,isFixedMenuActive:F},F&&t.createElement(pE,{editor:Q,variables:y,setImageUploadVisible:R,options:q,mentions:x,showImageInMention:w}),P&&t.createElement(ab,{editor:Q,options:q}),t.createElement(NI,{isVisible:L,setIsVisible:R,editor:Q,imageUploadUrl:d,uploadConfig:h,isUnsplashImageUploadActive:H,unsplashApiKey:null==C?void 0:C.unsplash}),t.createElement(Cc,S({editor:Q},z)),V&&t.createElement(lb,{count:null==Q?void 0:Q.storage.characterCount.characters(),limit:M,strategy:A}))};var lq=t.forwardRef(aq);
|
|
61
|
-
/*! @license DOMPurify 2.4.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.0/LICENSE */function cq(e){return cq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cq(e)}function pq(e,t){return pq=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},pq(e,t)}function uq(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function dq(e,t,n){return dq=uq()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&pq(o,n.prototype),o},dq.apply(null,arguments)}function hq(e){return function(e){if(Array.isArray(e))return mq(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return mq(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mq(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mq(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var fq=Object.hasOwnProperty,gq=Object.setPrototypeOf,bq=Object.isFrozen,vq=Object.getPrototypeOf,yq=Object.getOwnPropertyDescriptor,xq=Object.freeze,wq=Object.seal,kq=Object.create,Eq="undefined"!=typeof Reflect&&Reflect,_q=Eq.apply,Mq=Eq.construct;_q||(_q=function(e,t,n){return e.apply(t,n)}),xq||(xq=function(e){return e}),wq||(wq=function(e){return e}),Mq||(Mq=function(e,t){return dq(e,hq(t))});var Cq=Lq(Array.prototype.forEach),Dq=Lq(Array.prototype.pop),Oq=Lq(Array.prototype.push),Tq=Lq(String.prototype.toLowerCase),Nq=Lq(String.prototype.match),Sq=Lq(String.prototype.replace),Aq=Lq(String.prototype.indexOf),jq=Lq(String.prototype.trim),Iq=Lq(RegExp.prototype.test),zq=function(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return Mq(e,n)}}(TypeError);function Lq(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return _q(e,t,i)}}function Rq(e,t,n){n=n||Tq,gq&&gq(e,null);for(var i=t.length;i--;){var o=t[i];if("string"==typeof o){var r=n(o);r!==o&&(bq(t)||(t[i]=r),o=r)}e[o]=!0}return e}function Fq(e){var t,n=kq(null);for(t in e)_q(fq,e,[t])&&(n[t]=e[t]);return n}function Pq(e,t){for(;null!==e;){var n=yq(e,t);if(n){if(n.get)return Lq(n.get);if("function"==typeof n.value)return Lq(n.value)}e=vq(e)}return function(e){return console.warn("fallback value for",e),null}}var Bq=xq(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Uq=xq(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),$q=xq(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Hq=xq(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Vq=xq(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),qq=xq(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Wq=xq(["#text"]),Kq=xq(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Yq=xq(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Qq=xq(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Gq=xq(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Jq=wq(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Zq=wq(/<%[\w\W]*|[\w\W]*%>/gm),Xq=wq(/^data-[\-\w.\u00B7-\uFFFF]/),eW=wq(/^aria-[\-\w]+$/),tW=wq(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),nW=wq(/^(?:\w+script|data):/i),iW=wq(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),oW=wq(/^html$/i),rW=function(){return"undefined"==typeof window?null:window},sW=function(e,t){if("object"!==cq(e)||"function"!=typeof e.createPolicy)return null;var n=null,i="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(i)&&(n=t.currentScript.getAttribute(i));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};var aW=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rW(),n=function(t){return e(t)};if(n.version="2.4.0",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var i=t.document,o=t.document,r=t.DocumentFragment,s=t.HTMLTemplateElement,a=t.Node,l=t.Element,c=t.NodeFilter,p=t.NamedNodeMap,u=void 0===p?t.NamedNodeMap||t.MozNamedAttrMap:p,d=t.HTMLFormElement,h=t.DOMParser,m=t.trustedTypes,f=l.prototype,g=Pq(f,"cloneNode"),b=Pq(f,"nextSibling"),v=Pq(f,"childNodes"),y=Pq(f,"parentNode");if("function"==typeof s){var x=o.createElement("template");x.content&&x.content.ownerDocument&&(o=x.content.ownerDocument)}var w=sW(m,i),k=w?w.createHTML(""):"",E=o,_=E.implementation,M=E.createNodeIterator,C=E.createDocumentFragment,D=E.getElementsByTagName,O=i.importNode,T={};try{T=Fq(o).documentMode?o.documentMode:{}}catch(e){}var N={};n.isSupported="function"==typeof y&&_&&void 0!==_.createHTMLDocument&&9!==T;var S,A,j=Jq,I=Zq,z=Xq,L=eW,R=nW,F=iW,P=tW,B=null,U=Rq({},[].concat(hq(Bq),hq(Uq),hq($q),hq(Vq),hq(Wq))),$=null,H=Rq({},[].concat(hq(Kq),hq(Yq),hq(Qq),hq(Gq))),V=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),q=null,W=null,K=!0,Y=!0,Q=!1,G=!1,J=!1,Z=!1,X=!1,ee=!1,te=!1,ne=!1,ie=!0,oe=!1,re="user-content-",se=!0,ae=!1,le={},ce=null,pe=Rq({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ue=null,de=Rq({},["audio","video","img","source","image","track"]),he=null,me=Rq({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",be="http://www.w3.org/1999/xhtml",ve=be,ye=!1,xe=["application/xhtml+xml","text/html"],we="text/html",ke=null,Ee=o.createElement("form"),_e=function(e){return e instanceof RegExp||e instanceof Function},Me=function(e){ke&&ke===e||(e&&"object"===cq(e)||(e={}),e=Fq(e),S=S=-1===xe.indexOf(e.PARSER_MEDIA_TYPE)?we:e.PARSER_MEDIA_TYPE,A="application/xhtml+xml"===S?function(e){return e}:Tq,B="ALLOWED_TAGS"in e?Rq({},e.ALLOWED_TAGS,A):U,$="ALLOWED_ATTR"in e?Rq({},e.ALLOWED_ATTR,A):H,he="ADD_URI_SAFE_ATTR"in e?Rq(Fq(me),e.ADD_URI_SAFE_ATTR,A):me,ue="ADD_DATA_URI_TAGS"in e?Rq(Fq(de),e.ADD_DATA_URI_TAGS,A):de,ce="FORBID_CONTENTS"in e?Rq({},e.FORBID_CONTENTS,A):pe,q="FORBID_TAGS"in e?Rq({},e.FORBID_TAGS,A):{},W="FORBID_ATTR"in e?Rq({},e.FORBID_ATTR,A):{},le="USE_PROFILES"in e&&e.USE_PROFILES,K=!1!==e.ALLOW_ARIA_ATTR,Y=!1!==e.ALLOW_DATA_ATTR,Q=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=e.SAFE_FOR_TEMPLATES||!1,J=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,X=e.FORCE_BODY||!1,ie=!1!==e.SANITIZE_DOM,oe=e.SANITIZE_NAMED_PROPS||!1,se=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,P=e.ALLOWED_URI_REGEXP||P,ve=e.NAMESPACE||be,e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(V.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(V.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(V.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),G&&(Y=!1),te&&(ee=!0),le&&(B=Rq({},hq(Wq)),$=[],!0===le.html&&(Rq(B,Bq),Rq($,Kq)),!0===le.svg&&(Rq(B,Uq),Rq($,Yq),Rq($,Gq)),!0===le.svgFilters&&(Rq(B,$q),Rq($,Yq),Rq($,Gq)),!0===le.mathMl&&(Rq(B,Vq),Rq($,Qq),Rq($,Gq))),e.ADD_TAGS&&(B===U&&(B=Fq(B)),Rq(B,e.ADD_TAGS,A)),e.ADD_ATTR&&($===H&&($=Fq($)),Rq($,e.ADD_ATTR,A)),e.ADD_URI_SAFE_ATTR&&Rq(he,e.ADD_URI_SAFE_ATTR,A),e.FORBID_CONTENTS&&(ce===pe&&(ce=Fq(ce)),Rq(ce,e.FORBID_CONTENTS,A)),se&&(B["#text"]=!0),J&&Rq(B,["html","head","body"]),B.table&&(Rq(B,["tbody"]),delete q.tbody),xq&&xq(e),ke=e)},Ce=Rq({},["mi","mo","mn","ms","mtext"]),De=Rq({},["foreignobject","desc","title","annotation-xml"]),Oe=Rq({},["title","style","font","a","script"]),Te=Rq({},Uq);Rq(Te,$q),Rq(Te,Hq);var Ne=Rq({},Vq);Rq(Ne,qq);var Se=function(e){var t=y(e);t&&t.tagName||(t={namespaceURI:be,tagName:"template"});var n=Tq(e.tagName),i=Tq(t.tagName);return e.namespaceURI===ge?t.namespaceURI===be?"svg"===n:t.namespaceURI===fe?"svg"===n&&("annotation-xml"===i||Ce[i]):Boolean(Te[n]):e.namespaceURI===fe?t.namespaceURI===be?"math"===n:t.namespaceURI===ge?"math"===n&&De[i]:Boolean(Ne[n]):e.namespaceURI===be&&(!(t.namespaceURI===ge&&!De[i])&&(!(t.namespaceURI===fe&&!Ce[i])&&(!Ne[n]&&(Oe[n]||!Te[n]))))},Ae=function(e){Oq(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=k}catch(t){e.remove()}}},je=function(e,t){try{Oq(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Oq(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!$[e])if(ee||te)try{Ae(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Ie=function(e){var t,n;if(X)e="<remove></remove>"+e;else{var i=Nq(e,/^[\r\n\t ]+/);n=i&&i[0]}"application/xhtml+xml"===S&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var r=w?w.createHTML(e):e;if(ve===be)try{t=(new h).parseFromString(r,S)}catch(e){}if(!t||!t.documentElement){t=_.createDocument(ve,"template",null);try{t.documentElement.innerHTML=ye?"":r}catch(e){}}var s=t.body||t.documentElement;return e&&n&&s.insertBefore(o.createTextNode(n),s.childNodes[0]||null),ve===be?D.call(t,J?"html":"body")[0]:J?t.documentElement:s},ze=function(e){return M.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Le=function(e){return e instanceof d&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof u)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},Re=function(e){return"object"===cq(a)?e instanceof a:e&&"object"===cq(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Fe=function(e,t,i){N[e]&&Cq(N[e],(function(e){e.call(n,t,i,ke)}))},Pe=function(e){var t;if(Fe("beforeSanitizeElements",e,null),Le(e))return Ae(e),!0;if(Iq(/[\u0080-\uFFFF]/,e.nodeName))return Ae(e),!0;var i=A(e.nodeName);if(Fe("uponSanitizeElement",e,{tagName:i,allowedTags:B}),e.hasChildNodes()&&!Re(e.firstElementChild)&&(!Re(e.content)||!Re(e.content.firstElementChild))&&Iq(/<[/\w]/g,e.innerHTML)&&Iq(/<[/\w]/g,e.textContent))return Ae(e),!0;if("select"===i&&Iq(/<template/i,e.innerHTML))return Ae(e),!0;if(!B[i]||q[i]){if(!q[i]&&Ue(i)){if(V.tagNameCheck instanceof RegExp&&Iq(V.tagNameCheck,i))return!1;if(V.tagNameCheck instanceof Function&&V.tagNameCheck(i))return!1}if(se&&!ce[i]){var o=y(e)||e.parentNode,r=v(e)||e.childNodes;if(r&&o)for(var s=r.length-1;s>=0;--s)o.insertBefore(g(r[s],!0),b(e))}return Ae(e),!0}return e instanceof l&&!Se(e)?(Ae(e),!0):"noscript"!==i&&"noembed"!==i||!Iq(/<\/no(script|embed)/i,e.innerHTML)?(G&&3===e.nodeType&&(t=e.textContent,t=Sq(t,j," "),t=Sq(t,I," "),e.textContent!==t&&(Oq(n.removed,{element:e.cloneNode()}),e.textContent=t)),Fe("afterSanitizeElements",e,null),!1):(Ae(e),!0)},Be=function(e,t,n){if(ie&&("id"===t||"name"===t)&&(n in o||n in Ee))return!1;if(Y&&!W[t]&&Iq(z,t));else if(K&&Iq(L,t));else if(!$[t]||W[t]){if(!(Ue(e)&&(V.tagNameCheck instanceof RegExp&&Iq(V.tagNameCheck,e)||V.tagNameCheck instanceof Function&&V.tagNameCheck(e))&&(V.attributeNameCheck instanceof RegExp&&Iq(V.attributeNameCheck,t)||V.attributeNameCheck instanceof Function&&V.attributeNameCheck(t))||"is"===t&&V.allowCustomizedBuiltInElements&&(V.tagNameCheck instanceof RegExp&&Iq(V.tagNameCheck,n)||V.tagNameCheck instanceof Function&&V.tagNameCheck(n))))return!1}else if(he[t]);else if(Iq(P,Sq(n,F,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Aq(n,"data:")||!ue[e]){if(Q&&!Iq(R,Sq(n,F,"")));else if(n)return!1}else;return!0},Ue=function(e){return e.indexOf("-")>0},$e=function(e){var t,i,o,r;Fe("beforeSanitizeAttributes",e,null);var s=e.attributes;if(s){var a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$};for(r=s.length;r--;){var l=t=s[r],c=l.name,p=l.namespaceURI;if(i="value"===c?t.value:jq(t.value),o=A(c),a.attrName=o,a.attrValue=i,a.keepAttr=!0,a.forceKeepAttr=void 0,Fe("uponSanitizeAttribute",e,a),i=a.attrValue,!a.forceKeepAttr&&(je(c,e),a.keepAttr))if(Iq(/\/>/i,i))je(c,e);else{G&&(i=Sq(i,j," "),i=Sq(i,I," "));var u=A(e.nodeName);if(Be(u,o,i)){if(!oe||"id"!==o&&"name"!==o||(je(c,e),i=re+i),w&&"object"===cq(m)&&"function"==typeof m.getAttributeType)if(p);else switch(m.getAttributeType(u,o)){case"TrustedHTML":i=w.createHTML(i);break;case"TrustedScriptURL":i=w.createScriptURL(i)}try{p?e.setAttributeNS(p,c,i):e.setAttribute(c,i),Dq(n.removed)}catch(e){}}}}Fe("afterSanitizeAttributes",e,null)}},He=function e(t){var n,i=ze(t);for(Fe("beforeSanitizeShadowDOM",t,null);n=i.nextNode();)Fe("uponSanitizeShadowNode",n,null),Pe(n)||(n.content instanceof r&&e(n.content),$e(n));Fe("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){var o,s,l,c,p,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((ye=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Re(e)){if("function"!=typeof e.toString)throw zq("toString is not a function");if("string"!=typeof(e=e.toString()))throw zq("dirty is not a string, aborting")}if(!n.isSupported){if("object"===cq(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(Re(e))return t.toStaticHTML(e.outerHTML)}return e}if(Z||Me(u),n.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){var d=A(e.nodeName);if(!B[d]||q[d])throw zq("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof a)1===(s=(o=Ie("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?o=s:o.appendChild(s);else{if(!ee&&!G&&!J&&-1===e.indexOf("<"))return w&&ne?w.createHTML(e):e;if(!(o=Ie(e)))return ee?null:ne?k:""}o&&X&&Ae(o.firstChild);for(var h=ze(ae?e:o);l=h.nextNode();)3===l.nodeType&&l===c||Pe(l)||(l.content instanceof r&&He(l.content),$e(l),c=l);if(c=null,ae)return e;if(ee){if(te)for(p=C.call(o.ownerDocument);o.firstChild;)p.appendChild(o.firstChild);else p=o;return $.shadowroot&&(p=O.call(i,p,!0)),p}var m=J?o.outerHTML:o.innerHTML;return J&&B["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&Iq(oW,o.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+m),G&&(m=Sq(m,j," "),m=Sq(m,I," ")),w&&ne?w.createHTML(m):m},n.setConfig=function(e){Me(e),Z=!0},n.clearConfig=function(){ke=null,Z=!1},n.isValidAttribute=function(e,t,n){ke||Me({});var i=A(e),o=A(t);return Be(i,o,n)},n.addHook=function(e,t){"function"==typeof t&&(N[e]=N[e]||[],Oq(N[e],t))},n.removeHook=function(e){if(N[e])return Dq(N[e])},n.removeHooks=function(e){N[e]&&(N[e]=[])},n.removeAllHooks=function(){N={}},n}();const lW=e=>{if(e.tagName){const n=e.children?e.children.map(lW):null;return t.createElement(e.tagName,e.properties,n)}return e.value},cW=e=>{let{content:n="",className:i,...o}=e;const r=(e=>e.replaceAll($d,((e,t)=>{const n=KU.highlightAuto(t.replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")).children.map(lW);return`<pre><code>${D(n)}</code></pre>`})))(n),s=aW.sanitize;return t.createElement("div",S({className:Bc(Id,{[i]:i}),dangerouslySetInnerHTML:{__html:s(r,{ADD_TAGS:["iframe"],ADD_ATTR:["target","allow","allowfullscreen","frameborder"]})},"data-cy":"neeto-editor-content"},o))};export{Pd as EDITOR_OPTIONS,lq as Editor,cW as EditorContent};
|
|
61
|
+
/*! @license DOMPurify 2.4.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.0/LICENSE */function cq(e){return cq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cq(e)}function pq(e,t){return pq=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},pq(e,t)}function uq(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function dq(e,t,n){return dq=uq()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&pq(o,n.prototype),o},dq.apply(null,arguments)}function hq(e){return function(e){if(Array.isArray(e))return mq(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return mq(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mq(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mq(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var fq=Object.hasOwnProperty,gq=Object.setPrototypeOf,bq=Object.isFrozen,vq=Object.getPrototypeOf,yq=Object.getOwnPropertyDescriptor,xq=Object.freeze,wq=Object.seal,kq=Object.create,Eq="undefined"!=typeof Reflect&&Reflect,_q=Eq.apply,Mq=Eq.construct;_q||(_q=function(e,t,n){return e.apply(t,n)}),xq||(xq=function(e){return e}),wq||(wq=function(e){return e}),Mq||(Mq=function(e,t){return dq(e,hq(t))});var Cq=Lq(Array.prototype.forEach),Dq=Lq(Array.prototype.pop),Oq=Lq(Array.prototype.push),Tq=Lq(String.prototype.toLowerCase),Nq=Lq(String.prototype.match),Sq=Lq(String.prototype.replace),Aq=Lq(String.prototype.indexOf),jq=Lq(String.prototype.trim),Iq=Lq(RegExp.prototype.test),zq=function(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return Mq(e,n)}}(TypeError);function Lq(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return _q(e,t,i)}}function Rq(e,t,n){n=n||Tq,gq&&gq(e,null);for(var i=t.length;i--;){var o=t[i];if("string"==typeof o){var r=n(o);r!==o&&(bq(t)||(t[i]=r),o=r)}e[o]=!0}return e}function Fq(e){var t,n=kq(null);for(t in e)_q(fq,e,[t])&&(n[t]=e[t]);return n}function Pq(e,t){for(;null!==e;){var n=yq(e,t);if(n){if(n.get)return Lq(n.get);if("function"==typeof n.value)return Lq(n.value)}e=vq(e)}return function(e){return console.warn("fallback value for",e),null}}var Bq=xq(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Uq=xq(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),$q=xq(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Hq=xq(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Vq=xq(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),qq=xq(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Wq=xq(["#text"]),Kq=xq(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Yq=xq(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Qq=xq(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Gq=xq(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Jq=wq(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Zq=wq(/<%[\w\W]*|[\w\W]*%>/gm),Xq=wq(/^data-[\-\w.\u00B7-\uFFFF]/),eW=wq(/^aria-[\-\w]+$/),tW=wq(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),nW=wq(/^(?:\w+script|data):/i),iW=wq(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),oW=wq(/^html$/i),rW=function(){return"undefined"==typeof window?null:window},sW=function(e,t){if("object"!==cq(e)||"function"!=typeof e.createPolicy)return null;var n=null,i="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(i)&&(n=t.currentScript.getAttribute(i));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};var aW=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rW(),n=function(t){return e(t)};if(n.version="2.4.0",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var i=t.document,o=t.document,r=t.DocumentFragment,s=t.HTMLTemplateElement,a=t.Node,l=t.Element,c=t.NodeFilter,p=t.NamedNodeMap,u=void 0===p?t.NamedNodeMap||t.MozNamedAttrMap:p,d=t.HTMLFormElement,h=t.DOMParser,m=t.trustedTypes,f=l.prototype,g=Pq(f,"cloneNode"),b=Pq(f,"nextSibling"),v=Pq(f,"childNodes"),y=Pq(f,"parentNode");if("function"==typeof s){var x=o.createElement("template");x.content&&x.content.ownerDocument&&(o=x.content.ownerDocument)}var w=sW(m,i),k=w?w.createHTML(""):"",E=o,_=E.implementation,M=E.createNodeIterator,C=E.createDocumentFragment,D=E.getElementsByTagName,O=i.importNode,T={};try{T=Fq(o).documentMode?o.documentMode:{}}catch(e){}var N={};n.isSupported="function"==typeof y&&_&&void 0!==_.createHTMLDocument&&9!==T;var S,A,j=Jq,I=Zq,z=Xq,L=eW,R=nW,F=iW,P=tW,B=null,U=Rq({},[].concat(hq(Bq),hq(Uq),hq($q),hq(Vq),hq(Wq))),$=null,H=Rq({},[].concat(hq(Kq),hq(Yq),hq(Qq),hq(Gq))),V=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),q=null,W=null,K=!0,Y=!0,Q=!1,G=!1,J=!1,Z=!1,X=!1,ee=!1,te=!1,ne=!1,ie=!0,oe=!1,re="user-content-",se=!0,ae=!1,le={},ce=null,pe=Rq({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ue=null,de=Rq({},["audio","video","img","source","image","track"]),he=null,me=Rq({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",be="http://www.w3.org/1999/xhtml",ve=be,ye=!1,xe=["application/xhtml+xml","text/html"],we="text/html",ke=null,Ee=o.createElement("form"),_e=function(e){return e instanceof RegExp||e instanceof Function},Me=function(e){ke&&ke===e||(e&&"object"===cq(e)||(e={}),e=Fq(e),S=S=-1===xe.indexOf(e.PARSER_MEDIA_TYPE)?we:e.PARSER_MEDIA_TYPE,A="application/xhtml+xml"===S?function(e){return e}:Tq,B="ALLOWED_TAGS"in e?Rq({},e.ALLOWED_TAGS,A):U,$="ALLOWED_ATTR"in e?Rq({},e.ALLOWED_ATTR,A):H,he="ADD_URI_SAFE_ATTR"in e?Rq(Fq(me),e.ADD_URI_SAFE_ATTR,A):me,ue="ADD_DATA_URI_TAGS"in e?Rq(Fq(de),e.ADD_DATA_URI_TAGS,A):de,ce="FORBID_CONTENTS"in e?Rq({},e.FORBID_CONTENTS,A):pe,q="FORBID_TAGS"in e?Rq({},e.FORBID_TAGS,A):{},W="FORBID_ATTR"in e?Rq({},e.FORBID_ATTR,A):{},le="USE_PROFILES"in e&&e.USE_PROFILES,K=!1!==e.ALLOW_ARIA_ATTR,Y=!1!==e.ALLOW_DATA_ATTR,Q=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=e.SAFE_FOR_TEMPLATES||!1,J=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,X=e.FORCE_BODY||!1,ie=!1!==e.SANITIZE_DOM,oe=e.SANITIZE_NAMED_PROPS||!1,se=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,P=e.ALLOWED_URI_REGEXP||P,ve=e.NAMESPACE||be,e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(V.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(V.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(V.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),G&&(Y=!1),te&&(ee=!0),le&&(B=Rq({},hq(Wq)),$=[],!0===le.html&&(Rq(B,Bq),Rq($,Kq)),!0===le.svg&&(Rq(B,Uq),Rq($,Yq),Rq($,Gq)),!0===le.svgFilters&&(Rq(B,$q),Rq($,Yq),Rq($,Gq)),!0===le.mathMl&&(Rq(B,Vq),Rq($,Qq),Rq($,Gq))),e.ADD_TAGS&&(B===U&&(B=Fq(B)),Rq(B,e.ADD_TAGS,A)),e.ADD_ATTR&&($===H&&($=Fq($)),Rq($,e.ADD_ATTR,A)),e.ADD_URI_SAFE_ATTR&&Rq(he,e.ADD_URI_SAFE_ATTR,A),e.FORBID_CONTENTS&&(ce===pe&&(ce=Fq(ce)),Rq(ce,e.FORBID_CONTENTS,A)),se&&(B["#text"]=!0),J&&Rq(B,["html","head","body"]),B.table&&(Rq(B,["tbody"]),delete q.tbody),xq&&xq(e),ke=e)},Ce=Rq({},["mi","mo","mn","ms","mtext"]),De=Rq({},["foreignobject","desc","title","annotation-xml"]),Oe=Rq({},["title","style","font","a","script"]),Te=Rq({},Uq);Rq(Te,$q),Rq(Te,Hq);var Ne=Rq({},Vq);Rq(Ne,qq);var Se=function(e){var t=y(e);t&&t.tagName||(t={namespaceURI:be,tagName:"template"});var n=Tq(e.tagName),i=Tq(t.tagName);return e.namespaceURI===ge?t.namespaceURI===be?"svg"===n:t.namespaceURI===fe?"svg"===n&&("annotation-xml"===i||Ce[i]):Boolean(Te[n]):e.namespaceURI===fe?t.namespaceURI===be?"math"===n:t.namespaceURI===ge?"math"===n&&De[i]:Boolean(Ne[n]):e.namespaceURI===be&&(!(t.namespaceURI===ge&&!De[i])&&(!(t.namespaceURI===fe&&!Ce[i])&&(!Ne[n]&&(Oe[n]||!Te[n]))))},Ae=function(e){Oq(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=k}catch(t){e.remove()}}},je=function(e,t){try{Oq(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Oq(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!$[e])if(ee||te)try{Ae(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Ie=function(e){var t,n;if(X)e="<remove></remove>"+e;else{var i=Nq(e,/^[\r\n\t ]+/);n=i&&i[0]}"application/xhtml+xml"===S&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var r=w?w.createHTML(e):e;if(ve===be)try{t=(new h).parseFromString(r,S)}catch(e){}if(!t||!t.documentElement){t=_.createDocument(ve,"template",null);try{t.documentElement.innerHTML=ye?"":r}catch(e){}}var s=t.body||t.documentElement;return e&&n&&s.insertBefore(o.createTextNode(n),s.childNodes[0]||null),ve===be?D.call(t,J?"html":"body")[0]:J?t.documentElement:s},ze=function(e){return M.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Le=function(e){return e instanceof d&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof u)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},Re=function(e){return"object"===cq(a)?e instanceof a:e&&"object"===cq(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Fe=function(e,t,i){N[e]&&Cq(N[e],(function(e){e.call(n,t,i,ke)}))},Pe=function(e){var t;if(Fe("beforeSanitizeElements",e,null),Le(e))return Ae(e),!0;if(Iq(/[\u0080-\uFFFF]/,e.nodeName))return Ae(e),!0;var i=A(e.nodeName);if(Fe("uponSanitizeElement",e,{tagName:i,allowedTags:B}),e.hasChildNodes()&&!Re(e.firstElementChild)&&(!Re(e.content)||!Re(e.content.firstElementChild))&&Iq(/<[/\w]/g,e.innerHTML)&&Iq(/<[/\w]/g,e.textContent))return Ae(e),!0;if("select"===i&&Iq(/<template/i,e.innerHTML))return Ae(e),!0;if(!B[i]||q[i]){if(!q[i]&&Ue(i)){if(V.tagNameCheck instanceof RegExp&&Iq(V.tagNameCheck,i))return!1;if(V.tagNameCheck instanceof Function&&V.tagNameCheck(i))return!1}if(se&&!ce[i]){var o=y(e)||e.parentNode,r=v(e)||e.childNodes;if(r&&o)for(var s=r.length-1;s>=0;--s)o.insertBefore(g(r[s],!0),b(e))}return Ae(e),!0}return e instanceof l&&!Se(e)?(Ae(e),!0):"noscript"!==i&&"noembed"!==i||!Iq(/<\/no(script|embed)/i,e.innerHTML)?(G&&3===e.nodeType&&(t=e.textContent,t=Sq(t,j," "),t=Sq(t,I," "),e.textContent!==t&&(Oq(n.removed,{element:e.cloneNode()}),e.textContent=t)),Fe("afterSanitizeElements",e,null),!1):(Ae(e),!0)},Be=function(e,t,n){if(ie&&("id"===t||"name"===t)&&(n in o||n in Ee))return!1;if(Y&&!W[t]&&Iq(z,t));else if(K&&Iq(L,t));else if(!$[t]||W[t]){if(!(Ue(e)&&(V.tagNameCheck instanceof RegExp&&Iq(V.tagNameCheck,e)||V.tagNameCheck instanceof Function&&V.tagNameCheck(e))&&(V.attributeNameCheck instanceof RegExp&&Iq(V.attributeNameCheck,t)||V.attributeNameCheck instanceof Function&&V.attributeNameCheck(t))||"is"===t&&V.allowCustomizedBuiltInElements&&(V.tagNameCheck instanceof RegExp&&Iq(V.tagNameCheck,n)||V.tagNameCheck instanceof Function&&V.tagNameCheck(n))))return!1}else if(he[t]);else if(Iq(P,Sq(n,F,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Aq(n,"data:")||!ue[e]){if(Q&&!Iq(R,Sq(n,F,"")));else if(n)return!1}else;return!0},Ue=function(e){return e.indexOf("-")>0},$e=function(e){var t,i,o,r;Fe("beforeSanitizeAttributes",e,null);var s=e.attributes;if(s){var a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$};for(r=s.length;r--;){var l=t=s[r],c=l.name,p=l.namespaceURI;if(i="value"===c?t.value:jq(t.value),o=A(c),a.attrName=o,a.attrValue=i,a.keepAttr=!0,a.forceKeepAttr=void 0,Fe("uponSanitizeAttribute",e,a),i=a.attrValue,!a.forceKeepAttr&&(je(c,e),a.keepAttr))if(Iq(/\/>/i,i))je(c,e);else{G&&(i=Sq(i,j," "),i=Sq(i,I," "));var u=A(e.nodeName);if(Be(u,o,i)){if(!oe||"id"!==o&&"name"!==o||(je(c,e),i=re+i),w&&"object"===cq(m)&&"function"==typeof m.getAttributeType)if(p);else switch(m.getAttributeType(u,o)){case"TrustedHTML":i=w.createHTML(i);break;case"TrustedScriptURL":i=w.createScriptURL(i)}try{p?e.setAttributeNS(p,c,i):e.setAttribute(c,i),Dq(n.removed)}catch(e){}}}}Fe("afterSanitizeAttributes",e,null)}},He=function e(t){var n,i=ze(t);for(Fe("beforeSanitizeShadowDOM",t,null);n=i.nextNode();)Fe("uponSanitizeShadowNode",n,null),Pe(n)||(n.content instanceof r&&e(n.content),$e(n));Fe("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){var o,s,l,c,p,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((ye=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Re(e)){if("function"!=typeof e.toString)throw zq("toString is not a function");if("string"!=typeof(e=e.toString()))throw zq("dirty is not a string, aborting")}if(!n.isSupported){if("object"===cq(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(Re(e))return t.toStaticHTML(e.outerHTML)}return e}if(Z||Me(u),n.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){var d=A(e.nodeName);if(!B[d]||q[d])throw zq("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof a)1===(s=(o=Ie("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?o=s:o.appendChild(s);else{if(!ee&&!G&&!J&&-1===e.indexOf("<"))return w&&ne?w.createHTML(e):e;if(!(o=Ie(e)))return ee?null:ne?k:""}o&&X&&Ae(o.firstChild);for(var h=ze(ae?e:o);l=h.nextNode();)3===l.nodeType&&l===c||Pe(l)||(l.content instanceof r&&He(l.content),$e(l),c=l);if(c=null,ae)return e;if(ee){if(te)for(p=C.call(o.ownerDocument);o.firstChild;)p.appendChild(o.firstChild);else p=o;return $.shadowroot&&(p=O.call(i,p,!0)),p}var m=J?o.outerHTML:o.innerHTML;return J&&B["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&Iq(oW,o.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+m),G&&(m=Sq(m,j," "),m=Sq(m,I," ")),w&&ne?w.createHTML(m):m},n.setConfig=function(e){Me(e),Z=!0},n.clearConfig=function(){ke=null,Z=!1},n.isValidAttribute=function(e,t,n){ke||Me({});var i=A(e),o=A(t);return Be(i,o,n)},n.addHook=function(e,t){"function"==typeof t&&(N[e]=N[e]||[],Oq(N[e],t))},n.removeHook=function(e){if(N[e])return Dq(N[e])},n.removeHooks=function(e){N[e]&&(N[e]=[])},n.removeAllHooks=function(){N={}},n}();const lW=e=>{if(e.tagName){const n=e.children?e.children.map(lW):null;return t.createElement(e.tagName,e.properties,n)}return e.value},cW=e=>{let{content:n="",className:i,...o}=e;const r=(e=>e.replace($d,((e,t)=>{const n=KU.highlightAuto(t.replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")).children.map(lW);return`<pre><code>${D(n)}</code></pre>`})))(n),s=aW.sanitize;return t.createElement("div",S({className:Bc(Id,{[i]:i}),dangerouslySetInnerHTML:{__html:s(r,{ADD_TAGS:["iframe"],ADD_ATTR:["target","allow","allowfullscreen","frameborder"]})},"data-cy":"neeto-editor-content"},o))};export{Pd as EDITOR_OPTIONS,lq as Editor,cW as EditorContent};
|