From f5a48beaf5aeb2dc90cdb010622fc15821f09a70 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Tue, 26 Jul 2022 12:47:17 +0500 Subject: [PATCH] chore: update editor bundle --- apps/mobile/web.bundle/asset-manifest.json | 14 +++++++------- apps/mobile/web.bundle/index.html | 2 +- .../{3.a46cbd43.chunk.css => 3.0874a200.chunk.css} | 2 +- .../{3.cdfcd3a9.chunk.js => 3.08bb4dc3.chunk.js} | 4 ++-- ...LICENSE.txt => 3.08bb4dc3.chunk.js.LICENSE.txt} | 0 .../web.bundle/static/js/main.35e1fa36.chunk.js | 1 - .../web.bundle/static/js/main.6c63af72.chunk.js | 1 + 7 files changed, 12 insertions(+), 12 deletions(-) rename apps/mobile/web.bundle/static/css/{3.a46cbd43.chunk.css => 3.0874a200.chunk.css} (90%) rename apps/mobile/web.bundle/static/js/{3.cdfcd3a9.chunk.js => 3.08bb4dc3.chunk.js} (64%) rename apps/mobile/web.bundle/static/js/{3.cdfcd3a9.chunk.js.LICENSE.txt => 3.08bb4dc3.chunk.js.LICENSE.txt} (100%) delete mode 100644 apps/mobile/web.bundle/static/js/main.35e1fa36.chunk.js create mode 100644 apps/mobile/web.bundle/static/js/main.6c63af72.chunk.js diff --git a/apps/mobile/web.bundle/asset-manifest.json b/apps/mobile/web.bundle/asset-manifest.json index 95e511883..1603f8d0d 100644 --- a/apps/mobile/web.bundle/asset-manifest.json +++ b/apps/mobile/web.bundle/asset-manifest.json @@ -2,22 +2,22 @@ "files": { "static/js/0.6b732ed5.chunk.js": "./static/js/0.6b732ed5.chunk.js", "main.css": "./static/css/main.f2465fba.chunk.css", - "main.js": "./static/js/main.35e1fa36.chunk.js", + "main.js": "./static/js/main.6c63af72.chunk.js", "runtime-main.js": "./static/js/runtime-main.563aec9a.js", - "static/css/3.a46cbd43.chunk.css": "./static/css/3.a46cbd43.chunk.css", - "static/js/3.cdfcd3a9.chunk.js": "./static/js/3.cdfcd3a9.chunk.js", + "static/css/3.0874a200.chunk.css": "./static/css/3.0874a200.chunk.css", + "static/js/3.08bb4dc3.chunk.js": "./static/js/3.08bb4dc3.chunk.js", "static/js/4.628ec668.chunk.js": "./static/js/4.628ec668.chunk.js", "static/js/5.34df2de4.chunk.js": "./static/js/5.34df2de4.chunk.js", "index.html": "./index.html", - "static/js/3.cdfcd3a9.chunk.js.LICENSE.txt": "./static/js/3.cdfcd3a9.chunk.js.LICENSE.txt", + "static/js/3.08bb4dc3.chunk.js.LICENSE.txt": "./static/js/3.08bb4dc3.chunk.js.LICENSE.txt", "static/media/katexfonts.mobile.css": "./static/media/KaTeX_Typewriter-Regular.c5c02d76.ttf", "static/media/fonts.mobile.css": "./static/media/hack-regular.f2412cb7.ttf" }, "entrypoints": [ "static/js/runtime-main.563aec9a.js", - "static/css/3.a46cbd43.chunk.css", - "static/js/3.cdfcd3a9.chunk.js", + "static/css/3.0874a200.chunk.css", + "static/js/3.08bb4dc3.chunk.js", "static/css/main.f2465fba.chunk.css", - "static/js/main.35e1fa36.chunk.js" + "static/js/main.6c63af72.chunk.js" ] } \ No newline at end of file diff --git a/apps/mobile/web.bundle/index.html b/apps/mobile/web.bundle/index.html index c90932147..f95b1d905 100644 --- a/apps/mobile/web.bundle/index.html +++ b/apps/mobile/web.bundle/index.html @@ -1 +1 @@ -Notesnook editor
\ No newline at end of file +Notesnook editor
\ No newline at end of file diff --git a/apps/mobile/web.bundle/static/css/3.a46cbd43.chunk.css b/apps/mobile/web.bundle/static/css/3.0874a200.chunk.css similarity index 90% rename from apps/mobile/web.bundle/static/css/3.a46cbd43.chunk.css rename to apps/mobile/web.bundle/static/css/3.0874a200.chunk.css index c64c48139..95cb71a01 100644 --- a/apps/mobile/web.bundle/static/css/3.a46cbd43.chunk.css +++ b/apps/mobile/web.bundle/static/css/3.0874a200.chunk.css @@ -2,4 +2,4 @@ /*! * Hack typeface https://github.com/source-foundry/Hack * License: https://github.com/source-foundry/Hack/blob/master/LICENSE.md - */@font-face{font-family:"Hack";src:url(../../static/media/hack-regular.f2412cb7.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:"Hack";src:url(../../static/media/hack-bold.d34bf845.ttf) format("truetype");font-weight:700;font-style:normal}@font-face{font-family:"Hack";src:url(../../static/media/hack-italic.72f5c8c8.ttf) format("truetype");font-weight:400;font-style:italic}@font-face{font-family:"Hack";src:url(../../static/media/hack-bolditalic.8554b987.ttf) format("truetype");font-weight:700;font-style:italic}@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_AMS-Regular.853be924.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(../../static/media/KaTeX_Caligraphic-Bold.7489a2fb.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Caligraphic-Regular.7e873d38.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(../../static/media/KaTeX_Fraktur-Bold.4c761b37.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Fraktur-Regular.ed305b54.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(../../static/media/KaTeX_Main-Bold.8169508b.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(../../static/media/KaTeX_Main-BoldItalic.828abcb2.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(../../static/media/KaTeX_Main-Italic.fa675e5e.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Main-Regular.9eba1d77.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(../../static/media/KaTeX_Math-BoldItalic.bf2d440b.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(../../static/media/KaTeX_Math-Italic.8a5f9363.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(../../static/media/KaTeX_SansSerif-Bold.5b49f499.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(../../static/media/KaTeX_SansSerif-Italic.b257a18c.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_SansSerif-Regular.2f7bc363.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Script-Regular.fc9ba524.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Size1-Regular.6de7d4b5.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Size2-Regular.57f5c183.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Size3-Regular.8d6b6822.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Size4-Regular.4ad7c7e8.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Typewriter-Regular.c5c02d76.ttf) format("truetype")}.ProseMirror p.is-editor-empty:first-child:before{color:var(--placeholder);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ProseMirror:first-child{margin-top:10px}.ProseMirror hr{background-color:var(--border);border-width:0;height:2px}.ProseMirror code:not(pre code){background-color:var(--bgSecondary);border:1px solid var(--border);border-radius:5px;padding:3px 5px 0;font-family:ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace!important;font-size:10pt!important}.ProseMirror li p{margin:0}.ProseMirror li{margin-bottom:5px}.ProseMirror a{color:var(--primary);cursor:pointer}.ProseMirror a:hover{-webkit-filter:brightness(70%);filter:brightness(70%)}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;-webkit-font-feature-settings:"liga" 0,none;font-feature-settings:"liga" 0,none}.ProseMirror [contenteditable=false]{white-space:normal}.ProseMirror [contenteditable=false] [contenteditable=true],.ProseMirror pre{white-space:pre-wrap}img.ProseMirror-separator{display:inline!important;border:none!important;margin:0!important;width:1px!important;height:1px!important}.ProseMirror-gapcursor{display:none;pointer-events:none;position:absolute;margin:0}.ProseMirror-gapcursor:after{content:"";display:block;position:absolute;top:-2px;width:20px;border-top:1px solid var(--text);-webkit-animation:ProseMirror-cursor-blink 1.1s steps(2,start) infinite;animation:ProseMirror-cursor-blink 1.1s steps(2,start) infinite}@-webkit-keyframes ProseMirror-cursor-blink{to{visibility:hidden}}@keyframes ProseMirror-cursor-blink{to{visibility:hidden}}.ProseMirror-hideselection ::selection{background:transparent;color:var(--text)}.ProseMirror-hideselection ::-moz-selection{background:transparent;color:var(--text)}.ProseMirror-hideselection *{caret-color:transparent}.ProseMirror-focused .ProseMirror-gapcursor{display:block}.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}.ProseMirror li.node-taskItem{list-style-type:none}.ProseMirror table{border-collapse:collapse;margin:0;overflow:hidden;table-layout:fixed}.ProseMirror table td,.ProseMirror table th{border:1px solid var(--border);box-sizing:border-box;min-width:1em;padding:3px 5px;position:relative;vertical-align:top}.ProseMirror table td>*,.ProseMirror table th>*{margin-bottom:0}.ProseMirror table th{background-color:var(--bgSecondary);font-weight:700;text-align:left}.ProseMirror table .selectedCell:after{background:var(--primary);content:"";left:0;right:0;top:0;bottom:0;pointer-events:none;position:absolute;z-index:2;opacity:.2}.ProseMirror table .column-resize-handle{background-color:var(--primary);bottom:-2px;position:absolute;right:-2px;pointer-events:none;top:0;width:5px}.ProseMirror table p{margin:0}.tableWrapper{overflow-x:auto}.resize-cursor{cursor:ew-resize;cursor:col-resize}.drop-cursor{background-color:var(--text)!important}.search-result{background-color:var(--disabled)}.line-number-widget,.line-number:before{color:var(--codeFg);pointer-events:none;border-right:1px solid;margin-right:10px;padding-right:10px}.line-number:before{content:attr(data-line)}.line-number-widget.active,.line-number.active:before{color:var(--codeHighlight)}.line-number-widget.active:after,.line-number.active:after{content:" ";width:100%;position:absolute;left:0;pointer-events:none;background-color:var(--overlay)}pre::selection,pre ::selection{background-color:var(--codeSelection)!important;color:currentColor}.hide-scrollbar::-webkit-scrollbar{display:none}.ProseMirror blockquote{border-left:5px solid var(--border);padding-left:15px}@-webkit-keyframes blink{49%{border-color:unset}50%{border-color:#fff}99%{border-color:#fff}}@keyframes blink{49%{border-color:unset}50%{border-color:#fff}99%{border-color:#fff}}.no-cursor{caret-color:transparent}div:focus .fake-cursor,span:focus .fake-cursor{margin-right:-1px;border-left-width:1px;border-left-style:solid;-webkit-animation:blink 1s;animation:blink 1s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;position:relative;z-index:1}.math-node{min-width:1em;min-height:1em;font-size:.95em;font-family:"Consolas","Ubuntu Mono",monospace;cursor:auto}.math-node.empty-math .math-render:before{content:"(empty)";color:red}.math-node .math-render.parse-error:before{content:"(math error)";color:red;cursor:help}.math-node.ProseMirror-selectednode{outline:none}.math-node .math-src{display:none;color:var(--text);tab-size:4}.math-node.ProseMirror-selectednode .math-src{display:inline}.math-node.ProseMirror-selectednode .math-render{display:none}.math-inline{display:inline;white-space:nowrap}.math-inline .math-render{display:inline-block;cursor:pointer}.math-inline .math-src .ProseMirror{display:inline;border-right:1px solid transparent;border-left:1px solid transparent;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace!important}.math-inline.ProseMirror-selectednode{background-color:var(--bgSecondary);padding:3px;border-radius:5px;border:1px solid var(--border)}.math-inline .math-src:after,.math-inline .math-src:before{content:"$$";color:var(--disabled)}.math-block,.math-block .math-render{display:block}.math-block.ProseMirror-selectednode{background-color:var(--bgSecondary);padding:10px;border-radius:5px;border:1px solid var(--border)}.math-block .math-src .ProseMirror{width:100%;display:block;margin-top:10px;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace!important}.math-block .math-src:before{content:"Math";text-align:left;color:var(--disabled);margin-bottom:10px}.math-block .katex-display{margin:0} \ No newline at end of file + */@font-face{font-family:"Hack";src:url(../../static/media/hack-regular.f2412cb7.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:"Hack";src:url(../../static/media/hack-bold.d34bf845.ttf) format("truetype");font-weight:700;font-style:normal}@font-face{font-family:"Hack";src:url(../../static/media/hack-italic.72f5c8c8.ttf) format("truetype");font-weight:400;font-style:italic}@font-face{font-family:"Hack";src:url(../../static/media/hack-bolditalic.8554b987.ttf) format("truetype");font-weight:700;font-style:italic}@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_AMS-Regular.853be924.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(../../static/media/KaTeX_Caligraphic-Bold.7489a2fb.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Caligraphic-Regular.7e873d38.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(../../static/media/KaTeX_Fraktur-Bold.4c761b37.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Fraktur-Regular.ed305b54.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(../../static/media/KaTeX_Main-Bold.8169508b.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(../../static/media/KaTeX_Main-BoldItalic.828abcb2.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(../../static/media/KaTeX_Main-Italic.fa675e5e.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Main-Regular.9eba1d77.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(../../static/media/KaTeX_Math-BoldItalic.bf2d440b.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(../../static/media/KaTeX_Math-Italic.8a5f9363.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(../../static/media/KaTeX_SansSerif-Bold.5b49f499.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(../../static/media/KaTeX_SansSerif-Italic.b257a18c.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_SansSerif-Regular.2f7bc363.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Script-Regular.fc9ba524.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Size1-Regular.6de7d4b5.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Size2-Regular.57f5c183.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Size3-Regular.8d6b6822.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Size4-Regular.4ad7c7e8.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Typewriter-Regular.c5c02d76.ttf) format("truetype")}.ProseMirror p.is-editor-empty:first-child:before{color:var(--placeholder);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ProseMirror:first-child{margin-top:10px}.ProseMirror hr{background-color:var(--border);border-width:0;height:2px}.ProseMirror code:not(pre code){background-color:var(--bgSecondary);border:1px solid var(--border);border-radius:5px;padding:3px 5px 0;font-family:ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace!important;font-size:10pt!important}.ProseMirror li p{margin:0}.ProseMirror li{margin-bottom:5px}.ProseMirror a{color:var(--primary);cursor:pointer}.ProseMirror a:hover{-webkit-filter:brightness(70%);filter:brightness(70%)}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;-webkit-font-feature-settings:"liga" 0,none;font-feature-settings:"liga" 0,none}.ProseMirror [contenteditable=false]{white-space:normal}.ProseMirror [contenteditable=false] [contenteditable=true],.ProseMirror pre{white-space:pre-wrap}img.ProseMirror-separator{display:inline!important;border:none!important;margin:0!important;width:1px!important;height:1px!important}.ProseMirror-gapcursor{display:none;pointer-events:none;position:absolute;margin:0}.ProseMirror-gapcursor:after{content:"";display:block;position:absolute;top:-2px;width:20px;border-top:1px solid var(--text);-webkit-animation:ProseMirror-cursor-blink 1.1s steps(2,start) infinite;animation:ProseMirror-cursor-blink 1.1s steps(2,start) infinite}@-webkit-keyframes ProseMirror-cursor-blink{to{visibility:hidden}}@keyframes ProseMirror-cursor-blink{to{visibility:hidden}}.ProseMirror-hideselection ::selection{background:transparent;color:var(--text)}.ProseMirror-hideselection ::-moz-selection{background:transparent;color:var(--text)}.ProseMirror-hideselection *{caret-color:transparent}.ProseMirror-focused .ProseMirror-gapcursor{display:block}.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}.ProseMirror li.node-taskItem{list-style-type:none}.ProseMirror table{border-collapse:collapse;margin:0;overflow:hidden;table-layout:fixed}.ProseMirror table td,.ProseMirror table th{border:1px solid var(--border);box-sizing:border-box;min-width:1em;padding:3px 5px;position:relative;vertical-align:top}.ProseMirror table td>*,.ProseMirror table th>*{margin-bottom:0}.ProseMirror table th{background-color:var(--bgSecondary);font-weight:700;text-align:left}.ProseMirror table .selectedCell:after{background:var(--primary);content:"";left:0;right:0;top:0;bottom:0;pointer-events:none;position:absolute;z-index:2;opacity:.2}.ProseMirror table .column-resize-handle{background-color:var(--primary);bottom:-2px;position:absolute;right:-2px;pointer-events:none;top:0;width:5px}.ProseMirror table p{margin:0}.tableWrapper{overflow-x:auto}.resize-cursor{cursor:ew-resize;cursor:col-resize}.drop-cursor{background-color:var(--text)!important}.search-result.selected{background-color:var(--dimPrimary)!important}.search-result{background-color:var(--disabled)}.line-number-widget,.line-number:before{color:var(--codeFg);pointer-events:none;border-right:1px solid;margin-right:10px;padding-right:10px}.line-number:before{content:attr(data-line)}.line-number-widget.active,.line-number.active:before{color:var(--codeHighlight)}.line-number-widget.active:after,.line-number.active:after{content:" ";width:100%;position:absolute;left:0;pointer-events:none;background-color:var(--overlay)}pre::selection,pre ::selection{background-color:var(--codeSelection)!important;color:currentColor}.hide-scrollbar::-webkit-scrollbar{display:none}.ProseMirror blockquote{border-left:5px solid var(--border);padding-left:15px}@-webkit-keyframes blink{49%{border-color:unset}50%{border-color:#fff}99%{border-color:#fff}}@keyframes blink{49%{border-color:unset}50%{border-color:#fff}99%{border-color:#fff}}.no-cursor{caret-color:transparent}div:focus .fake-cursor,span:focus .fake-cursor{margin-right:-1px;border-left-width:1px;border-left-style:solid;-webkit-animation:blink 1s;animation:blink 1s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;position:relative;z-index:1}.math-node{min-width:1em;min-height:1em;font-size:.95em;font-family:"Consolas","Ubuntu Mono",monospace;cursor:auto}.math-node.empty-math .math-render:before{content:"(empty)";color:red}.math-node .math-render.parse-error:before{content:"(math error)";color:red;cursor:help}.math-node.ProseMirror-selectednode{outline:none}.math-node .math-src{display:none;color:var(--text);tab-size:4}.math-node.ProseMirror-selectednode .math-src{display:inline}.math-node.ProseMirror-selectednode .math-render{display:none}.math-inline{display:inline;white-space:nowrap}.math-inline .math-render{display:inline-block;cursor:pointer}.math-inline .math-src .ProseMirror{display:inline;border-right:1px solid transparent;border-left:1px solid transparent;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace!important}.math-inline.ProseMirror-selectednode{background-color:var(--bgSecondary);padding:3px;border-radius:5px;border:1px solid var(--border)}.math-inline .math-src:after,.math-inline .math-src:before{content:"$$";color:var(--disabled)}.math-block,.math-block .math-render{display:block}.math-block.ProseMirror-selectednode{background-color:var(--bgSecondary);padding:10px;border-radius:5px;border:1px solid var(--border)}.math-block .math-src .ProseMirror{width:100%;display:block;margin-top:10px;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace!important}.math-block .math-src:before{content:"Math";text-align:left;color:var(--disabled);margin-bottom:10px}.math-block .katex-display{margin:0} \ No newline at end of file diff --git a/apps/mobile/web.bundle/static/js/3.cdfcd3a9.chunk.js b/apps/mobile/web.bundle/static/js/3.08bb4dc3.chunk.js similarity index 64% rename from apps/mobile/web.bundle/static/js/3.cdfcd3a9.chunk.js rename to apps/mobile/web.bundle/static/js/3.08bb4dc3.chunk.js index 47263ac42..26fd2a0a9 100644 --- a/apps/mobile/web.bundle/static/js/3.cdfcd3a9.chunk.js +++ b/apps/mobile/web.bundle/static/js/3.08bb4dc3.chunk.js @@ -1,2 +1,2 @@ -/*! For license information please see 3.cdfcd3a9.chunk.js.LICENSE.txt */ -(this.webpackJsonptiptap=this.webpackJsonptiptap||[]).push([[3],[function(e,t,n){"use strict";e.exports=n(85)},function(e,t,n){"use strict";e.exports=n(79)},function(e,t,n){"use strict";n.r(t),n.d(t,"AllSelection",(function(){return w})),n.d(t,"EditorState",(function(){return E})),n.d(t,"NodeSelection",(function(){return y})),n.d(t,"Plugin",(function(){return T})),n.d(t,"PluginKey",(function(){return P})),n.d(t,"Selection",(function(){return f})),n.d(t,"SelectionRange",(function(){return p})),n.d(t,"TextSelection",(function(){return v})),n.d(t,"Transaction",(function(){return S}));var r=n(13),o=n(12),i=n(10),a=n(11),s=n(4),l=n(5),u=n(3),c=n(8),d=Object.create(null),f=function(){function e(t,n,r){Object(s.a)(this,e),this.$anchor=t,this.$head=n,this.ranges=r||[new p(t.min(n),t.max(n))]}return Object(l.a)(e,[{key:"anchor",get:function(){return this.$anchor.pos}},{key:"head",get:function(){return this.$head.pos}},{key:"from",get:function(){return this.$from.pos}},{key:"to",get:function(){return this.$to.pos}},{key:"$from",get:function(){return this.ranges[0].$from}},{key:"$to",get:function(){return this.ranges[0].$to}},{key:"empty",get:function(){for(var e=this.ranges,t=0;t1&&void 0!==arguments[1]?arguments[1]:u.Slice.empty,n=t.content.lastChild,r=null,o=0;o2&&void 0!==arguments[2]&&arguments[2],r=e.parent.inlineContent?new v(e):x(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(var o=e.depth-1;o>=0;o--){var i=t<0?x(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):x(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(i)return i}return null}},{key:"near",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.findFrom(e,t)||this.findFrom(e,-t)||new w(e.node(0))}},{key:"atStart",value:function(e){return x(e,e,0,0,1)||new w(e)}},{key:"atEnd",value:function(e){return x(e,e,e.content.size,e.childCount,-1)||new w(e)}},{key:"fromJSON",value:function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=d[t.type];if(!n)throw new RangeError("No selection type ".concat(t.type," defined"));return n.fromJSON(e,t)}},{key:"jsonID",value:function(e,t){if(e in d)throw new RangeError("Duplicate use of selection JSON ID "+e);return d[e]=t,t.prototype.jsonID=e,t}}]),e}();f.prototype.visible=!0;var p=Object(l.a)((function e(t,n){Object(s.a)(this,e),this.$from=t,this.$to=n})),h=!1;function m(e){h||e.parent.inlineContent||(h=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}var v=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return Object(s.a)(this,n),m(e),m(r),t.call(this,e,r)}return Object(l.a)(n,[{key:"$cursor",get:function(){return this.$anchor.pos==this.$head.pos?this.$head:null}},{key:"map",value:function(e,t){var r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return f.near(r);var o=e.resolve(t.map(this.anchor));return new n(o.parent.inlineContent?o:r,r)}},{key:"replace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.Slice.empty;if(Object(r.a)(Object(o.a)(n.prototype),"replace",this).call(this,e,t),t==u.Slice.empty){var i=this.$from.marksAcross(this.$to);i&&e.ensureMarks(i)}}},{key:"eq",value:function(e){return e instanceof n&&e.anchor==this.anchor&&e.head==this.head}},{key:"getBookmark",value:function(){return new g(this.anchor,this.head)}},{key:"toJSON",value:function(){return{type:"text",anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new n(e.resolve(t.anchor),e.resolve(t.head))}},{key:"create",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}},{key:"between",value:function(e,t,r){var o=e.pos-t.pos;if(r&&!o||(r=o>=0?1:-1),!t.parent.inlineContent){var i=f.findFrom(t,r,!0)||f.findFrom(t,-r,!0);if(!i)return f.near(t,r);t=i.$head}return e.parent.inlineContent||(0==o||(e=(f.findFrom(e,-r,!0)||f.findFrom(e,r,!0)).$anchor).pos1&&void 0!==arguments[1]?arguments[1]:u.Slice.empty;if(t==u.Slice.empty){e.delete(0,e.doc.content.size);var i=f.atStart(e.doc);i.eq(e.selection)||e.setSelection(i)}else Object(r.a)(Object(o.a)(n.prototype),"replace",this).call(this,e,t)}},{key:"toJSON",value:function(){return{type:"all"}}},{key:"map",value:function(e){return new n(e)}},{key:"eq",value:function(e){return e instanceof n}},{key:"getBookmark",value:function(){return k}}],[{key:"fromJSON",value:function(e){return new n(e)}}]),n}(f);f.jsonID("all",w);var k={map:function(){return this},resolve:function(e){return new w(e)}};function x(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(t.inlineContent)return v.create(e,n);for(var a=r-(o>0?0:1);o>0?a=0;a+=o){var s=t.child(a);if(s.isAtom){if(!i&&y.isSelectable(s))return y.create(e,n-(o<0?s.nodeSize:0))}else{var l=x(e,s,n+o,o<0?s.childCount:0,o,i);if(l)return l}n+=s.nodeSize*o}return null}function O(e,t,n){var r=e.steps.length-1;if(!(r0}},{key:"setStoredMarks",value:function(e){return this.storedMarks=e,this.updated|=2,this}},{key:"ensureMarks",value:function(e){return u.Mark.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}},{key:"addStoredMark",value:function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}},{key:"removeStoredMark",value:function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}},{key:"storedMarksSet",get:function(){return(2&this.updated)>0}},{key:"addStep",value:function(e,t){Object(r.a)(Object(o.a)(n.prototype),"addStep",this).call(this,e,t),this.updated=-3&this.updated,this.storedMarks=null}},{key:"setTime",value:function(e){return this.time=e,this}},{key:"replaceSelection",value:function(e){return this.selection.replace(this,e),this}},{key:"replaceSelectionWith",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||u.Mark.none))),n.replaceWith(this,e),this}},{key:"deleteSelection",value:function(){return this.selection.replace(this),this}},{key:"insertText",value:function(e,t,n){var r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(t);o=n==t?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(f.near(this.selection.$to)),this}},{key:"setMeta",value:function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}},{key:"getMeta",value:function(e){return this.meta["string"==typeof e?e:e.key]}},{key:"isGeneric",get:function(){for(var e in this.meta)return!1;return!0}},{key:"scrollIntoView",value:function(){return this.updated|=4,this}},{key:"scrolledIntoView",get:function(){return(4&this.updated)>0}}]),n}(c.e);function C(e,t){return t&&e?e.bind(t):e}var j=Object(l.a)((function e(t,n,r){Object(s.a)(this,e),this.name=t,this.init=C(n.init,r),this.apply=C(n.apply,r)})),D=[new j("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new j("selection",{init:function(e,t){return e.selection||f.atStart(t.doc)},apply:function(e){return e.selection}}),new j("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new j("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],A=Object(l.a)((function e(t,n){var r=this;Object(s.a)(this,e),this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=D.slice(),n&&n.forEach((function(e){if(r.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");r.plugins.push(e),r.pluginsByKey[e.key]=e,e.spec.state&&r.fields.push(new j(e.key,e.spec.state,e))}))})),E=function(){function e(t){Object(s.a)(this,e),this.config=t}return Object(l.a)(e,[{key:"schema",get:function(){return this.config.schema}},{key:"plugins",get:function(){return this.config.plugins}},{key:"apply",value:function(e){return this.applyTransaction(e).state}},{key:"filterTransaction",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0;n0&&void 0!==arguments[0]?arguments[0]:"key";Object(s.a)(this,e),this.key=N(t)}return Object(l.a)(e,[{key:"get",value:function(e){return e.config.pluginsByKey[this.key]}},{key:"getState",value:function(e){return e[this.key]}}]),e}()},function(e,t,n){"use strict";n.r(t),n.d(t,"ContentMatch",(function(){return _})),n.d(t,"DOMParser",(function(){return oe})),n.d(t,"DOMSerializer",(function(){return he})),n.d(t,"Fragment",(function(){return h})),n.d(t,"Mark",(function(){return y})),n.d(t,"MarkType",(function(){return te})),n.d(t,"Node",(function(){return V})),n.d(t,"NodeRange",(function(){return H})),n.d(t,"NodeType",(function(){return Q})),n.d(t,"ReplaceError",(function(){return b})),n.d(t,"ResolvedPos",(function(){return L})),n.d(t,"Schema",(function(){return ne})),n.d(t,"Slice",(function(){return w}));var r=n(13),o=n(12),i=n(10),a=n(11),s=n(48),l=n(4),u=n(5);function c(e){this.content=e}c.prototype={constructor:c,find:function(e){for(var t=0;t>1}},c.from=function(e){if(e instanceof c)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new c(t)};var d=c;function f(e,t,n){for(var r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;var o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(var a=0;o.text[a]==i.text[a];a++)n++;return n}if(o.content.size||i.content.size){var s=f(o.content,i.content,n+1);if(null!=s)return s}n+=o.nodeSize}else n+=o.nodeSize}}function p(e,t,n,r){for(var o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};var a=e.child(--o),s=t.child(--i),l=a.nodeSize;if(a!=s){if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){for(var u=0,c=Math.min(a.text.length,s.text.length);u3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0,i=0,a=0;ae&&!1!==n(s,r+a,o||null,i)&&s.content.size){var u=a+1;s.nodesBetween(Math.max(0,e-u),Math.min(s.content.size,t-u),n,r+u)}a=l}}},{key:"descendants",value:function(e){this.nodesBetween(0,this.size,e)}},{key:"textBetween",value:function(e,t,n,r){var o="",i=!0;return this.nodesBetween(e,t,(function(a,s){a.isText?(o+=a.text.slice(Math.max(e,s)-s,t-s),i=!n):a.isLeaf?(r?o+="function"===typeof r?r(a):r:a.type.spec.leafText&&(o+=a.type.spec.leafText(a)),i=!n):!i&&a.isBlock&&(o+=n,i=!0)}),0),o}},{key:"append",value:function(t){if(!t.size)return this;if(!this.size)return t;var n=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==t&&n==this.size)return this;var r=[],o=0;if(n>t)for(var i=0,a=0;at&&((an)&&(s=s.isText?s.cut(Math.max(0,t-a),Math.min(s.text.length,n-a)):s.cut(Math.max(0,t-a-1),Math.min(s.content.size,n-a-1))),r.push(s),o+=s.nodeSize),a=l}return new e(r,o)}},{key:"cutByIndex",value:function(t,n){return t==n?e.empty:0==t&&n==this.content.length?this:new e(this.content.slice(t,n))}},{key:"replaceChild",value:function(t,n){var r=this.content[t];if(r==n)return this;var o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[t]=n,new e(o,i)}},{key:"addToStart",value:function(t){return new e([t].concat(this.content),this.size+t.nodeSize)}},{key:"addToEnd",value:function(t){return new e(this.content.concat(t),this.size+t.nodeSize)}},{key:"eq",value:function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:0;return f(this,e,t)}},{key:"findDiffEnd",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.size;return p(this,e,t,n)}},{key:"findIndex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==e)return v(0,e);if(e==this.size)return v(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position ".concat(e," outside of fragment (").concat(this,")"));for(var n=0,r=0;;n++){var o=this.child(n),i=r+o.nodeSize;if(i>=e)return i==e||t>0?v(n+1,i):v(n,r);r=i}}},{key:"toString",value:function(){return"<"+this.toStringInner()+">"}},{key:"toStringInner",value:function(){return this.content.join(", ")}},{key:"toJSON",value:function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new e(n.map(t.nodeFromJSON))}},{key:"fromArray",value:function(t){if(!t.length)return e.empty;for(var n,r=0,o=0;othis.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t}},{key:"removeFromSet",value:function(e){for(var t=0;t0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;var r=n.openStart||0,o=n.openEnd||0;if("number"!=typeof r||"number"!=typeof o)throw new RangeError("Invalid input for Slice.fromJSON");return new e(h.fromJSON(t,n.content),r,o)}},{key:"maxOpen",value:function(t){for(var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=0,o=0,i=t.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(var a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)o++;return new e(t,r,o)}}]),e}();function k(e,t,n){var r=e.findIndex(t),o=r.index,i=r.offset,a=e.maybeChild(o),s=e.findIndex(n),l=s.index,u=s.offset;if(i==t||a.isText){if(u!=n&&!e.child(l).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(o!=l)throw new RangeError("Removing non-flat range");return e.replaceChild(o,a.copy(k(a.content,t-i-1,n-i-1)))}function x(e,t,n,r){var o=e.findIndex(t),i=o.index,a=o.offset,s=e.maybeChild(i);if(a==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));var l=x(s.content,t-a-1,n);return l&&e.replaceChild(i,s.copy(l))}function O(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 S(e,t,n,0)}function S(e,t,n,r){var o=e.index(r),i=e.node(r);if(o==t.index(r)&&r=0;o--)r=t.node(o).copy(h.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return E(i,M(e,s.start,s.end,t,r))}var l=e.parent,u=l.content;return E(l,u.cut(0,e.parentOffset).append(n.content).append(u.cut(t.parentOffset)))}return E(i,T(e,t,r))}function C(e,t){if(!t.type.compatibleContent(e.type))throw new b("Cannot join "+t.type.name+" onto "+e.type.name)}function j(e,t,n){var r=e.node(n);return C(r,t.node(n)),r}function D(e,t){var 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 A(e,t,n,r){var o=(t||e).node(n),i=0,a=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(D(e.nodeAfter,r),i++));for(var s=i;so&&j(e,t,o+1),a=r.depth>o&&j(n,r,o+1),s=[];return A(null,e,o,s),i&&a&&t.index(o)==n.index(o)?(C(i,a),D(E(i,M(e,t,n,r,o+1)),s)):(i&&D(E(i,T(e,t,o+1)),s),A(t,n,o,s),a&&D(E(a,T(n,r,o+1)),s)),A(r,null,o,s),new h(s)}function T(e,t,n){var r=[];(A(null,e,n,r),e.depth>n)&&D(E(j(e,t,n+1),T(e,t,n+1)),r);return A(t,null,n,r),new h(r)}w.empty=new w(h.empty,0,0);var L=function(){function e(t,n,r){Object(l.a)(this,e),this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}return Object(u.a)(e,[{key:"resolveDepth",value:function(e){return null==e?this.depth:e<0?this.depth+e:e}},{key:"parent",get:function(){return this.node(this.depth)}},{key:"doc",get:function(){return this.node(0)}},{key:"node",value:function(e){return this.path[3*this.resolveDepth(e)]}},{key:"index",value:function(e){return this.path[3*this.resolveDepth(e)+1]}},{key:"indexAfter",value:function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}},{key:"start",value:function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}},{key:"end",value:function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}},{key:"before",value:function(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]}},{key:"after",value:function(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}},{key:"textOffset",get:function(){return this.pos-this.path[this.path.length-1]}},{key:"nodeAfter",get:function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}},{key:"nodeBefore",get:function(){var 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)}},{key:"posAtIndex",value:function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1,o=0;o0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}},{key:"blockRange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,t=arguments.length>1?arguments[1]:void 0;if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new H(this,e,n);return null}},{key:"sameParent",value:function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}},{key:"max",value:function(e){return e.pos>this.pos?e:this}},{key:"min",value:function(e){return e.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");for(var r=[],o=0,i=n,a=t;;){var s=a.content.findIndex(i),l=s.index,u=s.offset,c=i-u;if(r.push(a,l,o+u),!c)break;if((a=a.child(l)).isText)break;i=c-1,o+=u+1}return new e(n,r,i)}},{key:"resolveCached",value:function(t,n){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:y.none;Object(l.a)(this,e),this.type=t,this.attrs=n,this.marks=o,this.content=r||h.empty}return Object(u.a)(e,[{key:"nodeSize",get:function(){return this.isLeaf?1:2+this.content.size}},{key:"childCount",get:function(){return this.content.childCount}},{key:"child",value:function(e){return this.content.child(e)}},{key:"maybeChild",value:function(e){return this.content.maybeChild(e)}},{key:"forEach",value:function(e){this.content.forEach(e)}},{key:"nodesBetween",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(e,t,n,r,this)}},{key:"descendants",value:function(e){this.nodesBetween(0,this.content.size,e)}},{key:"textContent",get:function(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}},{key:"textBetween",value:function(e,t,n,r){return this.content.textBetween(e,t,n,r)}},{key:"firstChild",get:function(){return this.content.firstChild}},{key:"lastChild",get:function(){return this.content.lastChild}},{key:"eq",value:function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}},{key:"sameMarkup",value:function(e){return this.hasMarkup(e.type,e.attrs,e.marks)}},{key:"hasMarkup",value:function(e,t,n){return this.type==e&&g(this.attrs,t||e.defaultAttrs||F)&&y.sameSet(this.marks,n||y.none)}},{key:"copy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}},{key:"mark",value:function(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}},{key:"cut",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e==t)return w.empty;var r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),a=r.start(i),s=r.node(i),l=s.content.cut(r.pos-a,o.pos-a);return new w(l,r.depth-i,o.depth-i)}},{key:"replace",value:function(e,t,n){return O(this.resolve(e),this.resolve(t),n)}},{key:"nodeAt",value:function(e){for(var t=this;;){var n=t.content.findIndex(e),r=n.index,o=n.offset;if(!(t=t.maybeChild(r)))return null;if(o==e||t.isText)return t;e-=o+1}}},{key:"childAfter",value:function(e){var t=this.content.findIndex(e),n=t.index,r=t.offset;return{node:this.content.maybeChild(n),index:n,offset:r}}},{key:"childBefore",value:function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,r=t.offset;if(re&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.marks)&&(r=!0),!r})),r}},{key:"isBlock",get:function(){return this.type.isBlock}},{key:"isTextblock",get:function(){return this.type.isTextblock}},{key:"inlineContent",get:function(){return this.type.inlineContent}},{key:"isInline",get:function(){return this.type.isInline}},{key:"isText",get:function(){return this.type.isText}},{key:"isLeaf",get:function(){return this.type.isLeaf}},{key:"isAtom",get:function(){return this.type.isAtom}},{key:"toString",value:function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),B(this.marks,e)}},{key:"contentMatchAt",value:function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}},{key:"canReplace",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h.empty,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n.childCount,i=this.contentMatchAt(e).matchFragment(n,r,o),a=i&&i.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(var s=r;s0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.text.length;return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}},{key:"eq",value:function(e){return this.sameMarkup(e)&&this.text==e.text}},{key:"toJSON",value:function(){var e=Object(r.a)(Object(o.a)(n.prototype),"toJSON",this).call(this);return e.text=this.text,e}}]),n}(V);function B(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var _=function(){function e(t){Object(l.a)(this,e),this.validEnd=t,this.next=[],this.wrapCache=[]}return Object(u.a)(e,[{key:"matchType",value:function(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.childCount,r=this,o=t;r&&o1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=[this];function o(i,a){var s=i.matchFragment(e,n);if(s&&(!t||s.validEnd))return h.from(a.map((function(e){return e.createAndFill()})));for(var l=0;l=this.next.length)throw new RangeError("There's no ".concat(e,"th edge in this content match"));return this.next[e]}},{key:"toString",value:function(){var e=[];return function t(n){e.push(n);for(var r=0;r"+e.indexOf(t.next[o].next);return r})).join("\n")}}],[{key:"parse",value:function(t,n){var r=new I(t,n);if(null==r.next)return e.empty;var o=$(r);r.next&&r.err("Unexpected trailing text");var i=function(e){var t=Object.create(null);return n(J(e,0));function n(r){var o=[];r.forEach((function(t){e[t].forEach((function(t){var n=t.term,r=t.to;if(n){for(var i,a=0;a-1),a=0;a-1&&o.push(a)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map((function(t){return 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==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)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=K(e,t)}return t}function U(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function K(e,t){var n=U(e),r=n;return e.eat(",")&&(r="}"!=e.next?U(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function G(e,t){return t-e}function J(e,t){var n=[];return function t(r){var o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new V(this,this.computeAttrs(e),h.from(t),y.setFrom(n))}},{key:"createChecked",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(t=h.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new V(this,this.computeAttrs(e),t,y.setFrom(n))}},{key:"createAndFill",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(e=this.computeAttrs(e),(t=h.from(t)).size){var r=this.contentMatch.fillBefore(t);if(!r)return null;t=r.append(t)}var o=this.contentMatch.matchFragment(t),i=o&&o.fillBefore(h.empty,!0);return i?new V(this,e,t.append(i),y.setFrom(n)):null}},{key:"validContent",value:function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var n=0;n-1}},{key:"allowsMarks",value:function(e){if(null==this.markSet)return!0;for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:null;return!e&&this.instance?this.instance:new y(this,X(this.attrs,e))}},{key:"removeFromSet",value:function(e){for(var t=0;t-1}}],[{key:"compile",value:function(t,n){var r=Object.create(null),o=0;return t.forEach((function(t,i){return r[t]=new e(t,o++,n,i)})),r}}]),e}(),ne=function(){function e(t){Object(l.a)(this,e),this.cached=Object.create(null),this.spec={nodes:d.from(t.nodes),marks:d.from(t.marks||{}),topNode:t.topNode},this.nodes=Q.compile(this.spec.nodes,this),this.marks=te.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var o=this.nodes[r],i=o.spec.content||"",a=o.spec.marks;o.contentMatch=n[i]||(n[i]=_.parse(i,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet="_"==a?null:a?re(this,a.split(" ")):""!=a&&o.inlineContent?null:[]}for(var s in this.marks){var u=this.marks[s],c=u.spec.excludes;u.excluded=null==c?[u]:""==c?[]:re(this,c.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)}return Object(u.a)(e,[{key:"node",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof Q))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}},{key:"text",value:function(e,t){var n=this.nodes.text;return new z(n,n.defaultAttrs,e,y.setFrom(t))}},{key:"mark",value:function(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}},{key:"nodeFromJSON",value:function(e){return V.fromJSON(this,e)}},{key:"markFromJSON",value:function(e){return y.fromJSON(this,e)}},{key:"nodeType",value:function(e){var t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}]),e}();function re(e,t){for(var n=[],r=0;r-1)&&n.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}var oe=function(){function e(t,n){var r=this;Object(l.a)(this,e),this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach((function(e){e.tag?r.tags.push(e):e.style&&r.styles.push(e)})),this.normalizeLists=!this.tags.some((function(e){if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;var n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}return Object(u.a)(e,[{key:"parse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new ce(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}},{key:"parseSlice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new ce(this,t,!0);return n.addAll(e,t.from,t.to),w.maxOpen(n.finish())}},{key:"matchTag",value:function(e,t,n){for(var r=n?this.tags.indexOf(n)+1:0;re.length&&(61!=a.charCodeAt(e.length)||a.slice(e.length+1)!=t))){if(i.getAttrs){var s=i.getAttrs(t);if(!1===s)continue;i.attrs=s||void 0}return i}}}}],[{key:"schemaRules",value:function(e){var t=[];function n(e){for(var n=null==e.priority?50:e.priority,r=0;r=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}},{key:"applyPending",value:function(e){for(var t=0,n=this.pendingMarks;t=0;r--){var o=this.nodes[r],i=o.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=o,!i.length))break;if(o.solid)break}if(!t)return!1;this.sync(n);for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;this.closeExtra();var o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);var i=le(e,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new ue(e,t,o.activeMarks,o.pendingMarks,n,null,i)),this.open++}},{key:"closeExtra",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],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}}},{key:"finish",value:function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}},{key:"sync",value:function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}},{key:"currentPos",get:function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,r=n.length-1;r>=0;r--)e+=n[r].nodeSize;t&&e++}return e}},{key:"findAtPoint",value:function(e,t){if(this.find)for(var n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1);return function e(a,s){for(;a>=0;a--){var l=n[a];if(""==l){if(a==n.length-1||0==a)continue;for(;s>=i;s--)if(e(a-1,s))return!0;return!1}var u=s>0||0==s&&o?t.nodes[s].type:r&&s>=i?r.node(s-i).type:null;if(!u||u.name!=l&&-1==u.groups.indexOf(l))return!1;s--}return!0}(n.length-1,this.open)}},{key:"textblockFromContext",value:function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}}},{key:"addPendingMark",value:function(e){var t=function(e,t){for(var n=0;n=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);var o=r.popFromStashMark(e);o&&r.type&&r.type.allowsMarkType(o.type)&&(r.activeMarks=o.addToSet(r.activeMarks))}if(r==t)break}}}]),e}();function de(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function fe(e){var t={};for(var n in e)t[n]=e[n];return t}function pe(e,t){var n=t.schema.nodes,r=function(r){var o=n[r];if(!o.allowsMarkType(e))return"continue";var i=[];return function e(n){i.push(n);for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;r||(r=ve(n).createDocumentFragment());var o=r,i=[];return e.forEach((function(e){if(i.length||e.marks.length){for(var r=0,a=0;r1&&void 0!==arguments[1]?arguments[1]:{},n=this.serializeNodeInner(e,t),r=e.marks.length-1;r>=0;r--){var o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}},{key:"serializeMark",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=this.marks[t.type.name];return o&&e.renderSpec(ve(r),o(t,n))}}],[{key:"renderSpec",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("string"==typeof n)return{dom:t.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;var o,i=n[0],a=i.indexOf(" ");a>0&&(r=i.slice(0,a),i=i.slice(a+1));var s=r?t.createElementNS(r,i):t.createElement(i),l=n[1],u=1;if(l&&"object"==typeof l&&null==l.nodeType&&!Array.isArray(l))for(var c in u=2,l)if(null!=l[c]){var d=c.indexOf(" ");d>0?s.setAttributeNS(c.slice(0,d),c.slice(d+1),l[c]):s.setAttribute(c,l[c])}for(var f=u;fu)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var h=e.renderSpec(t,p,r),m=h.dom,v=h.contentDOM;if(s.appendChild(m),v){if(o)throw new RangeError("Multiple content holes");o=v}}return{dom:s,contentDOM:o}}},{key:"fromSchema",value:function(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}},{key:"nodesFromSchema",value:function(e){var t=me(e.nodes);return t.text||(t.text=function(e){return e.text}),t}},{key:"marksFromSchema",value:function(e){return me(e.marks)}}]),e}();function me(e){var t={};for(var n in e){var r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function ve(e){return e.document||window.document}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n0}},{key:"deletedBefore",get:function(){return(5&this.delInfo)>0}},{key:"deletedAfter",get:function(){return(6&this.delInfo)>0}},{key:"deletedAcross",get:function(){return(4&this.delInfo)>0}}]),e}(),f=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Object(a.a)(this,e),this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}return Object(s.a)(e,[{key:"recover",value:function(e){var t=0,n=c(e);if(!this.inverted)for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!1)}},{key:"map",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!0)}},{key:"_map",value:function(e,t,n){for(var r=0,o=this.inverted?2:1,i=this.inverted?1:2,a=0;ae)break;var l=this.ranges[a+o],c=this.ranges[a+i],f=s+l;if(e<=f){var p=s+r+((l?e==s?-1:e==f?1:t:t)<0?0:c);if(n)return p;var h=e==(t<0?s:f)?null:a/3+(e-s)*u,m=e==s?2:e==f?1:4;return(t<0?e!=s:e!=f)&&(m|=8),new d(p,m,h)}r+=c-l}return n?e+r:new d(e+r,0,null)}},{key:"touches",value:function(e,t){for(var n=0,r=c(t),o=this.inverted?2:1,i=this.inverted?1:2,a=0;ae)break;var l=this.ranges[a+o];if(e<=s+l&&a==3*r)return!0;n+=this.ranges[a+i]-l}return!1}},{key:"forEach",value:function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length;Object(a.a)(this,e),this.maps=t,this.mirror=n,this.from=r,this.to=o}return Object(s.a)(e,[{key:"slice",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.maps.length;return new e(this.maps,this.mirror,t,n)}},{key:"copy",value:function(){return new e(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}},{key:"appendMap",value:function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}},{key:"appendMapping",value:function(e){for(var t=0,n=this.maps.length;t=0;t--){var r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}},{key:"invert",value:function(){var t=new e;return t.appendMappingInverted(this),t}},{key:"map",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.mirror)return this._map(e,t,!0);for(var n=this.from;n1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!1)}},{key:"_map",value:function(e,t,n){for(var r=0,o=this.from;oo&&a=r.pos?null:new n(t.pos,r.pos,this.mark)}},{key:"merge",value:function(e){return e instanceof n&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new n(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new n(t.from,t.to,e.markFromJSON(t.mark))}}]),n}(m);m.jsonID("addMark",y);var b=function(e){Object(o.a)(n,e);var t=Object(i.a)(n);function n(e,r,o){var i;return Object(a.a)(this,n),(i=t.call(this)).from=e,i.to=r,i.mark=o,i}return Object(s.a)(n,[{key:"apply",value:function(e){var t=this,n=e.slice(this.from,this.to),r=new l.Slice(g(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))}),e),n.openStart,n.openEnd);return v.fromReplace(e,this.from,this.to,r)}},{key:"invert",value:function(){return new y(this.from,this.to,this.mark)}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new n(t.pos,r.pos,this.mark)}},{key:"merge",value:function(e){return e instanceof n&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new n(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new n(t.from,t.to,e.markFromJSON(t.mark))}}]),n}(m);m.jsonID("removeMark",b);var w=function(e){Object(o.a)(n,e);var t=Object(i.a)(n);function n(e,r,o){var i,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object(a.a)(this,n),(i=t.call(this)).from=e,i.to=r,i.slice=o,i.structure=s,i}return Object(s.a)(n,[{key:"apply",value:function(e){return this.structure&&x(e,this.from,this.to)?v.fail("Structure replace would overwrite content"):v.fromReplace(e,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new f([this.from,this.to-this.from,this.slice.size])}},{key:"invert",value:function(e){return new n(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new n(t.pos,Math.max(t.pos,r.pos),this.slice)}},{key:"merge",value:function(e){if(!(e instanceof n)||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;var t=this.slice.size+e.slice.size==0?l.Slice.empty:new l.Slice(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new n(e.from,this.to,t,this.structure)}var r=this.slice.size+e.slice.size==0?l.Slice.empty:new l.Slice(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new n(this.from,this.to+(e.to-e.from),r,this.structure)}},{key:"toJSON",value:function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new n(t.from,t.to,l.Slice.fromJSON(e,t.slice),!!t.structure)}}]),n}(m);m.jsonID("replace",w);var k=function(e){Object(o.a)(n,e);var t=Object(i.a)(n);function n(e,r,o,i,s,l){var u,c=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return Object(a.a)(this,n),(u=t.call(this)).from=e,u.to=r,u.gapFrom=o,u.gapTo=i,u.slice=s,u.insert=l,u.structure=c,u}return Object(s.a)(n,[{key:"apply",value:function(e){if(this.structure&&(x(e,this.from,this.gapFrom)||x(e,this.gapTo,this.to)))return v.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return v.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?v.fromReplace(e,this.from,this.to,n):v.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new f([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}},{key:"invert",value:function(e){var t=this.gapTo-this.gapFrom;return new n(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)}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||or.pos?null:new n(t.pos,r.pos,o,i,this.slice,this.insert,this.structure)}},{key:"toJSON",value:function(){var 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}}],[{key:"fromJSON",value:function(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 n(t.from,t.to,t.gapFrom,t.gapTo,l.Slice.fromJSON(e,t.slice),t.insert,!!t.structure)}}]),n}(m);function x(e,t,n){for(var r=e.resolve(t),o=n-t,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var a=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}return!1}function O(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function S(e){for(var t=e.parent.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(n2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,o=D(e,t),i=o&&A(r,t);return i?o.map(j).concat({type:t,attrs:n}).concat(i.map(j)):null}function j(e){return{type:e,attrs:null}}function D(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;var a=i.length?i[0]:t;return n.canReplaceWith(r,o,a)?i:null}function A(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.child(r),a=t.contentMatch.findWrapping(i.type);if(!a)return null;for(var s=(a.length?a[a.length-1]:t).contentMatch,l=r;s&&l2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,o=e.resolve(t),i=o.depth-n,a=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var s=o.depth-1,l=n-2;s>i;s--,l--){var u=o.node(s),c=o.index(s);if(u.type.spec.isolating)return!1;var d=u.content.cutByIndex(c,u.childCount),f=r&&r[l]||u;if(f!=u&&(d=d.replaceChild(0,f.type.create(f.attrs))),!u.canReplace(c+1,u.childCount)||!f.type.validContent(d))return!1}var p=o.indexAfter(i),h=r&&r[0];return o.node(i).canReplaceWith(p,p,h?h.type:o.node(i+1).type)}function L(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,o=e.doc.resolve(t),i=l.Fragment.empty,a=l.Fragment.empty,s=o.depth,u=o.depth-n,c=n-1;s>u;s--,c--){i=l.Fragment.from(o.node(s).copy(i));var d=r&&r[c];a=l.Fragment.from(d?d.type.create(d.attrs,a):o.node(s).copy(a))}e.step(new w(t,t,new l.Slice(i.append(a),n,n),!0))}function N(e,t){var n=e.resolve(t),r=n.index();return P(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function P(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function R(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=e.resolve(t),o=r.depth;;o--){var i=void 0,a=void 0,s=r.index(o);if(o==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(o+1),s++,a=r.node(o).maybeChild(s)):(i=r.node(o).maybeChild(s-1),a=r.node(o+1)),i&&!i.isTextblock&&P(i,a)&&r.node(o).canReplace(s,s+1))return t;if(0==o)break;t=n<0?r.before(o):r.after(o)}}function H(e,t,n){var r=new w(t-n,t+n,l.Slice.empty,!0);e.step(r)}function F(e,t,n){var r=e.resolve(t);if(!n.content.size)return t;for(var o=n.content,i=0;i=0;s--){var l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,u=r.index(s)+(l>0?1:0),c=r.node(s),d=!1;if(1==a)d=c.canReplace(u,u,o);else{var f=c.contentMatchAt(u).findWrapping(o.firstChild.type);d=f&&c.canReplaceWith(u,u,f[0])}if(d)return 0==l?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function V(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.Slice.empty;if(t==n&&!r.size)return null;var o=e.resolve(t),i=e.resolve(n);return z(o,i,r)?new w(t,n,r):new B(o,i,r).fit()}function z(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}m.jsonID("replaceAround",k);var B=function(){function e(t,n,r){Object(a.a)(this,e),this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=l.Fragment.empty;for(var o=0;o<=t.depth;o++){var i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(var s=t.depth;s>0;s--)this.placed=l.Fragment.from(t.node(s).copy(this.placed))}return Object(s.a)(e,[{key:"depth",get:function(){return this.frontier.length-1}},{key:"fit",value:function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(t<0?this.$to:r.doc.resolve(t));if(!o)return null;for(var i=this.placed,a=r.depth,s=o.depth;a&&s&&1==i.childCount;)i=i.firstChild.content,a--,s--;var u=new l.Slice(i,a,s);return t>-1?new k(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new w(r.pos,o.pos,u):null}},{key:"findFittable",value:function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var n=null,r=(t?(n=$(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,o=this.depth;o>=0;o--){var i=this.frontier[o],a=i.type,s=i.match,u=void 0,c=null;if(1==e&&(r?s.matchType(r.type)||(c=s.fillBefore(l.Fragment.from(r),!1)):n&&a.compatibleContent(n.type)))return{sliceDepth:t,frontierDepth:o,parent:n,inject:c};if(2==e&&r&&(u=s.findWrapping(r.type)))return{sliceDepth:t,frontierDepth:o,parent:n,wrap:u};if(n&&s.matchType(n.type))break}}},{key:"openMore",value:function(){var e=this.unplaced,t=e.content,n=e.openStart,r=e.openEnd,o=$(t,n);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new l.Slice(t,n+1,Math.max(r,o.size+n>=t.size-r?n+1:0)),!0)}},{key:"dropNode",value:function(){var e=this.unplaced,t=e.content,n=e.openStart,r=e.openEnd,o=$(t,n);if(o.childCount<=1&&n>0){var i=t.size-n<=n+o.size;this.unplaced=new l.Slice(_(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new l.Slice(_(t,n,1),n,r)}},{key:"placeNodes",value:function(e){for(var t=e.sliceDepth,n=e.frontierDepth,r=e.parent,o=e.inject,i=e.wrap;this.depth>n;)this.closeFrontierNode();if(i)for(var a=0;a1||0==c||g.content.size)&&(h=y,f.push(q(g.mark(m.allowedMarks(g.marks)),1==d?c:0,d==u.childCount?v:-1)))}var b=d==u.childCount;b||(v=-1),this.placed=I(this.placed,n,l.Fragment.from(f)),this.frontier[n].match=h,b&&v<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var w=0,k=u;w1&&r==this.$to.end(--n);)++r;return r}},{key:"findCloseLevel",value:function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],r=n.match,o=n.type,i=t=0;s--){var l=this.frontier[s],u=l.match,c=W(e,s,l.type,u,!0);if(!c||c.childCount)continue e}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}},{key:"close",value:function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=I(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var r=e.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,e.index(n));this.openFrontierNode(r.type,r.attrs,o)}return e}},{key:"openFrontierNode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=I(this.placed,this.depth,l.Fragment.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}},{key:"closeFrontierNode",value:function(){var e=this.frontier.pop().match.fillBefore(l.Fragment.empty,!0);e.childCount&&(this.placed=I(this.placed,this.frontier.length,e))}}]),e}();function _(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(_(e.firstChild.content,t-1,n)))}function I(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(I(e.lastChild.content,t-1,n)))}function $(e,t){for(var n=0;n1&&(r=r.replaceChild(0,q(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(l.Fragment.empty,!0)))),e.copy(r)}function W(e,t,n,r,o){var i=e.node(t),a=o?e.indexAfter(t):e.index(t);if(a==i.childCount&&!n.compatibleContent(i.type))return null;var s=r.fillBefore(i.content,!0,a);return s&&!function(e,t,n){for(var r=n;rr){var a=o.contentMatchAt(0),s=a.fillBefore(e).append(e);e=s.append(a.matchFragment(s).fillBefore(l.Fragment.empty,!0))}return e}function G(e,t){for(var n=[],r=Math.min(e.depth,t.depth);r>=0;r--){var o=e.start(r);if(ot.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}var J=Error;((J=function e(t){var n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype)).constructor=J,J.prototype.name="TransformError";var Y=function(){function e(t){Object(a.a)(this,e),this.doc=t,this.steps=[],this.docs=[],this.mapping=new p}return Object(s.a)(e,[{key:"before",get:function(){return this.docs.length?this.docs[0]:this.doc}},{key:"step",value:function(e){var t=this.maybeStep(e);if(t.failed)throw new J(t.failed);return this}},{key:"maybeStep",value:function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}},{key:"docChanged",get:function(){return this.steps.length>0}},{key:"addStep",value:function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}},{key:"replace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.Slice.empty,r=V(this.doc,e,t,n);return r&&this.step(r),this}},{key:"replaceWith",value:function(e,t,n){return this.replace(e,t,new l.Slice(l.Fragment.from(n),0,0))}},{key:"delete",value:function(e,t){return this.replace(e,t,l.Slice.empty)}},{key:"insert",value:function(e,t){return this.replaceWith(e,e,t)}},{key:"replaceRange",value:function(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);var o=e.doc.resolve(t),i=e.doc.resolve(n);if(z(o,i,r))return e.step(new w(t,n,r));var a=G(o,e.doc.resolve(n));0==a[a.length-1]&&a.pop();var s=-(o.depth+1);a.unshift(s);for(var u=o.depth,c=o.pos-1;u>0;u--,c--){var d=o.node(u).type.spec;if(d.defining||d.definingAsContext||d.isolating)break;a.indexOf(u)>-1?s=u:o.before(u)==c&&a.splice(1,0,-u)}for(var f=a.indexOf(s),p=[],h=r.openStart,m=r.content,v=0;;v++){var g=m.firstChild;if(p.push(g),v==r.openStart)break;m=g.content}for(var y=h-1;y>=0;y--){var b=p[y].type,k=U(b);if(k&&o.node(f).type!=b)h=y;else if(k||!b.isTextblock)break}for(var x=r.openStart;x>=0;x--){var O=(x+h+1)%(r.openStart+1),S=p[O];if(S)for(var C=0;C=0&&(e.replace(t,n,r),!(e.steps.length>M));T--){var L=a[T];L<0||(t=o.before(L),n=i.after(L))}}(this,e,t,n),this}},{key:"replaceRangeWith",value:function(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){var o=function(e,t,n){var r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var a=r.depth-1;a>=0;a--){var s=r.indexAfter(a);if(r.node(a).canReplaceWith(s,s,n))return r.after(a+1);if(s0&&(l||r.node(s-1).canReplace(r.index(s-1),o.indexAfter(s-1))))return e.delete(r.before(s),o.after(s))}for(var u=1;u<=r.depth&&u<=o.depth;u++)if(t-r.start(u)==r.depth-u&&n>r.end(u)&&o.end(u)-n!=o.depth-u)return e.delete(r.before(u),n);e.delete(t,n)}(this,e,t),this}},{key:"lift",value:function(e,t){return function(e,t,n){for(var r=t.$from,o=t.$to,i=t.depth,a=r.before(i+1),s=o.after(i+1),u=a,c=s,d=l.Fragment.empty,f=0,p=i,h=!1;p>n;p--)h||r.index(p)>0?(h=!0,d=l.Fragment.from(r.node(p).copy(d)),f++):u--;for(var m=l.Fragment.empty,v=0,g=i,y=!1;g>n;g--)y||o.after(g+1)1&&void 0!==arguments[1]?arguments[1]:1;return H(this,e,t),this}},{key:"wrap",value:function(e,t){return function(e,t,n){for(var r=l.Fragment.empty,o=n.length-1;o>=0;o--){if(r.size){var i=n[o].type.contentMatch.matchFragment(r);if(!i||!i.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=l.Fragment.from(n[o].type.create(n[o].attrs,r))}var a=t.start,s=t.end;e.step(new k(a,s,a,s,new l.Slice(r,0,0),n.length,!0))}(this,e,t),this}},{key:"setBlockType",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return E(this,e,t,n,r),this}},{key:"setNodeMarkup",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return M(this,e,t,n,r),this}},{key:"split",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0;return L(this,e,t,n),this}},{key:"addMark",value:function(e,t,n){return function(e,t,n,r){var o,i,a=[],s=[];e.doc.nodesBetween(t,n,(function(e,l,u){if(e.isInline){var c=e.marks;if(!r.isInSet(c)&&u.type.allowsMarkType(r.type)){for(var d=Math.max(l,t),f=Math.min(l+e.nodeSize,n),p=r.addToSet(c),h=0;h3&&void 0!==arguments[3]?arguments[3]:n.contentMatch,o=e.doc.nodeAt(t),i=[],a=t+1,s=0;s=0;h--)e.step(i[h])}(this,e,t,n),this}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(39);var o=n(36);function i(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Object(o.a)(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(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(31);function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Object(r.a)(e,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(12),o=n(43),i=n(44),a=n(17);function s(e,t){if(t&&("object"===Object(i.a)(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Object(a.a)(e)}function l(e){var t=Object(o.a)();return function(){var n,o=Object(r.a)(e);if(t){var i=Object(r.a)(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return s(this,n)}}},function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(12);function o(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(r.a)(e)););return e}function i(){return i="undefined"!==typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=o(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},i.apply(this,arguments)}},function(e,t,n){"use strict";e.exports=n(102)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(36);function o(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Object(r.a)(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}},,function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(e,t){for(var n,s,l=a(e),u=1;u1&&l.forEach((function(n){var o;r[n]=e(((o={})[n]=t[n],o))})),r},d=function(e,t,n,r,i){var a={};return r.slice(0,e.length).forEach((function(r,s){var l,u=e[s],c=t(r,n,i);u?o()(a,((l={})[u]=o()({},a[u],c),l)):o()(a,c)})),a},f=function(e,t,n,r,i){var a={};for(var l in r){var u=e[l],c=t(r[l],n,i);if(u){var d,f=s(u);o()(a,((d={})[f]=o()({},a[f],c),d))}else o()(a,c)}return a},p=function(e){var t=e.properties,n=e.property,r=e.scale,o=e.transform,i=void 0===o?l:o,a=e.defaultScale;t=t||[n];var s=function(e,n,r){var o={},a=i(e,n,r);if(null!==a)return t.forEach((function(e){o[e]=a})),o};return s.scale=r,s.defaults=a,s},h=function(e){void 0===e&&(e={});var t={};return Object.keys(e).forEach((function(n){var r=e[n];t[n]=!0!==r?"function"!==typeof r?p(r):r:p({property:n,scale:n})})),c(t)},m=function(){for(var e={},t=arguments.length,n=new Array(t),r=0;r1?e:100*e+"%")}},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},size:{properties:["width","height"],scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0}),g=v,y={color:{property:"color",scale:"colors"},backgroundColor:{property:"backgroundColor",scale:"colors"},opacity:!0};y.bg=y.backgroundColor;var b=h(y),w=b,k=h({fontFamily:{property:"fontFamily",scale:"fonts"},fontSize:{property:"fontSize",scale:"fontSizes",defaultScale:[12,14,16,20,24,32,48,64,72]},fontWeight:{property:"fontWeight",scale:"fontWeights"},lineHeight:{property:"lineHeight",scale:"lineHeights"},letterSpacing:{property:"letterSpacing",scale:"letterSpacings"},textAlign:!0,fontStyle:!0}),x=k,O=h({alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:!0,flex:!0,flexGrow:!0,flexShrink:!0,flexBasis:!0,justifySelf:!0,alignSelf:!0,order:!0}),S=O,C={space:[0,4,8,16,32,64,128,256,512]},j=h({gridGap:{property:"gridGap",scale:"space",defaultScale:C.space},gridColumnGap:{property:"gridColumnGap",scale:"space",defaultScale:C.space},gridRowGap:{property:"gridRowGap",scale:"space",defaultScale:C.space},gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridAutoRows:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0}),D=j,A={border:{property:"border",scale:"borders"},borderWidth:{property:"borderWidth",scale:"borderWidths"},borderStyle:{property:"borderStyle",scale:"borderStyles"},borderColor:{property:"borderColor",scale:"colors"},borderRadius:{property:"borderRadius",scale:"radii"},borderTop:{property:"borderTop",scale:"borders"},borderTopLeftRadius:{property:"borderTopLeftRadius",scale:"radii"},borderTopRightRadius:{property:"borderTopRightRadius",scale:"radii"},borderRight:{property:"borderRight",scale:"borders"},borderBottom:{property:"borderBottom",scale:"borders"},borderBottomLeftRadius:{property:"borderBottomLeftRadius",scale:"radii"},borderBottomRightRadius:{property:"borderBottomRightRadius",scale:"radii"},borderLeft:{property:"borderLeft",scale:"borders"},borderX:{properties:["borderLeft","borderRight"],scale:"borders"},borderY:{properties:["borderTop","borderBottom"],scale:"borders"},borderTopWidth:{property:"borderTopWidth",scale:"borderWidths"},borderTopColor:{property:"borderTopColor",scale:"colors"},borderTopStyle:{property:"borderTopStyle",scale:"borderStyles"}};A.borderTopLeftRadius={property:"borderTopLeftRadius",scale:"radii"},A.borderTopRightRadius={property:"borderTopRightRadius",scale:"radii"},A.borderBottomWidth={property:"borderBottomWidth",scale:"borderWidths"},A.borderBottomColor={property:"borderBottomColor",scale:"colors"},A.borderBottomStyle={property:"borderBottomStyle",scale:"borderStyles"},A.borderBottomLeftRadius={property:"borderBottomLeftRadius",scale:"radii"},A.borderBottomRightRadius={property:"borderBottomRightRadius",scale:"radii"},A.borderLeftWidth={property:"borderLeftWidth",scale:"borderWidths"},A.borderLeftColor={property:"borderLeftColor",scale:"colors"},A.borderLeftStyle={property:"borderLeftStyle",scale:"borderStyles"},A.borderRightWidth={property:"borderRightWidth",scale:"borderWidths"},A.borderRightColor={property:"borderRightColor",scale:"colors"},A.borderRightStyle={property:"borderRightStyle",scale:"borderStyles"};var E=h(A),M=E,T={background:!0,backgroundImage:!0,backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0};T.bgImage=T.backgroundImage,T.bgSize=T.backgroundSize,T.bgPosition=T.backgroundPosition,T.bgRepeat=T.backgroundRepeat;var L=h(T),N=L,P={space:[0,4,8,16,32,64,128,256,512]},R=h({position:!0,zIndex:{property:"zIndex",scale:"zIndices"},top:{property:"top",scale:"space",defaultScale:P.space},right:{property:"right",scale:"space",defaultScale:P.space},bottom:{property:"bottom",scale:"space",defaultScale:P.space},left:{property:"left",scale:"space",defaultScale:P.space}}),H=R,F={space:[0,4,8,16,32,64,128,256,512]},V=function(e){return"number"===typeof e&&!isNaN(e)},z=function(e,t){if(!V(e))return u(t,e,e);var n=e<0,r=Math.abs(e),o=u(t,r,r);return V(o)?o*(n?-1:1):n?"-"+o:o},B={};B.margin={margin:{property:"margin",scale:"space",transform:z,defaultScale:F.space},marginTop:{property:"marginTop",scale:"space",transform:z,defaultScale:F.space},marginRight:{property:"marginRight",scale:"space",transform:z,defaultScale:F.space},marginBottom:{property:"marginBottom",scale:"space",transform:z,defaultScale:F.space},marginLeft:{property:"marginLeft",scale:"space",transform:z,defaultScale:F.space},marginX:{properties:["marginLeft","marginRight"],scale:"space",transform:z,defaultScale:F.space},marginY:{properties:["marginTop","marginBottom"],scale:"space",transform:z,defaultScale:F.space}},B.margin.m=B.margin.margin,B.margin.mt=B.margin.marginTop,B.margin.mr=B.margin.marginRight,B.margin.mb=B.margin.marginBottom,B.margin.ml=B.margin.marginLeft,B.margin.mx=B.margin.marginX,B.margin.my=B.margin.marginY,B.padding={padding:{property:"padding",scale:"space",defaultScale:F.space},paddingTop:{property:"paddingTop",scale:"space",defaultScale:F.space},paddingRight:{property:"paddingRight",scale:"space",defaultScale:F.space},paddingBottom:{property:"paddingBottom",scale:"space",defaultScale:F.space},paddingLeft:{property:"paddingLeft",scale:"space",defaultScale:F.space},paddingX:{properties:["paddingLeft","paddingRight"],scale:"space",defaultScale:F.space},paddingY:{properties:["paddingTop","paddingBottom"],scale:"space",defaultScale:F.space}},B.padding.p=B.padding.padding,B.padding.pt=B.padding.paddingTop,B.padding.pr=B.padding.paddingRight,B.padding.pb=B.padding.paddingBottom,B.padding.pl=B.padding.paddingLeft,B.padding.px=B.padding.paddingX,B.padding.py=B.padding.paddingY;var _=h(B.margin),I=h(B.padding),$=m(_,I),q=h({boxShadow:{property:"boxShadow",scale:"shadows"},textShadow:{property:"textShadow",scale:"shadows"}}),W=q,U=n(41),K=function(e){var t,n,r=e.scale,o=e.prop,i=void 0===o?"variant":o,a=e.variants,s=void 0===a?{}:a,l=e.key;n=Object.keys(s).length?function(e,t,n){return Object(U.default)(u(t,e,null))(n.theme)}:function(e,t){return u(t,e,null)},n.scale=r||l,n.defaults=s;var d=((t={})[i]=n,t);return c(d)},G=K({key:"buttons"}),J=K({key:"textStyles",prop:"textStyle"}),Y=K({key:"colorStyles",prop:"colors"}),X=g.width,Z=g.height,Q=g.minWidth,ee=g.minHeight,te=g.maxWidth,ne=g.maxHeight,re=g.size,oe=g.verticalAlign,ie=g.display,ae=g.overflow,se=g.overflowX,le=g.overflowY,ue=w.opacity,ce=x.fontSize,de=x.fontFamily,fe=x.fontWeight,pe=x.lineHeight,he=x.textAlign,me=x.fontStyle,ve=x.letterSpacing,ge=S.alignItems,ye=S.alignContent,be=S.justifyItems,we=S.justifyContent,ke=S.flexWrap,xe=S.flexDirection,Oe=S.flex,Se=S.flexGrow,Ce=S.flexShrink,je=S.flexBasis,De=S.justifySelf,Ae=S.alignSelf,Ee=S.order,Me=D.gridGap,Te=D.gridColumnGap,Le=D.gridRowGap,Ne=D.gridColumn,Pe=D.gridRow,Re=D.gridAutoFlow,He=D.gridAutoColumns,Fe=D.gridAutoRows,Ve=D.gridTemplateColumns,ze=D.gridTemplateRows,Be=D.gridTemplateAreas,_e=D.gridArea,Ie=M.borderWidth,$e=M.borderStyle,qe=M.borderColor,We=M.borderTop,Ue=M.borderRight,Ke=M.borderBottom,Ge=M.borderLeft,Je=M.borderRadius,Ye=N.backgroundImage,Xe=N.backgroundSize,Ze=N.backgroundPosition,Qe=N.backgroundRepeat,et=H.zIndex,tt=H.top,nt=H.right,rt=H.bottom,ot=H.left,it=function(e){var t=e.prop,n=e.cssProperty,r=e.alias,o=e.key,i=e.transformValue,a=e.scale,s=e.properties,l={};return l[t]=p({properties:s,property:n||t,scale:o,defaultScale:a,transform:i}),r&&(l[r]=l[t]),c(l)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Flex=t.Box=void 0;l(n(14));var r=l(n(58)),o=n(20),i=function(e){if(e&&e.__esModule)return e;var t=s();if(t&&t.has(e))return t.get(e);var n={};if(null!=e){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}}n.default=e,t&&t.set(e,n);return n}(n(41)),a=l(n(42));function s(){if("function"!==typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function l(e){return e&&e.__esModule?e:{default:e}}var u=(0,r.default)("div",{shouldForwardProp:a.default})({boxSizing:"border-box",margin:0,minWidth:0},(function(e){return(0,i.default)(e.__css)(e.theme)}),(function(e){var t=e.theme,n=e.variant,r=e.tx,o=void 0===r?"variants":r;return(0,i.default)((0,i.get)(t,o+"."+n,(0,i.get)(t,n)))(t)}),(function(e){return(0,i.default)(e.sx)(e.theme)}),(function(e){return e.css}),(0,o.compose)(o.space,o.layout,o.typography,o.color,o.flexbox));t.Box=u;var c=(0,r.default)(u)({display:"flex"});t.Flex=c},,function(e,t,n){"use strict";e.exports=n(90)},,function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(80)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=n(3),i=function(e,t){return function(n){Array.isArray(e)||(e=[e]);for(var r=0,o=e.length;r1&&void 0!==arguments[1]?arguments[1]:1;return function(n){var o=r.Selection.findFrom(n.doc.resolve(e),t,!0);return o?n.setSelection(o):n}},l=function(e){return e.type&&e.type.spec.selectable},u=function(e,t,n){return function(e){return l(e)&&e.type.isLeaf}(e)?n.setSelection(new r.NodeSelection(n.doc.resolve(t))):s(t)(n)},c=function(e){return e instanceof r.NodeSelection},d=function(e,t){return Array.isArray(e)&&e.indexOf(t.type)>-1||t.type===e},f=function(e){return Object.assign(Object.create(e),e).setTime(Date.now())},p=function(e,t){return function(n){var r=n.doc.nodeAt(e),o=n.doc.resolve(e);if(h(o,t)){var i=(n=n.replaceWith(e,e+r.nodeSize,t)).selection.$from.pos-1;return n=s(Math.max(i,0),-1)(n),n=s(n.selection.$from.start())(n),f(n)}return n}},h=function(e,t){var n=e.node(e.depth);return n&&n.type.validContent(t instanceof o.Fragment?t:o.Fragment.from(t))},m=function(e){return function(t){var n=t.doc.nodeAt(e);return f(t.delete(e,e+n.nodeSize))}},v=function(e,t){var n=e.index();return t instanceof o.Fragment?e.parent.canReplace(n,n,t):t instanceof o.Node&&e.parent.canReplaceWith(n,n,t.type)},g=function(e){return!e||"paragraph"===e.type.name&&2===e.nodeSize},y=function(e){return function(t){var n=t.$from;return b(n,e)}},b=function(e,t){for(var n=e.depth;n>0;n--){var r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}},w=function(e,t){return function(n){var r=y(e)(n);if(r)return S(r.pos,t)}},k=function(e){return function(t){return!!y(e)(t)}},x=function(e){return function(t){return y((function(t){return d(e,t)}))(t)}},O=function(e){var t=e.$from.nodeBefore,n=r.Selection.findFrom(e.$from,-1);if(n&&t){var o=x(t.type)(n);return o?o.pos:n.$from.pos}},S=function(e,t){var n=t(e),r=n.node.childNodes[n.offset];return n.node.nodeType===Node.TEXT_NODE?n.node.parentNode:r&&r.nodeType!==Node.TEXT_NODE?r:n.node},C=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)throw new Error('Invalid "node" parameter');var n=[];return e.descendants((function(e,r){if(n.push({node:e,pos:r}),!t)return!1})),n},j=function(e,t,n){if(!e)throw new Error('Invalid "node" parameter');if(!t)throw new Error('Invalid "predicate" parameter');return C(e,n).filter((function(e){return t(e.node)}))},D=function(e,t,n){return j(e,(function(e){return e.type===t}),n)};t.isNodeSelection=c,t.canInsert=v,t.findParentNode=y,t.findParentNodeClosestToPos=b,t.findParentDomRef=w,t.hasParentNode=k,t.findParentNodeOfType=x,t.findParentNodeOfTypeClosestToPos=function(e,t){return b(e,(function(e){return d(t,e)}))},t.hasParentNodeOfType=function(e){return function(t){return k((function(t){return d(e,t)}))(t)}},t.findParentDomRefOfType=function(e,t){return function(n){return w((function(t){return d(e,t)}),t)(n)}},t.findSelectedNodeOfType=function(e){return function(t){if(c(t)){var n=t.node,r=t.$from;if(d(e,n))return{node:n,pos:r.pos,depth:r.depth}}}},t.findPositionOfNodeBefore=O,t.findDomRefAtPos=S,t.flatten=C,t.findChildren=j,t.findTextNodes=function(e,t){return j(e,(function(e){return e.isText}),t)},t.findInlineNodes=function(e,t){return j(e,(function(e){return e.isInline}),t)},t.findBlockNodes=function(e,t){return j(e,(function(e){return e.isBlock}),t)},t.findChildrenByAttr=function(e,t,n){return j(e,(function(e){return!!t(e.attrs)}),n)},t.findChildrenByType=D,t.findChildrenByMark=function(e,t,n){return j(e,(function(e){return t.isInSet(e.marks)}),n)},t.contains=function(e,t){return!!D(e,t).length},t.removeParentNodeOfType=function(e){return function(t){var n=x(e)(t.selection);return n?m(n.pos)(t):t}},t.replaceParentNodeOfType=i,t.removeSelectedNode=function(e){if(c(e.selection)){var t=e.selection.$from.pos,n=e.selection.$to.pos;return f(e.delete(t,n))}return e},t.replaceSelectedNode=a,t.setTextSelection=s,t.safeInsert=function(e,t,n){return function(r){var o="number"===typeof t,s=r.selection.$from,d=o?r.doc.resolve(t):c(r.selection)?r.doc.resolve(s.pos+1):s,p=d.parent;if(c(r.selection)&&n&&r!==(r=a(e)(r)))return r;if(g(p)&&r!==(r=i(p.type,e)(r))){var h=l(e)?d.before(d.depth):d.pos;return u(e,h,r)}if(v(d,e)){r.insert(d.pos,e);var m=o?d.pos:l(e)?r.selection.$anchor.pos-1:r.selection.$anchor.pos;return f(u(e,m,r))}for(var y=d.depth;y>0;y--){var b=d.after(y),w=r.doc.resolve(b);if(v(w,e))return r.insert(b,e),f(u(e,b,r))}return r}},t.setParentNodeMarkup=function(e,t,n,r){return function(o){var i=x(e)(o.selection);return i?f(o.setNodeMarkup(i.pos,t,Object.assign({},i.node.attrs,n),r)):o}},t.selectParentNodeOfType=function(e){return function(t){if(!c(t.selection)){var n=x(e)(t.selection);if(n)return f(t.setSelection(r.NodeSelection.create(t.doc,n.pos)))}return t}},t.removeNodeBefore=function(e){var t=O(e.selection);return"number"===typeof t?m(t)(e):e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var r=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},o={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},i=n(37),a=/[A-Z]|^ms/g,s=/_EMO_([^_]+?)_([^]*?)_EMO_/g,l=function(e){return 45===e.charCodeAt(1)},u=function(e){return null!=e&&"boolean"!==typeof e},c=Object(i.a)((function(e){return l(e)?e:e.replace(a,"-$&").toLowerCase()})),d=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(s,(function(e,t,n){return p={name:t,styles:n,next:p},t}))}return 1===o[e]||l(e)||"number"!==typeof t||0===t?t:t+"px"};function f(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return p={name:n.name,styles:n.styles,next:p},n.name;if(void 0!==n.styles){var o=n.next;if(void 0!==o)for(;void 0!==o;)p={name:o.name,styles:o.styles,next:p},o=o.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=N(e,360),t=N(t,100),n=N(n,100),0===t)r=o=i=n;else{var s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;r=a(l,s,e+1/3),o=a(l,s,e),i=a(l,s,e-1/3)}return{r:255*r,g:255*o,b:255*i}}(e.h,r,l),d=!0,f="hsl"),e.hasOwnProperty("a")&&(n=e.a));var p,h,m;return n=L(n),{ok:d,format:e.format||f,r:u(255,c(t.r,0)),g:u(255,c(t.g,0)),b:u(255,c(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=l(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=l(this._r)),this._g<1&&(this._g=l(this._g)),this._b<1&&(this._b=l(this._b)),this._ok=n.ok,this._tc_id=s++}function p(e,t,n){e=N(e,255),t=N(t,255),n=N(n,255);var r,o,i=c(e,t,n),a=u(e,t,n),s=(i+a)/2;if(i==a)r=o=0;else{var l=i-a;switch(o=s>.5?l/(2-i-a):l/(i+a),i){case e:r=(t-n)/l+(t>1)+720)%360;--t;)r.h=(r.h+o)%360,i.push(f(r));return i}function E(e,t){t=t||6;for(var n=f(e).toHsv(),r=n.h,o=n.s,i=n.v,a=[],s=1/t;t--;)a.push(f({h:r,s:o,v:i})),i=(i+s)%1;return a}f.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:o.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:o.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:o.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=L(e),this._roundA=l(100*this._a)/100,this},toHsv:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=h(this._r,this._g,this._b),t=l(360*e.h),n=l(100*e.s),r=l(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=p(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=p(this._r,this._g,this._b),t=l(360*e.h),n=l(100*e.s),r=l(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return m(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,o){var i=[H(l(e).toString(16)),H(l(t).toString(16)),H(l(n).toString(16)),H(V(r))];if(o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return i.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:l(this._r),g:l(this._g),b:l(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+l(this._r)+", "+l(this._g)+", "+l(this._b)+")":"rgba("+l(this._r)+", "+l(this._g)+", "+l(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:l(100*N(this._r,255))+"%",g:l(100*N(this._g,255))+"%",b:l(100*N(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+l(100*N(this._r,255))+"%, "+l(100*N(this._g,255))+"%, "+l(100*N(this._b,255))+"%)":"rgba("+l(100*N(this._r,255))+"%, "+l(100*N(this._g,255))+"%, "+l(100*N(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(T[m(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+v(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var o=f(e);n="#"+v(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return f(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(w,arguments)},brighten:function(){return this._applyModification(k,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(g,arguments)},saturate:function(){return this._applyModification(y,arguments)},greyscale:function(){return this._applyModification(b,arguments)},spin:function(){return this._applyModification(O,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(S,arguments)},monochromatic:function(){return this._applyCombination(E,arguments)},splitcomplement:function(){return this._applyCombination(D,arguments)},triad:function(){return this._applyCombination(C,arguments)},tetrad:function(){return this._applyCombination(j,arguments)}},f.fromRatio=function(e,t){if("object"==typeof e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:F(e[r]));e=n}return f(e,t)},f.equals=function(e,t){return!(!e||!t)&&f(e).toRgbString()==f(t).toRgbString()},f.random=function(){return f.fromRatio({r:d(),g:d(),b:d()})},f.mix=function(e,t,n){n=0===n?0:n||50;var r=f(e).toRgb(),o=f(t).toRgb(),i=n/100;return f({r:(o.r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b,a:(o.a-r.a)*i+r.a})},f.readability=function(e,t){var n=f(e),r=f(t);return(o.max(n.getLuminance(),r.getLuminance())+.05)/(o.min(n.getLuminance(),r.getLuminance())+.05)},f.isReadable=function(e,t,n){var r,o,i=f.readability(e,t);switch(o=!1,(r=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":o=i>=4.5;break;case"AAlarge":o=i>=3;break;case"AAAsmall":o=i>=7}return o},f.mostReadable=function(e,t,n){var r,o,i,a,s=null,l=0;o=(n=n||{}).includeFallbackColors,i=n.level,a=n.size;for(var u=0;ul&&(l=r,s=f(t[u]));return f.isReadable(e,s,{level:i,size:a})||!o?s:(n.includeFallbackColors=!1,f.mostReadable(e,["#fff","#000"],n))};var M=f.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},T=f.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(M);function L(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function N(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"===typeof e&&-1!=e.indexOf("%")}(e);return e=u(t,c(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),o.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function P(e){return u(1,c(0,e))}function R(e){return parseInt(e,16)}function H(e){return 1==e.length?"0"+e:""+e}function F(e){return e<=1&&(e=100*e+"%"),e}function V(e){return o.round(255*parseFloat(e)).toString(16)}function z(e){return R(e)/255}var B=function(){var e="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",n="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+t),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+t),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+t),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function _(e){return!!B.CSS_UNIT.exec(e)}e.exports?e.exports=f:void 0===(r=function(){return f}.call(t,n,t,e))||(e.exports=r)}(Math)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Flex=t.Box=void 0;l(n(23));var r=l(n(58)),o=n(20),i=function(e){if(e&&e.__esModule)return e;var t=s();if(t&&t.has(e))return t.get(e);var n={};if(null!=e){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}}n.default=e,t&&t.set(e,n);return n}(n(41)),a=l(n(42));function s(){if("function"!==typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function l(e){return e&&e.__esModule?e:{default:e}}var u=(0,r.default)("div",{shouldForwardProp:a.default})({boxSizing:"border-box",margin:0,minWidth:0},(function(e){return(0,i.default)(e.__css)(e.theme)}),(function(e){var t=e.theme,n=e.variant,r=e.tx,o=void 0===r?"variants":r;return(0,i.default)((0,i.get)(t,o+"."+n,(0,i.get)(t,n)))(t)}),(function(e){return(0,i.default)(e.sx)(e.theme)}),(function(e){return e.css}),(0,o.compose)(o.space,o.layout,o.typography,o.color,o.flexbox));t.Box=u;var c=(0,r.default)(u)({display:"flex"});t.Flex=c},function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return m})),n.d(t,"b",(function(){return v}));var r=n(31);var o=n(1);var i=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)===0){var t,n=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(n,t),this.tags.push(n)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=function(e){if(e.sheet)return e.sheet;for(var t=0;tp)&&(z=(I=I.replace(" ",":")).length),0r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(v,"$1"+e.trim());case 58:return e.trim()+t.replace(v,"$1"+e.trim());default:if(0<1*n&&0l.charCodeAt(8))break;case 115:a=a.replace(l,"-webkit-"+l)+";"+a;break;case 207:case 102:a=a.replace(l,"-webkit-"+(102r.charCodeAt(0)&&(r=r.trim()),r=[r],02),L=T||!!y&&/Mac/.test(y.platform),N=/Android \d/.test(w),P=!!b&&"webkitFontSmoothing"in b.documentElement.style,R=P?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,H=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},F=function(e){var t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},V=null,z=function(e,t,n){var r=V||(V=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},B=function(e,t,n,r){return n&&(I(e,t,n,r,-1)||I(e,t,n,r,1))},_=/^(img|br|input|textarea|hr)$/i;function I(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:$(e))){var i=e.parentNode;if(!i||1!=i.nodeType||W(e)||_.test(e.nodeName)||"false"==e.contentEditable)return!1;t=H(e)+(o<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?$(e):0}}}function $(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function q(e,t,n){for(var r=0==t,o=t==$(e);r||o;){if(e==n)return!0;var i=H(e);if(!(e=e.parentNode))return!1;r=r&&0==i,o=o&&i==$(e)}}function W(e){for(var t,n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var U=function(e){var t=e.isCollapsed;return t&&A&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function K(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function G(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function J(e,t){return"number"==typeof e?e:e[t]}function Y(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function X(e,t,n){for(var r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,a=n||e.dom;a;a=F(a))if(1==a.nodeType){var s=a,l=s==i.body,u=l?G(i):Y(s),c=0,d=0;if(t.topu.bottom-J(r,"bottom")&&(d=t.bottom-u.bottom+J(o,"bottom")),t.leftu.right-J(r,"right")&&(c=t.right-u.right+J(o,"right")),c||d)if(l)i.defaultView.scrollBy(c,d);else{var f=s.scrollLeft,p=s.scrollTop;d&&(s.scrollTop+=d),c&&(s.scrollLeft+=c);var h=s.scrollLeft-f,m=s.scrollTop-p;t={left:t.left-h,top:t.top-m,right:t.right-h,bottom:t.bottom-m}}if(l)break}}function Z(e){for(var t=[],n=e.ownerDocument,r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=F(r));return t}function Q(e,t){for(var n=0;n=s){a=Math.max(f.bottom,a),s=Math.min(f.top,s);var p=f.left>t.left?f.left-t.left:f.right=(f.left+f.right)/2?1:0));continue}}!n&&(t.left>=f.right&&t.top>=f.top||t.left>=f.left&&t.top>=f.bottom)&&(i=u+1)}}return n&&3==n.nodeType?function(e,t){for(var n=e.nodeValue.length,r=document.createRange(),o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:e,offset:i}:te(n,r)}function ne(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function re(e,t,n){var r=e.childNodes.length;if(r&&n.topt.top&&o++}n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(s=function(e,t,n,r){for(var o=-1,i=t;i!=e.dom;){var a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.node.isBlock&&a.parent){var s=a.dom.getBoundingClientRect();if(s.left>r.left||s.top>r.top)o=a.posBefore;else{if(!(s.right-1?o:e.docView.posFromDOM(t,n,1)}(e,n,o,t))}null==s&&(s=function(e,t,n){var r=te(t,n),o=r.node,i=r.offset,a=-1;if(1==o.nodeType&&!o.firstChild){var s=o.getBoundingClientRect();a=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(o,i,a)}(e,l,t));var p=e.docView.nearestDesc(l,!0);return{pos:s,inside:p?p.posAtStart-p.border:-1}}function ie(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}var ae=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function se(e,t,n){var r=e.docView.domFromPos(t,n<0?-1:1),o=r.node,i=r.offset,a=P||j;if(3==o.nodeType){if(!a||!ae.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){var s=i,l=i,u=n<0?1:-1;return n<0&&!i?(l++,u=-1):n>=0&&i==o.nodeValue.length?(s--,u=1):n<0?s--:l++,le(ie(z(o,s,l),u),u<0)}var c=ie(z(o,i,i),n);if(j&&i&&/\s/.test(o.nodeValue[i-1])&&i=0)}if(i&&(n<0||i==$(o))){var m=o.childNodes[i-1],v=3==m.nodeType?z(m,$(m)-(a?0:1)):1!=m.nodeType||"BR"==m.nodeName&&m.nextSibling?null:m;if(v)return le(ie(v,1),!1)}if(i<$(o)){for(var g=o.childNodes[i];g.pmViewDesc&&g.pmViewDesc.ignoreForCoords;)g=g.nextSibling;var y=g?3==g.nodeType?z(g,0,a?0:1):1==g.nodeType?g:null:null;if(y)return le(ie(y,-1),!0)}return le(ie(3==o.nodeType?z(o):o,-n),n>=0)}function le(e,t){if(0==e.width)return e;var n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function ue(e,t){if(0==e.height)return e;var n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function ce(e,t,n){var r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}var de=/[\u0590-\u08ac]/;var fe=null,pe=null,he=!1;function me(e,t,n){return fe==t&&pe==n?he:(fe=t,pe=n,he="up"==n||"down"==n?function(e,t,n){var r=t.selection,o="up"==n?r.$from:r.$to;return ce(e,t,(function(){for(var t=e.docView.domFromPos(o.pos,"up"==n?-1:1).node;;){var r=e.docView.nearestDesc(t,!0);if(!r)break;if(r.node.isBlock){t=r.dom;break}t=r.dom.parentNode}for(var i=se(e,o.pos,1),a=t.firstChild;a;a=a.nextSibling){var s=void 0;if(1==a.nodeType)s=a.getClientRects();else{if(3!=a.nodeType)continue;s=z(a,0,a.nodeValue.length).getClientRects()}for(var l=0;lu.top+1&&("up"==n?i.top-u.top>2*(u.bottom-i.top):u.bottom-i.bottom>2*(i.bottom-u.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){var r=t.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,a=o==r.parent.content.size,s=e.domSelection();return de.test(r.parent.textContent)&&s.modify?ce(e,t,(function(){var t=s.getRangeAt(0),o=s.focusNode,i=s.focusOffset,a=s.caretBidiLevel;s.modify("move",n,"character");var l=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==s.focusNode.nodeType?s.focusNode:s.focusNode.parentNode)||o==s.focusNode&&i==s.focusOffset;return s.removeAllRanges(),s.addRange(t),null!=a&&(s.caretBidiLevel=a),l})):"left"==n||"backward"==n?i:a}(e,t,n))}var ve=function(){function e(t,n,r,o){Object(c.a)(this,e),this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=0,r.pmViewDesc=this}return Object(d.a)(e,[{key:"matchesWidget",value:function(e){return!1}},{key:"matchesMark",value:function(e){return!1}},{key:"matchesNode",value:function(e,t,n){return!1}},{key:"matchesHack",value:function(e){return!1}},{key:"parseRule",value:function(){return null}},{key:"stopEvent",value:function(e){return!1}},{key:"size",get:function(){for(var e=0,t=0;tH(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(var l=e;;l=l.parentNode){if(l==this.dom){s=!1;break}if(l.previousSibling)break}if(null==s&&t==e.childNodes.length)for(var u=e;;u=u.parentNode){if(u==this.dom){s=!0;break}if(u.nextSibling)break}}return(null==s?n>0:s)?this.posAtEnd:this.posAtStart}},{key:"nearestDesc",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!0,r=e;r;r=r.parentNode){var o=this.getDesc(r),i=void 0;if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}},{key:"getDesc",value:function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t}},{key:"posFromDOM",value:function(e,t,n){for(var r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}},{key:"descAt",value:function(e){for(var t=0,n=0;te||a instanceof Oe){o=e-i;break}i=s}if(o)return this.children[r].domFromPos(o-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof ge&&n.side>=0;r--);if(t<=0){for(var l,u=!0;(l=r?this.children[r-1]:null)&&l.dom.parentNode!=this.contentDOM;r--,u=!1);return l&&t&&u&&!l.border&&!l.domAtom?l.domFromPos(l.size,t):{node:this.contentDOM,offset:l?H(l.dom)+1:0}}for(var c,d=!0;(c=r2&&void 0!==arguments[2]?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,a=0;;a++){var s=this.children[a],l=i+s.size;if(-1==r&&e<=l){var u=i+s.border;if(e>=u&&t<=l-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(e,t,u);e=i;for(var c=a;c>0;c--){var d=this.children[c-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){r=H(d.dom)+1;break}e-=d.size}-1==r&&(r=0)}if(r>-1&&(l>t||a==this.children.length-1)){t=l;for(var f=a+1;f3&&void 0!==arguments[3]&&arguments[3],o=Math.min(e,t),i=Math.max(e,t),a=0,s=0;as&&it){var O=c;c=d,d=O}var S=document.createRange();S.setEnd(d.node,d.offset),S.setStart(c.node,c.offset),f.removeAllRanges(),f.addRange(S)}}}},{key:"ignoreMutation",value:function(e){return!this.contentDOM&&"selection"!=e.type}},{key:"contentLost",get:function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}},{key:"markDirty",value:function(e,t){for(var n=0,r=0;r=n:en){var a=n+o.border,s=i-o.border;if(e>=a&&t<=s)return this.dirty=e==n||t==i?2:1,void(e!=a||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-a,t-a):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}},{key:"markParentsDirty",value:function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var n=1==e?2:1;t.dirty0&&(i=He(i,0,e,r));for(var s=0;s=0;n--){var r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=function(){return v.Fragment.empty})}else t.contentElement=this.contentDOM;else t.getContent=function(){return e.node.content};return t}},{key:"matchesNode",value:function(e,t,n){return 0==this.dirty&&e.eq(this.node)&&Le(t,this.outerDeco)&&n.eq(this.innerDeco)}},{key:"size",get:function(){return this.node.nodeSize}},{key:"border",get:function(){return this.node.isLeaf?0:1}},{key:"updateChildren",value:function(e,t){var n=this,r=this.node.inlineContent,o=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,s=i&&i.pos<0,l=new Pe(this,a&&a.node);!function(e,t,n,r){var o=t.locals(e),i=0;if(0==o.length){for(var a=0;ai;)u.push(o[l++]);var y=i+m.nodeSize;if(m.isText){var b=y;l=0&&!a&&l.syncToMarks(i==n.node.childCount?v.Mark.none:n.node.child(i).marks,r,e),l.placeWidget(t,e,o)}),(function(t,n,a,u){var c;l.syncToMarks(t.marks,r,e),l.findNodeMatch(t,n,a,u)||s&&e.state.selection.from>o&&e.state.selection.to-1&&l.updateNodeAt(t,n,a,c,e)||l.updateNextNode(t,n,a,e,u)||l.addNode(t,n,a,e,o),o+=t.nodeSize})),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(a&&this.protectLocalComposition(e,a),Ce(this.contentDOM,this.children,e),T&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){var t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}},{key:"localCompositionInfo",value:function(e,t){var n=e.state.selection,r=n.from,o=n.to;if(!(e.state.selection instanceof p.TextSelection)||rt+this.node.content.size)return null;var i=e.domSelection(),a=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=$(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t=n){var c=s=0&&c+t.length+s>=n)return s+c;if(n==r&&l.length>=r+t.length-s&&l.slice(r-s,r-s+t.length)==t)return r}}}return-1}(this.node.content,s,r-t,o-t);return l<0?null:{node:a,pos:l,text:s}}return{node:a,pos:-1,text:""}}},{key:"protectLocalComposition",value:function(e,t){var n=t.node,r=t.pos,o=t.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}var a=new ye(this,i,n,o);e.input.compositionNodes.push(a),this.children=He(this.children,r,r+o.length,e,a)}}},{key:"update",value:function(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}},{key:"updateInner",value:function(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}},{key:"updateOuterDeco",value:function(e){if(!Le(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Ee(this.dom,this.nodeDOM,Ae(this.outerDeco,this.node,t),Ae(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}}},{key:"selectNode",value:function(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}},{key:"deselectNode",value:function(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}},{key:"domAtom",get:function(){return this.node.isAtom}}],[{key:"create",value:function(e,t,r,o,i,a){var s,l=i.nodeViews[t.type.name],u=l&&l(t,i,(function(){return s?s.parent?s.parent.posBeforeChild(s):void 0:a}),r,o),c=u&&u.dom,d=u&&u.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 if(!c){var f=v.DOMSerializer.renderSpec(document,t.type.spec.toDOM(t));c=f.dom,d=f.contentDOM}d||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));var p=c;return c=Te(c,r,t),u?s=new Se(e,t,r,o,c,d||null,p,u,i,a+1):t.isText?new xe(e,t,r,o,c,p,i):new n(e,t,r,o,c,d||null,p,i,a+1)}}]),n}(ve);function ke(e,t,n,r,o){return Te(r,t,e),new we(void 0,e,t,n,r,r,r,o,0)}var xe=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(e,r,o,i,a,s,l){return Object(c.a)(this,n),t.call(this,e,r,o,i,a,null,s,l,0)}return Object(d.a)(n,[{key:"parseRule",value:function(){for(var e=this.nodeDOM.parentNode;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}},{key:"update",value:function(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}},{key:"inParent",value:function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}},{key:"domFromPos",value:function(e){return{node:this.nodeDOM,offset:e}}},{key:"localPosFromDOM",value:function(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):Object(h.a)(Object(m.a)(n.prototype),"localPosFromDOM",this).call(this,e,t,r)}},{key:"ignoreMutation",value:function(e){return"characterData"!=e.type&&"selection"!=e.type}},{key:"slice",value:function(e,t,r){var o=this.node.cut(e,t),i=document.createTextNode(o.text);return new n(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}},{key:"markDirty",value:function(e,t){Object(h.a)(Object(m.a)(n.prototype),"markDirty",this).call(this,e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}},{key:"domAtom",get:function(){return!1}}]),n}(we),Oe=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(){return Object(c.a)(this,n),t.apply(this,arguments)}return Object(d.a)(n,[{key:"parseRule",value:function(){return{ignore:!0}}},{key:"matchesHack",value:function(e){return 0==this.dirty&&this.dom.nodeName==e}},{key:"domAtom",get:function(){return!0}},{key:"ignoreForCoords",get:function(){return"IMG"==this.dom.nodeName}}]),n}(ve),Se=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(e,r,o,i,a,s,l,u,d,f){var p;return Object(c.a)(this,n),(p=t.call(this,e,r,o,i,a,s,l,d,f)).spec=u,p}return Object(d.a)(n,[{key:"update",value:function(e,t,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(e,t,r);return i&&this.updateInner(e,t,r,o),i}return!(!this.contentDOM&&!e.isLeaf)&&Object(h.a)(Object(m.a)(n.prototype),"update",this).call(this,e,t,r,o)}},{key:"selectNode",value:function(){this.spec.selectNode?this.spec.selectNode():Object(h.a)(Object(m.a)(n.prototype),"selectNode",this).call(this)}},{key:"deselectNode",value:function(){this.spec.deselectNode?this.spec.deselectNode():Object(h.a)(Object(m.a)(n.prototype),"deselectNode",this).call(this)}},{key:"setSelection",value:function(e,t,r,o){this.spec.setSelection?this.spec.setSelection(e,t,r):Object(h.a)(Object(m.a)(n.prototype),"setSelection",this).call(this,e,t,r,o)}},{key:"destroy",value:function(){this.spec.destroy&&this.spec.destroy(),Object(h.a)(Object(m.a)(n.prototype),"destroy",this).call(this)}},{key:"stopEvent",value:function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}},{key:"ignoreMutation",value:function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):Object(h.a)(Object(m.a)(n.prototype),"ignoreMutation",this).call(this,e)}}]),n}(we);function Ce(e,t,n){for(var r=e.firstChild,o=!1,i=0;i0;){for(var s=void 0;;)if(r){var l=n.children[r-1];if(!(l instanceof be)){s=l,r--;break}n=l,r=l.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}var u=s.node;if(u){if(u!=e.child(o-1))break;--o,i.set(s,o),a.push(s)}}return{index:o,matched:i,matches:a.reverse()}}(t.node.content,t)}return Object(d.a)(e,[{key:"destroyBetween",value:function(e,t){if(e!=t){for(var n=e;n>1,i=Math.min(o,e.length);r-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var l=be.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}},{key:"findNodeMatch",value:function(e,t,n,r){var o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(var a=this.index,s=Math.min(this.top.children.length,a+5);a=n||c<=t?i.push(l):(un&&i.push(l.slice(n-u,l.size,r)))}return i}function Fe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;var o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;var s,l,u=r.resolve(a);if(U(n)){for(s=u;o&&!o.node;)o=o.parent;var c=o.node;if(o&&c.isAtom&&p.NodeSelection.isSelectable(c)&&o.parent&&(!c.isInline||!q(n.focusNode,n.focusOffset,o.dom))){var d=o.posBefore;l=new p.NodeSelection(a==d?u:r.resolve(d))}}else{var f=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(f<0)return null;s=r.resolve(f)}if(!l){var h="pointer"==t||e.state.selection.head1&&void 0!==arguments[1]&&arguments[1],n=e.state.selection;if(Ue(e,n),Ve(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&A){var r=e.domSelection(),o=e.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&B(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)We(e);else{var i,a,s=n.anchor,l=n.head;!Be||n instanceof p.TextSelection||(n.$from.parent.inlineContent||(i=_e(e,n.from)),n.empty||n.$from.parent.inlineContent||(a=_e(e,n.to))),e.docView.setSelection(s,l,e.root,t),Be&&(i&&$e(i),a&&$e(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&qe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var Be=M||A&&E<63;function _e(e,t){var n=e.docView.domFromPos(t,0),r=n.node,o=n.offset,i=o0?r.max(o):r.min(o),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&p.Selection.findFrom(a,t)}function Ze(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Qe(e,t,n){var r=e.state.selection;if(!(r instanceof p.TextSelection)){if(r instanceof p.NodeSelection&&r.node.isInline)return Ze(e,new p.TextSelection(t>0?r.$to:r.$from));var o=Xe(e.state,t);return!!o&&Ze(e,o)}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var i=Xe(e.state,t);return!!(i&&i instanceof p.NodeSelection)&&Ze(e,i)}if(!(L&&n.indexOf("m")>-1)){var a,s=r.$head,l=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(!l||l.isText)return!1;var u=t<0?s.pos-l.nodeSize:s.pos;return!!(l.isAtom||(a=e.docView.descAt(u))&&!a.contentDOM)&&(p.NodeSelection.isSelectable(l)?Ze(e,new p.NodeSelection(t<0?e.state.doc.resolve(s.pos-l.nodeSize):s)):!!P&&Ze(e,new p.TextSelection(e.state.doc.resolve(t<0?u:u+l.nodeSize))))}}function et(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function tt(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function nt(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){var o,i,a=!1;for(j&&1==n.nodeType&&r0){if(1!=n.nodeType)break;var s=n.childNodes[r-1];if(tt(s))o=n,i=--r;else{if(3!=s.nodeType)break;r=(n=s).nodeValue.length}}else{if(ot(n))break;for(var l=n.previousSibling;l&&tt(l);)o=n.parentNode,i=H(l),l=l.previousSibling;if(l)r=et(n=l);else{if((n=n.parentNode)==e.dom)break;r=0}}a?it(e,t,n,r):o&&it(e,t,o,i)}}function rt(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){for(var o,i,a=et(n);;)if(r-1)return!1;if(L&&n.indexOf("m")>-1)return!1;var o=r.$from,i=r.$to;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var a=Xe(e.state,t);if(a&&a instanceof p.NodeSelection)return Ze(e,a)}if(!o.parent.inlineContent){var s=t<0?o:i,l=r instanceof p.AllSelection?p.Selection.near(s,t):p.Selection.findFrom(s,t);return!!l&&Ze(e,l)}return!1}function st(e,t){if(!(e.state.selection instanceof p.TextSelection))return!0;var n=e.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r.sameParent(o))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){var s=e.state.tr;return t<0?s.delete(r.pos-a.nodeSize,r.pos):s.delete(r.pos,r.pos+a.nodeSize),e.dispatch(s),!0}return!1}function lt(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function ut(e,t){var n=t.keyCode,r=function(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||L&&72==n&&"c"==r?st(e,-1)||nt(e):46==n||L&&68==n&&"c"==r?st(e,1)||rt(e):13==n||27==n||(37==n||L&&66==n&&"c"==r?Qe(e,-1,r)||nt(e):39==n||L&&70==n&&"c"==r?Qe(e,1,r)||rt(e):38==n||L&&80==n&&"c"==r?at(e,-1,r)||nt(e):40==n||L&&78==n&&"c"==r?function(e){if(!M||e.state.selection.$head.parentOffset>0)return!1;var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;lt(e,o,"true"),setTimeout((function(){return lt(e,o,"false")}),20)}return!1}(e)||at(e,1,r)||rt(e):r==(L?"m":"c")&&(66==n||73==n||89==n||90==n))}function ct(e,t){for(var n=[],r=t.content,o=t.openStart,i=t.openEnd;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;var a=r.firstChild;n.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),r=a.content}var s=e.someProp("clipboardSerializer")||v.DOMSerializer.fromSchema(e.state.schema),l=wt(),u=l.createElement("div");u.appendChild(s.serializeFragment(r,{document:l}));for(var c,d=u.firstChild,f=0;d&&1==d.nodeType&&(c=yt[d.nodeName.toLowerCase()]);){for(var p=c.length-1;p>=0;p--){for(var h=l.createElement(c[p]);u.firstChild;)h.appendChild(u.firstChild);u.appendChild(h),f++}d=u.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice","".concat(o," ").concat(i).concat(f?" -".concat(f):""," ").concat(JSON.stringify(n))),{dom:u,text:e.someProp("clipboardTextSerializer",(function(e){return e(t)}))||t.content.textBetween(0,t.content.size,"\n\n")}}function dt(e,t,n,r,o){var i,a,s=o.parent.type.spec.code;if(!n&&!t)return null;var l=t&&(r||s||!n);if(l){if(e.someProp("transformPastedText",(function(e){t=e(t,s||r)})),s)return t?new v.Slice(v.Fragment.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):v.Slice.empty;var u=e.someProp("clipboardTextParser",(function(e){return e(t,o,r)}));if(u)a=u;else{var c=o.marks(),d=e.state.schema,f=v.DOMSerializer.fromSchema(d);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((function(e){var t=i.appendChild(document.createElement("p"));e&&t.appendChild(f.serializeNode(d.text(e,c)))}))}}else e.someProp("transformPastedHTML",(function(e){n=e(n)})),i=function(e){var t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=wt().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&yt[o[1].toLowerCase()])&&(e=n.map((function(e){return"<"+e+">"})).join("")+e+n.map((function(e){return""})).reverse().join(""));if(r.innerHTML=e,n)for(var i=0;i0&&i.firstChild;m--)i=i.firstChild;if(!a){var g=e.someProp("clipboardParser")||e.someProp("domParser")||v.DOMParser.fromSchema(e.state.schema);a=g.parseSlice(i,{preserveWhitespace:!(!l&&!h),context:o,ruleFromNode:function(e){return"BR"!=e.nodeName||e.nextSibling||!e.parentNode||ft.test(e.parentNode.nodeName)?null:{ignore:!0}}})}if(h)a=function(e,t){if(!e.size)return e;var n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(u){return e}for(var o=e.content,i=e.openStart,a=e.openEnd,s=n.length-2;s>=0;s-=2){var l=r.nodes[n[s]];if(!l||l.hasRequiredAttrs())break;o=v.Fragment.from(l.create(n[s+1],o)),i++,a++}return new v.Slice(o,i,a)}(gt(a,+h[1],+h[2]),h[4]);else if(a=v.Slice.maxOpen(function(e,t){if(e.childCount<2)return e;for(var n=function(n){var r=t.node(n).contentMatchAt(t.index(n)),o=void 0,i=[];if(e.forEach((function(e){if(i){var t,n=r.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&o.length&&ht(n,o,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=mt(i[i.length-1],o.length));var a=pt(e,n);i.push(a),r=r.matchType(a.type),o=n}}})),i)return{v:v.Fragment.from(i)}},r=t.depth;r>=0;r--){var o=n(r);if("object"===typeof o)return o.v}return e}(a.content,o),!0),a.openStart||a.openEnd){for(var y=0,b=0,w=a.content.firstChild;y2&&void 0!==arguments[2]?arguments[2]:0,r=t.length-1;r>=n;r--)e=t[r].create(null,v.Fragment.from(e));return e}function ht(e,t,n,r,o){if(o=n&&(s=t<0?a.contentMatchAt(0).fillBefore(s,e.childCount>1||i<=o).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(v.Fragment.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(s))}function gt(e,t,n){return ti.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)})))return{v:!0}},s=i.depth+1;s>0;s--){var l=a(s);if("object"===typeof l)return l.v}return!1}function Et(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Mt(e,t,n,r,o){return At(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(function(n){return n(e,t,r)}))||(o?function(e,t){if(-1==t)return!1;var n,r,o=e.state.selection;o instanceof p.NodeSelection&&(n=o.node);for(var i=e.state.doc.resolve(t),a=i.depth+1;a>0;a--){var s=a>i.depth?i.nodeAfter:i.node(a);if(p.NodeSelection.isSelectable(s)){r=n&&o.$from.depth>0&&a>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(a);break}}return null!=r&&(Et(e,p.NodeSelection.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&p.NodeSelection.isSelectable(r))&&(Et(e,new p.NodeSelection(n),"pointer"),!0)}(e,n))}function Tt(e,t,n,r){return At(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(function(n){return n(e,t,r)}))}function Lt(e,t,n,r){return At(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(function(n){return n(e,t,r)}))||function(e,t,n){if(0!=n.button)return!1;var r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Et(e,p.TextSelection.create(r,0,r.content.size),"pointer"),!0);for(var o=r.resolve(t),i=o.depth+1;i>0;i--){var a=i>o.depth?o.nodeAfter:o.node(i),s=o.before(i);if(a.inlineContent)Et(e,p.TextSelection.create(r,s+1,s+1+a.content.size),"pointer");else{if(!p.NodeSelection.isSelectable(a))continue;Et(e,p.NodeSelection.create(r,s),"pointer")}return!0}}(e,n,r)}function Nt(e){return Bt(e)}xt.keydown=function(e,t){var n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Ht(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!N||!A||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!T||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(function(t){return t(e,n)}))||ut(e,n)?n.preventDefault():St(e,"key");else{var r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout((function(){e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",(function(t){return t(e,K(13,"Enter"))})),e.input.lastIOSEnter=0)}),200)}},xt.keyup=function(e,t){16==t.keyCode&&(e.input.shiftKey=!1)},xt.keypress=function(e,t){var n=t;if(!(Ht(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||L&&n.metaKey))if(e.someProp("handleKeyPress",(function(t){return t(e,n)})))n.preventDefault();else{var r=e.state.selection;if(!(r instanceof p.TextSelection)||!r.$from.sameParent(r.$to)){var o=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(function(t){return t(e,r.$from.pos,r.$to.pos,o)}))||e.dispatch(e.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}}};var Pt=L?"metaKey":"ctrlKey";kt.mousedown=function(e,t){var n=t;e.input.shiftKey=n.shiftKey;var r=Nt(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[Pt]&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};var a=e.posAtCoords(Dt(n));a&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Rt(e,a,n,!!r)):("doubleClick"==i?Tt:Lt)(e,a.pos,a.inside,n)?n.preventDefault():St(e,"pointer"))};var Rt=function(){function e(t,n,r,o){var i,a,s=this;if(Object(c.a)(this,e),this.view=t,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[Pt],this.allowDefault=r.shiftKey,n.inside>-1)i=t.state.doc.nodeAt(n.inside),a=n.inside;else{var l=t.state.doc.resolve(n.pos);i=l.parent,a=l.depth?l.before():0}var u=o?null:r.target,d=u?t.docView.nearestDesc(u,!0):null;this.target=d?d.dom:null;var f=t.state.selection;(0==r.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||f instanceof p.NodeSelection&&f.from<=a&&f.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!j||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((function(){s.view.input.mouseDown==s&&s.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),St(t,"pointer")}return Object(d.a)(e,[{key:"done",value:function(){var e=this;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((function(){return ze(e.view)})),this.view.input.mouseDown=null}},{key:"up",value:function(e){if(this.done(),this.view.dom.contains(e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Dt(e))),this.allowDefault||!t?St(this.view,"pointer"):Mt(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||M&&this.mightDrag&&!this.mightDrag.node.isAtom||A&&!(this.view.state.selection instanceof p.TextSelection)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Et(this.view,p.Selection.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):St(this.view,"pointer")}}},{key:"move",value:function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),St(this.view,"pointer"),0==e.buttons&&this.done()}}]),e}();function Ht(e,t){return!!e.composing||!!(M&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}kt.touchdown=function(e){Nt(e),St(e,"pointer")},kt.contextmenu=function(e){return Nt(e)};var Ft=N?5e3:-1;function Vt(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((function(){return Bt(e)}),t))}function zt(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){var e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Bt(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(N&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),zt(e),t||e.docView&&e.docView.dirty){var n=Fe(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}xt.compositionstart=xt.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(e){return!1===e.type.spec.inclusive}))))e.markCursor=e.state.storedMarks||n.marks(),Bt(e,!0),e.markCursor=null;else if(Bt(e),j&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=e.domSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(3==a.nodeType){r.collapse(a,a.nodeValue.length);break}o=a,i=-1}e.input.composing=!0}Vt(e,Ft)},xt.compositionend=function(e,t){e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Vt(e,20))};var _t=S&&C<15||T&&R<604;function It(e,t,n,r){var o=dt(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(function(t){return t(e,r,o||v.Slice.empty)})))return!0;if(!o)return!1;var i=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),a=i?e.state.tr.replaceSelectionWith(i,e.input.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}kt.copy=xt.cut=function(e,t){var n=t,r=e.state.selection,o="cut"==n.type;if(!r.empty){var i=_t?null:n.clipboardData,a=ct(e,r.content()),s=a.dom,l=a.text;i?(n.preventDefault(),i.clearData(),i.setData("text/html",s.innerHTML),i.setData("text/plain",l)):function(e,t){if(e.dom.parentNode){var n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}}(e,s),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},xt.paste=function(e,t){var n=t;if(!e.composing||N){var r=_t?null:n.clipboardData;r&&It(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(e.dom.parentNode){var n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?It(e,r.value,null,t):It(e,r.textContent,r.innerHTML,t)}),50)}}(e,n)}};var $t=Object(d.a)((function e(t,n){Object(c.a)(this,e),this.slice=t,this.move=n})),qt=L?"altKey":"ctrlKey";for(var Wt in kt.dragstart=function(e,t){var n=t,r=e.input.mouseDown;if(r&&r.done(),n.dataTransfer){var o=e.state.selection,i=o.empty?null:e.posAtCoords(Dt(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof p.NodeSelection?o.to-1:o.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(p.NodeSelection.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){var a=e.docView.nearestDesc(n.target,!0);a&&a.node.type.spec.draggable&&a!=e.docView&&e.dispatch(e.state.tr.setSelection(p.NodeSelection.create(e.state.doc,a.posBefore)))}var s=e.state.selection.content(),l=ct(e,s),u=l.dom,c=l.text;n.dataTransfer.clearData(),n.dataTransfer.setData(_t?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",_t||n.dataTransfer.setData("text/plain",c),e.dragging=new $t(s,!n[qt])}},kt.dragend=function(e){var t=e.dragging;window.setTimeout((function(){e.dragging==t&&(e.dragging=null)}),50)},xt.dragover=xt.dragenter=function(e,t){return t.preventDefault()},xt.drop=function(e,t){var n=t,r=e.dragging;if(e.dragging=null,n.dataTransfer){var o=e.posAtCoords(Dt(n));if(o){var i=e.state.doc.resolve(o.pos);if(i){var a=r&&r.slice;a?e.someProp("transformPasted",(function(e){a=e(a)})):a=dt(e,n.dataTransfer.getData(_t?"Text":"text/plain"),_t?null:n.dataTransfer.getData("text/html"),!1,i);var s=!(!r||n[qt]);if(e.someProp("handleDrop",(function(t){return t(e,n,a||v.Slice.empty,s)})))n.preventDefault();else if(a){n.preventDefault();var l=a?Object(g.h)(e.state.doc,i.pos,a):i.pos;null==l&&(l=i.pos);var u=e.state.tr;s&&u.deleteSelection();var c=u.mapping.map(l),d=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,f=u.doc;if(d?u.replaceRangeWith(c,c,a.content.firstChild):u.replaceRange(c,c,a),!u.doc.eq(f)){var h=u.doc.resolve(c);if(d&&p.NodeSelection.isSelectable(a.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(a.content.firstChild))u.setSelection(new p.NodeSelection(h));else{var m=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((function(e,t,n,r){return m=r})),u.setSelection(Ge(e,h,u.doc.resolve(m)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))}}}}}},kt.focus=function(e){e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&ze(e)}),20))},kt.blur=function(e,t){var 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)},kt.beforeinput=function(e,t){if(A&&N&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();var n=e.input.domChangeCount;setTimeout((function(){if(e.input.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",(function(t){return t(e,K(8,"Backspace"))})))){var t=e.state.selection.$cursor;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}}),50)}},xt)kt[Wt]=xt[Wt];function Ut(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var Kt=function(){function e(t,n){Object(c.a)(this,e),this.toDOM=t,this.spec=n||Zt,this.side=this.spec.side||0}return Object(d.a)(e,[{key:"map",value:function(e,t,n,r){var o=e.mapResult(t.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new Yt(i-n,i-n,this)}},{key:"valid",value:function(){return!0}},{key:"eq",value:function(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ut(this.spec,t.spec))}},{key:"destroy",value:function(e){this.spec.destroy&&this.spec.destroy(e)}}]),e}(),Gt=function(){function e(t,n){Object(c.a)(this,e),this.attrs=t,this.spec=n||Zt}return Object(d.a)(e,[{key:"map",value:function(e,t,n,r){var o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Yt(o,i,this)}},{key:"valid",value:function(e,t){return t.from1&&void 0!==arguments[1]?arguments[1]:0;return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}},{key:"map",value:function(e,t,n){return this.type.map(e,this,t,n)}},{key:"spec",get:function(){return this.type.spec}},{key:"inline",get:function(){return this.type instanceof Gt}}],[{key:"widget",value:function(t,n,r){return new e(t,t,new Kt(n,r))}},{key:"inline",value:function(t,n,r,o){return new e(t,n,new Gt(r,o))}},{key:"node",value:function(t,n,r,o){return new e(t,n,new Jt(r,o))}}]),e}(),Xt=[],Zt={},Qt=function(){function e(t,n){Object(c.a)(this,e),this.local=t.length?t:Xt,this.children=n.length?n:Xt}return Object(d.a)(e,[{key:"find",value:function(e,t,n){var r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}},{key:"findInner",value:function(e,t,n,r,o){for(var i=0;i=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(var s=0;se){var l=this.children[s]+1;this.children[s+2].findInner(e-l,t-l,n,r+l,o)}}},{key:"map",value:function(e,t,n){return this==en||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Zt)}},{key:"mapInner",value:function(t,n,r,o,i){for(var a,s=0;sl+i)){var c=s[a]+i;t>=c?s[a+1]=e<=c?-2:-1:n>=o&&(u=r-n-(t-e))&&(s[a]+=u,s[a+1]+=u)}}},u=0;u=r.content.size){c=!0;continue}var h=n.map(e[d+1]+i,-1)-o,m=r.content.findIndex(p),v=m.index,g=m.offset,y=r.maybeChild(v);if(y&&g==p&&g+y.nodeSize==h){var b=s[d+2].mapInner(n,y,f+1,e[d]+i+1,a);b!=en?(s[d]=p,s[d+1]=h,s[d+2]=b):(s[d+1]=-2,c=!0)}else c=!0}if(c){var w=function(e,t,n,r,o,i,a){function s(e,t){for(var i=0;il&&a.to=t){this.children[i]==t&&(r=this.children[i+2]);break}for(var a=t+1,s=a+n.content.size,l=0;la&&u.type instanceof Gt){var c=Math.max(a,u.from)-a,d=Math.min(s,u.to)-a;cn&&r.to0;)t++;e.splice(t,0,n)}function cn(e){var t=[];return e.someProp("decorations",(function(n){var r=n(e.state);r&&r!=en&&t.push(r)})),e.cursorWrapper&&t.push(Qt.create(e.state.doc,[e.cursorWrapper.deco])),tn.from(t)}var dn={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},fn=S&&C<=11,pn=function(){function e(){Object(c.a)(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return Object(d.a)(e,[{key:"set",value:function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}},{key:"clear",value:function(){this.anchorNode=this.focusNode=null}},{key:"eq",value:function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}]),e}(),hn=function(){function e(t,n){var r=this;Object(c.a)(this,e),this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new pn,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((function(e){for(var t=0;te.target.nodeValue.length}))?r.flushSoon():r.flush()})),fn&&(this.onCharData=function(e){r.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),r.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}return Object(d.a)(e,[{key:"flushSoon",value:function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){e.flushingSoon=-1,e.flush()}),20))}},{key:"forceFlush",value:function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}},{key:"start",value:function(){this.observer&&this.observer.observe(this.view.dom,dn),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}},{key:"stop",value:function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var n=0;n-1)){var e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);var t=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&Je(this.view)&&!this.ignoreSelectionChange(t),r=-1,o=-1,i=!1,a=[];if(this.view.editable)for(var s=0;s1){var u=a.filter((function(e){return"BR"==e.nodeName}));if(2==u.length){var c=u[0],d=u[1];c.parentNode&&c.parentNode.parentNode==d.parentNode?d.remove():c.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),function(e){if(mn)return;mn=!0,"normal"==getComputedStyle(e.dom).whiteSpace&&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.")}(this.view)),this.handleDOMChange(r,o,i,a),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||ze(this.view),this.currentSelection.set(t))}}},{key:"registerMutation",value:function(e,t){if(t.indexOf(e.target)>-1)return null;var 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(var r=0;rDate.now()-50?e.input.lastSelectionOrigin:null,a=Fe(e,i);if(a&&!e.state.selection.eq(a)){var s=e.state.tr.setSelection(a);"pointer"==i?s.setMeta("pointer",!0):"key"==i&&s.scrollIntoView(),e.dispatch(s)}}else{var l=e.state.doc.resolve(t),u=l.sharedDepth(n);t=l.before(u+1),n=e.state.doc.resolve(n).after(u+1);var c=e.state.selection,d=function(e,t,n){var r,o=e.docView.parseRange(t,n),i=o.node,a=o.fromOffset,s=o.toOffset,l=o.from,u=o.to,c=e.domSelection(),d=c.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:c.anchorOffset}],U(c)||r.push({node:c.focusNode,offset:c.focusOffset})),A&&8===e.input.lastKeyCode)for(var f=s;f>a;f--){var p=i.childNodes[f-1],h=p.pmViewDesc;if("BR"==p.nodeName&&!h){s=f;break}if(!h||h.size)break}var m=e.state.doc,g=e.someProp("domParser")||v.DOMParser.fromSchema(e.state.schema),y=m.resolve(l),b=null,w=g.parse(i,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:a,to:s,preserveWhitespace:"pre"!=y.parent.type.whitespace||"full",findPositions:r,ruleFromNode:vn,context:y});if(r&&null!=r[0].pos){var k=r[0].pos,x=r[1]&&r[1].pos;null==x&&(x=k),b={anchor:k+l,head:x+l}}return{doc:w,sel:b,from:l,to:u}}(e,t,n);if(A&&e.cursorWrapper&&d.sel&&d.sel.anchor==e.cursorWrapper.deco.from){var f=e.cursorWrapper.deco.type.toDOM.nextSibling,h=f&&f.nodeValue?f.nodeValue.length:1;d.sel={anchor:d.sel.anchor+h,head:d.sel.anchor+h}}var m,g,y=e.state.doc,b=y.slice(d.from,d.to);8===e.input.lastKeyCode&&Date.now()-100=s?i-r:0)+(l-s),s=i}else if(l=l?i-r:0)+(s-l),l=i}return{start:i,endA:s,endB:l}}(b.content,d.doc.content,d.from,m,g);if((T&&e.input.lastIOSEnter>Date.now()-225||N)&&o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName}))&&(!w||w.endA>=w.endB)&&e.someProp("handleKeyDown",(function(t){return t(e,K(13,"Enter"))})))e.input.lastIOSEnter=0;else{if(!w){if(!(r&&c instanceof p.TextSelection&&!c.empty&&c.$head.sameParent(c.$anchor))||e.composing||d.sel&&d.sel.anchor!=d.sel.head){if(d.sel){var k=yn(e,e.state.doc,d.sel);k&&!k.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(k))}return}w={start:c.from,endA:c.to,endB:c.to}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&w.start<=e.state.selection.from+2&&e.state.selection.from>=d.from?w.start=e.state.selection.from:w.endA=e.state.selection.to-2&&e.state.selection.to<=d.to&&(w.endB+=e.state.selection.to-w.endA,w.endA=e.state.selection.to)),S&&C<=11&&w.endB==w.start+1&&w.endA==w.start&&w.start>d.from&&" \xa0"==d.doc.textBetween(w.start-d.from-1,w.start-d.from+1)&&(w.start--,w.endA--,w.endB--);var x,O=d.doc.resolveNoCache(w.start-d.from),j=d.doc.resolveNoCache(w.endB-d.from),D=y.resolve(w.start),E=O.sameParent(j)&&O.parent.inlineContent&&D.end()>=w.endA;if((T&&e.input.lastIOSEnter>Date.now()-225&&(!E||o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName})))||!E&&O.posw.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||bn(r,!0,!1)n||bn(a,!0,!1)t.content.size?null:Ge(e,t.resolve(n.anchor),t.resolve(n.head))}function bn(e,t,n){for(var r=e.depth,o=t?e.end():e.pos;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n)for(var i=e.node(r).maybeChild(e.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}var wn=function(){function e(t,n){var r=this;Object(c.a)(this,e),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 Ot,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Cn),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=On(this),xn(this),this.nodeViews=Sn(this),this.docView=ke(this.state.doc,kn(this),cn(this),this.dom,this),this.domObserver=new hn(this,(function(e,t,n,o){return gn(r,e,t,n,o)})),this.domObserver.start(),function(e){var t=function(t){var n=kt[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=function(t){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||jt(e,t)||!e.editable&&t.type in xt||n(e,t)})};for(var n in kt)t(n);M&&e.dom.addEventListener("input",(function(){return null})),Ct(e)}(this),this.updatePluginViews()}return Object(d.a)(e,[{key:"composing",get:function(){return this.input.composing}},{key:"props",get:function(){if(this._props.state!=this.state){var e=this._props;for(var t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}},{key:"update",value:function(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ct(this),this._props=e,e.plugins&&(e.plugins.forEach(Cn),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)}},{key:"setProps",value:function(e){var t={};for(var n in this._props)t[n]=this._props[n];for(var r in t.state=this.state,e)t[r]=e[r];this.update(t)}},{key:"updateState",value:function(e){this.updateStateInner(e,this.state.plugins!=e.plugins)}},{key:"updateStateInner",value:function(e,t){var n=this,r=this.state,o=!1,i=!1;if(e.storedMarks&&this.composing&&(zt(this),i=!0),this.state=e,t){var a=Sn(this);(function(e,t){var n=0,r=0;for(var o in e){if(e[o]!=t[o])return!0;n++}for(var i in t)r++;return n!=r})(a,this.nodeViews)&&(this.nodeViews=a,o=!0),Ct(this)}this.editable=On(this),xn(this);var s=cn(this),l=kn(this),u=t?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",c=o||!this.docView.matchesNode(e.doc,l,s);!c&&e.selection.eq(r.selection)||(i=!0);var d="preserve"==u&&i&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,a=o+1;a=o-20){t=s,n=l.top;break}}}return{refDOM:t,refTop:n,stack:Z(e.dom)}}(this);if(i){this.domObserver.stop();var f=c&&(S||A)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(e,t){var n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(r.selection,e.selection);if(c){var h=A?this.trackWrites=this.domSelection().focusNode:null;!o&&this.docView.update(e.doc,l,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ke(e.doc,l,s,this.dom,this)),h&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){var t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return B(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?ze(this,f):(Ue(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),"reset"==u)this.dom.scrollTop=0;else if("to selection"==u){var m=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(function(e){return e(n)})));else if(e.selection instanceof p.NodeSelection){var v=this.docView.domAfterPos(e.selection.from);1==v.nodeType&&X(this,v.getBoundingClientRect(),m)}else X(this,this.coordsAtPos(e.selection.head,1),m)}else d&&function(e){var t=e.refDOM,n=e.refTop,r=e.stack,o=t?t.getBoundingClientRect().top:0;Q(r,0==o?0:o-n)}(d)}},{key:"destroyPluginViews",value:function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()}},{key:"updatePluginViews",value:function(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:1;return se(this,e,t)}},{key:"domAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.domFromPos(e,t)}},{key:"nodeDOM",value:function(e){var t=this.docView.descAt(e);return t?t.nodeDOM:null}},{key:"posAtDOM",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}},{key:"endOfTextblock",value:function(e,t){return me(this,t||this.state,e)}},{key:"destroy",value:function(){this.docView&&(!function(e){for(var t in e.domObserver.stop(),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,[],cn(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}},{key:"isDestroyed",get:function(){return null==this.docView}},{key:"dispatchEvent",value:function(e){return function(e,t){jt(e,t)||!kt[t.type]||!e.editable&&t.type in xt||kt[t.type](e,t)}(this,e)}},{key:"dispatch",value:function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}},{key:"domSelection",value:function(){return this.root.getSelection()}}]),e}();function kn(e){var t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(e.state)),n)for(var r in n)"class"==r&&(t.class+=" "+n[r]),"style"==r?t.style=(t.style?t.style+";":"")+n[r]:t[r]||"contenteditable"==r||"nodeName"==r||(t[r]=String(n[r]))})),[Yt.node(0,e.state.doc.content.size,t)]}function xn(e){if(e.markCursor){var t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Yt.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function On(e){return!e.someProp("editable",(function(t){return!1===t(e.state)}))}function Sn(e){var t=Object.create(null);function n(e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Cn(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")}for(var jn={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:"'",229:"q"},Dn={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},An="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),En="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Mn="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Tn="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Ln="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Nn=An&&(Tn||+An[1]<57)||Mn&&Tn,Pn=0;Pn<10;Pn++)jn[48+Pn]=jn[96+Pn]=String(Pn);for(Pn=1;Pn<=24;Pn++)jn[Pn+111]="F"+Pn;for(Pn=65;Pn<=90;Pn++)jn[Pn]=String.fromCharCode(Pn+32),Dn[Pn]=String.fromCharCode(Pn);for(var Rn in jn)Dn.hasOwnProperty(Rn)||(Dn[Rn]=jn[Rn]);var Hn="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Fn(e){var t,n,r,o,i=e.split(/-(?!$)/),a=i[i.length-1];"Space"==a&&(a=" ");for(var s=0;s127)&&(r=jn[n.keyCode])&&r!=o){var s=t[Vn(r,n,!0)];if(s&&s(e.state,e.dispatch,e))return!0}else if(i&&n.shiftKey){var l=t[Vn(o,n,!0)];if(l&&l(e.state,e.dispatch,e))return!0}return!1}}var _n=function(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)},In=function(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;var o=Wn(r);if(!o){var i=r.blockRange(),a=i&&Object(g.k)(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)}var s=o.nodeBefore;if(!s.type.spec.isolating&&nr(e,o,t))return!0;if(0==r.parent.content.size&&($n(s,"end")||p.NodeSelection.isSelectable(s))){var l=Object(g.l)(e.doc,r.before(),r.after(),v.Slice.empty);if(l&&l.slice.size2&&void 0!==arguments[2]&&arguments[2],r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}var qn=function(e,t,n){var r=e.selection,o=r.$head,i=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):o.parentOffset>0)return!1;i=Wn(o)}var a=i&&i.nodeBefore;return!(!a||!p.NodeSelection.isSelectable(a))&&(t&&t(e.tr.setSelection(p.NodeSelection.create(e.doc,i.pos-a.nodeSize)).scrollIntoView()),!0)};function Wn(e){if(!e.parent.type.spec.isolating)for(var 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}var Un=function(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset=0;t--){var n=e.node(t);if(e.index(t)+11&&n.after()!=n.end(-1)){var r=n.before();if(Object(g.g)(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}var o=n.blockRange(),i=o&&Object(g.k)(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)},tr=function(e,t){var n=e.selection,r=n.$from,o=n.$to;if(e.selection instanceof p.NodeSelection&&e.selection.node.isBlock)return!(!r.parentOffset||!Object(g.g)(e.doc,r.pos))&&(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(t){var i=o.parentOffset==o.parent.content.size,a=e.tr;(e.selection instanceof p.TextSelection||e.selection instanceof p.AllSelection)&&a.deleteSelection();var s=0==r.depth?null:Xn(r.node(-1).contentMatchAt(r.indexAfter(-1))),l=i&&s?[{type:s}]:void 0,u=Object(g.g)(a.doc,a.mapping.map(r.pos),1,l);if(l||u||!Object(g.g)(a.doc,a.mapping.map(r.pos),1,s?[{type:s}]:void 0)||(s&&(l=[{type:s}]),u=!0),u&&(a.split(a.mapping.map(r.pos),1,l),!i&&!r.parentOffset&&r.parent.type!=s)){var c=a.mapping.map(r.before()),d=a.doc.resolve(c);s&&r.node(-1).canReplaceWith(d.index(),d.index()+1,s)&&a.setNodeMarkup(a.mapping.map(r.before()),s)}t(a.scrollIntoView())}return!0};function nr(e,t,n){var r,o,i=t.nodeBefore,a=t.nodeAfter;if(i.type.spec.isolating||a.type.spec.isolating)return!1;if(function(e,t,n){var r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!!(r&&o&&r.type.compatibleContent(o.type))&&(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!(!t.parent.canReplace(i,i+1)||!o.isTextblock&&!Object(g.f)(e.doc,t.pos))&&(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0))}(e,t,n))return!0;var s=t.parent.canReplace(t.index(),t.index()+1);if(s&&(r=(o=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&o.matchType(r[0]||a.type).validEnd){if(n){for(var l=t.pos+a.nodeSize,u=v.Fragment.empty,c=r.length-1;c>=0;c--)u=v.Fragment.from(r[c].create(null,u));u=v.Fragment.from(i.copy(u));var d=e.tr.step(new g.b(t.pos-1,l,t.pos,l,new v.Slice(u,1,0),r.length,!0)),f=l+2*r.length;Object(g.f)(d.doc,f)&&d.join(f),n(d.scrollIntoView())}return!0}var h=p.Selection.findFrom(t,1),m=h&&h.$from.blockRange(h.$to),y=m&&Object(g.k)(m);if(null!=y&&y>=t.depth)return n&&n(e.tr.lift(m,y).scrollIntoView()),!0;if(s&&$n(a,"start",!0)&&$n(i,"end")){for(var b=i,w=[];w.push(b),!b.isTextblock;)b=b.lastChild;for(var k=a,x=1;!k.isTextblock;k=k.firstChild)x++;if(b.canReplace(b.childCount,b.childCount,k.content)){if(n){for(var O=v.Fragment.empty,S=w.length-1;S>=0;S--)O=v.Fragment.from(w[S].copy(O));n(e.tr.step(new g.b(t.pos-w.length,t.pos+a.nodeSize,t.pos+x,t.pos+a.nodeSize-x,new v.Slice(O,w.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function rr(e){return function(t,n){for(var r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(p.TextSelection.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}var or=rr(-1),ir=rr(1);function ar(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var o=n.selection,i=o.$from,a=o.$to,s=i.blockRange(a),l=s&&Object(g.i)(s,e,t);return!!l&&(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0)}}function sr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var o=n.selection,i=o.from,a=o.to,s=!1;return n.doc.nodesBetween(i,a,(function(r,o){if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{var i=n.doc.resolve(o),a=i.index();s=i.parent.canReplaceWith(a,a+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(i,a,e,t).scrollIntoView()),!0)}}function lr(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var o=n.selection,i=o.$from,a=o.$to,s=i.blockRange(a),l=!1,u=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;var c=n.doc.resolve(s.start-2);u=new v.NodeRange(c,c,s.depth),s.endIndex=0;a--)i=v.Fragment.from(n[a].type.create(n[a].attrs,i));e.step(new g.b(t.start-(r?2:0),t.end,t.start,t.end,new v.Slice(i,0,0),n.length,!0));for(var s=0,l=0;l0&&t.firstChild.type==e}));return!!a&&(!n||(o.node(a.depth-1).type==e?function(e,t,n,r){var o=e.tr,i=r.end,a=r.$to.end(r.depth);is;a--)i-=o.child(a).nodeSize,r.delete(i-1,i+1);var l=r.doc.resolve(n.start),u=l.nodeAfter;if(r.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;var c=0==n.startIndex,d=n.endIndex==o.childCount,f=l.node(-1),p=l.index(-1);if(!f.canReplace(p+(c?0:1),p+1,u.content.append(d?v.Fragment.empty:v.Fragment.from(o))))return!1;var h=l.pos,m=h+u.nodeSize;return r.step(new g.b(h-(c?1:0),m+(d?1:0),h+1,m-1,new v.Slice((c?v.Fragment.empty:v.Fragment.from(o.copy(v.Fragment.empty))).append(d?v.Fragment.empty:v.Fragment.from(o.copy(v.Fragment.empty))),c?0:1,d?0:1),c?0:1)),t(r.scrollIntoView()),!0}(t,n,a)))}}function gr(e){var t=e.state,n=e.transaction,r=n.selection,o=n.doc,i=n.storedMarks;return Object(f.a)(Object(f.a)({},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 i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}})}var yr=function(){function e(t){Object(c.a)(this,e),this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}return Object(d.a)(e,[{key:"hasCustomState",get:function(){return!!this.customState}},{key:"state",get:function(){return this.customState||this.editor.state}},{key:"commands",get:function(){var e=this,t=this.rawCommands,n=this.editor,r=this.state,o=n.view,i=r.tr,a=this.buildProps(i);return Object.fromEntries(Object.entries(t).map((function(t){var n=Object(u.a)(t,2),r=n[0],s=n[1];return[r,function(){var t=s.apply(void 0,arguments)(a);return i.getMeta("preventDispatch")||e.hasCustomState||o.dispatch(i),t}]})))}},{key:"chain",get:function(){var e=this;return function(){return e.createChain()}}},{key:"can",get:function(){var e=this;return function(){return e.createCan()}}},{key:"createChain",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.rawCommands,o=this.editor,i=this.state,a=o.view,s=[],l=!!e,c=e||i.tr,d=function(){return l||!n||c.getMeta("preventDispatch")||t.hasCustomState||a.dispatch(c),s.every((function(e){return!0===e}))},p=Object(f.a)(Object(f.a)({},Object.fromEntries(Object.entries(r).map((function(e){var r=Object(u.a)(e,2),o=r[0],i=r[1];return[o,function(){var e=t.buildProps(c,n),r=i.apply(void 0,arguments)(e);return s.push(r),p}]})))),{},{run:d});return p}},{key:"createCan",value:function(e){var t=this,n=this.rawCommands,r=this.state,o=void 0,i=e||r.tr,a=this.buildProps(i,o),s=Object.fromEntries(Object.entries(n).map((function(e){var t=Object(u.a)(e,2),n=t[0],r=t[1];return[n,function(){return r.apply(void 0,arguments)(Object(f.a)(Object(f.a)({},a),{},{dispatch:o}))}]})));return Object(f.a)(Object(f.a)({},s),{},{chain:function(){return t.createChain(i,o)}})}},{key:"buildProps",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.rawCommands,o=this.editor,i=this.state,a=o.view;i.storedMarks&&e.setStoredMarks(i.storedMarks);var s={tr:e,editor:o,view:a,state:gr({state:i,transaction:e}),dispatch:n?function(){}:void 0,chain:function(){return t.createChain(e)},can:function(){return t.createCan(e)},get commands(){return Object.fromEntries(Object.entries(r).map((function(e){var t=Object(u.a)(e,2),n=t[0],r=t[1];return[n,function(){return r.apply(void 0,arguments)(s)}]})))}};return s}}]),e}(),br=function(){function e(){Object(c.a)(this,e),this.callbacks={}}return Object(d.a)(e,[{key:"on",value:function(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:void 0;if(jr(e)){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o0&&void 0!==arguments[0]?arguments[0]:{};return 0===Object.keys(e).length&&e.constructor===Object}(r))&&(null!==r&&void 0!==r)})))}function Mr(e){var t,n=xr(e),r=kr(e),o=r.nodeExtensions,i=r.markExtensions,a=null===(t=o.find((function(e){return wr(e,"topNode")})))||void 0===t?void 0:t.name,s=Object.fromEntries(o.map((function(t){var r=n.filter((function(e){return e.type===t.name})),o={name:t.name,options:t.options,storage:t.storage},i=e.reduce((function(e,n){var r=wr(n,"extendNodeSchema",o);return Object(f.a)(Object(f.a)({},e),r?r(t):{})}),{}),a=Er(Object(f.a)(Object(f.a)({},i),{},{content:Dr(wr(t,"content",o)),marks:Dr(wr(t,"marks",o)),group:Dr(wr(t,"group",o)),inline:Dr(wr(t,"inline",o)),atom:Dr(wr(t,"atom",o)),selectable:Dr(wr(t,"selectable",o)),draggable:Dr(wr(t,"draggable",o)),code:Dr(wr(t,"code",o)),defining:Dr(wr(t,"defining",o)),isolating:Dr(wr(t,"isolating",o)),attrs:Object.fromEntries(r.map((function(e){var t;return[e.name,{default:null===(t=null===e||void 0===e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))})),s=Dr(wr(t,"parseHTML",o));s&&(a.parseDOM=s.map((function(e){return Ar(e,r)})));var l=wr(t,"renderHTML",o);l&&(a.toDOM=function(e){return l({node:e,HTMLAttributes:Cr(e,r)})});var u=wr(t,"renderText",o);return u&&(a.toText=u),[t.name,a]}))),l=Object.fromEntries(i.map((function(t){var r=n.filter((function(e){return e.type===t.name})),o={name:t.name,options:t.options,storage:t.storage},i=e.reduce((function(e,n){var r=wr(n,"extendMarkSchema",o);return Object(f.a)(Object(f.a)({},e),r?r(t):{})}),{}),a=Er(Object(f.a)(Object(f.a)({},i),{},{inclusive:Dr(wr(t,"inclusive",o)),excludes:Dr(wr(t,"excludes",o)),group:Dr(wr(t,"group",o)),spanning:Dr(wr(t,"spanning",o)),code:Dr(wr(t,"code",o)),attrs:Object.fromEntries(r.map((function(e){var t;return[e.name,{default:null===(t=null===e||void 0===e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))})),s=Dr(wr(t,"parseHTML",o));s&&(a.parseDOM=s.map((function(e){return Ar(e,r)})));var l=wr(t,"renderHTML",o);return l&&(a.toDOM=function(e){return l({mark:e,HTMLAttributes:Cr(e,r)})}),[t.name,a]})));return new v.Schema({topNode:a,nodes:s,marks:l})}function Tr(e,t){return t.nodes[e]||t.marks[e]||null}function Lr(e,t){return Array.isArray(t)?t.some((function(t){return("string"===typeof t?t:t.name)===e.name})):t}function Nr(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var Pr=Object(d.a)((function e(t){Object(c.a)(this,e),this.find=t.find,this.handler=t.handler}));function Rr(e){var t,n=e.editor,r=e.from,o=e.to,i=e.text,a=e.rules,s=e.plugin,l=n.view;if(l.composing)return!1;var u=l.state.doc.resolve(r);if(u.parent.type.spec.code||(null===(t=u.nodeBefore||u.nodeAfter)||void 0===t?void 0:t.marks.find((function(e){return e.type.spec.code}))))return!1;var c=!1,d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n="";return e.parent.nodesBetween(Math.max(0,e.parentOffset-t),e.parentOffset,(function(t,r,o,i){var a,s,l;n+=(null===(s=(a=t.type.spec).toText)||void 0===s?void 0:s.call(a,{node:t,pos:r,parent:o,index:i}))||(null===(l=e.nodeBefore)||void 0===l?void 0:l.text)||"%leaf%"})),n}(u)+i;return a.forEach((function(e){if(!c){var t=function(e,t){if(Nr(t))return t.exec(e);var n=t(e);if(!n)return null;var r=[];return r.push(n.text),r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r}(d,e.find);if(t){var a=l.state.tr,u=gr({state:l.state,transaction:a}),f={from:r-(t[0].length-i.length),to:o},p=new yr({editor:n,state:u}),h=p.commands,m=p.chain,v=p.can;null!==e.handler({state:u,range:f,match:t,commands:h,chain:m,can:v})&&a.steps.length&&(a.setMeta(s,{transform:a,from:r,to:o,text:i}),l.dispatch(a),c=!0)}}})),c}function Hr(e){var t=e.editor,n=e.rules,r=new p.Plugin({state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(r);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(e,o,i,a){return Rr({editor:t,from:o,to:i,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:function(e){return setTimeout((function(){var o=e.state.selection.$cursor;o&&Rr({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1}},handleKeyDown:function(e,o){if("Enter"!==o.key)return!1;var i=e.state.selection.$cursor;return!!i&&Rr({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}var Fr=Object(d.a)((function e(t){Object(c.a)(this,e),this.find=t.find,this.handler=t.handler}));function Vr(e){var t=e.editor,n=e.state,r=e.from,o=e.to,i=e.rule,a=new yr({editor:t,state:n}),s=a.commands,u=a.chain,c=a.can,d=[];return n.doc.nodesBetween(r,o,(function(e,t){if(e.isTextblock&&!e.type.spec.code){var a=Math.max(r,t),f=Math.min(o,t+e.content.size);(function(e,t){if(Nr(t))return Object(l.a)(e.matchAll(t));var n=t(e);return n?n.map((function(t){var 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(a-t,f-t,void 0,"\ufffc"),i.find).forEach((function(e){if(void 0!==e.index){var t=a+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},l=i.handler({state:n,range:o,match:e,commands:s,chain:u,can:c});d.push(l)}}))}})),d.every((function(e){return null!==e}))}var zr=function(){function e(t,n){var r=this;Object(c.a)(this,e),this.splittableMarks=[],this.editor=n,this.extensions=e.resolve(t),this.schema=Mr(this.extensions),this.extensions.forEach((function(e){var t;r.editor.extensionStorage[e.name]=e.storage;var n={name:e.name,options:e.options,storage:e.storage,editor:r.editor,type:Tr(e.name,r.schema)};"mark"===e.type&&((null===(t=Dr(wr(e,"keepOnSplit",n)))||void 0===t||t)&&r.splittableMarks.push(e.name));var o=wr(e,"onBeforeCreate",n);o&&r.editor.on("beforeCreate",o);var i=wr(e,"onCreate",n);i&&r.editor.on("create",i);var a=wr(e,"onUpdate",n);a&&r.editor.on("update",a);var s=wr(e,"onSelectionUpdate",n);s&&r.editor.on("selectionUpdate",s);var l=wr(e,"onTransaction",n);l&&r.editor.on("transaction",l);var u=wr(e,"onFocus",n);u&&r.editor.on("focus",u);var c=wr(e,"onBlur",n);c&&r.editor.on("blur",c);var d=wr(e,"onDestroy",n);d&&r.editor.on("destroy",d)}))}return Object(d.a)(e,[{key:"commands",get:function(){var e=this;return this.extensions.reduce((function(t,n){var r=wr(n,"addCommands",{name:n.name,options:n.options,storage:n.storage,editor:e.editor,type:Tr(n.name,e.schema)});return r?Object(f.a)(Object(f.a)({},t),r()):t}),{})}},{key:"plugins",get:function(){var t=this,n=this.editor,r=e.sort(Object(l.a)(this.extensions).reverse()),o=[],i=[],a=r.map((function(e){var r={name:e.name,options:e.options,storage:e.storage,editor:n,type:Tr(e.name,t.schema)},a=[],s=wr(e,"addKeyboardShortcuts",r);if(s){var c=zn(Object.fromEntries(Object.entries(s()).map((function(e){var t=Object(u.a)(e,2),r=t[0],o=t[1];return[r,function(){return o({editor:n})}]}))));a.push(c)}var d=wr(e,"addInputRules",r);Lr(e,n.options.enableInputRules)&&d&&o.push.apply(o,Object(l.a)(d()));var f=wr(e,"addPasteRules",r);Lr(e,n.options.enablePasteRules)&&f&&i.push.apply(i,Object(l.a)(f()));var p=wr(e,"addProseMirrorPlugins",r);if(p){var h=p();a.push.apply(a,Object(l.a)(h))}return a})).flat();return[Hr({editor:n,rules:o})].concat(Object(l.a)(function(e){var t=e.editor,n=e.rules,r=null,o=!1,i=!1;return n.map((function(e){return new p.Plugin({view:function(e){var t=function(t){var n;r=(null===(n=e.dom.parentElement)||void 0===n?void 0:n.contains(t.target))?e.dom.parentElement:null};return window.addEventListener("dragstart",t),{destroy:function(){window.removeEventListener("dragstart",t)}}},props:{handleDOMEvents:{drop:function(e){return i=r===e.dom.parentElement,!1},paste:function(e,t){var n,r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return o=!!(null===r||void 0===r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:function(n,r,a){var s=n[0],l="paste"===s.getMeta("uiEvent")&&!o,u="drop"===s.getMeta("uiEvent")&&!i;if(l||u){var c=r.doc.content.findDiffStart(a.doc.content),d=r.doc.content.findDiffEnd(a.doc.content);if("number"===typeof c&&d&&c!==d.b){var f=a.tr,p=gr({state:a,transaction:f});if(Vr({editor:t,state:p,from:Math.max(c-1,0),to:d.b,rule:e})&&f.steps.length)return f}}}})}))}({editor:n,rules:i})),Object(l.a)(a))}},{key:"attributes",get:function(){return xr(this.extensions)}},{key:"nodeViews",get:function(){var e=this,t=this.editor,n=kr(this.extensions).nodeExtensions;return Object.fromEntries(n.filter((function(e){return!!wr(e,"addNodeView")})).map((function(n){var r=e.attributes.filter((function(e){return e.type===n.name})),o={name:n.name,options:n.options,storage:n.storage,editor:t,type:Or(n.name,e.schema)},i=wr(n,"addNodeView",o);if(!i)return[];return[n.name,function(e,o,a,s){var l=Cr(e,r);return i()({editor:t,node:e,getPos:a,decorations:s,HTMLAttributes:l,extension:n})}]})))}}],[{key:"resolve",value:function(t){var n=e.sort(e.flatten(t)),r=function(e){var t=e.filter((function(t,n){return e.indexOf(t)!==n}));return Object(l.a)(new Set(t))}(n.map((function(e){return e.name})));return r.length&&console.warn("[tiptap warn]: Duplicate extension names found: [".concat(r.map((function(e){return"'".concat(e,"'")})).join(", "),"]. This can lead to issues.")),n}},{key:"flatten",value:function(e){var t=this;return e.map((function(e){var n=wr(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return n?[e].concat(Object(l.a)(t.flatten(n()))):e})).flat(10)}},{key:"sort",value:function(e){return e.sort((function(e,t){var n=wr(e,"priority")||100,r=wr(t,"priority")||100;return n>r?-1:n0&&void 0!==arguments[0]?arguments[0]:{};Object(c.a)(this,e),this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=Object(f.a)(Object(f.a)({},this.config),t),this.name=this.config.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Dr(wr(this,"addOptions",{name:this.name}))),this.storage=Dr(wr(this,"addStorage",{name:this.name,options:this.options}))||{}}return Object(d.a)(e,[{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend();return t.options=_r(this.options,e),t.storage=Dr(wr(t,"addStorage",{name:t.name,options:t.options})),t}},{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new e(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(n.name,'".')),n.options=Dr(wr(n,"addOptions",{name:n.name})),n.storage=Dr(wr(n,"addStorage",{name:n.name,options:n.options})),n}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t)}}]),e}();function $r(e,t,n){var r=t.from,o=t.to,i=n||{},a=i.blockSeparator,s=void 0===a?"\n\n":a,l=i.textSerializers,u=void 0===l?{}:l,c="",d=!0;return e.nodesBetween(r,o,(function(e,n,i,a){var l,f=null===u||void 0===u?void 0:u[e.type.name];f?(e.isBlock&&!d&&(c+=s,d=!0),i&&(c+=f({node:e,pos:n,parent:i,index:a,range:t}))):e.isText?(c+=null===(l=null===e||void 0===e?void 0:e.text)||void 0===l?void 0:l.slice(Math.max(r,n)-n,o-n),d=!1):e.isBlock&&!d&&(c+=s,d=!0)})),c}function qr(e){return Object.fromEntries(Object.entries(e.nodes).filter((function(e){return Object(u.a)(e,2)[1].spec.toText})).map((function(e){var t=Object(u.a)(e,2);return[t[0],t[1].spec.toText]})))}var Wr=Ir.create({name:"clipboardTextSerializer",addProseMirrorPlugins:function(){var e=this;return[new p.Plugin({key:new p.PluginKey("clipboardTextSerializer"),props:{clipboardTextSerializer:function(){var t=e.editor,n=t.state,r=t.schema,o=n.doc,i=n.selection.ranges,a=Math.min.apply(Math,Object(l.a)(i.map((function(e){return e.$from.pos})))),s=Math.max.apply(Math,Object(l.a)(i.map((function(e){return e.$to.pos}))));return $r(o,{from:a,to:s},{textSerializers:qr(r)})}}})]}});function Ur(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{strict:!0},r=Object.keys(t);return!r.length||r.every((function(r){return n.strict?t[r]===e[r]:Nr(t[r])?t[r].test(e[r]):t[r]===e[r]}))}function Kr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.find((function(e){return e.type===t&&Ur(e.attrs,n)}))}function Gr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!!Kr(e,t,n)}function Jr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t){var r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),r.node){var o=Kr(Object(l.a)(r.node.marks),t,n);if(o){var i=r.index,a=e.start()+r.offset,s=i+1,u=a+r.node.nodeSize;for(Kr(Object(l.a)(r.node.marks),t,n);i>0&&o.isInSet(e.parent.child(i-1).marks);)i-=1,a-=e.parent.child(i).nodeSize;for(;s0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Math.min(Math.max(e,t),n)}function eo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)return null;var n=p.Selection.atStart(e),r=p.Selection.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;var o=n.from,i=r.to;return"all"===t?p.TextSelection.create(e,Qr(0,o,i),Qr(e.content.size,o,i)):p.TextSelection.create(e,Qr(t,o,i),Qr(t,o,i))}function to(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function no(e){var t="".concat(e,"");return(new window.DOMParser).parseFromString(t,"text/html").body}function ro(e,t,n){if(n=Object(f.a)({slice:!0,parseOptions:{}},n),"object"===typeof e&&null!==e)try{return Array.isArray(e)?v.Fragment.fromArray(e.map((function(e){return t.nodeFromJSON(e)}))):t.nodeFromJSON(e)}catch(o){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),ro("",t,n)}if("string"===typeof e){var r=v.DOMParser.fromSchema(t);return n.slice?r.parseSlice(no(e),n.parseOptions).content:r.parse(no(e),n.parseOptions)}return ro("",t,n)}function oo(){return"undefined"!==typeof navigator&&/Mac/.test(navigator.platform)}function io(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.selection,o=r.from,i=r.to,a=r.empty,s=t?Or(t,e.schema):null,l=[];e.doc.nodesBetween(o,i,(function(e,t){if(!e.isText){var n=Math.max(o,t),r=Math.min(i,t+e.nodeSize);l.push({node:e,from:n,to:r})}}));var u=i-o,c=l.filter((function(e){return!s||s.name===e.node.type.name})).filter((function(e){return Ur(e.node.attrs,n,{strict:!1})}));if(a)return!!c.length;var d=c.reduce((function(e,t){return e+t.to-t.from}),0);return d>=u}function ao(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function so(e,t){var n="string"===typeof t?[t]:t;return Object.keys(e).reduce((function(t,r){return n.includes(r)||(t[r]=e[r]),t}),{})}function lo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return ro(e,t,{slice:!1,parseOptions:n})}function uo(e,t){var n=Yr(t,e.schema),r=e.selection,o=r.from,i=r.to,a=r.empty,s=[];a?(e.storedMarks&&s.push.apply(s,Object(l.a)(e.storedMarks)),s.push.apply(s,Object(l.a)(e.selection.$head.marks()))):e.doc.nodesBetween(o,i,(function(e){s.push.apply(s,Object(l.a)(e.marks))}));var u=s.find((function(e){return e.type.name===n.name}));return u?Object(f.a)({},u.attrs):{}}function co(e,t,n){return Object.fromEntries(Object.entries(n).filter((function(n){var r=Object(u.a)(n,1)[0],o=e.find((function(e){return e.type===t&&e.name===r}));return!!o&&o.attribute.keepOnSplit})))}function fo(e){for(var t=0;t0;n-=1){var r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function mo(e){return function(t){return ho(t.$from,e)}}function vo(e,t){var n=kr(t).nodeExtensions.find((function(t){return t.name===e}));if(!n)return!1;var r=Dr(wr(n,"group",{name:n.name,options:n.options,storage:n.storage}));return"string"===typeof r&&r.split(" ").includes("list")}var go=function(e,t){var n=mo((function(e){return e.type===t}))(e.selection);if(!n)return!0;var r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;var o=e.doc.nodeAt(r);return n.node.type!==(null===o||void 0===o?void 0:o.type)||!Object(g.f)(e.doc,n.pos)||(e.join(n.pos),!0)},yo=function(e,t){var n=mo((function(e){return e.type===t}))(e.selection);if(!n)return!0;var r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;var o=e.doc.nodeAt(r);return n.node.type!==(null===o||void 0===o?void 0:o.type)||!Object(g.f)(e.doc,r)||(e.join(r),!0)};function bo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.selection,o=r.empty,i=r.ranges,a=t?Yr(t,e.schema):null;if(o)return!!(e.storedMarks||e.selection.$from.marks()).filter((function(e){return!a||a.name===e.type.name})).find((function(e){return Ur(e.attrs,n,{strict:!1})}));var s=0,u=[];if(i.forEach((function(t){var n=t.$from,r=t.$to,o=n.pos,i=r.pos;e.doc.nodesBetween(o,i,(function(e,t){if(e.isText||e.marks.length){var n=Math.max(o,t),r=Math.min(i,t+e.nodeSize);s+=r-n,u.push.apply(u,Object(l.a)(e.marks.map((function(e){return{mark:e,from:n,to:r}}))))}}))})),0===s)return!1;var c=u.filter((function(e){return!a||a.name===e.mark.type.name})).filter((function(e){return Ur(e.mark.attrs,n,{strict:!1})})).reduce((function(e,t){return e+t.to-t.from}),0),d=u.filter((function(e){return!a||e.mark.type!==a&&e.mark.type.excludes(a)})).reduce((function(e,t){return e+t.to-t.from}),0),f=c>0?c+d:c;return f>=s}var wo=Object.freeze({__proto__:null,blur:function(){return function(e){var t=e.editor,n=e.view;return requestAnimationFrame((function(){var e;t.isDestroyed||(n.dom.blur(),null===(e=null===window||void 0===window?void 0:window.getSelection())||void 0===e||e.removeAllRanges())})),!0}},clearContent:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(t){return t.commands.setContent("",e)}},clearNodes:function(){return function(e){var t=e.state,n=e.tr,r=e.dispatch,o=n.selection.ranges;return!r||(o.forEach((function(e){var r=e.$from,o=e.$to;t.doc.nodesBetween(r.pos,o.pos,(function(e,t){if(!e.type.isText){var r=n.doc,o=n.mapping,i=r.resolve(o.map(t)),a=r.resolve(o.map(t+e.nodeSize)),s=i.blockRange(a);if(s){var l=Object(g.k)(s);if(e.type.isTextblock){var u=i.parent.contentMatchAt(i.index()).defaultType;n.setNodeMarkup(s.start,u)}(l||0===l)&&n.lift(s,l)}}}))})),!0)}},command:function(e){return function(t){return e(t)}},createParagraphNear:function(){return function(e){var t=e.state,n=e.dispatch;return Qn(t,n)}},deleteNode:function(e){return function(t){for(var n=t.tr,r=t.state,o=t.dispatch,i=Or(e,r.schema),a=n.selection.$anchor,s=a.depth;s>0;s-=1){if(a.node(s).type===i){if(o){var l=a.before(s),u=a.after(s);n.delete(l,u).scrollIntoView()}return!0}}return!1}},deleteRange:function(e){return function(t){var n=t.tr,r=t.dispatch,o=e.from,i=e.to;return r&&n.delete(o,i),!0}},deleteSelection:function(){return function(e){var t=e.state,n=e.dispatch;return _n(t,n)}},enter:function(){return function(e){return e.commands.keyboardShortcut("Enter")}},exitCode:function(){return function(e){var t=e.state,n=e.dispatch;return Zn(t,n)}},extendMarkRange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=Yr(e,o.schema),s=r.doc,l=r.selection,u=l.$from,c=l.from,d=l.to;if(i){var f=Jr(u,a,t);if(f&&f.from<=c&&f.to>=d){var h=p.TextSelection.create(s,f.from,f.to);r.setSelection(h)}}return!0}},first:function(e){return function(t){for(var n="function"===typeof e?e(t):e,r=0;r0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.editor,o=n.view,i=n.tr,a=n.dispatch;t=Object(f.a)({scrollIntoView:!0},t);var s=function(){to()&&o.dom.focus(),requestAnimationFrame((function(){r.isDestroyed||(o.focus(),(null===t||void 0===t?void 0:t.scrollIntoView)&&r.commands.scrollIntoView())}))};if(o.hasFocus()&&null===e||!1===e)return!0;if(a&&null===e&&!Zr(r.state.selection))return s(),!0;var l=eo(i.doc,e)||r.state.selection,u=r.state.selection.eq(l);return a&&(u||i.setSelection(l),u&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0}},forEach:function(e,t){return function(n){return e.every((function(e,r){return t(e,Object(f.a)(Object(f.a)({},n),{},{index:r}))}))}},insertContent:function(e,t){return function(n){var r=n.tr;return n.commands.insertContentAt({from:r.selection.from,to:r.selection.to},e,t)}},insertContentAt:function(e,t,n){return function(r){var o=r.tr,i=r.dispatch,a=r.editor;if(i){n=Object(f.a)({parseOptions:{},updateSelection:!0},n);var s=ro(t,a.schema,{parseOptions:Object(f.a)({preserveWhitespace:"full"},n.parseOptions)});if("<>"===s.toString())return!0;var l="number"===typeof e?{from:e,to:e}:e,u=l.from,c=l.to,d=!0,h=!0;if((s.toString().startsWith("<")?s:[s]).forEach((function(e){e.check(),d=!!d&&(e.isText&&0===e.marks.length),h=!!h&&e.isBlock})),u===c&&h){var m=o.doc.resolve(u).parent;m.isTextblock&&!m.type.spec.code&&!m.childCount&&(u-=1,c+=1)}d?o.insertText(t,u,c):o.replaceWith(u,c,s),n.updateSelection&&function(e,t,n){var r=e.steps.length-1;if(!(r1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch;return!!io(r,Or(e,r.schema),t)&&Jn(r,o)}},liftEmptyBlock:function(){return function(e){var t=e.state,n=e.dispatch;return er(t,n)}},liftListItem:function(e){return function(t){var n=t.state,r=t.dispatch;return vr(Or(e,n.schema))(n,r)}},newlineInCode:function(){return function(e){var t=e.state,n=e.dispatch;return Yn(t,n)}},resetAttributes:function(e,t){return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=null,s=null,l=ao("string"===typeof e?e:e.name,o.schema);return!!l&&("node"===l&&(a=Or(e,o.schema)),"mark"===l&&(s=Yr(e,o.schema)),i&&r.selection.ranges.forEach((function(e){o.doc.nodesBetween(e.$from.pos,e.$to.pos,(function(e,n){a&&a===e.type&&r.setNodeMarkup(n,void 0,so(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((function(o){s===o.type&&r.addMark(n,n+e.nodeSize,s.create(so(o.attrs,t)))}))}))})),!0)}},scrollIntoView:function(){return function(e){var t=e.tr;return e.dispatch&&t.scrollIntoView(),!0}},selectAll:function(){return function(e){var t=e.tr;return e.commands.setTextSelection({from:0,to:t.doc.content.size})}},selectNodeBackward:function(){return function(e){var t=e.state,n=e.dispatch;return qn(t,n)}},selectNodeForward:function(){return function(e){var t=e.state,n=e.dispatch;return Kn(t,n)}},selectParentNode:function(){return function(e){return function(e,t){var n,r=e.selection,o=r.$from,i=r.to,a=o.sharedDepth(i);return 0!=a&&(n=o.before(a),t&&t(e.tr.setSelection(p.NodeSelection.create(e.doc,n))),!0)}(e.state,e.dispatch)}},selectTextblockEnd:function(){return function(e){var t=e.state,n=e.dispatch;return ir(t,n)}},selectTextblockStart:function(){return function(e){var t=e.state,n=e.dispatch;return or(t,n)}},setContent:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o=r.tr,i=r.editor,a=r.dispatch,s=o.doc,l=lo(e,i.schema,n);return a&&o.replaceWith(0,s.content.size,l).setMeta("preventUpdate",!t),!0}},setMark:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=r.selection,s=a.empty,l=a.ranges,u=Yr(e,o.schema);if(i)if(s){var c=uo(o,u);r.addStoredMark(u.create(Object(f.a)(Object(f.a)({},c),t)))}else l.forEach((function(e){var n=e.$from.pos,i=e.$to.pos;o.doc.nodesBetween(n,i,(function(e,o){var a=Math.max(o,n),s=Math.min(o+e.nodeSize,i);e.marks.find((function(e){return e.type===u}))?e.marks.forEach((function(e){u===e.type&&r.addMark(a,s,u.create(Object(f.a)(Object(f.a)({},e.attrs),t)))})):r.addMark(a,s,u.create(t))}))}));return!0}},setMeta:function(e,t){return function(n){return n.tr.setMeta(e,t),!0}},setNode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch,i=n.chain,a=Or(e,r.schema);return a.isTextblock?i().command((function(e){var n=e.commands;return!!sr(a,t)(r)||n.clearNodes()})).command((function(e){var n=e.state;return sr(a,t)(n,o)})).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)}},setNodeSelection:function(e){return function(t){var n=t.tr;if(t.dispatch){var r=n.doc,o=p.Selection.atStart(r).from,i=p.Selection.atEnd(r).to,a=Qr(e,o,i),s=p.NodeSelection.create(r,a);n.setSelection(s)}return!0}},setTextSelection:function(e){return function(t){var n=t.tr;if(t.dispatch){var r=n.doc,o="number"===typeof e?{from:e,to:e}:e,i=o.from,a=o.to,s=p.TextSelection.atStart(r).from,l=p.TextSelection.atEnd(r).to,u=Qr(i,s,l),c=Qr(a,s,l),d=p.TextSelection.create(r,u,c);n.setSelection(d)}return!0}},sinkListItem:function(e){return function(t){var n,r=t.state,o=t.dispatch,i=Or(e,r.schema);return(n=i,function(e,t){var r=e.selection,o=r.$from,i=r.$to,a=o.blockRange(i,(function(e){return e.childCount>0&&e.firstChild.type==n}));if(!a)return!1;var s=a.startIndex;if(0==s)return!1;var l=a.parent,u=l.child(s-1);if(u.type!=n)return!1;if(t){var c=u.lastChild&&u.lastChild.type==l.type,d=v.Fragment.from(c?n.create():null),f=new v.Slice(v.Fragment.from(n.create(null,v.Fragment.from(l.type.create(null,d)))),c?3:1,0),p=a.start,h=a.end;t(e.tr.step(new g.b(p-(c?3:1),h,p,h,f,1,!0)).scrollIntoView())}return!0})(r,o)}},splitBlock:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.keepMarks,n=void 0===t||t;return function(e){var t=e.tr,r=e.state,o=e.dispatch,i=e.editor,a=t.selection,s=t.doc,l=a.$from,u=a.$to,c=co(i.extensionManager.attributes,l.node().type.name,l.node().attrs);if(a instanceof p.NodeSelection&&a.node.isBlock)return!(!l.parentOffset||!Object(g.g)(s,l.pos))&&(o&&(n&&po(r,i.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(o){var d=u.parentOffset===u.parent.content.size;a instanceof p.TextSelection&&t.deleteSelection();var f=0===l.depth?void 0:fo(l.node(-1).contentMatchAt(l.indexAfter(-1))),h=d&&f?[{type:f,attrs:c}]:void 0,m=Object(g.g)(t.doc,t.mapping.map(l.pos),1,h);if(h||m||!Object(g.g)(t.doc,t.mapping.map(l.pos),1,f?[{type:f}]:void 0)||(m=!0,h=f?[{type:f,attrs:c}]:void 0),m&&(t.split(t.mapping.map(l.pos),1,h),f&&!d&&!l.parentOffset&&l.parent.type!==f)){var v=t.mapping.map(l.before()),y=t.doc.resolve(v);l.node(-1).canReplaceWith(y.index(),y.index()+1,f)&&t.setNodeMarkup(t.mapping.map(l.before()),f)}n&&po(r,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0}},splitListItem:function(e){return function(t){var n,r=t.tr,o=t.state,i=t.dispatch,a=t.editor,s=Or(e,o.schema),l=o.selection,u=l.$from,c=l.$to,d=o.selection.node;if(d&&d.isBlock||u.depth<2||!u.sameParent(c))return!1;var f=u.node(-1);if(f.type!==s)return!1;var h=a.extensionManager.attributes;if(0===u.parent.content.size&&u.node(-1).childCount===u.indexAfter(-1)){if(2===u.depth||u.node(-3).type!==s||u.index(-2)!==u.node(-2).childCount-1)return!1;if(i){for(var m=v.Fragment.empty,y=u.index(-1)?1:u.index(-2)?2:3,b=u.depth-y;b>=u.depth-3;b-=1)m=v.Fragment.from(u.node(b).copy(m));var w=u.indexAfter(-1)-1)return!1;e.isTextblock&&0===e.content.size&&(S=t+1)})),S>-1&&r.setSelection(p.TextSelection.near(r.doc.resolve(S))),r.scrollIntoView()}return!0}var C=c.pos===u.end()?f.contentMatchAt(0).defaultType:null,j=co(h,f.type.name,f.attrs),D=co(h,u.node().type.name,u.node().attrs);r.delete(u.pos,c.pos);var A=C?[{type:s,attrs:j},{type:C,attrs:D}]:[{type:s,attrs:j}];return!!Object(g.g)(r.doc,u.pos,2)&&(i&&r.split(u.pos,2,A).scrollIntoView(),!0)}},toggleList:function(e,t){return function(n){var r=n.editor,o=n.tr,i=n.state,a=n.dispatch,s=n.chain,l=n.commands,u=n.can,c=r.extensionManager.extensions,d=Or(e,i.schema),f=Or(t,i.schema),p=i.selection,h=p.$from,m=p.$to,v=h.blockRange(m);if(!v)return!1;var g=mo((function(e){return vo(e.type.name,c)}))(p);if(v.depth>=1&&g&&v.depth-g.depth<=1){if(g.node.type===d)return l.liftListItem(f);if(vo(g.node.type.name,c)&&d.validContent(g.node.content)&&a)return s().command((function(){return o.setNodeMarkup(g.pos,d),!0})).command((function(){return go(o,d)})).command((function(){return yo(o,d)})).run()}return s().command((function(){return!!u().wrapInList(d)||l.clearNodes()})).wrapInList(d).command((function(){return go(o,d)})).command((function(){return yo(o,d)})).run()}},toggleMark:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o=r.state,i=r.commands,a=n.extendEmptyMarkRange,s=void 0!==a&&a,l=Yr(e,o.schema);return bo(o,l,t)?i.unsetMark(l,{extendEmptyMarkRange:s}):i.setMark(l,t)}},toggleNode:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o=r.state,i=r.commands,a=Or(e,o.schema),s=Or(t,o.schema);return io(o,a,n)?i.setNode(s):i.setNode(a,n)}},toggleWrap:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.commands,i=Or(e,r.schema);return io(r,i,t)?o.lift(i):o.wrapIn(i,t)}},undoInputRule:function(){return function(e){for(var t=e.state,n=e.dispatch,r=t.plugins,o=0;o=0;u-=1)s.step(l.steps[u].invert(l.docs[u]));if(a.text){var c=s.doc.resolve(a.from).marks();s.replaceWith(a.from,a.to,t.schema.text(a.text,c))}else s.delete(a.from,a.to)}return!0}}return!1}},unsetAllMarks:function(){return function(e){var t=e.tr,n=e.dispatch,r=t.selection,o=r.empty,i=r.ranges;return o||n&&i.forEach((function(e){t.removeMark(e.$from.pos,e.$to.pos)})),!0}},unsetMark:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r,o=n.tr,i=n.state,a=n.dispatch,s=t.extendEmptyMarkRange,l=void 0!==s&&s,u=o.selection,c=Yr(e,i.schema),d=u.$from,f=u.empty,p=u.ranges;if(!a)return!0;if(f&&l){var h=u.from,m=u.to,v=null===(r=d.marks().find((function(e){return e.type===c})))||void 0===r?void 0:r.attrs,g=Jr(d,c,v);g&&(h=g.from,m=g.to),o.removeMark(h,m,c)}else p.forEach((function(e){o.removeMark(e.$from.pos,e.$to.pos,c)}));return o.removeStoredMark(c),!0}},updateAttributes:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=null,s=null,l=ao("string"===typeof e?e:e.name,o.schema);return!!l&&("node"===l&&(a=Or(e,o.schema)),"mark"===l&&(s=Yr(e,o.schema)),i&&r.selection.ranges.forEach((function(e){var n=e.$from.pos,i=e.$to.pos;o.doc.nodesBetween(n,i,(function(e,o){a&&a===e.type&&r.setNodeMarkup(o,void 0,Object(f.a)(Object(f.a)({},e.attrs),t)),s&&e.marks.length&&e.marks.forEach((function(a){if(s===a.type){var l=Math.max(o,n),u=Math.min(o+e.nodeSize,i);r.addMark(l,u,s.create(Object(f.a)(Object(f.a)({},a.attrs),t)))}}))}))})),!0)}},wrapIn:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch;return ar(Or(e,r.schema),t)(r,o)}},wrapInList:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch;return hr(Or(e,r.schema),t)(r,o)}}}),ko=Ir.create({name:"commands",addCommands:function(){return Object(f.a)({},wo)}}),xo=Ir.create({name:"editable",addProseMirrorPlugins:function(){var e=this;return[new p.Plugin({key:new p.PluginKey("editable"),props:{editable:function(){return e.editor.options.editable}}})]}}),Oo=Ir.create({name:"focusEvents",addProseMirrorPlugins:function(){var e=this.editor;return[new p.Plugin({key:new p.PluginKey("focusEvents"),props:{handleDOMEvents:{focus:function(t,n){e.isFocused=!0;var r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:function(t,n){e.isFocused=!1;var r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),So=Ir.create({name:"keymap",addKeyboardShortcuts:function(){var e=this,t=function(){return e.editor.commands.first((function(e){var t=e.commands;return[function(){return t.undoInputRule()},function(){return t.command((function(e){var n=e.tr,r=n.selection,o=n.doc,i=r.empty,a=r.$anchor,s=a.pos,l=a.parent,u=p.Selection.atStart(o).from===s;return!(!(i&&u&&l.type.isTextblock)||l.textContent.length)&&t.clearNodes()}))},function(){return t.deleteSelection()},function(){return t.joinBackward()},function(){return t.selectNodeBackward()}]}))},n=function(){return e.editor.commands.first((function(e){var t=e.commands;return[function(){return t.deleteSelection()},function(){return t.joinForward()},function(){return t.selectNodeForward()}]}))},r={Enter:function(){return e.editor.commands.first((function(e){var t=e.commands;return[function(){return t.newlineInCode()},function(){return t.createParagraphNear()},function(){return t.liftEmptyBlock()},function(){return t.splitBlock()}]}))},"Mod-Enter":function(){return e.editor.commands.exitCode()},Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:n,"Mod-Delete":n,"Mod-a":function(){return e.editor.commands.selectAll()}},o=Object(f.a)({},r),i=Object(f.a)(Object(f.a)({},r),{},{"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":n,"Ctrl-Alt-Backspace":n,"Alt-Delete":n,"Alt-d":n,"Ctrl-a":function(){return e.editor.commands.selectTextblockStart()},"Ctrl-e":function(){return e.editor.commands.selectTextblockEnd()}});return to()||oo()?i:o},addProseMirrorPlugins:function(){var e=this;return[new p.Plugin({key:new p.PluginKey("clearDocument"),appendTransaction:function(t,n,r){if(t.some((function(e){return e.docChanged}))&&!n.doc.eq(r.doc)){var o=n.selection,i=o.empty,a=o.from,s=o.to,l=p.Selection.atStart(n.doc).from,u=p.Selection.atEnd(n.doc).to,c=a===l&&s===u,d=0===r.doc.textBetween(0,r.doc.content.size," "," ").length;if(!i&&c&&d){var f=r.tr,h=gr({state:r,transaction:f});if(new yr({editor:e.editor,state:h}).commands.clearNodes(),f.steps.length)return f}}}})]}}),Co=Ir.create({name:"tabindex",addProseMirrorPlugins:function(){return[new p.Plugin({key:new p.PluginKey("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}}),jo=Object.freeze({__proto__:null,ClipboardTextSerializer:Wr,Commands:ko,Editable:xo,FocusEvents:Oo,Keymap:So,Tabindex:Co});function Do(e,t){var n=ao("string"===typeof t?t:t.name,e.schema);return"node"===n?function(e,t){var n=Or(t,e.schema),r=e.selection,o=r.from,i=r.to,a=[];e.doc.nodesBetween(o,i,(function(e){a.push(e)}));var s=a.reverse().find((function(e){return e.type.name===n.name}));return s?Object(f.a)({},s.attrs):{}}(e,t):"mark"===n?uo(e,t):{}}function Ao(e,t){var n=v.DOMSerializer.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function Eo(e,t){return $r(e,{from:0,to:e.content.size},t)}var Mo=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(c.a)(this,n),(e=t.call(this)).isFocused=!1,e.extensionStorage={},e.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:function(){return null},onCreate:function(){return null},onUpdate:function(){return null},onSelectionUpdate:function(){return null},onTransaction:function(){return null},onFocus:function(){return null},onBlur:function(){return null},onDestroy:function(){return null}},e.isCapturingTransaction=!1,e.capturedTransaction=null,e.setOptions(r),e.createExtensionManager(),e.createCommandManager(),e.createSchema(),e.on("beforeCreate",e.options.onBeforeCreate),e.emit("beforeCreate",{editor:Object(o.a)(e)}),e.createView(),e.injectCSS(),e.on("create",e.options.onCreate),e.on("update",e.options.onUpdate),e.on("selectionUpdate",e.options.onSelectionUpdate),e.on("transaction",e.options.onTransaction),e.on("focus",e.options.onFocus),e.on("blur",e.options.onBlur),e.on("destroy",e.options.onDestroy),window.setTimeout((function(){e.isDestroyed||(e.commands.focus(e.options.autofocus),e.emit("create",{editor:Object(o.a)(e)}))}),0),e}return Object(d.a)(n,[{key:"storage",get:function(){return this.extensionStorage}},{key:"commands",get:function(){return this.commandManager.commands}},{key:"chain",value:function(){return this.commandManager.chain()}},{key:"can",value:function(){return this.commandManager.can()}},{key:"injectCSS",value:function(){this.options.injectCSS&&document&&(this.css=function(e,t){var n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;var r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}('.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}',this.options.injectNonce))}},{key:"setOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=Object(f.a)(Object(f.a)({},this.options),e),this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}},{key:"setEditable",value:function(e){this.setOptions({editable:e})}},{key:"isEditable",get:function(){return this.options.editable&&this.view&&this.view.editable}},{key:"state",get:function(){return this.view.state}},{key:"registerPlugin",value:function(e,t){var n=jr(t)?t(e,Object(l.a)(this.state.plugins)):[].concat(Object(l.a)(this.state.plugins),[e]),r=this.state.reconfigure({plugins:n});this.view.updateState(r)}},{key:"unregisterPlugin",value:function(e){if(!this.isDestroyed){var t="string"===typeof e?"".concat(e,"$"):e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((function(e){return!e.key.startsWith(t)}))});this.view.updateState(n)}}},{key:"createExtensionManager",value:function(){var e=this.options.enableCoreExtensions?Object.values(jo):[],t=[].concat(Object(l.a)(e),Object(l.a)(this.options.extensions)).filter((function(e){return["extension","node","mark"].includes(null===e||void 0===e?void 0:e.type)}));this.extensionManager=new zr(t,this)}},{key:"createCommandManager",value:function(){this.commandManager=new yr({editor:this})}},{key:"createSchema",value:function(){this.schema=this.extensionManager.schema}},{key:"createView",value:function(){var e=lo(this.options.content,this.schema,this.options.parseOptions),t=eo(e,this.options.autofocus);this.view=new wn(this.options.element,Object(f.a)(Object(f.a)({},this.options.editorProps),{},{dispatchTransaction:this.dispatchTransaction.bind(this),state:p.EditorState.create({doc:e,selection:t||void 0})}));var n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews(),this.view.dom.editor=this}},{key:"createNodeViews",value:function(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}},{key:"captureTransaction",value:function(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;var t=this.capturedTransaction;return this.capturedTransaction=null,t}},{key:"dispatchTransaction",value:function(e){var t=this;if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((function(e){var n;return null===(n=t.capturedTransaction)||void 0===n?void 0:n.step(e)})):void(this.capturedTransaction=e);var n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});var o=e.getMeta("focus"),i=e.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}},{key:"getAttributes",value:function(e){return Do(this.state,e)}},{key:"isActive",value:function(e,t){var n="string"===typeof e?e:null,r="string"===typeof e?t:e;return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return io(e,null,n)||bo(e,null,n);var r=ao(t,e.schema);return"node"===r?io(e,t,n):"mark"===r&&bo(e,t,n)}(this.state,n,r)}},{key:"getJSON",value:function(){return this.state.doc.toJSON()}},{key:"getHTML",value:function(){return Ao(this.state.doc.content,this.schema)}},{key:"getText",value:function(e){var t=e||{},n=t.blockSeparator,r=void 0===n?"\n\n":n,o=t.textSerializers,i=void 0===o?{}:o;return Eo(this.state.doc,{blockSeparator:r,textSerializers:Object(f.a)(Object(f.a)({},i),qr(this.schema))})}},{key:"isEmpty",get:function(){return function(e){var t,n=null===(t=e.type.createAndFill())||void 0===t?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}(this.state.doc)}},{key:"getCharacterCount",value:function(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}},{key:"destroy",value:function(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}},{key:"isDestroyed",get:function(){var e;return!(null===(e=this.view)||void 0===e?void 0:e.docView)}}]),n}(br);function To(e,t){var n=[];return e.descendants((function(e,r){t(e)&&n.push({node:e,pos:r})})),n}function Lo(e,t,n){var r=[];return e.nodesBetween(t.from,t.to,(function(e,t){n(e)&&r.push({node:e,pos:t})})),r}function No(e){var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JSON.stringify,n={};return e.filter((function(e){var r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter((function(e,n){return!t.filter((function(e,t){return t!==n})).some((function(t){return 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 Po(e,t,n){var r=[];return e===t?n.resolve(e).marks().forEach((function(t){var o=Jr(n.resolve(e-1),t.type);o&&r.push(Object(f.a)({mark:t},o))})):n.nodesBetween(e,t,(function(e,t){r.push.apply(r,Object(l.a)(e.marks.map((function(n){return{from:t,to:t+e.nodeSize,mark:n}}))))})),r}function Ro(e){return new Pr({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=Dr(e.getAttributes,void 0,o);if(!1===i||null===i)return null;var a=n.tr,s=o[o.length-1],l=o[0],u=r.to;if(s){var c=l.search(/\S/),d=r.from+l.indexOf(s),f=d+s.length;if(Po(r.from,r.to,n.doc).filter((function(t){return t.mark.type.excluded.find((function(n){return n===e.type&&n!==t.mark.type}))})).filter((function(e){return e.to>d})).length)return null;fr.from&&a.delete(r.from+c,d),u=r.from+c+s.length,a.addMark(r.from+c,u,e.type.create(i||{})),a.removeStoredMark(e.type)}}})}function Ho(e){return new Pr({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=Dr(e.getAttributes,void 0,o)||{},a=n.tr,s=r.from,l=r.to;if(o[1]){var u=s+o[0].lastIndexOf(o[1]);u>l?u=l:l=u+o[1].length;var c=o[0][o[0].length-1];a.insertText(c,s+o[0].length-1),a.replaceWith(u,l,e.type.create(i))}else o[0]&&a.replaceWith(s,l,e.type.create(i))}})}function Fo(e){return new Pr({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=n.doc.resolve(r.from),a=Dr(e.getAttributes,void 0,o)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;n.tr.delete(r.from,r.to).setBlockType(r.from,r.from,e.type,a)}})}function Vo(e){return new Pr({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=Dr(e.getAttributes,void 0,o)||{},a=n.tr.delete(r.from,r.to),s=a.doc.resolve(r.from).blockRange(),l=s&&Object(g.i)(s,e.type,i);if(!l)return null;a.wrap(s,l);var u=a.doc.resolve(r.from-1).nodeBefore;u&&u.type===e.type&&Object(g.f)(a.doc,r.from-1)&&(!e.joinPredicate||e.joinPredicate(o,u))&&a.join(r.from-1)}})}var zo=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(c.a)(this,e),this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=Object(f.a)(Object(f.a)({},this.config),t),this.name=this.config.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Dr(wr(this,"addOptions",{name:this.name}))),this.storage=Dr(wr(this,"addStorage",{name:this.name,options:this.options}))||{}}return Object(d.a)(e,[{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend();return t.options=_r(this.options,e),t.storage=Dr(wr(t,"addStorage",{name:t.name,options:t.options})),t}},{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new e(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(n.name,'".')),n.options=Dr(wr(n,"addOptions",{name:n.name})),n.storage=Dr(wr(n,"addStorage",{name:n.name,options:n.options})),n}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t)}}]),e}(),Bo=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(c.a)(this,e),this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=Object(f.a)(Object(f.a)({},this.config),t),this.name=this.config.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Dr(wr(this,"addOptions",{name:this.name}))),this.storage=Dr(wr(this,"addStorage",{name:this.name,options:this.options}))||{}}return Object(d.a)(e,[{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend();return t.options=_r(this.options,e),t.storage=Dr(wr(t,"addStorage",{name:t.name,options:t.options})),t}},{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new e(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(n.name,'".')),n.options=Dr(wr(n,"addOptions",{name:n.name})),n.storage=Dr(wr(n,"addStorage",{name:n.name,options:n.options})),n}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t)}}]),e}();function _o(e){return new Fr({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=Dr(e.getAttributes,void 0,o);if(!1===i||null===i)return null;var a=n.tr,s=o[o.length-1],l=o[0],u=r.to;if(s){var c=l.search(/\S/),d=r.from+l.indexOf(s),f=d+s.length;if(Po(r.from,r.to,n.doc).filter((function(t){return t.mark.type.excluded.find((function(n){return n===e.type&&n!==t.mark.type}))})).filter((function(e){return e.to>d})).length)return null;fr.from&&a.delete(r.from+c,d),u=r.from+c+s.length,a.addMark(r.from+c,u,e.type.create(i||{})),a.removeStoredMark(e.type)}}})}var Io=Ir.create({name:"characterCount",addOptions:function(){return{limit:null,mode:"textSize"}},addStorage:function(){return{characters:function(){return 0},words:function(){return 0}}},onBeforeCreate:function(){var e=this;this.storage.characters=function(t){var n=(null===t||void 0===t?void 0:t.node)||e.editor.state.doc;return"textSize"===((null===t||void 0===t?void 0:t.mode)||e.options.mode)?n.textBetween(0,n.content.size,void 0," ").length:n.nodeSize},this.storage.words=function(t){var n=(null===t||void 0===t?void 0:t.node)||e.editor.state.doc;return n.textBetween(0,n.content.size," "," ").split(" ").filter((function(e){return""!==e})).length}},addProseMirrorPlugins:function(){var e=this;return[new p.Plugin({key:new p.PluginKey("characterCount"),filterTransaction:function(t,n){var r=e.options.limit;if(!t.docChanged||0===r||null===r||void 0===r)return!0;var o=e.storage.characters({node:n.doc}),i=e.storage.characters({node:t.doc});if(i<=r)return!0;if(o>r&&i>r&&i<=o)return!0;if(o>r&&i>r&&i>o)return!1;if(!t.getMeta("paste"))return!1;var a=t.selection.$head.pos,s=a-(i-r),l=a;return t.deleteRange(s,l),!(e.storage.characters({node:t.doc})>r)}})]}}),$o="undefined"!=typeof navigator?navigator:null,qo="undefined"!=typeof document?document:null,Wo=$o&&$o.userAgent||"",Uo=/Edge\/(\d+)/.exec(Wo),Ko=/MSIE \d/.exec(Wo),Go=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Wo),Jo=!!(Ko||Go||Uo),Yo=Ko?document.documentMode:Go?+Go[1]:Uo?+Uo[1]:0,Xo=!Jo&&/gecko\/(\d+)/i.test(Wo);Xo&&(/Firefox\/(\d+)/.exec(Wo)||[0,0])[1];var Zo=!Jo&&/Chrome\/(\d+)/.exec(Wo),Qo=!!Zo,ei=Zo?+Zo[1]:0,ti=!Jo&&!!$o&&/Apple Computer/.test($o.vendor),ni=ti&&(/Mobile\/\w+/.test(Wo)||!!$o&&$o.maxTouchPoints>2),ri=ni||!!$o&&/Mac/.test($o.platform),oi=/Android \d/.test(Wo),ii=!!qo&&"webkitFontSmoothing"in qo.documentElement.style,ai=ii?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,si=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},li=function(e,t,n,r){return n&&(ci(e,t,n,r,-1)||ci(e,t,n,r,1))},ui=/^(img|br|input|textarea|hr)$/i;function ci(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:di(e))){var i=e.parentNode;if(!i||1!=i.nodeType||pi(e)||ui.test(e.nodeName)||"false"==e.contentEditable)return!1;t=si(e)+(o<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?di(e):0}}}function di(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function fi(e,t,n){for(var r=0==t,o=t==di(e);r||o;){if(e==n)return!0;var i=si(e);if(!(e=e.parentNode))return!1;r=r&&0==i,o=o&&i==di(e)}}function pi(e){for(var t,n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var hi=function(e){var t=e.isCollapsed;return t&&Qo&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function mi(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}var vi=function(e){e&&(this.nodeName=e)};vi.prototype=Object.create(null);new vi;function gi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;var o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;var s,l,u=r.resolve(a);if(hi(n)){for(s=u;o&&!o.node;)o=o.parent;var c=o.node;if(o&&c.isAtom&&p.NodeSelection.isSelectable(c)&&o.parent&&(!c.isInline||!fi(n.focusNode,n.focusOffset,o.dom))){var d=o.posBefore;l=new p.NodeSelection(a==d?u:r.resolve(d))}}else{var f=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(f<0)return null;s=r.resolve(f)}if(!l){var h="pointer"==t||e.state.selection.head1&&void 0!==arguments[1]&&arguments[1],n=e.state.selection;if(ji(e,n),yi(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Qo){var r=e.domSelection(),o=e.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&li(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Ci(e);else{var i,a,s=n.anchor,l=n.head;!wi||n instanceof p.TextSelection||(n.$from.parent.inlineContent||(i=ki(e,n.from)),n.empty||n.$from.parent.inlineContent||(a=ki(e,n.to))),e.docView.setSelection(s,l,e.root,t),wi&&(i&&Oi(i),a&&Oi(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Si(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var wi=ti||Qo&&ei<63;function ki(e,t){var n=e.docView.domFromPos(t,0),r=n.node,o=n.offset,i=o0?r.max(o):r.min(o),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&p.Selection.findFrom(a,t)}function Ti(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Li(e,t,n){var r=e.state.selection;if(!(r instanceof p.TextSelection)){if(r instanceof p.NodeSelection&&r.node.isInline)return Ti(e,new p.TextSelection(t>0?r.$to:r.$from));var o=Mi(e.state,t);return!!o&&Ti(e,o)}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var i=Mi(e.state,t);return!!(i&&i instanceof p.NodeSelection)&&Ti(e,i)}if(!(ri&&n.indexOf("m")>-1)){var a,s=r.$head,l=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(!l||l.isText)return!1;var u=t<0?s.pos-l.nodeSize:s.pos;return!!(l.isAtom||(a=e.docView.descAt(u))&&!a.contentDOM)&&(p.NodeSelection.isSelectable(l)?Ti(e,new p.NodeSelection(t<0?e.state.doc.resolve(s.pos-l.nodeSize):s)):!!ii&&Ti(e,new p.TextSelection(e.state.doc.resolve(t<0?u:u+l.nodeSize))))}}function Ni(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Pi(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function Ri(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){var o,i,a=!1;for(Xo&&1==n.nodeType&&r0){if(1!=n.nodeType)break;var s=n.childNodes[r-1];if(Pi(s))o=n,i=--r;else{if(3!=s.nodeType)break;r=(n=s).nodeValue.length}}else{if(Fi(n))break;for(var l=n.previousSibling;l&&Pi(l);)o=n.parentNode,i=si(l),l=l.previousSibling;if(l)r=Ni(n=l);else{if((n=n.parentNode)==e.dom)break;r=0}}a?Vi(e,t,n,r):o&&Vi(e,t,o,i)}}function Hi(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){for(var o,i,a=Ni(n);;)if(r-1)return!1;if(ri&&n.indexOf("m")>-1)return!1;var o=r.$from,i=r.$to;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var a=Mi(e.state,t);if(a&&a instanceof p.NodeSelection)return Ti(e,a)}if(!o.parent.inlineContent){var s=t<0?o:i,l=r instanceof p.AllSelection?p.Selection.near(s,t):p.Selection.findFrom(s,t);return!!l&&Ti(e,l)}return!1}function Bi(e,t){if(!(e.state.selection instanceof p.TextSelection))return!0;var n=e.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r.sameParent(o))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){var s=e.state.tr;return t<0?s.delete(r.pos-a.nodeSize,r.pos):s.delete(r.pos,r.pos+a.nodeSize),e.dispatch(s),!0}return!1}function _i(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Ii(e,t){var n=t.keyCode,r=function(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||ri&&72==n&&"c"==r?Bi(e,-1)||Ri(e):46==n||ri&&68==n&&"c"==r?Bi(e,1)||Hi(e):13==n||27==n||(37==n||ri&&66==n&&"c"==r?Li(e,-1,r)||Ri(e):39==n||ri&&70==n&&"c"==r?Li(e,1,r)||Hi(e):38==n||ri&&80==n&&"c"==r?zi(e,-1,r)||Ri(e):40==n||ri&&78==n&&"c"==r?function(e){if(!ti||e.state.selection.$head.parentOffset>0)return!1;var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;_i(e,o,"true"),setTimeout((function(){return _i(e,o,"false")}),20)}return!1}(e)||zi(e,1,r)||Hi(e):r==(ri?"m":"c")&&(66==n||73==n||89==n||90==n))}function $i(e,t){for(var n=[],r=t.content,o=t.openStart,i=t.openEnd;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;var a=r.firstChild;n.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),r=a.content}var s=e.someProp("clipboardSerializer")||v.DOMSerializer.fromSchema(e.state.schema),l=Qi(),u=l.createElement("div");u.appendChild(s.serializeFragment(r,{document:l}));for(var c,d=u.firstChild,f=0;d&&1==d.nodeType&&(c=Xi[d.nodeName.toLowerCase()]);){for(var p=c.length-1;p>=0;p--){for(var h=l.createElement(c[p]);u.firstChild;)h.appendChild(u.firstChild);u.appendChild(h),f++}d=u.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice","".concat(o," ").concat(i).concat(f?" -".concat(f):""," ").concat(JSON.stringify(n))),{dom:u,text:e.someProp("clipboardTextSerializer",(function(e){return e(t)}))||t.content.textBetween(0,t.content.size,"\n\n")}}function qi(e,t,n,r,o){var i,a,s=o.parent.type.spec.code;if(!n&&!t)return null;var l=t&&(r||s||!n);if(l){if(e.someProp("transformPastedText",(function(e){t=e(t,s||r)})),s)return t?new v.Slice(v.Fragment.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):v.Slice.empty;var u=e.someProp("clipboardTextParser",(function(e){return e(t,o,r)}));if(u)a=u;else{var c=o.marks(),d=e.state.schema,f=v.DOMSerializer.fromSchema(d);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((function(e){var t=i.appendChild(document.createElement("p"));e&&t.appendChild(f.serializeNode(d.text(e,c)))}))}}else e.someProp("transformPastedHTML",(function(e){n=e(n)})),i=function(e){var t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=Qi().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&Xi[o[1].toLowerCase()])&&(e=n.map((function(e){return"<"+e+">"})).join("")+e+n.map((function(e){return""})).reverse().join(""));if(r.innerHTML=e,n)for(var i=0;i0&&i.firstChild;m--)i=i.firstChild;if(!a){var g=e.someProp("clipboardParser")||e.someProp("domParser")||v.DOMParser.fromSchema(e.state.schema);a=g.parseSlice(i,{preserveWhitespace:!(!l&&!h),context:o,ruleFromNode:function(e){return"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Wi.test(e.parentNode.nodeName)?null:{ignore:!0}}})}if(h)a=function(e,t){if(!e.size)return e;var n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(u){return e}for(var o=e.content,i=e.openStart,a=e.openEnd,s=n.length-2;s>=0;s-=2){var l=r.nodes[n[s]];if(!l||l.hasRequiredAttrs())break;o=v.Fragment.from(l.create(n[s+1],o)),i++,a++}return new v.Slice(o,i,a)}(Yi(a,+h[1],+h[2]),h[4]);else if(a=v.Slice.maxOpen(function(e,t){if(e.childCount<2)return e;for(var n=function(n){var r=t.node(n).contentMatchAt(t.index(n)),o=void 0,i=[];if(e.forEach((function(e){if(i){var t,n=r.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&o.length&&Ki(n,o,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=Gi(i[i.length-1],o.length));var a=Ui(e,n);i.push(a),r=r.matchType(a.type),o=n}}})),i)return{v:v.Fragment.from(i)}},r=t.depth;r>=0;r--){var o=n(r);if("object"===typeof o)return o.v}return e}(a.content,o),!0),a.openStart||a.openEnd){for(var y=0,b=0,w=a.content.firstChild;y2&&void 0!==arguments[2]?arguments[2]:0,r=t.length-1;r>=n;r--)e=t[r].create(null,v.Fragment.from(e));return e}function Ki(e,t,n,r,o){if(o=n&&(s=t<0?a.contentMatchAt(0).fillBefore(s,e.childCount>1||i<=o).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(v.Fragment.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(s))}function Yi(e,t,n){return ti.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)})))return{v:!0}},s=i.depth+1;s>0;s--){var l=a(s);if("object"===typeof l)return l.v}return!1}function ia(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function aa(e,t,n,r,o){return oa(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(function(n){return n(e,t,r)}))||(o?function(e,t){if(-1==t)return!1;var n,r,o=e.state.selection;o instanceof p.NodeSelection&&(n=o.node);for(var i=e.state.doc.resolve(t),a=i.depth+1;a>0;a--){var s=a>i.depth?i.nodeAfter:i.node(a);if(p.NodeSelection.isSelectable(s)){r=n&&o.$from.depth>0&&a>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(a);break}}return null!=r&&(ia(e,p.NodeSelection.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&p.NodeSelection.isSelectable(r))&&(ia(e,new p.NodeSelection(n),"pointer"),!0)}(e,n))}function sa(e,t,n,r){return oa(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(function(n){return n(e,t,r)}))}function la(e,t,n,r){return oa(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(function(n){return n(e,t,r)}))||function(e,t,n){if(0!=n.button)return!1;var r=e.state.doc;if(-1==t)return!!r.inlineContent&&(ia(e,p.TextSelection.create(r,0,r.content.size),"pointer"),!0);for(var o=r.resolve(t),i=o.depth+1;i>0;i--){var a=i>o.depth?o.nodeAfter:o.node(i),s=o.before(i);if(a.inlineContent)ia(e,p.TextSelection.create(r,s+1,s+1+a.content.size),"pointer");else{if(!p.NodeSelection.isSelectable(a))continue;ia(e,p.NodeSelection.create(r,s),"pointer")}return!0}}(e,n,r)}function ua(e){return va(e)}ta.keydown=function(e,t){var n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!fa(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!oi||!Qo||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!ni||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(function(t){return t(e,n)}))||Ii(e,n)?n.preventDefault():na(e,"key");else{var r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout((function(){e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",(function(t){return t(e,mi(13,"Enter"))})),e.input.lastIOSEnter=0)}),200)}},ta.keyup=function(e,t){16==t.keyCode&&(e.input.shiftKey=!1)},ta.keypress=function(e,t){var n=t;if(!(fa(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||ri&&n.metaKey))if(e.someProp("handleKeyPress",(function(t){return t(e,n)})))n.preventDefault();else{var r=e.state.selection;if(!(r instanceof p.TextSelection)||!r.$from.sameParent(r.$to)){var o=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(function(t){return t(e,r.$from.pos,r.$to.pos,o)}))||e.dispatch(e.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}}};var ca=ri?"metaKey":"ctrlKey";ea.mousedown=function(e,t){var n=t;e.input.shiftKey=n.shiftKey;var r=ua(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[ca]&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};var a=e.posAtCoords(ra(n));a&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new da(e,a,n,!!r)):("doubleClick"==i?sa:la)(e,a.pos,a.inside,n)?n.preventDefault():na(e,"pointer"))};var da=function(){function e(t,n,r,o){var i,a,s=this;if(Object(c.a)(this,e),this.view=t,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[ca],this.allowDefault=r.shiftKey,n.inside>-1)i=t.state.doc.nodeAt(n.inside),a=n.inside;else{var l=t.state.doc.resolve(n.pos);i=l.parent,a=l.depth?l.before():0}var u=o?null:r.target,d=u?t.docView.nearestDesc(u,!0):null;this.target=d?d.dom:null;var f=t.state.selection;(0==r.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||f instanceof p.NodeSelection&&f.from<=a&&f.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Xo||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((function(){s.view.input.mouseDown==s&&s.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),na(t,"pointer")}return Object(d.a)(e,[{key:"done",value:function(){var e=this;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((function(){return bi(e.view)})),this.view.input.mouseDown=null}},{key:"up",value:function(e){if(this.done(),this.view.dom.contains(e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(ra(e))),this.allowDefault||!t?na(this.view,"pointer"):aa(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||ti&&this.mightDrag&&!this.mightDrag.node.isAtom||Qo&&!(this.view.state.selection instanceof p.TextSelection)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(ia(this.view,p.Selection.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):na(this.view,"pointer")}}},{key:"move",value:function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),na(this.view,"pointer"),0==e.buttons&&this.done()}}]),e}();function fa(e,t){return!!e.composing||!!(ti&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}ea.touchdown=function(e){ua(e),na(e,"pointer")},ea.contextmenu=function(e){return ua(e)};var pa=oi?5e3:-1;function ha(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((function(){return va(e)}),t))}function ma(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){var e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function va(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(oi&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),ma(e),t||e.docView&&e.docView.dirty){var n=gi(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}ta.compositionstart=ta.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(e){return!1===e.type.spec.inclusive}))))e.markCursor=e.state.storedMarks||n.marks(),va(e,!0),e.markCursor=null;else if(va(e),Xo&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=e.domSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(3==a.nodeType){r.collapse(a,a.nodeValue.length);break}o=a,i=-1}e.input.composing=!0}ha(e,pa)},ta.compositionend=function(e,t){e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,ha(e,20))};var ga=Jo&&Yo<15||ni&&ai<604;function ya(e,t,n,r){var o=qi(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(function(t){return t(e,r,o||v.Slice.empty)})))return!0;if(!o)return!1;var i=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),a=i?e.state.tr.replaceSelectionWith(i,e.input.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}ea.copy=ta.cut=function(e,t){var n=t,r=e.state.selection,o="cut"==n.type;if(!r.empty){var i=ga?null:n.clipboardData,a=$i(e,r.content()),s=a.dom,l=a.text;i?(n.preventDefault(),i.clearData(),i.setData("text/html",s.innerHTML),i.setData("text/plain",l)):function(e,t){if(e.dom.parentNode){var n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}}(e,s),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},ta.paste=function(e,t){var n=t;if(!e.composing||oi){var r=ga?null:n.clipboardData;r&&ya(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(e.dom.parentNode){var n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ya(e,r.value,null,t):ya(e,r.textContent,r.innerHTML,t)}),50)}}(e,n)}};var ba=Object(d.a)((function e(t,n){Object(c.a)(this,e),this.slice=t,this.move=n})),wa=ri?"altKey":"ctrlKey";for(var ka in ea.dragstart=function(e,t){var n=t,r=e.input.mouseDown;if(r&&r.done(),n.dataTransfer){var o=e.state.selection,i=o.empty?null:e.posAtCoords(ra(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof p.NodeSelection?o.to-1:o.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(p.NodeSelection.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){var a=e.docView.nearestDesc(n.target,!0);a&&a.node.type.spec.draggable&&a!=e.docView&&e.dispatch(e.state.tr.setSelection(p.NodeSelection.create(e.state.doc,a.posBefore)))}var s=e.state.selection.content(),l=$i(e,s),u=l.dom,c=l.text;n.dataTransfer.clearData(),n.dataTransfer.setData(ga?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",ga||n.dataTransfer.setData("text/plain",c),e.dragging=new ba(s,!n[wa])}},ea.dragend=function(e){var t=e.dragging;window.setTimeout((function(){e.dragging==t&&(e.dragging=null)}),50)},ta.dragover=ta.dragenter=function(e,t){return t.preventDefault()},ta.drop=function(e,t){var n=t,r=e.dragging;if(e.dragging=null,n.dataTransfer){var o=e.posAtCoords(ra(n));if(o){var i=e.state.doc.resolve(o.pos);if(i){var a=r&&r.slice;a?e.someProp("transformPasted",(function(e){a=e(a)})):a=qi(e,n.dataTransfer.getData(ga?"Text":"text/plain"),ga?null:n.dataTransfer.getData("text/html"),!1,i);var s=!(!r||n[wa]);if(e.someProp("handleDrop",(function(t){return t(e,n,a||v.Slice.empty,s)})))n.preventDefault();else if(a){n.preventDefault();var l=a?Object(g.h)(e.state.doc,i.pos,a):i.pos;null==l&&(l=i.pos);var u=e.state.tr;s&&u.deleteSelection();var c=u.mapping.map(l),d=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,f=u.doc;if(d?u.replaceRangeWith(c,c,a.content.firstChild):u.replaceRange(c,c,a),!u.doc.eq(f)){var h=u.doc.resolve(c);if(d&&p.NodeSelection.isSelectable(a.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(a.content.firstChild))u.setSelection(new p.NodeSelection(h));else{var m=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((function(e,t,n,r){return m=r})),u.setSelection(Ai(e,h,u.doc.resolve(m)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))}}}}}},ea.focus=function(e){e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&bi(e)}),20))},ea.blur=function(e,t){var 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)},ea.beforeinput=function(e,t){if(Qo&&oi&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();var n=e.input.domChangeCount;setTimeout((function(){if(e.input.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",(function(t){return t(e,mi(8,"Backspace"))})))){var t=e.state.selection.$cursor;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}}),50)}},ta)ea[ka]=ta[ka];function xa(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var Oa=function(){function e(t,n){Object(c.a)(this,e),this.toDOM=t,this.spec=n||Aa,this.side=this.spec.side||0}return Object(d.a)(e,[{key:"map",value:function(e,t,n,r){var o=e.mapResult(t.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new ja(i-n,i-n,this)}},{key:"valid",value:function(){return!0}},{key:"eq",value:function(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&xa(this.spec,t.spec))}},{key:"destroy",value:function(e){this.spec.destroy&&this.spec.destroy(e)}}]),e}(),Sa=function(){function e(t,n){Object(c.a)(this,e),this.attrs=t,this.spec=n||Aa}return Object(d.a)(e,[{key:"map",value:function(e,t,n,r){var o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new ja(o,i,this)}},{key:"valid",value:function(e,t){return t.from1&&void 0!==arguments[1]?arguments[1]:0;return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}},{key:"map",value:function(e,t,n){return this.type.map(e,this,t,n)}},{key:"spec",get:function(){return this.type.spec}},{key:"inline",get:function(){return this.type instanceof Sa}}],[{key:"widget",value:function(t,n,r){return new e(t,t,new Oa(n,r))}},{key:"inline",value:function(t,n,r,o){return new e(t,n,new Sa(r,o))}},{key:"node",value:function(t,n,r,o){return new e(t,n,new Ca(r,o))}}]),e}(),Da=[],Aa={},Ea=function(){function e(t,n){Object(c.a)(this,e),this.local=t.length?t:Da,this.children=n.length?n:Da}return Object(d.a)(e,[{key:"find",value:function(e,t,n){var r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}},{key:"findInner",value:function(e,t,n,r,o){for(var i=0;i=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(var s=0;se){var l=this.children[s]+1;this.children[s+2].findInner(e-l,t-l,n,r+l,o)}}},{key:"map",value:function(e,t,n){return this==Ma||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Aa)}},{key:"mapInner",value:function(t,n,r,o,i){for(var a,s=0;sl+i)){var c=s[a]+i;t>=c?s[a+1]=e<=c?-2:-1:n>=o&&(u=r-n-(t-e))&&(s[a]+=u,s[a+1]+=u)}}},u=0;u=r.content.size){c=!0;continue}var h=n.map(e[d+1]+i,-1)-o,m=r.content.findIndex(p),v=m.index,g=m.offset,y=r.maybeChild(v);if(y&&g==p&&g+y.nodeSize==h){var b=s[d+2].mapInner(n,y,f+1,e[d]+i+1,a);b!=Ma?(s[d]=p,s[d+1]=h,s[d+2]=b):(s[d+1]=-2,c=!0)}else c=!0}if(c){var w=function(e,t,n,r,o,i,a){function s(e,t){for(var i=0;il&&a.to=t){this.children[i]==t&&(r=this.children[i+2]);break}for(var a=t+1,s=a+n.content.size,l=0;la&&u.type instanceof Sa){var c=Math.max(a,u.from)-a,d=Math.min(s,u.to)-a;cn&&r.to0;)t++;e.splice(t,0,n)}var za=Ir.create({name:"placeholder",addOptions:function(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins:function(){var e=this;return[new p.Plugin({props:{decorations:function(t){var n=t.doc,r=t.selection,o=e.editor.isEditable||!e.options.showOnlyWhenEditable,i=r.anchor,a=[];return o?(n.descendants((function(t,n){var r=i>=n&&i<=n+t.nodeSize,o=!t.isLeaf&&!t.childCount;if((r||!e.options.showOnlyCurrent)&&o){var s=[e.options.emptyNodeClass];e.editor.isEmpty&&s.push(e.options.emptyEditorClass);var l=ja.node(n,n+t.nodeSize,{class:s.join(" "),"data-placeholder":"function"===typeof e.options.placeholder?e.options.placeholder({editor:e.editor,node:t,pos:n,hasAnchor:r}):e.options.placeholder});a.push(l)}return e.options.includeChildren})),Ea.create(n,a)):null}}})]}}),Ba=zo.create({name:"underline",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:function(e){return!!e.includes("underline")&&{}}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["u",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setUnderline:function(){return function(t){return t.commands.setMark(e.name)}},toggleUnderline:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetUnderline:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-u":function(){return e.editor.commands.toggleUnderline()},"Mod-U":function(){return e.editor.commands.toggleUnderline()}}}}),_a=/^\s*>\s$/,Ia=Bo.create({name:"blockquote",addOptions:function(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML:function(){return[{tag:"blockquote"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["blockquote",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setBlockquote:function(){return function(t){return t.commands.wrapIn(e.name)}},toggleBlockquote:function(){return function(t){return t.commands.toggleWrap(e.name)}},unsetBlockquote:function(){return function(t){return t.commands.lift(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-b":function(){return e.editor.commands.toggleBlockquote()}}},addInputRules:function(){return[Vo({find:_a,type:this.type})]}}),$a=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,qa=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Wa=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Ua=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Ka=zo.create({name:"bold",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"strong"},{tag:"b",getAttrs:function(e){return"normal"!==e.style.fontWeight&&null}},{style:"font-weight",getAttrs:function(e){return/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["strong",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setBold:function(){return function(t){return t.commands.setMark(e.name)}},toggleBold:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetBold:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-b":function(){return e.editor.commands.toggleBold()},"Mod-B":function(){return e.editor.commands.toggleBold()}}},addInputRules:function(){return[Ro({find:$a,type:this.type}),Ro({find:Wa,type:this.type})]},addPasteRules:function(){return[_o({find:qa,type:this.type}),_o({find:Ua,type:this.type})]}}),Ga=/^\s*([-+*])\s$/,Ja=Bo.create({name:"bulletList",addOptions:function(){return{itemTypeName:"listItem",HTMLAttributes:{}}},group:"block list",content:function(){return"".concat(this.options.itemTypeName,"+")},parseHTML:function(){return[{tag:"ul"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["ul",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{toggleBulletList:function(){return function(t){return t.commands.toggleList(e.name,e.options.itemTypeName)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-8":function(){return e.editor.commands.toggleBulletList()}}},addInputRules:function(){return[Vo({find:Ga,type:this.type})]}}),Ya=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,Xa=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,Za=zo.create({name:"code",addOptions:function(){return{HTMLAttributes:{}}},excludes:"_",code:!0,parseHTML:function(){return[{tag:"code"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["code",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setCode:function(){return function(t){return t.commands.setMark(e.name)}},toggleCode:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetCode:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-e":function(){return e.editor.commands.toggleCode()}}},addInputRules:function(){return[Ro({find:Ya,type:this.type})]},addPasteRules:function(){return[_o({find:Xa,type:this.type})]}}),Qa=/^```([a-z]+)?[\s\n]$/,es=/^~~~([a-z]+)?[\s\n]$/,ts=Bo.create({name:"codeBlock",addOptions:function(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes:function(){var e=this;return{language:{default:null,parseHTML:function(t){var n,r=e.options.languageClassPrefix,o=Object(l.a)((null===(n=t.firstElementChild)||void 0===n?void 0:n.classList)||[]).filter((function(e){return e.startsWith(r)})).map((function(e){return e.replace(r,"")}))[0];return o||null},rendered:!1}}},parseHTML:function(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes;return["pre",Sr(this.options.HTMLAttributes,n),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands:function(){var e=this;return{setCodeBlock:function(t){return function(n){return n.commands.setNode(e.name,t)}},toggleCodeBlock:function(t){return function(n){return n.commands.toggleNode(e.name,"paragraph",t)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Alt-c":function(){return e.editor.commands.toggleCodeBlock()},Backspace:function(){var t=e.editor.state.selection,n=t.empty,r=t.$anchor,o=1===r.pos;return!(!n||r.parent.type.name!==e.name)&&(!(!o&&r.parent.textContent.length)&&e.editor.commands.clearNodes())},Enter:function(t){var n=t.editor;if(!e.options.exitOnTripleEnter)return!1;var r=n.state.selection,o=r.$from;if(!r.empty||o.parent.type!==e.type)return!1;var i=o.parentOffset===o.parent.nodeSize-2,a=o.parent.textContent.endsWith("\n\n");return!(!i||!a)&&n.chain().command((function(e){return e.tr.delete(o.pos-2,o.pos),!0})).exitCode().run()},ArrowDown:function(t){var n=t.editor;if(!e.options.exitOnArrowDown)return!1;var r=n.state,o=r.selection,i=r.doc,a=o.$from;if(!o.empty||a.parent.type!==e.type)return!1;if(!(a.parentOffset===a.parent.nodeSize-2))return!1;var s=a.after();return void 0!==s&&(!i.nodeAt(s)&&n.commands.exitCode())}}},addInputRules:function(){return[Fo({find:Qa,type:this.type,getAttributes:function(e){return{language:e[1]}}}),Fo({find:es,type:this.type,getAttributes:function(e){return{language:e[1]}}})]},addProseMirrorPlugins:function(){var e=this;return[new p.Plugin({key:new p.PluginKey("codeBlockVSCodeHandler"),props:{handlePaste:function(t,n){if(!n.clipboardData)return!1;if(e.editor.isActive(e.type.name))return!1;var r=n.clipboardData.getData("text/plain"),o=n.clipboardData.getData("vscode-editor-data"),i=o?JSON.parse(o):void 0,a=null===i||void 0===i?void 0:i.mode;if(!r||!a)return!1;var s=t.state.tr;return s.replaceSelectionWith(e.type.create({language:a})),s.setSelection(p.TextSelection.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(r.replace(/\r\n?/g,"\n")),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),ns=Bo.create({name:"doc",topNode:!0,content:"block+"});function rs(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new p.Plugin({view:function(t){return new is(t,e)}})}var is=function(){function e(t,n){var r=this;Object(c.a)(this,e),this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=n.width||1,this.color=n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map((function(e){var n=function(t){r[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}}))}return Object(d.a)(e,[{key:"destroy",value:function(){var e=this;this.handlers.forEach((function(t){var n=t.name,r=t.handler;return e.editorView.dom.removeEventListener(n,r)}))}},{key:"update",value:function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}},{key:"setCursor",value:function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}},{key:"updateOverlay",value:function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,r=t.nodeAfter;if(n||r){var o=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:o.left,right:o.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!e){var a=this.editorView.coordsAtPos(this.cursorPos);e={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}var s,l,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.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),!u||u==document.body&&"static"==getComputedStyle(u).position)s=-pageXOffset,l=-pageYOffset;else{var c=u.getBoundingClientRect();s=c.left-u.scrollLeft,l=c.top-u.scrollTop}this.element.style.left=e.left-s+"px",this.element.style.top=e.top-l+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"}},{key:"scheduleRemoval",value:function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)}},{key:"dragover",value:function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t):r;if(t&&!o){var i=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(i=Object(g.h)(this.editorView.state.doc,i,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(i),this.scheduleRemoval(5e3)}}}},{key:"dragend",value:function(){this.scheduleRemoval(20)}},{key:"drop",value:function(){this.scheduleRemoval(20)}},{key:"dragleave",value:function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}]),e}(),as=Ir.create({name:"dropCursor",addOptions:function(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins:function(){return[rs(this.options)]}}),ss="undefined"!=typeof navigator?navigator:null,ls="undefined"!=typeof document?document:null,us=ss&&ss.userAgent||"",cs=/Edge\/(\d+)/.exec(us),ds=/MSIE \d/.exec(us),fs=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(us),ps=!!(ds||fs||cs),hs=ds?document.documentMode:fs?+fs[1]:cs?+cs[1]:0,ms=!ps&&/gecko\/(\d+)/i.test(us);ms&&(/Firefox\/(\d+)/.exec(us)||[0,0])[1];var vs=!ps&&/Chrome\/(\d+)/.exec(us),gs=!!vs,ys=vs?+vs[1]:0,bs=!ps&&!!ss&&/Apple Computer/.test(ss.vendor),ws=bs&&(/Mobile\/\w+/.test(us)||!!ss&&ss.maxTouchPoints>2),ks=ws||!!ss&&/Mac/.test(ss.platform),xs=/Android \d/.test(us),Os=!!ls&&"webkitFontSmoothing"in ls.documentElement.style,Ss=Os?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,Cs=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},js=function(e){var t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},Ds=null,As=function(e,t,n){var r=Ds||(Ds=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},Es=function(e,t,n,r){return n&&(Ts(e,t,n,r,-1)||Ts(e,t,n,r,1))},Ms=/^(img|br|input|textarea|hr)$/i;function Ts(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:Ls(e))){var i=e.parentNode;if(!i||1!=i.nodeType||Ps(e)||Ms.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Cs(e)+(o<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?Ls(e):0}}}function Ls(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Ns(e,t,n){for(var r=0==t,o=t==Ls(e);r||o;){if(e==n)return!0;var i=Cs(e);if(!(e=e.parentNode))return!1;r=r&&0==i,o=o&&i==Ls(e)}}function Ps(e){for(var t,n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var Rs=function(e){var t=e.isCollapsed;return t&&gs&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function Hs(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function Fs(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Vs(e,t){return"number"==typeof e?e:e[t]}function zs(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Bs(e,t,n){for(var r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,a=n||e.dom;a;a=js(a))if(1==a.nodeType){var s=a,l=s==i.body,u=l?Fs(i):zs(s),c=0,d=0;if(t.topu.bottom-Vs(r,"bottom")&&(d=t.bottom-u.bottom+Vs(o,"bottom")),t.leftu.right-Vs(r,"right")&&(c=t.right-u.right+Vs(o,"right")),c||d)if(l)i.defaultView.scrollBy(c,d);else{var f=s.scrollLeft,p=s.scrollTop;d&&(s.scrollTop+=d),c&&(s.scrollLeft+=c);var h=s.scrollLeft-f,m=s.scrollTop-p;t={left:t.left-h,top:t.top-m,right:t.right-h,bottom:t.bottom-m}}if(l)break}}function _s(e){for(var t=[],n=e.ownerDocument,r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=js(r));return t}function Is(e,t){for(var n=0;n=s){a=Math.max(f.bottom,a),s=Math.min(f.top,s);var p=f.left>t.left?f.left-t.left:f.right=(f.left+f.right)/2?1:0));continue}}!n&&(t.left>=f.right&&t.top>=f.top||t.left>=f.left&&t.top>=f.bottom)&&(i=u+1)}}return n&&3==n.nodeType?function(e,t){for(var n=e.nodeValue.length,r=document.createRange(),o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:e,offset:i}:qs(n,r)}function Ws(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Us(e,t,n){var r=e.childNodes.length;if(r&&n.topt.top&&o++}n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(s=function(e,t,n,r){for(var o=-1,i=t;i!=e.dom;){var a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.node.isBlock&&a.parent){var s=a.dom.getBoundingClientRect();if(s.left>r.left||s.top>r.top)o=a.posBefore;else{if(!(s.right-1?o:e.docView.posFromDOM(t,n,1)}(e,n,o,t))}null==s&&(s=function(e,t,n){var r=qs(t,n),o=r.node,i=r.offset,a=-1;if(1==o.nodeType&&!o.firstChild){var s=o.getBoundingClientRect();a=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(o,i,a)}(e,l,t));var p=e.docView.nearestDesc(l,!0);return{pos:s,inside:p?p.posAtStart-p.border:-1}}function Gs(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}var Js=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ys(e,t,n){var r=e.docView.domFromPos(t,n<0?-1:1),o=r.node,i=r.offset,a=r.atom,s=Os||ms;if(3==o.nodeType){if(!s||!Js.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){var l=i,u=i,c=n<0?1:-1;return n<0&&!i?(u++,c=-1):n>=0&&i==o.nodeValue.length?(l--,c=1):n<0?l--:u++,Xs(Gs(As(o,l,u),c),c<0)}var d=Gs(As(o,i,i),n);if(ms&&i&&/\s/.test(o.nodeValue[i-1])&&i=0)}if(null==a&&i&&(n<0||i==Ls(o))){var v=o.childNodes[i-1],g=3==v.nodeType?As(v,Ls(v)-(s?0:1)):1!=v.nodeType||"BR"==v.nodeName&&v.nextSibling?null:v;if(g)return Xs(Gs(g,1),!1)}if(null==a&&i=0)}function Xs(e,t){if(0==e.width)return e;var n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Zs(e,t){if(0==e.height)return e;var n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Qs(e,t,n){var r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}var el=/[\u0590-\u08ac]/;var tl=null,nl=null,rl=!1;function ol(e,t,n){return tl==t&&nl==n?rl:(tl=t,nl=n,rl="up"==n||"down"==n?function(e,t,n){var r=t.selection,o="up"==n?r.$from:r.$to;return Qs(e,t,(function(){for(var t=e.docView.domFromPos(o.pos,"up"==n?-1:1).node;;){var r=e.docView.nearestDesc(t,!0);if(!r)break;if(r.node.isBlock){t=r.dom;break}t=r.dom.parentNode}for(var i=Ys(e,o.pos,1),a=t.firstChild;a;a=a.nextSibling){var s=void 0;if(1==a.nodeType)s=a.getClientRects();else{if(3!=a.nodeType)continue;s=As(a,0,a.nodeValue.length).getClientRects()}for(var l=0;lu.top+1&&("up"==n?i.top-u.top>2*(u.bottom-i.top):u.bottom-i.bottom>2*(i.bottom-u.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){var r=t.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,a=o==r.parent.content.size,s=e.domSelection();return el.test(r.parent.textContent)&&s.modify?Qs(e,t,(function(){var t=s.getRangeAt(0),o=s.focusNode,i=s.focusOffset,a=s.caretBidiLevel;s.modify("move",n,"character");var l=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==s.focusNode.nodeType?s.focusNode:s.focusNode.parentNode)||o==s.focusNode&&i==s.focusOffset;return s.removeAllRanges(),s.addRange(t),null!=a&&(s.caretBidiLevel=a),l})):"left"==n||"backward"==n?i:a}(e,t,n))}var il=function(){function e(t,n,r,o){Object(c.a)(this,e),this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=0,r.pmViewDesc=this}return Object(d.a)(e,[{key:"matchesWidget",value:function(e){return!1}},{key:"matchesMark",value:function(e){return!1}},{key:"matchesNode",value:function(e,t,n){return!1}},{key:"matchesHack",value:function(e){return!1}},{key:"parseRule",value:function(){return null}},{key:"stopEvent",value:function(e){return!1}},{key:"size",get:function(){for(var e=0,t=0;tCs(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(var l=e;;l=l.parentNode){if(l==this.dom){s=!1;break}if(l.previousSibling)break}if(null==s&&t==e.childNodes.length)for(var u=e;;u=u.parentNode){if(u==this.dom){s=!0;break}if(u.nextSibling)break}}return(null==s?n>0:s)?this.posAtEnd:this.posAtStart}},{key:"nearestDesc",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!0,r=e;r;r=r.parentNode){var o=this.getDesc(r),i=void 0;if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}},{key:"getDesc",value:function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t}},{key:"posFromDOM",value:function(e,t,n){for(var r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}},{key:"descAt",value:function(e){for(var t=0,n=0;te||a instanceof fl){o=e-i;break}i=s}if(o)return this.children[r].domFromPos(o-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof al&&n.side>=0;r--);if(t<=0){for(var l,u=!0;(l=r?this.children[r-1]:null)&&l.dom.parentNode!=this.contentDOM;r--,u=!1);return l&&t&&u&&!l.border&&!l.domAtom?l.domFromPos(l.size,t):{node:this.contentDOM,offset:l?Cs(l.dom)+1:0}}for(var c,d=!0;(c=r2&&void 0!==arguments[2]?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,a=0;;a++){var s=this.children[a],l=i+s.size;if(-1==r&&e<=l){var u=i+s.border;if(e>=u&&t<=l-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(e,t,u);e=i;for(var c=a;c>0;c--){var d=this.children[c-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){r=Cs(d.dom)+1;break}e-=d.size}-1==r&&(r=0)}if(r>-1&&(l>t||a==this.children.length-1)){t=l;for(var f=a+1;f3&&void 0!==arguments[3]&&arguments[3],o=Math.min(e,t),i=Math.max(e,t),a=0,s=0;as&&it){var O=c;c=d,d=O}var S=document.createRange();S.setEnd(d.node,d.offset),S.setStart(c.node,c.offset),f.removeAllRanges(),f.addRange(S)}}}},{key:"ignoreMutation",value:function(e){return!this.contentDOM&&"selection"!=e.type}},{key:"contentLost",get:function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}},{key:"markDirty",value:function(e,t){for(var n=0,r=0;r=n:en){var a=n+o.border,s=i-o.border;if(e>=a&&t<=s)return this.dirty=e==n||t==i?2:1,void(e!=a||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-a,t-a):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}},{key:"markParentsDirty",value:function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var n=1==e?2:1;t.dirty0&&(i=Cl(i,0,e,r));for(var s=0;s=0;n--){var r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=function(){return v.Fragment.empty})}else t.contentElement=this.contentDOM;else t.getContent=function(){return e.node.content};return t}},{key:"matchesNode",value:function(e,t,n){return 0==this.dirty&&e.eq(this.node)&&kl(t,this.outerDeco)&&n.eq(this.innerDeco)}},{key:"size",get:function(){return this.node.nodeSize}},{key:"border",get:function(){return this.node.isLeaf?0:1}},{key:"updateChildren",value:function(e,t){var n=this,r=this.node.inlineContent,o=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,s=i&&i.pos<0,l=new Ol(this,a&&a.node);!function(e,t,n,r){var o=t.locals(e),i=0;if(0==o.length){for(var a=0;ai;)u.push(o[l++]);var y=i+m.nodeSize;if(m.isText){var b=y;l=0&&!a&&l.syncToMarks(i==n.node.childCount?v.Mark.none:n.node.child(i).marks,r,e),l.placeWidget(t,e,o)}),(function(t,n,a,u){var c;l.syncToMarks(t.marks,r,e),l.findNodeMatch(t,n,a,u)||s&&e.state.selection.from>o&&e.state.selection.to-1&&l.updateNodeAt(t,n,a,c,e)||l.updateNextNode(t,n,a,e,u)||l.addNode(t,n,a,e,o),o+=t.nodeSize})),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(a&&this.protectLocalComposition(e,a),hl(this.contentDOM,this.children,e),ws&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){var t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}},{key:"localCompositionInfo",value:function(e,t){var n=e.state.selection,r=n.from,o=n.to;if(!(e.state.selection instanceof p.TextSelection)||rt+this.node.content.size)return null;var i=e.domSelection(),a=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=Ls(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t=n){var c=s=0&&c+t.length+s>=n)return s+c;if(n==r&&l.length>=r+t.length-s&&l.slice(r-s,r-s+t.length)==t)return r}}}return-1}(this.node.content,s,r-t,o-t);return l<0?null:{node:a,pos:l,text:s}}return{node:a,pos:-1,text:""}}},{key:"protectLocalComposition",value:function(e,t){var n=t.node,r=t.pos,o=t.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}var a=new sl(this,i,n,o);e.input.compositionNodes.push(a),this.children=Cl(this.children,r,r+o.length,e,a)}}},{key:"update",value:function(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}},{key:"updateInner",value:function(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}},{key:"updateOuterDeco",value:function(e){if(!kl(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=yl(this.dom,this.nodeDOM,gl(this.outerDeco,this.node,t),gl(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}}},{key:"selectNode",value:function(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}},{key:"deselectNode",value:function(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}},{key:"domAtom",get:function(){return this.node.isAtom}}],[{key:"create",value:function(e,t,r,o,i,a){var s,l=i.nodeViews[t.type.name],u=l&&l(t,i,(function(){return s?s.parent?s.parent.posBeforeChild(s):void 0:a}),r,o),c=u&&u.dom,d=u&&u.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 if(!c){var f=v.DOMSerializer.renderSpec(document,t.type.spec.toDOM(t));c=f.dom,d=f.contentDOM}d||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));var p=c;return c=wl(c,r,t),u?s=new pl(e,t,r,o,c,d||null,p,u,i,a+1):t.isText?new dl(e,t,r,o,c,p,i):new n(e,t,r,o,c,d||null,p,i,a+1)}}]),n}(il);function cl(e,t,n,r,o){return wl(r,t,e),new ul(void 0,e,t,n,r,r,r,o,0)}var dl=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(e,r,o,i,a,s,l){return Object(c.a)(this,n),t.call(this,e,r,o,i,a,null,s,l,0)}return Object(d.a)(n,[{key:"parseRule",value:function(){for(var e=this.nodeDOM.parentNode;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}},{key:"update",value:function(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}},{key:"inParent",value:function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}},{key:"domFromPos",value:function(e){return{node:this.nodeDOM,offset:e}}},{key:"localPosFromDOM",value:function(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):Object(h.a)(Object(m.a)(n.prototype),"localPosFromDOM",this).call(this,e,t,r)}},{key:"ignoreMutation",value:function(e){return"characterData"!=e.type&&"selection"!=e.type}},{key:"slice",value:function(e,t,r){var o=this.node.cut(e,t),i=document.createTextNode(o.text);return new n(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}},{key:"markDirty",value:function(e,t){Object(h.a)(Object(m.a)(n.prototype),"markDirty",this).call(this,e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}},{key:"domAtom",get:function(){return!1}}]),n}(ul),fl=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(){return Object(c.a)(this,n),t.apply(this,arguments)}return Object(d.a)(n,[{key:"parseRule",value:function(){return{ignore:!0}}},{key:"matchesHack",value:function(e){return 0==this.dirty&&this.dom.nodeName==e}},{key:"domAtom",get:function(){return!0}},{key:"ignoreForCoords",get:function(){return"IMG"==this.dom.nodeName}}]),n}(il),pl=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(e,r,o,i,a,s,l,u,d,f){var p;return Object(c.a)(this,n),(p=t.call(this,e,r,o,i,a,s,l,d,f)).spec=u,p}return Object(d.a)(n,[{key:"update",value:function(e,t,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(e,t,r);return i&&this.updateInner(e,t,r,o),i}return!(!this.contentDOM&&!e.isLeaf)&&Object(h.a)(Object(m.a)(n.prototype),"update",this).call(this,e,t,r,o)}},{key:"selectNode",value:function(){this.spec.selectNode?this.spec.selectNode():Object(h.a)(Object(m.a)(n.prototype),"selectNode",this).call(this)}},{key:"deselectNode",value:function(){this.spec.deselectNode?this.spec.deselectNode():Object(h.a)(Object(m.a)(n.prototype),"deselectNode",this).call(this)}},{key:"setSelection",value:function(e,t,r,o){this.spec.setSelection?this.spec.setSelection(e,t,r):Object(h.a)(Object(m.a)(n.prototype),"setSelection",this).call(this,e,t,r,o)}},{key:"destroy",value:function(){this.spec.destroy&&this.spec.destroy(),Object(h.a)(Object(m.a)(n.prototype),"destroy",this).call(this)}},{key:"stopEvent",value:function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}},{key:"ignoreMutation",value:function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):Object(h.a)(Object(m.a)(n.prototype),"ignoreMutation",this).call(this,e)}}]),n}(ul);function hl(e,t,n){for(var r=e.firstChild,o=!1,i=0;i0;){for(var s=void 0;;)if(r){var l=n.children[r-1];if(!(l instanceof ll)){s=l,r--;break}n=l,r=l.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}var u=s.node;if(u){if(u!=e.child(o-1))break;--o,i.set(s,o),a.push(s)}}return{index:o,matched:i,matches:a.reverse()}}(t.node.content,t)}return Object(d.a)(e,[{key:"destroyBetween",value:function(e,t){if(e!=t){for(var n=e;n>1,i=Math.min(o,e.length);r-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var l=ll.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}},{key:"findNodeMatch",value:function(e,t,n,r){var o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(var a=this.index,s=Math.min(this.top.children.length,a+5);a=n||c<=t?i.push(l):(un&&i.push(l.slice(n-u,l.size,r)))}return i}function jl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;var o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;var s,l,u=r.resolve(a);if(Rs(n)){for(s=u;o&&!o.node;)o=o.parent;var c=o.node;if(o&&c.isAtom&&p.NodeSelection.isSelectable(c)&&o.parent&&(!c.isInline||!Ns(n.focusNode,n.focusOffset,o.dom))){var d=o.posBefore;l=new p.NodeSelection(a==d?u:r.resolve(d))}}else{var f=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(f<0)return null;s=r.resolve(f)}if(!l){var h="pointer"==t||e.state.selection.head1&&void 0!==arguments[1]&&arguments[1],n=e.state.selection;if(Rl(e,n),Dl(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&gs){var r=e.domSelection(),o=e.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Es(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Pl(e);else{var i,a,s=n.anchor,l=n.head;!El||n instanceof p.TextSelection||(n.$from.parent.inlineContent||(i=Ml(e,n.from)),n.empty||n.$from.parent.inlineContent||(a=Ml(e,n.to))),e.docView.setSelection(s,l,e.root,t),El&&(i&&Ll(i),a&&Ll(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Nl(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var El=bs||gs&&ys<63;function Ml(e,t){var n=e.docView.domFromPos(t,0),r=n.node,o=n.offset,i=o0?r.max(o):r.min(o),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&p.Selection.findFrom(a,t)}function _l(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Il(e,t,n){var r=e.state.selection;if(!(r instanceof p.TextSelection)){if(r instanceof p.NodeSelection&&r.node.isInline)return _l(e,new p.TextSelection(t>0?r.$to:r.$from));var o=Bl(e.state,t);return!!o&&_l(e,o)}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var i=Bl(e.state,t);return!!(i&&i instanceof p.NodeSelection)&&_l(e,i)}if(!(ks&&n.indexOf("m")>-1)){var a,s=r.$head,l=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(!l||l.isText)return!1;var u=t<0?s.pos-l.nodeSize:s.pos;return!!(l.isAtom||(a=e.docView.descAt(u))&&!a.contentDOM)&&(p.NodeSelection.isSelectable(l)?_l(e,new p.NodeSelection(t<0?e.state.doc.resolve(s.pos-l.nodeSize):s)):!!Os&&_l(e,new p.TextSelection(e.state.doc.resolve(t<0?u:u+l.nodeSize))))}}function $l(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function ql(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function Wl(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){var o,i,a=!1;for(ms&&1==n.nodeType&&r<$l(n)&&ql(n.childNodes[r])&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;var s=n.childNodes[r-1];if(ql(s))o=n,i=--r;else{if(3!=s.nodeType)break;r=(n=s).nodeValue.length}}else{if(Kl(n))break;for(var l=n.previousSibling;l&&ql(l);)o=n.parentNode,i=Cs(l),l=l.previousSibling;if(l)r=$l(n=l);else{if((n=n.parentNode)==e.dom)break;r=0}}a?Gl(e,t,n,r):o&&Gl(e,t,o,i)}}function Ul(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){for(var o,i,a=$l(n);;)if(r-1)return!1;if(ks&&n.indexOf("m")>-1)return!1;var o=r.$from,i=r.$to;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var a=Bl(e.state,t);if(a&&a instanceof p.NodeSelection)return _l(e,a)}if(!o.parent.inlineContent){var s=t<0?o:i,l=r instanceof p.AllSelection?p.Selection.near(s,t):p.Selection.findFrom(s,t);return!!l&&_l(e,l)}return!1}function Yl(e,t){if(!(e.state.selection instanceof p.TextSelection))return!0;var n=e.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r.sameParent(o))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){var s=e.state.tr;return t<0?s.delete(r.pos-a.nodeSize,r.pos):s.delete(r.pos,r.pos+a.nodeSize),e.dispatch(s),!0}return!1}function Xl(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Zl(e,t){var n=t.keyCode,r=function(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||ks&&72==n&&"c"==r?Yl(e,-1)||Wl(e):46==n||ks&&68==n&&"c"==r?Yl(e,1)||Ul(e):13==n||27==n||(37==n||ks&&66==n&&"c"==r?Il(e,-1,r)||Wl(e):39==n||ks&&70==n&&"c"==r?Il(e,1,r)||Ul(e):38==n||ks&&80==n&&"c"==r?Jl(e,-1,r)||Wl(e):40==n||ks&&78==n&&"c"==r?function(e){if(!bs||e.state.selection.$head.parentOffset>0)return!1;var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;Xl(e,o,"true"),setTimeout((function(){return Xl(e,o,"false")}),20)}return!1}(e)||Jl(e,1,r)||Ul(e):r==(ks?"m":"c")&&(66==n||73==n||89==n||90==n))}function Ql(e,t){for(var n=[],r=t.content,o=t.openStart,i=t.openEnd;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;var a=r.firstChild;n.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),r=a.content}var s=e.someProp("clipboardSerializer")||v.DOMSerializer.fromSchema(e.state.schema),l=uu(),u=l.createElement("div");u.appendChild(s.serializeFragment(r,{document:l}));for(var c,d=u.firstChild,f=0;d&&1==d.nodeType&&(c=su[d.nodeName.toLowerCase()]);){for(var p=c.length-1;p>=0;p--){for(var h=l.createElement(c[p]);u.firstChild;)h.appendChild(u.firstChild);u.appendChild(h),f++}d=u.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice","".concat(o," ").concat(i).concat(f?" -".concat(f):""," ").concat(JSON.stringify(n))),{dom:u,text:e.someProp("clipboardTextSerializer",(function(e){return e(t)}))||t.content.textBetween(0,t.content.size,"\n\n")}}function eu(e,t,n,r,o){var i,a,s=o.parent.type.spec.code;if(!n&&!t)return null;var l=t&&(r||s||!n);if(l){if(e.someProp("transformPastedText",(function(e){t=e(t,s||r)})),s)return t?new v.Slice(v.Fragment.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):v.Slice.empty;var u=e.someProp("clipboardTextParser",(function(e){return e(t,o,r)}));if(u)a=u;else{var c=o.marks(),d=e.state.schema,f=v.DOMSerializer.fromSchema(d);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((function(e){var t=i.appendChild(document.createElement("p"));e&&t.appendChild(f.serializeNode(d.text(e,c)))}))}}else e.someProp("transformPastedHTML",(function(e){n=e(n)})),i=function(e){var t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=uu().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&su[o[1].toLowerCase()])&&(e=n.map((function(e){return"<"+e+">"})).join("")+e+n.map((function(e){return""})).reverse().join(""));if(r.innerHTML=e,n)for(var i=0;i0&&i.firstChild;m--)i=i.firstChild;if(!a){var g=e.someProp("clipboardParser")||e.someProp("domParser")||v.DOMParser.fromSchema(e.state.schema);a=g.parseSlice(i,{preserveWhitespace:!(!l&&!h),context:o,ruleFromNode:function(e){return"BR"!=e.nodeName||e.nextSibling||!e.parentNode||tu.test(e.parentNode.nodeName)?null:{ignore:!0}}})}if(h)a=function(e,t){if(!e.size)return e;var n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(u){return e}for(var o=e.content,i=e.openStart,a=e.openEnd,s=n.length-2;s>=0;s-=2){var l=r.nodes[n[s]];if(!l||l.hasRequiredAttrs())break;o=v.Fragment.from(l.create(n[s+1],o)),i++,a++}return new v.Slice(o,i,a)}(au(a,+h[1],+h[2]),h[4]);else if(a=v.Slice.maxOpen(function(e,t){if(e.childCount<2)return e;for(var n=function(n){var r=t.node(n).contentMatchAt(t.index(n)),o=void 0,i=[];if(e.forEach((function(e){if(i){var t,n=r.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&o.length&&ru(n,o,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=ou(i[i.length-1],o.length));var a=nu(e,n);i.push(a),r=r.matchType(a.type),o=n}}})),i)return{v:v.Fragment.from(i)}},r=t.depth;r>=0;r--){var o=n(r);if("object"===typeof o)return o.v}return e}(a.content,o),!0),a.openStart||a.openEnd){for(var y=0,b=0,w=a.content.firstChild;y2&&void 0!==arguments[2]?arguments[2]:0,r=t.length-1;r>=n;r--)e=t[r].create(null,v.Fragment.from(e));return e}function ru(e,t,n,r,o){if(o=n&&(s=t<0?a.contentMatchAt(0).fillBefore(s,e.childCount>1||i<=o).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(v.Fragment.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(s))}function au(e,t,n){return ti.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)})))return{v:!0}},s=i.depth+1;s>0;s--){var l=a(s);if("object"===typeof l)return l.v}return!1}function yu(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function bu(e,t,n,r,o){return gu(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(function(n){return n(e,t,r)}))||(o?function(e,t){if(-1==t)return!1;var n,r,o=e.state.selection;o instanceof p.NodeSelection&&(n=o.node);for(var i=e.state.doc.resolve(t),a=i.depth+1;a>0;a--){var s=a>i.depth?i.nodeAfter:i.node(a);if(p.NodeSelection.isSelectable(s)){r=n&&o.$from.depth>0&&a>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(a);break}}return null!=r&&(yu(e,p.NodeSelection.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&p.NodeSelection.isSelectable(r))&&(yu(e,new p.NodeSelection(n),"pointer"),!0)}(e,n))}function wu(e,t,n,r){return gu(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(function(n){return n(e,t,r)}))}function ku(e,t,n,r){return gu(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(function(n){return n(e,t,r)}))||function(e,t,n){if(0!=n.button)return!1;var r=e.state.doc;if(-1==t)return!!r.inlineContent&&(yu(e,p.TextSelection.create(r,0,r.content.size),"pointer"),!0);for(var o=r.resolve(t),i=o.depth+1;i>0;i--){var a=i>o.depth?o.nodeAfter:o.node(i),s=o.before(i);if(a.inlineContent)yu(e,p.TextSelection.create(r,s+1,s+1+a.content.size),"pointer");else{if(!p.NodeSelection.isSelectable(a))continue;yu(e,p.NodeSelection.create(r,s),"pointer")}return!0}}(e,n,r)}function xu(e){return Eu(e)}du.keydown=function(e,t){var n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Cu(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!xs||!gs||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!ws||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(function(t){return t(e,n)}))||Zl(e,n)?n.preventDefault():pu(e,"key");else{var r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout((function(){e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",(function(t){return t(e,Hs(13,"Enter"))})),e.input.lastIOSEnter=0)}),200)}},du.keyup=function(e,t){16==t.keyCode&&(e.input.shiftKey=!1)},du.keypress=function(e,t){var n=t;if(!(Cu(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||ks&&n.metaKey))if(e.someProp("handleKeyPress",(function(t){return t(e,n)})))n.preventDefault();else{var r=e.state.selection;if(!(r instanceof p.TextSelection)||!r.$from.sameParent(r.$to)){var o=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(function(t){return t(e,r.$from.pos,r.$to.pos,o)}))||e.dispatch(e.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}}};var Ou=ks?"metaKey":"ctrlKey";cu.mousedown=function(e,t){var n=t;e.input.shiftKey=n.shiftKey;var r=xu(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[Ou]&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};var a=e.posAtCoords(vu(n));a&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Su(e,a,n,!!r)):("doubleClick"==i?wu:ku)(e,a.pos,a.inside,n)?n.preventDefault():pu(e,"pointer"))};var Su=function(){function e(t,n,r,o){var i,a,s=this;if(Object(c.a)(this,e),this.view=t,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[Ou],this.allowDefault=r.shiftKey,n.inside>-1)i=t.state.doc.nodeAt(n.inside),a=n.inside;else{var l=t.state.doc.resolve(n.pos);i=l.parent,a=l.depth?l.before():0}var u=o?null:r.target,d=u?t.docView.nearestDesc(u,!0):null;this.target=d?d.dom:null;var f=t.state.selection;(0==r.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||f instanceof p.NodeSelection&&f.from<=a&&f.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!ms||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((function(){s.view.input.mouseDown==s&&s.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),pu(t,"pointer")}return Object(d.a)(e,[{key:"done",value:function(){var e=this;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((function(){return Al(e.view)})),this.view.input.mouseDown=null}},{key:"up",value:function(e){if(this.done(),this.view.dom.contains(e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(vu(e))),this.allowDefault||!t?pu(this.view,"pointer"):bu(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||bs&&this.mightDrag&&!this.mightDrag.node.isAtom||gs&&!(this.view.state.selection instanceof p.TextSelection)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(yu(this.view,p.Selection.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):pu(this.view,"pointer")}}},{key:"move",value:function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),pu(this.view,"pointer"),0==e.buttons&&this.done()}}]),e}();function Cu(e,t){return!!e.composing||!!(bs&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}cu.touchdown=function(e){xu(e),pu(e,"pointer")},cu.contextmenu=function(e){return xu(e)};var ju=xs?5e3:-1;function Du(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((function(){return Eu(e)}),t))}function Au(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){var e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Eu(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(xs&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Au(e),t||e.docView&&e.docView.dirty){var n=jl(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}du.compositionstart=du.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(e){return!1===e.type.spec.inclusive}))))e.markCursor=e.state.storedMarks||n.marks(),Eu(e,!0),e.markCursor=null;else if(Eu(e),ms&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=e.domSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(3==a.nodeType){r.collapse(a,a.nodeValue.length);break}o=a,i=-1}e.input.composing=!0}Du(e,ju)},du.compositionend=function(e,t){e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Du(e,20))};var Mu=ps&&hs<15||ws&&Ss<604;function Tu(e,t,n,r){var o=eu(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(function(t){return t(e,r,o||v.Slice.empty)})))return!0;if(!o)return!1;var i=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),a=i?e.state.tr.replaceSelectionWith(i,e.input.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}cu.copy=du.cut=function(e,t){var n=t,r=e.state.selection,o="cut"==n.type;if(!r.empty){var i=Mu?null:n.clipboardData,a=Ql(e,r.content()),s=a.dom,l=a.text;i?(n.preventDefault(),i.clearData(),i.setData("text/html",s.innerHTML),i.setData("text/plain",l)):function(e,t){if(e.dom.parentNode){var n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}}(e,s),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},du.paste=function(e,t){var n=t;if(!e.composing||xs){var r=Mu?null:n.clipboardData;r&&Tu(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(e.dom.parentNode){var n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Tu(e,r.value,null,t):Tu(e,r.textContent,r.innerHTML,t)}),50)}}(e,n)}};var Lu=Object(d.a)((function e(t,n){Object(c.a)(this,e),this.slice=t,this.move=n})),Nu=ks?"altKey":"ctrlKey";for(var Pu in cu.dragstart=function(e,t){var n=t,r=e.input.mouseDown;if(r&&r.done(),n.dataTransfer){var o=e.state.selection,i=o.empty?null:e.posAtCoords(vu(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof p.NodeSelection?o.to-1:o.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(p.NodeSelection.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){var a=e.docView.nearestDesc(n.target,!0);a&&a.node.type.spec.draggable&&a!=e.docView&&e.dispatch(e.state.tr.setSelection(p.NodeSelection.create(e.state.doc,a.posBefore)))}var s=e.state.selection.content(),l=Ql(e,s),u=l.dom,c=l.text;n.dataTransfer.clearData(),n.dataTransfer.setData(Mu?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",Mu||n.dataTransfer.setData("text/plain",c),e.dragging=new Lu(s,!n[Nu])}},cu.dragend=function(e){var t=e.dragging;window.setTimeout((function(){e.dragging==t&&(e.dragging=null)}),50)},du.dragover=du.dragenter=function(e,t){return t.preventDefault()},du.drop=function(e,t){var n=t,r=e.dragging;if(e.dragging=null,n.dataTransfer){var o=e.posAtCoords(vu(n));if(o){var i=e.state.doc.resolve(o.pos);if(i){var a=r&&r.slice;a?e.someProp("transformPasted",(function(e){a=e(a)})):a=eu(e,n.dataTransfer.getData(Mu?"Text":"text/plain"),Mu?null:n.dataTransfer.getData("text/html"),!1,i);var s=!(!r||n[Nu]);if(e.someProp("handleDrop",(function(t){return t(e,n,a||v.Slice.empty,s)})))n.preventDefault();else if(a){n.preventDefault();var l=a?Object(g.h)(e.state.doc,i.pos,a):i.pos;null==l&&(l=i.pos);var u=e.state.tr;s&&u.deleteSelection();var c=u.mapping.map(l),d=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,f=u.doc;if(d?u.replaceRangeWith(c,c,a.content.firstChild):u.replaceRange(c,c,a),!u.doc.eq(f)){var h=u.doc.resolve(c);if(d&&p.NodeSelection.isSelectable(a.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(a.content.firstChild))u.setSelection(new p.NodeSelection(h));else{var m=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((function(e,t,n,r){return m=r})),u.setSelection(Fl(e,h,u.doc.resolve(m)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))}}}}}},cu.focus=function(e){e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&Al(e)}),20))},cu.blur=function(e,t){var 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)},cu.beforeinput=function(e,t){if(gs&&xs&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();var n=e.input.domChangeCount;setTimeout((function(){if(e.input.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",(function(t){return t(e,Hs(8,"Backspace"))})))){var t=e.state.selection.$cursor;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}}),50)}},du)cu[Pu]=du[Pu];function Ru(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var Hu=function(){function e(t,n){Object(c.a)(this,e),this.toDOM=t,this.spec=n||_u,this.side=this.spec.side||0}return Object(d.a)(e,[{key:"map",value:function(e,t,n,r){var o=e.mapResult(t.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new zu(i-n,i-n,this)}},{key:"valid",value:function(){return!0}},{key:"eq",value:function(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ru(this.spec,t.spec))}},{key:"destroy",value:function(e){this.spec.destroy&&this.spec.destroy(e)}}]),e}(),Fu=function(){function e(t,n){Object(c.a)(this,e),this.attrs=t,this.spec=n||_u}return Object(d.a)(e,[{key:"map",value:function(e,t,n,r){var o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new zu(o,i,this)}},{key:"valid",value:function(e,t){return t.from1&&void 0!==arguments[1]?arguments[1]:0;return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}},{key:"map",value:function(e,t,n){return this.type.map(e,this,t,n)}},{key:"spec",get:function(){return this.type.spec}},{key:"inline",get:function(){return this.type instanceof Fu}}],[{key:"widget",value:function(t,n,r){return new e(t,t,new Hu(n,r))}},{key:"inline",value:function(t,n,r,o){return new e(t,n,new Fu(r,o))}},{key:"node",value:function(t,n,r,o){return new e(t,n,new Vu(r,o))}}]),e}(),Bu=[],_u={},Iu=function(){function e(t,n){Object(c.a)(this,e),this.local=t.length?t:Bu,this.children=n.length?n:Bu}return Object(d.a)(e,[{key:"find",value:function(e,t,n){var r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}},{key:"findInner",value:function(e,t,n,r,o){for(var i=0;i=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(var s=0;se){var l=this.children[s]+1;this.children[s+2].findInner(e-l,t-l,n,r+l,o)}}},{key:"map",value:function(e,t,n){return this==$u||0==e.maps.length?this:this.mapInner(e,t,0,0,n||_u)}},{key:"mapInner",value:function(t,n,r,o,i){for(var a,s=0;sl+i)){var c=s[a]+i;t>=c?s[a+1]=e<=c?-2:-1:n>=o&&(u=r-n-(t-e))&&(s[a]+=u,s[a+1]+=u)}}},u=0;u=r.content.size){c=!0;continue}var h=n.map(e[d+1]+i,-1)-o,m=r.content.findIndex(p),v=m.index,g=m.offset,y=r.maybeChild(v);if(y&&g==p&&g+y.nodeSize==h){var b=s[d+2].mapInner(n,y,f+1,e[d]+i+1,a);b!=$u?(s[d]=p,s[d+1]=h,s[d+2]=b):(s[d+1]=-2,c=!0)}else c=!0}if(c){var w=function(e,t,n,r,o,i,a){function s(e,t){for(var i=0;il&&a.to=t){this.children[i]==t&&(r=this.children[i+2]);break}for(var a=t+1,s=a+n.content.size,l=0;la&&u.type instanceof Fu){var c=Math.max(a,u.from)-a,d=Math.min(s,u.to)-a;cn&&r.to0;)t++;e.splice(t,0,n)}function Zu(e){var t=[];return e.someProp("decorations",(function(n){var r=n(e.state);r&&r!=$u&&t.push(r)})),e.cursorWrapper&&t.push(Iu.create(e.state.doc,[e.cursorWrapper.deco])),qu.from(t)}var Qu={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ec=ps&&hs<=11,tc=function(){function e(){Object(c.a)(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return Object(d.a)(e,[{key:"set",value:function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}},{key:"clear",value:function(){this.anchorNode=this.focusNode=null}},{key:"eq",value:function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}]),e}(),nc=function(){function e(t,n){var r=this;Object(c.a)(this,e),this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new tc,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((function(e){for(var t=0;te.target.nodeValue.length}))?r.flushSoon():r.flush()})),ec&&(this.onCharData=function(e){r.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),r.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}return Object(d.a)(e,[{key:"flushSoon",value:function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){e.flushingSoon=-1,e.flush()}),20))}},{key:"forceFlush",value:function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}},{key:"start",value:function(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Qu)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}},{key:"stop",value:function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var n=0;n-1)){var e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);var t=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&Vl(this.view)&&!this.ignoreSelectionChange(t),r=-1,o=-1,i=!1,a=[];if(this.view.editable)for(var s=0;s1){var u=a.filter((function(e){return"BR"==e.nodeName}));if(2==u.length){var c=u[0],d=u[1];c.parentNode&&c.parentNode.parentNode==d.parentNode?d.remove():c.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),function(e){if(rc)return;rc=!0,"normal"==getComputedStyle(e.dom).whiteSpace&&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.")}(this.view)),this.handleDOMChange(r,o,i,a),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||Al(this.view),this.currentSelection.set(t))}}},{key:"registerMutation",value:function(e,t){if(t.indexOf(e.target)>-1)return null;var 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(var r=0;rDate.now()-50?e.input.lastSelectionOrigin:null,a=jl(e,i);if(a&&!e.state.selection.eq(a)){var s=e.state.tr.setSelection(a);"pointer"==i?s.setMeta("pointer",!0):"key"==i&&s.scrollIntoView(),e.dispatch(s)}}else{var l=e.state.doc.resolve(t),u=l.sharedDepth(n);t=l.before(u+1),n=e.state.doc.resolve(n).after(u+1);var c=e.state.selection,d=function(e,t,n){var r,o=e.docView.parseRange(t,n),i=o.node,a=o.fromOffset,s=o.toOffset,l=o.from,u=o.to,c=e.domSelection(),d=c.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:c.anchorOffset}],Rs(c)||r.push({node:c.focusNode,offset:c.focusOffset})),gs&&8===e.input.lastKeyCode)for(var f=s;f>a;f--){var p=i.childNodes[f-1],h=p.pmViewDesc;if("BR"==p.nodeName&&!h){s=f;break}if(!h||h.size)break}var m=e.state.doc,g=e.someProp("domParser")||v.DOMParser.fromSchema(e.state.schema),y=m.resolve(l),b=null,w=g.parse(i,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:a,to:s,preserveWhitespace:"pre"!=y.parent.type.whitespace||"full",findPositions:r,ruleFromNode:oc,context:y});if(r&&null!=r[0].pos){var k=r[0].pos,x=r[1]&&r[1].pos;null==x&&(x=k),b={anchor:k+l,head:x+l}}return{doc:w,sel:b,from:l,to:u}}(e,t,n);if(gs&&e.cursorWrapper&&d.sel&&d.sel.anchor==e.cursorWrapper.deco.from){var f=e.cursorWrapper.deco.type.toDOM.nextSibling,h=f&&f.nodeValue?f.nodeValue.length:1;d.sel={anchor:d.sel.anchor+h,head:d.sel.anchor+h}}var m,g,y=e.state.doc,b=y.slice(d.from,d.to);8===e.input.lastKeyCode&&Date.now()-100=s?i-r:0)+(l-s),s=i}else if(l=l?i-r:0)+(s-l),l=i}return{start:i,endA:s,endB:l}}(b.content,d.doc.content,d.from,m,g);if((ws&&e.input.lastIOSEnter>Date.now()-225||xs)&&o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName}))&&(!w||w.endA>=w.endB)&&e.someProp("handleKeyDown",(function(t){return t(e,Hs(13,"Enter"))})))e.input.lastIOSEnter=0;else{if(!w){if(!(r&&c instanceof p.TextSelection&&!c.empty&&c.$head.sameParent(c.$anchor))||e.composing||d.sel&&d.sel.anchor!=d.sel.head){if(d.sel){var k=ac(e,e.state.doc,d.sel);k&&!k.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(k))}return}w={start:c.from,endA:c.to,endB:c.to}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&w.start<=e.state.selection.from+2&&e.state.selection.from>=d.from?w.start=e.state.selection.from:w.endA=e.state.selection.to-2&&e.state.selection.to<=d.to&&(w.endB+=e.state.selection.to-w.endA,w.endA=e.state.selection.to)),ps&&hs<=11&&w.endB==w.start+1&&w.endA==w.start&&w.start>d.from&&" \xa0"==d.doc.textBetween(w.start-d.from-1,w.start-d.from+1)&&(w.start--,w.endA--,w.endB--);var x,O=d.doc.resolveNoCache(w.start-d.from),S=d.doc.resolveNoCache(w.endB-d.from),C=y.resolve(w.start),j=O.sameParent(S)&&O.parent.inlineContent&&C.end()>=w.endA;if((ws&&e.input.lastIOSEnter>Date.now()-225&&(!j||o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName})))||!j&&O.posw.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||sc(r,!0,!1)n||sc(a,!0,!1)t.content.size?null:Fl(e,t.resolve(n.anchor),t.resolve(n.head))}function sc(e,t,n){for(var r=e.depth,o=t?e.end():e.pos;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n)for(var i=e.node(r).maybeChild(e.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}var lc=Ql,uc=function(){function e(t,n){var r=this;Object(c.a)(this,e),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 fu,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(hc),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=fc(this),dc(this),this.nodeViews=pc(this),this.docView=cl(this.state.doc,cc(this),Zu(this),this.dom,this),this.domObserver=new nc(this,(function(e,t,n,o){return ic(r,e,t,n,o)})),this.domObserver.start(),function(e){var t=function(t){var n=cu[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=function(t){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||mu(e,t)||!e.editable&&t.type in du||n(e,t)})};for(var n in cu)t(n);bs&&e.dom.addEventListener("input",(function(){return null})),hu(e)}(this),this.updatePluginViews()}return Object(d.a)(e,[{key:"composing",get:function(){return this.input.composing}},{key:"props",get:function(){if(this._props.state!=this.state){var e=this._props;for(var t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}},{key:"update",value:function(e){e.handleDOMEvents!=this._props.handleDOMEvents&&hu(this),this._props=e,e.plugins&&(e.plugins.forEach(hc),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)}},{key:"setProps",value:function(e){var t={};for(var n in this._props)t[n]=this._props[n];for(var r in t.state=this.state,e)t[r]=e[r];this.update(t)}},{key:"updateState",value:function(e){this.updateStateInner(e,this.state.plugins!=e.plugins)}},{key:"updateStateInner",value:function(e,t){var n=this,r=this.state,o=!1,i=!1;if(e.storedMarks&&this.composing&&(Au(this),i=!0),this.state=e,t){var a=pc(this);(function(e,t){var n=0,r=0;for(var o in e){if(e[o]!=t[o])return!0;n++}for(var i in t)r++;return n!=r})(a,this.nodeViews)&&(this.nodeViews=a,o=!0),hu(this)}this.editable=fc(this),dc(this);var s=Zu(this),l=cc(this),u=t?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",c=o||!this.docView.matchesNode(e.doc,l,s);!c&&e.selection.eq(r.selection)||(i=!0);var d="preserve"==u&&i&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,a=o+1;a=o-20){t=s,n=l.top;break}}}return{refDOM:t,refTop:n,stack:_s(e.dom)}}(this);if(i){this.domObserver.stop();var f=c&&(ps||gs)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(e,t){var n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(r.selection,e.selection);if(c){var h=gs?this.trackWrites=this.domSelection().focusNode:null;!o&&this.docView.update(e.doc,l,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=cl(e.doc,l,s,this.dom,this)),h&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){var t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return Es(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Al(this,f):(Rl(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),"reset"==u)this.dom.scrollTop=0;else if("to selection"==u){var m=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(function(e){return e(n)})));else if(e.selection instanceof p.NodeSelection){var v=this.docView.domAfterPos(e.selection.from);1==v.nodeType&&Bs(this,v.getBoundingClientRect(),m)}else Bs(this,this.coordsAtPos(e.selection.head,1),m)}else d&&function(e){var t=e.refDOM,n=e.refTop,r=e.stack,o=t?t.getBoundingClientRect().top:0;Is(r,0==o?0:o-n)}(d)}},{key:"destroyPluginViews",value:function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()}},{key:"updatePluginViews",value:function(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:1;return Ys(this,e,t)}},{key:"domAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.domFromPos(e,t)}},{key:"nodeDOM",value:function(e){var t=this.docView.descAt(e);return t?t.nodeDOM:null}},{key:"posAtDOM",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}},{key:"endOfTextblock",value:function(e,t){return ol(this,t||this.state,e)}},{key:"destroy",value:function(){this.docView&&(!function(e){for(var t in e.domObserver.stop(),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,[],Zu(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}},{key:"isDestroyed",get:function(){return null==this.docView}},{key:"dispatchEvent",value:function(e){return function(e,t){mu(e,t)||!cu[t.type]||!e.editable&&t.type in du||cu[t.type](e,t)}(this,e)}},{key:"dispatch",value:function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}},{key:"domSelection",value:function(){return this.root.getSelection()}}]),e}();function cc(e){var t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(e.state)),n)for(var r in n)"class"==r&&(t.class+=" "+n[r]),"style"==r?t.style=(t.style?t.style+";":"")+n[r]:t[r]||"contenteditable"==r||"nodeName"==r||(t[r]=String(n[r]))})),[zu.node(0,e.state.doc.content.size,t)]}function dc(e){if(e.markCursor){var t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:zu.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function fc(e){return!e.someProp("editable",(function(t){return!1===t(e.state)}))}function pc(e){var t=Object.create(null);function n(e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function hc(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 mc=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(e){return Object(c.a)(this,n),t.call(this,e,e)}return Object(d.a)(n,[{key:"map",value:function(e,t){var r=e.resolve(t.map(this.head));return n.valid(r)?new n(r):p.Selection.near(r)}},{key:"content",value:function(){return v.Slice.empty}},{key:"eq",value:function(e){return e instanceof n&&e.head==this.head}},{key:"toJSON",value:function(){return{type:"gapcursor",pos:this.head}}},{key:"getBookmark",value:function(){return new vc(this.anchor)}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new n(e.resolve(t.pos))}},{key:"valid",value:function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var n=e.index(t),r=e.node(t);if(0!=n)for(var o=r.child(n-1);;o=o.lastChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(var o=r.child(n);;o=o.firstChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;var n=t.type.spec.allowGapCursor;if(null!=n)return n;var r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}},{key:"findGapCursorFrom",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e:for(;;){if(!r&&n.valid(e))return e;for(var o=e.pos,i=null,a=e.depth;;a--){var s=e.node(a);if(t>0?e.indexAfter(a)0){i=s.child(t>0?e.indexAfter(a):e.index(a)-1);break}if(0==a)return null;o+=t;var l=e.doc.resolve(o);if(n.valid(l))return l}for(;;){var u=t>0?i.firstChild:i.lastChild;if(!u){if(i.isAtom&&!i.isText&&!p.NodeSelection.isSelectable(i)){e=e.doc.resolve(o+i.nodeSize*t),r=!1;continue e}break}i=u,o+=t;var c=e.doc.resolve(o);if(n.valid(c))return c}return null}}}]),n}(p.Selection);mc.prototype.visible=!1,mc.findFrom=mc.findGapCursorFrom,p.Selection.jsonID("gapcursor",mc);var vc=function(){function e(t){Object(c.a)(this,e),this.pos=t}return Object(d.a)(e,[{key:"map",value:function(t){return new e(t.map(this.pos))}},{key:"resolve",value:function(e){var t=e.resolve(this.pos);return mc.valid(t)?new mc(t):p.Selection.near(t)}}]),e}();var gc=Bn({ArrowLeft:yc("horiz",-1),ArrowRight:yc("horiz",1),ArrowUp:yc("vert",-1),ArrowDown:yc("vert",1)});function yc(e,t){var n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){var i=e.selection,a=t>0?i.$to:i.$from,s=i.empty;if(i instanceof p.TextSelection){if(!o.endOfTextblock(n)||0==a.depth)return!1;s=!1,a=e.doc.resolve(t>0?a.after():a.before())}var l=mc.findGapCursorFrom(a,t,s);return!!l&&(r&&r(e.tr.setSelection(new mc(l))),!0)}}function bc(e,t,n){if(!e||!e.editable)return!1;var r=e.state.doc.resolve(t);if(!mc.valid(r))return!1;var o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&p.NodeSelection.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new mc(r))),!0)}function wc(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof mc))return!1;var n=e.state.selection.$from,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;for(var o=v.Fragment.empty,i=r.length-1;i>=0;i--)o=v.Fragment.from(r[i].createAndFill(null,o));var a=e.state.tr.replace(n.pos,n.pos,new v.Slice(o,0,0));return a.setSelection(p.TextSelection.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function kc(e){if(!(e.selection instanceof mc))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",Iu.create(e.doc,[zu.widget(e.selection.head,t,{key:"gapcursor"})])}var xc=Ir.create({name:"gapCursor",addProseMirrorPlugins:function(){return[new p.Plugin({props:{decorations:kc,createSelectionBetween:function(e,t,n){return t.pos==n.pos&&mc.valid(n)?new mc(n):null},handleClick:bc,handleKeyDown:gc,handleDOMEvents:{beforeinput:wc}}})]},extendNodeSchema:function(e){var t;return{allowGapCursor:null!==(t=Dr(wr(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),Oc=Bo.create({name:"hardBreak",addOptions:function(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML:function(){return[{tag:"br"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["br",Sr(this.options.HTMLAttributes,t)]},renderText:function(){return"\n"},addCommands:function(){var e=this;return{setHardBreak:function(){return function(t){var n=t.commands,r=t.chain,o=t.state,i=t.editor;return n.first([function(){return n.exitCode()},function(){return n.command((function(){var t=o.selection,n=o.storedMarks;if(t.$from.parent.type.spec.isolating)return!1;var a=e.options.keepMarks,s=i.extensionManager.splittableMarks,l=n||t.$to.parentOffset&&t.$from.marks();return r().insertContent({type:e.name}).command((function(e){var t=e.tr;if(e.dispatch&&l&&a){var n=l.filter((function(e){return s.includes(e.type.name)}));t.ensureMarks(n)}return!0})).run()}))}])}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Enter":function(){return e.editor.commands.setHardBreak()},"Shift-Enter":function(){return e.editor.commands.setHardBreak()}}}}),Sc=Bo.create({name:"heading",addOptions:function(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes:function(){return{level:{default:1,rendered:!1}}},parseHTML:function(){return this.options.levels.map((function(e){return{tag:"h".concat(e),attrs:{level:e}}}))},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes,r=this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0];return["h".concat(r),Sr(this.options.HTMLAttributes,n),0]},addCommands:function(){var e=this;return{setHeading:function(t){return function(n){var r=n.commands;return!!e.options.levels.includes(t.level)&&r.setNode(e.name,t)}},toggleHeading:function(t){return function(n){var r=n.commands;return!!e.options.levels.includes(t.level)&&r.toggleNode(e.name,"paragraph",t)}}}},addKeyboardShortcuts:function(){var e=this;return this.options.levels.reduce((function(t,n){return Object(f.a)(Object(f.a)({},t),Object(s.a)({},"Mod-Alt-".concat(n),(function(){return e.editor.commands.toggleHeading({level:n})})))}),{})},addInputRules:function(){var e=this;return this.options.levels.map((function(t){return Fo({find:new RegExp("^(#{1,".concat(t,"})\\s$")),type:e.type,getAttributes:{level:t}})}))}}),Cc=200,jc=function(){};jc.prototype.append=function(e){return e.length?(e=jc.from(e),!this.length&&e||e.length=t?jc.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},jc.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},jc.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)},jc.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},jc.from=function(e){return e instanceof jc?e:e&&e.length?new Dc(e):jc.empty};var Dc=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Cc)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Cc)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}(jc);jc.empty=new Dc([]);var Ac=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 eo&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n=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}(jc),Ec=jc,Mc=function(){function e(t,n){Object(c.a)(this,e),this.items=t,this.eventCount=n}return Object(d.a)(e,[{key:"popEvent",value:function(t,n){var r=this;if(0==this.eventCount)return null;for(var o,i,a=this.items.length;;a--){if(this.items.get(a-1).selection){--a;break}}n&&(o=this.remapping(a,this.items.length),i=o.maps.length);var s,l,u=t.tr,c=[],d=[];return this.items.forEach((function(t,n){if(!t.step)return o||(o=r.remapping(a,n+1),i=o.maps.length),i--,void d.push(t);if(o){d.push(new Tc(t.map));var f,p=t.step.map(o.slice(i));p&&u.maybeStep(p).doc&&(f=u.mapping.maps[u.mapping.maps.length-1],c.push(new Tc(f,void 0,void 0,c.length+d.length))),i--,f&&o.appendMap(f,i)}else u.maybeStep(t.step);return t.selection?(s=o?t.selection.map(o.slice(i)):t.selection,l=new e(r.items.slice(0,a).append(d.reverse().concat(c)),r.eventCount-1),!1):void 0}),this.items.length,0),{remaining:l,transform:u,selection:s}}},{key:"addTransform",value:function(t,n,r,o){for(var i=[],a=this.eventCount,s=this.items,l=!o&&s.length?s.get(s.length-1):null,u=0;uNc&&(s=function(e,t){var n;return e.forEach((function(e,r){if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,p),a-=p),new e(s.append(i),a)}},{key:"remapping",value:function(e,t){var n=new g.a;return this.items.forEach((function(t,r){var o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)}),e,t),n}},{key:"addMaps",value:function(t){return 0==this.eventCount?this:new e(this.items.append(t.map((function(e){return new Tc(e)}))),this.eventCount)}},{key:"rebased",value:function(t,n){if(!this.eventCount)return this;var r=[],o=Math.max(0,this.items.length-n),i=t.mapping,a=t.steps.length,s=this.eventCount;this.items.forEach((function(e){e.selection&&s--}),o);var l=n;this.items.forEach((function(e){var n=i.getMirror(--l);if(null!=n){a=Math.min(a,n);var o=i.maps[n];if(e.step){var u=t.steps[n].invert(t.docs[n]),c=e.selection&&e.selection.map(i.slice(l+1,n));c&&s++,r.push(new Tc(o,u,c))}else r.push(new Tc(o))}}),o);for(var u=[],c=n;c500&&(d=d.compress(this.items.length-r.length)),d}},{key:"emptyItemCount",value:function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e}},{key:"compress",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.items.length,n=this.remapping(0,t),r=n.maps.length,o=[],i=0;return this.items.forEach((function(e,a){if(a>=t)o.push(e),e.selection&&i++;else if(e.step){var s=e.step.map(n.slice(r)),l=s&&s.getMap();if(r--,l&&n.appendMap(l,r),s){var u=e.selection&&e.selection.map(n.slice(r));u&&i++;var c,d=new Tc(l.invert(),s,u),f=o.length-1;(c=o.length&&o[f].merge(d))?o[f]=c:o.push(d)}}else e.map&&r--}),this.items.length,0),new e(Ec.from(o.reverse()),i)}}]),e}();Mc.empty=new Mc(Ec.empty,0);var Tc=function(){function e(t,n,r,o){Object(c.a)(this,e),this.map=t,this.step=n,this.selection=r,this.mirrorOffset=o}return Object(d.a)(e,[{key:"merge",value:function(t){if(this.step&&t.step&&!t.selection){var n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}}]),e}(),Lc=Object(d.a)((function e(t,n,r,o){Object(c.a)(this,e),this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=o})),Nc=20;function Pc(e,t,n,r){var o,i=n.getMeta(_c);if(i)return i.historyState;n.getMeta(Ic)&&(e=new Lc(e.done,e.undone,null,0));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(a&&a.getMeta(_c))return a.getMeta(_c).redo?new Lc(e.done.addTransform(n,void 0,r,Bc(t)),e.undone,Rc(n.mapping.maps[n.steps.length-1]),e.prevTime):new Lc(e.done,e.undone.addTransform(n,void 0,r,Bc(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new Lc(e.done.rebased(n,o),e.undone.rebased(n,o),Hc(e.prevRanges,n.mapping),e.prevTime):new Lc(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Hc(e.prevRanges,n.mapping),e.prevTime);var s=0==e.prevTime||!a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;return e.mapping.maps[0].forEach((function(e,r){for(var o=0;o=t[o]&&(n=!0)})),n}(n,e.prevRanges)),l=a?Hc(e.prevRanges,n.mapping):Rc(n.mapping.maps[n.steps.length-1]);return new Lc(e.done.addTransform(n,s?t.selection.getBookmark():void 0,r,Bc(t)),Mc.empty,l,n.time)}function Rc(e){var t=[];return e.forEach((function(e,n,r,o){return t.push(r,o)})),t}function Hc(e,t){if(!e)return null;for(var n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{};return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new p.Plugin({key:_c,state:{init:function(){return new Lc(Mc.empty,Mc.empty,null,0)},apply:function(t,n,r){return Pc(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var n=t.inputType,r="historyUndo"==n?qc:"historyRedo"==n?Wc:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}var qc=function(e,t){var n=_c.getState(e);return!(!n||0==n.done.eventCount)&&(t&&Fc(n,e,t,!1),!0)},Wc=function(e,t){var n=_c.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&Fc(n,e,t,!0),!0)};var Uc=Ir.create({name:"history",addOptions:function(){return{depth:100,newGroupDelay:500}},addCommands:function(){return{undo:function(){return function(e){var t=e.state,n=e.dispatch;return qc(t,n)}},redo:function(){return function(e){var t=e.state,n=e.dispatch;return Wc(t,n)}}}},addProseMirrorPlugins:function(){return[$c(this.options)]},addKeyboardShortcuts:function(){var e=this;return{"Mod-z":function(){return e.editor.commands.undo()},"Mod-y":function(){return e.editor.commands.redo()},"Shift-Mod-z":function(){return e.editor.commands.redo()},"Mod-\u044f":function(){return e.editor.commands.undo()},"Shift-Mod-\u044f":function(){return e.editor.commands.redo()}}}}),Kc=Bo.create({name:"horizontalRule",addOptions:function(){return{HTMLAttributes:{}}},group:"block",parseHTML:function(){return[{tag:"hr"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["hr",Sr(this.options.HTMLAttributes,t)]},addCommands:function(){var e=this;return{setHorizontalRule:function(){return function(t){return(0,t.chain)().insertContent({type:e.name}).command((function(e){var t,n=e.tr;if(e.dispatch){var r=n.selection.$to,o=r.end();if(r.nodeAfter)n.setSelection(p.TextSelection.create(n.doc,r.pos));else{var i=null===(t=r.parent.type.contentMatch.defaultType)||void 0===t?void 0:t.create();i&&(n.insert(o,i),n.setSelection(p.TextSelection.create(n.doc,o)))}n.scrollIntoView()}return!0})).run()}}}},addInputRules:function(){return[Ho({find:/^(?:---|\u2014-|___\s|\*\*\*\s)$/,type:this.type})]}}),Gc=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,Jc=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,Yc=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,Xc=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,Zc=zo.create({name:"italic",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"em"},{tag:"i",getAttrs:function(e){return"normal"!==e.style.fontStyle&&null}},{style:"font-style=italic"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["em",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setItalic:function(){return function(t){return t.commands.setMark(e.name)}},toggleItalic:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetItalic:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-i":function(){return e.editor.commands.toggleItalic()},"Mod-I":function(){return e.editor.commands.toggleItalic()}}},addInputRules:function(){return[Ro({find:Gc,type:this.type}),Ro({find:Yc,type:this.type})]},addPasteRules:function(){return[_o({find:Jc,type:this.type}),_o({find:Xc,type:this.type})]}}),Qc=Bo.create({name:"listItem",addOptions:function(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML:function(){return[{tag:"li"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["li",Sr(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts:function(){var e=this;return{Enter:function(){return e.editor.commands.splitListItem(e.name)},Tab:function(){return e.editor.commands.sinkListItem(e.name)},"Shift-Tab":function(){return e.editor.commands.liftListItem(e.name)}}}});function ed(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var td=["start"],nd=/^(\d+)\.\s$/,rd=Bo.create({name:"orderedList",addOptions:function(){return{itemTypeName:"listItem",HTMLAttributes:{}}},group:"block list",content:function(){return"".concat(this.options.itemTypeName,"+")},addAttributes:function(){return{start:{default:1,parseHTML:function(e){return e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}}},parseHTML:function(){return[{tag:"ol"}]},renderHTML:function(e){var t=e.HTMLAttributes,n=t.start,r=ed(t,td);return 1===n?["ol",Sr(this.options.HTMLAttributes,r),0]:["ol",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{toggleOrderedList:function(){return function(t){return t.commands.toggleList(e.name,e.options.itemTypeName)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-7":function(){return e.editor.commands.toggleOrderedList()}}},addInputRules:function(){return[Vo({find:nd,type:this.type,getAttributes:function(e){return{start:+e[1]}},joinPredicate:function(e,t){return t.childCount+t.attrs.start===+e[1]}})]}}),od=Bo.create({name:"paragraph",priority:1e3,addOptions:function(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML:function(){return[{tag:"p"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["p",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setParagraph:function(){return function(t){return t.commands.setNode(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Alt-0":function(){return e.editor.commands.setParagraph()}}}}),id=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,ad=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,sd=zo.create({name:"strike",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:function(e){return!!e.includes("line-through")&&{}}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["s",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setStrike:function(){return function(t){return t.commands.setMark(e.name)}},toggleStrike:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetStrike:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-x":function(){return e.editor.commands.toggleStrike()}}},addInputRules:function(){return[Ro({find:id,type:this.type})]},addPasteRules:function(){return[_o({find:ad,type:this.type})]}}),ld=Bo.create({name:"text",group:"inline"}),ud=Ir.create({name:"starterKit",addExtensions:function(){var e,t,n,r,o,i,a,s,l,u,c,d,f,p,h,m,v,g,y=[];return!1!==this.options.blockquote&&y.push(Ia.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&y.push(Ka.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&y.push(Ja.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&y.push(Za.configure(null===(r=this.options)||void 0===r?void 0:r.code)),!1!==this.options.codeBlock&&y.push(ts.configure(null===(o=this.options)||void 0===o?void 0:o.codeBlock)),!1!==this.options.document&&y.push(ns.configure(null===(i=this.options)||void 0===i?void 0:i.document)),!1!==this.options.dropcursor&&y.push(as.configure(null===(a=this.options)||void 0===a?void 0:a.dropcursor)),!1!==this.options.gapcursor&&y.push(xc.configure(null===(s=this.options)||void 0===s?void 0:s.gapcursor)),!1!==this.options.hardBreak&&y.push(Oc.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&y.push(Sc.configure(null===(u=this.options)||void 0===u?void 0:u.heading)),!1!==this.options.history&&y.push(Uc.configure(null===(c=this.options)||void 0===c?void 0:c.history)),!1!==this.options.horizontalRule&&y.push(Kc.configure(null===(d=this.options)||void 0===d?void 0:d.horizontalRule)),!1!==this.options.italic&&y.push(Zc.configure(null===(f=this.options)||void 0===f?void 0:f.italic)),!1!==this.options.listItem&&y.push(Qc.configure(null===(p=this.options)||void 0===p?void 0:p.listItem)),!1!==this.options.orderedList&&y.push(rd.configure(null===(h=this.options)||void 0===h?void 0:h.orderedList)),!1!==this.options.paragraph&&y.push(od.configure(null===(m=this.options)||void 0===m?void 0:m.paragraph)),!1!==this.options.strike&&y.push(sd.configure(null===(v=this.options)||void 0===v?void 0:v.strike)),!1!==this.options.text&&y.push(ld.configure(null===(g=this.options)||void 0===g?void 0:g.text)),y}}),cd=Ir.create({name:"textAlign",addOptions:function(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes:function(){var e=this;return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:function(t){return t.style.textAlign||e.options.defaultAlignment},renderHTML:function(t){return t.textAlign===e.options.defaultAlignment?{}:{style:"text-align: ".concat(t.textAlign)}}}}}]},addCommands:function(){var e=this;return{setTextAlign:function(t){return function(n){var r=n.commands;return!!e.options.alignments.includes(t)&&e.options.types.every((function(e){return r.updateAttributes(e,{textAlign:t})}))}},unsetTextAlign:function(){return function(t){var n=t.commands;return e.options.types.every((function(e){return n.resetAttributes(e,"textAlign")}))}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-l":function(){return e.editor.commands.setTextAlign("left")},"Mod-Shift-e":function(){return e.editor.commands.setTextAlign("center")},"Mod-Shift-r":function(){return e.editor.commands.setTextAlign("right")},"Mod-Shift-j":function(){return e.editor.commands.setTextAlign("justify")}}}}),dd=zo.create({name:"subscript",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"sub"},{style:"vertical-align",getAttrs:function(e){return"sub"===e&&null}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["sub",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setSubscript:function(){return function(t){return t.commands.setMark(e.name)}},toggleSubscript:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetSubscript:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-,":function(){return e.editor.commands.toggleSubscript()}}}}),fd=zo.create({name:"superscript",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"sup"},{style:"vertical-align",getAttrs:function(e){return"super"===e&&null}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["sup",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setSuperscript:function(){return function(t){return t.commands.setMark(e.name)}},toggleSuperscript:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetSuperscript:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-.":function(){return e.editor.commands.toggleSuperscript()}}}}),pd=zo.create({name:"textStyle",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"span",getAttrs:function(e){return!!e.hasAttribute("style")&&{}}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["span",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{removeEmptyTextStyle:function(){return function(t){var n=t.state,r=t.commands,o=uo(n,e.type);return!!Object.entries(o).some((function(e){return!!Object(u.a)(e,2)[1]}))||r.unsetMark(e.name)}}}}}),hd=Ir.create({name:"fontSize",defaultOptions:{types:["textStyle"],defaultFontSize:16},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{fontSize:{default:"".concat(this.options.defaultFontSize,"px"),parseHTML:function(e){return e.style.fontSize},renderHTML:function(e){return e.fontSize?{style:"font-size: ".concat(e.fontSize)}:{}}}}}]},addCommands:function(){return{setFontSize:function(e){return function(t){return(0,t.chain)().setMark("textStyle",{fontSize:e}).run()}},unsetFontSize:function(){return function(e){return(0,e.chain)().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}}}),md=Ir.create({name:"textDirection",defaultOptions:{types:["paragraph","heading"],defaultDirection:"ltr"},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{textDirection:{default:this.options.defaultDirection,parseHTML:function(e){return e.dir},renderHTML:function(e){return e.textDirection?{dir:e.textDirection}:{}}}}}]},addCommands:function(){var e=this;return{setTextDirection:function(t){return function(n){var r=n.commands;return e.options.types.every((function(e){return r.updateAttributes(e,{textDirection:t})}))}}}}}),vd=Ir.create({name:"fontFamily",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:function(e){var t;return null===(t=e.style.fontFamily)||void 0===t?void 0:t.replace(/['"]+/g,"")},renderHTML:function(e){return e.fontFamily?{style:"font-family: ".concat(e.fontFamily)}:{}}}}}]},addCommands:function(){return{setFontFamily:function(e){return function(t){return(0,t.chain)().setMark("textStyle",{fontFamily:e}).run()}},unsetFontFamily:function(){return function(e){return(0,e.chain)().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}}}),gd=Ja.extend({addAttributes:function(){return{listType:{default:null,parseHTML:function(e){return e.style.listStyleType},renderHTML:function(e){return e.listType?{style:"list-style-type: ".concat(e.listType)}:{}}}}}}),yd=rd.extend({addAttributes:function(){return{listType:{default:null,parseHTML:function(e){return e.style.listStyleType},renderHTML:function(e){return e.listType?{style:"list-style-type: ".concat(e.listType)}:{}}}}}}),bd=Ir.create({name:"color",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:function(e){var t;return null===(t=e.style.color)||void 0===t?void 0:t.replace(/['"]+/g,"")},renderHTML:function(e){return e.color?{style:"color: ".concat(e.color)}:{}}}}}]},addCommands:function(){return{setColor:function(e){return function(t){return(0,t.chain)().setMark("textStyle",{color:e}).run()}},unsetColor:function(){return function(e){return(0,e.chain)().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}}}),wd=Bo.create({name:"tableRow",addOptions:function(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:function(){return[{tag:"tr"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["tr",Sr(this.options.HTMLAttributes,t),0]}});function kd(e,t,n){return{default:null,parseHTML:function(t){var r;return n?null===(r=t.style[e])||void 0===r?void 0:r.toString().replace(n,""):t.style[e]},renderHTML:function(r){return r[e]?{style:"".concat(t,": ").concat(r[e]).concat(n||"")}:{}}}}var xd=Bo.create({name:"tableCell",addOptions:function(){return{HTMLAttributes:{}}},content:"block+",addAttributes:function(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:function(e){var t=e.getAttribute("colwidth");return t?[parseInt(t,10)]:null}}}},tableRole:"cell",isolating:!0,parseHTML:function(){return[{tag:"td"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["td",Sr(this.options.HTMLAttributes,t),0]}}).extend({addAttributes:function(){var e;return Object.assign(Object.assign({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{backgroundColor:kd("backgroundColor","background-color"),color:kd("color","color"),borderWidth:kd("borderWidth","border-width","px"),borderStyle:kd("borderStyle","border-style"),borderColor:kd("borderColor","border-color")})}}),Od=Bo.create({name:"tableHeader",addOptions:function(){return{HTMLAttributes:{}}},content:"block+",addAttributes:function(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:function(e){var t=e.getAttribute("colwidth");return t?[parseInt(t,10)]:null}}}},tableRole:"header_cell",isolating:!0,parseHTML:function(){return[{tag:"th"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["th",Sr(this.options.HTMLAttributes,t),0]}}),Sd=n(15),Cd=n(0),jd=n(1),Dd=n.n(jd),Ad=n(32),Ed=n(45);n(60);function Md(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Td=function(e,t){return"function"===typeof t?t(e):function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return this.options.component?Object(Cd.jsx)(Bd,{children:Object(Cd.jsx)(this.options.component,Object.assign({},t,{editor:this.editor,getPos:this.getPos,node:this.node,forwardRef:n,updateAttributes:function(t,n){return e.updateAttributes(t,e.getPos(),null===n||void 0===n?void 0:n.addToHistory,null===n||void 0===n?void 0:n.preventUpdate)}}))}):null}},{key:"updateAttributes",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.editor.commands.command((function(i){var a=i.tr;return a.setNodeMarkup(t,void 0,Object.assign(Object.assign({},n.node.attrs),e)),a.setMeta("addToHistory",r),a.setMeta("preventUpdate",o),!0}))}},{key:"update",value:function(e,t,n){var r=this;return this.node.type===e.type&&(this.viewShouldUpdate(e)?(this.node=e,this.renderReactComponent((function(){return r.render(r.options.props,r.handleRef)})),!0):(this.node=e,!0))}},{key:"onDragStart",value:function(e){var t,n,r,o,i,a,s,l=this.editor.view,u=e.target,c=3===u.nodeType?null===(t=u.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(this.dom&&!(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(u))&&c){var d=this.dom.querySelector("[data-drag-image]")||this.dom,f=0,h=0;if(d!==c){var m=d.getBoundingClientRect(),v=c.getBoundingClientRect(),g=null!==(r=e.offsetX)&&void 0!==r?r:null===(o=e.nativeEvent)||void 0===o?void 0:o.offsetX,y=null!==(i=e.offsetY)&&void 0!==i?i:null===(a=e.nativeEvent)||void 0===a?void 0:a.offsetY;f=v.x-m.x+g,h=v.y-m.y+y}var b=p.NodeSelection.create(l.state.doc,this.getPos()),w=l.state.tr.setSelection(b);l.dispatch(w),null===(s=e.dataTransfer)||void 0===s||s.setDragImage(d,f,h),function(e,t){if(!e.dataTransfer)return;var n=t.view,r=n.state.selection.content(),o=lc(n,r),i=o.dom,a=o.text;e.dataTransfer.clearData(),e.dataTransfer.setData("Text",a),e.dataTransfer.setData("text/plain",a),e.dataTransfer.setData("text/html",i.innerHTML),e.dataTransfer.effectAllowed="copyMove",n.dragging={slice:r,move:!0}}(e,this.editor)}}},{key:"stopEvent",value:function(e){var t,n=this;if(!this.dom)return!1;var r=e.target;if(!(this.dom.contains(r)&&!(null===(t=this.contentDOM)||void 0===t?void 0:t.contains(r))))return!1;var o="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o)return!0;var i=this.editor.isEditable,a=this.isDragging,s=!!this.node.type.spec.draggable,l=p.NodeSelection.isSelectable(this.node),u="copy"===e.type,c="paste"===e.type,d="cut"===e.type,f="mousedown"===e.type,h=e.type.startsWith("drag");if(!s&&l&&h&&e.preventDefault(),s&&h&&!a)return e.preventDefault(),!1;if(s&&i&&!a&&f){var m=r.closest("[data-drag-handle]");m&&(this.dom===m||this.dom.contains(m))&&(this.isDragging=!0,document.addEventListener("dragend",(function(){n.isDragging=!1}),{once:!0}),document.addEventListener("mouseup",(function(){n.isDragging=!1}),{once:!0}))}return!(a||o||u||c||d||f&&l)}},{key:"ignoreMutation",value:function(e){if(!this.dom||!this.contentDOM)return!0;if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&this.editor.isFocused&&[].concat(Object(l.a)(Array.from(e.addedNodes)),Object(l.a)(Array.from(e.removedNodes))).every((function(e){return e.isContentEditable})))return!1;return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}},{key:"viewShouldUpdate",value:function(e){return!this.options.shouldUpdate||this.options.shouldUpdate(this.node,e)}},{key:"setDomAttrs",value:function(e,t){Object.keys(e.attrs||{}).forEach((function(n){t.setAttribute(n,e.attrs[n])}))}},{key:"dom",get:function(){return this.domRef}},{key:"destroy",value:function(){this.domRef&&this.portalProviderAPI&&(this.portalProviderAPI.remove(this.domRef),this.domRef=void 0,this.contentDOM=void 0)}}]),e}();function Id(e,t){return function(n){var r=n.node,o=n.getPos,i=n.editor;return new _d(r,i,(function(){return"boolean"===typeof o?-1:o()}),Object.assign(Object.assign({},t),{component:e})).init()}}var $d=n(25),qd=n.n($d),Wd=function(){function e(){Object(c.a)(this,e),this.listeners={}}return Object(d.a)(e,[{key:"on",value:function(e,t){this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].add(t)}},{key:"off",value:function(e,t){this.listeners[e]&&this.listeners[e].has(t)&&this.listeners[e].delete(t)}},{key:"emit",value:function(e,t){this.listeners[e]&&this.listeners[e].forEach((function(e){return e(t)}))}},{key:"destroy",value:function(){this.listeners={}}}]),e}();var Ud=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(){var e;return Object(c.a)(this,n),(e=t.call(this)).portals=new Map,e.setContext=function(t){e.context=t},e}return Object(d.a)(n,[{key:"render",value:function(e,t){this.portals.set(t,{children:e});var n=e();Object($d.unstable_renderSubtreeIntoContainer)(this.context,n,t)}},{key:"forceUpdate",value:function(){}},{key:"remove",value:function(e){this.portals.delete(e);try{Object($d.unmountComponentAtNode)(e)}catch(t){}}}]),n}(Wd),Kd=Dd.a.createContext(void 0);function Gd(){return Object(jd.useContext)(Kd)}var Jd=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(e){var r;return Object(c.a)(this,n),(r=t.call(this,e)).portalProviderAPI=new Ud,r}return Object(d.a)(n,[{key:"render",value:function(){return Object(Cd.jsxs)(Kd.Provider,Object.assign({value:this.portalProviderAPI},{children:[this.props.children,Object(Cd.jsx)(Yd,{portalProviderAPI:this.portalProviderAPI})]}))}},{key:"componentDidUpdate",value:function(){this.portalProviderAPI.forceUpdate()}}]),n}(Dd.a.Component);Jd.displayName="PortalProvider";var Yd=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(e){var r;return Object(c.a)(this,n),(r=t.call(this,e)).handleUpdate=function(e){return r.setState({portals:e})},e.portalProviderAPI.setContext(Object(o.a)(r)),e.portalProviderAPI.on("update",r.handleUpdate),r.state={portals:new Map},r}return Object(d.a)(n,[{key:"render",value:function(){var e=this.state.portals;return Object(Cd.jsx)(Cd.Fragment,{children:Array.from(e.entries()).map((function(e){var t=Object(u.a)(e,2),n=t[0],r=t[1];return Object($d.createPortal)(r,n)}))})}}]),n}(Dd.a.Component),Xd=function(){function e(){Object(c.a)(this,e),this.changeHandlers=[],this.changeHandlers=[]}return Object(d.a)(e,[{key:"subscribe",value:function(e){this.changeHandlers.push(e)}},{key:"unsubscribe",value:function(e){this.changeHandlers=this.changeHandlers.filter((function(t){return t!==e}))}},{key:"notifyNewSelection",value:function(e,t){this.changeHandlers.forEach((function(n){return n(e,t)}))}}]),e}(),Zd=new p.PluginKey("reactNodeView"),Qd=new p.Plugin({state:{init:function(){return new Xd},apply:function(e,t){return t}},key:Zd,view:function(e){var t=Zd.getState(e.state);return{update:function(e){var n=e.state.selection,r=n.from,o=n.to;t.notifyNewSelection(r,o)}}}}),ef=Ir.create({name:"node-view-selection-notifier",addProseMirrorPlugins:function(){return[Qd]}}),tf=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(e,r,o,i){var a;return Object(c.a)(this,n),(a=t.call(this,e,r,o,i)).pos=-1,a.isNodeInsideSelection=function(e,t,n,r){var o=a.getPositionsWithDefault(n,r);return n=o.pos,r=o.posEnd,"number"===typeof n&&"number"===typeof r&&(e<=n&&t>=r)},a.isSelectionInsideNode=function(e,t,n,r){var o=a.getPositionsWithDefault(n,r);return n=o.pos,r=o.posEnd,"number"===typeof n&&"number"===typeof r&&(n0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(!this.options.component)return null;var r=this.editor.isEditable&&(this.insideSelection()||this.nodeInsideSelection());return Object(Cd.jsx)(Bd,{children:Object(Cd.jsx)(this.options.component,Object.assign({},t,{editor:this.editor,getPos:this.getPos,node:this.node,forwardRef:n,selected:r,updateAttributes:function(t,n){return e.updateAttributes(t,e.pos,null===n||void 0===n?void 0:n.addToHistory,null===n||void 0===n?void 0:n.preventUpdate)}}))})}},{key:"updatePos",value:function(){"boolean"!==typeof this.getPos&&(this.pos=this.getPos(),this.posEnd=this.pos+this.node.nodeSize)}},{key:"getPositionsWithDefault",value:function(e,t){return{pos:"number"!==typeof e?this.pos:e,posEnd:"number"!==typeof t?this.posEnd:t}}},{key:"viewShouldUpdate",value:function(e){if(Object(h.a)(Object(m.a)(n.prototype),"viewShouldUpdate",this).call(this,e))return!0;var t=this.editor.view.state.selection,r=this.oldSelection;this.oldSelection=t;var o=this.pos,i=this.posEnd;this.updatePos();var a=t.from,s=t.to,l=r.from,u=r.to;if(this.node.type.spec.selectable){var c=t instanceof p.NodeSelection&&t.from===this.pos,d=r instanceof p.NodeSelection&&r.from===this.pos;if(c&&!d||d&&!c)return!0}var f=this.isNodeInsideSelection(a,s)&&!this.isNodeInsideSelection(l,u),v=!this.isNodeInsideSelection(a,s)&&this.isNodeInsideSelection(l,u),g=this.isNodeInsideSelection(a,s,o,i)&&!this.isNodeInsideSelection(a,s);return!!(f||v||g)}},{key:"destroy",value:function(){this.selectionChangeState.unsubscribe(this.onSelectionChange),Object(h.a)(Object(m.a)(n.prototype),"destroy",this).call(this)}}]),n}(_d);function nf(e,t){return function(n){var r=n.node,o=n.getPos,i=n.editor;return new tf(r,i,(function(){return"boolean"===typeof o?-1:o()}),Object.assign(Object.assign({},t),{component:e})).init()}}var rf=n(23),of=n.n(rf),af=n(30);function sf(){return sf=Object.assign||function(e){for(var t=1;t0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function Mf(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o-1||/[A-Z]/.test(e))}var lp={};var up=["","X","Y","Z"],cp=["transformPerspective","x","y","z"];function dp(e,t){return cp.indexOf(e)-cp.indexOf(t)}["translate","scale","rotate","skew"].forEach((function(e){return up.forEach((function(t){return cp.push(e+t)}))}));var fp=new Set(cp);function pp(e){return fp.has(e)}var hp=new Set(["originX","originY","originZ"]);function mp(e){return hp.has(e)}function vp(e,t){var n=t.layout,r=t.layoutId;return pp(e)||mp(e)||(n||void 0!==r)&&(!!lp[e]||"opacity"===e)}var gp=function(e){return null!==e&&"object"===typeof e&&e.getVelocity},yp={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function bp(e){return e.startsWith("--")}var wp=function(e,t){return t&&"number"===typeof e?t.transform(e):e},kp=function(e,t){return function(n){return Math.max(Math.min(n,t),e)}},xp=function(e){return e%1?Number(e.toFixed(5)):e},Op=/(-)?([\d]*\.?[\d])+/g,Sp=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,Cp=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function jp(e){return"string"===typeof e}var Dp=function(e){return{test:function(t){return jp(t)&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return""+t+e}}},Ap=Dp("deg"),Ep=Dp("%"),Mp=Dp("px"),Tp=Dp("vh"),Lp=Dp("vw"),Np=Df(Df({},Ep),{parse:function(e){return Ep.parse(e)/100},transform:function(e){return Ep.transform(100*e)}}),Pp={test:function(e){return"number"===typeof e},parse:parseFloat,transform:function(e){return e}},Rp=Df(Df({},Pp),{transform:kp(0,1)}),Hp=Df(Df({},Pp),{default:1}),Fp=Df(Df({},Pp),{transform:Math.round}),Vp={borderWidth:Mp,borderTopWidth:Mp,borderRightWidth:Mp,borderBottomWidth:Mp,borderLeftWidth:Mp,borderRadius:Mp,radius:Mp,borderTopLeftRadius:Mp,borderTopRightRadius:Mp,borderBottomRightRadius:Mp,borderBottomLeftRadius:Mp,width:Mp,maxWidth:Mp,height:Mp,maxHeight:Mp,size:Mp,top:Mp,right:Mp,bottom:Mp,left:Mp,padding:Mp,paddingTop:Mp,paddingRight:Mp,paddingBottom:Mp,paddingLeft:Mp,margin:Mp,marginTop:Mp,marginRight:Mp,marginBottom:Mp,marginLeft:Mp,rotate:Ap,rotateX:Ap,rotateY:Ap,rotateZ:Ap,scale:Hp,scaleX:Hp,scaleY:Hp,scaleZ:Hp,skew:Ap,skewX:Ap,skewY:Ap,distance:Mp,translateX:Mp,translateY:Mp,translateZ:Mp,x:Mp,y:Mp,z:Mp,perspective:Mp,transformPerspective:Mp,opacity:Rp,originX:Np,originY:Np,originZ:Mp,zIndex:Fp,fillOpacity:Rp,strokeOpacity:Rp,numOctaves:Fp};function zp(e,t,n,r,o,i,a,s){var l,u=e.style,c=e.vars,d=e.transform,f=e.transformKeys,p=e.transformOrigin;f.length=0;var h=!1,m=!1,v=!0;for(var g in t){var y=t[g];if(bp(g))c[g]=y;else{var b=Vp[g],w=wp(y,b);if(pp(g)){if(h=!0,d[g]=w,f.push(g),!v)continue;y!==(null!==(l=b.default)&&void 0!==l?l:0)&&(v=!1)}else if(mp(g))p[g]=w,m=!0;else if((null===n||void 0===n?void 0:n.isHydrated)&&(null===r||void 0===r?void 0:r.isHydrated)&&lp[g]){var k=lp[g].process(y,r,n),x=lp[g].applyTo;if(x)for(var O=x.length,S=0;S0?-1:1)*((r-i)*a)/s}):(t=function(e){return Math.exp(-e*o)*((e-l)*o+1)-.001},n=function(e){return Math.exp(-e*o)*(o*o*(l-e))});var f=function(e,t,n){for(var r=n,o=1;o<12;o++)r-=e(r)/t(r);return r}(t,n,5/o);if(o*=1e3,isNaN(f))return{stiffness:100,damping:10,duration:o};var p=Math.pow(f,2)*c;return{stiffness:p,damping:2*d*Math.sqrt(c*p),duration:o}}function Jh(e,t){return e*Math.sqrt(1-t*t)}var Yh=["duration","bounce"],Xh=["stiffness","damping","mass"];function Zh(e,t){return t.some((function(t){return void 0!==e[t]}))}function Qh(e){var t=e.from,n=void 0===t?0:t,r=e.to,o=void 0===r?1:r,i=e.restSpeed,a=void 0===i?2:i,s=e.restDelta,l=Af(e,["from","to","restSpeed","restDelta"]),u={done:!1,value:n},c=function(e){var t=Df({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!Zh(e,Xh)&&Zh(e,Yh)){var n=Gh(e);(t=Df(Df(Df({},t),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return t}(l),d=c.stiffness,f=c.damping,p=c.mass,h=c.velocity,m=c.duration,v=c.isResolvedFromDuration,g=em,y=em;function b(){var e=h?-h/1e3:0,t=o-n,r=f/(2*Math.sqrt(d*p)),i=Math.sqrt(d/p)/1e3;if(null!==s&&void 0!==s||(s=Math.abs(o-n)<=1?.01:.4),r<1){var a=Jh(i,r);g=function(n){var s=Math.exp(-r*i*n);return o-s*((e+r*i*t)/a*Math.sin(a*n)+t*Math.cos(a*n))},y=function(n){var o=Math.exp(-r*i*n);return r*i*o*(Math.sin(a*n)*(e+r*i*t)/a+t*Math.cos(a*n))-o*(Math.cos(a*n)*(e+r*i*t)-a*t*Math.sin(a*n))}}else if(1===r)g=function(n){return o-Math.exp(-i*n)*(t+(e+i*t)*n)};else{var l=i*Math.sqrt(r*r-1);g=function(n){var a=Math.exp(-r*i*n),s=Math.min(l*n,300);return o-a*((e+r*i*t)*Math.sinh(s)+l*t*Math.cosh(s))/l}}}return b(),{next:function(e){var t=g(e);if(v)u.done=e>=m;else{var n=1e3*y(e),r=Math.abs(n)<=a,i=Math.abs(o-t)<=s;u.done=r&&i}return u.value=u.done?o:t,u},flipTarget:function(){var e;h=-h,n=(e=[o,n])[0],o=e[1],b()}}}Qh.needsInterpolation=function(e,t){return"string"===typeof e||"string"===typeof t};var em=function(e){return 0},tm=function(e,t,n){var r=t-e;return 0===r?1:(n-e)/r},nm=function(e,t,n){return-n*e+n*t+e},rm=function(e,t){return function(n){return Boolean(jp(n)&&Cp.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t))}},om=function(e,t,n){return function(r){var o;if(!jp(r))return r;var i=r.match(Op),a=i[0],s=i[1],l=i[2],u=i[3];return(o={})[e]=parseFloat(a),o[t]=parseFloat(s),o[n]=parseFloat(l),o.alpha=void 0!==u?parseFloat(u):1,o}},im=kp(0,255),am=Df(Df({},Pp),{transform:function(e){return Math.round(im(e))}}),sm={test:rm("rgb","red"),parse:om("red","green","blue"),transform:function(e){var t=e.red,n=e.green,r=e.blue,o=e.alpha,i=void 0===o?1:o;return"rgba("+am.transform(t)+", "+am.transform(n)+", "+am.transform(r)+", "+xp(Rp.transform(i))+")"}};var lm={test:rm("#"),parse:function(e){var t="",n="",r="",o="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),o=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),o=e.substr(4,1),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:sm.transform},um={test:rm("hsl","hue"),parse:om("hue","saturation","lightness"),transform:function(e){var t=e.hue,n=e.saturation,r=e.lightness,o=e.alpha,i=void 0===o?1:o;return"hsla("+Math.round(t)+", "+Ep.transform(xp(n))+", "+Ep.transform(xp(r))+", "+xp(Rp.transform(i))+")"}},cm=function(e,t,n){var r=e*e,o=t*t;return Math.sqrt(Math.max(0,n*(o-r)+r))},dm=[lm,sm,um],fm=function(e){return dm.find((function(t){return t.test(e)}))},pm=function(e){return"'"+e+"' is not an animatable color. Use the equivalent color code instead."},hm=function(e,t){var n=fm(e),r=fm(t);pm(e),pm(t),n.transform,r.transform;var o=n.parse(e),i=r.parse(t),a=Df({},o),s=n===um?nm:cm;return function(e){for(var t in a)"alpha"!==t&&(a[t]=s(o[t],i[t],e));return a.alpha=nm(o.alpha,i.alpha,e),n.transform(a)}},mm={test:function(e){return sm.test(e)||lm.test(e)||um.test(e)},parse:function(e){return sm.test(e)?sm.parse(e):um.test(e)?um.parse(e):lm.parse(e)},transform:function(e){return jp(e)?e:e.hasOwnProperty("red")?sm.transform(e):um.transform(e)}},vm="${c}",gm="${n}";function ym(e){var t=[],n=0,r=e.match(Sp);r&&(n=r.length,e=e.replace(Sp,vm),t.push.apply(t,r.map(mm.parse)));var o=e.match(Op);return o&&(e=e.replace(Op,gm),t.push.apply(t,o.map(Pp.parse))),{values:t,numColors:n,tokenised:e}}function bm(e){return ym(e).values}function wm(e){var t=ym(e),n=t.values,r=t.numColors,o=t.tokenised,i=n.length;return function(e){for(var t=o,n=0;n0},parse:bm,createTransformer:wm,getAnimatableNone:function(e){var t=bm(e);return wm(e)(t.map(km))}},Om=function(e){return"number"===typeof e};function Sm(e,t){return Om(e)?function(n){return nm(e,t,n)}:mm.test(e)?hm(e,t):Am(e,t)}var Cm=function(e,t){var n=Mf([],e),r=n.length,o=e.map((function(e,n){return Sm(e,t[n])}));return function(e){for(var t=0;te[l-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());var u=Mm(t,a,s),c=2===l?function(e,t){var n=e[0],r=e[1],o=t[0];return function(e){return o(tm(n,r,e))}}(e,u):function(e,t){var n=e.length,r=n-1;return function(o){var i=0,a=!1;if(o<=e[0]?a=!0:o>=e[r]&&(i=r-1,a=!0),!a){for(var s=1;so||s===r);s++);i=s-1}var l=tm(e[i],e[i+1],o);return t[i](l)}}(e,u);return i?function(t){return c(Uh(e[0],e[l-1],t))}:c}var Lm,Nm=function(e){return function(t){return 1-e(1-t)}},Pm=function(e){return function(t){return t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2}},Rm=function(e){return function(t){return t*t*((e+1)*t-e)}},Hm=function(e){return e},Fm=(Lm=2,function(e){return Math.pow(e,Lm)}),Vm=Nm(Fm),zm=Pm(Fm),Bm=function(e){return 1-Math.sin(Math.acos(e))},_m=Nm(Bm),Im=Pm(_m),$m=Rm(1.525),qm=Nm($m),Wm=Pm($m),Um=function(e){var t=Rm(e);return function(e){return(e*=2)<1?.5*t(e):.5*(2-Math.pow(2,-10*(e-1)))}}(1.525),Km=function(e){if(1===e||0===e)return e;var t=e*e;return e<.36363636363636365?7.5625*t:e<.7272727272727273?9.075*t-9.9*e+3.4:e<.9?12.066481994459833*t-19.63545706371191*e+8.898060941828255:10.8*e*e-20.52*e+10.72},Gm=Nm(Km);function Jm(e,t){return e.map((function(){return t||zm})).splice(0,e.length-1)}function Ym(e){var t=e.from,n=void 0===t?0:t,r=e.to,o=void 0===r?1:r,i=e.ease,a=e.offset,s=e.duration,l=void 0===s?300:s,u={done:!1,value:n},c=Array.isArray(o)?o:[n,o],d=function(e,t){return e.map((function(e){return e*t}))}(a&&a.length===c.length?a:function(e){var t=e.length;return e.map((function(e,n){return 0!==n?n/(t-1):0}))}(c),l);function f(){return Tm(d,c,{ease:Array.isArray(i)?i:Jm(c,i)})}var p=f();return{next:function(e){return u.value=p(e),u.done=e>=l,u},flipTarget:function(){c.reverse(),p=f()}}}var Xm={keyframes:Ym,spring:Qh,decay:function(e){var t=e.velocity,n=void 0===t?0:t,r=e.from,o=void 0===r?0:r,i=e.power,a=void 0===i?.8:i,s=e.timeConstant,l=void 0===s?350:s,u=e.restDelta,c=void 0===u?.5:u,d=e.modifyTarget,f={done:!1,value:o},p=a*n,h=o+p,m=void 0===d?h:d(h);return m!==h&&(p=m-o),{next:function(e){var t=-p*Math.exp(-e/l);return f.done=!(t>c||t<-c),f.value=f.done?m:m+t,f},flipTarget:function(){}}}};var Zm=1/60*1e3,Qm="undefined"!==typeof performance?function(){return performance.now()}:function(){return Date.now()},ev="undefined"!==typeof window?function(e){return window.requestAnimationFrame(e)}:function(e){return setTimeout((function(){return e(Qm())}),Zm)};var tv=!0,nv=!1,rv=!1,ov={delta:0,timestamp:0},iv=["read","update","preRender","render","postRender"],av=iv.reduce((function(e,t){return e[t]=function(e){var t=[],n=[],r=0,o=!1,i=new WeakSet,a={schedule:function(e,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var l=s&&o,u=l?t:n;return a&&i.add(e),-1===u.indexOf(e)&&(u.push(e),l&&o&&(r=t.length)),e},cancel:function(e){var t=n.indexOf(e);-1!==t&&n.splice(t,1),i.delete(e)},process:function(s){var l;if(o=!0,t=(l=[n,t])[0],(n=l[1]).length=0,r=t.length)for(var u=0;u=t+n:e<=-n}(f,D,y,E)&&L():(r.stop(),k&&k()))}return l&&(null===b||void 0===b||b(),(r=c(N)).start()),{stop:function(){null===w||void 0===w||w(),r.stop()}}}function yv(e,t){return t?e*(1e3/t):0}var bv=function(e){return 1e3*e},wv=function(e,t){return 1-3*t+3*e},kv=function(e,t){return 3*t-6*e},xv=function(e){return 3*e},Ov=function(e,t,n){return((wv(t,n)*e+kv(t,n))*e+xv(t))*e},Sv=function(e,t,n){return 3*wv(t,n)*e*e+2*kv(t,n)*e+xv(t)};var Cv=.1;function jv(e,t,n,r){if(e===t&&n===r)return Hm;for(var o=new Float32Array(11),i=0;i<11;++i)o[i]=Ov(i*Cv,e,n);function a(t){for(var r=0,i=1;10!==i&&o[i]<=t;++i)r+=Cv;--i;var a=r+(t-o[i])/(o[i+1]-o[i])*Cv,s=Sv(a,e,n);return s>=.001?function(e,t,n,r){for(var o=0;o<8;++o){var i=Sv(t,n,r);if(0===i)return t;t-=(Ov(t,n,r)-e)/i}return t}(t,a,e,n):0===s?a:function(e,t,n,r,o){var i,a,s=0;do{(i=Ov(a=t+(n-t)/2,r,o)-e)>0?n=a:t=a}while(Math.abs(i)>1e-7&&++s<10);return a}(t,r,r+Cv,e,n)}return function(e){return 0===e||1===e?e:Ov(a(e),t,r)}}var Dv={linear:Hm,easeIn:Fm,easeInOut:zm,easeOut:Vm,circIn:Bm,circInOut:Im,circOut:_m,backIn:$m,backInOut:Wm,backOut:qm,anticipate:Um,bounceIn:Gm,bounceInOut:function(e){return e<.5?.5*(1-Km(1-2*e)):.5*Km(2*e-1)+.5},bounceOut:Km},Av=function(e){if(Array.isArray(e)){e.length;var t=Ef(e,4);return jv(t[0],t[1],t[2],t[3])}return"string"===typeof e?Dv[e]:e},Ev=function(e,t){return"zIndex"!==e&&(!("number"!==typeof t&&!Array.isArray(t))||!("string"!==typeof t||!xm.test(t)||t.startsWith("url(")))},Mv=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},Tv=function(e){return{type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},Lv=function(){return{type:"keyframes",ease:"linear",duration:.3}},Nv=function(e){return{type:"keyframes",duration:.8,values:e}},Pv={x:Mv,y:Mv,z:Mv,rotate:Mv,rotateX:Mv,rotateY:Mv,rotateZ:Mv,scaleX:Tv,scaleY:Tv,scale:Tv,opacity:Lv,backgroundColor:Lv,color:Lv,default:Tv},Rv=new Set(["brightness","contrast","saturate","opacity"]);function Hv(e){var t=e.slice(0,-1).split("("),n=t[0],r=t[1];if("drop-shadow"===n)return e;var o=(r.match(Op)||[])[0];if(!o)return e;var i=r.replace(o,""),a=Rv.has(n)?1:0;return o!==r&&(a*=100),n+"("+a+i+")"}var Fv=/([a-z-]*)\(.*?\)/g,Vv=Df(Df({},xm),{getAnimatableNone:function(e){var t=e.match(Fv);return t?t.map(Hv).join(" "):e}}),zv=Df(Df({},Vp),{color:mm,backgroundColor:mm,outlineColor:mm,fill:mm,stroke:mm,borderColor:mm,borderTopColor:mm,borderRightColor:mm,borderBottomColor:mm,borderLeftColor:mm,filter:Vv,WebkitFilter:Vv}),Bv=function(e){return zv[e]};function _v(e,t){var n,r=Bv(e);return r!==Vv&&(r=xm),null===(n=r.getAnimatableNone)||void 0===n?void 0:n.call(r,t)}function Iv(e){var t=e.ease,n=e.times,r=e.yoyo,o=e.flip,i=e.loop,a=Af(e,["ease","times","yoyo","flip","loop"]),s=Df({},a);return n&&(s.offset=n),a.duration&&(s.duration=bv(a.duration)),a.repeatDelay&&(s.repeatDelay=bv(a.repeatDelay)),t&&(s.ease=function(e){return Array.isArray(e)&&"number"!==typeof e[0]}(t)?t.map(Av):Av(t)),"tween"===a.type&&(s.type="keyframes"),(r||i||o)&&(!0,r?s.repeatType="reverse":i?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=i||r||o||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function $v(e,t,n){var r;return Array.isArray(t.to)&&(null!==(r=e.duration)&&void 0!==r||(e.duration=.8)),function(e){Array.isArray(e.to)&&null===e.to[0]&&(e.to=Mf([],Ef(e.to)),e.to[0]=e.from)}(t),function(e){e.when,e.delay,e.delayChildren,e.staggerChildren,e.staggerDirection,e.repeat,e.repeatType,e.repeatDelay,e.from;var t=Af(e,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(t).length}(e)||(e=Df(Df({},e),function(e,t){var n;return n=ch(t)?Nv:Pv[e]||Pv.default,Df({to:t},n(t))}(n,t.to))),Df(Df({},t),Iv(e))}function qv(e,t,n,r,o){var i,a=Kv(r,e),s=null!==(i=a.from)&&void 0!==i?i:t.get(),l=Ev(e,n);"none"===s&&l&&"string"===typeof n?s=_v(e,n):Wv(s)&&"string"===typeof n?s=Uv(n):!Array.isArray(n)&&Wv(n)&&"string"===typeof s&&(n=Uv(s));var u=Ev(e,s);return u&&l&&!1!==a.type?function(){var r={from:s,to:n,velocity:t.getVelocity(),onComplete:o,onUpdate:function(e){return t.set(e)}};return"inertia"===a.type||"decay"===a.type?function(e){var t,n=e.from,r=void 0===n?0:n,o=e.velocity,i=void 0===o?0:o,a=e.min,s=e.max,l=e.power,u=void 0===l?.8:l,c=e.timeConstant,d=void 0===c?750:c,f=e.bounceStiffness,p=void 0===f?500:f,h=e.bounceDamping,m=void 0===h?10:h,v=e.restDelta,g=void 0===v?1:v,y=e.modifyTarget,b=e.driver,w=e.onUpdate,k=e.onComplete;function x(e){return void 0!==a&&es}function O(e){return void 0===a?s:void 0===s||Math.abs(a-e)E||-1===M&&e-1&&e.splice(n,1)}var Xv=function(){function e(){this.subscriptions=[]}return e.prototype.add=function(e){var t=this;return Jv(this.subscriptions,e),function(){return Yv(t.subscriptions,e)}},e.prototype.notify=function(e,t,n){var r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(var o=0;oh&&g,k=Array.isArray(v)?v:[v],x=k.reduce(i,{});!1===y&&(x={});var O=m.prevResolvedValues,S=void 0===O?{}:O,C=Df(Df({},S),x),j=function(e){w=!0,f.delete(e),m.needsAnimating[e]=!0};for(var D in C){var A=x[D],E=S[D];p.hasOwnProperty(D)||(A!==E?ch(A)&&ch(E)?Wh(A,E)?m.protectedKeys[D]=!0:j(D):void 0!==A?j(D):f.add(D):void 0!==A&&f.has(D)?j(D):m.protectedKeys[D]=!0)}m.prevProp=v,m.prevResolvedValues=x,m.isActive&&(p=Df(Df({},p),x)),o&&e.blockInitialAnimation&&(w=!1),w&&!b&&d.push.apply(d,Mf([],Ef(k.map((function(e){return{animation:e,options:Df({type:r},a)}})))))},v=0;v=3;if(t||n){var o=e.point,i=pv().timestamp;r.history.push(Df(Df({},o),{timestamp:i}));var a=r.handlers,s=a.onStart,l=a.onMove;t||(s&&s(r.lastMoveEvent,e),r.startEvent=r.lastMoveEvent),l&&l(r.lastMoveEvent,e)}}},this.handlePointerMove=function(e,t){r.lastMoveEvent=e,r.lastMoveEventInfo=Cg(t,r.transformPagePoint),kh(e)&&0===e.buttons?r.handlePointerUp(e,t):hv.update(r.updatePoint,!0)},this.handlePointerUp=function(e,t){r.end();var n=r.handlers,o=n.onEnd,i=n.onSessionEnd,a=Dg(Cg(t,r.transformPagePoint),r.history);r.startEvent&&o&&o(e,a),i&&i(e,a)},!(xh(e)&&e.touches.length>1)){this.handlers=t,this.transformPagePoint=o;var i=Cg(jh(e),this.transformPagePoint),a=i.point,s=pv().timestamp;this.history=[Df(Df({},a),{timestamp:s})];var l=t.onSessionStart;l&&l(e,Dg(i,this.history)),this.removeListeners=Ih(Th(window,"pointermove",this.handlePointerMove),Th(window,"pointerup",this.handlePointerUp),Th(window,"pointercancel",this.handlePointerUp))}}return e.prototype.updateHandlers=function(e){this.handlers=e},e.prototype.end=function(){this.removeListeners&&this.removeListeners(),lv.update(this.updatePoint)},e}();function Cg(e,t){return t?{point:t(e.point)}:e}function jg(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Dg(e,t){var n=e.point;return{point:n,delta:jg(n,Eg(t)),offset:jg(n,Ag(t)),velocity:Mg(t,.1)}}function Ag(e){return e[0]}function Eg(e){return e[e.length-1]}function Mg(e,t){if(e.length<2)return{x:0,y:0};for(var n=e.length-1,r=null,o=Eg(e);n>=0&&(r=e[n],!(o.timestamp-r.timestamp>bv(t)));)n--;if(!r)return{x:0,y:0};var i=(o.timestamp-r.timestamp)/1e3;if(0===i)return{x:0,y:0};var a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Tg(e){return e}function Lg(e){var t=e.top;return{x:{min:e.left,max:e.right},y:{min:t,max:e.bottom}}}var Ng={translate:0,scale:1,origin:0,originPoint:0};function Pg(){return{x:Df({},Ng),y:Df({},Ng)}}function Rg(e){return[e("x"),e("y")]}function Hg(e,t,n){var r=t.min,o=t.max;return void 0!==r&&eo&&(e=n?nm(o,e,n.max):Math.min(e,o)),e}function Fg(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Vg(e,t){var n,r=t.min-e.min,o=t.max-e.max;return t.max-t.minr?n=tm(t.min,t.max-r,e.min):r>o&&(n=tm(e.min,e.max-o,t.min)),Uh(0,1,n)}function Wg(e,t,n,r){void 0===r&&(r=.5),e.origin=r,e.originPoint=nm(t.min,t.max,e.origin),e.scale=$g(n)/$g(t),Ig(e.scale,1,1e-4)&&(e.scale=1),e.translate=nm(n.min,n.max,e.origin)-e.originPoint,Ig(e.translate)&&(e.translate=0)}function Ug(e,t,n,r){Wg(e.x,t.x,n.x,Kg(r.originX)),Wg(e.y,t.y,n.y,Kg(r.originY))}function Kg(e){return"number"===typeof e?e:.5}function Gg(e,t,n){e.min=n.min+t.min,e.max=e.min+$g(t)}var Jg=function(e,t){return e.depth-t.depth};function Yg(e){return e.projection.isEnabled||e.shouldResetTransform()}function Xg(e,t){void 0===t&&(t=[]);var n=e.parent;return n&&Xg(n,t),Yg(e)&&t.push(e),t}function Zg(e){if(!e.shouldResetTransform()){var t,n=e.getLayoutState();e.notifyBeforeLayoutMeasure(n.layout),n.isHydrated=!0,n.layout=e.measureViewportBox(),n.layoutCorrected=(t=n.layout,{x:Df({},t.x),y:Df({},t.y)}),e.notifyLayoutMeasure(n.layout,e.prevViewportBox||n.layout),hv.update((function(){return e.rebaseProjectionTarget()}))}}function Qg(e,t){return{min:t.min-e.min,max:t.max-e.min}}function ey(e,t){return{x:Qg(e.x,t.x),y:Qg(e.y,t.y)}}function ty(e,t){var n=e.getLayoutId(),r=t.getLayoutId();return n!==r||void 0===r&&e!==t}function ny(e){var t=e.getProps(),n=t.drag,r=t._dragX;return n&&!r}function ry(e,t){e.min=t.min,e.max=t.max}function oy(e,t,n){return n+t*(e-n)}function iy(e,t,n,r,o){return void 0!==o&&(e=oy(e,o,r)),oy(e,n,r)+t}function ay(e,t,n,r,o){void 0===t&&(t=0),void 0===n&&(n=1),e.min=iy(e.min,t,n,r,o),e.max=iy(e.max,t,n,r,o)}function sy(e,t){var n=t.x,r=t.y;ay(e.x,n.translate,n.scale,n.originPoint),ay(e.y,r.translate,r.scale,r.originPoint)}function ly(e,t,n,r){var o=Ef(r,3),i=o[0],a=o[1],s=o[2];e.min=t.min,e.max=t.max;var l=void 0!==n[s]?n[s]:.5,u=nm(t.min,t.max,l);ay(e,n[i],n[a],u,n.scale)}var uy=["x","scaleX","originX"],cy=["y","scaleY","originY"];function dy(e,t,n){ly(e.x,t.x,n,uy),ly(e.y,t.y,n,cy)}function fy(e,t,n,r,o){return e=oy(e-=t,1/n,r),void 0!==o&&(e=oy(e,1/o,r)),e}function py(e,t,n){var r=Ef(n,3),o=r[0],i=r[1],a=r[2];!function(e,t,n,r,o){void 0===t&&(t=0),void 0===n&&(n=1),void 0===r&&(r=.5);var i=nm(e.min,e.max,r)-t;e.min=fy(e.min,t,n,i,o),e.max=fy(e.max,t,n,i,o)}(e,t[o],t[i],t[a],t.scale)}function hy(e,t){py(e.x,t,uy),py(e.y,t,cy)}var my=new Set;function vy(e,t,n){e[n]||(e[n]=[]),e[n].push(t)}function gy(e){return my.add(e),function(){return my.delete(e)}}function yy(){if(my.size){var e=0,t=[[]],n=[],r=function(n){return vy(t,n,e)},o=function(t){vy(n,t,e),e++};my.forEach((function(t){t(r,o),e=0})),my.clear();for(var i=n.length,a=0;a<=i;a++)t[a]&&t[a].forEach(wy),n[a]&&n[a].forEach(wy)}}var by,wy=function(e){return e()},ky=new WeakMap,xy=function(){function e(e){var t=e.visualElement;this.isDragging=!1,this.currentDirection=null,this.constraints=!1,this.elastic={x:{min:0,max:1},y:{min:0,max:1}},this.props={},this.hasMutatedConstraints=!1,this.cursorProgress={x:.5,y:.5},this.originPoint={},this.openGlobalLock=null,this.panSession=null,this.visualElement=t,this.visualElement.enableLayoutProjection(),ky.set(t,this)}return e.prototype.start=function(e,t){var n=this,r=void 0===t?{}:t,o=r.snapToCursor,i=void 0!==o&&o,a=r.cursorProgress,s=this.props.transformPagePoint;this.panSession=new Sg(e,{onSessionStart:function(e){var t;n.stopMotion();var r=function(e){return jh(e,"client")}(e).point;null===(t=n.cancelLayout)||void 0===t||t.call(n),n.cancelLayout=gy((function(e,t){var o=Xg(n.visualElement),s=function(e){var t=[];return e.children.forEach((function e(n){Yg(n)&&t.push(n),n.children.forEach(e)})),t.sort(Jg)}(n.visualElement),l=Mf(Mf([],Ef(o)),Ef(s)),u=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),t((function(){l.forEach((function(e){return e.resetTransform()}))})),e((function(){Zg(n.visualElement),s.forEach(Zg)})),t((function(){l.forEach((function(e){return e.restoreTransform()})),i&&(u=n.snapToCursor(r))})),e((function(){Boolean(n.getAxisMotionValue("x")&&!n.isExternalDrag())||n.visualElement.rebaseProjectionTarget(!0,n.visualElement.measureViewportBox(!1)),n.visualElement.scheduleUpdateLayoutProjection();var e=n.visualElement.projection;Rg((function(t){if(!u){var o=e.target[t],i=o.min,s=o.max;n.cursorProgress[t]=a?a[t]:tm(i,s,r[t])}var l=n.getAxisMotionValue(t);l&&(n.originPoint[t]=l.get())}))})),t((function(){uv.update(),uv.preRender(),uv.render(),uv.postRender()})),e((function(){return n.resolveDragConstraints()}))}))},onStart:function(e,t){var r,o,i,a=n.props,s=a.drag,l=a.dragPropagation;(!s||l||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=Hh(s),n.openGlobalLock))&&(yy(),n.isDragging=!0,n.currentDirection=null,null===(o=(r=n.props).onDragStart)||void 0===o||o.call(r,e,t),null===(i=n.visualElement.animationState)||void 0===i||i.setActive(vh.Drag,!0))},onMove:function(e,t){var r,o,i,a,s=n.props,l=s.dragPropagation,u=s.dragDirectionLock;if(l||n.openGlobalLock){var c=t.offset;if(u&&null===n.currentDirection)return n.currentDirection=function(e,t){void 0===t&&(t=10);var n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(c),void(null!==n.currentDirection&&(null===(o=(r=n.props).onDirectionLock)||void 0===o||o.call(r,n.currentDirection)));n.updateAxis("x",t.point,c),n.updateAxis("y",t.point,c),null===(a=(i=n.props).onDrag)||void 0===a||a.call(i,e,t),by=e}},onSessionEnd:function(e,t){return n.stop(e,t)}},{transformPagePoint:s})},e.prototype.resolveDragConstraints=function(){var e=this,t=this.props,n=t.dragConstraints,r=t.dragElastic,o=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(Jf(n)?this.resolveRefConstraints(o,n):function(e,t){var n=t.top,r=t.left,o=t.bottom,i=t.right;return{x:Fg(e.x,r,i),y:Fg(e.y,n,o)}}(o,n)),this.elastic=function(e){return!1===e?e=0:!0===e&&(e=.35),{x:zg(e,"left","right"),y:zg(e,"top","bottom")}}(r),this.constraints&&!this.hasMutatedConstraints&&Rg((function(t){e.getAxisMotionValue(t)&&(e.constraints[t]=function(e,t){var n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(o[t],e.constraints[t]))}))},e.prototype.resolveRefConstraints=function(e,t){var n=this.props,r=n.onMeasureDragConstraints,o=n.transformPagePoint,i=t.current;this.constraintsBox=_g(i,o);var a=function(e,t){return{x:Vg(e.x,t.x),y:Vg(e.y,t.y)}}(e,this.constraintsBox);if(r){var s=r(function(e){var t=e.x,n=e.y;return{top:n.min,bottom:n.max,left:t.min,right:t.max}}(a));this.hasMutatedConstraints=!!s,s&&(a=Lg(s))}return a},e.prototype.cancelDrag=function(){var e,t;this.visualElement.unlockProjectionTarget(),null===(e=this.cancelLayout)||void 0===e||e.call(this),this.isDragging=!1,this.panSession&&this.panSession.end(),this.panSession=null,!this.props.dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(t=this.visualElement.animationState)||void 0===t||t.setActive(vh.Drag,!1)},e.prototype.stop=function(e,t){var n,r,o;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var i=this.isDragging;if(this.cancelDrag(),i){var a=t.velocity;this.animateDragEnd(a),null===(o=(r=this.props).onDragEnd)||void 0===o||o.call(r,e,t)}},e.prototype.snapToCursor=function(e){var t=this;return Rg((function(n){if(Oy(n,t.props.drag,t.currentDirection)){var r=t.getAxisMotionValue(n);if(!r)return t.cursorProgress[n]=.5,!0;var o=t.visualElement.getLayoutState().layout,i=o[n].max-o[n].min,a=o[n].min+i/2,s=e[n]-a;t.originPoint[n]=e[n],r.set(s)}})).includes(!0)},e.prototype.updateAxis=function(e,t,n){if(Oy(e,this.props.drag,this.currentDirection))return this.getAxisMotionValue(e)?this.updateAxisMotionValue(e,n):this.updateVisualElementAxis(e,t)},e.prototype.updateAxisMotionValue=function(e,t){var n=this.getAxisMotionValue(e);if(t&&n){var r=this.originPoint[e]+t[e],o=this.constraints?Hg(r,this.constraints[e],this.elastic[e]):r;n.set(o)}},e.prototype.updateVisualElementAxis=function(e,t){var n,r=this.visualElement.getLayoutState().layout[e],o=r.max-r.min,i=this.cursorProgress[e],a=function(e,t,n,r,o){var i=e-t*n;return r?Hg(i,r,o):i}(t[e],o,i,null===(n=this.constraints)||void 0===n?void 0:n[e],this.elastic[e]);this.visualElement.setProjectionTargetAxis(e,a,a+o)},e.prototype.setProps=function(e){var t=e.drag,n=void 0!==t&&t,r=e.dragDirectionLock,o=void 0!==r&&r,i=e.dragPropagation,a=void 0!==i&&i,s=e.dragConstraints,l=void 0!==s&&s,u=e.dragElastic,c=void 0===u?.35:u,d=e.dragMomentum,f=void 0===d||d,p=Af(e,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=Df({drag:n,dragDirectionLock:o,dragPropagation:a,dragConstraints:l,dragElastic:c,dragMomentum:f},p)},e.prototype.getAxisMotionValue=function(e){var t=this.props,n=t.layout,r=t.layoutId,o="_drag"+e.toUpperCase();return this.props[o]?this.props[o]:n||void 0!==r?void 0:this.visualElement.getValue(e,0)},e.prototype.isLayoutDrag=function(){return!this.getAxisMotionValue("x")},e.prototype.isExternalDrag=function(){var e=this.props,t=e._dragX,n=e._dragY;return t||n},e.prototype.animateDragEnd=function(e){var t=this,n=this.props,r=n.drag,o=n.dragMomentum,i=n.dragElastic,a=n.dragTransition,s=function(e,t){void 0===t&&(t=!0);var n,r=e.getProjectionParent();return!!r&&(t?hy(n=ey(r.projection.target,e.projection.target),r.getLatestValues()):n=ey(r.getLayoutState().layout,e.getLayoutState().layout),Rg((function(t){return e.setProjectionTargetAxis(t,n[t].min,n[t].max,!0)})),!0)}(this.visualElement,this.isLayoutDrag()&&!this.isExternalDrag()),l=this.constraints||{};if(s&&Object.keys(l).length&&this.isLayoutDrag()){var u=this.visualElement.getProjectionParent();if(u){var c=ey(u.projection.targetFinal,l);Rg((function(e){var t=c[e],n=t.min,r=t.max;l[e]={min:isNaN(n)?void 0:n,max:isNaN(r)?void 0:r}}))}}var d=Rg((function(n){var u;if(Oy(n,r,t.currentDirection)){var c=null!==(u=null===l||void 0===l?void 0:l[n])&&void 0!==u?u:{},d=i?200:1e6,f=i?40:1e7,p=Df(Df({type:"inertia",velocity:o?e[n]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10},a),c);return t.getAxisMotionValue(n)?t.startAxisValueAnimation(n,p):t.visualElement.startLayoutAnimation(n,p,s)}}));return Promise.all(d).then((function(){var e,n;null===(n=(e=t.props).onDragTransitionEnd)||void 0===n||n.call(e)}))},e.prototype.stopMotion=function(){var e=this;Rg((function(t){var n=e.getAxisMotionValue(t);n?n.stop():e.visualElement.stopLayoutAnimation()}))},e.prototype.startAxisValueAnimation=function(e,t){var n=this.getAxisMotionValue(e);if(n){var r=n.get();return n.set(r),n.set(r),Gv(e,n,0,t)}},e.prototype.scalePoint=function(){var e=this,t=this.props,n=t.drag;if(Jf(t.dragConstraints)&&this.constraintsBox){this.stopMotion();var r={x:0,y:0};Rg((function(t){r[t]=qg(e.visualElement.projection.target[t],e.constraintsBox[t])})),this.updateConstraints((function(){Rg((function(t){if(Oy(t,n,null)){var o=function(e,t,n){var r=e.max-e.min,o=nm(t.min,t.max-r,n);return{min:o,max:o+r}}(e.visualElement.projection.target[t],e.constraintsBox[t],r[t]),i=o.min,a=o.max;e.visualElement.setProjectionTargetAxis(t,i,a)}}))})),setTimeout(yy,1)}},e.prototype.updateConstraints=function(e){var t=this;this.cancelLayout=gy((function(n,r){var o=Xg(t.visualElement);r((function(){return o.forEach((function(e){return e.resetTransform()}))})),n((function(){return Zg(t.visualElement)})),r((function(){return o.forEach((function(e){return e.restoreTransform()}))})),n((function(){t.resolveDragConstraints()})),e&&r(e)}))},e.prototype.mount=function(e){var t=this,n=Th(e.getInstance(),"pointerdown",(function(e){var n=t.props,r=n.drag,o=n.dragListener;r&&(void 0===o||o)&&t.start(e)})),r=bh(window,"resize",(function(){t.scalePoint()})),o=e.onLayoutUpdate((function(){t.isDragging&&t.resolveDragConstraints()})),i=e.prevDragCursor;return i&&this.start(by,{cursorProgress:i}),function(){null===n||void 0===n||n(),null===r||void 0===r||r(),null===o||void 0===o||o(),t.cancelDrag()}},e}();function Oy(e,t,n){return(!0===t||t===e)&&(null===n||n===e)}var Sy,Cy,jy={pan:$h((function(e){var t=e.onPan,n=e.onPanStart,r=e.onPanEnd,o=e.onPanSessionStart,i=e.visualElement,a=t||n||r||o,s=Object(jd.useRef)(null),l=Object(jd.useContext)(Hf).transformPagePoint,u={onSessionStart:o,onStart:n,onMove:t,onEnd:function(e,t){s.current=null,r&&r(e,t)}};Object(jd.useEffect)((function(){null!==s.current&&s.current.updateHandlers(u)})),Lh(i,"pointerdown",a&&function(e){s.current=new Sg(e,u,{transformPagePoint:l})}),Bh((function(){return s.current&&s.current.end()}))})),drag:$h((function(e){var t=e.dragControls,n=e.visualElement,r=Object(jd.useContext)(Hf).transformPagePoint,o=zf((function(){return new xy({visualElement:n})}));o.setProps(Df(Df({},e),{transformPagePoint:r})),Object(jd.useEffect)((function(){return t&&t.subscribe(o)}),[o]),Object(jd.useEffect)((function(){return o.mount(n)}),[])}))};function Dy(e){return"string"===typeof e&&e.startsWith("var(--")}!function(e){e[e.Entering=0]="Entering",e[e.Present=1]="Present",e[e.Exiting=2]="Exiting"}(Sy||(Sy={})),function(e){e[e.Hide=0]="Hide",e[e.Show=1]="Show"}(Cy||(Cy={}));var Ay=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Ey(e,t,n){void 0===n&&(n=1);var r=Ef(function(e){var t=Ay.exec(e);if(!t)return[,];var n=Ef(t,3);return[n[1],n[2]]}(e),2),o=r[0],i=r[1];if(o){var a=window.getComputedStyle(t).getPropertyValue(o);return a?a.trim():Dy(i)?Ey(i,t,n+1):i}}function My(e,t){return e/(t.max-t.min)*100}var Ty="_$css";var Ly={process:function(e,t,n){var r=n.target;if("string"===typeof e){if(!Mp.test(e))return e;e=parseFloat(e)}return My(e,r.x)+"% "+My(e,r.y)+"%"}},Ny={borderRadius:Df(Df({},Ly),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Ly,borderTopRightRadius:Ly,borderBottomLeftRadius:Ly,borderBottomRightRadius:Ly,boxShadow:{process:function(e,t){var n=t.delta,r=t.treeScale,o=e,i=e.includes("var("),a=[];i&&(e=e.replace(Ay,(function(e){return a.push(e),Ty})));var s=xm.parse(e);if(s.length>5)return o;var l=xm.createTransformer(e),u="number"!==typeof s[0]?1:0,c=n.x.scale*r.x,d=n.y.scale*r.y;s[0+u]/=c,s[1+u]/=d;var f=nm(c,d,.5);"number"===typeof s[2+u]&&(s[2+u]/=f),"number"===typeof s[3+u]&&(s[3+u]/=f);var p=l(s);if(i){var h=0;p=p.replace(Ty,(function(){var e=a[h];return h++,e}))}return p}}},Py=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.frameTarget={x:{min:0,max:1},y:{min:0,max:1}},t.currentAnimationTarget={x:{min:0,max:1},y:{min:0,max:1}},t.isAnimating={x:!1,y:!1},t.stopAxisAnimation={x:void 0,y:void 0},t.isAnimatingTree=!1,t.animate=function(e,n,r){void 0===r&&(r={});var o=r.originBox,i=r.targetBox,a=r.visibilityAction,s=r.shouldStackAnimate,l=r.onComplete,u=r.prevParent,c=Af(r,["originBox","targetBox","visibilityAction","shouldStackAnimate","onComplete","prevParent"]),d=t.props,f=d.visualElement,p=d.layout;if(!1===s)return t.isAnimatingTree=!1,t.safeToRemove();if(!t.isAnimatingTree||!0===s){s&&(t.isAnimatingTree=!0),n=o||n,e=i||e;var h=!1,m=f.getProjectionParent();if(m){var v=m.prevViewportBox,g=m.getLayoutState().layout;u&&(i&&(g=u.getLayoutState().layout),o&&!ty(u,m)&&u.prevViewportBox&&(v=u.prevViewportBox)),v&&By(u,o,i)&&(h=!0,n=ey(v,n),e=ey(g,e))}var y=Ry(n,e),b=Rg((function(r){var o,i;if("position"===p){var s=e[r].max-e[r].min;n[r].max=n[r].min+s}if(!f.projection.isTargetLocked)return void 0===a?y?t.animateAxis(r,e[r],n[r],Df(Df({},c),{isRelative:h})):(null===(i=(o=t.stopAxisAnimation)[r])||void 0===i||i.call(o),f.setProjectionTargetAxis(r,e[r].min,e[r].max,h)):void f.setVisibility(a===Cy.Show)}));return f.syncRender(),Promise.all(b).then((function(){t.isAnimatingTree=!1,l&&l(),f.notifyLayoutAnimationComplete()}))}},t}return jf(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props.visualElement;t.animateMotionValue=Gv,t.enableLayoutProjection(),this.unsubLayoutReady=t.onLayoutUpdate(this.animate),t.layoutSafeToRemove=function(){return e.safeToRemove()},function(e){for(var t in e)lp[t]=e[t]}(Ny)},t.prototype.componentWillUnmount=function(){var e=this;this.unsubLayoutReady(),Rg((function(t){var n,r;return null===(r=(n=e.stopAxisAnimation)[t])||void 0===r?void 0:r.call(n)}))},t.prototype.animateAxis=function(e,t,n,r){var o,i,a=this,s=void 0===r?{}:r,l=s.transition,u=s.isRelative;if(!this.isAnimating[e]||!Vy(t,this.currentAnimationTarget[e])){null===(i=(o=this.stopAxisAnimation)[e])||void 0===i||i.call(o),this.isAnimating[e]=!0;var c=this.props.visualElement,d=this.frameTarget[e],f=c.getProjectionAnimationProgress()[e];f.clearListeners(),f.set(0),f.set(0);var p=function(){var r=f.get()/1e3;!function(e,t,n,r){e.min=nm(t.min,n.min,r),e.max=nm(t.max,n.max,r)}(d,n,t,r),c.setProjectionTargetAxis(e,d.min,d.max,u)};p();var h=f.onChange(p);this.stopAxisAnimation[e]=function(){a.isAnimating[e]=!1,f.stop(),h()},this.currentAnimationTarget[e]=t;var m=l||c.getDefaultTransition()||zy;return Gv("x"===e?"layoutX":"layoutY",f,1e3,m&&Kv(m,"layout")).then(this.stopAxisAnimation[e])}},t.prototype.safeToRemove=function(){var e,t;null===(t=(e=this.props).safeToRemove)||void 0===t||t.call(e)},t.prototype.render=function(){return null},t}(jd.Component);function Ry(e,t){return!Fy(e)&&!Fy(t)&&(!Vy(e.x,t.x)||!Vy(e.y,t.y))}var Hy={min:0,max:0};function Fy(e){return Vy(e.x,Hy)&&Vy(e.y,Hy)}function Vy(e,t){return e.min===t.min&&e.max===t.max}var zy={duration:.45,ease:[.4,0,.1,1]};function By(e,t,n){return e||!e&&!(t||n)}var _y={layoutReady:function(e){return e.notifyLayoutReady()}};function Iy(){var e=new Set;return{add:function(t){return e.add(t)},flush:function(t){var n=void 0===t?_y:t,r=n.layoutReady,o=n.parent;gy((function(t,n){var i=Array.from(e).sort(Jg),a=o?Xg(o):[];n((function(){Mf(Mf([],Ef(a)),Ef(i)).forEach((function(e){return e.resetTransform()}))})),t((function(){i.forEach(Zg)})),n((function(){a.forEach((function(e){return e.restoreTransform()})),i.forEach(r)})),t((function(){i.forEach((function(e){e.isPresent&&(e.presence=Sy.Present)}))})),n((function(){uv.preRender(),uv.render()})),t((function(){hv.postRender((function(){return i.forEach($y)})),e.clear()}))})),yy()}}}function $y(e){e.prevViewportBox=e.projection.target}var qy=Object(jd.createContext)(Iy()),Wy=Object(jd.createContext)(Iy());function Uy(e){return!!e.forceUpdate}var Ky=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jf(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.syncLayout,n=e.framerSyncLayout,r=e.visualElement;Uy(t)&&t.register(r),Uy(n)&&n.register(r),r.onUnmount((function(){Uy(t)&&t.remove(r),Uy(n)&&n.remove(r)}))},t.prototype.getSnapshotBeforeUpdate=function(){var e=this.props,t=e.syncLayout,n=e.visualElement;return Uy(t)?t.syncUpdate():(!function(e){e.shouldResetTransform()||(e.prevViewportBox=e.measureViewportBox(!1),e.rebaseProjectionTarget(!1,e.prevViewportBox))}(n),t.add(n)),null},t.prototype.componentDidUpdate=function(){var e=this.props.syncLayout;Uy(e)||e.flush()},t.prototype.render=function(){return null},t}(Dd.a.Component);var Gy={measureLayout:function(e){var t=Object(jd.useContext)(qy),n=Object(jd.useContext)(Wy);return Dd.a.createElement(Ky,Df({},e,{syncLayout:t,framerSyncLayout:n}))},layoutAnimation:function(e){var t=Ef(Bf(),2)[1];return jd.createElement(Py,Df({},e,{safeToRemove:t}))}};function Jy(){return{isHydrated:!1,layout:{x:{min:0,max:1},y:{min:0,max:1}},layoutCorrected:{x:{min:0,max:1},y:{min:0,max:1}},treeScale:{x:1,y:1},delta:Pg(),deltaFinal:Pg(),deltaTransform:""}}var Yy=Jy();function Xy(e,t,n){var r=e.x,o=e.y,i="translate3d("+r.translate/t.x+"px, "+o.translate/t.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,l=n.rotateY;a&&(i+="rotate("+a+") "),s&&(i+="rotateX("+s+") "),l&&(i+="rotateY("+l+") ")}return i+="scale("+r.scale+", "+o.scale+")",n||i!==Qy?i:""}function Zy(e){var t=e.deltaFinal;return 100*t.x.origin+"% "+100*t.y.origin+"% 0"}var Qy=Xy(Yy.delta,Yy.treeScale,{x:1,y:1}),eb=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function tb(e,t,n,r){var o,i,a=e.delta,s=e.layout,l=e.layoutCorrected,u=e.treeScale,c=t.target;i=s,ry((o=l).x,i.x),ry(o.y,i.y),function(e,t,n){var r=n.length;if(r){var o,i;t.x=t.y=1;for(var a=0;a=0;t--){var n=U.path[t];if(n.projection.isEnabled){e=n;break}}w=e}return w},resolveRelativeTargetBox:function(){var e=U.getProjectionParent();if(A.relativeTarget&&e&&(function(e,t){Gg(e.target.x,e.relativeTarget.x,t.target.x),Gg(e.target.y,e.relativeTarget.y,t.target.y)}(A,e.projection),ny(e))){var t=A.target;dy(t,t,e.getLatestValues())}},shouldResetTransform:function(){return Boolean(m._layoutResetTransform)},pointTo:function(e){E=e.projection,M=e.getLatestValues(),null===k||void 0===k||k(),k=Ih(e.onSetAxisTarget(U.scheduleUpdateLayoutProjection),e.onLayoutAnimationComplete((function(){var e;U.isPresent?U.presence=Sy.Present:null===(e=U.layoutSafeToRemove)||void 0===e||e.call(U)})))},isPresent:!0,presence:Sy.Entering});return U}};function ob(e){e.resolveRelativeTargetBox()}function ib(e){e.updateLayoutProjection()}var ab,sb=Mf(["initial"],Ef(hg)),lb=sb.length,ub=new Set(["width","height","top","left","right","bottom","x","y"]),cb=function(e){return ub.has(e)},db=function(e,t){e.set(t,!1),e.set(t)},fb=function(e){return e===Pp||e===Mp};!function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"}(ab||(ab={}));var pb=function(e,t){return parseFloat(e.split(", ")[t])},hb=function(e,t){return function(n,r){var o=r.transform;if("none"===o||!o)return 0;var i=o.match(/^matrix3d\((.+)\)$/);if(i)return pb(i[1],t);var a=o.match(/^matrix\((.+)\)$/);return a?pb(a[1],e):0}},mb=new Set(["x","y","z"]),vb=cp.filter((function(e){return!mb.has(e)}));var gb={width:function(e){var t=e.x;return t.max-t.min},height:function(e){var t=e.y;return t.max-t.min},top:function(e,t){var n=t.top;return parseFloat(n)},left:function(e,t){var n=t.left;return parseFloat(n)},bottom:function(e,t){var n=e.y,r=t.top;return parseFloat(r)+(n.max-n.min)},right:function(e,t){var n=e.x,r=t.left;return parseFloat(r)+(n.max-n.min)},x:hb(4,13),y:hb(5,14)},yb=function(e,t,n,r){void 0===n&&(n={}),void 0===r&&(r={}),t=Df({},t),r=Df({},r);var o=Object.keys(t).filter(cb),i=[],a=!1,s=[];if(o.forEach((function(o){var l=e.getValue(o);if(e.hasValue(o)){var u,c=n[o],d=t[o],f=ng(c);if(ch(d))for(var p=d.length,h=null===d[0]?1:0;h=500)null===i||void 0===i||i();else{var n=30*h.current.offsetHeight/100;m.get()>=n?y():g.start({transition:Pb,y:0})}},dragConstraints:{top:0,bottom:0},dragMomentum:!1,dragElastic:!1,sx:{bg:"transparent",alignItems:"center",justifyContent:"center",p:2}},{children:Object(Cd.jsx)(af.Box,{id:"pill",sx:{backgroundColor:"hover",width:60,height:8,borderRadius:100}})})),Object(Cd.jsx)(Hb,Object.assign({items:o,title:r,onClose:i},{children:f}))]}))})):null}function Hb(e){var t,n=e.title,r=e.items,o=e.onClose,i=e.children,a=function(e){var t=Object(jd.useState)(e),n=Object(u.a)(t,2),r=n[0],o=n[1],i=Object(jd.useState)(!1),a=Object(u.a)(i,2),s=a[0],l=a[1],c=Object(jd.useRef)([e]);return{current:r,goBack:Object(jd.useCallback)((function(){if(s){var e=c.current.pop();o(e),c.current.length<=1&&l(!1)}}),[s]),navigate:Object(jd.useCallback)((function(e){console.log("NAVI",e),o((function(t){return t&&c.current.push(t),e})),l(!0)}),[]),canGoBack:s}}({title:n,items:r}),s=a.current,l=a.goBack,c=a.canGoBack,d=a.navigate;return Object(Cd.jsxs)(af.Flex,Object.assign({sx:{flexDirection:"column"}},{children:[c||(null===s||void 0===s?void 0:s.title)?Object(Cd.jsxs)(af.Flex,Object.assign({id:"header",sx:{alignItems:"center",mx:0,mb:1}},{children:[c&&Object(Cd.jsx)(uf,Object.assign({variant:"icon",sx:{p:1,ml:1},onClick:l},{children:Object(Cd.jsx)(mf,{path:vf.arrowLeft,size:"big"})})),(null===s||void 0===s?void 0:s.title)&&Object(Cd.jsx)(lf,Object.assign({variant:"title",sx:{ml:1,fontSize:"title"}},{children:null===s||void 0===s?void 0:s.title}))]})):null,i||(null===(t=null===s||void 0===s?void 0:s.items)||void 0===t?void 0:t.map((function(e){if(e.isHidden)return null;switch(e.type){case"separator":return Object(Cd.jsx)(xf,{},e.key);case"button":return Object(Cd.jsx)(kf,{item:e,onClick:function(t){e.menu?d(e.menu):e.onClick&&(null===o||void 0===o||o(),setTimeout((function(){var t;null===(t=e.onClick)||void 0===t||t.call(e)}),300))}},e.key);case"popup":return Object(Cd.jsx)(Dd.a.Fragment,{children:Object(Cd.jsx)(e.component,{onClick:o})},e.key)}})))]}))}var Fb={x:0,y:0,actualX:0,actualY:0};function Vb(e,t){var n=t||{},r=n.target,o=void 0===r?"mouse":r,i=n.isTargetAbsolute,a=void 0!==i&&i,s=n.location,l=void 0===s?void 0:s,u=n.yOffset,c=void 0===u?0:u,d=n.xOffset,f=void 0===d?0:d,p=n.align,h=void 0===p?"start":p,m=n.parent,v=void 0===m?document.body:m,g=n.yAnchor,y="mouse"===o?Fb:zb(o,a),b=y.x,w=y.y,k=y.width,x=y.height,O=y.actualX,S=y.actualY,C=e.offsetWidth,j=e.offsetHeight,D=v.clientWidth,A=v.clientHeight,E={top:0,left:0};if(D-OA?A-j:w,x&&("below"===l?E.top+=x:"top"===l&&(E.top=w-j)),k&&"mouse"!==o&&"center"===h&&C>0?E.left-=(C-k)/2:k&&"mouse"!==o&&"end"===h&&C>0&&(E.left-=C-k),j>A-E.top&&(e.style.maxHeight="".concat(A-20,"px")),g){var T=zb(g,a);E.top=T.y-j}return E.top=a&&E.top<0?0:E.top,E.left=a&&E.left<0?0:E.left,E.top+="below"===l?c:-c,E.left+=f,E}function zb(e,t){var n=e.getBoundingClientRect(),r={x:e.offsetLeft,y:e.offsetTop,width:n.width,height:n.height,actualY:n.y,actualX:n.x};return t&&(r.x=r.actualX,r.y=r.actualY),r}function Bb(e,t,n){var r=Object(jd.useState)(-1),o=Object(u.a)(r,2),i=o[0],a=o[1],s=Object(jd.useState)(!1),l=Object(u.a)(s,2),c=l[0],d=l[1],f=Object(jd.useCallback)((function(t){var n=e[t];if(n){var r=document.getElementById(n.key);r&&r.scrollIntoView({behavior:"auto"})}}),[e]),p=Object(jd.useCallback)((function(r){var o=function(t){return e[t]},i=function(t){var n,r;return e&&("separator"===(null===(n=e[t])||void 0===n?void 0:n.type)||(null===(r=o(t))||void 0===r?void 0:r.isDisabled))},s=function(t){return t0?--t:e.length-1},u=function(t){return e&&o(t).menu};a((function(e){var o=e;switch(r.key){case"ArrowUp":if(c)break;for(o=l(e);i(o);)o=l(o);break;case"ArrowDown":if(c)break;for(o=s(e);i(o);)o=s(o);break;case"ArrowRight":u(e)&&d(!0);break;case"ArrowLeft":!function(e){u(e)&&d(!1)}(e);break;case"Enter":t&&t(r);break;case"Escape":n&&n(r)}return o!==e&&f(o),o}))}),[e,c,f,t]);return Object(jd.useEffect)((function(){return window.addEventListener("keydown",p),function(){window.removeEventListener("keydown",p)}}),[p]),{focusIndex:i,setFocusIndex:a,isSubmenuOpen:c,setIsSubmenuOpen:d}}function _b(){return document.querySelector(".editor-toolbar")||void 0}function Ib(){return document.getElementById("popup-container")||void 0}window.addEventListener("mousemove",(function(e){var t=function(e){var t=0,n=0;!e&&window.event&&(e=window.event);e.pageX||e.pageY?(t=e.pageX,n=e.pageY):(e.clientX||e.clientY)&&(t=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,n=e.clientY+document.body.scrollTop+document.documentElement.scrollTop);return{x:t,y:n,actualY:n,actualX:t}}(e),n=t.x,r=t.y,o=t.actualX,i=t.actualY;Fb.x=n,Fb.y=r,Fb.actualX=o,Fb.actualY=i}));var $b=Dd.a.createContext(null),qb=Dd.a.createContext(null),Wb=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(){var e;return Object(c.a)(this,n),(e=t.apply(this,arguments)).popupContainer=null,e.state={popups:[]},e.openPopup=function(t,n){n&&e.setState((function(e){return{popups:[].concat(Object(l.a)(e.popups),[{id:t,popup:n}])}}))},e.closePopup=function(t){e.setState((function(e){var n=e.popups.findIndex((function(e){return e.id===t}));if(n<=-1)return e;var r=e.popups.slice();return r.splice(n,1),{popups:r}}))},e}return Object(d.a)(n,[{key:"render",value:function(){return Object(Cd.jsxs)($b.Provider,Object.assign({value:this},{children:[this.props.children,Object(Cd.jsxs)(qb.Provider,Object.assign({value:this.props.editor},{children:[this.state.popups.map((function(e){var t=e.id,n=e.popup;return Object(Cd.jsx)(n,{id:t},t)})),Object(Cd.jsx)("div",{id:"popup-container"})]}))]}))}}]),n}(Dd.a.Component);var Ub=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0){var a=document.body.clientHeight-20;i+o>a&&(e.style.top=a-o+"px")}t=o}})),d.current.observe(e,{box:"border-box"})}}),[u]);return Object(Cd.jsx)(Sf.a,Object.assign({contentRef:function(e){return c.current=e},className:"popup-presenter",role:"menu",isOpen:t,appElement:document.body,shouldCloseOnEsc:!0,shouldReturnFocusAfterClose:!0,shouldCloseOnOverlayClick:!0,shouldFocusAfterRender:s,ariaHideApp:i,preventScroll:i,onRequestClose:r,portalClassName:"popup-presenter-portal",onAfterOpen:function(e){e&&n&&(f(),h(),p())},onAfterClose:function(){var e;return null===(e=d.current)||void 0===e?void 0:e.disconnect()},overlayElement:function(e,t){return Object(Cd.jsx)(af.Box,Object.assign({},e,{style:Object.assign(Object.assign({},e.style),{position:i?"fixed":"initial",zIndex:1e3,backgroundColor:i?"unset":"transparent"})},{children:t}))},contentElement:function(e,t){return Object(Cd.jsx)(af.Box,Object.assign({},e,{style:{},sx:{top:0,left:0,right:0,bottom:0,display:"flex",width:"fit-content",height:"fit-content",position:"fixed",backgroundColor:void 0,padding:0,zIndex:0,outline:0,isolation:"isolate"}},{children:t}))},style:{content:{},overlay:{zIndex:999,background:"transparent"}}},{children:l}))}function Gb(e){return e.isOpen?Object(Cd.jsx)(Kb,Object.assign({},e)):null}function Jb(e){var t=e.id,n=(e.group,e.position),r=e.renderPopup,o=(e.isOpen,e.onClosed,e.autoCloseOnUnmount),i=Ub(e,["id","group","position","renderPopup","isOpen","onClosed","autoCloseOnUnmount"]),a=Object(jd.useContext)($b),s=Yb(e),l=s.closePopup,u=s.isPopupOpen;return Object(jd.useEffect)((function(){if(o)return function(){null===a||void 0===a||a.closePopup(t)}}),[o,t,a]),Object(jd.useEffect)((function(){a&&u&&a.openPopup(t,(function(e){var t=e.id,o=Rd((function(e){return!!e.openedPopups[t]}));return Object(jd.useEffect)((function(){o||a.closePopup(t)}),[o]),Object(Cd.jsx)(Gb,Object.assign({isOpen:o,onClose:function(){return l(t)},position:n,blocking:!0,focusOnRender:!0},i,{children:Object(Cd.jsx)(af.Box,Object.assign({sx:{boxShadow:"menu",borderRadius:"default",overflow:"hidden"}},{children:Object(Cd.jsx)(qb.Consumer,{children:function(){return r((function(){return a.closePopup(t)}))}})}))}),t)}))}),[a,u]),null}function Yb(e){var t=e.group,n=e.isOpen,r=e.id,o=e.onClosed,i=Rd((function(e){return!!e.openedPopups[r]})),a=Rd((function(e){return e.openPopup})),s=Rd((function(e){return e.closePopup})),l=Rd((function(e){return e.closePopupGroup}));return Rd((function(e){return"bottom"===e.toolbarLocation}))&&(t="popup"),Object(jd.useEffect)((function(){n?a({id:r,group:t}):s(r)}),[n,r,t,a,s]),Object(jd.useEffect)((function(){i||null===o||void 0===o||o()}),[i]),Object(jd.useEffect)((function(){i&&l(t,[r])}),[o,i,l,r,t]),Object(jd.useEffect)((function(){n||s(r)}),[n,r,t,s]),{isPopupOpen:i,closePopup:s}}function Xb(e){var t=e.popup,n=Ub(e,["popup"]);function r(){qd.a.unmountComponentAtNode(Ib())}return qd.a.render(Object(Cd.jsx)(Bd,{children:Object(Cd.jsx)(aw,Object.assign({isOpen:!0,position:{target:_b(),isTargetAbsolute:!0,location:"below",align:"end",yOffset:10},blocking:!0,focusOnRender:!0},n,{onClose:function(){var e;r(),null===(e=n.onClose)||void 0===e||e.call(n)}},{children:t(r)}))}),Ib()),r}var Zb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var hw,mw,vw,gw,yw=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(s&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}var ak=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(t){i(t)}}function s(e){try{l(r.throw(e))}catch(t){i(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};function sk(e){var t=this,n=e.onInsert,r=e.onClose,o=Object(jd.useState)(!1),i=Object(u.a)(o,2),a=i[0],s=i[1],l=Object(jd.useState)(),c=Object(u.a)(l,2),d=c[0],f=c[1],p=Object(jd.useState)(""),h=Object(u.a)(p,2),m=h[0],v=h[1];return Object(Cd.jsx)(sw,Object.assign({title:"Insert image from URL",onClose:r,action:{loading:a,title:"Insert image",disabled:!m,onClick:function(){return ak(t,void 0,void 0,ik().mark((function e(){var t,r,o,i,a;return ik().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s(!0),f(void 0),e.prev=2,e.next=5,fetch(m);case 5:if((t=e.sent).ok){e.next=8;break}return e.abrupt("return",f("invalid status code ".concat(t.status)));case 8:if(r=t.headers.get("Content-Type"),o=t.headers.get("Content-Length"),r&&o&&"0"!==o&&r.startsWith("image/")){e.next=12;break}return e.abrupt("return",f("not an image"));case 12:return i=parseInt(o),e.t0=lk,e.next=16,t.blob();case 16:return e.t1=e.sent,e.next=19,(0,e.t0)(e.t1);case 19:a=e.sent,n({src:a,type:r,size:i}),e.next=26;break;case 23:e.prev=23,e.t2=e.catch(2),e.t2 instanceof Error&&f(e.t2.message);case 26:return e.prev=26,s(!1),e.finish(26);case 29:case"end":return e.stop()}}),e,null,[[2,23,26,29]])})))}}},{children:Object(Cd.jsxs)(af.Flex,Object.assign({sx:{px:1,flexDirection:"column",width:["auto",350]}},{children:[Object(Cd.jsx)(Dw,{type:"url",autoFocus:!0,placeholder:"Paste Image URL here",value:m,onChange:function(e){v(e.target.value),f(void 0)}}),d?Object(Cd.jsxs)(lf,Object.assign({variant:"error",sx:{bg:"errorBg",mt:1,p:1,borderRadius:"default"}},{children:["Failed to download image: ",d.toLowerCase(),"."]})):Object(Cd.jsx)(lf,Object.assign({variant:"subBody",sx:{bg:"shade",color:"primary",mt:1,p:1,borderRadius:"default"}},{children:"To protect your privacy, we will download the image & add it to your attachments."}))]}))}))}function lk(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(e){return t(r.result)},r.onerror=function(e){return n(r.error)},r.onabort=function(e){return n(new Error("Read aborted"))},r.readAsDataURL(e)}))}var uk=function(e){return{key:"hr",type:"button",title:"Horizontal rule",icon:"horizontalRule",isChecked:null===e||void 0===e?void 0:e.isActive("horizontalRule"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().setHorizontalRule().run()}}},ck=function(e){return{key:"codeblock",type:"button",title:"Code block",icon:"codeblock",isChecked:null===e||void 0===e?void 0:e.isActive("codeBlock"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().toggleCodeBlock().run()}}},dk=function(e){return{key:"blockquote",type:"button",title:"Quote",icon:"blockquote",isChecked:null===e||void 0===e?void 0:e.isActive("blockQuote"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().toggleBlockquote().run()}}},fk=function(e){return{key:"math",type:"button",title:"Math & formulas",icon:"mathBlock",isChecked:null===e||void 0===e?void 0:e.isActive("mathBlock"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().insertMathBlock().run()}}},pk=function(e,t){return{key:"image",type:"button",title:"Image",icon:"image",menu:{title:"Insert an image",items:[{key:"upload-from-disk",type:"button",title:"Upload from disk",icon:"upload",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().openAttachmentPicker("image").run()}},{key:"camera",type:"button",title:"Take a photo using camera",icon:"camera",isHidden:!t,onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().openAttachmentPicker("camera").run()}},t?wk(e):kk(e)]}}},hk=function(e){return{key:"table",type:"button",title:"Table",icon:"table",menu:{title:"Insert a table",items:[{key:"table-size-selector",type:"popup",component:function(t){return Object(Cd.jsx)(tk,{onInsertTable:function(n){var r,o;null===(r=e.current)||void 0===r||r.chain().focus().insertTable({rows:n.rows,cols:n.columns}).run(),null===(o=t.onClick)||void 0===o||o.call(t)}})}}]}}},mk=function(e){return{key:"embed",type:"button",title:"Embed",icon:"embed",menu:{title:"Insert an embed",items:[{key:"embed-popup",type:"popup",component:function(t){var n=t.onClick;return Object(Cd.jsx)(Qw,{title:"Insert embed",onClose:function(t){var r;if(!t)return null===n||void 0===n?void 0:n();null===(r=e.current)||void 0===r||r.chain().insertEmbed(t).run(),null===n||void 0===n||n()}})}}]}}},vk=function(e){return{key:"embed",type:"button",title:"Embed",icon:"embed",onClick:function(){e&&Xb({popup:function(t){return Object(Cd.jsx)(Qw,{title:"Insert embed",onClose:function(n){var r;if(!n)return t();null===(r=e.current)||void 0===r||r.chain().insertEmbed(n).run(),t()}})}})}}},gk=function(e){return{key:"attachment",type:"button",title:"Attachment",icon:"attachment",isChecked:null===e||void 0===e?void 0:e.isActive("attachment"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().openAttachmentPicker("file").run()}}},yk=function(e){return{key:"tasklist",type:"button",title:"Task list",icon:"checkbox",isChecked:null===e||void 0===e?void 0:e.isActive("taskList"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().toggleTaskList().run()}}},bk=function(e){return{key:"outlinelist",type:"button",title:"Outline list",icon:"outlineList",isChecked:null===e||void 0===e?void 0:e.isActive("outlineList"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().toggleOutlineList().run()}}},wk=function(e){return{key:"upload-from-url",type:"button",title:"Attach from URL",icon:"link",menu:{title:"Attach image from URL",items:[{key:"attach-image",type:"popup",component:function(t){var n=t.onClick;return Object(Cd.jsx)(sk,{onInsert:function(t){var r;null===(r=e.requestPermission("insertImage"))||void 0===r||r.chain().focus().insertImage(t).run(),null===n||void 0===n||n()},onClose:function(){null===n||void 0===n||n()}})}}]}}},kk=function(e){return{key:"upload-from-url",type:"button",title:"Attach from URL",icon:"link",onClick:function(){Xb({popup:function(t){return Object(Cd.jsx)(sk,{onInsert:function(n){var r;null===(r=e.requestPermission("insertImage"))||void 0===r||r.chain().focus().insertImage(n).run(),t()},onClose:t})}})}}};function xk(e){var t=e.id,n=e.group,r=e.items,o=e.selectedItem,i=e.buttonRef,a=e.menuWidth,s=Object(jd.useRef)(),l=Object(jd.useState)(!1),c=Object(u.a)(l,2),d=c[0],f=c[1],p=Hd(),h=Fd(),m="bottom"===p,v=Yb({group:n,id:t,isOpen:d,onClosed:function(){return f(!1)}}),g=v.closePopup,y=v.isPopupOpen;return Object(Cd.jsxs)(Cd.Fragment,{children:[Object(Cd.jsxs)(yf,Object.assign({ref:function(e){s.current=e,i&&(i.current=e||void 0)},sx:{p:1,m:0,bg:y?"hover":"transparent",mr:1,display:"flex",alignItems:"center",":hover":{bg:"hover"},":last-of-type":{mr:0}},onClick:function(){return f((function(e){return!e}))},onMouseDown:function(e){return e.preventDefault()}},{children:["string"===typeof o?Object(Cd.jsx)(lf,Object.assign({sx:{fontSize:"subBody",mr:1,color:"text"}},{children:o})):o,Object(Cd.jsx)(mf,{path:m?vf.chevronUp:vf.chevronDown,size:"small",color:"text"})]})),Object(Cd.jsx)(tw,{isOpen:y,items:r,onClose:function(){return g(t)},position:{target:m?_b():s.current||"mouse",isTargetAbsolute:!0,location:m?"top":"below",align:"center",yOffset:5},blocking:!h,focusOnRender:!h,sx:{minWidth:a,maxWidth:m?"95vw":"auto",flexDirection:m?"row":"column",overflowX:m?"auto":"hidden",marginRight:m?"10px":0,display:"flex",alignItems:m?"center":"unset",mr:m?0:2}})]})}var Ok=Dd.a.memo((function(e){var t=e.title,n=e.onDecrease,r=e.onIncrease,o=e.onReset,i=e.value;return Object(Cd.jsxs)(af.Flex,Object.assign({sx:{alignItems:"center",mr:1,":last-of-type":{mr:0}}},{children:[Object(Cd.jsx)(wf,{toggled:!1,title:"Decrease ".concat(t),icon:"minus",variant:"small",onClick:n}),Object(Cd.jsx)(yf,Object.assign({sx:{color:"text",bg:"transparent",px:0,fontSize:"subBody",mx:1,textAlign:"center",":hover":{bg:"transparent"}},onClick:o,title:"Reset ".concat(t)},{children:i})),Object(Cd.jsx)(wf,{toggled:!1,title:"Increase ".concat(t),icon:"plus",variant:"small",onClick:r})]}))}),(function(e,t){return e.value===t.value}));function Sk(e){var t=Object(jd.useRef)(e);return Object(jd.useEffect)((function(){t.current=e}),[e]),t}var Ck={"Sans-serif":"Open Sans",Serif:"serif",Monospace:"monospace"};var jk=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o=0||(o[n]=e[n]);return o}function Uk(e){var t=Object(jd.useRef)(e),n=Object(jd.useRef)((function(e){t.current&&t.current(e)}));return t.current=e,n.current}var Kk=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e0:e.buttons>0)&&o.current?i(Yk(o.current,e,s.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,i=Jk(o.current),a=n?i.addEventListener:i.removeEventListener;a(r?"touchmove":"mousemove",e),a(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(Xk(t),!function(e,t){return t&&!Gk(e)}(t,l.current)&&r)){if(Gk(t)){l.current=!0;var a=t.changedTouches||[];a.length&&(s.current=a[0].identifier)}r.focus(),i(Yk(r,t,s.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),a({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]}),[a,i]),c=u[0],d=u[1],f=u[2];return Object(jd.useEffect)((function(){return f}),[f]),Dd.a.createElement("div",qk({},r,{onTouchStart:c,onMouseDown:c,className:"react-colorful__interactive",ref:o,onKeyDown:d,tabIndex:0,role:"slider"}))})),Qk=function(e){return e.filter(Boolean).join(" ")},ex=function(e){var t=e.color,n=e.left,r=e.top,o=void 0===r?.5:r,i=Qk(["react-colorful__pointer",e.className]);return Dd.a.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},Dd.a.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},tx=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},nx=(Math.PI,function(e){return"#"===e[0]&&(e=e.substr(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:1}:{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:1}}),rx=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:tx(e.h),s:tx(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:tx(o/2),a:tx(r,2)}},ox=function(e){var t=rx(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},ix=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),a=r*(1-n),s=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),u=i%6;return{r:tx(255*[r,s,a,a,l,r][u]),g:tx(255*[l,r,r,s,a,a][u]),b:tx(255*[a,a,l,r,r,s][u]),a:tx(o,2)}},ax=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},sx=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),a=i-Math.min(t,n,r),s=a?i===t?(n-r)/a:i===n?2+(r-t)/a:4+(t-n)/a:0;return{h:tx(60*(s<0?s+6:s)),s:tx(i?a/i*100:0),v:tx(i/255*100),a:o}},lx=Dd.a.memo((function(e){var t=e.hue,n=e.onChange,r=Qk(["react-colorful__hue",e.className]);return Dd.a.createElement("div",{className:r},Dd.a.createElement(Zk,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:Kk(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuetext":tx(t)},Dd.a.createElement(ex,{className:"react-colorful__hue-pointer",left:t/360,color:ox({h:t,s:100,v:100,a:1})})))})),ux=Dd.a.memo((function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:ox({h:t.h,s:100,v:100,a:1})};return Dd.a.createElement("div",{className:"react-colorful__saturation",style:r},Dd.a.createElement(Zk,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:Kk(t.s+100*e.left,0,100),v:Kk(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+tx(t.s)+"%, Brightness "+tx(t.v)+"%"},Dd.a.createElement(ex,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:ox(t)})))})),cx=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function dx(e,t,n){var r=Uk(n),o=Object(jd.useState)((function(){return e.toHsva(t)})),i=o[0],a=o[1],s=Object(jd.useRef)({color:t,hsva:i});Object(jd.useEffect)((function(){if(!e.equal(t,s.current.color)){var n=e.toHsva(t);s.current={hsva:n,color:t},a(n)}}),[t,e]),Object(jd.useEffect)((function(){var t;cx(i,s.current.hsva)||e.equal(t=e.fromHsva(i),s.current.color)||(s.current={hsva:i,color:t},r(t))}),[i,e,r]);var l=Object(jd.useCallback)((function(e){a((function(t){return Object.assign({},t,e)}))}),[]);return[i,l]}var fx,px="undefined"!=typeof window?jd.useLayoutEffect:jd.useEffect,hx=new Map,mx=function(e){px((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!hx.has(t)){var r=t.createElement("style");r.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',hx.set(t,r);var o=fx||n.nc;o&&r.setAttribute("nonce",o),t.head.appendChild(r)}}),[])},vx=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,a=Wk(e,["className","colorModel","color","onChange"]),s=Object(jd.useRef)(null);mx(s);var l=dx(n,o,i),u=l[0],c=l[1],d=Qk(["react-colorful",t]);return Dd.a.createElement("div",qk({},a,{ref:s,className:d}),Dd.a.createElement(ux,{hsva:u,onChange:c}),Dd.a.createElement(lx,{hue:u.h,onChange:c,className:"react-colorful__last-control"}))},gx={defaultColor:"000",toHsva:function(e){return sx(nx(e))},fromHsva:function(e){return n=(t=ix(e)).g,r=t.b,"#"+ax(t.r)+ax(n)+ax(r);var t,n,r},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||cx(nx(e),nx(t))}},yx=function(e){return Dd.a.createElement(vx,qk({},e,{colorModel:gx}))};var bx=["#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4caf50","#8bc34a","#cddc39","#ffeb3b","#ffc107","#f44336"],wx=[35,35,25];function kx(e){var t=e.colors,n=void 0===t?bx:t,r=e.color,o=e.onClear,i=e.onChange,a=e.title,s=e.onClose,l=e.expanded,c=Object(jd.useRef)(),d=Object(jd.useState)(l||!1),f=Object(u.a)(d,2),p=f[0],h=f[1],m=Object(jd.useState)(Ik()(r||n[0]).toHexString()),v=Object(u.a)(m,2),g=v[0],y=v[1],b=Ik()(g);Object(jd.useEffect)((function(){c.current&&p&&c.current.focus({preventScroll:!0})}),[p]);var w=Object(jd.useCallback)(function(e,t){var n;return function(){for(var r=arguments.length,o=new Array(r),i=0;ir&&(i+=u.attrs.colspan)}for(var c=0;c1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[],o=0,i=null,a=[],s=0,l=t*n;s=n){(i||(i=[])).push({type:"overlong_rowspan",pos:c,n:v-y});break}for(var b=o+y*t,w=0;w0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function Rx(e){for(var t=e.selection.$head,n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}function Hx(e){var t=e.selection;return t.$anchorCell?t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell:t.node&&"cell"==t.node.type.spec.tableRole?t.$anchor:Px(t.$head)||function(e){for(var t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){var r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(var o=e.nodeBefore,i=e.pos;o;o=o.lastChild,i--){var a=o.type.spec.tableRole;if("cell"==a||"header_cell"==a)return e.doc.resolve(i-o.nodeSize)}}(t.$head)}function Fx(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function Vx(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function zx(e,t,n){var r=e.start(-1),o=Mx.get(e.node(-1)).nextCell(e.pos-r,t,n);return null==o?null:e.node(0).resolve(r+o)}function Bx(e,t,n){var r={};for(var o in e)r[o]=e[o];return r[t]=n,r}function _x(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=Bx(e,"colspan",e.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some((function(e){return e>0}))||(r.colwidth=null)),r}function Ix(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=Bx(e,"colspan",e.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:e;Object(c.a)(this,n);var i=e.node(-1),a=Mx.get(i),s=e.start(-1),l=a.rectBetween(e.pos-s,o.pos-s),u=e.node(0),d=a.cellsInRect(l).filter((function(e){return e!=o.pos-s}));d.unshift(o.pos-s);var f=d.map((function(e){var t=i.nodeAt(e),n=e+s+1;return new p.SelectionRange(u.resolve(n),u.resolve(n+t.content.size))}));return(r=t.call(this,f[0].$from,f[0].$to,f)).$anchorCell=e,r.$headCell=o,r}return Object(d.a)(n,[{key:"map",value:function(e,t){var r=e.resolve(t.map(this.$anchorCell.pos)),o=e.resolve(t.map(this.$headCell.pos));if(Fx(r)&&Fx(o)&&Vx(r,o)){var i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?n.rowSelection(r,o):i&&this.isColSelection()?n.colSelection(r,o):new n(r,o)}return p.TextSelection.between(r,o)}},{key:"content",value:function(){for(var e=this.$anchorCell.node(-1),t=Mx.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[],a=r.top;a0||h>0){var m=f.attrs;p>0&&(m=_x(m,0,p)),h>0&&(m=_x(m,m.colspan-h,h)),f=d.leftr.bottom){var g=Bx(f.attrs,"rowspan",Math.min(d.bottom,r.bottom)-Math.max(d.top,r.top));f=d.top1&&void 0!==arguments[1]?arguments[1]:v.Slice.empty,n=e.steps.length,r=this.ranges,o=0;o0)return!1;var n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}},{key:"isRowSelection",value:function(){var e=Mx.get(this.$anchorCell.node(-1)),t=this.$anchorCell.start(-1),n=e.colCount(this.$anchorCell.pos-t),r=e.colCount(this.$headCell.pos-t);if(Math.min(n,r)>0)return!1;var o=n+this.$anchorCell.nodeAfter.attrs.colspan,i=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,i)==e.width}},{key:"eq",value:function(e){return e instanceof n&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}},{key:"toJSON",value:function(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}},{key:"getBookmark",value:function(){return new qx(this.$anchorCell.pos,this.$headCell.pos)}}],[{key:"colSelection",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=Mx.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),a=r.findCell(t.pos-o),s=e.node(0);return i.top<=a.top?(i.top>0&&(e=s.resolve(o+r.map[i.left])),a.bottom0&&(t=s.resolve(o+r.map[a.left])),i.bottom1&&void 0!==arguments[1]?arguments[1]:e,r=Mx.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),a=r.findCell(t.pos-o),s=e.node(0);return i.left<=a.left?(i.left>0&&(e=s.resolve(o+r.map[i.top*r.width])),a.right0&&(t=s.resolve(o+r.map[a.top*r.width])),i.right2&&void 0!==arguments[2]?arguments[2]:t;return new n(e.resolve(t),e.resolve(r))}}]),n}(p.Selection);$x.prototype.visible=!1,p.Selection.jsonID("cell",$x);var qx=function(){function e(t,n){Object(c.a)(this,e),this.anchor=t,this.head=n}return Object(d.a)(e,[{key:"map",value:function(t){return new e(t.map(this.anchor),t.map(this.head))}},{key:"resolve",value:function(e){var t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()=0&&!(t.after(i+1)=0&&!(n.before(a+1)>n.start(a));a--,o--);return r==o&&/row|table/.test(t.node(i).type.spec.tableRole)}(i)?r=p.TextSelection.create(a,i.from):i instanceof p.TextSelection&&function(e){for(var t,n,r=e.$from,o=e.$to,i=r.depth;i>0;i--){var a=r.node(i);if("cell"===a.type.spec.tableRole||"header_cell"===a.type.spec.tableRole){t=a;break}}for(var s=o.depth;s>0;s--){var l=o.node(s);if("cell"===l.type.spec.tableRole||"header_cell"===l.type.spec.tableRole){n=l;break}}return t!==n&&0===o.parentOffset}(i)&&(r=p.TextSelection.create(a,i.$from.start(),i.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}function Kx(e){if(!e.size)return null;for(var t=e.content,n=e.openStart,r=e.openEnd;1==t.childCount&&(n>0&&r>0||"table"==t.firstChild.type.spec.tableRole);)n--,r--,t=t.firstChild.content;var o=t.firstChild,i=o.type.spec.tableRole,a=o.type.schema,s=[];if("row"==i)for(var l=0;l=0;i--)for(var a=o.child(i).attrs,s=a.rowspan,l=a.colspan,u=r;u=t.length&&t.push(v.Fragment.empty),n[f]t.width)for(var c=0,d=0;ct.height){for(var g=[],y=0,b=(t.height-1)*t.width;y=t.width)&&n.nodeAt(t.map[b+y]).type==u.header_cell;g.push(w?l||(l=u.header_cell.createAndFill()):s||(s=u.cell.createAndFill()))}for(var k=u.row.create(null,v.Fragment.from(g)),x=[],O=t.height;Ot&&(p=p.type.create(_x(p.attrs,p.attrs.colspan,d+p.attrs.colspan-t),p.content)),c.push(p),d+=p.attrs.colspan;for(var h=1;hn&&(x=x.type.create(Bx(x.attrs,"rowspan",Math.max(1,n-x.attrs.rowspan)),x.content)),b.push(x)}m.push(v.Fragment.from(b))}i=m,o=n}return{width:r,height:o,rows:i}}(r,s.right-s.left,s.bottom-s.top),Xx(e.state,e.dispatch,a,s,r),!0}if(r){var l=Hx(e.state),u=l.start(-1);return Xx(e.state,e.dispatch,u,Mx.get(l.node(-1)).findCell(l.pos-u),r),!0}return!1}function iO(e,t){if(!t.ctrlKey&&!t.metaKey){var n,r=sO(e,t.target);if(t.shiftKey&&e.state.selection instanceof $x)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(n=Px(e.state.selection.$anchor))&&lO(e,t).pos!=n.pos)o(n,t),t.preventDefault();else if(!r)return;e.root.addEventListener("mouseup",i),e.root.addEventListener("dragstart",i),e.root.addEventListener("mousemove",a)}function o(t,n){var r=lO(e,n),o=null==Nx.getState(e.state);if(!r||!Vx(t,r)){if(!o)return;r=t}var i=new $x(t,r);if(o||!e.state.selection.eq(i)){var a=e.state.tr.setSelection(i);o&&a.setMeta(Nx,t.pos),e.dispatch(a)}}function i(){e.root.removeEventListener("mouseup",i),e.root.removeEventListener("dragstart",i),e.root.removeEventListener("mousemove",a),null!=Nx.getState(e.state)&&e.dispatch(e.state.tr.setMeta(Nx,-1))}function a(n){var a,s=Nx.getState(e.state);if(null!=s)a=e.state.doc.resolve(s);else if(sO(e,n.target)!=r&&!(a=lO(e,t)))return i();a&&o(a,n)}}function aO(e,t,n){if(!(e.state.selection instanceof p.TextSelection))return null;for(var r=e.state.selection.$head,o=r.depth-1;o>=0;o--){var i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){var a=r.before(o),s="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(s)?a:null}}return null}function sO(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function lO(e,t){var n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?Px(e.state.doc.resolve(n.pos)):null}var uO=new p.PluginKey("fix-tables");function cO(e,t,n,r){var o=e.childCount,i=t.childCount;e:for(var a=0,s=0;a0){var k="cell";y.firstChild&&(k=y.firstChild.type.spec.tableRole);for(var x=[],O=0;O0?-1:0;(function(e,t,n){for(var r=Lx(t.type.schema).header_cell,o=0;o0&&n0&&r.map[l-1]==u||n0?-1:0;(function(e,t,n){for(var r=Lx(t.type.schema).header_cell,o=0;o0&&n0&&f==r.map[d-r.width]){var p=o.nodeAt(f).attrs;e.setNodeMarkup(e.mapping.slice(u).map(f+i),null,Bx(p,"rowspan",p.rowspan-1)),c+=p.colspan-1}else if(n0&&o[a]==o[a-1]||t.right0&&o[i]==o[i-n]||t.bottom0;t--){var n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}(i.$from)))return!1;o=Px(i.$from).pos}if(1==r.attrs.colspan&&1==r.attrs.rowspan)return!1;if(t){var a=r.attrs,s=[],l=a.colwidth;a.rowspan>1&&(a=Bx(a,"rowspan",1)),a.colspan>1&&(a=Bx(a,"colspan",1));for(var u,c=fO(e),d=e.tr,f=0;f=0;r--){var i=e.node(-1).child(r);if(i.childCount)return o-1-i.lastChild.nodeSize;o-=i.nodeSize}}else{if(e.index()0&&void 0!==arguments[0]?arguments[0]:{},t=e.handleWidth,n=void 0===t?5:t,r=e.cellMinWidth,o=void 0===r?25:r,i=e.View,a=void 0===i?SO:i,s=e.lastColumnResizable,l=void 0===s||s,u=new p.Plugin({key:jO,state:{init:function(e,t){return this.spec.props.nodeViews[Lx(t.schema).table.name]=function(e,t){return new a(e,o,t)},new AO(-1,!1)},apply:function(e,t){return t.apply(e)}},props:{attributes:function(e){return jO.getState(e).activeHandle>-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove:function(e,t){EO(e,t,n,o,l)},mouseleave:function(e){MO(e)},mousedown:function(e,t){TO(e,t,o)}},decorations:function(e){var t=jO.getState(e);if(t.activeHandle>-1)return HO(e,t.activeHandle)},nodeViews:{}}});return u}var AO=function(){function e(t,n){Object(c.a)(this,e),this.activeHandle=t,this.dragging=n}return Object(d.a)(e,[{key:"apply",value:function(t){var n=this,r=t.getMeta(jO);if(r&&null!=r.setHandle)return new e(r.setHandle,null);if(r&&void 0!==r.setDragging)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){var o=t.mapping.map(n.activeHandle,-1);Fx(t.doc.resolve(o))||(o=null),n=new e(o,n.dragging)}return n}}]),e}();function EO(e,t,n,r,o){var i=jO.getState(e.state);if(!i.dragging){var a=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),s=-1;if(a){var l=a.getBoundingClientRect(),u=l.left,c=l.right;t.clientX-u<=n?s=LO(e,t,"left"):c-t.clientX<=n&&(s=LO(e,t,"right"))}if(s!=i.activeHandle){if(!o&&-1!==s){var d=e.state.doc.resolve(s),f=d.node(-1),p=Mx.get(f),h=d.start(-1);if(p.colCount(d.pos-h)+d.nodeAfter.attrs.colspan-1==p.width-1)return}PO(e,s)}}}function MO(e){var t=jO.getState(e.state);t.activeHandle>-1&&!t.dragging&&PO(e,-1)}function TO(e,t,n){var r=jO.getState(e.state);if(-1==r.activeHandle||r.dragging)return!1;var o=e.state.doc.nodeAt(r.activeHandle),i=function(e,t,n){var r=n.colspan,o=n.colwidth,i=o&&o[o.length-1];if(i)return i;var a=e.domAtPos(t),s=a.node.childNodes[a.offset].offsetWidth,l=r;if(o)for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},t=e.allowTableNodeSelection,n=void 0!==t&&t;return new p.Plugin({key:Nx,state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(Nx);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;var r=e.mapping.mapResult(t),o=r.deleted,i=r.pos;return o?null:i}},props:{decorations:Wx,handleDOMEvents:{mousedown:iO},createSelectionBetween:function(e){if(null!=Nx.getState(e.state))return e.state.selection},handleTripleClick:rO,handleKeyDown:Zx,handlePaste:oO},appendTransaction:function(e,t,r){return Ux(r,dO(r,t),n)}})}function VO(e,t,n,r){return IO(e,t,zO(t,n),zO(t,r))}function zO(e,t){for(var n=e.map,r=e.table,o=[],i=0;i=n.map.length)break;var s=n.map[a],l=r.nodeAt(s);l&&(o.push({cell:l,pos:s}),i+=l.attrs.rowspan)}return o}function BO(e,t,n,r){return IO(e,t,_O(t,n),_O(t,r))}function _O(e,t){for(var n=e.map,r=e.table,o=[],i=0,a=t*n.width;i=n.map.length);i++,a++){var s=n.map[a],l=r.nodeAt(s);l&&(o.push({cell:l,pos:s}),i+=l.attrs.colspan-1)}return o}function IO(e,t,n,r){if(n.length===r.length){for(var o=e.mapping.maps.length,i=0;i1&&void 0!==arguments[1]?arguments[1]:1;if(0===e)return"0B";var n=1024,r=t<0?0:t,o=["B","K","M","G","T","P","E","Z","Y"],i=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,i)).toFixed(r))+o[i]}var FS=Bo.create({name:"attachment",content:"inline*",marks:"",inline:!0,atom:!0,addOptions:function(){return{HTMLAttributes:{},onDownloadAttachment:function(){return!1},onOpenAttachmentPicker:function(){return!1}}},group:function(){return"inline"},draggable:!0,addAttributes:function(){return{progress:{default:0,rendered:!1},hash:VS("hash"),filename:VS("filename"),type:VS("mime"),size:VS("size")}},parseHTML:function(){return[{tag:"span[data-hash]"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["span",Sr(this.options.HTMLAttributes,t)]},addNodeView:function(){return nf(RS,{shouldUpdate:function(e,t){var n=e.attrs,r=t.attrs;return n.progress!==r.progress}})},addCommands:function(){var e=this;return{insertAttachment:function(t){return function(n){return n.commands.insertContent({type:e.name,attrs:t})}},removeAttachment:function(){return function(e){var t=e.commands;e.tr;return t.deleteSelection()}},downloadAttachment:function(t){return function(n){var r=n.editor;return e.options.onDownloadAttachment(r,t)}},openAttachmentPicker:function(t){return function(n){var r=n.editor;return e.options.onOpenAttachmentPicker(r,t)}},setAttachmentProgress:function(t){return function(n){var r,o=n.state,i=n.tr,a=n.dispatch,s=t.hash,l=t.progress,u=(t.type,To(o.doc,(function(t){return(t.type.name===e.name||"image"===t.type.name)&&t.attrs.hash===s}))),c=Object(Sd.a)(u);try{for(c.s();!(r=c.n()).done;){var d=r.value;i.setNodeMarkup(d.pos,d.node.type,Object.assign(Object.assign({},d.node.attrs),{progress:100===l?null:l}))}}catch(f){c.e(f)}finally{c.f()}return i.setMeta("preventUpdate",!0),i.setMeta("addToHistory",!1),a&&a(i),!0}}}}});function VS(e,t){return{default:t,parseHTML:function(t){return t.dataset[e]},renderHTML:function(t){return t[e]?Object(s.a)({},"data-".concat(e),t[e]):{}}}}var zS=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 r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),BS=function(){return BS=Object.assign||function(e){for(var t,n=1,r=arguments.length;n1)||(0===t.parentOffset||0===t.index(t.depth-1))}(e.state)||!e.can().liftListItem(n))return!1;var a=function(e,t){var n=Object(AS.findParentNodeOfType)(e)(t.selection);return!!n&&!n.node.textContent.length}(n,e.state);if(a){if(kC(n,e.state)){var s=xC(n,e.state);return!!s&&e.commands.deleteNode(s.type)}return e.commands.deleteNode(n)}return kC(n,e.state)?e.commands.liftListItem(n):e.chain().joinBackward().joinBackward().run()}var kC=function(e,t){var n=Object(AS.findParentNodeOfType)(e)(t.selection);if(!n)return!1;var r=n.pos,o=t.doc.resolve(r);return console.log("isFirstOfType",o),!o.nodeBefore},xC=function(e,t){var n,r=Object(AS.findParentNodeOfType)(e)(t.selection);if(r){var o=r.pos,i=t.doc.resolve(o);if(i.parent.type.spec.group&&!((null===(n=i.parent.type.spec.group)||void 0===n?void 0:n.indexOf("list"))<=-1))return i.parent}};var OC=/^\s*(\[([( |x])?\])\s$/;function SC(e){var t=e.editor,n=e.updateAttributes,r=e.getPos,o=e.forwardRef,i=e.node.attrs.checked,a=Fd(),s=Object(jd.useCallback)((function(){var e;if(!t.isEditable||!t.current)return!1;var o=t.current.state.selection,a=o.empty,s=o.from,l=o.to;if(a){n({checked:!i});var u=r(),c=null===(e=t.current)||void 0===e?void 0:e.state.doc.nodeAt(u);if(!c)return!1;t.commands.command((function(e){var t=e.tr;return CC(c,t,!i,u),!0}))}else{var d=Lo(t.current.state.doc,{from:s,to:l},(function(e){return e.type.name===jC.name}));t.current.commands.command((function(e){var t,n=e.tr,r=Object(Sd.a)(d);try{for(r.s();!(t=r.n()).done;){var o=t.value,a=o.node,s=o.pos;n.setNodeMarkup(s,null,{checked:!i}),CC(a,n,!i,s)}}catch(l){r.e(l)}finally{r.f()}return!0}))}return!0}),[t,r,i]);return Object(Cd.jsx)(Cd.Fragment,{children:Object(Cd.jsxs)(af.Flex,Object.assign({"data-drag-image":!0,sx:{bg:"background",borderRadius:"default",":hover > .dragHandle":{opacity:t.isEditable?1:0}}},{children:[Object(Cd.jsx)(mf,{className:"dragHandle",draggable:"true","data-drag-handle":!0,path:vf.dragHandle,sx:{opacity:[1,1,0],alignSelf:"start",mr:2,bg:"transparent",cursor:"grab",".icon:hover path":{fill:"var(--checked) !important"}},size:a?24:20}),Object(Cd.jsx)(mf,{path:i?vf.check:"",stroke:"1px",contentEditable:!1,tabIndex:1,sx:{border:"2px solid",borderColor:i?"checked":"icon",borderRadius:"default",alignSelf:"start",mr:2,p:"1px",cursor:t.isEditable?"pointer":"unset",":hover":{borderColor:"checked"},":hover .icon path":{fill:"var(--checked) !important"}},onMouseDown:function(e){zd.current&&e.preventDefault(),s()},onTouchEnd:function(e){zd.current&&(e.preventDefault(),s())},color:i?"checked":"icon",size:a?16:14}),Object(Cd.jsx)(lf,{as:"div",ref:o,sx:{"> .taskitem-content-wrapper > p":{textDecorationLine:i?"line-through":"none",opacity:i?.8:1},flex:1}})]}))})}function CC(e,t,n,r){var o,i=To(e,(function(e){return e.type.name===jC.name})),a=Object(Sd.a)(i);try{for(a.s();!(o=a.n()).done;){var s=o.value.pos+r+1;t.setNodeMarkup(s,void 0,{checked:n})}}catch(l){a.e(l)}finally{a.f()}return t}var jC=Bo.create({name:"taskItem",addOptions:function(){return{nested:!1,HTMLAttributes:{}}},content:function(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:function(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:function(e){return"true"===e.getAttribute("data-checked")},renderHTML:function(e){return{"data-checked":e.checked}}}}},parseHTML:function(){return[{tag:'li[data-type="'.concat(this.name,'"]'),priority:51}]},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes;return["li",Sr(this.options.HTMLAttributes,n,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts:function(){var e=this,t={Enter:function(){return e.editor.commands.splitListItem(e.name)},"Shift-Tab":function(){return e.editor.commands.liftListItem(e.name)}};return this.options.nested?Object(f.a)(Object(f.a)({},t),{},{Tab:function(){return e.editor.commands.sinkListItem(e.name)}}):t},addNodeView:function(){var e=this;return function(t){var n=t.node,r=t.HTMLAttributes,o=t.getPos,i=t.editor,a=document.createElement("li"),s=document.createElement("label"),l=document.createElement("span"),c=document.createElement("input"),d=document.createElement("div");return s.contentEditable="false",c.type="checkbox",c.addEventListener("change",(function(t){if(i.isEditable||e.options.onReadOnlyChecked){var r=t.target.checked;i.isEditable&&"function"===typeof o&&i.chain().focus(void 0,{scrollIntoView:!1}).command((function(e){var t=e.tr,n=o(),i=t.doc.nodeAt(n);return t.setNodeMarkup(n,void 0,Object(f.a)(Object(f.a)({},null===i||void 0===i?void 0:i.attrs),{},{checked:r})),!0})).run(),!i.isEditable&&e.options.onReadOnlyChecked&&(e.options.onReadOnlyChecked(n,r)||(c.checked=!c.checked))}else c.checked=!c.checked})),Object.entries(e.options.HTMLAttributes).forEach((function(e){var t=Object(u.a)(e,2),n=t[0],r=t[1];a.setAttribute(n,r)})),a.dataset.checked=n.attrs.checked,n.attrs.checked&&c.setAttribute("checked","checked"),s.append(c,l),a.append(s,d),Object.entries(r).forEach((function(e){var t=Object(u.a)(e,2),n=t[0],r=t[1];a.setAttribute(n,r)})),{dom:a,contentDOM:d,update:function(t){return t.type===e.type&&(a.dataset.checked=t.attrs.checked,t.attrs.checked?c.setAttribute("checked","checked"):c.removeAttribute("checked"),!0)}}}},addInputRules:function(){return[Vo({find:OC,type:this.type,getAttributes:function(e){return{checked:"x"===e[e.length-1]}}})]}}).extend({draggable:!0,addAttributes:function(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:function(e){return e.classList.contains("checked")},renderHTML:function(e){return{class:e.checked?"checked":""}}}}},renderHTML:function(e){e.node;var t=e.HTMLAttributes;return["li",Sr(this.options.HTMLAttributes,t,{class:"checklist--item"}),0]},parseHTML:function(){return[{tag:"li",getAttrs:function(e){var t;return e instanceof Node&&e instanceof HTMLElement&&(!(!e.classList.contains("checklist--item")&&!(null===(t=e.parentElement)||void 0===t?void 0:t.classList.contains("checklist")))&&null)},priority:51}]},addKeyboardShortcuts:function(){var e,t=this;return Object.assign(Object.assign({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{Backspace:function(e){return wC(e.editor,t.name,t.type)}})},addNodeView:function(){return Id(SC,{contentDOMFactory:!0,wrapperFactory:function(){return document.createElement("li")},shouldUpdate:function(e,t){var n=e.attrs,r=t.attrs;return n.checked!==r.checked||n.collapsed!==r.collapsed}})}});function DC(e){var t=Fd(),n=e.editor,r=e.getPos,o=e.node,i=e.updateAttributes,a=e.forwardRef,s=Or(jC.name,n.schema),l=o.attrs,c=l.title,d=l.collapsed,f=Object(jd.useState)({checked:0,total:0,percentage:0}),p=Object(u.a)(f,2),h=p[0],m=p[1],v=Object(jd.useCallback)((function(){var e=n.state.doc.resolve(r());return Object(AS.findParentNodeOfTypeClosestToPos)(e,s)}),[]),g=Object(jd.useMemo)((function(){return!!v()}),[v]);return Object(jd.useEffect)((function(){var e=v();if(e){var t=e.node,r=e.pos,o=function(e,t,n){var r,o=To(e,(function(e){return e.type.name===jC.name})),i=Object(Sd.a)(o);try{for(i.s();!(r=i.n()).done;){var a=t+r.value.pos+1,s=n.nodeAt(a);if(!(null===s||void 0===s?void 0:s.attrs.checked))return!1}}catch(l){i.e(l)}finally{i.f()}return!0}(t,r,n.state.doc);t.attrs.checked!==o&&n.commands.command((function(e){return e.tr.setNodeMarkup(r,void 0,{checked:o}),!0}))}}),[o,o.childCount]),Object(jd.useEffect)((function(){var e=To(o,(function(e){return e.type.name===jC.name})),t=e.filter((function(e){return e.node.attrs.checked})).length,n=e.length,r=Math.round(t/n*100);m({checked:t,total:n,percentage:r})}),[g,o]),Object(Cd.jsxs)(Cd.Fragment,{children:[Object(Cd.jsx)(af.Flex,Object.assign({sx:{flexDirection:"column",":hover > div > .toggleSublist":{opacity:1}}},{children:g?Object(Cd.jsxs)(af.Flex,Object.assign({sx:{position:"absolute",top:0,right:0},contentEditable:!1},{children:[d&&Object(Cd.jsxs)(lf,Object.assign({variant:"body",sx:{color:"fontTertiary",mr:35}},{children:[h.checked,"/",h.total]})),Object(Cd.jsx)(mf,{className:"toggleSublist",path:d?vf.chevronDown:vf.chevronUp,sx:{opacity:t||d?1:0,position:"absolute",right:0,alignSelf:"start",mr:2,cursor:"pointer",".icon:hover path":{fill:"var(--checked) !important"}},size:t?24:20,onClick:function(){i({collapsed:!d},{addToHistory:!1,preventUpdate:!0})}})]})):Object(Cd.jsxs)(af.Flex,Object.assign({sx:{position:"relative",bg:"bgSecondary",py:1,borderRadius:"default",mb:2,alignItems:"center",justifyContent:"end",overflow:"hidden"},contentEditable:!1},{children:[Object(Cd.jsx)(af.Box,{sx:{height:"100%",width:"".concat(h.percentage,"%"),position:"absolute",bg:"border",zIndex:0,left:0,transition:"width 250ms ease-out"}}),Object(Cd.jsx)(Dw,{readOnly:!n.isEditable,value:c||"",variant:"clean",sx:{p:0,px:2,zIndex:1,color:"fontTertiary"},placeholder:"Untitled",onChange:function(e){i({title:e.target.value},{addToHistory:!0,preventUpdate:!1})}}),Object(Cd.jsxs)(af.Flex,Object.assign({sx:{flexShrink:0,pr:2}},{children:[Object(Cd.jsx)(mf,{path:vf.checkbox,size:15,color:"fontTertiary"}),Object(Cd.jsxs)(lf,Object.assign({variant:"body",sx:{ml:1,color:"fontTertiary"}},{children:[h.checked,"/",h.total]}))]}))]}))})),Object(Cd.jsx)(lf,{as:"div",ref:a,sx:{ul:{display:d?"none":"block",paddingInlineStart:0,marginBlockStart:g?10:0,marginBlockEnd:0,marginLeft:g?-35:0},li:{listStyleType:"none",position:"relative",marginBottom:[2,"7px"]}}})]})}var AC=bC.extend({addAttributes:function(){return{collapsed:{default:!1,keepOnSplit:!1,parseHTML:function(e){return"true"===e.dataset.collapsed},renderHTML:function(e){return{"data-collapsed":!0===e.collapsed}}},title:{default:null,keepOnSplit:!1,parseHTML:function(e){return e.dataset.title},renderHTML:function(e){return!e.title||e.nested?{}:{"data-title":e.title}}}}},parseHTML:function(){return[{tag:"ul",getAttrs:function(e){return e instanceof Node&&e instanceof HTMLElement&&(e.classList.contains("checklist")&&null)},priority:51}]},renderHTML:function(e){var t=e.HTMLAttributes;return["ul",Sr(this.options.HTMLAttributes,t,{class:"checklist"}),0]},addCommands:function(){var e=this;return{toggleTaskList:function(){return function(t){var n=t.editor,r=t.commands,o=t.state,i=t.tr,a=o.selection,s=a.$from,l=a.$to;r.toggleList(e.name,e.options.itemTypeName);var u={from:i.mapping.map(s.pos),to:i.mapping.map(l.pos)};return setTimeout((function(){return n.commands.setTextSelection(u)}),0),!0}}}},addNodeView:function(){var e=this;return Id(DC,{contentDOMFactory:function(){var t=document.createElement("ul");return t.classList.add("".concat(e.name.toLowerCase(),"-content-wrapper")),t.style.whiteSpace="inherit",{dom:t}}})}});function EC(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new p.Plugin({view:function(t){return new MC(t,e)}})}var MC=function(){function e(t,n){var r=this;Object(c.a)(this,e),this.editorView=t,this.width=n.width||1,this.color=n.color||"black",this.class=n.class||"",this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(e){var n=function(t){return r[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}}))}return Object(d.a)(e,[{key:"destroy",value:function(){var e=this;this.handlers.forEach((function(t){var n=t.name,r=t.handler;return e.editorView.dom.removeEventListener(n,r)}))}},{key:"update",value:function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}},{key:"setCursor",value:function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e&&this.element&&this.element.parentNode?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}},{key:"updateOverlay",value:function(){if(this.cursorPos){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,r=t.nodeAfter;if(n||r){var o=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(!o)return;var i=o.getBoundingClientRect(),a=n?i.bottom:i.top;if(n&&r){var s=this.editorView.nodeDOM(this.cursorPos);if(!s)return;a=(a+s.getBoundingClientRect().top)/2}e={left:i.left,right:i.right,top:a-this.width/2,bottom:a+this.width/2}}}if(!e){var l=this.editorView.coordsAtPos(this.cursorPos);e={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}var u,c,d=this.editorView.dom.offsetParent;if(!this.element&&d&&(this.element=d.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),!d||d==document.body&&"static"==getComputedStyle(d).position)u=-pageXOffset,c=-pageYOffset;else{var f=d.getBoundingClientRect();u=f.left-d.scrollLeft,c=f.top-d.scrollTop}this.element&&(this.element.style.left=e.left-u+"px",this.element.style.top=e.top-c+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px")}}},{key:"scheduleRemoval",value:function(e){var t=this;clearTimeout(this.timeout||void 0),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)}},{key:"dragover",value:function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t):r;if(t&&!o){var i=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){var a=Object(g.h)(this.editorView.state.doc,i,this.editorView.dragging.slice);if(!a)return this.setCursor(null);i=a}this.setCursor(i),this.scheduleRemoval(5e3)}}}},{key:"dragend",value:function(){this.scheduleRemoval(20)}},{key:"drop",value:function(){this.scheduleRemoval(20)}},{key:"dragleave",value:function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}]),e}(),TC=Ir.create({name:"dropCursor",addOptions:function(){return{color:"currentColor",width:1,class:null}},addProseMirrorPlugins:function(){return[EC(this.options)]}}),LC=function(e,t){return t(e.tr)};var NC=Ir.create({name:"searchreplace",addOptions:function(){return{searchResultClass:"search-result"}},addCommands:function(){var e=this;return{startSearch:function(){return function(t){var n=t.state;return e.storage.isSearching=!0,n.selection.empty||(e.storage.selectedText=n.doc.textBetween(n.selection.$from.pos,n.selection.$to.pos)),!0}},endSearch:function(){return function(t){var n=t.state,r=t.dispatch;return e.storage.isSearching=!1,e.storage.searchTerm="",LC(n,r),!0}},search:function(t,n){return function(r){var o=r.state,i=r.dispatch;return e.storage.searchTerm=t,e.storage.enableRegex=(null===n||void 0===n?void 0:n.enableRegex)||!1,e.storage.matchCase=(null===n||void 0===n?void 0:n.matchCase)||!1,e.storage.matchWholeWord=(null===n||void 0===n?void 0:n.matchWholeWord)||!1,e.storage.results=[],LC(o,i),!0}},moveToNextResult:function(){return function(t){var n=t.chain,r=e.storage,o=r.selectedIndex,i=r.results;if(!i||i.length<=0)return!1;var a=o+1;(isNaN(a)||a>=i.length)&&(a=0);var s=i[a],l=s.from,u=s.to;console.log("[moveToNextResult]",l,u);var c=n().focus(void 0,{scrollIntoView:!0}).setTextSelection({from:l,to:u}).run();return c&&(e.storage.selectedIndex=a),c}},moveToPreviousResult:function(){return function(t){var n=t.chain,r=e.storage,o=r.selectedIndex,i=r.results;if(!i||i.length<=0)return!1;var a=o-1;(isNaN(a)||a<0)&&(a=i.length-1);var s=i[a],l=s.from,u=s.to,c=n().focus(void 0,{scrollIntoView:!0}).setTextSelection({from:l,to:u}).run();return c&&(e.storage.selectedIndex=a),c}},replace:function(t){return function(n){var r=n.commands,o=n.tr,i=n.dispatch,a=e.storage,s=a.selectedIndex,l=a.results;if(!i||!l||l.length<=0)return!1;var u=void 0===s?0:s,c=l[u],d=c.from,f=c.to;if(o.insertText(t,d,f),u+11&&void 0!==arguments[1]?arguments[1]:"div",i=e||"",a={},s=0;s4&&"data"===n.slice(0,4)&&pj.test(t)){if("-"===t.charAt(4)){var i=t.slice(5).replace(hj,gj);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{var a=t.slice(4);if(!hj.test(a)){var s=a.replace(mj,vj);"-"!==s.charAt(0)&&(s="-"+s),t="data"+s}}o=ej}return new o(r,t)}(e,n),a=-1;if(void 0!==r&&null!==r){if("number"===typeof r){if(Number.isNaN(r))return;o=r}else o="boolean"===typeof r?r:"string"===typeof r?i.spaceSeparated?wj(r):i.commaSeparated?kj(r):i.commaOrSpaceSeparated?wj(kj(r).join(" ")):Dj(i,i.property,r):Array.isArray(r)?r.concat():"style"===i.property?function(e){var t,n=[];for(t in e)Oj.call(e,t)&&n.push([t,e[t]].join(": "));return n.join("; ")}(r):String(r);if(Array.isArray(o)){for(var s=[];++a2?l-2:0),c=2;c=48&&t<=57}function Lj(e){var t="string"===typeof e?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Nj(e){return function(e){var t="string"===typeof e?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}(e)||Tj(e)}var Pj={AElig:"\xc6",AMP:"&",Aacute:"\xc1",Abreve:"\u0102",Acirc:"\xc2",Acy:"\u0410",Afr:"\ud835\udd04",Agrave:"\xc0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2a53",Aogon:"\u0104",Aopf:"\ud835\udd38",ApplyFunction:"\u2061",Aring:"\xc5",Ascr:"\ud835\udc9c",Assign:"\u2254",Atilde:"\xc3",Auml:"\xc4",Backslash:"\u2216",Barv:"\u2ae7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212c",Beta:"\u0392",Bfr:"\ud835\udd05",Bopf:"\ud835\udd39",Breve:"\u02d8",Bscr:"\u212c",Bumpeq:"\u224e",CHcy:"\u0427",COPY:"\xa9",Cacute:"\u0106",Cap:"\u22d2",CapitalDifferentialD:"\u2145",Cayleys:"\u212d",Ccaron:"\u010c",Ccedil:"\xc7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010a",Cedilla:"\xb8",CenterDot:"\xb7",Cfr:"\u212d",Chi:"\u03a7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201d",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2a74",Congruent:"\u2261",Conint:"\u222f",ContourIntegral:"\u222e",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2a2f",Cscr:"\ud835\udc9e",Cup:"\u22d3",CupCap:"\u224d",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040f",Dagger:"\u2021",Darr:"\u21a1",Dashv:"\u2ae4",Dcaron:"\u010e",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\ud835\udd07",DiacriticalAcute:"\xb4",DiacriticalDot:"\u02d9",DiacriticalDoubleAcute:"\u02dd",DiacriticalGrave:"`",DiacriticalTilde:"\u02dc",Diamond:"\u22c4",DifferentialD:"\u2146",Dopf:"\ud835\udd3b",Dot:"\xa8",DotDot:"\u20dc",DotEqual:"\u2250",DoubleContourIntegral:"\u222f",DoubleDot:"\xa8",DoubleDownArrow:"\u21d3",DoubleLeftArrow:"\u21d0",DoubleLeftRightArrow:"\u21d4",DoubleLeftTee:"\u2ae4",DoubleLongLeftArrow:"\u27f8",DoubleLongLeftRightArrow:"\u27fa",DoubleLongRightArrow:"\u27f9",DoubleRightArrow:"\u21d2",DoubleRightTee:"\u22a8",DoubleUpArrow:"\u21d1",DoubleUpDownArrow:"\u21d5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21f5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295e",DownLeftVector:"\u21bd",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295f",DownRightVector:"\u21c1",DownRightVectorBar:"\u2957",DownTee:"\u22a4",DownTeeArrow:"\u21a7",Downarrow:"\u21d3",Dscr:"\ud835\udc9f",Dstrok:"\u0110",ENG:"\u014a",ETH:"\xd0",Eacute:"\xc9",Ecaron:"\u011a",Ecirc:"\xca",Ecy:"\u042d",Edot:"\u0116",Efr:"\ud835\udd08",Egrave:"\xc8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25fb",EmptyVerySmallSquare:"\u25ab",Eogon:"\u0118",Eopf:"\ud835\udd3c",Epsilon:"\u0395",Equal:"\u2a75",EqualTilde:"\u2242",Equilibrium:"\u21cc",Escr:"\u2130",Esim:"\u2a73",Eta:"\u0397",Euml:"\xcb",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\ud835\udd09",FilledSmallSquare:"\u25fc",FilledVerySmallSquare:"\u25aa",Fopf:"\ud835\udd3d",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03dc",Gbreve:"\u011e",Gcedil:"\u0122",Gcirc:"\u011c",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\ud835\udd0a",Gg:"\u22d9",Gopf:"\ud835\udd3e",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterGreater:"\u2aa2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Gscr:"\ud835\udca2",Gt:"\u226b",HARDcy:"\u042a",Hacek:"\u02c7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210c",HilbertSpace:"\u210b",Hopf:"\u210d",HorizontalLine:"\u2500",Hscr:"\u210b",Hstrok:"\u0126",HumpDownHump:"\u224e",HumpEqual:"\u224f",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xcd",Icirc:"\xce",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xcc",Im:"\u2111",Imacr:"\u012a",ImaginaryI:"\u2148",Implies:"\u21d2",Int:"\u222c",Integral:"\u222b",Intersection:"\u22c2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012e",Iopf:"\ud835\udd40",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xcf",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\ud835\udd0d",Jopf:"\ud835\udd41",Jscr:"\ud835\udca5",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040c",Kappa:"\u039a",Kcedil:"\u0136",Kcy:"\u041a",Kfr:"\ud835\udd0e",Kopf:"\ud835\udd42",Kscr:"\ud835\udca6",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039b",Lang:"\u27ea",Laplacetrf:"\u2112",Larr:"\u219e",Lcaron:"\u013d",Lcedil:"\u013b",Lcy:"\u041b",LeftAngleBracket:"\u27e8",LeftArrow:"\u2190",LeftArrowBar:"\u21e4",LeftArrowRightArrow:"\u21c6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21c3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230a",LeftRightArrow:"\u2194",LeftRightVector:"\u294e",LeftTee:"\u22a3",LeftTeeArrow:"\u21a4",LeftTeeVector:"\u295a",LeftTriangle:"\u22b2",LeftTriangleBar:"\u29cf",LeftTriangleEqual:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21bf",LeftUpVectorBar:"\u2958",LeftVector:"\u21bc",LeftVectorBar:"\u2952",Leftarrow:"\u21d0",Leftrightarrow:"\u21d4",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2aa1",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",Lfr:"\ud835\udd0f",Ll:"\u22d8",Lleftarrow:"\u21da",Lmidot:"\u013f",LongLeftArrow:"\u27f5",LongLeftRightArrow:"\u27f7",LongRightArrow:"\u27f6",Longleftarrow:"\u27f8",Longleftrightarrow:"\u27fa",Longrightarrow:"\u27f9",Lopf:"\ud835\udd43",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21b0",Lstrok:"\u0141",Lt:"\u226a",Map:"\u2905",Mcy:"\u041c",MediumSpace:"\u205f",Mellintrf:"\u2133",Mfr:"\ud835\udd10",MinusPlus:"\u2213",Mopf:"\ud835\udd44",Mscr:"\u2133",Mu:"\u039c",NJcy:"\u040a",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041d",NegativeMediumSpace:"\u200b",NegativeThickSpace:"\u200b",NegativeThinSpace:"\u200b",NegativeVeryThinSpace:"\u200b",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NewLine:"\n",Nfr:"\ud835\udd11",NoBreak:"\u2060",NonBreakingSpace:"\xa0",Nopf:"\u2115",Not:"\u2aec",NotCongruent:"\u2262",NotCupCap:"\u226d",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226b\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2a7e\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224e\u0338",NotHumpEqual:"\u224f\u0338",NotLeftTriangle:"\u22ea",NotLeftTriangleBar:"\u29cf\u0338",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226a\u0338",NotLessSlantEqual:"\u2a7d\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2aa2\u0338",NotNestedLessLess:"\u2aa1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2aaf\u0338",NotPrecedesSlantEqual:"\u22e0",NotReverseElement:"\u220c",NotRightTriangle:"\u22eb",NotRightTriangleBar:"\u29d0\u0338",NotRightTriangleEqual:"\u22ed",NotSquareSubset:"\u228f\u0338",NotSquareSubsetEqual:"\u22e2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22e3",NotSubset:"\u2282\u20d2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2ab0\u0338",NotSucceedsSlantEqual:"\u22e1",NotSucceedsTilde:"\u227f\u0338",NotSuperset:"\u2283\u20d2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\ud835\udca9",Ntilde:"\xd1",Nu:"\u039d",OElig:"\u0152",Oacute:"\xd3",Ocirc:"\xd4",Ocy:"\u041e",Odblac:"\u0150",Ofr:"\ud835\udd12",Ograve:"\xd2",Omacr:"\u014c",Omega:"\u03a9",Omicron:"\u039f",Oopf:"\ud835\udd46",OpenCurlyDoubleQuote:"\u201c",OpenCurlyQuote:"\u2018",Or:"\u2a54",Oscr:"\ud835\udcaa",Oslash:"\xd8",Otilde:"\xd5",Otimes:"\u2a37",Ouml:"\xd6",OverBar:"\u203e",OverBrace:"\u23de",OverBracket:"\u23b4",OverParenthesis:"\u23dc",PartialD:"\u2202",Pcy:"\u041f",Pfr:"\ud835\udd13",Phi:"\u03a6",Pi:"\u03a0",PlusMinus:"\xb1",Poincareplane:"\u210c",Popf:"\u2119",Pr:"\u2abb",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",Prime:"\u2033",Product:"\u220f",Proportion:"\u2237",Proportional:"\u221d",Pscr:"\ud835\udcab",Psi:"\u03a8",QUOT:'"',Qfr:"\ud835\udd14",Qopf:"\u211a",Qscr:"\ud835\udcac",RBarr:"\u2910",REG:"\xae",Racute:"\u0154",Rang:"\u27eb",Rarr:"\u21a0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211c",ReverseElement:"\u220b",ReverseEquilibrium:"\u21cb",ReverseUpEquilibrium:"\u296f",Rfr:"\u211c",Rho:"\u03a1",RightAngleBracket:"\u27e9",RightArrow:"\u2192",RightArrowBar:"\u21e5",RightArrowLeftArrow:"\u21c4",RightCeiling:"\u2309",RightDoubleBracket:"\u27e7",RightDownTeeVector:"\u295d",RightDownVector:"\u21c2",RightDownVectorBar:"\u2955",RightFloor:"\u230b",RightTee:"\u22a2",RightTeeArrow:"\u21a6",RightTeeVector:"\u295b",RightTriangle:"\u22b3",RightTriangleBar:"\u29d0",RightTriangleEqual:"\u22b5",RightUpDownVector:"\u294f",RightUpTeeVector:"\u295c",RightUpVector:"\u21be",RightUpVectorBar:"\u2954",RightVector:"\u21c0",RightVectorBar:"\u2953",Rightarrow:"\u21d2",Ropf:"\u211d",RoundImplies:"\u2970",Rrightarrow:"\u21db",Rscr:"\u211b",Rsh:"\u21b1",RuleDelayed:"\u29f4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042c",Sacute:"\u015a",Sc:"\u2abc",Scaron:"\u0160",Scedil:"\u015e",Scirc:"\u015c",Scy:"\u0421",Sfr:"\ud835\udd16",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03a3",SmallCircle:"\u2218",Sopf:"\ud835\udd4a",Sqrt:"\u221a",Square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\ud835\udcae",Star:"\u22c6",Sub:"\u22d0",Subset:"\u22d0",SubsetEqual:"\u2286",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",SuchThat:"\u220b",Sum:"\u2211",Sup:"\u22d1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22d1",THORN:"\xde",TRADE:"\u2122",TSHcy:"\u040b",TScy:"\u0426",Tab:"\t",Tau:"\u03a4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\ud835\udd17",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205f\u200a",ThinSpace:"\u2009",Tilde:"\u223c",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\ud835\udd4b",TripleDot:"\u20db",Tscr:"\ud835\udcaf",Tstrok:"\u0166",Uacute:"\xda",Uarr:"\u219f",Uarrocir:"\u2949",Ubrcy:"\u040e",Ubreve:"\u016c",Ucirc:"\xdb",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\ud835\udd18",Ugrave:"\xd9",Umacr:"\u016a",UnderBar:"_",UnderBrace:"\u23df",UnderBracket:"\u23b5",UnderParenthesis:"\u23dd",Union:"\u22c3",UnionPlus:"\u228e",Uogon:"\u0172",Uopf:"\ud835\udd4c",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21c5",UpDownArrow:"\u2195",UpEquilibrium:"\u296e",UpTee:"\u22a5",UpTeeArrow:"\u21a5",Uparrow:"\u21d1",Updownarrow:"\u21d5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03d2",Upsilon:"\u03a5",Uring:"\u016e",Uscr:"\ud835\udcb0",Utilde:"\u0168",Uuml:"\xdc",VDash:"\u22ab",Vbar:"\u2aeb",Vcy:"\u0412",Vdash:"\u22a9",Vdashl:"\u2ae6",Vee:"\u22c1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200a",Vfr:"\ud835\udd19",Vopf:"\ud835\udd4d",Vscr:"\ud835\udcb1",Vvdash:"\u22aa",Wcirc:"\u0174",Wedge:"\u22c0",Wfr:"\ud835\udd1a",Wopf:"\ud835\udd4e",Wscr:"\ud835\udcb2",Xfr:"\ud835\udd1b",Xi:"\u039e",Xopf:"\ud835\udd4f",Xscr:"\ud835\udcb3",YAcy:"\u042f",YIcy:"\u0407",YUcy:"\u042e",Yacute:"\xdd",Ycirc:"\u0176",Ycy:"\u042b",Yfr:"\ud835\udd1c",Yopf:"\ud835\udd50",Yscr:"\ud835\udcb4",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017d",Zcy:"\u0417",Zdot:"\u017b",ZeroWidthSpace:"\u200b",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\ud835\udcb5",aacute:"\xe1",abreve:"\u0103",ac:"\u223e",acE:"\u223e\u0333",acd:"\u223f",acirc:"\xe2",acute:"\xb4",acy:"\u0430",aelig:"\xe6",af:"\u2061",afr:"\ud835\udd1e",agrave:"\xe0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03b1",amacr:"\u0101",amalg:"\u2a3f",amp:"&",and:"\u2227",andand:"\u2a55",andd:"\u2a5c",andslope:"\u2a58",andv:"\u2a5a",ang:"\u2220",ange:"\u29a4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29a8",angmsdab:"\u29a9",angmsdac:"\u29aa",angmsdad:"\u29ab",angmsdae:"\u29ac",angmsdaf:"\u29ad",angmsdag:"\u29ae",angmsdah:"\u29af",angrt:"\u221f",angrtvb:"\u22be",angrtvbd:"\u299d",angsph:"\u2222",angst:"\xc5",angzarr:"\u237c",aogon:"\u0105",aopf:"\ud835\udd52",ap:"\u2248",apE:"\u2a70",apacir:"\u2a6f",ape:"\u224a",apid:"\u224b",apos:"'",approx:"\u2248",approxeq:"\u224a",aring:"\xe5",ascr:"\ud835\udcb6",ast:"*",asymp:"\u2248",asympeq:"\u224d",atilde:"\xe3",auml:"\xe4",awconint:"\u2233",awint:"\u2a11",bNot:"\u2aed",backcong:"\u224c",backepsilon:"\u03f6",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",barvee:"\u22bd",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23b5",bbrktbrk:"\u23b6",bcong:"\u224c",bcy:"\u0431",bdquo:"\u201e",becaus:"\u2235",because:"\u2235",bemptyv:"\u29b0",bepsi:"\u03f6",bernou:"\u212c",beta:"\u03b2",beth:"\u2136",between:"\u226c",bfr:"\ud835\udd1f",bigcap:"\u22c2",bigcirc:"\u25ef",bigcup:"\u22c3",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",bigvee:"\u22c1",bigwedge:"\u22c0",bkarow:"\u290d",blacklozenge:"\u29eb",blacksquare:"\u25aa",blacktriangle:"\u25b4",blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20e5",bnequiv:"\u2261\u20e5",bnot:"\u2310",bopf:"\ud835\udd53",bot:"\u22a5",bottom:"\u22a5",bowtie:"\u22c8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255d",boxUR:"\u255a",boxUl:"\u255c",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256c",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256b",boxVl:"\u2562",boxVr:"\u255f",boxbox:"\u29c9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250c",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252c",boxhu:"\u2534",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxuL:"\u255b",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256a",boxvL:"\u2561",boxvR:"\u255e",boxvh:"\u253c",boxvl:"\u2524",boxvr:"\u251c",bprime:"\u2035",breve:"\u02d8",brvbar:"\xa6",bscr:"\ud835\udcb7",bsemi:"\u204f",bsim:"\u223d",bsime:"\u22cd",bsol:"\\",bsolb:"\u29c5",bsolhsub:"\u27c8",bull:"\u2022",bullet:"\u2022",bump:"\u224e",bumpE:"\u2aae",bumpe:"\u224f",bumpeq:"\u224f",cacute:"\u0107",cap:"\u2229",capand:"\u2a44",capbrcup:"\u2a49",capcap:"\u2a4b",capcup:"\u2a47",capdot:"\u2a40",caps:"\u2229\ufe00",caret:"\u2041",caron:"\u02c7",ccaps:"\u2a4d",ccaron:"\u010d",ccedil:"\xe7",ccirc:"\u0109",ccups:"\u2a4c",ccupssm:"\u2a50",cdot:"\u010b",cedil:"\xb8",cemptyv:"\u29b2",cent:"\xa2",centerdot:"\xb7",cfr:"\ud835\udd20",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03c7",cir:"\u25cb",cirE:"\u29c3",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledR:"\xae",circledS:"\u24c8",circledast:"\u229b",circledcirc:"\u229a",circleddash:"\u229d",cire:"\u2257",cirfnint:"\u2a10",cirmid:"\u2aef",cirscir:"\u29c2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2a6d",conint:"\u222e",copf:"\ud835\udd54",coprod:"\u2210",copy:"\xa9",copysr:"\u2117",crarr:"\u21b5",cross:"\u2717",cscr:"\ud835\udcb8",csub:"\u2acf",csube:"\u2ad1",csup:"\u2ad0",csupe:"\u2ad2",ctdot:"\u22ef",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22de",cuesc:"\u22df",cularr:"\u21b6",cularrp:"\u293d",cup:"\u222a",cupbrcap:"\u2a48",cupcap:"\u2a46",cupcup:"\u2a4a",cupdot:"\u228d",cupor:"\u2a45",cups:"\u222a\ufe00",curarr:"\u21b7",curarrm:"\u293c",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",curlyvee:"\u22ce",curlywedge:"\u22cf",curren:"\xa4",curvearrowleft:"\u21b6",curvearrowright:"\u21b7",cuvee:"\u22ce",cuwed:"\u22cf",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232d",dArr:"\u21d3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22a3",dbkarow:"\u290f",dblac:"\u02dd",dcaron:"\u010f",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21ca",ddotseq:"\u2a77",deg:"\xb0",delta:"\u03b4",demptyv:"\u29b1",dfisht:"\u297f",dfr:"\ud835\udd21",dharl:"\u21c3",dharr:"\u21c2",diam:"\u22c4",diamond:"\u22c4",diamondsuit:"\u2666",diams:"\u2666",die:"\xa8",digamma:"\u03dd",disin:"\u22f2",div:"\xf7",divide:"\xf7",divideontimes:"\u22c7",divonx:"\u22c7",djcy:"\u0452",dlcorn:"\u231e",dlcrop:"\u230d",dollar:"$",dopf:"\ud835\udd55",dot:"\u02d9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22a1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21ca",downharpoonleft:"\u21c3",downharpoonright:"\u21c2",drbkarow:"\u2910",drcorn:"\u231f",drcrop:"\u230c",dscr:"\ud835\udcb9",dscy:"\u0455",dsol:"\u29f6",dstrok:"\u0111",dtdot:"\u22f1",dtri:"\u25bf",dtrif:"\u25be",duarr:"\u21f5",duhar:"\u296f",dwangle:"\u29a6",dzcy:"\u045f",dzigrarr:"\u27ff",eDDot:"\u2a77",eDot:"\u2251",eacute:"\xe9",easter:"\u2a6e",ecaron:"\u011b",ecir:"\u2256",ecirc:"\xea",ecolon:"\u2255",ecy:"\u044d",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\ud835\udd22",eg:"\u2a9a",egrave:"\xe8",egs:"\u2a96",egsdot:"\u2a98",el:"\u2a99",elinters:"\u23e7",ell:"\u2113",els:"\u2a95",elsdot:"\u2a97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014b",ensp:"\u2002",eogon:"\u0119",eopf:"\ud835\udd56",epar:"\u22d5",eparsl:"\u29e3",eplus:"\u2a71",epsi:"\u03b5",epsilon:"\u03b5",epsiv:"\u03f5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2a96",eqslantless:"\u2a95",equals:"=",equest:"\u225f",equiv:"\u2261",equivDD:"\u2a78",eqvparsl:"\u29e5",erDot:"\u2253",erarr:"\u2971",escr:"\u212f",esdot:"\u2250",esim:"\u2242",eta:"\u03b7",eth:"\xf0",euml:"\xeb",euro:"\u20ac",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\ufb03",fflig:"\ufb00",ffllig:"\ufb04",ffr:"\ud835\udd23",filig:"\ufb01",fjlig:"fj",flat:"\u266d",fllig:"\ufb02",fltns:"\u25b1",fnof:"\u0192",fopf:"\ud835\udd57",forall:"\u2200",fork:"\u22d4",forkv:"\u2ad9",fpartint:"\u2a0d",frac12:"\xbd",frac13:"\u2153",frac14:"\xbc",frac15:"\u2155",frac16:"\u2159",frac18:"\u215b",frac23:"\u2154",frac25:"\u2156",frac34:"\xbe",frac35:"\u2157",frac38:"\u215c",frac45:"\u2158",frac56:"\u215a",frac58:"\u215d",frac78:"\u215e",frasl:"\u2044",frown:"\u2322",fscr:"\ud835\udcbb",gE:"\u2267",gEl:"\u2a8c",gacute:"\u01f5",gamma:"\u03b3",gammad:"\u03dd",gap:"\u2a86",gbreve:"\u011f",gcirc:"\u011d",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22db",geq:"\u2265",geqq:"\u2267",geqslant:"\u2a7e",ges:"\u2a7e",gescc:"\u2aa9",gesdot:"\u2a80",gesdoto:"\u2a82",gesdotol:"\u2a84",gesl:"\u22db\ufe00",gesles:"\u2a94",gfr:"\ud835\udd24",gg:"\u226b",ggg:"\u22d9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2a92",gla:"\u2aa5",glj:"\u2aa4",gnE:"\u2269",gnap:"\u2a8a",gnapprox:"\u2a8a",gne:"\u2a88",gneq:"\u2a88",gneqq:"\u2269",gnsim:"\u22e7",gopf:"\ud835\udd58",grave:"`",gscr:"\u210a",gsim:"\u2273",gsime:"\u2a8e",gsiml:"\u2a90",gt:">",gtcc:"\u2aa7",gtcir:"\u2a7a",gtdot:"\u22d7",gtlPar:"\u2995",gtquest:"\u2a7c",gtrapprox:"\u2a86",gtrarr:"\u2978",gtrdot:"\u22d7",gtreqless:"\u22db",gtreqqless:"\u2a8c",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\ufe00",gvnE:"\u2269\ufe00",hArr:"\u21d4",hairsp:"\u200a",half:"\xbd",hamilt:"\u210b",hardcy:"\u044a",harr:"\u2194",harrcir:"\u2948",harrw:"\u21ad",hbar:"\u210f",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22b9",hfr:"\ud835\udd25",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21ff",homtht:"\u223b",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",hopf:"\ud835\udd59",horbar:"\u2015",hscr:"\ud835\udcbd",hslash:"\u210f",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xed",ic:"\u2063",icirc:"\xee",icy:"\u0438",iecy:"\u0435",iexcl:"\xa1",iff:"\u21d4",ifr:"\ud835\udd26",igrave:"\xec",ii:"\u2148",iiiint:"\u2a0c",iiint:"\u222d",iinfin:"\u29dc",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012b",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22b7",imped:"\u01b5",in:"\u2208",incare:"\u2105",infin:"\u221e",infintie:"\u29dd",inodot:"\u0131",int:"\u222b",intcal:"\u22ba",integers:"\u2124",intercal:"\u22ba",intlarhk:"\u2a17",intprod:"\u2a3c",iocy:"\u0451",iogon:"\u012f",iopf:"\ud835\udd5a",iota:"\u03b9",iprod:"\u2a3c",iquest:"\xbf",iscr:"\ud835\udcbe",isin:"\u2208",isinE:"\u22f9",isindot:"\u22f5",isins:"\u22f4",isinsv:"\u22f3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xef",jcirc:"\u0135",jcy:"\u0439",jfr:"\ud835\udd27",jmath:"\u0237",jopf:"\ud835\udd5b",jscr:"\ud835\udcbf",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03ba",kappav:"\u03f0",kcedil:"\u0137",kcy:"\u043a",kfr:"\ud835\udd28",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045c",kopf:"\ud835\udd5c",kscr:"\ud835\udcc0",lAarr:"\u21da",lArr:"\u21d0",lAtail:"\u291b",lBarr:"\u290e",lE:"\u2266",lEg:"\u2a8b",lHar:"\u2962",lacute:"\u013a",laemptyv:"\u29b4",lagran:"\u2112",lambda:"\u03bb",lang:"\u27e8",langd:"\u2991",langle:"\u27e8",lap:"\u2a85",laquo:"\xab",larr:"\u2190",larrb:"\u21e4",larrbfs:"\u291f",larrfs:"\u291d",larrhk:"\u21a9",larrlp:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",lat:"\u2aab",latail:"\u2919",late:"\u2aad",lates:"\u2aad\ufe00",lbarr:"\u290c",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",lcaron:"\u013e",lcedil:"\u013c",lceil:"\u2308",lcub:"{",lcy:"\u043b",ldca:"\u2936",ldquo:"\u201c",ldquor:"\u201e",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21a2",leftharpoondown:"\u21bd",leftharpoonup:"\u21bc",leftleftarrows:"\u21c7",leftrightarrow:"\u2194",leftrightarrows:"\u21c6",leftrightharpoons:"\u21cb",leftrightsquigarrow:"\u21ad",leftthreetimes:"\u22cb",leg:"\u22da",leq:"\u2264",leqq:"\u2266",leqslant:"\u2a7d",les:"\u2a7d",lescc:"\u2aa8",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessapprox:"\u2a85",lessdot:"\u22d6",lesseqgtr:"\u22da",lesseqqgtr:"\u2a8b",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297c",lfloor:"\u230a",lfr:"\ud835\udd29",lg:"\u2276",lgE:"\u2a91",lhard:"\u21bd",lharu:"\u21bc",lharul:"\u296a",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226a",llarr:"\u21c7",llcorner:"\u231e",llhard:"\u296b",lltri:"\u25fa",lmidot:"\u0140",lmoust:"\u23b0",lmoustache:"\u23b0",lnE:"\u2268",lnap:"\u2a89",lnapprox:"\u2a89",lne:"\u2a87",lneq:"\u2a87",lneqq:"\u2268",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",lobrk:"\u27e6",longleftarrow:"\u27f5",longleftrightarrow:"\u27f7",longmapsto:"\u27fc",longrightarrow:"\u27f6",looparrowleft:"\u21ab",looparrowright:"\u21ac",lopar:"\u2985",lopf:"\ud835\udd5d",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",lowbar:"_",loz:"\u25ca",lozenge:"\u25ca",lozf:"\u29eb",lpar:"(",lparlt:"\u2993",lrarr:"\u21c6",lrcorner:"\u231f",lrhar:"\u21cb",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",lscr:"\ud835\udcc1",lsh:"\u21b0",lsim:"\u2272",lsime:"\u2a8d",lsimg:"\u2a8f",lsqb:"[",lsquo:"\u2018",lsquor:"\u201a",lstrok:"\u0142",lt:"<",ltcc:"\u2aa6",ltcir:"\u2a79",ltdot:"\u22d6",lthree:"\u22cb",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltrPar:"\u2996",ltri:"\u25c3",ltrie:"\u22b4",ltrif:"\u25c2",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe00",lvnE:"\u2268\ufe00",mDDot:"\u223a",macr:"\xaf",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21a6",mapsto:"\u21a6",mapstodown:"\u21a7",mapstoleft:"\u21a4",mapstoup:"\u21a5",marker:"\u25ae",mcomma:"\u2a29",mcy:"\u043c",mdash:"\u2014",measuredangle:"\u2221",mfr:"\ud835\udd2a",mho:"\u2127",micro:"\xb5",mid:"\u2223",midast:"*",midcir:"\u2af0",middot:"\xb7",minus:"\u2212",minusb:"\u229f",minusd:"\u2238",minusdu:"\u2a2a",mlcp:"\u2adb",mldr:"\u2026",mnplus:"\u2213",models:"\u22a7",mopf:"\ud835\udd5e",mp:"\u2213",mscr:"\ud835\udcc2",mstpos:"\u223e",mu:"\u03bc",multimap:"\u22b8",mumap:"\u22b8",nGg:"\u22d9\u0338",nGt:"\u226b\u20d2",nGtv:"\u226b\u0338",nLeftarrow:"\u21cd",nLeftrightarrow:"\u21ce",nLl:"\u22d8\u0338",nLt:"\u226a\u20d2",nLtv:"\u226a\u0338",nRightarrow:"\u21cf",nVDash:"\u22af",nVdash:"\u22ae",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20d2",nap:"\u2249",napE:"\u2a70\u0338",napid:"\u224b\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266e",natural:"\u266e",naturals:"\u2115",nbsp:"\xa0",nbump:"\u224e\u0338",nbumpe:"\u224f\u0338",ncap:"\u2a43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2a6d\u0338",ncup:"\u2a42",ncy:"\u043d",ndash:"\u2013",ne:"\u2260",neArr:"\u21d7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\ud835\udd2b",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2a7e\u0338",nges:"\u2a7e\u0338",ngsim:"\u2275",ngt:"\u226f",ngtr:"\u226f",nhArr:"\u21ce",nharr:"\u21ae",nhpar:"\u2af2",ni:"\u220b",nis:"\u22fc",nisd:"\u22fa",niv:"\u220b",njcy:"\u045a",nlArr:"\u21cd",nlE:"\u2266\u0338",nlarr:"\u219a",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219a",nleftrightarrow:"\u21ae",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2a7d\u0338",nles:"\u2a7d\u0338",nless:"\u226e",nlsim:"\u2274",nlt:"\u226e",nltri:"\u22ea",nltrie:"\u22ec",nmid:"\u2224",nopf:"\ud835\udd5f",not:"\xac",notin:"\u2209",notinE:"\u22f9\u0338",notindot:"\u22f5\u0338",notinva:"\u2209",notinvb:"\u22f7",notinvc:"\u22f6",notni:"\u220c",notniva:"\u220c",notnivb:"\u22fe",notnivc:"\u22fd",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2afd\u20e5",npart:"\u2202\u0338",npolint:"\u2a14",npr:"\u2280",nprcue:"\u22e0",npre:"\u2aaf\u0338",nprec:"\u2280",npreceq:"\u2aaf\u0338",nrArr:"\u21cf",nrarr:"\u219b",nrarrc:"\u2933\u0338",nrarrw:"\u219d\u0338",nrightarrow:"\u219b",nrtri:"\u22eb",nrtrie:"\u22ed",nsc:"\u2281",nsccue:"\u22e1",nsce:"\u2ab0\u0338",nscr:"\ud835\udcc3",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22e2",nsqsupe:"\u22e3",nsub:"\u2284",nsubE:"\u2ac5\u0338",nsube:"\u2288",nsubset:"\u2282\u20d2",nsubseteq:"\u2288",nsubseteqq:"\u2ac5\u0338",nsucc:"\u2281",nsucceq:"\u2ab0\u0338",nsup:"\u2285",nsupE:"\u2ac6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20d2",nsupseteq:"\u2289",nsupseteqq:"\u2ac6\u0338",ntgl:"\u2279",ntilde:"\xf1",ntlg:"\u2278",ntriangleleft:"\u22ea",ntrianglelefteq:"\u22ec",ntriangleright:"\u22eb",ntrianglerighteq:"\u22ed",nu:"\u03bd",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22ad",nvHarr:"\u2904",nvap:"\u224d\u20d2",nvdash:"\u22ac",nvge:"\u2265\u20d2",nvgt:">\u20d2",nvinfin:"\u29de",nvlArr:"\u2902",nvle:"\u2264\u20d2",nvlt:"<\u20d2",nvltrie:"\u22b4\u20d2",nvrArr:"\u2903",nvrtrie:"\u22b5\u20d2",nvsim:"\u223c\u20d2",nwArr:"\u21d6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24c8",oacute:"\xf3",oast:"\u229b",ocir:"\u229a",ocirc:"\xf4",ocy:"\u043e",odash:"\u229d",odblac:"\u0151",odiv:"\u2a38",odot:"\u2299",odsold:"\u29bc",oelig:"\u0153",ofcir:"\u29bf",ofr:"\ud835\udd2c",ogon:"\u02db",ograve:"\xf2",ogt:"\u29c1",ohbar:"\u29b5",ohm:"\u03a9",oint:"\u222e",olarr:"\u21ba",olcir:"\u29be",olcross:"\u29bb",oline:"\u203e",olt:"\u29c0",omacr:"\u014d",omega:"\u03c9",omicron:"\u03bf",omid:"\u29b6",ominus:"\u2296",oopf:"\ud835\udd60",opar:"\u29b7",operp:"\u29b9",oplus:"\u2295",or:"\u2228",orarr:"\u21bb",ord:"\u2a5d",order:"\u2134",orderof:"\u2134",ordf:"\xaa",ordm:"\xba",origof:"\u22b6",oror:"\u2a56",orslope:"\u2a57",orv:"\u2a5b",oscr:"\u2134",oslash:"\xf8",osol:"\u2298",otilde:"\xf5",otimes:"\u2297",otimesas:"\u2a36",ouml:"\xf6",ovbar:"\u233d",par:"\u2225",para:"\xb6",parallel:"\u2225",parsim:"\u2af3",parsl:"\u2afd",part:"\u2202",pcy:"\u043f",percnt:"%",period:".",permil:"\u2030",perp:"\u22a5",pertenk:"\u2031",pfr:"\ud835\udd2d",phi:"\u03c6",phiv:"\u03d5",phmmat:"\u2133",phone:"\u260e",pi:"\u03c0",pitchfork:"\u22d4",piv:"\u03d6",planck:"\u210f",planckh:"\u210e",plankv:"\u210f",plus:"+",plusacir:"\u2a23",plusb:"\u229e",pluscir:"\u2a22",plusdo:"\u2214",plusdu:"\u2a25",pluse:"\u2a72",plusmn:"\xb1",plussim:"\u2a26",plustwo:"\u2a27",pm:"\xb1",pointint:"\u2a15",popf:"\ud835\udd61",pound:"\xa3",pr:"\u227a",prE:"\u2ab3",prap:"\u2ab7",prcue:"\u227c",pre:"\u2aaf",prec:"\u227a",precapprox:"\u2ab7",preccurlyeq:"\u227c",preceq:"\u2aaf",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",precsim:"\u227e",prime:"\u2032",primes:"\u2119",prnE:"\u2ab5",prnap:"\u2ab9",prnsim:"\u22e8",prod:"\u220f",profalar:"\u232e",profline:"\u2312",profsurf:"\u2313",prop:"\u221d",propto:"\u221d",prsim:"\u227e",prurel:"\u22b0",pscr:"\ud835\udcc5",psi:"\u03c8",puncsp:"\u2008",qfr:"\ud835\udd2e",qint:"\u2a0c",qopf:"\ud835\udd62",qprime:"\u2057",qscr:"\ud835\udcc6",quaternions:"\u210d",quatint:"\u2a16",quest:"?",questeq:"\u225f",quot:'"',rAarr:"\u21db",rArr:"\u21d2",rAtail:"\u291c",rBarr:"\u290f",rHar:"\u2964",race:"\u223d\u0331",racute:"\u0155",radic:"\u221a",raemptyv:"\u29b3",rang:"\u27e9",rangd:"\u2992",range:"\u29a5",rangle:"\u27e9",raquo:"\xbb",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21e5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291e",rarrhk:"\u21aa",rarrlp:"\u21ac",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21a3",rarrw:"\u219d",ratail:"\u291a",ratio:"\u2236",rationals:"\u211a",rbarr:"\u290d",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298c",rbrksld:"\u298e",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201d",rdquor:"\u201d",rdsh:"\u21b3",real:"\u211c",realine:"\u211b",realpart:"\u211c",reals:"\u211d",rect:"\u25ad",reg:"\xae",rfisht:"\u297d",rfloor:"\u230b",rfr:"\ud835\udd2f",rhard:"\u21c1",rharu:"\u21c0",rharul:"\u296c",rho:"\u03c1",rhov:"\u03f1",rightarrow:"\u2192",rightarrowtail:"\u21a3",rightharpoondown:"\u21c1",rightharpoonup:"\u21c0",rightleftarrows:"\u21c4",rightleftharpoons:"\u21cc",rightrightarrows:"\u21c9",rightsquigarrow:"\u219d",rightthreetimes:"\u22cc",ring:"\u02da",risingdotseq:"\u2253",rlarr:"\u21c4",rlhar:"\u21cc",rlm:"\u200f",rmoust:"\u23b1",rmoustache:"\u23b1",rnmid:"\u2aee",roang:"\u27ed",roarr:"\u21fe",robrk:"\u27e7",ropar:"\u2986",ropf:"\ud835\udd63",roplus:"\u2a2e",rotimes:"\u2a35",rpar:")",rpargt:"\u2994",rppolint:"\u2a12",rrarr:"\u21c9",rsaquo:"\u203a",rscr:"\ud835\udcc7",rsh:"\u21b1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22cc",rtimes:"\u22ca",rtri:"\u25b9",rtrie:"\u22b5",rtrif:"\u25b8",rtriltri:"\u29ce",ruluhar:"\u2968",rx:"\u211e",sacute:"\u015b",sbquo:"\u201a",sc:"\u227b",scE:"\u2ab4",scap:"\u2ab8",scaron:"\u0161",sccue:"\u227d",sce:"\u2ab0",scedil:"\u015f",scirc:"\u015d",scnE:"\u2ab6",scnap:"\u2aba",scnsim:"\u22e9",scpolint:"\u2a13",scsim:"\u227f",scy:"\u0441",sdot:"\u22c5",sdotb:"\u22a1",sdote:"\u2a66",seArr:"\u21d8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xa7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\ud835\udd30",sfrown:"\u2322",sharp:"\u266f",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xad",sigma:"\u03c3",sigmaf:"\u03c2",sigmav:"\u03c2",sim:"\u223c",simdot:"\u2a6a",sime:"\u2243",simeq:"\u2243",simg:"\u2a9e",simgE:"\u2aa0",siml:"\u2a9d",simlE:"\u2a9f",simne:"\u2246",simplus:"\u2a24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2a33",smeparsl:"\u29e4",smid:"\u2223",smile:"\u2323",smt:"\u2aaa",smte:"\u2aac",smtes:"\u2aac\ufe00",softcy:"\u044c",sol:"/",solb:"\u29c4",solbar:"\u233f",sopf:"\ud835\udd64",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\ufe00",sqcup:"\u2294",sqcups:"\u2294\ufe00",sqsub:"\u228f",sqsube:"\u2291",sqsubset:"\u228f",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25a1",square:"\u25a1",squarf:"\u25aa",squf:"\u25aa",srarr:"\u2192",sscr:"\ud835\udcc8",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22c6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03f5",straightphi:"\u03d5",strns:"\xaf",sub:"\u2282",subE:"\u2ac5",subdot:"\u2abd",sube:"\u2286",subedot:"\u2ac3",submult:"\u2ac1",subnE:"\u2acb",subne:"\u228a",subplus:"\u2abf",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2ac5",subsetneq:"\u228a",subsetneqq:"\u2acb",subsim:"\u2ac7",subsub:"\u2ad5",subsup:"\u2ad3",succ:"\u227b",succapprox:"\u2ab8",succcurlyeq:"\u227d",succeq:"\u2ab0",succnapprox:"\u2aba",succneqq:"\u2ab6",succnsim:"\u22e9",succsim:"\u227f",sum:"\u2211",sung:"\u266a",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",sup:"\u2283",supE:"\u2ac6",supdot:"\u2abe",supdsub:"\u2ad8",supe:"\u2287",supedot:"\u2ac4",suphsol:"\u27c9",suphsub:"\u2ad7",suplarr:"\u297b",supmult:"\u2ac2",supnE:"\u2acc",supne:"\u228b",supplus:"\u2ac0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2ac6",supsetneq:"\u228b",supsetneqq:"\u2acc",supsim:"\u2ac8",supsub:"\u2ad4",supsup:"\u2ad6",swArr:"\u21d9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292a",szlig:"\xdf",target:"\u2316",tau:"\u03c4",tbrk:"\u23b4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20db",telrec:"\u2315",tfr:"\ud835\udd31",there4:"\u2234",therefore:"\u2234",theta:"\u03b8",thetasym:"\u03d1",thetav:"\u03d1",thickapprox:"\u2248",thicksim:"\u223c",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223c",thorn:"\xfe",tilde:"\u02dc",times:"\xd7",timesb:"\u22a0",timesbar:"\u2a31",timesd:"\u2a30",tint:"\u222d",toea:"\u2928",top:"\u22a4",topbot:"\u2336",topcir:"\u2af1",topf:"\ud835\udd65",topfork:"\u2ada",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25b5",triangledown:"\u25bf",triangleleft:"\u25c3",trianglelefteq:"\u22b4",triangleq:"\u225c",triangleright:"\u25b9",trianglerighteq:"\u22b5",tridot:"\u25ec",trie:"\u225c",triminus:"\u2a3a",triplus:"\u2a39",trisb:"\u29cd",tritime:"\u2a3b",trpezium:"\u23e2",tscr:"\ud835\udcc9",tscy:"\u0446",tshcy:"\u045b",tstrok:"\u0167",twixt:"\u226c",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",uArr:"\u21d1",uHar:"\u2963",uacute:"\xfa",uarr:"\u2191",ubrcy:"\u045e",ubreve:"\u016d",ucirc:"\xfb",ucy:"\u0443",udarr:"\u21c5",udblac:"\u0171",udhar:"\u296e",ufisht:"\u297e",ufr:"\ud835\udd32",ugrave:"\xf9",uharl:"\u21bf",uharr:"\u21be",uhblk:"\u2580",ulcorn:"\u231c",ulcorner:"\u231c",ulcrop:"\u230f",ultri:"\u25f8",umacr:"\u016b",uml:"\xa8",uogon:"\u0173",uopf:"\ud835\udd66",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21bf",upharpoonright:"\u21be",uplus:"\u228e",upsi:"\u03c5",upsih:"\u03d2",upsilon:"\u03c5",upuparrows:"\u21c8",urcorn:"\u231d",urcorner:"\u231d",urcrop:"\u230e",uring:"\u016f",urtri:"\u25f9",uscr:"\ud835\udcca",utdot:"\u22f0",utilde:"\u0169",utri:"\u25b5",utrif:"\u25b4",uuarr:"\u21c8",uuml:"\xfc",uwangle:"\u29a7",vArr:"\u21d5",vBar:"\u2ae8",vBarv:"\u2ae9",vDash:"\u22a8",vangrt:"\u299c",varepsilon:"\u03f5",varkappa:"\u03f0",varnothing:"\u2205",varphi:"\u03d5",varpi:"\u03d6",varpropto:"\u221d",varr:"\u2195",varrho:"\u03f1",varsigma:"\u03c2",varsubsetneq:"\u228a\ufe00",varsubsetneqq:"\u2acb\ufe00",varsupsetneq:"\u228b\ufe00",varsupsetneqq:"\u2acc\ufe00",vartheta:"\u03d1",vartriangleleft:"\u22b2",vartriangleright:"\u22b3",vcy:"\u0432",vdash:"\u22a2",vee:"\u2228",veebar:"\u22bb",veeeq:"\u225a",vellip:"\u22ee",verbar:"|",vert:"|",vfr:"\ud835\udd33",vltri:"\u22b2",vnsub:"\u2282\u20d2",vnsup:"\u2283\u20d2",vopf:"\ud835\udd67",vprop:"\u221d",vrtri:"\u22b3",vscr:"\ud835\udccb",vsubnE:"\u2acb\ufe00",vsubne:"\u228a\ufe00",vsupnE:"\u2acc\ufe00",vsupne:"\u228b\ufe00",vzigzag:"\u299a",wcirc:"\u0175",wedbar:"\u2a5f",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\ud835\udd34",wopf:"\ud835\udd68",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\ud835\udccc",xcap:"\u22c2",xcirc:"\u25ef",xcup:"\u22c3",xdtri:"\u25bd",xfr:"\ud835\udd35",xhArr:"\u27fa",xharr:"\u27f7",xi:"\u03be",xlArr:"\u27f8",xlarr:"\u27f5",xmap:"\u27fc",xnis:"\u22fb",xodot:"\u2a00",xopf:"\ud835\udd69",xoplus:"\u2a01",xotime:"\u2a02",xrArr:"\u27f9",xrarr:"\u27f6",xscr:"\ud835\udccd",xsqcup:"\u2a06",xuplus:"\u2a04",xutri:"\u25b3",xvee:"\u22c1",xwedge:"\u22c0",yacute:"\xfd",yacy:"\u044f",ycirc:"\u0177",ycy:"\u044b",yen:"\xa5",yfr:"\ud835\udd36",yicy:"\u0457",yopf:"\ud835\udd6a",yscr:"\ud835\udcce",yucy:"\u044e",yuml:"\xff",zacute:"\u017a",zcaron:"\u017e",zcy:"\u0437",zdot:"\u017c",zeetrf:"\u2128",zeta:"\u03b6",zfr:"\ud835\udd37",zhcy:"\u0436",zigrarr:"\u21dd",zopf:"\ud835\udd6b",zscr:"\ud835\udccf",zwj:"\u200d",zwnj:"\u200c"},Rj={}.hasOwnProperty;function Hj(e){return!!Rj.call(Pj,e)&&Pj[e]}var Fj=String.fromCharCode,Vj=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function zj(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o="string"===typeof r.additional?r.additional.charCodeAt(0):r.additional,i=[],a=0,s=-1,l="";r.position&&("start"in r.position||"indent"in r.position?(n=r.position.indent,t=r.position.start):t=r.position);var u,c=(t?t.line:0)||1,d=(t?t.column:0)||1,f=N();for(a--;++a<=e.length;)if(10===u&&(d=(n?n[s]:0)||1),38===(u=e.charCodeAt(a))){var p=e.charCodeAt(a+1);if(9===p||10===p||12===p||32===p||38===p||60===p||Number.isNaN(p)||o&&p===o){l+=Fj(u),d++;continue}var h=a+1,m=h,v=h,g=void 0;if(35===p){v=++m;var y=e.charCodeAt(v);88===y||120===y?(g="hexadecimal",v=++m):g="decimal"}else g="named";var b="",w="",k="",x="named"===g?Nj:"decimal"===g?Tj:Lj;for(v--;++v<=e.length;){var O=e.charCodeAt(v);if(!x(O))break;k+=Fj(O),"named"===g&&Ej.includes(k)&&(b=k,w=Hj(k))}var S=59===e.charCodeAt(v);if(S){v++;var C="named"===g&&Hj(k);C&&(b=k,w=C)}var j=1+v-h,D="";if(S||!1!==r.nonTerminated)if(k)if("named"===g){if(S&&!w)P(5,1);else if(b!==k&&(j=1+(v=m+b.length)-m,S=!1),!S){var A=b?1:3;if(r.attribute){var E=e.charCodeAt(v);61===E?(P(A,j),w=""):Nj(E)?w="":P(A,j)}else P(A,j)}D=w}else{S||P(2,j);var M=Number.parseInt(k,"hexadecimal"===g?16:10);if(Bj(M))P(7,j),D=Fj(65533);else if(M in Mj)P(6,j),D=Mj[M];else{var T="";_j(M)&&P(6,j),M>65535&&(T+=Fj((M-=65536)>>>10|55296),M=56320|1023&M),D=T+Fj(M)}}else"named"!==g&&P(4,j);else;if(D){R(),f=N(),a=v-1,d+=v-h+1,i.push(D);var L=N();L.offset++,r.reference&&r.reference.call(r.referenceContext,D,{start:f,end:L},e.slice(h-1,v)),f=L}else k=e.slice(h-1,v),l+=k,d+=k.length,a=v-1}else 10===u&&(c++,s++,d=0),Number.isNaN(u)?R():(l+=Fj(u),d++);return i.join("");function N(){return{line:c,column:d,offset:a+((t?t.offset:0)||0)}}function P(e,t){var n;r.warning&&((n=N()).column+=t,n.offset+=t,r.warning.call(r.warningContext,Vj[e],n,e))}function R(){l&&(i.push(l),r.text&&r.text.call(r.textContext,l,{start:f,end:N()}),l="")}}function Bj(e){return e>=55296&&e<=57343||e>1114111}function _j(e){return e>=1&&e<=8||11===e||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||65535===(65535&e)||65534===(65535&e)}var Ij=0,$j={},qj={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Ij}),e.__id},clone:function e(t,n){var r,o;switch(n=n||{},qj.util.type(t)){case"Object":if(o=qj.util.objId(t),n[o])return n[o];for(var i in r={},n[o]=r,t)t.hasOwnProperty(i)&&(r[i]=e(t[i],n));return r;case"Array":return o=qj.util.objId(t),n[o]?n[o]:(r=[],n[o]=r,t.forEach((function(t,o){r[o]=e(t,n)})),r);default:return t}}},languages:{plain:$j,plaintext:$j,text:$j,txt:$j,extend:function(e,t){var n=qj.util.clone(qj.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var o=(r=r||qj.languages)[e],i={};for(var a in o)if(o.hasOwnProperty(a)){if(a==t)for(var s in n)n.hasOwnProperty(s)&&(i[s]=n[s]);n.hasOwnProperty(a)||(i[a]=o[a])}var l=r[e];return r[e]=i,qj.languages.DFS(qj.languages,(function(t,n){n===l&&t!=e&&(this[t]=i)})),i},DFS:function e(t,n,r,o){o=o||{};var i=qj.util.objId;for(var a in t)if(t.hasOwnProperty(a)){n.call(t,a,t[a],r||a);var s=t[a],l=qj.util.type(s);"Object"!==l||o[i(s)]?"Array"!==l||o[i(s)]||(o[i(s)]=!0,e(s,n,a,o)):(o[i(s)]=!0,e(s,n,null,o))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(qj.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=qj.tokenize(r.code,r.grammar),qj.hooks.run("after-tokenize",r),Wj.stringify(qj.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var o=new Gj;return Jj(o,o.head,e),Kj(e,o,t,o.head,0),function(e){var t=[],n=e.head.next;for(;n!==e.tail;)t.push(n.value),n=n.next;return t}(o)},hooks:{all:{},add:function(e,t){var n=qj.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=qj.hooks.all[e];if(n&&n.length)for(var r,o=0;r=n[o++];)r(t)}},Token:Wj};function Wj(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function Uj(e,t,n,r){e.lastIndex=t;var o=e.exec(n);if(o&&r&&o[1]){var i=o[1].length;o.index+=i,o[0]=o[0].slice(i)}return o}function Kj(e,t,n,r,o,i){for(var a in n)if(n.hasOwnProperty(a)&&n[a]){var s=n[a];s=Array.isArray(s)?s:[s];for(var l=0;l=i.reach);g+=v.value.length,v=v.next){var y=v.value;if(t.length>e.length)return;if(!(y instanceof Wj)){var b,w=1;if(f){if(!(b=Uj(m,g,e,d))||b.index>=e.length)break;var k=b.index,x=b.index+b[0].length,O=g;for(O+=v.value.length;k>=O;)O+=(v=v.next).value.length;if(g=O-=v.value.length,v.value instanceof Wj)continue;for(var S=v;S!==t.tail&&(Oi.reach&&(i.reach=A);var E=v.prev;if(j&&(E=Jj(t,E,j),g+=j.length),Yj(t,E,w),v=Jj(t,E,new Wj(a,c?qj.tokenize(C,c):C,p,C)),D&&Jj(t,v,D),w>1){var M={cause:a+","+l,reach:A};Kj(e,t,n,v.prev,g,M),i&&M.reach>i.reach&&(i.reach=M.reach)}}}}}}function Gj(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function Jj(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function Yj(e,t,n){for(var r=t.next,o=0;o-1||(null===(n=e.alias)||void 0===n?void 0:n.some((function(e){return e.toLowerCase().indexOf(t)>-1})))})))}}),Object(Cd.jsx)(af.Flex,Object.assign({sx:{flexDirection:"column",pt:1,mt:1}},{children:a.map((function(e){return Object(Cd.jsxs)(yf,Object.assign({variant:"menuitem",sx:{textAlign:"left",py:1,display:"flex",justifyContent:"space-between",alignItems:"center"},onClick:function(){return t(e.filename)}},{children:[Object(Cd.jsx)(lf,Object.assign({variant:"body"},{children:e.title})),n===e.filename?Object(Cd.jsx)(mf,{path:vf.check,size:"small"}):e.alias?Object(Cd.jsx)(lf,Object.assign({variant:"subBody",sx:{fontSize:"10px"}},{children:e.alias.slice(0,3).join(", ")})):null]}),e.title)}))}))]}))}))}function iD(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.reduce((function(e,n){if("comment"===n.type||"doctype"===n.type)return e;var r=Object(l.a)(t);return"element"===n.type&&n.properties?r.push.apply(r,Object(l.a)(n.properties.className)):r.push("token","text"),"element"===n.type?e.push.apply(e,Object(l.a)(iD(n.children,r))):e.push({classes:r,text:n.value}),e}),[])}function aD(e,t,n,r){var o=String(n).length,i={class:"line-number ".concat(r?"active":""),"data-line":String(t).padEnd(o," ")},a={line:t,active:r,total:n,from:e};return zu.inline(e,e+1,i,a)}function sD(e){var t=e.doc,n=e.name,r=e.defaultLanguage,o=e.caretPosition,i=[],a=eD.listLanguages();return To(t,(function(e){return e.type.name===n})).forEach((function(e){var t,n=e.node.textContent,s=OD(n,e.pos),l=Object(Sd.a)(s||[]);try{for(l.s();!(t=l.n()).done;){var u=t.value,c=u.index+1,d=c===(null===o||void 0===o?void 0:o.line)&&u.from===(null===o||void 0===o?void 0:o.from),f=aD(u.from,c,(null===s||void 0===s?void 0:s.length)||0,d);i.push(f)}}catch(v){l.e(v)}finally{l.f()}var p=e.node.attrs.language||r,h=a.includes(p)?eD.highlight(n,p).children||[]:null;if(h){var m=e.pos+1;iD(h).forEach((function(e){var t=m+e.text.length;if(e.classes.length){var n=zu.inline(m,t,{class:e.classes.join(" ")});i.push(n)}m=t}))}})),Iu.create(t,i)}function lD(e){var t=e.name,n=e.defaultLanguage,r=new p.PluginKey("highlighter");return new p.Plugin({key:r,state:{init:function(e,r){return sD({doc:r.doc,name:t,defaultLanguage:n})},apply:function(e,r,o,i){var a=o.selection.$head.parent.type.name,s=i.selection.$head.parent.type.name,l=To(o.doc,(function(e){return e.type.name===t})),u=To(i.doc,(function(e){return e.type.name===t})),c=xD(i.selection);return e.docChanged&&([a,s].includes(t)||u.length!==l.length||e.steps.some((function(e){return void 0!==e.from&&void 0!==e.to&&l.some((function(t){return t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to}))})))?sD({doc:e.doc,name:t,defaultLanguage:n,caretPosition:c}):(r=function(e,t,n){var r=t.find(void 0,void 0,(function(e){var t=e.line,r=e.active,o=e.from;return!!n&&(t===n.line&&o===n.from)||r}));if(!r.length)return t;var o=r.slice();t=t.remove(r);var i,a=[],s=Object(Sd.a)(o);try{for(s.s();!(i=s.n()).done;){var l=i.value,u=l.from,c=l.spec,d=c.line,f=c.total,p=d===(null===n||void 0===n?void 0:n.line),h=aD(u,d,(null===n||void 0===n?void 0:n.total)||f,p);a.push(h)}}catch(m){s.e(m)}finally{s.f()}return t.add(e,a)}(e.doc,r,c),r.map(e.mapping,e.doc))}},props:{decorations:function(e){return r.getState(e)}},appendTransaction:function(e,n,r){var o=r.tr,i=!1,a=e.some((function(e){return e.docChanged})),s=(r.selection.$from.parent.type.name===t||n.selection.$from.parent.type.name===t)&&n.selection.$from.pos!==r.selection.$from.pos;return To(r.doc,(function(e){return e.type.name===t})).forEach((function(e){var t,n=e.node,l=e.pos,u=Object.assign({},n.attrs);if(a||!(null===(t=u.lines)||void 0===t?void 0:t.length)){var c=OD(n.textContent,l);u.lines=c.slice()}if(s){var d=xD(r.selection,a?OD(n.textContent,l):void 0);u.caretPosition=d}(a||s)&&(o.setNodeMarkup(l,n.type,u),i=!0)})),i?o:null}})}var uD=/^(?:( )+|\t+)/,cD="space";function dD(e,t){var n,r,o,i=new Map,a=0,s=Object(Sd.a)(e.split(/\n/g));try{for(s.s();!(o=s.n()).done;){var l=o.value;if(l){var u=void 0,c=void 0,d=void 0,f=void 0,p=l.match(uD);if(null===p)a=0,n="";else{if(u=p[0].length,c=p[1]?cD:"tab",t&&c===cD&&1===u)continue;c!==n&&(a=0),n=c,d=0;var h=u-a;if(a=u,0===h)d++;else r=fD(c,h>0?h:-h);f=void 0===(f=i.get(r))?[1,0]:[++f[0],f[1]+d],i.set(r,f)}}}}catch(m){s.e(m)}finally{s.f()}return i}function fD(e,t){return(e===cD?"s":"t")+String(t)}function pD(e){if("string"!==typeof e)throw new TypeError("Expected a string");var t=dD(e,!0);0===t.size&&(t=dD(e,!1));var n,r,o=function(e){var t,n,r=0,o=0,i=Object(Sd.a)(e);try{for(i.s();!(n=i.n()).done;){var a=Object(u.a)(n.value,2),s=a[0],l=Object(u.a)(a[1],2),c=l[0],d=l[1];(c>r||c===r&&d>o)&&(r=c,o=d,t=s)}}catch(f){i.e(f)}finally{i.f()}return t}(t),i=0,a="";if(void 0!==o){var s={type:"s"===(r=o)[0]?cD:"tab",amount:Number(r.slice(1))};a=function(e,t){return(e===cD?" ":"\t").repeat(t)}(n=s.type,i=s.amount)}return{amount:i,type:n,indent:a}}var hD=n(62),mD=n.n(hD);function vD(e){var t=mD()(e);if(0===t)return e;var n=new RegExp("^[ \\t]{".concat(t,"}"),"gm");return e.replace(n,"")}function gD(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.indent,o=void 0===r?" ":r,i=n.includeEmptyLines,a=void 0!==i&&i;if("string"!==typeof e)throw new TypeError("Expected `input` to be a `string`, got `".concat(typeof e,"`"));if("number"!==typeof t)throw new TypeError("Expected `count` to be a `number`, got `".concat(typeof t,"`"));if(t<0)throw new RangeError("Expected `count` to be at least 0, got `".concat(t,"`"));if("string"!==typeof o)throw new TypeError("Expected `options.indent` to be a `string`, got `".concat(typeof o,"`"));if(0===t)return e;var s=a?/^/gm:/^(?!\s*$)/gm;return e.replace(s,o.repeat(t))}function yD(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return gD(vD(e),t,n)}var bD=/^```([a-z]+)?[\s\n]$/,wD=/^~~~([a-z]+)?[\s\n]$/,kD=Bo.create({name:"codeblock",addOptions:function(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes:function(){var e=this;return{caretPosition:{default:void 0,rendered:!1},lines:{default:[],rendered:!1},indentType:{default:"space",parseHTML:function(e){return e.dataset.indentType},renderHTML:function(e){return e.indentType?{"data-indent-type":e.indentType}:{}}},indentLength:{default:2,parseHTML:function(e){return e.dataset.indentLength},renderHTML:function(e){return e.indentLength?{"data-indent-length":e.indentLength}:{}}},language:{default:null,parseHTML:function(t){var n,r=e.options.languageClassPrefix,o=[].concat(Object(l.a)(t.classList||[]),Object(l.a)((null===(n=null===t||void 0===t?void 0:t.firstElementChild)||void 0===n?void 0:n.classList)||[])).filter((function(e){return e.startsWith(r)})).map((function(e){return e.replace(r,"")}))[0];return o||null},renderHTML:function(e){return e.language?{class:"language-".concat(e.language)}:{}}}}},parseHTML:function(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["pre",Sr(this.options.HTMLAttributes,t),["code",{},0]]},addCommands:function(){var e=this;return{setCodeBlock:function(t){return function(n){return n.commands.setNode(e.name,t)}},toggleCodeBlock:function(t){return function(n){var r=n.commands;return console.log("TOGGLING!"),r.toggleNode(e.name,"paragraph",t)}},changeCodeBlockIndentation:function(t){return function(n){var r=n.editor,o=n.tr,i=n.commands,a=r.state.selection.$from;if(a.parent.type!==e.type)return!1;var s,l=a.parent.attrs.lines,u=Object(Sd.a)(l);try{for(u.s();!(s=u.n()).done;){var c=s.value,d=c.text(),f=d.length-d.trimStart().length;if(f){var p=f,h=DD({type:t.type,amount:p});o.insertText(h,o.mapping.map(c.from),o.mapping.map(c.from+f))}}}catch(m){u.e(m)}finally{u.f()}return i.updateAttributes(e.type,{indentType:t.type,indentLength:t.amount}),!0}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Alt-c":function(){return e.editor.commands.toggleCodeBlock()},"Mod-a":function(t){var n=t.editor,r=e.editor.state.selection.$anchor;if(r.parent.type.name!==e.name)return!1;var o=ho(r,(function(t){return t.type.name===e.type.name}));return!!o&&n.commands.setTextSelection({from:o.pos+1,to:o.pos+o.node.nodeSize-1})},Backspace:function(){var t=e.editor.state.selection,n=t.empty,r=t.$anchor,o=r.parent,i=e.editor.state.doc.nodeAt(r.pos+1),a=function(t){return t&&t.type.name===e.name},s=1===r.pos;return!!n&&(s||a(o)&&!o.textContent.length?e.editor.commands.deleteNode(e.type):!(!i||!a(i)||i.textContent.length)&&e.editor.commands.command((function(e){return e.tr.delete(r.pos+1,r.pos+1+i.nodeSize),!0})))},Enter:function(t){var n=t.editor,r=n.state.selection,o=r.$from;if(!r.empty||o.parent.type!==e.type)return!1;var i=CD(o.parent);return e.options.exitOnTripleEnter&&function(e,t){var n=t.parentOffset===t.parent.nodeSize-2,r=t.parent.textContent.endsWith("\n\n");if(!n||!r)return!1;return e.chain().command((function(e){return e.tr.delete(t.pos-2,t.pos),!0})).exitCode().run()}(n,o)||function(e,t,n){var r=function(e,t){var n=function(e,t){return e.find((function(e){return t>=e.from&&t<=e.to}))}(e.parent.attrs.lines,e.pos);if(!n)return!1;var r=n.text(),o=r.length-r.trimStart().length;return{newline:"\n",indentation:DD({amount:o,type:t.type})}}(t,n)||{},o=r.indentation,i=r.newline;return!!i&&e.chain().insertContent("".concat(i).concat(o),{parseOptions:{preserveWhitespace:"full"}}).focus().run()}(n,o,i)},ArrowUp:function(t){var n=t.editor;if(!e.options.exitOnArrowUp)return!1;var r=n.state.selection,o=r.$anchor;return!(!r.empty||o.parent.type!==e.type)&&(!(1!==o.pos)&&n.commands.insertContentAt(0,"

"))},ArrowDown:function(t){var n=t.editor;if(!e.options.exitOnArrowDown)return!1;var r=n.state,o=r.selection,i=r.doc,a=o.$from;if(!o.empty||a.parent.type!==e.type)return!1;if(!(a.parentOffset===a.parent.nodeSize-2))return!1;var s=a.after();return void 0!==s&&(i.nodeAt(s)?(n.commands.setNodeSelection(a.before()),!1):n.commands.exitCode())},"Shift-Tab":function(t){var n=t.editor,r=n.state.selection,o=r.$from;if(o.parent.type!==e.type)return!1;var i=CD(o.parent),a=DD(i),s=SD(o.parent.attrs.lines,r);return n.chain().command((function(e){return AD(e.tr,(function(e){var t,n=Object(Sd.a)(s);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.text(a.length)===a&&e.delete(e.mapping.map(r.from),e.mapping.map(r.from+i.amount))}}catch(o){n.e(o)}finally{n.f()}}))})).run()},Tab:function(t){var n=t.editor,r=n.state.selection,o=r.$from;if(o.parent.type!==e.type)return!1;var i=SD(o.parent.attrs.lines,r);return n.chain().command((function(e){return AD(e.tr,(function(e){var t=DD(CD(o.parent));if(1===i.length)return e.insertText(t,o.pos);var n,r=Object(Sd.a)(i);try{for(r.s();!(n=r.n()).done;){var a=n.value;e.insertText(t,e.mapping.map(a.from))}}catch(s){r.e(s)}finally{r.f()}}))})).run()}}},addInputRules:function(){return[Fo({find:bD,type:this.type,getAttributes:function(e){return{language:e[1]}}}),Fo({find:wD,type:this.type,getAttributes:function(e){return{language:e[1]}}})]},addProseMirrorPlugins:function(){var e=this;return[new p.Plugin({key:new p.PluginKey("codeBlockVSCodeHandler"),props:{handlePaste:function(t,n){if(!n.clipboardData)return!1;var r=n.clipboardData.getData("text/plain"),o=n.clipboardData.getData("vscode-editor-data"),i=o?JSON.parse(o):void 0,a=null===i||void 0===i?void 0:i.mode;if(!r||!a)return!1;var s=function(e,t){var n=t||pD(e),r=n.amount,o=n.type,i=void 0===o?"space":o;return{code:vD(yD(e,r,{includeEmptyLines:!1,indent:"space"===i?" ":"\t"})),amount:r,type:i}}(r,CD(t.state.selection.$from.parent)),l=t.state.tr;return e.editor.isActive(e.type.name)||l.replaceSelectionWith(e.type.create({language:a,indentType:s.type,indentLength:s.amount})),l.insertText(s.code.replace(/\r\n?/g,"\n")),l.setMeta("paste",!0),t.dispatch(l),!0}}}),lD({name:this.name,defaultLanguage:"txt"})]},addNodeView:function(){return Id(rD,{contentDOMFactory:function(){var e=document.createElement("div");return e.classList.add("node-content-wrapper"),e.style.whiteSpace="inherit",e.style.minWidth="20px",{dom:e}},shouldUpdate:function(e,t){var n=e.attrs,r=t.attrs;return function(e,t){return void 0===t||(null===e||void 0===e?void 0:e.column)!==(null===t||void 0===t?void 0:t.column)||(null===e||void 0===e?void 0:e.line)!==(null===t||void 0===t?void 0:t.line)}(n.caretPosition,r.caretPosition)||n.language!==r.language||n.indentType!==r.indentType}})}});function xD(e,t){var n=e.$from,r=e.$to,o=e.$head;if(n.parent.type.name===kD.name){t=t||(n.parent.attrs.lines||[]);var i,a=Object(Sd.a)(t);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(o.pos>=s.from&&o.pos<=s.to){var l=s.length+1;return{line:s.index+1,column:l-(s.to-o.pos),selected:r.pos-n.pos,total:t.length,from:s.from}}}}catch(u){a.e(u)}finally{a.f()}}}function OD(e,t){for(var n=[],r=0,o=t+1,i=0,a=function(){var t=e.indexOf("\n",r);t<=-1&&(t=e.length);var a=t-r,s=o+a,l=r;n.push({index:i,length:a,from:o,to:s,text:function(t){return e.slice(l,t?l+t:l+a)}}),o=s+1,r=t+1,++i};r<=e.length;)a();return n}function SD(e,t){var n=t.$from,r=t.$to;return e.filter((function(e){return jD(e.from,n.pos,r.pos)||jD(e.to,n.pos,r.pos)||jD(n.pos,e.from,e.to)}))}function CD(e){if(e.type.name===kD.name){var t=e.attrs,n=t.indentType,r=t.indentLength;return{type:n,amount:parseInt(r)}}}function jD(e,t,n){return e>=t&&e<=n}function DD(e){return("space"===e.type?" ":"\t").repeat(e.amount)}function AD(e,t){var n=e.selection,r=n.$anchor,o=n.$head;return t(e),e.setSelection(new p.TextSelection(e.doc.resolve(e.mapping.map(r.pos)),e.doc.resolve(e.mapping.map(o.pos)))),!0}var ED=Qc.extend({addKeyboardShortcuts:function(){var e,t=this;return Object.assign(Object.assign({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{Tab:function(e){var n,r;return"codeblock"!==e.editor.state.selection.$from.parent.type.name&&((null===(r=null===(n=t.parent)||void 0===n?void 0:n.call(t))||void 0===r?void 0:r.Tab(e))||!1)},Backspace:function(e){return wC(e.editor,t.name,t.type)}})}});function MD(e){var t,n,r=e.editor,o=(e.updateAttributes,e.node),i=e.getPos,a=e.forwardRef,s=Fd(),l=(null===(t=o.lastChild)||void 0===t?void 0:t.type.name)===RD.name,c=l&&(null===(n=o.lastChild)||void 0===n?void 0:n.attrs.collapsed),d=function(){var e=To(o,(function(e){return e.type.name===RD.name})),t=Object(u.a)(e,1)[0];if(t){var n=t.pos;r.commands.toggleOutlineCollapse(n+i()+1,!c)}};return Object(Cd.jsxs)(af.Flex,{children:[Object(Cd.jsxs)(af.Flex,Object.assign({className:"outline",sx:{flexDirection:"column",alignItems:"center",mt:s?"0px":"3px"}},{children:[l?Object(Cd.jsx)(mf,{path:c?vf.chevronRight:vf.chevronDown,title:c?"Click to uncollapse list":"Click to collapse list",sx:{cursor:"pointer",transition:"all .2s ease-in-out",":hover":{transform:["unset","scale(1.3)"]},":active":{transform:["scale(1.3)","unset"]},".icon:hover path":{fill:"var(--checked) !important"}},size:s?24:18,onMouseDown:function(e){return e.preventDefault()},onTouchEnd:function(e){e.preventDefault(),d()},onClick:d}):Object(Cd.jsx)(mf,{path:vf.circle,size:s?24:18,sx:{transform:"scale(0.4)"}}),l&&!c&&Object(Cd.jsx)(af.Box,{sx:{flex:1,width:1,mt:2,backgroundColor:"border",borderRadius:50,flexShrink:0,cursor:"pointer",transition:"all .2s ease-in-out",":hover":{backgroundColor:"fontTertiary",width:4}},contentEditable:!1})]})),Object(Cd.jsx)(lf,{ref:a,sx:{pl:1,listStyleType:"none",flex:1}})]})}var TD=Bo.create({name:"outlineListItem",addOptions:function(){return{HTMLAttributes:{}}},content:"heading* paragraph block*",defining:!0,parseHTML:function(){return[{tag:'li[data-type="'.concat(this.name,'"]')}]},renderHTML:function(e){var t=e.HTMLAttributes;return["li",Sr(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addKeyboardShortcuts:function(){var e=this;return{"Mod-Space":function(t){var n=function(e,t){var n,r,o=e.state.selection.$from,i=Object(AS.findParentNodeOfTypeClosestToPos)(o,t);if(!i)return!1;var a=To(i.node,(function(e){return e.type.name===RD.name})),s=Object(u.a)(a,1)[0];if(!s)return!1;var l=(null===(n=null===s||void 0===s?void 0:s.node)||void 0===n?void 0:n.type.name)===RD.name,c=null===(r=null===s||void 0===s?void 0:s.node)||void 0===r?void 0:r.attrs.collapsed,d=i.pos+s.pos+1;return{isCollapsed:c,isNested:l,subListPos:d}}(t.editor,e.type);if(!n)return!1;var r=n.isCollapsed,o=n.subListPos;return e.editor.commands.toggleOutlineCollapse(o,!r)},Enter:function(t){t.editor;return e.editor.commands.splitListItem(e.name)},Tab:function(){return e.editor.commands.sinkListItem(e.name)},"Shift-Tab":function(){return e.editor.commands.liftListItem(e.name)},Backspace:function(t){return wC(t.editor,e.name,e.type)}}},addCommands:function(){return{toggleOutlineCollapse:function(e,t){return function(n){return n.tr.setNodeMarkup(e,void 0,{collapsed:t}),!0}}}},addNodeView:function(){return Id(MD,{contentDOMFactory:!0,wrapperFactory:function(){return document.createElement("li")}})}});function LD(e){var t=e.editor,n=e.getPos,r=e.node,o=(e.updateAttributes,e.forwardRef),i=r.attrs.collapsed,a=Object(jd.useMemo)((function(){var e;return(null===(e=t.state.doc.resolve(n()).parent)||void 0===e?void 0:e.type.name)===TD.name}),[]);return Object(Cd.jsx)(Cd.Fragment,{children:Object(Cd.jsx)(lf,{className:"outline-list",as:"div",ref:o,sx:{ul:{display:i?"none":"block",paddingInlineStart:0,paddingLeft:0,marginBlockStart:a?5:0,marginBlockEnd:0},li:{listStyleType:"none"}}})})}var ND=/^\s*(-o)\s$/,PD="outlineListItem",RD=Bo.create({name:"outlineList",addOptions:function(){return{HTMLAttributes:{}}},addAttributes:function(){return{collapsed:{default:!1,keepOnSplit:!1,parseHTML:function(e){return"true"===e.dataset.collapsed},renderHTML:function(e){return{"data-collapsed":!0===e.collapsed}}}}},group:"block list",content:"".concat(PD,"+"),parseHTML:function(){return[{tag:'ul[data-type="'.concat(this.name,'"]'),priority:52}]},renderHTML:function(e){var t=e.HTMLAttributes;return["ul",Sr(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands:function(){var e=this;return{toggleOutlineList:function(){return function(t){return t.commands.toggleList(e.name,PD)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-O":function(){return e.editor.commands.toggleOutlineList()}}},addInputRules:function(){return[Vo({find:ND,type:this.type})]},addNodeView:function(){var e=this;return Id(LD,{contentDOMFactory:function(){var t=document.createElement("ul");return t.classList.add("".concat(e.name.toLowerCase(),"-content-wrapper")),t.style.whiteSpace="inherit",{dom:t}}})}});function HD(e,t,n,r,o,i){for(var a=0,s=!0,l=t.firstChild,u=e.firstChild,c=0,d=0;c0&&void 0!==arguments[0]?arguments[0]:{},t=e.rows,n=void 0===t?3:t,r=e.cols,o=void 0===r?3:r,i=e.withHeaderRow,a=void 0===i||i;return function(e){var t=e.tr,r=e.dispatch,i=zD(e.editor.schema,n,o,a);if(r){var s=t.selection.anchor+1;t.replaceSelectionWith(i).scrollIntoView().setSelection(p.TextSelection.near(t.doc.resolve(s)))}return!0}},addColumnBefore:function(){return function(e){return function(e,t){if(!Rx(e))return!1;if(t){var n=fO(e);t(pO(e.tr,n,n.left))}return!0}(e.state,e.dispatch)}},addColumnAfter:function(){return function(e){return function(e,t){if(!Rx(e))return!1;if(t){var n=fO(e);t(pO(e.tr,n,n.right))}return!0}(e.state,e.dispatch)}},deleteColumn:function(){return function(e){return function(e,t){if(!Rx(e))return!1;if(t){var n=fO(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(var o=n.right-1;hO(r,n,o),o!=n.left;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=Mx.get(n.table);t(r)}return!0}(e.state,e.dispatch)}},addRowBefore:function(){return function(e){return function(e,t){if(!Rx(e))return!1;if(t){var n=fO(e);t(mO(e.tr,n,n.top))}return!0}(e.state,e.dispatch)}},addRowAfter:function(){return function(e){return function(e,t){if(!Rx(e))return!1;if(t){var n=fO(e);t(mO(e.tr,n,n.bottom))}return!0}(e.state,e.dispatch)}},deleteRow:function(){return function(e){return function(e,t){if(!Rx(e))return!1;if(t){var n=fO(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(var o=n.bottom-1;vO(r,n,o),o!=n.top;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=Mx.get(n.table);t(r)}return!0}(e.state,e.dispatch)}},deleteTable:function(){return function(e){return function(e,t){for(var n=e.selection.$anchor,r=n.depth;r>0;r--)if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}(e.state,e.dispatch)}},mergeCells:function(){return function(e){return yO(e.state,e.dispatch)}},splitCell:function(){return function(e){return bO(e.state,e.dispatch)}},toggleHeaderColumn:function(){return function(e){var t=e.state,n=e.dispatch;return kO("column")(t,n)}},toggleHeaderRow:function(){return function(e){var t=e.state,n=e.dispatch;return kO("row")(t,n)}},toggleHeaderCell:function(){return function(e){var t=e.state,n=e.dispatch;return xO(t,n)}},mergeOrSplit:function(){return function(e){var t=e.state,n=e.dispatch;return!!yO(t,n)||bO(t,n)}},setCellAttribute:function(e,t){return function(n){var r=n.state,o=n.dispatch;return function(e,t){return function(n,r){if(!Rx(n))return!1;var o=Hx(n);if(o.nodeAfter.attrs[e]===t)return!1;if(r){var i=n.tr;n.selection instanceof $x?n.selection.forEachCell((function(n,r){n.attrs[e]!==t&&i.setNodeMarkup(r,null,Bx(n.attrs,e,t))})):i.setNodeMarkup(o.pos,null,Bx(o.nodeAfter.attrs,e,t)),r(i)}return!0}}(e,t)(r,o)}},goToNextCell:function(){return function(e){var t=e.state,n=e.dispatch;return OO(1)(t,n)}},goToPreviousCell:function(){return function(e){var t=e.state,n=e.dispatch;return OO(-1)(t,n)}},fixTables:function(){return function(e){var t=e.state;return e.dispatch&&dO(t),!0}},setCellSelection:function(e){return function(t){var n=t.tr;if(t.dispatch){var r=$x.create(n.doc,e.anchorCell,e.headCell);n.setSelection(r)}return!0}}}},addKeyboardShortcuts:function(){var e=this;return{Tab:function(){return!!e.editor.commands.goToNextCell()||!!e.editor.can().addRowAfter()&&e.editor.chain().addRowAfter().goToNextCell().run()},"Shift-Tab":function(){return e.editor.commands.goToPreviousCell()},Backspace:BD,"Mod-Backspace":BD,Delete:BD,"Mod-Delete":BD}},addProseMirrorPlugins:function(){var e=this.options.resizable&&this.editor.isEditable;return[].concat(Object(l.a)(e?[DO({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[]),[FO({allowTableNodeSelection:this.options.allowTableNodeSelection})])},extendNodeSchema:function(e){return{tableRole:Dr(wr(e,"tableRole",{name:e.name,options:e.options,storage:e.storage}))}}});function ID(e){var t=e.editor,n=e.node,r=e.forwardRef,o=Object(jd.useRef)(null),i=Object(jd.useRef)(),a=t.isActive("table");return Object(jd.useEffect)((function(){o.current&&i.current&&CO(n,o.current,i.current,50)}),[n]),Object(Cd.jsxs)(Cd.Fragment,{children:[Object(Cd.jsx)(ow,{children:a&&Object(Cd.jsxs)(Cd.Fragment,{children:[Object(Cd.jsx)($D,{editor:t,table:i.current}),Object(Cd.jsx)(qD,{editor:t,table:i.current})]})}),Object(Cd.jsx)("div",Object.assign({className:"tableWrapper"},{children:Object(Cd.jsx)("table",Object.assign({ref:function(e){null===r||void 0===r||r(e),i.current=e||void 0}},{children:Object(Cd.jsx)("colgroup",{ref:o})}))}))]})}function $D(e){var t=e.editor,n=Object(jd.useRef)(null);return Object(jd.useEffect)((function(){if(n.current){var e=Tk(t,["tableRow"]);if(e){var r=Vb(n.current,{location:"left",target:e,align:"start",xOffset:-5,yOffset:-3});n.current.style.top="".concat(r.top,"px"),n.current.style.left="".concat(r.left,"px")}}}),[t.state.selection,n.current]),Object(Cd.jsxs)(af.Flex,Object.assign({ref:n,sx:{zIndex:999,top:0,left:0,position:"absolute",bg:"background",flexWrap:"nowrap",borderRadius:"default",opacity:.3,":hover":{opacity:1}}},{children:[Object(Cd.jsx)(XO,Object.assign({},UO("rowProperties"),{icon:"more",variant:"small",editor:t})),Object(Cd.jsx)(kS,Object.assign({},UO("insertRowBelow"),{editor:t,variant:"small"}))]}))}function qD(e){var t=e.editor,n=e.table,r=Object(jd.useRef)(null);return Object(jd.useEffect)((function(){if(r.current&&n){var e=Tk(t,["tableCell","tableHeader"]);if(e){var o=Vb(r.current,{location:"top",align:"center",target:e,yAnchor:n,yOffset:2});r.current.style.left="".concat(o.left,"px"),r.current.style.top="".concat(o.top,"px")}}}),[t.state.selection,r.current,n]),Object(Cd.jsxs)(af.Flex,Object.assign({ref:r,sx:{zIndex:999,top:0,left:0,position:"absolute",bg:"background",flexWrap:"nowrap",borderRadius:"default",opacity:.3,":hover":{opacity:1}}},{children:[Object(Cd.jsx)(ZO,{editor:t,title:"tableProperties",icon:"more",variant:"small"}),Object(Cd.jsx)(hS,Object.assign({},UO("insertColumnRight"),{editor:t,variant:"small",icon:"plus"}))]}))}var WD=_D.extend({addProseMirrorPlugins:function(){var e,t=this.options.resizable&&this.editor.isEditable;return[].concat(Object(l.a)(t?[DO({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:(e=this.editor,function(t){Object(i.a)(r,t);var n=Object(a.a)(r);function r(t,i){var a,s;return Object(c.a)(this,r),s=n.call(this,t,e,(function(){return 0}),{component:ID,shouldUpdate:function(e,t){return e.type===t.type},contentDOMFactory:function(){return{dom:document.createElement("tbody")}},wrapperFactory:function(){var e=document.createElement("div");return e.style.position="relative",e}}),Object(h.a)((a=Object(o.a)(s),Object(m.a)(r.prototype)),"init",a).call(a),s}return Object(d.a)(r)}(tf)),lastColumnResizable:this.options.lastColumnResizable})]:[]),[FO({allowTableNodeSelection:this.options.allowTableNodeSelection})])}});function UD(e){this.j={},this.jr=[],this.jd=null,this.t=e}UD.prototype={accepts:function(){return!!this.t},tt:function(e,t){if(t&&t.j)return this.j[e]=t,t;var n=t,r=this.j[e];if(r)return n&&(r.t=n),r;r=KD();var o=XD(this,e);return o?(Object.assign(r.j,o.j),r.jr.append(o.jr),r.jr=o.jd,r.t=n||o.t):r.t=n,this.j[e]=r,r}};var KD=function(){return new UD},GD=function(e){return new UD(e)},JD=function(e,t,n){e.j[t]||(e.j[t]=n)},YD=function(e,t,n){e.jr.push([t,n])},XD=function(e,t){var n=e.j[t];if(n)return n;for(var r=0;r=a)return[];for(;i0&&void 0!==arguments[0]?arguments[0]:[],t=KD(),n=GD(oA),r=GD(tA),o=KD(),i=GD(sA),a=[[KA,r],[qA,r],[WA,r],[UA,r]],s=function(){var e=GD(tA);return e.j={"-":o},e.jr=[].concat(a),e},l=function(e){var t=s();return t.t=e,t};QD(t,[["'",GD(yA)],["{",GD(uA)],["[",GD(cA)],["<",GD(dA)],["(",GD(fA)],["}",GD(pA)],["]",GD(hA)],[">",GD(mA)],[")",GD(vA)],["&",GD(gA)],["*",GD(bA)],["@",GD(wA)],["`",GD(xA)],["^",GD(OA)],[":",GD(SA)],[",",GD(CA)],["$",GD(jA)],[".",GD(DA)],["=",GD(AA)],["!",GD(EA)],["-",GD(MA)],["%",GD(TA)],["|",GD(LA)],["+",GD(NA)],["#",GD(PA)],["?",GD(RA)],['"',GD(HA)],["/",GD(VA)],[";",GD(FA)],["~",GD(zA)],["_",GD(BA)],["\\",GD(kA)]]),JD(t,"\n",GD(lA)),YD(t,GA,i),JD(i,"\n",KD()),YD(i,GA,i);for(var u=0;u<$A.length;u++)eA(t,$A[u],l(rA),s);var c=s(),d=s(),f=s(),p=s();eA(t,"file",c,s),eA(t,"ftp",d,s),eA(t,"http",f,s),eA(t,"mailto",p,s);var h=s(),m=GD(iA),v=GD(aA);JD(d,"s",h),JD(d,":",m),JD(f,"s",h),JD(f,":",m),JD(c,":",m),JD(h,":",m),JD(p,":",v);for(var g=s(),y=0;y2&&void 0!==arguments[2]?arguments[2]:{},r=Object.create(e.prototype);for(var o in n)r[o]=n[o];r.constructor=t,t.prototype=r}(eE,n,t),n}eE.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]:XA.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}}};var nE=tE("email",{isLink:!0}),rE=tE("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),oE=tE("text"),iE=tE("nl"),aE=tE("url",{isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:XA.defaultProtocol,t=this.tk,n=!1,r=!1,o=[],i=0;t[i].t===iA;)n=!0,o.push(t[i].v),i++;for(;t[i].t===VA;)r=!0,o.push(t[i].v),i++;for(;i=0&&f++,o++,c++;if(f<0)for(var p=o-c;p0&&(i.push(uE(oE,t,a)),a=[]),o-=f,c-=f;var h=d.t,m=n.slice(o-c,o);i.push(uE(h,t,m))}}return a.length>0&&i.push(uE(oE,t,a)),i}(dE.parser.start,e,function(e,t){for(var n=function(e){for(var t=[],n=e.length,r=0;r56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(a),r+=a.length}return t}(t.replace(/[A-Z]/g,(function(e){return e.toLowerCase()}))),r=n.length,o=[],i=0,a=0;a=0&&(d+=n[a].length,f++),u+=n[a].length,i+=n[a].length,a++;i-=d,a-=f,u-=d,o.push({t:c.t,v:t.substr(i-u,u),s:i-u,e:i})}return o}(dE.scanner.start,e))}function hE(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=pE(e),r=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:null,n=pE(e);return 1===n.length&&n[0].isLink&&(!t||n[0].t===t)}function vE(e){return new p.Plugin({key:new p.PluginKey("autolink"),appendTransaction:function(t,n,r){var o=t.some((function(e){return e.docChanged}))&&!n.doc.eq(r.doc),i=t.some((function(e){return e.getMeta("preventAutolink")}));if(o&&!i){var a=r.tr,s=function(e,t){var n=new g.e(e);return t.forEach((function(e){e.steps.forEach((function(e){n.step(e)}))})),n}(n.doc,Object(l.a)(t)),u=s.mapping,c=function(e){var t=e.mapping,n=e.steps,r=[];return t.maps.forEach((function(e,o){var i=[];if(e.ranges.length)e.forEach((function(e,t){i.push({from:e,to:t})}));else{var a=n[o],s=a.from,l=a.to;if(void 0===s||void 0===l)return;i.push({from:s,to:l})}i.forEach((function(e){var n=e.from,i=e.to,a=t.slice(o).map(n,-1),s=t.slice(o).map(i),l=t.invert().map(a,-1),u=t.invert().map(s);r.push({oldRange:{from:l,to:u},newRange:{from:a,to:s}})}))})),No(r)}(s);if(c.forEach((function(t){var o=t.oldRange,i=t.newRange;Po(o.from,o.to,n.doc).filter((function(t){return t.mark.type===e.type})).forEach((function(t){var o=Po(u.map(t.from),u.map(t.to),r.doc).filter((function(t){return t.mark.type===e.type}));if(o.length){var i=o[0],s=n.doc.textBetween(t.from,t.to,void 0," "),l=r.doc.textBetween(i.from,i.to,void 0," "),c=mE(s),d=mE(l);c&&!d&&a.removeMark(i.from,i.to,e.type)}})),Lo(r.doc,i,(function(e){return e.isTextblock})).forEach((function(t){hE(r.doc.textBetween(t.pos,t.pos+t.node.nodeSize,void 0," ")).filter((function(e){return e.isLink})).filter((function(t){return!e.validate||e.validate(t.value)})).map((function(e){return Object(f.a)(Object(f.a)({},e),{},{from:t.pos+e.start+1,to:t.pos+e.end+1})})).filter((function(e){var t=i.from>=e.from&&i.from<=e.to,n=i.to>=e.from&&i.to<=e.to;return t||n})).forEach((function(t){a.addMark(t.from,t.to,e.type.create({href:t.href}))}))}))})),a.steps.length)return a}}})}var gE=zo.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate:function(){this.options.protocols.forEach(fE)},inclusive:function(){return this.options.autolink},addOptions:function(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes:function(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},class:{default:this.options.HTMLAttributes.class}}},parseHTML:function(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML:function(e){var t=e.HTMLAttributes;return["a",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setLink:function(t){return function(n){return(0,n.chain)().setMark(e.name,t).setMeta("preventAutolink",!0).run()}},toggleLink:function(t){return function(n){return(0,n.chain)().toggleMark(e.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},unsetLink:function(){return function(t){return(0,t.chain)().unsetMark(e.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}},addPasteRules:function(){var e=this;return[_o({find:function(t){return hE(t).filter((function(t){return!e.options.validate||e.options.validate(t.value)})).filter((function(e){return e.isLink})).map((function(e){return{text:e.value,index:e.start,data:e}}))},type:this.type,getAttributes:function(e){var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins:function(){var e,t=[];return this.options.autolink&&t.push(vE({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push((e={type:this.type},new p.Plugin({key:new p.PluginKey("handleClickLink"),props:{handleClick:function(t,n,r){var o,i=Do(t.state,e.type.name);return!(!(null===(o=r.target)||void 0===o?void 0:o.closest("a"))||!i.href)&&(window.open(i.href,i.target),!0)}}}))),this.options.linkOnPaste&&t.push(function(e){return new p.Plugin({key:new p.PluginKey("handlePasteLink"),props:{handlePaste:function(t,n,r){if(t.state.selection.empty)return!1;var o="";r.content.forEach((function(e){o+=e.textContent}));var i=hE(o).find((function(e){return e.isLink&&e.value===o}));return!(!o||!i)&&(e.editor.commands.setMark(e.type,{href:i.href}),!0)}}})}({editor:this.editor,type:this.type})),t}}),yE=new p.PluginKey("codemark");function bE(e,t){var n,r;return"schema"in e?null!==(n=null===t||void 0===t?void 0:t.markType)&&void 0!==n?n:e.schema.marks.code:null!==(r=null===t||void 0===t?void 0:t.markType)&&void 0!==r?r:e.state.schema.marks.code}function wE(e,t){return e.resolve(Math.min(Math.max(1,t),e.nodeSize-2))}function kE(e,t,n,r){var o,i=e.isInSet(null!==(o=t.state.storedMarks)&&void 0!==o?o:t.state.doc.resolve(n).marks()),a=t.state.doc.rangeHasMark(n,r,e);return!(!i&&!a)}var xE={match:/`((?:[^`\w]|[\w])+)`$/,handler:function(e,t,n,r,o,i,a){if(kE(e,t,o,i))return!1;var s=r[1],l=e.create(),u=o+s.length,c=t.state.tr.delete(o,i).insertText(s).addMark(o,u,l),d=c.setSelection(p.TextSelection.create(c.doc,u)).removeStoredMark(e),f=d.setMeta(a.input,{transform:d,from:o,to:i,text:"`".concat(s).concat(n)});return t.dispatch(f),!0}},OE={match:/^`((?:[^`\w]|[\w])+)`/,handler:function(e,t,n,r,o,i,a){if(kE(e,t,o,i))return!1;var s=e.create(),l=r[1],u=o,c=t.state.tr.delete(o,i).insertText(l).addMark(o,o+l.length,s),d=c.setSelection(p.TextSelection.create(c.doc,u)).addStoredMark(e.create()),f=d.setMeta(a.input,{transform:d,from:o,to:i,text:"`".concat(l).concat(n)});return t.dispatch(f),!0}};function SE(e,t){var n=new p.Plugin({isInputRules:!0,state:{init:function(){return null},apply:function(e,t){var r=e.getMeta(n);return r||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(r,o,i,a){return function(e,t,n,r,o,i){if(t.composing)return!1;var a=t.state.doc.resolve(n);if(a.parent.type.spec.code)return!1;var s=a.parent.textBetween(Math.max(0,a.parentOffset-100),a.parentOffset,void 0,"\ufffc")+o,l=o+a.parent.textBetween(a.parentOffset,Math.min(a.parent.nodeSize-2,a.parentOffset+100),void 0,"\ufffc"),u=xE.match.exec(s),c=OE.match.exec(l);if(u){var d=xE.handler(e,t,o,u,n-u[0].length+o.length,r,i);if(d)return d}return!!c&&OE.handler(e,t,o,c,n,r+c[0].length-o.length,i)}(bE(r,t),r,o,i,a,{input:n,cursor:e})}}});return n}function CE(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"next",r={action:n};return e.dispatch(e.state.tr.setMeta(t,r)),!1}function jE(e,t,n,r){var o=function(e,t,n,r){var o;if(n.metaKey)return CE(e,t);if(n.shiftKey||n.altKey||n.ctrlKey)return!1;var i=e.state,a=i.selection,s=i.doc;if(!a.empty)return!1;var l=t.getState(e.state),u=a.$from,c=!!r.isInSet(u.marks()),d=!!r.isInSet(null!==(o=u.marksAcross(wE(s,a.from+1)))&&void 0!==o?o:[]);return u.pos===e.state.doc.nodeSize-3&&u.parentOffset===u.parent.nodeSize-2&&(null===l||void 0===l?void 0:l.active)?(e.dispatch(e.state.tr.removeStoredMark(r)),!0):(c!==d||0===u.parentOffset)&&(!c||(null===l||void 0===l?void 0:l.active)&&-1!==l.side||0===u.parentOffset?!(!d||-1!==(null===l||void 0===l?void 0:l.side))&&(e.dispatch(e.state.tr.addStoredMark(r.create())),!0):(e.dispatch(e.state.tr.removeStoredMark(r)),!0))}(e,t,n,r);if(o)return!0;var i=e.state.selection,a=i.$from;return!(!i.empty||a.parentOffset!==a.parent.nodeSize-2)&&CE(e,t)}function DE(e,t,n,r){var o=function(e,t,n,r){var o;if(n.metaKey)return CE(e,t);if(n.shiftKey||n.altKey||n.ctrlKey)return!1;var i=e.state,a=i.selection,s=i.doc,l=t.getState(e.state),u=!!r.isInSet(a.$from.marks()),c=!!r.isInSet(null!==(o=wE(s,a.empty?a.from-1:a.from+1).marks())&&void 0!==o?o:[]);if(u&&-1===(null===l||void 0===l?void 0:l.side)&&0===a.$from.parentOffset)return!1;if(0===(null===l||void 0===l?void 0:l.side)&&0===a.$from.parentOffset)return e.dispatch(e.state.tr.removeStoredMark(r)),!0;if(u&&c&&0===(null===l||void 0===l?void 0:l.side))return e.dispatch(e.state.tr.addStoredMark(r.create())),!0;if(u&&!c&&(null===l||void 0===l?void 0:l.active)&&0===a.$from.parentOffset)return e.dispatch(e.state.tr.removeStoredMark(r)),!0;if(!u&&(null===l||void 0===l?void 0:l.active)&&0===(null===l||void 0===l?void 0:l.side))return e.dispatch(e.state.tr.removeStoredMark(r)),!0;if(u===c)return!1;if(c||!a.empty&&u){var d=a.empty?a.from-1:a.from,f=e.state.tr.setSelection(p.TextSelection.create(s,d));return!a.empty&&c?e.dispatch(f.addStoredMark(r.create())):e.dispatch(f.removeStoredMark(r)),!0}if((c||!a.empty&&u)&&!(null===l||void 0===l?void 0:l.active)){var h=a.empty?a.from-1:a.from;return e.dispatch(e.state.tr.setSelection(p.TextSelection.create(s,h)).removeStoredMark(r)),!0}if(u&&!(null===l||void 0===l?void 0:l.active)&&a.$from.parentOffset>0)return e.dispatch(e.state.tr.setSelection(p.TextSelection.create(s,a.from-1)).addStoredMark(r.create())),!0;if(u&&!c&&(null===l||void 0===l?void 0:l.active)&&-1!==l.side)return e.dispatch(e.state.tr.addStoredMark(r.create())),!0;if(u&&!c&&(null===l||void 0===l?void 0:l.active)){var m=a.from-1;return e.dispatch(e.state.tr.setSelection(p.TextSelection.create(s,m)).addStoredMark(r.create())),!0}return!1}(e,t,n,r);if(o)return!0;var i=e.state.selection,a=i.$from,s=t.getState(e.state);return 1===a.pos&&0===a.parentOffset&&-1===(null===s||void 0===s?void 0:s.side)||!(!i.empty||0!==a.parentOffset)&&CE(e,t)}function AE(){var e=document.createElement("span");return e.classList.add("fake-cursor"),e}function EE(e){var t=new p.Plugin({key:yE,appendTransaction:function(n,r,o){var i,a=t.getState(r),s=null===(i=n[0])||void 0===i?void 0:i.getMeta(t);return(null===a||void 0===a?void 0:a.next)||"click"===(null===s||void 0===s?void 0:s.action)?function(e,t){var n,r;if(!e)return null;var o=e.selection,i=e.doc;if(!o.empty)return null;var a=!!t.isInSet(null!==(n=e.storedMarks)&&void 0!==n?n:[]),s=!!t.isInSet(o.$from.marks()),l=!!t.isInSet(null!==(r=wE(i,o.from+1).marks())&&void 0!==r?r:[]),u=0===o.$from.parentOffset;return s!==l||!s&&a!==s||s&&u?e.tr.removeStoredMark(t):null}(o,bE(o,e)):null},state:{init:function(){return null},apply:function(n,r,o,i){var a,s=n.getMeta(t);if("next"===(null===s||void 0===s?void 0:s.action))return{next:!0};var l=bE(i,e),u=l.isInSet(null!==(a=i.storedMarks)&&void 0!==a?a:i.doc.resolve(n.selection.from).marks()),c=l.isInSet(i.doc.resolve(n.selection.from).marks()),d=l.isInSet(wE(i.doc,n.selection.from+1).marks()),f=0===n.selection.$from.parentOffset;return n.selection.empty?u||!d||c&&!f?(!u||c&&!f)&&(u||!c||d)?u&&c&&!d?{active:!0,side:-1}:null:{active:!0,side:0}:{active:!0,side:-1}:null}},props:{attributes:function(e){var n,r=(null!==(n=t.getState(e))&&void 0!==n?n:{}).active,o=void 0!==r&&r;return Object.assign({},o?{class:"no-cursor"}:{})},decorations:function(e){var n,r=null!==(n=t.getState(e))&&void 0!==n?n:{},o=r.active,i=r.side;if(!o)return Iu.empty;var a=zu.widget(e.selection.from,AE,{side:i});return Iu.create(e.doc,[a])},handleKeyDown:function(n,r){switch(r.key){case"`":return function(e,t,n,r){if(e.state.selection.empty)return!1;if(n.metaKey||n.shiftKey||n.altKey||n.ctrlKey)return!1;var o=e.state.selection,i=o.from,a=o.to;if(a-i>=100||e.state.doc.rangeHasMark(i,a,r))return!1;var s=e.state.tr.addMark(i,a,r.create()),l=s.setSelection(p.TextSelection.create(s.doc,a)).removeStoredMark(r);return e.dispatch(l),!0}(n,0,r,bE(n,e));case"ArrowRight":return jE(n,t,r,bE(n,e));case"ArrowLeft":return DE(n,t,r,bE(n,e));case"Backspace":return function(e,t,n,r){if(n.metaKey||n.shiftKey||n.altKey||n.ctrlKey)return!1;var o=e.state,i=o.selection,a=o.doc,s=wE(a,i.from-1),l=!!r.isInSet(s.marks()),u=0===s.parentOffset,c=!!r.isInSet(wE(a,i.to+1).marks());if((!l||u)&&!c)return CE(e,t);var d=t.getState(e.state);if(i.empty&&-1===(null===d||void 0===d?void 0:d.side)){var f=e.state.tr.delete(i.from-1,i.from);return e.dispatch(f),!0}return!1}(n,t,r,bE(n,e));case"Delete":return function(e,t,n,r){if(n.metaKey||n.shiftKey||n.altKey||n.ctrlKey)return!1;var o=e.state,i=o.selection,a=o.doc,s=!!r.isInSet(i.$from.marks()),l=0===i.$from.parentOffset,u=!!r.isInSet(wE(a,i.to+2).marks());return!(s&&!l||u)&&CE(e,t)}(n,t,r,bE(n,e));case"ArrowUp":case"ArrowDown":case"Home":case"End":return CE(n,t);case"e":case"a":return!!r.ctrlKey&&CE(n,t);default:return!1}},handleClick:function(e){return CE(e,t,"click")}}});return t}var ME=function(e){var t=EE(e);return[t,SE(t,e)]},TE=Ir.create({name:"codemarkPlugin",addProseMirrorPlugins:function(){return ME({markType:this.editor.schema.marks.code})}}),LE=Object(d.a)((function e(t,n){var r;Object(c.a)(this,e),this.match=t,this.match=t,this.handler="string"==typeof n?(r=n,function(e,t,n,o){var i=r;if(t[1]){var a=t[0].lastIndexOf(t[1]);i+=t[0].slice(a+t[1].length);var s=(n+=a)-o;s>0&&(i=t[0].slice(a-s,a)+i,n=o)}return e.tr.insertText(i,n,o)}):n}));function NE(e){var t=e.rules,n=new p.Plugin({state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(e,r,o,i){return PE(e,r,o,i,t,n)},handleDOMEvents:{compositionend:function(e){setTimeout((function(){var r=e.state.selection.$cursor;r&&PE(e,r.pos,r.pos,"",t,n)}))}}},isInputRules:!0});return n}function PE(e,t,n,r,o,i){if(e.composing)return!1;var a=e.state,s=a.doc.resolve(t);if(s.parent.type.spec.code)return!1;for(var l=s.parent.textBetween(Math.max(0,s.parentOffset-500),s.parentOffset,null,"\ufffc")+r,u=0;u3&&void 0!==arguments[3])||arguments[3];return function(o,i){var a=e.state,s=a.selection,l=s.to,u=s.from,c=o.selection,d=c.to,f=c.from;if(r&&d!==f)return!1;var h=t>0?d:f;if(n){var m=o.doc.nodeSize-2;if(t>0&&h0)return!1}if(i){var v=t>0?l:u;e.dispatch(a.tr.setSelection(p.TextSelection.create(a.doc,v))),e.focus()}return!0}}var HE=function(){function e(t,n,r,o,i,a){var s=this;Object(c.a)(this,e),this.options=o,this._node=t,this._outerView=n,this._getPos=r,this._mathPluginKey=i,this.cursorSide="start",this._isEditing=!1,this._tagName=o.tagName||this._node.type.name.replace("_","-"),this.dom=document.createElement(this._tagName),o.className&&this.dom.classList.add(o.className),this.dom.classList.add("math-node"),this._mathRenderElt=document.createElement("span"),this._mathRenderElt.textContent="",this._mathRenderElt.classList.add("math-render"),this.dom.appendChild(this._mathRenderElt),this._mathSrcElt=document.createElement("span"),this._mathSrcElt.classList.add("math-src"),this.dom.appendChild(this._mathSrcElt),this.dom.addEventListener("click",(function(){return s.ensureFocus()})),this.renderMath()}return Object(d.a)(e,[{key:"destroy",value:function(){this.closeEditor(!1),this._mathRenderElt&&(this._mathRenderElt.remove(),delete this._mathRenderElt),this._mathSrcElt&&(this._mathSrcElt.remove(),delete this._mathSrcElt),this.dom.remove()}},{key:"ensureFocus",value:function(){this._innerView&&this._outerView.hasFocus()&&this._innerView.focus()}},{key:"update",value:function(e,t,n){if(!e.sameMarkup(this._node))return!1;if(this._node=e,this._innerView){var r=this._innerView.state,o=e.content.findDiffStart(r.doc.content);if(null!=o){var i=e.content.findDiffEnd(r.doc.content);if(i){var a=i.a,s=i.b,l=o-Math.min(a,s);l>0&&(a+=l,s+=l),this._innerView.dispatch(r.tr.replace(o,s,e.slice(o,a)).setMeta("fromOutside",!0))}}}return this._isEditing||this.renderMath(),!0}},{key:"updateCursorPos",value:function(e){var t=this._getPos(),n=this._node.nodeSize;e.selection.from0&&null!==e[0].textContent&&(t=e[0].textContent.trim()),t.length<1)for(this.dom.classList.add("empty-math");this._mathRenderElt.firstChild;)this._mathRenderElt.firstChild.remove();else{this.dom.classList.remove("empty-math");try{this.options.renderer(t,this._mathRenderElt),this._mathRenderElt.classList.remove("parse-error"),this.dom.setAttribute("title","")}catch(n){n instanceof Error&&(console.error(n),this._mathRenderElt.classList.add("parse-error"),this.dom.setAttribute("title",n.toString()))}}}}},{key:"dispatchInner",value:function(e){if(this._innerView){var t=this._innerView.state.applyTransaction(e),n=t.state,r=t.transactions;if(this._innerView.updateState(n),!e.getMeta("fromOutside")){for(var o=this._outerView.state.tr,i=g.d.offset(this._getPos()+1),a=0;a0)&&(t._outerView.dispatch(t._outerView.state.tr.insertText("")),t._outerView.focus(),!0))})),Enter:lr(Yn,RE(this._outerView,1,!1)),"Ctrl-Enter":RE(this._outerView,1,!1),ArrowLeft:RE(this._outerView,-1,!0),ArrowRight:RE(this._outerView,1,!0),ArrowUp:RE(this._outerView,-1,!0),ArrowDown:RE(this._outerView,1,!0)})]}),dispatchTransaction:this.dispatchInner.bind(this)});var n=this._innerView.state;this._innerView.focus();var r=null===(e=this._mathPluginKey.getState(this._outerView.state))||void 0===e?void 0:e.prevCursorPos;null!==r&&void 0!==r||console.error("[prosemirror-math] Error: Unable to fetch math plugin state from key.");var o=(null!==r&&void 0!==r?r:0)<=this._getPos()?0:this._node.nodeSize-2;setTimeout((function(){t._innerView&&(t._innerView.focus(),t._innerView.dispatch(n.tr.setSelection(p.TextSelection.create(n.doc,o))))})),this._isEditing=!0}},{key:"closeEditor",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._innerView&&(this._innerView.destroy(),this._innerView=void 0),e&&this.renderMath(),this._isEditing=!1}}]),e}(),FE=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(t){i(t)}}function s(e){try{l(r.throw(e))}catch(t){i(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};function VE(){return FE(this,void 0,void 0,ik().mark((function e(){var t,r;return ik().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.e(0).then(n.t.bind(null,127,7));case 2:return t=e.sent,r=t.default,e.next=6,Promise.all([n.e(0),n.e(4)]).then(n.bind(null,128));case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})))}var zE={inline:function(e,t){VE().then((function(n){n.render(e,t,{displayMode:!1,globalGroup:!0,throwOnError:!1})}))},block:function(e,t){VE().then((function(n){n.render(e,t,{displayMode:!0,globalGroup:!0,throwOnError:!1})}))}},BE=new p.PluginKey("prosemirror-math");function _E(e){return function(t,n,r){var o=BE.getState(n.state);if(!o)throw new Error("no math plugin!");var i=o.activeNodeViews,a=new HE(t,n,r,{className:e?"math-inline":"math-block",renderer:e?zE.inline:zE.block,tagName:e?"span":"div"},BE,(function(){i.splice(i.indexOf(a))}));return i.push(a),a}}var IE={key:BE,state:{init:function(e,t){return{macros:{},activeNodeViews:[],prevCursorPos:0}},apply:function(e,t,n,r){var o=r.selection.from,i=n.selection.from;return{activeNodeViews:t.activeNodeViews,macros:t.macros,prevCursorPos:i!==o?i:t.prevCursorPos}}},props:{nodeViews:{mathInline:_E(!0),mathBlock:_E(!1)}}},$E=new p.Plugin(IE);function qE(e,t){return v.Fragment.from(t.text(e))}function WE(e){var t,n=e.querySelector("img.mwe-math-fallback-image-inline[alt]");return null!==(t=null===n||void 0===n?void 0:n.getAttribute("alt"))&&void 0!==t&&t}function UE(e){var t,n=e.querySelector("math[alttext]");return null!==(t=null===n||void 0===n?void 0:n.getAttribute("alttext"))&&void 0!==t&&t}function KE(e){var t,n=e.querySelector("math annotation[encoding='application/x-tex'");return null!==(t=null===n||void 0===n?void 0:n.textContent)&&void 0!==t&&t}function GE(e){var t=function(e,t){var n,r=Object(Sd.a)(t);try{for(r.s();!(n=r.n()).done;){var o=(0,n.value)(e);if(!1!==o)return o}}catch(i){r.e(i)}finally{r.f()}return!1}(e,[WE,UE,KE]);return t}var JE=[{tag:"span",getAttrs:function(e){return!!e.classList.contains("mwe-math-element")&&null},getContent:function(e,t){return qE(GE(e)||"\\text{\\color{red}(paste error)}",t)}}],YE=[{tag:"dl",getAttrs:function(e){var t=e;if(1!==t.childElementCount)return!1;var n=t.firstChild;return"DD"===n.tagName&&(1===n.childElementCount&&(!!n.firstChild.classList.contains("mwe-math-element")&&null))},getContent:function(e,t){return qE(GE(e)||"\\text{\\color{red}(paste error)}",t)}}];[{tag:"math-inline"}].concat(Object(l.a)(JE)),[{tag:"math-display"}].concat(Object(l.a)(YE));var XE=/\$\$(.+)\$\$/,ZE=(function(){try{new RegExp("(?1&&void 0!==arguments[1]?arguments[1]:"";return function(n,r){var o=n.selection,i=o.$from,a=o.empty,s=i.index();if(!a&&!i.parent.canReplaceWith(s,s,e))return!1;if(r){var l=e.create({},t?n.schema.text(t):null),u=n.tr.replaceSelectionWith(l);r(u=a?u.setSelection(p.TextSelection.create(u.doc,i.pos+1)):u.setSelection(p.NodeSelection.create(u.doc,i.pos)))}return!0}}(e.type)(n,r,o)}}}},addProseMirrorPlugins:function(){var e,t,n;return[NE({rules:[(e=ZE,t=this.type,new LE(e,(function(e,r,o,i){var a=e.doc.resolve(o),s=n instanceof Function?n(r):n;if(!a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t))return null;var l=e.tr.delete(o,i).setBlockType(o,o,t,s);return l.setSelection(p.NodeSelection.create(l.doc,l.mapping.map(a.pos-1)))})))]})]}}),rM=void 0,oM=Ir.create({name:"keepinview",onCreate:function(){var e=this;rM=function(){iM(e.editor)},window.addEventListener("resize",rM)},onDestroy:function(){rM&&(window.removeEventListener("resize",rM),rM=void 0)},addKeyboardShortcuts:function(){return{Enter:function(e){var t=e.editor;return setTimeout((function(){iM(t)})),!1}}}});function iM(e){var t=e.state.selection.$from,n=function(e,t,n){var r=e.state.doc.content.size,o=Qr(t,0,r),i=Qr(n,0,r),a=e.coordsAtPos(o),s=e.coordsAtPos(i,-1),l=Math.min(a.top,s.top),u=Math.max(a.bottom,s.bottom),c=Math.min(a.left,s.left),d=Math.max(a.right,s.right),p={top:l,bottom:u,left:c,right:d,width:d-c,height:u-l,x:c,y:l};return Object(f.a)(Object(f.a)({},p),{},{toJSON:function(){return p}})}(e.view,t.pos,t.pos+1),r=n.top;if(window.innerHeight-r<100){var o=e.view.domAtPos(t.pos).node;if(o.nodeType===Node.TEXT_NODE&&o.parentNode&&(o=o.parentNode),o instanceof HTMLElement){var i=aM(o);i?i.scrollBy({top:100,behavior:"smooth"}):o.scrollIntoView({behavior:"smooth",block:"center"})}}}var aM=function(e){if(e){for(var t=e.parentElement;t;){var n=t.style,r=n.overflow,o=n.overflowY;if(sM(r)||sM(o))return t;t=t.parentElement}return document.documentElement}};function sM(e){return e.split(" ").every((function(e){return"auto"===e||"scroll"===e}))}var lM=new p.PluginKey("selection-persist-key"),uM=Ir.create({name:"selection-persist",addProseMirrorPlugins:function(){var e=!1;return[new p.Plugin({key:lM,props:{decorations:function(e){return lM.getState(e)}},state:{init:function(){return Iu.empty},apply:function(t,n,r,o){var i=!!t.getMeta("blur");!!t.getMeta("focus")&&(e=!1,!0),i&&(e=!0,!1);var a=r.selection,s=a.from,l=a.to;return e?Iu.create(t.doc,[zu.inline(s,l,{style:"background-color: var(--dimPrimary)"})]):Iu.empty}}})]}}),cM=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(){return Object(c.a)(this,n),t.apply(this,arguments)}return Object(d.a)(n,[{key:"requestPermission",value:function(e){var t=new CustomEvent("permissionrequest",{detail:{id:e},cancelable:!0});if(window.dispatchEvent(t))return this.current}}]),n}(Mo);function dM(){var e=Object(jd.useState)(0),t=Object(u.a)(e,2)[1];return function(){return t((function(e){return e+1}))}}var fM=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object(jd.useState)(null),r=Object(u.a)(n,2),o=r[0],i=r[1],a=dM(),s=Object(jd.useRef)(o);return Object(jd.useEffect)((function(){var t=!0,n=new cM(e);return i(n),n.on("transaction",(function(){requestAnimationFrame((function(){requestAnimationFrame((function(){t&&a()}))}))})),function(){n.destroy(),t=!1}}),t),Object(jd.useEffect)((function(){s.current=o,o&&(o.current||Object.defineProperty(o,"current",{get:function(){return s.current}}))}),[o]),Object(jd.useEffect)((function(){function e(e){if(null===o||void 0===o?void 0:o.view.dragging)return e.preventDefault(),!0}return null===o||void 0===o||o.view.dom.addEventListener("dragenter",e),function(){null===o||void 0===o||o.view.dom.removeEventListener("dragenter",e)}}),[null===o||void 0===o?void 0:o.view.dom]),o},pM={premium:["insertImage"]};function hM(e){var t=e.claims,n=e.onPermissionDenied;Object(jd.useEffect)((function(){function e(e){var r=e.detail.id;for(var o in pM){var i=o;if(!(pM[i].indexOf(r)<=-1)&&!t[i]){n(i,r),e.preventDefault();break}}e.preventDefault()}return window.addEventListener("permissionrequest",e),function(){window.removeEventListener("permissionrequest",e)}}),[t,n])}var mM=Ir.create({name:"highlight",addOptions:function(){return{types:["textStyle"],HTMLAttributes:{}}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:function(e){var t;return null===(t=e.style.backgroundColor)||void 0===t?void 0:t.replace(/['"]+/g,"")},renderHTML:function(e){return e.backgroundColor?{style:"background-color: ".concat(e.backgroundColor)}:{}}}}}]},addCommands:function(){return{setHighlight:function(e){return function(t){return t.commands.setMark("textStyle",{backgroundColor:e})}},toggleHighlight:function(e){return function(t){return t.commands.toggleMark("textStyle",{backgroundColor:e})}},unsetHighlight:function(){return function(e){return(0,e.chain)().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}}}),vM=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.theme,r=e.isMobile,o=e.isKeyboardOpen,i=e.onDownloadAttachment,a=e.onOpenAttachmentPicker,s=e.onBeforeCreate,l=vM(e,["theme","isMobile","isKeyboardOpen","onDownloadAttachment","onOpenAttachmentPicker","onBeforeCreate"]),u=Gd(),c=Rd((function(e){return e.setIsMobile})),d=Rd((function(e){return e.setTheme})),f=Rd((function(e){return e.setIsKeyboardOpen}));Object(jd.useEffect)((function(){c(r||!1),d(n),f(o||!1)}),[r,n,o]);var p=Object(jd.useMemo)((function(){return{extensions:[ef,NC,pd,ud.configure({dropcursor:!1,codeBlock:!1,listItem:!1,orderedList:!1,bulletList:!1,history:{depth:200,newGroupDelay:1e3}}),TC.configure({class:"drop-cursor"}),Io,Ba,dd,fd,hd,md,vd,gd,yd,jC.configure({nested:!0}),AC,gE.configure({openOnClick:!r}),WD.configure({resizable:!0,allowTableNodeSelection:!0,cellMinWidth:50}),wd,xd,Od,mM,kD,bd,cd.configure({types:["heading","paragraph"],alignments:["left","right","center","justify"],defaultAlignment:"left"}),za.configure({placeholder:"Start writing your note..."}),yC,RC,FS.configure({onDownloadAttachment:i,onOpenAttachmentPicker:a}),TD,RD,ED,TE,tM,nM,oM,uM],onBeforeCreate:function(e){var t=e.editor;t.storage.portalProviderAPI=u,s&&s({editor:t})},injectCSS:!1}}),[i,a,u,s]),h=fM(Object.assign(Object.assign({},p),l),t);return h}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(39);function o(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";t.a=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}},function(e,t,n){"use strict";n.r(t);var r=n(37),o=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,i=Object(r.a)((function(e){return o.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.default=i},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)return o(e,t,t);var n=Math.abs(t),r=o(e,n,n);return"string"===typeof r?"-"+r:-1*r},d=["margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","top","bottom","left","right"].reduce((function(e,t){var n;return r({},e,((n={})[t]=c,n))}),{}),f=function(e){return function(t){var n={},r=o(t,"breakpoints",i),a=[null].concat(r.map((function(e){return"@media screen and (min-width: "+e+")"})));for(var s in e){var l="function"===typeof e[s]?e[s](t):e[s];if(null!=l)if(Array.isArray(l))for(var u=0;u=0)&&i(e,!n)}e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){s&&(s.removeAttribute?s.removeAttribute("aria-hidden"):null!=s.length?s.forEach((function(e){return e.removeAttribute("aria-hidden")})):document.querySelectorAll(s).forEach((function(e){return e.removeAttribute("aria-hidden")})));s=null},t.log=function(){0},t.assertNodeList=l,t.setElement=function(e){var t=e;if("string"===typeof t&&a.canUseDOM){var n=document.querySelectorAll(t);l(n,t),t=n}return s=t||s},t.validateElement=u,t.hide=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=u(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.setAttribute("aria-hidden","true")}}catch(a){n=!0,r=a}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.show=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=u(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.removeAttribute("aria-hidden")}}catch(a){n=!0,r=a}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.documentNotReadyOrSSRTesting=function(){s=null};var r,o=n(97),i=(r=o)&&r.__esModule?r:{default:r},a=n(51);var s=null;function l(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function u(e){var t=e||s;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,i.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log=function(){console.log("portalOpenInstances ----------"),console.log(o.openInstances.length),o.openInstances.forEach((function(e){return console.log(e)})),console.log("end portalOpenInstances ----------")},t.resetState=function(){o=new r};var r=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.register=function(e){-1===t.openInstances.indexOf(e)&&(t.openInstances.push(e),t.emit("register"))},this.deregister=function(e){var n=t.openInstances.indexOf(e);-1!==n&&(t.openInstances.splice(n,1),t.emit("deregister"))},this.subscribe=function(e){t.subscribers.push(e)},this.emit=function(e){t.subscribers.forEach((function(n){return n(e,t.openInstances.slice())}))},this.openInstances=[],this.subscribers=[]},o=new r;t.default=o},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n96?u:c};function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t0&&(C.transform=M.join(" "),C.transformOrigin="center",D&&(L=r.createElement("g",{style:C},T,r.createElement("rect",{width:"24",height:"24",fill:"transparent"}))));var N,P=L,R=!0===O||"number"!=typeof O?2:O,H=!D&&(g||b);if(R<0&&(H=!H),O&&(P=r.createElement("g",{style:{animation:"spin"+(H?"-inverse":"")+" linear "+Math.abs(R)+"s infinite",transformOrigin:"center"}},L,!(g||b||0!==k)&&r.createElement("rect",{width:"24",height:"24",fill:"transparent"}))),D)return P;var F,V="icon_labelledby_"+i,z="icon_describedby_"+i;if(s)N=d?V+" "+z:V;else if(F="presentation",d)throw new Error("title attribute required when description is set");return r.createElement("svg",u({ref:t,viewBox:"0 0 24 24",style:C,role:F,"aria-labelledby":N},A),s&&r.createElement("title",{id:V},s),d&&r.createElement("desc",{id:z},d),!D&&O&&(H?r.createElement("style",null,"@keyframes spin-inverse { to { transform: rotate(-360deg) } }"):r.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg) } }")),P)}));d.displayName="Icon",d.propTypes={path:o.string.isRequired,size:o.oneOfType([o.number,o.string]),color:o.string,horizontal:o.bool,vertical:o.bool,rotate:o.number,spin:o.oneOfType([o.bool,o.number]),style:o.object,inStack:o.bool,className:o.string},d.defaultProps={size:null,color:"currentColor",horizontal:!1,vertical:!1,rotate:0,spin:!1},t.default=d}])},function(e,t,n){"use strict";e.exports=function(e){var t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((function(e,t){return Math.min(e,t.length)}),1/0):0}},,,,function(e,t,n){"use strict";var r,o=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r,i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["color","size","children"])),l="mdi-icon "+(s.className||"");return o.createElement("svg",i({},s,{className:l,width:a,height:a,fill:n,viewBox:"0 0 24 24"}),o.createElement("path",{d:"M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"}))},s=o.memo?o.memo(a):a;e.exports=s},function(e,t,n){"use strict";var r,o=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r,i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["color","size","children"])),l="mdi-icon "+(s.className||"");return o.createElement("svg",i({},s,{className:l,width:a,height:a,fill:n,viewBox:"0 0 24 24"}),o.createElement("path",{d:"M19.35,10.04C18.67,6.59 15.64,4 12,4C9.11,4 6.6,5.64 5.35,8.04C2.34,8.36 0,10.91 0,14A6,6 0 0,0 6,20H19A5,5 0 0,0 24,15C24,12.36 21.95,10.22 19.35,10.04M19,18H6A4,4 0 0,1 2,14C2,11.95 3.53,10.24 5.56,10.03L6.63,9.92L7.13,8.97C8.08,7.14 9.94,6 12,6C14.62,6 16.88,7.86 17.39,10.43L17.69,11.93L19.22,12.04C20.78,12.14 22,13.45 22,15A3,3 0 0,1 19,18M8,13H10.55V16H13.45V13H16L12,9L8,13Z"}))},s=o.memo?o.memo(a):a;e.exports=s},function(e,t,n){"use strict";var r,o=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r,i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["color","size","children"])),l="mdi-icon "+(s.className||"");return o.createElement("svg",i({},s,{className:l,width:a,height:a,fill:n,viewBox:"0 0 24 24"}),o.createElement("path",{d:"M5 16L3 5L8.5 10L12 4L15.5 10L21 5L19 16H5M19 19C19 19.6 18.6 20 18 20H6C5.4 20 5 19.6 5 19V18H19V19Z"}))},s=o.memo?o.memo(a):a;e.exports=s},function(e,t,n){"use strict";var r,o=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r,i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["color","size","children"])),l="mdi-icon "+(s.className||"");return o.createElement("svg",i({},s,{className:l,width:a,height:a,fill:n,viewBox:"0 0 24 24"}),o.createElement("path",{d:"M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"}))},s=o.memo?o.memo(a):a;e.exports=s},function(e,t,n){"use strict";var r,o=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r,i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["color","size","children"])),l="mdi-icon "+(s.className||"");return o.createElement("svg",i({},s,{className:l,width:a,height:a,fill:n,viewBox:"0 0 24 24"}),o.createElement("path",{d:"M20 13.5C20 17.09 17.09 20 13.5 20H6V18H13.5C16 18 18 16 18 13.5S16 9 13.5 9H7.83L10.91 12.09L9.5 13.5L4 8L9.5 2.5L10.92 3.91L7.83 7H13.5C17.09 7 20 9.91 20 13.5Z"}))},s=o.memo?o.memo(a):a;e.exports=s},function(e,t,n){"use strict";var r,o=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r,i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["color","size","children"])),l="mdi-icon "+(s.className||"");return o.createElement("svg",i({},s,{className:l,width:a,height:a,fill:n,viewBox:"0 0 24 24"}),o.createElement("path",{d:"M10.5 18H18V20H10.5C6.91 20 4 17.09 4 13.5S6.91 7 10.5 7H16.17L13.08 3.91L14.5 2.5L20 8L14.5 13.5L13.09 12.09L16.17 9H10.5C8 9 6 11 6 13.5S8 18 10.5 18Z"}))},s=o.memo?o.memo(a):a;e.exports=s},function(e,t,n){"use strict";var r,o=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r,i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["color","size","children"])),l="mdi-icon "+(s.className||"");return o.createElement("svg",i({},s,{className:l,width:a,height:a,fill:n,viewBox:"0 0 24 24"}),o.createElement("path",{d:"M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z"}))},s=o.memo?o.memo(a):a;e.exports=s},function(e,t,n){"use strict";var r,o=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r,i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["color","size","children"])),l="mdi-icon "+(s.className||"");return o.createElement("svg",i({},s,{className:l,width:a,height:a,fill:n,viewBox:"0 0 24 24"}),o.createElement("path",{d:"M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z"}))},s=o.memo?o.memo(a):a;e.exports=s},,,,,,function(e,t,n){"use strict";var r=n(19),o=60103,i=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var a=60109,s=60110,l=60112;t.Suspense=60113;var u=60115,c=60116;if("function"===typeof Symbol&&Symbol.for){var d=Symbol.for;o=d("react.element"),i=d("react.portal"),t.Fragment=d("react.fragment"),t.StrictMode=d("react.strict_mode"),t.Profiler=d("react.profiler"),a=d("react.provider"),s=d("react.context"),l=d("react.forward_ref"),t.Suspense=d("react.suspense"),u=d("react.memo"),c=d("react.lazy")}var f="function"===typeof Symbol&&Symbol.iterator;function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n