@researai/deepscientist 1.5.15 → 1.5.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +385 -104
- package/bin/ds.js +1241 -110
- package/docs/en/00_QUICK_START.md +100 -19
- package/docs/en/01_SETTINGS_REFERENCE.md +34 -1
- package/docs/en/02_START_RESEARCH_GUIDE.md +7 -0
- package/docs/en/05_TUI_GUIDE.md +6 -0
- package/docs/en/06_RUNTIME_AND_CANVAS.md +4 -3
- package/docs/en/09_DOCTOR.md +25 -8
- package/docs/en/14_PROMPT_SKILLS_AND_MCP_GUIDE.md +63 -13
- package/docs/en/15_CODEX_PROVIDER_SETUP.md +37 -11
- package/docs/en/19_EXTERNAL_CONTROLLER_GUIDE.md +226 -0
- package/docs/en/19_LOCAL_BROWSER_AUTH.md +70 -0
- package/docs/en/20_WORKSPACE_MODES_GUIDE.md +250 -0
- package/docs/en/21_LOCAL_MODEL_BACKENDS_GUIDE.md +283 -0
- package/docs/en/91_DEVELOPMENT.md +237 -0
- package/docs/en/README.md +24 -2
- package/docs/zh/00_QUICK_START.md +89 -19
- package/docs/zh/01_SETTINGS_REFERENCE.md +34 -1
- package/docs/zh/02_START_RESEARCH_GUIDE.md +7 -0
- package/docs/zh/05_TUI_GUIDE.md +6 -0
- package/docs/zh/09_DOCTOR.md +26 -9
- package/docs/zh/14_PROMPT_SKILLS_AND_MCP_GUIDE.md +63 -13
- package/docs/zh/15_CODEX_PROVIDER_SETUP.md +37 -11
- package/docs/zh/19_EXTERNAL_CONTROLLER_GUIDE.md +226 -0
- package/docs/zh/19_LOCAL_BROWSER_AUTH.md +68 -0
- package/docs/zh/20_WORKSPACE_MODES_GUIDE.md +251 -0
- package/docs/zh/21_LOCAL_MODEL_BACKENDS_GUIDE.md +281 -0
- package/docs/zh/README.md +24 -2
- package/install.sh +46 -4
- package/package.json +2 -1
- package/pyproject.toml +1 -1
- package/src/deepscientist/__init__.py +1 -1
- package/src/deepscientist/acp/envelope.py +6 -0
- package/src/deepscientist/artifact/service.py +647 -22
- package/src/deepscientist/bash_exec/service.py +234 -9
- package/src/deepscientist/bridges/connectors.py +8 -2
- package/src/deepscientist/cli.py +115 -19
- package/src/deepscientist/codex_cli_compat.py +367 -22
- package/src/deepscientist/config/models.py +2 -1
- package/src/deepscientist/config/service.py +183 -13
- package/src/deepscientist/daemon/api/handlers.py +255 -31
- package/src/deepscientist/daemon/api/router.py +9 -0
- package/src/deepscientist/daemon/app.py +1146 -105
- package/src/deepscientist/diagnostics/__init__.py +6 -0
- package/src/deepscientist/diagnostics/runner_failures.py +130 -0
- package/src/deepscientist/doctor.py +207 -3
- package/src/deepscientist/gitops/__init__.py +10 -1
- package/src/deepscientist/gitops/diff.py +129 -0
- package/src/deepscientist/gitops/service.py +4 -1
- package/src/deepscientist/mcp/server.py +39 -0
- package/src/deepscientist/prompts/builder.py +275 -34
- package/src/deepscientist/quest/layout.py +15 -2
- package/src/deepscientist/quest/service.py +707 -55
- package/src/deepscientist/quest/stage_views.py +6 -1
- package/src/deepscientist/runners/codex.py +143 -43
- package/src/deepscientist/shared.py +19 -0
- package/src/deepscientist/skills/__init__.py +2 -2
- package/src/deepscientist/skills/installer.py +196 -5
- package/src/deepscientist/skills/registry.py +66 -0
- package/src/prompts/connectors/qq.md +18 -8
- package/src/prompts/connectors/weixin.md +16 -6
- package/src/prompts/contracts/shared_interaction.md +14 -2
- package/src/prompts/system.md +23 -5
- package/src/prompts/system_copilot.md +56 -0
- package/src/skills/analysis-campaign/SKILL.md +1 -0
- package/src/skills/baseline/SKILL.md +8 -0
- package/src/skills/decision/SKILL.md +8 -0
- package/src/skills/experiment/SKILL.md +8 -0
- package/src/skills/figure-polish/SKILL.md +1 -0
- package/src/skills/finalize/SKILL.md +1 -0
- package/src/skills/idea/SKILL.md +1 -0
- package/src/skills/intake-audit/SKILL.md +8 -0
- package/src/skills/mentor/SKILL.md +217 -0
- package/src/skills/mentor/references/correction-rules.md +210 -0
- package/src/skills/mentor/references/knowledge-profile.md +91 -0
- package/src/skills/mentor/references/persona-profile.md +138 -0
- package/src/skills/mentor/references/taste-profile.md +128 -0
- package/src/skills/mentor/references/thought-style-profile.md +138 -0
- package/src/skills/mentor/references/work-profile.md +289 -0
- package/src/skills/mentor/references/workflow-profile.md +240 -0
- package/src/skills/optimize/SKILL.md +1 -0
- package/src/skills/rebuttal/SKILL.md +1 -0
- package/src/skills/review/SKILL.md +1 -0
- package/src/skills/scout/SKILL.md +8 -0
- package/src/skills/write/SKILL.md +1 -0
- package/src/tui/dist/app/AppContainer.js +19 -11
- package/src/tui/dist/index.js +4 -1
- package/src/tui/dist/lib/api.js +33 -3
- package/src/tui/package.json +1 -1
- package/src/ui/dist/assets/AiManusChatView-Bv-Z8YpU.js +204 -0
- package/src/ui/dist/assets/AnalysisPlugin-BCKAfjba.js +1 -0
- package/src/ui/dist/assets/CliPlugin-BCKcpc35.js +109 -0
- package/src/ui/dist/assets/CodeEditorPlugin-DbOfSJ8K.js +2 -0
- package/src/ui/dist/assets/CodeViewerPlugin-CbaFRrUU.js +270 -0
- package/src/ui/dist/assets/DocViewerPlugin-DAjLVeQD.js +7 -0
- package/src/ui/dist/assets/GitCommitViewerPlugin-CIUqbUDO.js +1 -0
- package/src/ui/dist/assets/GitDiffViewerPlugin-CQACjoAA.js +6 -0
- package/src/ui/dist/assets/GitSnapshotViewer-0r4nLPke.js +30 -0
- package/src/ui/dist/assets/ImageViewerPlugin-nBOmI2v_.js +26 -0
- package/src/ui/dist/assets/LabCopilotPanel-BHxOxF4z.js +14 -0
- package/src/ui/dist/assets/LabPlugin-BKoZGs95.js +22 -0
- package/src/ui/dist/assets/LatexPlugin-ZwtV8pIp.js +25 -0
- package/src/ui/dist/assets/MarkdownViewerPlugin-DKqVfKyW.js +128 -0
- package/src/ui/dist/assets/MarketplacePlugin-BwxStZ9D.js +13 -0
- package/src/ui/dist/assets/NotebookEditor-BEQhaQbt.js +81 -0
- package/src/ui/dist/assets/{NotebookEditor-CccQYZjX.css → NotebookEditor-BHH8rdGj.css} +1 -1
- package/src/ui/dist/assets/NotebookEditor-BOr3x3Ej.css +1 -0
- package/src/ui/dist/assets/NotebookEditor-DB9N_T9q.js +361 -0
- package/src/ui/dist/assets/PdfLoader-Cy5jtWrr.css +1 -0
- package/src/ui/dist/assets/PdfLoader-eWBONbQP.js +16 -0
- package/src/ui/dist/assets/PdfMarkdownPlugin-D22YOZL3.js +1 -0
- package/src/ui/dist/assets/PdfViewerPlugin-c-RK9DLM.js +17 -0
- package/src/ui/dist/assets/PdfViewerPlugin-nwwE-fjJ.css +1 -0
- package/src/ui/dist/assets/SearchPlugin-CxF9ytAx.js +16 -0
- package/src/ui/dist/assets/SearchPlugin-DA4en4hK.css +1 -0
- package/src/ui/dist/assets/TextViewerPlugin-C5xqeeUH.js +54 -0
- package/src/ui/dist/assets/VNCViewer-BoLGLnHz.js +11 -0
- package/src/ui/dist/assets/bot-DREQOxzP.js +6 -0
- package/src/ui/dist/assets/browser-CTB2jwNe.js +8 -0
- package/src/ui/dist/assets/chevron-up-C9Qpx4DE.js +6 -0
- package/src/ui/dist/assets/code-WlFHE7z_.js +6 -0
- package/src/ui/dist/assets/file-content-BZMz3RYp.js +1 -0
- package/src/ui/dist/assets/file-diff-panel-CQhw0jS2.js +1 -0
- package/src/ui/dist/assets/file-jump-queue-DA-SdG__.js +1 -0
- package/src/ui/dist/assets/file-socket-CfQPKQKj.js +1 -0
- package/src/ui/dist/assets/git-commit-horizontal-DxZ8DCZh.js +6 -0
- package/src/ui/dist/assets/image-Bgl4VIyx.js +6 -0
- package/src/ui/dist/assets/index-BpV6lusQ.css +33 -0
- package/src/ui/dist/assets/index-CBNVuWcP.js +2496 -0
- package/src/ui/dist/assets/index-CwNu1aH4.js +11 -0
- package/src/ui/dist/assets/index-DrUnlf6K.js +1 -0
- package/src/ui/dist/assets/index-NW-h8VzN.js +1 -0
- package/src/ui/dist/assets/monaco-CiHMMNH_.js +1 -0
- package/src/ui/dist/assets/pdf-effect-queue-J8OnM0jE.js +6 -0
- package/src/ui/dist/assets/plugin-monaco-C8UgLomw.js +19 -0
- package/src/ui/dist/assets/plugin-notebook-HbW2K-1c.js +169 -0
- package/src/ui/dist/assets/plugin-pdf-CR8hgQBV.js +357 -0
- package/src/ui/dist/assets/plugin-terminal-MXFIPun8.js +227 -0
- package/src/ui/dist/assets/popover-CLc0pPP8.js +1 -0
- package/src/ui/dist/assets/project-sync-C9IdzdZW.js +1 -0
- package/src/ui/dist/assets/select-Cs2PmzwL.js +11 -0
- package/src/ui/dist/assets/sigma-ClKcHAXm.js +6 -0
- package/src/ui/dist/assets/trash-DwpbFr3w.js +11 -0
- package/src/ui/dist/assets/useCliAccess-NQ8m0Let.js +1 -0
- package/src/ui/dist/assets/useFileDiffOverlay-FuhcnKiw.js +1 -0
- package/src/ui/dist/assets/wrap-text-BC-Hltpd.js +11 -0
- package/src/ui/dist/assets/zoom-out-E_gaeAxL.js +11 -0
- package/src/ui/dist/index.html +5 -2
- package/src/ui/dist/assets/AiManusChatView-DDjbFnbt.js +0 -26597
- package/src/ui/dist/assets/AnalysisPlugin-Yb5IdmaU.js +0 -123
- package/src/ui/dist/assets/CliPlugin-e64sreyu.js +0 -31037
- package/src/ui/dist/assets/CodeEditorPlugin-C4D2TIkU.js +0 -427
- package/src/ui/dist/assets/CodeViewerPlugin-BVoNZIvC.js +0 -905
- package/src/ui/dist/assets/DocViewerPlugin-CLChbllo.js +0 -278
- package/src/ui/dist/assets/GitDiffViewerPlugin-C4xeFyFQ.js +0 -2661
- package/src/ui/dist/assets/ImageViewerPlugin-OiMUAcLi.js +0 -500
- package/src/ui/dist/assets/LabCopilotPanel-BjD2ThQF.js +0 -4104
- package/src/ui/dist/assets/LabPlugin-DQPg-NrB.js +0 -2677
- package/src/ui/dist/assets/LatexPlugin-CI05XAV9.js +0 -1792
- package/src/ui/dist/assets/MarkdownViewerPlugin-DpeBLYZf.js +0 -308
- package/src/ui/dist/assets/MarketplacePlugin-DolE58Q2.js +0 -413
- package/src/ui/dist/assets/NotebookEditor-7Qm2rSWD.js +0 -4214
- package/src/ui/dist/assets/NotebookEditor-C1kWaxKi.js +0 -84873
- package/src/ui/dist/assets/NotebookEditor-C3VQ7ylN.css +0 -1405
- package/src/ui/dist/assets/PdfLoader-BfOHw8Zw.js +0 -25468
- package/src/ui/dist/assets/PdfLoader-C-Y707R3.css +0 -49
- package/src/ui/dist/assets/PdfMarkdownPlugin-BulDREv1.js +0 -409
- package/src/ui/dist/assets/PdfViewerPlugin-C-daaOaL.js +0 -3095
- package/src/ui/dist/assets/PdfViewerPlugin-DQ11QcSf.css +0 -3627
- package/src/ui/dist/assets/SearchPlugin-CjpaiJ3A.js +0 -741
- package/src/ui/dist/assets/SearchPlugin-DDMrGDkh.css +0 -379
- package/src/ui/dist/assets/TextViewerPlugin-BxIyqPQC.js +0 -472
- package/src/ui/dist/assets/VNCViewer-HAg9mF7M.js +0 -18821
- package/src/ui/dist/assets/awareness-C0NPR2Dj.js +0 -292
- package/src/ui/dist/assets/bot-0DYntytV.js +0 -21
- package/src/ui/dist/assets/browser-BAcuE0Xj.js +0 -2895
- package/src/ui/dist/assets/code-B20Slj_w.js +0 -17
- package/src/ui/dist/assets/file-content-DT24KFma.js +0 -377
- package/src/ui/dist/assets/file-diff-panel-DK13YPql.js +0 -92
- package/src/ui/dist/assets/file-jump-queue-r5XKgJEV.js +0 -16
- package/src/ui/dist/assets/file-socket-B4T2o4nR.js +0 -58
- package/src/ui/dist/assets/function-B5QZkkHC.js +0 -1895
- package/src/ui/dist/assets/image-DSeR_sDS.js +0 -18
- package/src/ui/dist/assets/index-BrFje2Uk.js +0 -120
- package/src/ui/dist/assets/index-BwRJaoTl.js +0 -25
- package/src/ui/dist/assets/index-D_E4281X.js +0 -221322
- package/src/ui/dist/assets/index-DnYB3xb1.js +0 -159
- package/src/ui/dist/assets/index-G7AcWcMu.css +0 -12594
- package/src/ui/dist/assets/monaco-LExaAN3Y.js +0 -623
- package/src/ui/dist/assets/pdf-effect-queue-BJk5okWJ.js +0 -47
- package/src/ui/dist/assets/pdf_viewer-e0g1is2C.js +0 -8206
- package/src/ui/dist/assets/popover-D3Gg_FoV.js +0 -476
- package/src/ui/dist/assets/project-sync-C_ygLlVU.js +0 -297
- package/src/ui/dist/assets/select-CpAK6uWm.js +0 -1690
- package/src/ui/dist/assets/sigma-DEccaSgk.js +0 -22
- package/src/ui/dist/assets/square-check-big-uUfyVsbD.js +0 -17
- package/src/ui/dist/assets/trash-CXvwwSe8.js +0 -32
- package/src/ui/dist/assets/useCliAccess-Bnop4mgR.js +0 -957
- package/src/ui/dist/assets/useFileDiffOverlay-B8eUAX0I.js +0 -53
- package/src/ui/dist/assets/wrap-text-9vbOBpkW.js +0 -35
- package/src/ui/dist/assets/yjs-DncrqiZ8.js +0 -11243
- package/src/ui/dist/assets/zoom-out-BgVMmOW4.js +0 -34
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import{r as Ge,R as je}from"./plugin-monaco-C8UgLomw.js";import{g as A_}from"./plugin-terminal-MXFIPun8.js";var T_={exports:{}},An={},N_={exports:{}},M_={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* scheduler.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/(function(t){function e(v,T){var D=v.length;v.push(T);e:for(;0<D;){var B=D-1>>>1,V=v[B];if(0<i(V,T))v[B]=T,v[D]=V,D=B;else break e}}function n(v){return v.length===0?null:v[0]}function r(v){if(v.length===0)return null;var T=v[0],D=v.pop();if(D!==T){v[0]=D;e:for(var B=0,V=v.length,de=V>>>1;B<de;){var fe=2*(B+1)-1,ie=v[fe],ge=fe+1,nt=v[ge];if(0>i(ie,D))ge<V&&0>i(nt,ie)?(v[B]=nt,v[ge]=D,B=ge):(v[B]=ie,v[fe]=D,B=fe);else if(ge<V&&0>i(nt,D))v[B]=nt,v[ge]=D,B=ge;else break e}}return T}function i(v,T){var D=v.sortIndex-T.sortIndex;return D!==0?D:v.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var a=[],u=[],c=1,d=null,f=3,h=!1,p=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(v){for(var T=n(u);T!==null;){if(T.callback===null)r(u);else if(T.startTime<=v)r(u),T.sortIndex=T.expirationTime,e(a,T);else break;T=n(u)}}function y(v){if(g=!1,k(v),!p)if(n(a)!==null)p=!0,A(_);else{var T=n(u);T!==null&&C(y,T.startTime-v)}}function _(v,T){p=!1,g&&(g=!1,m(S),S=-1),h=!0;var D=f;try{for(k(T),d=n(a);d!==null&&(!(d.expirationTime>T)||v&&!G());){var B=d.callback;if(typeof B=="function"){d.callback=null,f=d.priorityLevel;var V=B(d.expirationTime<=T);T=t.unstable_now(),typeof V=="function"?d.callback=V:d===n(a)&&r(a),k(T)}else r(a);d=n(a)}if(d!==null)var de=!0;else{var fe=n(u);fe!==null&&C(y,fe.startTime-T),de=!1}return de}finally{d=null,f=D,h=!1}}var w=!1,x=null,S=-1,O=5,L=-1;function G(){return!(t.unstable_now()-L<O)}function U(){if(x!==null){var v=t.unstable_now();L=v;var T=!0;try{T=x(!0,v)}finally{T?j():(w=!1,x=null)}}else w=!1}var j;if(typeof E=="function")j=function(){E(U)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,Z=te.port2;te.port1.onmessage=U,j=function(){Z.postMessage(null)}}else j=function(){b(U,0)};function A(v){x=v,w||(w=!0,j())}function C(v,T){S=b(function(){v(t.unstable_now())},T)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(v){v.callback=null},t.unstable_continueExecution=function(){p||h||(p=!0,A(_))},t.unstable_forceFrameRate=function(v){0>v||125<v?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<v?Math.floor(1e3/v):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return n(a)},t.unstable_next=function(v){switch(f){case 1:case 2:case 3:var T=3;break;default:T=f}var D=f;f=T;try{return v()}finally{f=D}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(v,T){switch(v){case 1:case 2:case 3:case 4:case 5:break;default:v=3}var D=f;f=v;try{return T()}finally{f=D}},t.unstable_scheduleCallback=function(v,T,D){var B=t.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?B+D:B):D=B,v){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=D+V,v={id:c++,callback:T,priorityLevel:v,startTime:D,expirationTime:V,sortIndex:-1},D>B?(v.sortIndex=D,e(u,v),n(a)===null&&v===n(u)&&(g?(m(S),S=-1):g=!0,C(y,D-B))):(v.sortIndex=V,e(a,v),p||h||(p=!0,A(_))),v},t.unstable_shouldYield=G,t.unstable_wrapCallback=function(v){var T=f;return function(){var D=f;f=T;try{return v.apply(this,arguments)}finally{f=D}}}})(M_);N_.exports=M_;var cT=N_.exports;/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-dom.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var dT=Ge,xn=cT;function F(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var O_=new Set,Ra={};function so(t,e){Qo(t,e),Qo(t+"Capture",e)}function Qo(t,e){for(Ra[t]=e,t=0;t<e.length;t++)O_.add(e[t])}var Qr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_0=Object.prototype.hasOwnProperty,fT=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ry={},iy={};function hT(t){return _0.call(iy,t)?!0:_0.call(ry,t)?!1:fT.test(t)?iy[t]=!0:(ry[t]=!0,!1)}function pT(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function gT(t,e,n,r){if(e===null||typeof e>"u"||pT(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Gt(t,e,n,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var At={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){At[t]=new Gt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];At[e]=new Gt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){At[t]=new Gt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){At[t]=new Gt(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){At[t]=new Gt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){At[t]=new Gt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){At[t]=new Gt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){At[t]=new Gt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){At[t]=new Gt(t,5,!1,t.toLowerCase(),null,!1,!1)});var Em=/[\-:]([a-z])/g;function km(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Em,km);At[e]=new Gt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Em,km);At[e]=new Gt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Em,km);At[e]=new Gt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){At[t]=new Gt(t,1,!1,t.toLowerCase(),null,!1,!1)});At.xlinkHref=new Gt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){At[t]=new Gt(t,1,!1,t.toLowerCase(),null,!0,!0)});function wm(t,e,n,r){var i=At.hasOwnProperty(e)?At[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(gT(e,n,i,r)&&(n=null),r||i===null?hT(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var ai=dT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ec=Symbol.for("react.element"),To=Symbol.for("react.portal"),No=Symbol.for("react.fragment"),_m=Symbol.for("react.strict_mode"),v0=Symbol.for("react.profiler"),D_=Symbol.for("react.provider"),R_=Symbol.for("react.context"),vm=Symbol.for("react.forward_ref"),x0=Symbol.for("react.suspense"),S0=Symbol.for("react.suspense_list"),xm=Symbol.for("react.memo"),pi=Symbol.for("react.lazy"),I_=Symbol.for("react.offscreen"),sy=Symbol.iterator;function Ul(t){return t===null||typeof t!="object"?null:(t=sy&&t[sy]||t["@@iterator"],typeof t=="function"?t:null)}var ze=Object.assign,Gh;function ea(t){if(Gh===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Gh=e&&e[1]||""}return`
|
|
18
|
+
`+Gh+t}var Yh=!1;function Jh(t,e){if(!t||Yh)return"";Yh=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var r=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){r=u}t.call(e.prototype)}else{try{throw Error()}catch(u){r=u}t()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
|
|
19
|
+
`),s=r.stack.split(`
|
|
20
|
+
`),o=i.length-1,l=s.length-1;1<=o&&0<=l&&i[o]!==s[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==s[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==s[l]){var a=`
|
|
21
|
+
`+i[o].replace(" at new "," at ");return t.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",t.displayName)),a}while(1<=o&&0<=l);break}}}finally{Yh=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?ea(t):""}function mT(t){switch(t.tag){case 5:return ea(t.type);case 16:return ea("Lazy");case 13:return ea("Suspense");case 19:return ea("SuspenseList");case 0:case 2:case 15:return t=Jh(t.type,!1),t;case 11:return t=Jh(t.type.render,!1),t;case 1:return t=Jh(t.type,!0),t;default:return""}}function C0(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case No:return"Fragment";case To:return"Portal";case v0:return"Profiler";case _m:return"StrictMode";case x0:return"Suspense";case S0:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case R_:return(t.displayName||"Context")+".Consumer";case D_:return(t._context.displayName||"Context")+".Provider";case vm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case xm:return e=t.displayName||null,e!==null?e:C0(t.type)||"Memo";case pi:e=t._payload,t=t._init;try{return C0(t(e))}catch{}}return null}function bT(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return C0(e);case 8:return e===_m?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Ji(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function L_(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function yT(t){var e=L_(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function tc(t){t._valueTracker||(t._valueTracker=yT(t))}function P_(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=L_(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function bd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function A0(t,e){var n=e.checked;return ze({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function oy(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Ji(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function F_(t,e){e=e.checked,e!=null&&wm(t,"checked",e,!1)}function T0(t,e){F_(t,e);var n=Ji(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?N0(t,e.type,n):e.hasOwnProperty("defaultValue")&&N0(t,e.type,Ji(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function ly(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function N0(t,e,n){(e!=="number"||bd(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var ta=Array.isArray;function Ho(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+Ji(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function M0(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(F(91));return ze({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function ay(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(F(92));if(ta(n)){if(1<n.length)throw Error(F(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Ji(n)}}function B_(t,e){var n=Ji(e.value),r=Ji(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function uy(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function z_(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function O0(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?z_(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var nc,$_=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(nc=nc||document.createElement("div"),nc.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=nc.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ia(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ua={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ET=["Webkit","ms","Moz","O"];Object.keys(ua).forEach(function(t){ET.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ua[e]=ua[t]})});function U_(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ua.hasOwnProperty(t)&&ua[t]?(""+e).trim():e+"px"}function H_(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=U_(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var kT=ze({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function D0(t,e){if(e){if(kT[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(F(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(F(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(F(61))}if(e.style!=null&&typeof e.style!="object")throw Error(F(62))}}function R0(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var I0=null;function Sm(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var L0=null,Vo=null,Wo=null;function cy(t){if(t=Fu(t)){if(typeof L0!="function")throw Error(F(280));var e=t.stateNode;e&&(e=Xf(e),L0(t.stateNode,t.type,e))}}function V_(t){Vo?Wo?Wo.push(t):Wo=[t]:Vo=t}function W_(){if(Vo){var t=Vo,e=Wo;if(Wo=Vo=null,cy(t),e)for(t=0;t<e.length;t++)cy(e[t])}}function K_(t,e){return t(e)}function j_(){}var Zh=!1;function q_(t,e,n){if(Zh)return t(e,n);Zh=!0;try{return K_(t,e,n)}finally{Zh=!1,(Vo!==null||Wo!==null)&&(j_(),W_())}}function La(t,e){var n=t.stateNode;if(n===null)return null;var r=Xf(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(F(231,e,typeof n));return n}var P0=!1;if(Qr)try{var Hl={};Object.defineProperty(Hl,"passive",{get:function(){P0=!0}}),window.addEventListener("test",Hl,Hl),window.removeEventListener("test",Hl,Hl)}catch{P0=!1}function wT(t,e,n,r,i,s,o,l,a){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(c){this.onError(c)}}var ca=!1,yd=null,Ed=!1,F0=null,_T={onError:function(t){ca=!0,yd=t}};function vT(t,e,n,r,i,s,o,l,a){ca=!1,yd=null,wT.apply(_T,arguments)}function xT(t,e,n,r,i,s,o,l,a){if(vT.apply(this,arguments),ca){if(ca){var u=yd;ca=!1,yd=null}else throw Error(F(198));Ed||(Ed=!0,F0=u)}}function oo(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function G_(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function dy(t){if(oo(t)!==t)throw Error(F(188))}function ST(t){var e=t.alternate;if(!e){if(e=oo(t),e===null)throw Error(F(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return dy(i),t;if(s===r)return dy(i),e;s=s.sibling}throw Error(F(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,l=i.child;l;){if(l===n){o=!0,n=i,r=s;break}if(l===r){o=!0,r=i,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,r=i;break}if(l===r){o=!0,r=s,n=i;break}l=l.sibling}if(!o)throw Error(F(189))}}if(n.alternate!==r)throw Error(F(190))}if(n.tag!==3)throw Error(F(188));return n.stateNode.current===n?t:e}function Y_(t){return t=ST(t),t!==null?J_(t):null}function J_(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=J_(t);if(e!==null)return e;t=t.sibling}return null}var Z_=xn.unstable_scheduleCallback,fy=xn.unstable_cancelCallback,CT=xn.unstable_shouldYield,AT=xn.unstable_requestPaint,qe=xn.unstable_now,TT=xn.unstable_getCurrentPriorityLevel,Cm=xn.unstable_ImmediatePriority,X_=xn.unstable_UserBlockingPriority,kd=xn.unstable_NormalPriority,NT=xn.unstable_LowPriority,Q_=xn.unstable_IdlePriority,Gf=null,vr=null;function MT(t){if(vr&&typeof vr.onCommitFiberRoot=="function")try{vr.onCommitFiberRoot(Gf,t,void 0,(t.current.flags&128)===128)}catch{}}var or=Math.clz32?Math.clz32:RT,OT=Math.log,DT=Math.LN2;function RT(t){return t>>>=0,t===0?32:31-(OT(t)/DT|0)|0}var rc=64,ic=4194304;function na(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function wd(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?r=na(l):(s&=o,s!==0&&(r=na(s)))}else o=n&~i,o!==0?r=na(o):s!==0&&(r=na(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-or(e),i=1<<n,r|=t[n],e&=~i;return r}function IT(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function LT(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var o=31-or(s),l=1<<o,a=i[o];a===-1?(!(l&n)||l&r)&&(i[o]=IT(l,e)):a<=e&&(t.expiredLanes|=l),s&=~l}}function B0(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function ev(){var t=rc;return rc<<=1,!(rc&4194240)&&(rc=64),t}function Xh(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Lu(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-or(e),t[e]=n}function PT(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-or(n),s=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~s}}function Am(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-or(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var _e=0;function tv(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var nv,Tm,rv,iv,sv,z0=!1,sc=[],Pi=null,Fi=null,Bi=null,Pa=new Map,Fa=new Map,ki=[],FT="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function hy(t,e){switch(t){case"focusin":case"focusout":Pi=null;break;case"dragenter":case"dragleave":Fi=null;break;case"mouseover":case"mouseout":Bi=null;break;case"pointerover":case"pointerout":Pa.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fa.delete(e.pointerId)}}function Vl(t,e,n,r,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=Fu(e),e!==null&&Tm(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function BT(t,e,n,r,i){switch(e){case"focusin":return Pi=Vl(Pi,t,e,n,r,i),!0;case"dragenter":return Fi=Vl(Fi,t,e,n,r,i),!0;case"mouseover":return Bi=Vl(Bi,t,e,n,r,i),!0;case"pointerover":var s=i.pointerId;return Pa.set(s,Vl(Pa.get(s)||null,t,e,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Fa.set(s,Vl(Fa.get(s)||null,t,e,n,r,i)),!0}return!1}function ov(t){var e=xs(t.target);if(e!==null){var n=oo(e);if(n!==null){if(e=n.tag,e===13){if(e=G_(n),e!==null){t.blockedOn=e,sv(t.priority,function(){rv(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Kc(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=$0(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);I0=r,n.target.dispatchEvent(r),I0=null}else return e=Fu(n),e!==null&&Tm(e),t.blockedOn=n,!1;e.shift()}return!0}function py(t,e,n){Kc(t)&&n.delete(e)}function zT(){z0=!1,Pi!==null&&Kc(Pi)&&(Pi=null),Fi!==null&&Kc(Fi)&&(Fi=null),Bi!==null&&Kc(Bi)&&(Bi=null),Pa.forEach(py),Fa.forEach(py)}function Wl(t,e){t.blockedOn===e&&(t.blockedOn=null,z0||(z0=!0,xn.unstable_scheduleCallback(xn.unstable_NormalPriority,zT)))}function Ba(t){function e(i){return Wl(i,t)}if(0<sc.length){Wl(sc[0],t);for(var n=1;n<sc.length;n++){var r=sc[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Pi!==null&&Wl(Pi,t),Fi!==null&&Wl(Fi,t),Bi!==null&&Wl(Bi,t),Pa.forEach(e),Fa.forEach(e),n=0;n<ki.length;n++)r=ki[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<ki.length&&(n=ki[0],n.blockedOn===null);)ov(n),n.blockedOn===null&&ki.shift()}var Ko=ai.ReactCurrentBatchConfig,_d=!0;function $T(t,e,n,r){var i=_e,s=Ko.transition;Ko.transition=null;try{_e=1,Nm(t,e,n,r)}finally{_e=i,Ko.transition=s}}function UT(t,e,n,r){var i=_e,s=Ko.transition;Ko.transition=null;try{_e=4,Nm(t,e,n,r)}finally{_e=i,Ko.transition=s}}function Nm(t,e,n,r){if(_d){var i=$0(t,e,n,r);if(i===null)ap(t,e,r,vd,n),hy(t,r);else if(BT(i,t,e,n,r))r.stopPropagation();else if(hy(t,r),e&4&&-1<FT.indexOf(t)){for(;i!==null;){var s=Fu(i);if(s!==null&&nv(s),s=$0(t,e,n,r),s===null&&ap(t,e,r,vd,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else ap(t,e,r,null,n)}}var vd=null;function $0(t,e,n,r){if(vd=null,t=Sm(r),t=xs(t),t!==null)if(e=oo(t),e===null)t=null;else if(n=e.tag,n===13){if(t=G_(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return vd=t,null}function lv(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(TT()){case Cm:return 1;case X_:return 4;case kd:case NT:return 16;case Q_:return 536870912;default:return 16}default:return 16}}var Ai=null,Mm=null,jc=null;function av(){if(jc)return jc;var t,e=Mm,n=e.length,r,i="value"in Ai?Ai.value:Ai.textContent,s=i.length;for(t=0;t<n&&e[t]===i[t];t++);var o=n-t;for(r=1;r<=o&&e[n-r]===i[s-r];r++);return jc=i.slice(t,1<r?1-r:void 0)}function qc(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function oc(){return!0}function gy(){return!1}function Tn(t){function e(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(n=t[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?oc:gy,this.isPropagationStopped=gy,this}return ze(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=oc)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=oc)},persist:function(){},isPersistent:oc}),e}var Tl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Om=Tn(Tl),Pu=ze({},Tl,{view:0,detail:0}),HT=Tn(Pu),Qh,ep,Kl,Yf=ze({},Pu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dm,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Kl&&(Kl&&t.type==="mousemove"?(Qh=t.screenX-Kl.screenX,ep=t.screenY-Kl.screenY):ep=Qh=0,Kl=t),Qh)},movementY:function(t){return"movementY"in t?t.movementY:ep}}),my=Tn(Yf),VT=ze({},Yf,{dataTransfer:0}),WT=Tn(VT),KT=ze({},Pu,{relatedTarget:0}),tp=Tn(KT),jT=ze({},Tl,{animationName:0,elapsedTime:0,pseudoElement:0}),qT=Tn(jT),GT=ze({},Tl,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),YT=Tn(GT),JT=ze({},Tl,{data:0}),by=Tn(JT),ZT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},XT={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},QT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function eN(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=QT[t])?!!e[t]:!1}function Dm(){return eN}var tN=ze({},Pu,{key:function(t){if(t.key){var e=ZT[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=qc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?XT[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dm,charCode:function(t){return t.type==="keypress"?qc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?qc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),nN=Tn(tN),rN=ze({},Yf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yy=Tn(rN),iN=ze({},Pu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dm}),sN=Tn(iN),oN=ze({},Tl,{propertyName:0,elapsedTime:0,pseudoElement:0}),lN=Tn(oN),aN=ze({},Yf,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),uN=Tn(aN),cN=[9,13,27,32],Rm=Qr&&"CompositionEvent"in window,da=null;Qr&&"documentMode"in document&&(da=document.documentMode);var dN=Qr&&"TextEvent"in window&&!da,uv=Qr&&(!Rm||da&&8<da&&11>=da),Ey=" ",ky=!1;function cv(t,e){switch(t){case"keyup":return cN.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dv(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Mo=!1;function fN(t,e){switch(t){case"compositionend":return dv(e);case"keypress":return e.which!==32?null:(ky=!0,Ey);case"textInput":return t=e.data,t===Ey&&ky?null:t;default:return null}}function hN(t,e){if(Mo)return t==="compositionend"||!Rm&&cv(t,e)?(t=av(),jc=Mm=Ai=null,Mo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return uv&&e.locale!=="ko"?null:e.data;default:return null}}var pN={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function wy(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!pN[t.type]:e==="textarea"}function fv(t,e,n,r){V_(r),e=xd(e,"onChange"),0<e.length&&(n=new Om("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var fa=null,za=null;function gN(t){vv(t,0)}function Jf(t){var e=Ro(t);if(P_(e))return t}function mN(t,e){if(t==="change")return e}var hv=!1;if(Qr){var np;if(Qr){var rp="oninput"in document;if(!rp){var _y=document.createElement("div");_y.setAttribute("oninput","return;"),rp=typeof _y.oninput=="function"}np=rp}else np=!1;hv=np&&(!document.documentMode||9<document.documentMode)}function vy(){fa&&(fa.detachEvent("onpropertychange",pv),za=fa=null)}function pv(t){if(t.propertyName==="value"&&Jf(za)){var e=[];fv(e,za,t,Sm(t)),q_(gN,e)}}function bN(t,e,n){t==="focusin"?(vy(),fa=e,za=n,fa.attachEvent("onpropertychange",pv)):t==="focusout"&&vy()}function yN(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Jf(za)}function EN(t,e){if(t==="click")return Jf(e)}function kN(t,e){if(t==="input"||t==="change")return Jf(e)}function wN(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ar=typeof Object.is=="function"?Object.is:wN;function $a(t,e){if(ar(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!_0.call(e,i)||!ar(t[i],e[i]))return!1}return!0}function xy(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Sy(t,e){var n=xy(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=xy(n)}}function gv(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?gv(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function mv(){for(var t=window,e=bd();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=bd(t.document)}return e}function Im(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function _N(t){var e=mv(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&gv(n.ownerDocument.documentElement,n)){if(r!==null&&Im(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=Sy(n,s);var o=Sy(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var vN=Qr&&"documentMode"in document&&11>=document.documentMode,Oo=null,U0=null,ha=null,H0=!1;function Cy(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;H0||Oo==null||Oo!==bd(r)||(r=Oo,"selectionStart"in r&&Im(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ha&&$a(ha,r)||(ha=r,r=xd(U0,"onSelect"),0<r.length&&(e=new Om("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Oo)))}function lc(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Do={animationend:lc("Animation","AnimationEnd"),animationiteration:lc("Animation","AnimationIteration"),animationstart:lc("Animation","AnimationStart"),transitionend:lc("Transition","TransitionEnd")},ip={},bv={};Qr&&(bv=document.createElement("div").style,"AnimationEvent"in window||(delete Do.animationend.animation,delete Do.animationiteration.animation,delete Do.animationstart.animation),"TransitionEvent"in window||delete Do.transitionend.transition);function Zf(t){if(ip[t])return ip[t];if(!Do[t])return t;var e=Do[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in bv)return ip[t]=e[n];return t}var yv=Zf("animationend"),Ev=Zf("animationiteration"),kv=Zf("animationstart"),wv=Zf("transitionend"),_v=new Map,Ay="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ss(t,e){_v.set(t,e),so(e,[t])}for(var sp=0;sp<Ay.length;sp++){var op=Ay[sp],xN=op.toLowerCase(),SN=op[0].toUpperCase()+op.slice(1);ss(xN,"on"+SN)}ss(yv,"onAnimationEnd");ss(Ev,"onAnimationIteration");ss(kv,"onAnimationStart");ss("dblclick","onDoubleClick");ss("focusin","onFocus");ss("focusout","onBlur");ss(wv,"onTransitionEnd");Qo("onMouseEnter",["mouseout","mouseover"]);Qo("onMouseLeave",["mouseout","mouseover"]);Qo("onPointerEnter",["pointerout","pointerover"]);Qo("onPointerLeave",["pointerout","pointerover"]);so("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));so("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));so("onBeforeInput",["compositionend","keypress","textInput","paste"]);so("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));so("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));so("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ra="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),CN=new Set("cancel close invalid load scroll toggle".split(" ").concat(ra));function Ty(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,xT(r,e,void 0,t),t.currentTarget=null}function vv(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var o=r.length-1;0<=o;o--){var l=r[o],a=l.instance,u=l.currentTarget;if(l=l.listener,a!==s&&i.isPropagationStopped())break e;Ty(i,l,u),s=a}else for(o=0;o<r.length;o++){if(l=r[o],a=l.instance,u=l.currentTarget,l=l.listener,a!==s&&i.isPropagationStopped())break e;Ty(i,l,u),s=a}}}if(Ed)throw t=F0,Ed=!1,F0=null,t}function De(t,e){var n=e[q0];n===void 0&&(n=e[q0]=new Set);var r=t+"__bubble";n.has(r)||(xv(e,t,2,!1),n.add(r))}function lp(t,e,n){var r=0;e&&(r|=4),xv(n,t,r,e)}var ac="_reactListening"+Math.random().toString(36).slice(2);function Ua(t){if(!t[ac]){t[ac]=!0,O_.forEach(function(n){n!=="selectionchange"&&(CN.has(n)||lp(n,!1,t),lp(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[ac]||(e[ac]=!0,lp("selectionchange",!1,e))}}function xv(t,e,n,r){switch(lv(e)){case 1:var i=$T;break;case 4:i=UT;break;default:i=Nm}n=i.bind(null,e,n,t),i=void 0,!P0||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function ap(t,e,n,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var a=o.tag;if((a===3||a===4)&&(a=o.stateNode.containerInfo,a===i||a.nodeType===8&&a.parentNode===i))return;o=o.return}for(;l!==null;){if(o=xs(l),o===null)return;if(a=o.tag,a===5||a===6){r=s=o;continue e}l=l.parentNode}}r=r.return}q_(function(){var u=s,c=Sm(n),d=[];e:{var f=_v.get(t);if(f!==void 0){var h=Om,p=t;switch(t){case"keypress":if(qc(n)===0)break e;case"keydown":case"keyup":h=nN;break;case"focusin":p="focus",h=tp;break;case"focusout":p="blur",h=tp;break;case"beforeblur":case"afterblur":h=tp;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=my;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=WT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=sN;break;case yv:case Ev:case kv:h=qT;break;case wv:h=lN;break;case"scroll":h=HT;break;case"wheel":h=uN;break;case"copy":case"cut":case"paste":h=YT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=yy}var g=(e&4)!==0,b=!g&&t==="scroll",m=g?f!==null?f+"Capture":null:f;g=[];for(var E=u,k;E!==null;){k=E;var y=k.stateNode;if(k.tag===5&&y!==null&&(k=y,m!==null&&(y=La(E,m),y!=null&&g.push(Ha(E,y,k)))),b)break;E=E.return}0<g.length&&(f=new h(f,p,null,n,c),d.push({event:f,listeners:g}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",f&&n!==I0&&(p=n.relatedTarget||n.fromElement)&&(xs(p)||p[ei]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(p=n.relatedTarget||n.toElement,h=u,p=p?xs(p):null,p!==null&&(b=oo(p),p!==b||p.tag!==5&&p.tag!==6)&&(p=null)):(h=null,p=u),h!==p)){if(g=my,y="onMouseLeave",m="onMouseEnter",E="mouse",(t==="pointerout"||t==="pointerover")&&(g=yy,y="onPointerLeave",m="onPointerEnter",E="pointer"),b=h==null?f:Ro(h),k=p==null?f:Ro(p),f=new g(y,E+"leave",h,n,c),f.target=b,f.relatedTarget=k,y=null,xs(c)===u&&(g=new g(m,E+"enter",p,n,c),g.target=k,g.relatedTarget=b,y=g),b=y,h&&p)t:{for(g=h,m=p,E=0,k=g;k;k=go(k))E++;for(k=0,y=m;y;y=go(y))k++;for(;0<E-k;)g=go(g),E--;for(;0<k-E;)m=go(m),k--;for(;E--;){if(g===m||m!==null&&g===m.alternate)break t;g=go(g),m=go(m)}g=null}else g=null;h!==null&&Ny(d,f,h,g,!1),p!==null&&b!==null&&Ny(d,b,p,g,!0)}}e:{if(f=u?Ro(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var _=mN;else if(wy(f))if(hv)_=kN;else{_=yN;var w=bN}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(_=EN);if(_&&(_=_(t,u))){fv(d,_,n,c);break e}w&&w(t,f,u),t==="focusout"&&(w=f._wrapperState)&&w.controlled&&f.type==="number"&&N0(f,"number",f.value)}switch(w=u?Ro(u):window,t){case"focusin":(wy(w)||w.contentEditable==="true")&&(Oo=w,U0=u,ha=null);break;case"focusout":ha=U0=Oo=null;break;case"mousedown":H0=!0;break;case"contextmenu":case"mouseup":case"dragend":H0=!1,Cy(d,n,c);break;case"selectionchange":if(vN)break;case"keydown":case"keyup":Cy(d,n,c)}var x;if(Rm)e:{switch(t){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Mo?cv(t,n)&&(S="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(S="onCompositionStart");S&&(uv&&n.locale!=="ko"&&(Mo||S!=="onCompositionStart"?S==="onCompositionEnd"&&Mo&&(x=av()):(Ai=c,Mm="value"in Ai?Ai.value:Ai.textContent,Mo=!0)),w=xd(u,S),0<w.length&&(S=new by(S,t,null,n,c),d.push({event:S,listeners:w}),x?S.data=x:(x=dv(n),x!==null&&(S.data=x)))),(x=dN?fN(t,n):hN(t,n))&&(u=xd(u,"onBeforeInput"),0<u.length&&(c=new by("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=x))}vv(d,e)})}function Ha(t,e,n){return{instance:t,listener:e,currentTarget:n}}function xd(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=La(t,n),s!=null&&r.unshift(Ha(t,s,i)),s=La(t,e),s!=null&&r.push(Ha(t,s,i))),t=t.return}return r}function go(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Ny(t,e,n,r,i){for(var s=e._reactName,o=[];n!==null&&n!==r;){var l=n,a=l.alternate,u=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&u!==null&&(l=u,i?(a=La(n,s),a!=null&&o.unshift(Ha(n,a,l))):i||(a=La(n,s),a!=null&&o.push(Ha(n,a,l)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var AN=/\r\n?/g,TN=/\u0000|\uFFFD/g;function My(t){return(typeof t=="string"?t:""+t).replace(AN,`
|
|
22
|
+
`).replace(TN,"")}function uc(t,e,n){if(e=My(e),My(t)!==e&&n)throw Error(F(425))}function Sd(){}var V0=null,W0=null;function K0(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var j0=typeof setTimeout=="function"?setTimeout:void 0,NN=typeof clearTimeout=="function"?clearTimeout:void 0,Oy=typeof Promise=="function"?Promise:void 0,MN=typeof queueMicrotask=="function"?queueMicrotask:typeof Oy<"u"?function(t){return Oy.resolve(null).then(t).catch(ON)}:j0;function ON(t){setTimeout(function(){throw t})}function up(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),Ba(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Ba(e)}function zi(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function Dy(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Nl=Math.random().toString(36).slice(2),Er="__reactFiber$"+Nl,Va="__reactProps$"+Nl,ei="__reactContainer$"+Nl,q0="__reactEvents$"+Nl,DN="__reactListeners$"+Nl,RN="__reactHandles$"+Nl;function xs(t){var e=t[Er];if(e)return e;for(var n=t.parentNode;n;){if(e=n[ei]||n[Er]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Dy(t);t!==null;){if(n=t[Er])return n;t=Dy(t)}return e}t=n,n=t.parentNode}return null}function Fu(t){return t=t[Er]||t[ei],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Ro(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(F(33))}function Xf(t){return t[Va]||null}var G0=[],Io=-1;function ls(t){return{current:t}}function Ie(t){0>Io||(t.current=G0[Io],G0[Io]=null,Io--)}function Ne(t,e){Io++,G0[Io]=t.current,t.current=e}var Zi={},It=ls(Zi),nn=ls(!1),Ws=Zi;function el(t,e){var n=t.type.contextTypes;if(!n)return Zi;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function rn(t){return t=t.childContextTypes,t!=null}function Cd(){Ie(nn),Ie(It)}function Ry(t,e,n){if(It.current!==Zi)throw Error(F(168));Ne(It,e),Ne(nn,n)}function Sv(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(F(108,bT(t)||"Unknown",i));return ze({},n,r)}function Ad(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Zi,Ws=It.current,Ne(It,t),Ne(nn,nn.current),!0}function Iy(t,e,n){var r=t.stateNode;if(!r)throw Error(F(169));n?(t=Sv(t,e,Ws),r.__reactInternalMemoizedMergedChildContext=t,Ie(nn),Ie(It),Ne(It,t)):Ie(nn),Ne(nn,n)}var Vr=null,Qf=!1,cp=!1;function Cv(t){Vr===null?Vr=[t]:Vr.push(t)}function IN(t){Qf=!0,Cv(t)}function as(){if(!cp&&Vr!==null){cp=!0;var t=0,e=_e;try{var n=Vr;for(_e=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Vr=null,Qf=!1}catch(i){throw Vr!==null&&(Vr=Vr.slice(t+1)),Z_(Cm,as),i}finally{_e=e,cp=!1}}return null}var Lo=[],Po=0,Td=null,Nd=0,Ln=[],Pn=0,Ks=null,Wr=1,Kr="";function ys(t,e){Lo[Po++]=Nd,Lo[Po++]=Td,Td=t,Nd=e}function Av(t,e,n){Ln[Pn++]=Wr,Ln[Pn++]=Kr,Ln[Pn++]=Ks,Ks=t;var r=Wr;t=Kr;var i=32-or(r)-1;r&=~(1<<i),n+=1;var s=32-or(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Wr=1<<32-or(e)+i|n<<i|r,Kr=s+t}else Wr=1<<s|n<<i|r,Kr=t}function Lm(t){t.return!==null&&(ys(t,1),Av(t,1,0))}function Pm(t){for(;t===Td;)Td=Lo[--Po],Lo[Po]=null,Nd=Lo[--Po],Lo[Po]=null;for(;t===Ks;)Ks=Ln[--Pn],Ln[Pn]=null,Kr=Ln[--Pn],Ln[Pn]=null,Wr=Ln[--Pn],Ln[Pn]=null}var vn=null,wn=null,Pe=!1,rr=null;function Tv(t,e){var n=Bn(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function Ly(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,vn=t,wn=zi(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,vn=t,wn=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Ks!==null?{id:Wr,overflow:Kr}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Bn(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,vn=t,wn=null,!0):!1;default:return!1}}function Y0(t){return(t.mode&1)!==0&&(t.flags&128)===0}function J0(t){if(Pe){var e=wn;if(e){var n=e;if(!Ly(t,e)){if(Y0(t))throw Error(F(418));e=zi(n.nextSibling);var r=vn;e&&Ly(t,e)?Tv(r,n):(t.flags=t.flags&-4097|2,Pe=!1,vn=t)}}else{if(Y0(t))throw Error(F(418));t.flags=t.flags&-4097|2,Pe=!1,vn=t}}}function Py(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;vn=t}function cc(t){if(t!==vn)return!1;if(!Pe)return Py(t),Pe=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!K0(t.type,t.memoizedProps)),e&&(e=wn)){if(Y0(t))throw Nv(),Error(F(418));for(;e;)Tv(t,e),e=zi(e.nextSibling)}if(Py(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(F(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){wn=zi(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}wn=null}}else wn=vn?zi(t.stateNode.nextSibling):null;return!0}function Nv(){for(var t=wn;t;)t=zi(t.nextSibling)}function tl(){wn=vn=null,Pe=!1}function Fm(t){rr===null?rr=[t]:rr.push(t)}var LN=ai.ReactCurrentBatchConfig;function jl(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(F(309));var r=n.stateNode}if(!r)throw Error(F(147,t));var i=r,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var l=i.refs;o===null?delete l[s]:l[s]=o},e._stringRef=s,e)}if(typeof t!="string")throw Error(F(284));if(!n._owner)throw Error(F(290,t))}return t}function dc(t,e){throw t=Object.prototype.toString.call(e),Error(F(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Fy(t){var e=t._init;return e(t._payload)}function Mv(t){function e(m,E){if(t){var k=m.deletions;k===null?(m.deletions=[E],m.flags|=16):k.push(E)}}function n(m,E){if(!t)return null;for(;E!==null;)e(m,E),E=E.sibling;return null}function r(m,E){for(m=new Map;E!==null;)E.key!==null?m.set(E.key,E):m.set(E.index,E),E=E.sibling;return m}function i(m,E){return m=Vi(m,E),m.index=0,m.sibling=null,m}function s(m,E,k){return m.index=k,t?(k=m.alternate,k!==null?(k=k.index,k<E?(m.flags|=2,E):k):(m.flags|=2,E)):(m.flags|=1048576,E)}function o(m){return t&&m.alternate===null&&(m.flags|=2),m}function l(m,E,k,y){return E===null||E.tag!==6?(E=bp(k,m.mode,y),E.return=m,E):(E=i(E,k),E.return=m,E)}function a(m,E,k,y){var _=k.type;return _===No?c(m,E,k.props.children,y,k.key):E!==null&&(E.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===pi&&Fy(_)===E.type)?(y=i(E,k.props),y.ref=jl(m,E,k),y.return=m,y):(y=ed(k.type,k.key,k.props,null,m.mode,y),y.ref=jl(m,E,k),y.return=m,y)}function u(m,E,k,y){return E===null||E.tag!==4||E.stateNode.containerInfo!==k.containerInfo||E.stateNode.implementation!==k.implementation?(E=yp(k,m.mode,y),E.return=m,E):(E=i(E,k.children||[]),E.return=m,E)}function c(m,E,k,y,_){return E===null||E.tag!==7?(E=Os(k,m.mode,y,_),E.return=m,E):(E=i(E,k),E.return=m,E)}function d(m,E,k){if(typeof E=="string"&&E!==""||typeof E=="number")return E=bp(""+E,m.mode,k),E.return=m,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case ec:return k=ed(E.type,E.key,E.props,null,m.mode,k),k.ref=jl(m,null,E),k.return=m,k;case To:return E=yp(E,m.mode,k),E.return=m,E;case pi:var y=E._init;return d(m,y(E._payload),k)}if(ta(E)||Ul(E))return E=Os(E,m.mode,k,null),E.return=m,E;dc(m,E)}return null}function f(m,E,k,y){var _=E!==null?E.key:null;if(typeof k=="string"&&k!==""||typeof k=="number")return _!==null?null:l(m,E,""+k,y);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case ec:return k.key===_?a(m,E,k,y):null;case To:return k.key===_?u(m,E,k,y):null;case pi:return _=k._init,f(m,E,_(k._payload),y)}if(ta(k)||Ul(k))return _!==null?null:c(m,E,k,y,null);dc(m,k)}return null}function h(m,E,k,y,_){if(typeof y=="string"&&y!==""||typeof y=="number")return m=m.get(k)||null,l(E,m,""+y,_);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ec:return m=m.get(y.key===null?k:y.key)||null,a(E,m,y,_);case To:return m=m.get(y.key===null?k:y.key)||null,u(E,m,y,_);case pi:var w=y._init;return h(m,E,k,w(y._payload),_)}if(ta(y)||Ul(y))return m=m.get(k)||null,c(E,m,y,_,null);dc(E,y)}return null}function p(m,E,k,y){for(var _=null,w=null,x=E,S=E=0,O=null;x!==null&&S<k.length;S++){x.index>S?(O=x,x=null):O=x.sibling;var L=f(m,x,k[S],y);if(L===null){x===null&&(x=O);break}t&&x&&L.alternate===null&&e(m,x),E=s(L,E,S),w===null?_=L:w.sibling=L,w=L,x=O}if(S===k.length)return n(m,x),Pe&&ys(m,S),_;if(x===null){for(;S<k.length;S++)x=d(m,k[S],y),x!==null&&(E=s(x,E,S),w===null?_=x:w.sibling=x,w=x);return Pe&&ys(m,S),_}for(x=r(m,x);S<k.length;S++)O=h(x,m,S,k[S],y),O!==null&&(t&&O.alternate!==null&&x.delete(O.key===null?S:O.key),E=s(O,E,S),w===null?_=O:w.sibling=O,w=O);return t&&x.forEach(function(G){return e(m,G)}),Pe&&ys(m,S),_}function g(m,E,k,y){var _=Ul(k);if(typeof _!="function")throw Error(F(150));if(k=_.call(k),k==null)throw Error(F(151));for(var w=_=null,x=E,S=E=0,O=null,L=k.next();x!==null&&!L.done;S++,L=k.next()){x.index>S?(O=x,x=null):O=x.sibling;var G=f(m,x,L.value,y);if(G===null){x===null&&(x=O);break}t&&x&&G.alternate===null&&e(m,x),E=s(G,E,S),w===null?_=G:w.sibling=G,w=G,x=O}if(L.done)return n(m,x),Pe&&ys(m,S),_;if(x===null){for(;!L.done;S++,L=k.next())L=d(m,L.value,y),L!==null&&(E=s(L,E,S),w===null?_=L:w.sibling=L,w=L);return Pe&&ys(m,S),_}for(x=r(m,x);!L.done;S++,L=k.next())L=h(x,m,S,L.value,y),L!==null&&(t&&L.alternate!==null&&x.delete(L.key===null?S:L.key),E=s(L,E,S),w===null?_=L:w.sibling=L,w=L);return t&&x.forEach(function(U){return e(m,U)}),Pe&&ys(m,S),_}function b(m,E,k,y){if(typeof k=="object"&&k!==null&&k.type===No&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case ec:e:{for(var _=k.key,w=E;w!==null;){if(w.key===_){if(_=k.type,_===No){if(w.tag===7){n(m,w.sibling),E=i(w,k.props.children),E.return=m,m=E;break e}}else if(w.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===pi&&Fy(_)===w.type){n(m,w.sibling),E=i(w,k.props),E.ref=jl(m,w,k),E.return=m,m=E;break e}n(m,w);break}else e(m,w);w=w.sibling}k.type===No?(E=Os(k.props.children,m.mode,y,k.key),E.return=m,m=E):(y=ed(k.type,k.key,k.props,null,m.mode,y),y.ref=jl(m,E,k),y.return=m,m=y)}return o(m);case To:e:{for(w=k.key;E!==null;){if(E.key===w)if(E.tag===4&&E.stateNode.containerInfo===k.containerInfo&&E.stateNode.implementation===k.implementation){n(m,E.sibling),E=i(E,k.children||[]),E.return=m,m=E;break e}else{n(m,E);break}else e(m,E);E=E.sibling}E=yp(k,m.mode,y),E.return=m,m=E}return o(m);case pi:return w=k._init,b(m,E,w(k._payload),y)}if(ta(k))return p(m,E,k,y);if(Ul(k))return g(m,E,k,y);dc(m,k)}return typeof k=="string"&&k!==""||typeof k=="number"?(k=""+k,E!==null&&E.tag===6?(n(m,E.sibling),E=i(E,k),E.return=m,m=E):(n(m,E),E=bp(k,m.mode,y),E.return=m,m=E),o(m)):n(m,E)}return b}var nl=Mv(!0),Ov=Mv(!1),Md=ls(null),Od=null,Fo=null,Bm=null;function zm(){Bm=Fo=Od=null}function $m(t){var e=Md.current;Ie(Md),t._currentValue=e}function Z0(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function jo(t,e){Od=t,Bm=Fo=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(tn=!0),t.firstContext=null)}function Wn(t){var e=t._currentValue;if(Bm!==t)if(t={context:t,memoizedValue:e,next:null},Fo===null){if(Od===null)throw Error(F(308));Fo=t,Od.dependencies={lanes:0,firstContext:t}}else Fo=Fo.next=t;return e}var Ss=null;function Um(t){Ss===null?Ss=[t]:Ss.push(t)}function Dv(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,Um(e)):(n.next=i.next,i.next=n),e.interleaved=n,ti(t,r)}function ti(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var gi=!1;function Hm(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Rv(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Gr(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function $i(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,be&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,ti(t,n)}return i=r.interleaved,i===null?(e.next=e,Um(r)):(e.next=i.next,i.next=e),r.interleaved=e,ti(t,n)}function Gc(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Am(t,n)}}function By(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Dd(t,e,n,r){var i=t.updateQueue;gi=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var a=l,u=a.next;a.next=null,o===null?s=u:o.next=u,o=a;var c=t.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==o&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=a))}if(s!==null){var d=i.baseState;o=0,c=u=a=null,l=s;do{var f=l.lane,h=l.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var p=t,g=l;switch(f=e,h=n,g.tag){case 1:if(p=g.payload,typeof p=="function"){d=p.call(h,d,f);break e}d=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,f=typeof p=="function"?p.call(h,d,f):p,f==null)break e;d=ze({},d,f);break e;case 2:gi=!0}}l.callback!==null&&l.lane!==0&&(t.flags|=64,f=i.effects,f===null?i.effects=[l]:f.push(l))}else h={eventTime:h,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=h,a=d):c=c.next=h,o|=f;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;f=l,l=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(a=d),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=c,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);qs|=o,t.lanes=o,t.memoizedState=d}}function zy(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(F(191,i));i.call(r)}}}var Bu={},xr=ls(Bu),Wa=ls(Bu),Ka=ls(Bu);function Cs(t){if(t===Bu)throw Error(F(174));return t}function Vm(t,e){switch(Ne(Ka,e),Ne(Wa,t),Ne(xr,Bu),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:O0(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=O0(e,t)}Ie(xr),Ne(xr,e)}function rl(){Ie(xr),Ie(Wa),Ie(Ka)}function Iv(t){Cs(Ka.current);var e=Cs(xr.current),n=O0(e,t.type);e!==n&&(Ne(Wa,t),Ne(xr,n))}function Wm(t){Wa.current===t&&(Ie(xr),Ie(Wa))}var Fe=ls(0);function Rd(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var dp=[];function Km(){for(var t=0;t<dp.length;t++)dp[t]._workInProgressVersionPrimary=null;dp.length=0}var Yc=ai.ReactCurrentDispatcher,fp=ai.ReactCurrentBatchConfig,js=0,Be=null,rt=null,dt=null,Id=!1,pa=!1,ja=0,PN=0;function Nt(){throw Error(F(321))}function jm(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!ar(t[n],e[n]))return!1;return!0}function qm(t,e,n,r,i,s){if(js=s,Be=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Yc.current=t===null||t.memoizedState===null?$N:UN,t=n(r,i),pa){s=0;do{if(pa=!1,ja=0,25<=s)throw Error(F(301));s+=1,dt=rt=null,e.updateQueue=null,Yc.current=HN,t=n(r,i)}while(pa)}if(Yc.current=Ld,e=rt!==null&&rt.next!==null,js=0,dt=rt=Be=null,Id=!1,e)throw Error(F(300));return t}function Gm(){var t=ja!==0;return ja=0,t}function gr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?Be.memoizedState=dt=t:dt=dt.next=t,dt}function Kn(){if(rt===null){var t=Be.alternate;t=t!==null?t.memoizedState:null}else t=rt.next;var e=dt===null?Be.memoizedState:dt.next;if(e!==null)dt=e,rt=t;else{if(t===null)throw Error(F(310));rt=t,t={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},dt===null?Be.memoizedState=dt=t:dt=dt.next=t}return dt}function qa(t,e){return typeof e=="function"?e(t):e}function hp(t){var e=Kn(),n=e.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=t;var r=rt,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var l=o=null,a=null,u=s;do{var c=u.lane;if((js&c)===c)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:t(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=d,o=r):a=a.next=d,Be.lanes|=c,qs|=c}u=u.next}while(u!==null&&u!==s);a===null?o=r:a.next=l,ar(r,e.memoizedState)||(tn=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=a,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do s=i.lane,Be.lanes|=s,qs|=s,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function pp(t){var e=Kn(),n=e.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,s=e.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=t(s,o.action),o=o.next;while(o!==i);ar(s,e.memoizedState)||(tn=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,r]}function Lv(){}function Pv(t,e){var n=Be,r=Kn(),i=e(),s=!ar(r.memoizedState,i);if(s&&(r.memoizedState=i,tn=!0),r=r.queue,Ym(zv.bind(null,n,r,t),[t]),r.getSnapshot!==e||s||dt!==null&&dt.memoizedState.tag&1){if(n.flags|=2048,Ga(9,Bv.bind(null,n,r,i,e),void 0,null),pt===null)throw Error(F(349));js&30||Fv(n,e,i)}return i}function Fv(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Be.updateQueue,e===null?(e={lastEffect:null,stores:null},Be.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function Bv(t,e,n,r){e.value=n,e.getSnapshot=r,$v(e)&&Uv(t)}function zv(t,e,n){return n(function(){$v(e)&&Uv(t)})}function $v(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!ar(t,n)}catch{return!0}}function Uv(t){var e=ti(t,1);e!==null&&lr(e,t,1,-1)}function $y(t){var e=gr();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:t},e.queue=t,t=t.dispatch=zN.bind(null,Be,t),[e.memoizedState,t]}function Ga(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Be.updateQueue,e===null?(e={lastEffect:null,stores:null},Be.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function Hv(){return Kn().memoizedState}function Jc(t,e,n,r){var i=gr();Be.flags|=t,i.memoizedState=Ga(1|e,n,void 0,r===void 0?null:r)}function eh(t,e,n,r){var i=Kn();r=r===void 0?null:r;var s=void 0;if(rt!==null){var o=rt.memoizedState;if(s=o.destroy,r!==null&&jm(r,o.deps)){i.memoizedState=Ga(e,n,s,r);return}}Be.flags|=t,i.memoizedState=Ga(1|e,n,s,r)}function Uy(t,e){return Jc(8390656,8,t,e)}function Ym(t,e){return eh(2048,8,t,e)}function Vv(t,e){return eh(4,2,t,e)}function Wv(t,e){return eh(4,4,t,e)}function Kv(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function jv(t,e,n){return n=n!=null?n.concat([t]):null,eh(4,4,Kv.bind(null,e,t),n)}function Jm(){}function qv(t,e){var n=Kn();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&jm(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function Gv(t,e){var n=Kn();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&jm(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function Yv(t,e,n){return js&21?(ar(n,e)||(n=ev(),Be.lanes|=n,qs|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,tn=!0),t.memoizedState=n)}function FN(t,e){var n=_e;_e=n!==0&&4>n?n:4,t(!0);var r=fp.transition;fp.transition={};try{t(!1),e()}finally{_e=n,fp.transition=r}}function Jv(){return Kn().memoizedState}function BN(t,e,n){var r=Hi(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Zv(t))Xv(e,n);else if(n=Dv(t,e,n,r),n!==null){var i=Vt();lr(n,t,r,i),Qv(n,e,r)}}function zN(t,e,n){var r=Hi(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Zv(t))Xv(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,l=s(o,n);if(i.hasEagerState=!0,i.eagerState=l,ar(l,o)){var a=e.interleaved;a===null?(i.next=i,Um(e)):(i.next=a.next,a.next=i),e.interleaved=i;return}}catch{}finally{}n=Dv(t,e,i,r),n!==null&&(i=Vt(),lr(n,t,r,i),Qv(n,e,r))}}function Zv(t){var e=t.alternate;return t===Be||e!==null&&e===Be}function Xv(t,e){pa=Id=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Qv(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Am(t,n)}}var Ld={readContext:Wn,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useInsertionEffect:Nt,useLayoutEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useMutableSource:Nt,useSyncExternalStore:Nt,useId:Nt,unstable_isNewReconciler:!1},$N={readContext:Wn,useCallback:function(t,e){return gr().memoizedState=[t,e===void 0?null:e],t},useContext:Wn,useEffect:Uy,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Jc(4194308,4,Kv.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Jc(4194308,4,t,e)},useInsertionEffect:function(t,e){return Jc(4,2,t,e)},useMemo:function(t,e){var n=gr();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=gr();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=BN.bind(null,Be,t),[r.memoizedState,t]},useRef:function(t){var e=gr();return t={current:t},e.memoizedState=t},useState:$y,useDebugValue:Jm,useDeferredValue:function(t){return gr().memoizedState=t},useTransition:function(){var t=$y(!1),e=t[0];return t=FN.bind(null,t[1]),gr().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Be,i=gr();if(Pe){if(n===void 0)throw Error(F(407));n=n()}else{if(n=e(),pt===null)throw Error(F(349));js&30||Fv(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,Uy(zv.bind(null,r,s,t),[t]),r.flags|=2048,Ga(9,Bv.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=gr(),e=pt.identifierPrefix;if(Pe){var n=Kr,r=Wr;n=(r&~(1<<32-or(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=ja++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=PN++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},UN={readContext:Wn,useCallback:qv,useContext:Wn,useEffect:Ym,useImperativeHandle:jv,useInsertionEffect:Vv,useLayoutEffect:Wv,useMemo:Gv,useReducer:hp,useRef:Hv,useState:function(){return hp(qa)},useDebugValue:Jm,useDeferredValue:function(t){var e=Kn();return Yv(e,rt.memoizedState,t)},useTransition:function(){var t=hp(qa)[0],e=Kn().memoizedState;return[t,e]},useMutableSource:Lv,useSyncExternalStore:Pv,useId:Jv,unstable_isNewReconciler:!1},HN={readContext:Wn,useCallback:qv,useContext:Wn,useEffect:Ym,useImperativeHandle:jv,useInsertionEffect:Vv,useLayoutEffect:Wv,useMemo:Gv,useReducer:pp,useRef:Hv,useState:function(){return pp(qa)},useDebugValue:Jm,useDeferredValue:function(t){var e=Kn();return rt===null?e.memoizedState=t:Yv(e,rt.memoizedState,t)},useTransition:function(){var t=pp(qa)[0],e=Kn().memoizedState;return[t,e]},useMutableSource:Lv,useSyncExternalStore:Pv,useId:Jv,unstable_isNewReconciler:!1};function tr(t,e){if(t&&t.defaultProps){e=ze({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function X0(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:ze({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var th={isMounted:function(t){return(t=t._reactInternals)?oo(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=Vt(),i=Hi(t),s=Gr(r,i);s.payload=e,n!=null&&(s.callback=n),e=$i(t,s,i),e!==null&&(lr(e,t,i,r),Gc(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=Vt(),i=Hi(t),s=Gr(r,i);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=$i(t,s,i),e!==null&&(lr(e,t,i,r),Gc(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Vt(),r=Hi(t),i=Gr(n,r);i.tag=2,e!=null&&(i.callback=e),e=$i(t,i,r),e!==null&&(lr(e,t,r,n),Gc(e,t,r))}};function Hy(t,e,n,r,i,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,s,o):e.prototype&&e.prototype.isPureReactComponent?!$a(n,r)||!$a(i,s):!0}function ex(t,e,n){var r=!1,i=Zi,s=e.contextType;return typeof s=="object"&&s!==null?s=Wn(s):(i=rn(e)?Ws:It.current,r=e.contextTypes,s=(r=r!=null)?el(t,i):Zi),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=th,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function Vy(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&th.enqueueReplaceState(e,e.state,null)}function Q0(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},Hm(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=Wn(s):(s=rn(e)?Ws:It.current,i.context=el(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(X0(t,e,s,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&th.enqueueReplaceState(i,i.state,null),Dd(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function il(t,e){try{var n="",r=e;do n+=mT(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
23
|
+
Error generating stack: `+s.message+`
|
|
24
|
+
`+s.stack}return{value:t,source:e,stack:i,digest:null}}function gp(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function eg(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var VN=typeof WeakMap=="function"?WeakMap:Map;function tx(t,e,n){n=Gr(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Fd||(Fd=!0,cg=r),eg(t,e)},n}function nx(t,e,n){n=Gr(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){eg(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){eg(t,e),typeof r!="function"&&(Ui===null?Ui=new Set([this]):Ui.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function Wy(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new VN;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=rM.bind(null,t,e,n),e.then(t,t))}function Ky(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function jy(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Gr(-1,1),e.tag=2,$i(n,e,1))),n.lanes|=1),t)}var WN=ai.ReactCurrentOwner,tn=!1;function Ut(t,e,n,r){e.child=t===null?Ov(e,null,n,r):nl(e,t.child,n,r)}function qy(t,e,n,r,i){n=n.render;var s=e.ref;return jo(e,i),r=qm(t,e,n,r,s,i),n=Gm(),t!==null&&!tn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,ni(t,e,i)):(Pe&&n&&Lm(e),e.flags|=1,Ut(t,e,r,i),e.child)}function Gy(t,e,n,r,i){if(t===null){var s=n.type;return typeof s=="function"&&!i1(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,rx(t,e,s,r,i)):(t=ed(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:$a,n(o,r)&&t.ref===e.ref)return ni(t,e,i)}return e.flags|=1,t=Vi(s,r),t.ref=e.ref,t.return=e,e.child=t}function rx(t,e,n,r,i){if(t!==null){var s=t.memoizedProps;if($a(s,r)&&t.ref===e.ref)if(tn=!1,e.pendingProps=r=s,(t.lanes&i)!==0)t.flags&131072&&(tn=!0);else return e.lanes=t.lanes,ni(t,e,i)}return tg(t,e,n,r,i)}function ix(t,e,n){var r=e.pendingProps,i=r.children,s=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ne(zo,mn),mn|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Ne(zo,mn),mn|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Ne(zo,mn),mn|=r}else s!==null?(r=s.baseLanes|n,e.memoizedState=null):r=n,Ne(zo,mn),mn|=r;return Ut(t,e,i,n),e.child}function sx(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function tg(t,e,n,r,i){var s=rn(n)?Ws:It.current;return s=el(e,s),jo(e,i),n=qm(t,e,n,r,s,i),r=Gm(),t!==null&&!tn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,ni(t,e,i)):(Pe&&r&&Lm(e),e.flags|=1,Ut(t,e,n,i),e.child)}function Yy(t,e,n,r,i){if(rn(n)){var s=!0;Ad(e)}else s=!1;if(jo(e,i),e.stateNode===null)Zc(t,e),ex(e,n,r),Q0(e,n,r,i),r=!0;else if(t===null){var o=e.stateNode,l=e.memoizedProps;o.props=l;var a=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Wn(u):(u=rn(n)?Ws:It.current,u=el(e,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||a!==u)&&Vy(e,o,r,u),gi=!1;var f=e.memoizedState;o.state=f,Dd(e,r,o,i),a=e.memoizedState,l!==r||f!==a||nn.current||gi?(typeof c=="function"&&(X0(e,n,c,r),a=e.memoizedState),(l=gi||Hy(e,n,l,r,f,a,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=a),o.props=r,o.state=a,o.context=u,r=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,Rv(t,e),l=e.memoizedProps,u=e.type===e.elementType?l:tr(e.type,l),o.props=u,d=e.pendingProps,f=o.context,a=n.contextType,typeof a=="object"&&a!==null?a=Wn(a):(a=rn(n)?Ws:It.current,a=el(e,a));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==d||f!==a)&&Vy(e,o,r,a),gi=!1,f=e.memoizedState,o.state=f,Dd(e,r,o,i);var p=e.memoizedState;l!==d||f!==p||nn.current||gi?(typeof h=="function"&&(X0(e,n,h,r),p=e.memoizedState),(u=gi||Hy(e,n,u,r,f,p,a)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,p,a),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,p,a)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=p),o.props=r,o.state=p,o.context=a,r=u):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),r=!1)}return ng(t,e,n,r,s,i)}function ng(t,e,n,r,i,s){sx(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&Iy(e,n,!1),ni(t,e,s);r=e.stateNode,WN.current=e;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=nl(e,t.child,null,s),e.child=nl(e,null,l,s)):Ut(t,e,l,s),e.memoizedState=r.state,i&&Iy(e,n,!0),e.child}function ox(t){var e=t.stateNode;e.pendingContext?Ry(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Ry(t,e.context,!1),Vm(t,e.containerInfo)}function Jy(t,e,n,r,i){return tl(),Fm(i),e.flags|=256,Ut(t,e,n,r),e.child}var rg={dehydrated:null,treeContext:null,retryLane:0};function ig(t){return{baseLanes:t,cachePool:null,transitions:null}}function lx(t,e,n){var r=e.pendingProps,i=Fe.current,s=!1,o=(e.flags&128)!==0,l;if((l=o)||(l=t!==null&&t.memoizedState===null?!1:(i&2)!==0),l?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),Ne(Fe,i&1),t===null)return J0(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,t=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=ih(o,r,0,null),t=Os(t,r,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=ig(n),e.memoizedState=rg,t):Zm(e,o));if(i=t.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return KN(t,e,o,r,l,i,n);if(s){s=r.fallback,o=e.mode,i=t.child,l=i.sibling;var a={mode:"hidden",children:r.children};return!(o&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=a,e.deletions=null):(r=Vi(i,a),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?s=Vi(l,s):(s=Os(s,o,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=t.child.memoizedState,o=o===null?ig(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~n,e.memoizedState=rg,r}return s=t.child,t=s.sibling,r=Vi(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function Zm(t,e){return e=ih({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function fc(t,e,n,r){return r!==null&&Fm(r),nl(e,t.child,null,n),t=Zm(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function KN(t,e,n,r,i,s,o){if(n)return e.flags&256?(e.flags&=-257,r=gp(Error(F(422))),fc(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=ih({mode:"visible",children:r.children},i,0,null),s=Os(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&nl(e,t.child,null,o),e.child.memoizedState=ig(o),e.memoizedState=rg,s);if(!(e.mode&1))return fc(t,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,s=Error(F(419)),r=gp(s,r,void 0),fc(t,e,o,r)}if(l=(o&t.childLanes)!==0,tn||l){if(r=pt,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,ti(t,i),lr(r,t,i,-1))}return r1(),r=gp(Error(F(421))),fc(t,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=iM.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,wn=zi(i.nextSibling),vn=e,Pe=!0,rr=null,t!==null&&(Ln[Pn++]=Wr,Ln[Pn++]=Kr,Ln[Pn++]=Ks,Wr=t.id,Kr=t.overflow,Ks=e),e=Zm(e,r.children),e.flags|=4096,e)}function Zy(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Z0(t.return,e,n)}function mp(t,e,n,r,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function ax(t,e,n){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(Ut(t,e,r.children,n),r=Fe.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Zy(t,n,e);else if(t.tag===19)Zy(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(Ne(Fe,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&Rd(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),mp(e,!1,i,n,s);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Rd(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}mp(e,!0,n,null,s);break;case"together":mp(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Zc(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function ni(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),qs|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(F(153));if(e.child!==null){for(t=e.child,n=Vi(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Vi(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function jN(t,e,n){switch(e.tag){case 3:ox(e),tl();break;case 5:Iv(e);break;case 1:rn(e.type)&&Ad(e);break;case 4:Vm(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;Ne(Md,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Ne(Fe,Fe.current&1),e.flags|=128,null):n&e.child.childLanes?lx(t,e,n):(Ne(Fe,Fe.current&1),t=ni(t,e,n),t!==null?t.sibling:null);Ne(Fe,Fe.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return ax(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ne(Fe,Fe.current),r)break;return null;case 22:case 23:return e.lanes=0,ix(t,e,n)}return ni(t,e,n)}var ux,sg,cx,dx;ux=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};sg=function(){};cx=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,Cs(xr.current);var s=null;switch(n){case"input":i=A0(t,i),r=A0(t,r),s=[];break;case"select":i=ze({},i,{value:void 0}),r=ze({},r,{value:void 0}),s=[];break;case"textarea":i=M0(t,i),r=M0(t,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=Sd)}D0(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ra.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var a=r[u];if(l=i?.[u],r.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||a&&a.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in a)a.hasOwnProperty(o)&&l[o]!==a[o]&&(n||(n={}),n[o]=a[o])}else n||(s||(s=[]),s.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(s=s||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(s=s||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ra.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&De("scroll",t),s||l===a||(s=[])):(s=s||[]).push(u,a))}n&&(s=s||[]).push("style",n);var u=s;(e.updateQueue=u)&&(e.flags|=4)}};dx=function(t,e,n,r){n!==r&&(e.flags|=4)};function ql(t,e){if(!Pe)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Mt(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function qN(t,e,n){var r=e.pendingProps;switch(Pm(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(e),null;case 1:return rn(e.type)&&Cd(),Mt(e),null;case 3:return r=e.stateNode,rl(),Ie(nn),Ie(It),Km(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(cc(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,rr!==null&&(hg(rr),rr=null))),sg(t,e),Mt(e),null;case 5:Wm(e);var i=Cs(Ka.current);if(n=e.type,t!==null&&e.stateNode!=null)cx(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(F(166));return Mt(e),null}if(t=Cs(xr.current),cc(e)){r=e.stateNode,n=e.type;var s=e.memoizedProps;switch(r[Er]=e,r[Va]=s,t=(e.mode&1)!==0,n){case"dialog":De("cancel",r),De("close",r);break;case"iframe":case"object":case"embed":De("load",r);break;case"video":case"audio":for(i=0;i<ra.length;i++)De(ra[i],r);break;case"source":De("error",r);break;case"img":case"image":case"link":De("error",r),De("load",r);break;case"details":De("toggle",r);break;case"input":oy(r,s),De("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},De("invalid",r);break;case"textarea":ay(r,s),De("invalid",r)}D0(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="children"?typeof l=="string"?r.textContent!==l&&(s.suppressHydrationWarning!==!0&&uc(r.textContent,l,t),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&uc(r.textContent,l,t),i=["children",""+l]):Ra.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&De("scroll",r)}switch(n){case"input":tc(r),ly(r,s,!0);break;case"textarea":tc(r),uy(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Sd)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=z_(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[Er]=e,t[Va]=r,ux(t,e,!1,!1),e.stateNode=t;e:{switch(o=R0(n,r),n){case"dialog":De("cancel",t),De("close",t),i=r;break;case"iframe":case"object":case"embed":De("load",t),i=r;break;case"video":case"audio":for(i=0;i<ra.length;i++)De(ra[i],t);i=r;break;case"source":De("error",t),i=r;break;case"img":case"image":case"link":De("error",t),De("load",t),i=r;break;case"details":De("toggle",t),i=r;break;case"input":oy(t,r),i=A0(t,r),De("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=ze({},r,{value:void 0}),De("invalid",t);break;case"textarea":ay(t,r),i=M0(t,r),De("invalid",t);break;default:i=r}D0(n,i),l=i;for(s in l)if(l.hasOwnProperty(s)){var a=l[s];s==="style"?H_(t,a):s==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&$_(t,a)):s==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Ia(t,a):typeof a=="number"&&Ia(t,""+a):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Ra.hasOwnProperty(s)?a!=null&&s==="onScroll"&&De("scroll",t):a!=null&&wm(t,s,a,o))}switch(n){case"input":tc(t),ly(t,r,!1);break;case"textarea":tc(t),uy(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Ji(r.value));break;case"select":t.multiple=!!r.multiple,s=r.value,s!=null?Ho(t,!!r.multiple,s,!1):r.defaultValue!=null&&Ho(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=Sd)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Mt(e),null;case 6:if(t&&e.stateNode!=null)dx(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(F(166));if(n=Cs(Ka.current),Cs(xr.current),cc(e)){if(r=e.stateNode,n=e.memoizedProps,r[Er]=e,(s=r.nodeValue!==n)&&(t=vn,t!==null))switch(t.tag){case 3:uc(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&uc(r.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Er]=e,e.stateNode=r}return Mt(e),null;case 13:if(Ie(Fe),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Pe&&wn!==null&&e.mode&1&&!(e.flags&128))Nv(),tl(),e.flags|=98560,s=!1;else if(s=cc(e),r!==null&&r.dehydrated!==null){if(t===null){if(!s)throw Error(F(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(F(317));s[Er]=e}else tl(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Mt(e),s=!1}else rr!==null&&(hg(rr),rr=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||Fe.current&1?st===0&&(st=3):r1())),e.updateQueue!==null&&(e.flags|=4),Mt(e),null);case 4:return rl(),sg(t,e),t===null&&Ua(e.stateNode.containerInfo),Mt(e),null;case 10:return $m(e.type._context),Mt(e),null;case 17:return rn(e.type)&&Cd(),Mt(e),null;case 19:if(Ie(Fe),s=e.memoizedState,s===null)return Mt(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)ql(s,!1);else{if(st!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Rd(t),o!==null){for(e.flags|=128,ql(s,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)s=n,t=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,t=o.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return Ne(Fe,Fe.current&1|2),e.child}t=t.sibling}s.tail!==null&&qe()>sl&&(e.flags|=128,r=!0,ql(s,!1),e.lanes=4194304)}else{if(!r)if(t=Rd(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),ql(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Pe)return Mt(e),null}else 2*qe()-s.renderingStartTime>sl&&n!==1073741824&&(e.flags|=128,r=!0,ql(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=qe(),e.sibling=null,n=Fe.current,Ne(Fe,r?n&1|2:n&1),e):(Mt(e),null);case 22:case 23:return n1(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?mn&1073741824&&(Mt(e),e.subtreeFlags&6&&(e.flags|=8192)):Mt(e),null;case 24:return null;case 25:return null}throw Error(F(156,e.tag))}function GN(t,e){switch(Pm(e),e.tag){case 1:return rn(e.type)&&Cd(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return rl(),Ie(nn),Ie(It),Km(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Wm(e),null;case 13:if(Ie(Fe),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(F(340));tl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ie(Fe),null;case 4:return rl(),null;case 10:return $m(e.type._context),null;case 22:case 23:return n1(),null;case 24:return null;default:return null}}var hc=!1,Dt=!1,YN=typeof WeakSet=="function"?WeakSet:Set,W=null;function Bo(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ue(t,e,r)}else n.current=null}function og(t,e,n){try{n()}catch(r){Ue(t,e,r)}}var Xy=!1;function JN(t,e){if(V0=_d,t=mv(),Im(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,a=-1,u=0,c=0,d=t,f=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(l=o+i),d!==s||r!==0&&d.nodeType!==3||(a=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===t)break t;if(f===n&&++u===i&&(l=o),f===s&&++c===r&&(a=o),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(W0={focusedElem:t,selectionRange:n},_d=!1,W=e;W!==null;)if(e=W,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,W=t;else for(;W!==null;){e=W;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,b=p.memoizedState,m=e.stateNode,E=m.getSnapshotBeforeUpdate(e.elementType===e.type?g:tr(e.type,g),b);m.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var k=e.stateNode.containerInfo;k.nodeType===1?k.textContent="":k.nodeType===9&&k.documentElement&&k.removeChild(k.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(y){Ue(e,e.return,y)}if(t=e.sibling,t!==null){t.return=e.return,W=t;break}W=e.return}return p=Xy,Xy=!1,p}function ga(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&og(e,n,s)}i=i.next}while(i!==r)}}function nh(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function lg(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function fx(t){var e=t.alternate;e!==null&&(t.alternate=null,fx(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Er],delete e[Va],delete e[q0],delete e[DN],delete e[RN])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function hx(t){return t.tag===5||t.tag===3||t.tag===4}function Qy(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||hx(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function ag(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Sd));else if(r!==4&&(t=t.child,t!==null))for(ag(t,e,n),t=t.sibling;t!==null;)ag(t,e,n),t=t.sibling}function ug(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(ug(t,e,n),t=t.sibling;t!==null;)ug(t,e,n),t=t.sibling}var kt=null,nr=!1;function ci(t,e,n){for(n=n.child;n!==null;)px(t,e,n),n=n.sibling}function px(t,e,n){if(vr&&typeof vr.onCommitFiberUnmount=="function")try{vr.onCommitFiberUnmount(Gf,n)}catch{}switch(n.tag){case 5:Dt||Bo(n,e);case 6:var r=kt,i=nr;kt=null,ci(t,e,n),kt=r,nr=i,kt!==null&&(nr?(t=kt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):kt.removeChild(n.stateNode));break;case 18:kt!==null&&(nr?(t=kt,n=n.stateNode,t.nodeType===8?up(t.parentNode,n):t.nodeType===1&&up(t,n),Ba(t)):up(kt,n.stateNode));break;case 4:r=kt,i=nr,kt=n.stateNode.containerInfo,nr=!0,ci(t,e,n),kt=r,nr=i;break;case 0:case 11:case 14:case 15:if(!Dt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&og(n,e,o),i=i.next}while(i!==r)}ci(t,e,n);break;case 1:if(!Dt&&(Bo(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ue(n,e,l)}ci(t,e,n);break;case 21:ci(t,e,n);break;case 22:n.mode&1?(Dt=(r=Dt)||n.memoizedState!==null,ci(t,e,n),Dt=r):ci(t,e,n);break;default:ci(t,e,n)}}function eE(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new YN),e.forEach(function(r){var i=sM.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function er(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=t,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 5:kt=l.stateNode,nr=!1;break e;case 3:kt=l.stateNode.containerInfo,nr=!0;break e;case 4:kt=l.stateNode.containerInfo,nr=!0;break e}l=l.return}if(kt===null)throw Error(F(160));px(s,o,i),kt=null,nr=!1;var a=i.alternate;a!==null&&(a.return=null),i.return=null}catch(u){Ue(i,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)gx(e,t),e=e.sibling}function gx(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(er(e,t),fr(t),r&4){try{ga(3,t,t.return),nh(3,t)}catch(g){Ue(t,t.return,g)}try{ga(5,t,t.return)}catch(g){Ue(t,t.return,g)}}break;case 1:er(e,t),fr(t),r&512&&n!==null&&Bo(n,n.return);break;case 5:if(er(e,t),fr(t),r&512&&n!==null&&Bo(n,n.return),t.flags&32){var i=t.stateNode;try{Ia(i,"")}catch(g){Ue(t,t.return,g)}}if(r&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,o=n!==null?n.memoizedProps:s,l=t.type,a=t.updateQueue;if(t.updateQueue=null,a!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&F_(i,s),R0(l,o);var u=R0(l,s);for(o=0;o<a.length;o+=2){var c=a[o],d=a[o+1];c==="style"?H_(i,d):c==="dangerouslySetInnerHTML"?$_(i,d):c==="children"?Ia(i,d):wm(i,c,d,u)}switch(l){case"input":T0(i,s);break;case"textarea":B_(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?Ho(i,!!s.multiple,h,!1):f!==!!s.multiple&&(s.defaultValue!=null?Ho(i,!!s.multiple,s.defaultValue,!0):Ho(i,!!s.multiple,s.multiple?[]:"",!1))}i[Va]=s}catch(g){Ue(t,t.return,g)}}break;case 6:if(er(e,t),fr(t),r&4){if(t.stateNode===null)throw Error(F(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(g){Ue(t,t.return,g)}}break;case 3:if(er(e,t),fr(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ba(e.containerInfo)}catch(g){Ue(t,t.return,g)}break;case 4:er(e,t),fr(t);break;case 13:er(e,t),fr(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(e1=qe())),r&4&&eE(t);break;case 22:if(c=n!==null&&n.memoizedState!==null,t.mode&1?(Dt=(u=Dt)||c,er(e,t),Dt=u):er(e,t),fr(t),r&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!c&&t.mode&1)for(W=t,c=t.child;c!==null;){for(d=W=c;W!==null;){switch(f=W,h=f.child,f.tag){case 0:case 11:case 14:case 15:ga(4,f,f.return);break;case 1:Bo(f,f.return);var p=f.stateNode;if(typeof p.componentWillUnmount=="function"){r=f,n=f.return;try{e=r,p.props=e.memoizedProps,p.state=e.memoizedState,p.componentWillUnmount()}catch(g){Ue(r,n,g)}}break;case 5:Bo(f,f.return);break;case 22:if(f.memoizedState!==null){nE(d);continue}}h!==null?(h.return=f,W=h):nE(d)}c=c.sibling}e:for(c=null,d=t;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=d.stateNode,a=d.memoizedProps.style,o=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=U_("display",o))}catch(g){Ue(t,t.return,g)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(g){Ue(t,t.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:er(e,t),fr(t),r&4&&eE(t);break;case 21:break;default:er(e,t),fr(t)}}function fr(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(hx(n)){var r=n;break e}n=n.return}throw Error(F(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Ia(i,""),r.flags&=-33);var s=Qy(t);ug(t,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,l=Qy(t);ag(t,l,o);break;default:throw Error(F(161))}}catch(a){Ue(t,t.return,a)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function ZN(t,e,n){W=t,mx(t)}function mx(t,e,n){for(var r=(t.mode&1)!==0;W!==null;){var i=W,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||hc;if(!o){var l=i.alternate,a=l!==null&&l.memoizedState!==null||Dt;l=hc;var u=Dt;if(hc=o,(Dt=a)&&!u)for(W=i;W!==null;)o=W,a=o.child,o.tag===22&&o.memoizedState!==null?rE(i):a!==null?(a.return=o,W=a):rE(i);for(;s!==null;)W=s,mx(s),s=s.sibling;W=i,hc=l,Dt=u}tE(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,W=s):tE(t)}}function tE(t){for(;W!==null;){var e=W;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Dt||nh(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Dt)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:tr(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&zy(e,s,r);break;case 3:var o=e.updateQueue;if(o!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}zy(e,o,n)}break;case 5:var l=e.stateNode;if(n===null&&e.flags&4){n=l;var a=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&Ba(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(F(163))}Dt||e.flags&512&&lg(e)}catch(f){Ue(e,e.return,f)}}if(e===t){W=null;break}if(n=e.sibling,n!==null){n.return=e.return,W=n;break}W=e.return}}function nE(t){for(;W!==null;){var e=W;if(e===t){W=null;break}var n=e.sibling;if(n!==null){n.return=e.return,W=n;break}W=e.return}}function rE(t){for(;W!==null;){var e=W;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{nh(4,e)}catch(a){Ue(e,n,a)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(a){Ue(e,i,a)}}var s=e.return;try{lg(e)}catch(a){Ue(e,s,a)}break;case 5:var o=e.return;try{lg(e)}catch(a){Ue(e,o,a)}}}catch(a){Ue(e,e.return,a)}if(e===t){W=null;break}var l=e.sibling;if(l!==null){l.return=e.return,W=l;break}W=e.return}}var XN=Math.ceil,Pd=ai.ReactCurrentDispatcher,Xm=ai.ReactCurrentOwner,zn=ai.ReactCurrentBatchConfig,be=0,pt=null,Xe=null,Ct=0,mn=0,zo=ls(0),st=0,Ya=null,qs=0,rh=0,Qm=0,ma=null,Qt=null,e1=0,sl=1/0,Ur=null,Fd=!1,cg=null,Ui=null,pc=!1,Ti=null,Bd=0,ba=0,dg=null,Xc=-1,Qc=0;function Vt(){return be&6?qe():Xc!==-1?Xc:Xc=qe()}function Hi(t){return t.mode&1?be&2&&Ct!==0?Ct&-Ct:LN.transition!==null?(Qc===0&&(Qc=ev()),Qc):(t=_e,t!==0||(t=window.event,t=t===void 0?16:lv(t.type)),t):1}function lr(t,e,n,r){if(50<ba)throw ba=0,dg=null,Error(F(185));Lu(t,n,r),(!(be&2)||t!==pt)&&(t===pt&&(!(be&2)&&(rh|=n),st===4&&wi(t,Ct)),sn(t,r),n===1&&be===0&&!(e.mode&1)&&(sl=qe()+500,Qf&&as()))}function sn(t,e){var n=t.callbackNode;LT(t,e);var r=wd(t,t===pt?Ct:0);if(r===0)n!==null&&fy(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&fy(n),e===1)t.tag===0?IN(iE.bind(null,t)):Cv(iE.bind(null,t)),MN(function(){!(be&6)&&as()}),n=null;else{switch(tv(r)){case 1:n=Cm;break;case 4:n=X_;break;case 16:n=kd;break;case 536870912:n=Q_;break;default:n=kd}n=xx(n,bx.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function bx(t,e){if(Xc=-1,Qc=0,be&6)throw Error(F(327));var n=t.callbackNode;if(qo()&&t.callbackNode!==n)return null;var r=wd(t,t===pt?Ct:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=zd(t,r);else{e=r;var i=be;be|=2;var s=Ex();(pt!==t||Ct!==e)&&(Ur=null,sl=qe()+500,Ms(t,e));do try{tM();break}catch(l){yx(t,l)}while(!0);zm(),Pd.current=s,be=i,Xe!==null?e=0:(pt=null,Ct=0,e=st)}if(e!==0){if(e===2&&(i=B0(t),i!==0&&(r=i,e=fg(t,i))),e===1)throw n=Ya,Ms(t,0),wi(t,r),sn(t,qe()),n;if(e===6)wi(t,r);else{if(i=t.current.alternate,!(r&30)&&!QN(i)&&(e=zd(t,r),e===2&&(s=B0(t),s!==0&&(r=s,e=fg(t,s))),e===1))throw n=Ya,Ms(t,0),wi(t,r),sn(t,qe()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(F(345));case 2:Es(t,Qt,Ur);break;case 3:if(wi(t,r),(r&130023424)===r&&(e=e1+500-qe(),10<e)){if(wd(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){Vt(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=j0(Es.bind(null,t,Qt,Ur),e);break}Es(t,Qt,Ur);break;case 4:if(wi(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var o=31-or(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=qe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*XN(r/1960))-r,10<r){t.timeoutHandle=j0(Es.bind(null,t,Qt,Ur),r);break}Es(t,Qt,Ur);break;case 5:Es(t,Qt,Ur);break;default:throw Error(F(329))}}}return sn(t,qe()),t.callbackNode===n?bx.bind(null,t):null}function fg(t,e){var n=ma;return t.current.memoizedState.isDehydrated&&(Ms(t,e).flags|=256),t=zd(t,e),t!==2&&(e=Qt,Qt=n,e!==null&&hg(e)),t}function hg(t){Qt===null?Qt=t:Qt.push.apply(Qt,t)}function QN(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!ar(s(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function wi(t,e){for(e&=~Qm,e&=~rh,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-or(e),r=1<<n;t[n]=-1,e&=~r}}function iE(t){if(be&6)throw Error(F(327));qo();var e=wd(t,0);if(!(e&1))return sn(t,qe()),null;var n=zd(t,e);if(t.tag!==0&&n===2){var r=B0(t);r!==0&&(e=r,n=fg(t,r))}if(n===1)throw n=Ya,Ms(t,0),wi(t,e),sn(t,qe()),n;if(n===6)throw Error(F(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Es(t,Qt,Ur),sn(t,qe()),null}function t1(t,e){var n=be;be|=1;try{return t(e)}finally{be=n,be===0&&(sl=qe()+500,Qf&&as())}}function Gs(t){Ti!==null&&Ti.tag===0&&!(be&6)&&qo();var e=be;be|=1;var n=zn.transition,r=_e;try{if(zn.transition=null,_e=1,t)return t()}finally{_e=r,zn.transition=n,be=e,!(be&6)&&as()}}function n1(){mn=zo.current,Ie(zo)}function Ms(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,NN(n)),Xe!==null)for(n=Xe.return;n!==null;){var r=n;switch(Pm(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Cd();break;case 3:rl(),Ie(nn),Ie(It),Km();break;case 5:Wm(r);break;case 4:rl();break;case 13:Ie(Fe);break;case 19:Ie(Fe);break;case 10:$m(r.type._context);break;case 22:case 23:n1()}n=n.return}if(pt=t,Xe=t=Vi(t.current,null),Ct=mn=e,st=0,Ya=null,Qm=rh=qs=0,Qt=ma=null,Ss!==null){for(e=0;e<Ss.length;e++)if(n=Ss[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}Ss=null}return t}function yx(t,e){do{var n=Xe;try{if(zm(),Yc.current=Ld,Id){for(var r=Be.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Id=!1}if(js=0,dt=rt=Be=null,pa=!1,ja=0,Xm.current=null,n===null||n.return===null){st=1,Ya=e,Xe=null;break}e:{var s=t,o=n.return,l=n,a=e;if(e=Ct,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,c=l,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=Ky(o);if(h!==null){h.flags&=-257,jy(h,o,l,s,e),h.mode&1&&Wy(s,u,e),e=h,a=u;var p=e.updateQueue;if(p===null){var g=new Set;g.add(a),e.updateQueue=g}else p.add(a);break e}else{if(!(e&1)){Wy(s,u,e),r1();break e}a=Error(F(426))}}else if(Pe&&l.mode&1){var b=Ky(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),jy(b,o,l,s,e),Fm(il(a,l));break e}}s=a=il(a,l),st!==4&&(st=2),ma===null?ma=[s]:ma.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var m=tx(s,a,e);By(s,m);break e;case 1:l=a;var E=s.type,k=s.stateNode;if(!(s.flags&128)&&(typeof E.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(Ui===null||!Ui.has(k)))){s.flags|=65536,e&=-e,s.lanes|=e;var y=nx(s,l,e);By(s,y);break e}}s=s.return}while(s!==null)}wx(n)}catch(_){e=_,Xe===n&&n!==null&&(Xe=n=n.return);continue}break}while(!0)}function Ex(){var t=Pd.current;return Pd.current=Ld,t===null?Ld:t}function r1(){(st===0||st===3||st===2)&&(st=4),pt===null||!(qs&268435455)&&!(rh&268435455)||wi(pt,Ct)}function zd(t,e){var n=be;be|=2;var r=Ex();(pt!==t||Ct!==e)&&(Ur=null,Ms(t,e));do try{eM();break}catch(i){yx(t,i)}while(!0);if(zm(),be=n,Pd.current=r,Xe!==null)throw Error(F(261));return pt=null,Ct=0,st}function eM(){for(;Xe!==null;)kx(Xe)}function tM(){for(;Xe!==null&&!CT();)kx(Xe)}function kx(t){var e=vx(t.alternate,t,mn);t.memoizedProps=t.pendingProps,e===null?wx(t):Xe=e,Xm.current=null}function wx(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=GN(n,e),n!==null){n.flags&=32767,Xe=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{st=6,Xe=null;return}}else if(n=qN(n,e,mn),n!==null){Xe=n;return}if(e=e.sibling,e!==null){Xe=e;return}Xe=e=t}while(e!==null);st===0&&(st=5)}function Es(t,e,n){var r=_e,i=zn.transition;try{zn.transition=null,_e=1,nM(t,e,n,r)}finally{zn.transition=i,_e=r}return null}function nM(t,e,n,r){do qo();while(Ti!==null);if(be&6)throw Error(F(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(F(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(PT(t,s),t===pt&&(Xe=pt=null,Ct=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||pc||(pc=!0,xx(kd,function(){return qo(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=zn.transition,zn.transition=null;var o=_e;_e=1;var l=be;be|=4,Xm.current=null,JN(t,n),gx(n,t),_N(W0),_d=!!V0,W0=V0=null,t.current=n,ZN(n),AT(),be=l,_e=o,zn.transition=s}else t.current=n;if(pc&&(pc=!1,Ti=t,Bd=i),s=t.pendingLanes,s===0&&(Ui=null),MT(n.stateNode),sn(t,qe()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Fd)throw Fd=!1,t=cg,cg=null,t;return Bd&1&&t.tag!==0&&qo(),s=t.pendingLanes,s&1?t===dg?ba++:(ba=0,dg=t):ba=0,as(),null}function qo(){if(Ti!==null){var t=tv(Bd),e=zn.transition,n=_e;try{if(zn.transition=null,_e=16>t?16:t,Ti===null)var r=!1;else{if(t=Ti,Ti=null,Bd=0,be&6)throw Error(F(331));var i=be;for(be|=4,W=t.current;W!==null;){var s=W,o=s.child;if(W.flags&16){var l=s.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(W=u;W!==null;){var c=W;switch(c.tag){case 0:case 11:case 15:ga(8,c,s)}var d=c.child;if(d!==null)d.return=c,W=d;else for(;W!==null;){c=W;var f=c.sibling,h=c.return;if(fx(c),c===u){W=null;break}if(f!==null){f.return=h,W=f;break}W=h}}}var p=s.alternate;if(p!==null){var g=p.child;if(g!==null){p.child=null;do{var b=g.sibling;g.sibling=null,g=b}while(g!==null)}}W=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,W=o;else e:for(;W!==null;){if(s=W,s.flags&2048)switch(s.tag){case 0:case 11:case 15:ga(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,W=m;break e}W=s.return}}var E=t.current;for(W=E;W!==null;){o=W;var k=o.child;if(o.subtreeFlags&2064&&k!==null)k.return=o,W=k;else e:for(o=E;W!==null;){if(l=W,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:nh(9,l)}}catch(_){Ue(l,l.return,_)}if(l===o){W=null;break e}var y=l.sibling;if(y!==null){y.return=l.return,W=y;break e}W=l.return}}if(be=i,as(),vr&&typeof vr.onPostCommitFiberRoot=="function")try{vr.onPostCommitFiberRoot(Gf,t)}catch{}r=!0}return r}finally{_e=n,zn.transition=e}}return!1}function sE(t,e,n){e=il(n,e),e=tx(t,e,1),t=$i(t,e,1),e=Vt(),t!==null&&(Lu(t,1,e),sn(t,e))}function Ue(t,e,n){if(t.tag===3)sE(t,t,n);else for(;e!==null;){if(e.tag===3){sE(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ui===null||!Ui.has(r))){t=il(n,t),t=nx(e,t,1),e=$i(e,t,1),t=Vt(),e!==null&&(Lu(e,1,t),sn(e,t));break}}e=e.return}}function rM(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=Vt(),t.pingedLanes|=t.suspendedLanes&n,pt===t&&(Ct&n)===n&&(st===4||st===3&&(Ct&130023424)===Ct&&500>qe()-e1?Ms(t,0):Qm|=n),sn(t,e)}function _x(t,e){e===0&&(t.mode&1?(e=ic,ic<<=1,!(ic&130023424)&&(ic=4194304)):e=1);var n=Vt();t=ti(t,e),t!==null&&(Lu(t,e,n),sn(t,n))}function iM(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),_x(t,n)}function sM(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(F(314))}r!==null&&r.delete(e),_x(t,n)}var vx;vx=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||nn.current)tn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return tn=!1,jN(t,e,n);tn=!!(t.flags&131072)}else tn=!1,Pe&&e.flags&1048576&&Av(e,Nd,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Zc(t,e),t=e.pendingProps;var i=el(e,It.current);jo(e,n),i=qm(null,e,r,t,i,n);var s=Gm();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,rn(r)?(s=!0,Ad(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Hm(e),i.updater=th,e.stateNode=i,i._reactInternals=e,Q0(e,r,t,n),e=ng(null,e,r,!0,s,n)):(e.tag=0,Pe&&s&&Lm(e),Ut(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Zc(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=lM(r),t=tr(r,t),i){case 0:e=tg(null,e,r,t,n);break e;case 1:e=Yy(null,e,r,t,n);break e;case 11:e=qy(null,e,r,t,n);break e;case 14:e=Gy(null,e,r,tr(r.type,t),n);break e}throw Error(F(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:tr(r,i),tg(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:tr(r,i),Yy(t,e,r,i,n);case 3:e:{if(ox(e),t===null)throw Error(F(387));r=e.pendingProps,s=e.memoizedState,i=s.element,Rv(t,e),Dd(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=il(Error(F(423)),e),e=Jy(t,e,r,n,i);break e}else if(r!==i){i=il(Error(F(424)),e),e=Jy(t,e,r,n,i);break e}else for(wn=zi(e.stateNode.containerInfo.firstChild),vn=e,Pe=!0,rr=null,n=Ov(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(tl(),r===i){e=ni(t,e,n);break e}Ut(t,e,r,n)}e=e.child}return e;case 5:return Iv(e),t===null&&J0(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,K0(r,i)?o=null:s!==null&&K0(r,s)&&(e.flags|=32),sx(t,e),Ut(t,e,o,n),e.child;case 6:return t===null&&J0(e),null;case 13:return lx(t,e,n);case 4:return Vm(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=nl(e,null,r,n):Ut(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:tr(r,i),qy(t,e,r,i,n);case 7:return Ut(t,e,e.pendingProps,n),e.child;case 8:return Ut(t,e,e.pendingProps.children,n),e.child;case 12:return Ut(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,Ne(Md,r._currentValue),r._currentValue=o,s!==null)if(ar(s.value,o)){if(s.children===i.children&&!nn.current){e=ni(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(s.tag===1){a=Gr(-1,n&-n),a.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Z0(s.return,n,e),l.lanes|=n;break}a=a.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(F(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Z0(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ut(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,jo(e,n),i=Wn(i),r=r(i),e.flags|=1,Ut(t,e,r,n),e.child;case 14:return r=e.type,i=tr(r,e.pendingProps),i=tr(r.type,i),Gy(t,e,r,i,n);case 15:return rx(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:tr(r,i),Zc(t,e),e.tag=1,rn(r)?(t=!0,Ad(e)):t=!1,jo(e,n),ex(e,r,i),Q0(e,r,i,n),ng(null,e,r,!0,t,n);case 19:return ax(t,e,n);case 22:return ix(t,e,n)}throw Error(F(156,e.tag))};function xx(t,e){return Z_(t,e)}function oM(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bn(t,e,n,r){return new oM(t,e,n,r)}function i1(t){return t=t.prototype,!(!t||!t.isReactComponent)}function lM(t){if(typeof t=="function")return i1(t)?1:0;if(t!=null){if(t=t.$$typeof,t===vm)return 11;if(t===xm)return 14}return 2}function Vi(t,e){var n=t.alternate;return n===null?(n=Bn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function ed(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")i1(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case No:return Os(n.children,i,s,e);case _m:o=8,i|=8;break;case v0:return t=Bn(12,n,e,i|2),t.elementType=v0,t.lanes=s,t;case x0:return t=Bn(13,n,e,i),t.elementType=x0,t.lanes=s,t;case S0:return t=Bn(19,n,e,i),t.elementType=S0,t.lanes=s,t;case I_:return ih(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case D_:o=10;break e;case R_:o=9;break e;case vm:o=11;break e;case xm:o=14;break e;case pi:o=16,r=null;break e}throw Error(F(130,t==null?t:typeof t,""))}return e=Bn(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function Os(t,e,n,r){return t=Bn(7,t,r,e),t.lanes=n,t}function ih(t,e,n,r){return t=Bn(22,t,r,e),t.elementType=I_,t.lanes=n,t.stateNode={isHidden:!1},t}function bp(t,e,n){return t=Bn(6,t,null,e),t.lanes=n,t}function yp(t,e,n){return e=Bn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function aM(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xh(0),this.expirationTimes=Xh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function s1(t,e,n,r,i,s,o,l,a){return t=new aM(t,e,n,l,a),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Bn(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hm(s),t}function uM(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:To,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function Sx(t){if(!t)return Zi;t=t._reactInternals;e:{if(oo(t)!==t||t.tag!==1)throw Error(F(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(rn(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(F(171))}if(t.tag===1){var n=t.type;if(rn(n))return Sv(t,n,e)}return e}function Cx(t,e,n,r,i,s,o,l,a){return t=s1(n,r,!0,t,i,s,o,l,a),t.context=Sx(null),n=t.current,r=Vt(),i=Hi(n),s=Gr(r,i),s.callback=e??null,$i(n,s,i),t.current.lanes=i,Lu(t,i,r),sn(t,r),t}function sh(t,e,n,r){var i=e.current,s=Vt(),o=Hi(i);return n=Sx(n),e.context===null?e.context=n:e.pendingContext=n,e=Gr(s,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=$i(i,e,o),t!==null&&(lr(t,i,o,s),Gc(t,i,o)),o}function $d(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function oE(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function o1(t,e){oE(t,e),(t=t.alternate)&&oE(t,e)}function cM(){return null}var Ax=typeof reportError=="function"?reportError:function(t){console.error(t)};function l1(t){this._internalRoot=t}oh.prototype.render=l1.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(F(409));sh(t,e,null,null)};oh.prototype.unmount=l1.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Gs(function(){sh(null,t,null,null)}),e[ei]=null}};function oh(t){this._internalRoot=t}oh.prototype.unstable_scheduleHydration=function(t){if(t){var e=iv();t={blockedOn:null,target:t,priority:e};for(var n=0;n<ki.length&&e!==0&&e<ki[n].priority;n++);ki.splice(n,0,t),n===0&&ov(t)}};function a1(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function lh(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function lE(){}function dM(t,e,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=$d(o);s.call(u)}}var o=Cx(e,r,t,0,null,!1,!1,"",lE);return t._reactRootContainer=o,t[ei]=o.current,Ua(t.nodeType===8?t.parentNode:t),Gs(),o}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var u=$d(a);l.call(u)}}var a=s1(t,0,!1,null,null,!1,!1,"",lE);return t._reactRootContainer=a,t[ei]=a.current,Ua(t.nodeType===8?t.parentNode:t),Gs(function(){sh(e,a,n,r)}),a}function ah(t,e,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var l=i;i=function(){var a=$d(o);l.call(a)}}sh(e,o,t,i)}else o=dM(n,e,t,i,r);return $d(o)}nv=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=na(e.pendingLanes);n!==0&&(Am(e,n|1),sn(e,qe()),!(be&6)&&(sl=qe()+500,as()))}break;case 13:Gs(function(){var r=ti(t,1);if(r!==null){var i=Vt();lr(r,t,1,i)}}),o1(t,1)}};Tm=function(t){if(t.tag===13){var e=ti(t,134217728);if(e!==null){var n=Vt();lr(e,t,134217728,n)}o1(t,134217728)}};rv=function(t){if(t.tag===13){var e=Hi(t),n=ti(t,e);if(n!==null){var r=Vt();lr(n,t,e,r)}o1(t,e)}};iv=function(){return _e};sv=function(t,e){var n=_e;try{return _e=t,e()}finally{_e=n}};L0=function(t,e,n){switch(e){case"input":if(T0(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=Xf(r);if(!i)throw Error(F(90));P_(r),T0(r,i)}}}break;case"textarea":B_(t,n);break;case"select":e=n.value,e!=null&&Ho(t,!!n.multiple,e,!1)}};K_=t1;j_=Gs;var fM={usingClientEntryPoint:!1,Events:[Fu,Ro,Xf,V_,W_,t1]},Gl={findFiberByHostInstance:xs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},hM={bundleType:Gl.bundleType,version:Gl.version,rendererPackageName:Gl.rendererPackageName,rendererConfig:Gl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ai.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Y_(t),t===null?null:t.stateNode},findFiberByHostInstance:Gl.findFiberByHostInstance||cM,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gc.isDisabled&&gc.supportsFiber)try{Gf=gc.inject(hM),vr=gc}catch{}}An.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fM;An.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!a1(e))throw Error(F(200));return uM(t,e,null,n)};An.createRoot=function(t,e){if(!a1(t))throw Error(F(299));var n=!1,r="",i=Ax;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=s1(t,1,!1,null,null,n,!1,r,i),t[ei]=e.current,Ua(t.nodeType===8?t.parentNode:t),new l1(e)};An.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(F(188)):(t=Object.keys(t).join(","),Error(F(268,t)));return t=Y_(e),t=t===null?null:t.stateNode,t};An.flushSync=function(t){return Gs(t)};An.hydrate=function(t,e,n){if(!lh(e))throw Error(F(200));return ah(null,t,e,!0,n)};An.hydrateRoot=function(t,e,n){if(!a1(t))throw Error(F(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=Ax;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=Cx(e,null,t,1,n??null,i,!1,s,o),t[ei]=e.current,Ua(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new oh(e)};An.render=function(t,e,n){if(!lh(e))throw Error(F(200));return ah(null,t,e,!1,n)};An.unmountComponentAtNode=function(t){if(!lh(t))throw Error(F(40));return t._reactRootContainer?(Gs(function(){ah(null,null,t,!1,function(){t._reactRootContainer=null,t[ei]=null})}),!0):!1};An.unstable_batchedUpdates=t1;An.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!lh(n))throw Error(F(200));if(t==null||t._reactInternals===void 0)throw Error(F(38));return ah(t,e,n,!1,r)};An.version="18.3.1-next-f1338f8080-20240426";function Tx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Tx)}catch(t){console.error(t)}}Tx(),T_.exports=An;var Nx=T_.exports;const pM=A_(Nx);function GV(){}function YV(){}function wt(t){this.content=t}wt.prototype={constructor:wt,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new wt(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new wt(n)},addToStart:function(t,e){return new wt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new wt(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new wt(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=wt.from(t),t.size?new wt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=wt.from(t),t.size?new wt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=wt.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};wt.from=function(t){if(t instanceof wt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new wt(e)};function Mx(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)n++;return n}if(i.content.size||s.content.size){let o=Mx(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function Ox(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){n-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:n,b:r};if(o.isText&&o.text!=l.text){let u=0,c=Math.min(o.text.length,l.text.length);for(;u<c&&o.text[o.text.length-u-1]==l.text[l.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(o.content.size||l.content.size){let u=Ox(o.content,l.content,n-1,r-1);if(u)return u}n-=a,r-=a}}class R{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,l=0;l<n;o++){let a=this.content[o],u=l+a.nodeSize;if(u>e&&r(a,i+l,s||null,o)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,e-c),Math.min(a.content.size,n-c),r,i+c)}l=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(l,a)=>{let u=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&r&&(o?o=!1:s+=r),s+=u},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new R(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let l=this.content[s],a=o+l.nodeSize;a>e&&((o<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,n-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,n-o-1))),r.push(l),i+=l.nodeSize),o=a}return new R(r,i)}cutByIndex(e,n){return e==n?R.empty:e==0&&n==this.content.length?this:new R(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new R(i,s)}addToStart(e){return new R([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new R(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return Mx(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Ox(this,e,n,r)}findIndex(e){if(e==0)return mc(0,e);if(e==this.size)return mc(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?mc(n+1,s):mc(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return R.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new R(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return R.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new R(n||e,r)}static from(e){if(!e)return R.empty;if(e instanceof R)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new R([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}R.empty=new R([],0);const Ep={index:0,offset:0};function mc(t,e){return Ep.index=t,Ep.offset=e,Ep}function Ud(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Ud(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ud(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Ee=class pg{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ud(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return pg.none;if(e instanceof pg)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Ee.none=[];class Hd extends Error{}class ${constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Rx(this.content,e+this.openStart,n);return r&&new $(r,this.openStart,this.openEnd)}removeBetween(e,n){return new $(Dx(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return $.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new $(R.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new $(e,r,i)}}$.empty=new $(R.empty,0,0);function Dx(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:l}=t.findIndex(n);if(i==e||s.isText){if(l!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(Dx(s.content,e-i-1,n-i-1)))}function Rx(t,e,n,r){let{index:i,offset:s}=t.findIndex(e),o=t.maybeChild(i);if(s==e||o.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=Rx(o.content,e-s-1,n,o);return l&&t.replaceChild(i,o.copy(l))}function gM(t,e,n){if(n.openStart>t.depth)throw new Hd("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Hd("Inconsistent open depths");return Ix(t,e,n,0)}function Ix(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=Ix(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,l=o.content;return Rs(o,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=mM(n,t);return Rs(s,Px(t,o,l,e,r))}else return Rs(s,Vd(t,e,r))}function Lx(t,e){if(!e.type.compatibleContent(t.type))throw new Hd("Cannot join "+e.type.name+" onto "+t.type.name)}function gg(t,e,n){let r=t.node(n);return Lx(r,e.node(n)),r}function Ds(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function ya(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(Ds(t.nodeAfter,r),s++));for(let l=s;l<o;l++)Ds(i.child(l),r);e&&e.depth==n&&e.textOffset&&Ds(e.nodeBefore,r)}function Rs(t,e){return t.type.checkContent(e),t.copy(e)}function Px(t,e,n,r,i){let s=t.depth>i&&gg(t,e,i+1),o=r.depth>i&&gg(n,r,i+1),l=[];return ya(null,t,i,l),s&&o&&e.index(i)==n.index(i)?(Lx(s,o),Ds(Rs(s,Px(t,e,n,r,i+1)),l)):(s&&Ds(Rs(s,Vd(t,e,i+1)),l),ya(e,n,i,l),o&&Ds(Rs(o,Vd(n,r,i+1)),l)),ya(r,null,i,l),new R(l)}function Vd(t,e,n){let r=[];if(ya(null,t,n,r),t.depth>n){let i=gg(t,e,n+1);Ds(Rs(i,Vd(t,e,n+1)),r)}return ya(e,null,n,r),new R(r)}function mM(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(R.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Ja{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Ee.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Wd(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),u=s-a;if(r.push(o,l,i+a),!u||(o=o.child(l),o.isText))break;s=u-1,i+=a+1}return new Ja(n,r,s)}static resolveCached(e,n){let r=aE.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else aE.set(e,r=new bM);let i=r.elts[r.i]=Ja.resolve(e,n);return r.i=(r.i+1)%yM,i}}class bM{constructor(){this.elts=[],this.i=0}}const yM=12,aE=new WeakMap;class Wd{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const EM=Object.create(null);let Wi=class mg{constructor(e,n,r,i=Ee.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||R.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Ud(this.attrs,n||e.defaultAttrs||EM)&&Ee.sameSet(this.marks,r||Ee.none)}copy(e=null){return e==this.content?this:new mg(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new mg(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return $.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),l=i.start(o),u=i.node(o).content.cut(i.pos-l,s.pos-l);return new $(u,i.depth-o,s.depth-o)}replace(e,n,r){return gM(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Ja.resolveCached(this,e)}resolveNoCache(e){return Ja.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Fx(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=R.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),l=o&&o.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=i;a<s;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Ee.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Ee.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=R.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Wi.prototype.text=void 0;class Kd extends Wi{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Fx(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Kd(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Kd(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Fx(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Ys{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new kM(e,n);if(r.next==null)return Ys.empty;let i=Bx(r);r.next&&r.err("Unexpected trailing text");let s=AM(CM(i));return TM(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,l){let a=o.matchFragment(e,r);if(a&&(!n||a.validEnd))return R.from(l.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:c,next:d}=o.next[u];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=s(d,l.concat(c));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let l=i;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:l,next:a}=s.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
|
|
25
|
+
`)}}Ys.empty=new Ys(!0);class kM{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Bx(t){let e=[];do e.push(wM(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function wM(t){let e=[];do e.push(_M(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function _M(t){let e=SM(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=vM(t,e);else break;return e}function uE(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function vM(t,e){let n=uE(t),r=n;return t.eat(",")&&(t.next!="}"?r=uE(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function xM(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function SM(t){if(t.eat("(")){let e=Bx(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=xM(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function CM(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,l,a){let u={term:a,to:l};return e[o].push(u),u}function i(o,l){o.forEach(a=>a.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((a,u)=>a.concat(s(u,l)),[]);if(o.type=="seq")for(let a=0;;a++){let u=s(o.exprs[a],l);if(a==o.exprs.length-1)return u;i(u,l=n())}else if(o.type=="star"){let a=n();return r(l,a),i(s(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=n();return i(s(o.expr,l),a),i(s(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(s(o.expr,l));if(o.type=="range"){let a=l;for(let u=0;u<o.min;u++){let c=n();i(s(o.expr,a),c),a=c}if(o.max==-1)i(s(o.expr,a),a);else for(let u=o.min;u<o.max;u++){let c=n();r(a,c),i(s(o.expr,a),c),a=c}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function zx(t,e){return e-t}function cE(t,e){let n=[];return r(e),n.sort(zx);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:l,to:a}=s[o];!l&&n.indexOf(a)==-1&&r(a)}}}function AM(t){let e=Object.create(null);return n(cE(t,0));function n(r){let i=[];r.forEach(o=>{t[o].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c<i.length;c++)i[c][0]==l&&(u=i[c][1]);cE(t,a).forEach(c=>{u||i.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=e[r.join(",")]=new Ys(r.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let l=i[o][1].sort(zx);s.next.push({type:i[o][0],next:e[l.join(",")]||n(l)})}return s}}function TM(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let l=0;l<i.next.length;l++){let{type:a,next:u}=i.next[l];o.push(a.name),s&&!(a.isText||a.hasRequiredAttrs())&&(s=!1),r.indexOf(u)==-1&&r.push(u)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function $x(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Ux(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Hx(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let s=t[i];s.validate&&s.validate(e[i])}}function Vx(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new MM(t,r,e[r]);return n}let dE=class Wx{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Vx(e,r.attrs),this.defaultAttrs=$x(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ys.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Ux(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Wi(this,this.computeAttrs(e),R.from(n),Ee.setFrom(r))}createChecked(e=null,n,r){return n=R.from(n),this.checkContent(n),new Wi(this,this.computeAttrs(e),n,Ee.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=R.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(R.empty,!0);return s?new Wi(this,e,n.append(s),Ee.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Hx(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Ee.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new Wx(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function NM(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class MM{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?NM(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class uh{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Vx(e,i.attrs),this.excluded=null;let s=$x(this.attrs);this.instance=s?new Ee(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Ee(this,Ux(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new uh(s,i++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Hx(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}let u1=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=wt.from(e.nodes),n.marks=wt.from(e.marks||{}),this.nodes=dE.compile(this.spec.nodes,this),this.marks=uh.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=Ys.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?fE(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:fE(this,o.split(" "))}this.nodeFromJSON=i=>Wi.fromJSON(this,i),this.markFromJSON=i=>Ee.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof dE){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new Kd(r,r.defaultAttrs,e,Ee.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function fE(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let l in t.marks){let a=t.marks[l];(i=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function OM(t){return t.tag!=null}function DM(t){return t.style!=null}let Ea=class bg{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(OM(i))this.tags.push(i);else if(DM(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new pE(this,n,!1);return r.addAll(e,Ee.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new pE(this,n,!0);return r.addAll(e,Ee.none,n.from,n.to),$.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(LM(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(o.getAttrs){let a=o.getAttrs(n);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let l=n[o];if((l.priority==null?50:l.priority)<s)break}n.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=gE(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=gE(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new bg(e,bg.schemaRules(e)))}};const Kx={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},RM={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},jx={ol:!0,ul:!0},Za=1,yg=2,ka=4;function hE(t,e,n){return e!=null?(e?Za:0)|(e==="full"?yg:0):t&&t.whitespace=="pre"?Za|yg:n&~ka}class bc{constructor(e,n,r,i,s,o){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=Ee.none,this.match=s||(o&ka?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(R.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Za)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=R.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(R.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Kx.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class pE{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,o=hE(null,n.preserveWhitespace,0)|(r?ka:0);i?s=new bc(i.type,i.attrs,Ee.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new bc(null,null,Ee.none,!0,null,o):s=new bc(e.schema.topNodeType,null,Ee.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,s=i.options&yg?"full":this.localPreserveWS||(i.options&Za)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
|
|
26
|
+
`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),n,!0),l[a]&&this.insertNode(o.text(l[a]),n,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=i.content[i.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;jx.hasOwnProperty(o)&&this.parser.normalizeLists&&IM(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:RM.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let u,c=this.needsBlock;if(Kx.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),u=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=a&&a.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),u&&this.sync(s),this.needsBlock=c}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,a,u,a.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
27
|
+
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(s,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?n=n.filter(u=>!a.clearMark(u)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(e,n,r,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,n.attrs||null,r,n.preserveWhitespace);a&&(s=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}s&&this.sync(l)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];o!=l;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,n);this.findAtPoint(e,s)}findPlace(e,n,r){let i,s;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],u=a.findWrapping(e);if(u&&(!i||i.length>u.length+l)&&(i=u,s=a,!u.length))break;if(a.solid){if(r)break;l+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)n=this.enterInner(i[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=Ee.none;for(let l of i.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):mE(l.type,e.type))&&(o=l.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=hE(e,s,o.options);o.options&ka&&o.content.length==0&&(l|=ka);let a=Ee.none;return r=r.filter(u=>(o.type?o.type.allowsMarkType(u.type):mE(u.type,e))?(a=u.addToSet(a),!1):!0),this.nodes.push(new bc(e,n,a,i,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Za)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(l,a)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let c=a>0||a==0&&i?this.nodes[a].type:r&&a>=s?r.node(a-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;a--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function IM(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&jx.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function LM(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function gE(t){let e={};for(let n in t)e[n]=t[n];return e}function mE(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=l=>{s.push(l);for(let a=0;a<l.edgeCount;a++){let{type:u,next:c}=l.edge(a);if(u==e||s.indexOf(c)<0&&o(c))return!0}};if(o(i.contentMatch))return!0}}class lo{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=kp(n).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let l=0,a=0;for(;l<s.length&&a<o.marks.length;){let u=o.marks[a];if(!this.marks[u.type.name]){a++;continue}if(!u.eq(s[l][0])||u.type.spec.spanning===!1)break;l++,a++}for(;l<s.length;)i=s.pop()[1];for(;a<o.marks.length;){let u=o.marks[a++],c=this.serializeMark(u,o.isInline,n);c&&(s.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=td(kp(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&td(kp(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return td(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new lo(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=bE(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return bE(e.marks)}}function bE(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function kp(t){return t.document||window.document}const yE=new WeakMap;function PM(t){let e=yE.get(t);return e===void 0&&yE.set(t,e=FM(t)),e}function FM(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function td(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=PM(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let l,a=n?t.createElementNS(n,i):t.createElement(i),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&a.style?a.style.cssText=u[d]:a.setAttribute(d,u[d])}}for(let d=c;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=td(t,f,n,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const qx=65535,Gx=Math.pow(2,16);function BM(t,e){return t+e*Gx}function EE(t){return t&qx}function zM(t){return(t-(t&qx))/Gx}const Yx=1,Jx=2,nd=4,Zx=8;class Eg{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Zx)>0}get deletedBefore(){return(this.delInfo&(Yx|nd))>0}get deletedAfter(){return(this.delInfo&(Jx|nd))>0}get deletedAcross(){return(this.delInfo&nd)>0}}class bn{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&bn.empty)return bn.empty}recover(e){let n=0,r=EE(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+zM(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?i:0);if(a>e)break;let u=this.ranges[l+s],c=this.ranges[l+o],d=a+u;if(e<=d){let f=u?e==a?-1:e==d?1:n:n,h=a+i+(f<0?0:c);if(r)return h;let p=e==(n<0?a:d)?null:BM(l/3,e-a),g=e==a?Jx:e==d?Yx:nd;return(n<0?e!=a:e!=d)&&(g|=Zx),new Eg(h,g,p)}i+=c-u}return r?e+i:new Eg(e+i,0,null)}touches(e,n){let r=0,i=EE(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let u=this.ranges[l+s],c=a+u;if(e<=c&&l==i*3)return!0;r+=this.ranges[l+o]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],l=o-(this.inverted?s:0),a=o+(this.inverted?0:s),u=this.ranges[i+n],c=this.ranges[i+r];e(l,l+u,a,a+c),s+=c-u}}invert(){return new bn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?bn.empty:new bn(e<0?[0,-e,0]:[0,0,e])}}bn.empty=new bn([]);class Xa{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Xa(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Xa;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],l=o.mapResult(e,n);if(l.recover!=null){let a=this.getMirror(s);if(a!=null&&a>s&&a<this.to){s=a,e=this._maps[a].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new Eg(e,i,null)}}const wp=Object.create(null);class Bt{getMap(){return bn.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=wp[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in wp)throw new RangeError("Duplicate use of step JSON ID "+e);return wp[e]=n,n.prototype.jsonID=e,n}}class Qe{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Qe(e,null)}static fail(e){return new Qe(null,e)}static fromReplace(e,n,r,i){try{return Qe.ok(e.replace(n,r,i))}catch(s){if(s instanceof Hd)return Qe.fail(s.message);throw s}}}function c1(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(c1(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return R.fromArray(r)}class Ni extends Bt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new $(c1(n.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return Qe.fromReplace(e,this.from,this.to,s)}invert(){return new kr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ni(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ni&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ni(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ni(n.from,n.to,e.markFromJSON(n.mark))}}Bt.jsonID("addMark",Ni);class kr extends Bt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new $(c1(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Qe.fromReplace(e,this.from,this.to,r)}invert(){return new Ni(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new kr(n.pos,r.pos,this.mark)}merge(e){return e instanceof kr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new kr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new kr(n.from,n.to,e.markFromJSON(n.mark))}}Bt.jsonID("removeMark",kr);class Mi extends Bt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Qe.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Qe.fromReplace(e,this.pos,this.pos+1,new $(R.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Mi(this.pos,n.marks[i]);return new Mi(this.pos,this.mark)}}return new Js(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Mi(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Mi(n.pos,e.markFromJSON(n.mark))}}Bt.jsonID("addNodeMark",Mi);class Js extends Bt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Qe.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Qe.fromReplace(e,this.pos,this.pos+1,new $(R.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Mi(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Js(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Js(n.pos,e.markFromJSON(n.mark))}}Bt.jsonID("removeNodeMark",Js);class ft extends Bt{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&kg(e,this.from,this.to)?Qe.fail("Structure replace would overwrite content"):Qe.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new bn([this.from,this.to-this.from,this.slice.size])}invert(e){return new ft(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new ft(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ft)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?$.empty:new $(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ft(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?$.empty:new $(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ft(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ft(n.from,n.to,$.fromJSON(e,n.slice),!!n.structure)}}Bt.jsonID("replace",ft);class gt extends Bt{constructor(e,n,r,i,s,o,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=l}apply(e){if(this.structure&&(kg(e,this.from,this.gapFrom)||kg(e,this.gapTo,this.to)))return Qe.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Qe.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Qe.fromReplace(e,this.from,this.to,r):Qe.fail("Content does not fit in gap")}getMap(){return new bn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new gt(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new gt(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new gt(n.from,n.to,n.gapFrom,n.gapTo,$.fromJSON(e,n.slice),n.insert,!!n.structure)}}Bt.jsonID("replaceAround",gt);function kg(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function $M(t,e,n,r){let i=[],s=[],o,l;t.doc.nodesBetween(e,n,(a,u,c)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let f=Math.max(u,e),h=Math.min(u+a.nodeSize,n),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(o&&o.to==f&&o.mark.eq(d[g])?o.to=h:i.push(o=new kr(f,h,d[g])));l&&l.to==f?l.to=h:s.push(l=new Ni(f,h,r))}}),i.forEach(a=>t.step(a)),s.forEach(a=>t.step(a))}function UM(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,l)=>{if(!o.isInline)return;s++;let a=null;if(r instanceof uh){let u=o.marks,c;for(;c=r.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let u=Math.min(l+o.nodeSize,n);for(let c=0;c<a.length;c++){let d=a[c],f;for(let h=0;h<i.length;h++){let p=i[h];p.step==s-1&&d.eq(i[h].style)&&(f=p)}f?(f.to=u,f.step=s):i.push({style:d,from:Math.max(l,e),to:u,step:s})}}}),i.forEach(o=>t.step(new kr(o.from,o.to,o.style)))}function d1(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<s.childCount;a++){let u=s.child(a),c=l+u.nodeSize,d=r.matchType(u.type);if(!d)o.push(new ft(l,c,$.empty));else{r=d;for(let f=0;f<u.marks.length;f++)n.allowsMarkType(u.marks[f].type)||t.step(new kr(l,c,u.marks[f]));if(i&&u.isText&&n.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(u.text);)p||(p=new $(R.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),o.push(new ft(l+f.index,l+f.index+f[0].length,p))}}l=c}if(!r.validEnd){let a=r.fillBefore(R.empty,!0);t.replace(l,l,new $(a,0,0))}for(let a=o.length-1;a>=0;a--)t.step(o[a])}function HM(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Ml(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,s=0;;--r){let o=t.$from.node(r),l=t.$from.index(r)+i,a=t.$to.indexAfter(r)-s;if(r<t.depth&&o.canReplace(l,a,n))return r;if(r==0||o.type.spec.isolating||!HM(o,l,a))break;l&&(i=1),a<o.childCount&&(s=1)}return null}function VM(t,e,n){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),l=i.after(s+1),a=o,u=l,c=R.empty,d=0;for(let p=s,g=!1;p>n;p--)g||r.index(p)>0?(g=!0,c=R.from(r.node(p).copy(c)),d++):a--;let f=R.empty,h=0;for(let p=s,g=!1;p>n;p--)g||i.after(p+1)<i.end(p)?(g=!0,f=R.from(i.node(p).copy(f)),h++):u++;t.step(new gt(a,u,o,l,new $(c.append(f),d,h),c.size-d,!0))}function f1(t,e,n=null,r=t){let i=WM(t,e),s=i&&KM(r,e);return s?i.map(kE).concat({type:e,attrs:n}).concat(s.map(kE)):null}function kE(t){return{type:t,attrs:null}}function WM(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return n.canReplaceWith(r,i,o)?s:null}function KM(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let u=r;a&&u<i;u++)a=a.matchType(n.child(u).type);return!a||!a.validEnd?null:o}function jM(t,e,n){let r=R.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let l=n[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=R.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new gt(i,s,i,s,new $(r,0,0),n.length,!0))}function qM(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,l)=>{let a=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,a)&&GM(t.doc,t.mapping.slice(s).map(l),r)){let u=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?u=!1:!h&&p&&(u=!0)}u===!1&&Qx(t,o,l,s),d1(t,t.mapping.slice(s).map(l,1),r,void 0,u===null);let c=t.mapping.slice(s),d=c.map(l,1),f=c.map(l+o.nodeSize,1);return t.step(new gt(d,f,d+1,f-1,new $(R.from(r.create(a,null,o.marks)),0,0),1,!0)),u===!0&&Xx(t,o,l,s),!1}})}function Xx(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let a=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Qx(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(`
|
|
28
|
+
`))}})}function GM(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function YM(t,e,n,r,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,o);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new gt(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new $(R.from(o),0,0),1,!0))}function Yr(t,e,n=1,r){let i=t.resolve(e),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=n-2;u>s;u--,c--){let d=i.node(u),f=i.index(u);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),p=r&&r[c+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let g=r&&r[c]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(h))return!1}let l=i.indexAfter(s),a=r&&r[0];return i.node(s).canReplaceWith(l,l,a?a.type:i.node(s+1).type)}function JM(t,e,n=1,r){let i=t.doc.resolve(e),s=R.empty,o=R.empty;for(let l=i.depth,a=i.depth-n,u=n-1;l>a;l--,u--){s=R.from(i.node(l).copy(s));let c=r&&r[u];o=R.from(c?c.type.create(c.attrs,o):i.node(l).copy(o))}t.step(new ft(e,e,new $(s.append(o),n,n),!0))}function us(t,e){let n=t.resolve(e),r=n.index();return e2(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ZM(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(o),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function e2(t,e){return!!(t&&e&&!t.isLeaf&&ZM(t,e))}function ch(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let s,o,l=r.index(i);if(i==r.depth?(s=r.nodeBefore,o=r.nodeAfter):n>0?(s=r.node(i+1),l++,o=r.node(i).maybeChild(l)):(s=r.node(i).maybeChild(l-1),o=r.node(i+1)),s&&!s.isTextblock&&e2(s,o)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function XM(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-n),o=s.node().type;if(i&&o.inlineContent){let c=o.whitespace=="pre",d=!!o.contentMatch.matchType(i);c&&!d?r=!1:!c&&d&&(r=!0)}let l=t.steps.length;if(r===!1){let c=t.doc.resolve(e+n);Qx(t,c.node(),c.before(),l)}o.inlineContent&&d1(t,e+n-1,o,s.node().contentMatchAt(s.index()),r==null);let a=t.mapping.slice(l),u=a.map(e-n);if(t.step(new ft(u,a.map(e+n,-1),$.empty,!0)),r===!0){let c=t.doc.resolve(u);Xx(t,c.node(),c.before(),t.steps.length)}return t}function QM(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function t2(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let o=r.depth;o>=0;o--){let l=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,a=r.index(o)+(l>0?1:0),u=r.node(o),c=!1;if(s==1)c=u.canReplace(a,a,i);else{let d=u.contentMatchAt(a).findWrapping(i.firstChild.type);c=d&&u.canReplaceWith(a,a,d[0])}if(c)return l==0?r.pos:l<0?r.before(o+1):r.after(o+1)}return null}function dh(t,e,n=e,r=$.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return n2(i,s,r)?new ft(e,n,r):new eO(i,s,r).fit()}function n2(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class eO{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=R.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=R.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,o=r.depth,l=i.depth;for(;o&&l&&s.childCount==1;)s=s.firstChild.content,o--,l--;let a=new $(s,o,l);return e>-1?new gt(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new ft(r.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=_p(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,d=null;if(n==1&&(o?u.matchType(o.type)||(d=u.fillBefore(R.from(o),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:l,parent:s,inject:d};if(n==2&&o&&(c=u.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=_p(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new $(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=_p(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new $(ia(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new $(ia(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g<s.length;g++)this.openFrontierNode(s[g]);let o=this.unplaced,l=r?r.content:o.content,a=o.openStart-e,u=0,c=[],{match:d,type:f}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)c.push(i.child(g));d=d.matchFragment(i)}let h=l.size+e-(o.content.size-o.openEnd);for(;u<l.childCount;){let g=l.child(u),b=d.matchType(g.type);if(!b)break;u++,(u>1||a==0||g.content.size)&&(d=b,c.push(r2(g.mark(f.allowedMarks(g.marks)),u==1?a:0,u==l.childCount?h:-1)))}let p=u==l.childCount;p||(h=-1),this.placed=sa(this.placed,n,R.from(c)),this.frontier[n].match=d,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,b=l;g<h;g++){let m=b.lastChild;this.frontier.push({type:m.type,match:m.contentMatchAt(m.childCount)}),b=m.content}this.unplaced=p?e==0?$.empty:new $(ia(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new $(ia(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!vp(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),o=vp(e,n,i,r,s);if(o){for(let l=n-1;l>=0;l--){let{match:a,type:u}=this.frontier[l],c=vp(e,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:n,fit:o,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=sa(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=sa(this.placed,this.depth,R.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(R.empty,!0);n.childCount&&(this.placed=sa(this.placed,this.frontier.length,n))}}function ia(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(ia(t.firstChild.content,e-1,n)))}function sa(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(sa(t.lastChild.content,e-1,n)))}function _p(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function r2(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,r2(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(R.empty,!0)))),t.copy(r)}function vp(t,e,n,r,i){let s=t.node(e),o=i?t.indexAfter(e):t.index(e);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let l=r.fillBefore(s.content,!0,o);return l&&!tO(n,s.content,o)?l:null}function tO(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function nO(t){return t.spec.defining||t.spec.definingForContent}function rO(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(n2(i,s,r))return t.step(new ft(e,n,r));let o=s2(i,s);o[o.length-1]==0&&o.pop();let l=-(i.depth+1);o.unshift(l);for(let f=i.depth,h=i.pos-1;f>0;f--,h--){let p=i.node(f).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(f)>-1?l=f:i.before(f)==h&&o.splice(1,0,-f)}let a=o.indexOf(l),u=[],c=r.openStart;for(let f=r.content,h=0;;h++){let p=f.firstChild;if(u.push(p),h==r.openStart)break;f=p.content}for(let f=c-1;f>=0;f--){let h=u[f],p=nO(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(l)-1)))c=f;else if(p||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+c+1)%(r.openStart+1),p=u[h];if(p)for(let g=0;g<o.length;g++){let b=o[(g+a)%o.length],m=!0;b<0&&(m=!1,b=-b);let E=i.node(b-1),k=i.index(b-1);if(E.canReplaceWith(k,k,p.type,p.marks))return t.replace(i.before(b),m?s.after(b):n,new $(i2(r.content,0,r.openStart,h),h,r.openEnd))}}let d=t.steps.length;for(let f=o.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let h=o[f];h<0||(e=i.before(h),n=s.after(h))}}function i2(t,e,n,r,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(i2(s.content,e+1,n,r,s)))}if(e>r){let s=i.contentMatchAt(0),o=s.fillBefore(t).append(t);t=o.append(s.matchFragment(o).fillBefore(R.empty,!0))}return t}function iO(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=QM(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new $(R.from(r),0,0))}function sO(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),s=s2(r,i);for(let o=0;o<s.length;o++){let l=s[o],a=o==s.length-1;if(a&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),i.end(l));if(l>0&&(a||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function s2(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let s=t.start(i);if(s<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&n.push(i)}return n}class Go extends Bt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Qe.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Qe.fromReplace(e,this.pos,this.pos+1,new $(R.from(i),0,n.isLeaf?0:1))}getMap(){return bn.empty}invert(e){return new Go(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Go(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Go(n.pos,n.attr,n.value)}}Bt.jsonID("attr",Go);class Qa extends Bt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Qe.ok(r)}getMap(){return bn.empty}invert(e){return new Qa(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Qa(n.attr,n.value)}}Bt.jsonID("docAttr",Qa);let ol=class extends Error{};ol=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};ol.prototype=Object.create(Error.prototype);ol.prototype.constructor=ol;ol.prototype.name="TransformError";class h1{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Xa}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new ol(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(e=i.map(e,1),n=i.map(n,-1)),i.forEach((s,o,l,a)=>{e=Math.min(e,l),n=Math.max(n,a)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=$.empty){let i=dh(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new $(R.from(r),0,0))}delete(e,n){return this.replace(e,n,$.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return rO(this,e,n,r),this}replaceRangeWith(e,n,r){return iO(this,e,n,r),this}deleteRange(e,n){return sO(this,e,n),this}lift(e,n){return VM(this,e,n),this}join(e,n=1){return XM(this,e,n),this}wrap(e,n){return jM(this,e,n),this}setBlockType(e,n=e,r,i=null){return qM(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return YM(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Go(e,n,r)),this}setDocAttribute(e,n){return this.step(new Qa(e,n)),this}addNodeMark(e,n){return this.step(new Mi(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof Ee)n.isInSet(r.marks)&&this.step(new Js(e,n));else{let i=r.marks,s,o=[];for(;s=n.isInSet(i);)o.push(new Js(e,s)),i=s.removeFromSet(i);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(e,n=1,r){return JM(this,e,n,r),this}addMark(e,n,r){return $M(this,e,n,r),this}removeMark(e,n,r){return UM(this,e,n,r),this}clearIncompatible(e,n,r){return d1(this,e,n,r),this}}const xp=Object.create(null);class ne{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new o2(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=$.empty){let r=n.content.lastChild,i=null;for(let l=0;l<n.openEnd;l++)i=r,r=r.lastChild;let s=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:a,$to:u}=o[l],c=e.mapping.slice(s);e.replaceRange(c.map(a.pos),c.map(u.pos),l?$.empty:n),l==0&&vE(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:l}=i[s],a=e.mapping.slice(r),u=a.map(o.pos),c=a.map(l.pos);s?e.deleteRange(u,c):(e.replaceRangeWith(u,c,n),vE(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new X(e):_o(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=n<0?_o(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):_o(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new on(e.node(0))}static atStart(e){return _o(e,e,0,0,1)||new on(e)}static atEnd(e){return _o(e,e,e.content.size,e.childCount,-1)||new on(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=xp[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in xp)throw new RangeError("Duplicate use of selection JSON ID "+e);return xp[e]=n,n.prototype.jsonID=e,n}getBookmark(){return X.between(this.$anchor,this.$head).getBookmark()}}ne.prototype.visible=!0;class o2{constructor(e,n){this.$from=e,this.$to=n}}let wE=!1;function _E(t){!wE&&!t.parent.inlineContent&&(wE=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class X extends ne{constructor(e,n=e){_E(e),_E(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ne.near(r);let i=e.resolve(n.map(this.anchor));return new X(i.parent.inlineContent?i:r,r)}replace(e,n=$.empty){if(super.replace(e,n),n==$.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof X&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new fh(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new X(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=ne.findFrom(n,r,!0)||ne.findFrom(n,-r,!0);if(s)n=s.$head;else return ne.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ne.findFrom(e,-r,!0)||ne.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new X(e,n)}}ne.jsonID("text",X);class fh{constructor(e,n){this.anchor=e,this.head=n}map(e){return new fh(e.map(this.anchor),e.map(this.head))}resolve(e){return X.between(e.resolve(this.anchor),e.resolve(this.head))}}class J extends ne{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),s=e.resolve(i);return r?ne.near(s):new J(s)}content(){return new $(R.from(this.node),0,0)}eq(e){return e instanceof J&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new p1(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new J(e.resolve(n.anchor))}static create(e,n){return new J(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}J.prototype.visible=!1;ne.jsonID("node",J);class p1{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new fh(r,r):new p1(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&J.isSelectable(r)?new J(n):ne.near(n)}}class on extends ne{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=$.empty){if(n==$.empty){e.delete(0,e.doc.content.size);let r=ne.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new on(e)}map(e){return new on(e)}eq(e){return e instanceof on}getBookmark(){return oO}}ne.jsonID("all",on);const oO={map(){return this},resolve(t){return new on(t)}};function _o(t,e,n,r,i,s=!1){if(e.inlineContent)return X.create(t,n);for(let o=r-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let l=e.child(o);if(l.isAtom){if(!s&&J.isSelectable(l))return J.create(t,n-(i<0?l.nodeSize:0))}else{let a=_o(t,l,n+i,i<0?l.childCount:0,i,s);if(a)return a}n+=l.nodeSize*i}return null}function vE(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof ft||i instanceof gt))return;let s=t.mapping.maps[r],o;s.forEach((l,a,u,c)=>{o==null&&(o=c)}),t.setSelection(ne.near(t.doc.resolve(o),n))}const xE=1,yc=2,SE=4;let lO=class extends h1{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|xE)&~yc,this.storedMarks=null,this}get selectionSet(){return(this.updated&xE)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=yc,this}ensureMarks(e){return Ee.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&yc)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~yc,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ee.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(n);s=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,s)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(ne.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=SE,this}get scrolledIntoView(){return(this.updated&SE)>0}};function CE(t,e){return!e||!t?t:t.bind(e)}class oa{constructor(e,n,r){this.name=e,this.init=CE(n.init,r),this.apply=CE(n.apply,r)}}const aO=[new oa("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new oa("selection",{init(t,e){return t.selection||ne.atStart(e.doc)},apply(t){return t.selection}}),new oa("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new oa("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Sp{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=aO.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new oa(r.key,r.spec.state,r))})}}class $o{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let l=this.config.plugins[o];if(l.spec.appendTransaction){let a=i?i[o].n:0,u=i?i[o].state:this,c=a<n.length&&l.spec.appendTransaction.call(l,a?n.slice(a):n,u,r);if(c&&r.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<o?{state:r,n:n.length}:{state:this,n:0})}n.push(c),r=r.applyInner(c),s=!0}i&&(i[o]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new $o(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new lO(this)}static create(e){let n=new Sp(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new $o(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new Sp(this.schema,e.plugins),r=n.fields,i=new $o(n);for(let s=0;s<r.length;s++){let o=r[s].name;i[o]=this.hasOwnProperty(o)?this[o]:r[s].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Sp(e.schema,e.plugins),s=new $o(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=Wi.fromJSON(e.schema,n.doc);else if(o.name=="selection")s.selection=ne.fromJSON(s.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],u=a.spec.state;if(a.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[o.name]=u.fromJSON.call(a,e,n[l],s);return}}s[o.name]=o.init(e,s)}}),s}}function l2(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=l2(i,e,{})),n[r]=i}return n}class Ae{constructor(e){this.spec=e,this.props={},e.props&&l2(e.props,this,this.props),this.key=e.key?e.key.key:a2("plugin")}getState(e){return e[this.key]}}const Cp=Object.create(null);function a2(t){return t in Cp?t+"$"+ ++Cp[t]:(Cp[t]=0,t+"$")}class Le{constructor(e="key"){this.key=a2(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const _t=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},ll=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let wg=null;const Hr=function(t,e,n){let r=wg||(wg=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},uO=function(){wg=null},Zs=function(t,e,n,r){return n&&(AE(t,e,n,r,-1)||AE(t,e,n,r,1))},cO=/^(img|br|input|textarea|hr)$/i;function AE(t,e,n,r,i){for(var s;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Fn(t))){let o=t.parentNode;if(!o||o.nodeType!=1||zu(t)||cO.test(t.nodeName)||t.contentEditable=="false")return!1;e=_t(t)+(i<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else t=o,e=i<0?Fn(t):0}else return!1}}function Fn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function dO(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Fn(t)}else if(t.parentNode&&!zu(t))e=_t(t),t=t.parentNode;else return null}}function fO(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!zu(t))e=_t(t)+1,t=t.parentNode;else return null}}function hO(t,e,n){for(let r=e==0,i=e==Fn(t);r||i;){if(t==n)return!0;let s=_t(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,i=i&&s==Fn(t)}}function zu(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const hh=function(t){return t.focusNode&&Zs(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function ws(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function pO(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function gO(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Fn(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Fn(r.startContainer),r.startOffset)}}}const Ar=typeof navigator<"u"?navigator:null,TE=typeof document<"u"?document:null,cs=Ar&&Ar.userAgent||"",_g=/Edge\/(\d+)/.exec(cs),u2=/MSIE \d/.exec(cs),vg=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(cs),ln=!!(u2||vg||_g),Ki=u2?document.documentMode:vg?+vg[1]:_g?+_g[1]:0,$n=!ln&&/gecko\/(\d+)/i.test(cs);$n&&+(/Firefox\/(\d+)/.exec(cs)||[0,0])[1];const xg=!ln&&/Chrome\/(\d+)/.exec(cs),xt=!!xg,c2=xg?+xg[1]:0,Lt=!ln&&!!Ar&&/Apple Computer/.test(Ar.vendor),al=Lt&&(/Mobile\/\w+/.test(cs)||!!Ar&&Ar.maxTouchPoints>2),In=al||(Ar?/Mac/.test(Ar.platform):!1),d2=Ar?/Win/.test(Ar.platform):!1,jr=/Android \d/.test(cs),$u=!!TE&&"webkitFontSmoothing"in TE.documentElement.style,mO=$u?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function bO(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Lr(t,e){return typeof t=="number"?t:t[e]}function yO(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function NE(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let o=n||t.dom;o;){if(o.nodeType!=1){o=ll(o);continue}let l=o,a=l==s.body,u=a?bO(s):yO(l),c=0,d=0;if(e.top<u.top+Lr(r,"top")?d=-(u.top-e.top+Lr(i,"top")):e.bottom>u.bottom-Lr(r,"bottom")&&(d=e.bottom-e.top>u.bottom-u.top?e.top+Lr(i,"top")-u.top:e.bottom-u.bottom+Lr(i,"bottom")),e.left<u.left+Lr(r,"left")?c=-(u.left-e.left+Lr(i,"left")):e.right>u.right-Lr(r,"right")&&(c=e.right-u.right+Lr(i,"right")),c||d)if(a)s.defaultView.scrollBy(c,d);else{let h=l.scrollLeft,p=l.scrollTop;d&&(l.scrollTop+=d),c&&(l.scrollLeft+=c);let g=l.scrollLeft-h,b=l.scrollTop-p;e={left:e.left-g,top:e.top-b,right:e.right-g,bottom:e.bottom-b}}let f=a?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(f))break;o=f=="absolute"?o.offsetParent:ll(o)}}function EO(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,o=n+1;o<Math.min(innerHeight,e.bottom);o+=5){let l=t.root.elementFromPoint(s,o);if(!l||l==t.dom||!t.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=n-20){r=l,i=a.top;break}}return{refDOM:r,refTop:i,stack:f2(t.dom)}}function f2(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=ll(r));return e}function kO({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;h2(n,r==0?0:r-e)}function h2(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:s}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let mo=null;function wO(t){if(t.setActive)return t.setActive();if(mo)return t.focus(mo);let e=f2(t);t.focus(mo==null?{get preventScroll(){return mo={preventScroll:!0},!0}}:void 0),mo||(mo=!1,h2(e,0))}function p2(t,e){let n,r=2e8,i,s=0,o=e.top,l=e.top,a,u;for(let c=t.firstChild,d=0;c;c=c.nextSibling,d++){let f;if(c.nodeType==1)f=c.getClientRects();else if(c.nodeType==3)f=Hr(c).getClientRects();else continue;for(let h=0;h<f.length;h++){let p=f[h];if(p.top<=o&&p.bottom>=l){o=Math.max(p.bottom,o),l=Math.min(p.top,l);let g=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(g<r){n=c,r=g,i=g&&n.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,c.nodeType==1&&g&&(s=d+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!a&&p.left<=e.left&&p.right>=e.left&&(a=c,u={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(s=d+1)}}return!n&&a&&(n=a,i=u,r=0),n&&n.nodeType==3?_O(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:p2(n,i)}function _O(t,e){let n=t.nodeValue.length,r=document.createRange(),i;for(let s=0;s<n;s++){r.setEnd(t,s+1),r.setStart(t,s);let o=hi(r,1);if(o.top!=o.bottom&&g1(e,o)){i={node:t,offset:s+(e.left>=(o.left+o.right)/2?1:0)};break}}return r.detach(),i||{node:t,offset:0}}function g1(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function vO(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function xO(t,e,n){let{node:r,offset:i}=p2(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();s=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,i,s)}function SO(t,e,n,r){let i=-1;for(let s=e,o=!1;s!=t.dom;){let l=t.docView.nearestDesc(s,!0),a;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!o&&a.left>r.left||a.top>r.top?i=l.posBefore:(!o&&a.right<r.left||a.bottom<r.top)&&(i=l.posAfter),o=!0),!l.contentDOM&&i<0&&!l.node.isText))return(l.node.isBlock?r.top<(a.top+a.bottom)/2:r.left<(a.left+a.right)/2)?l.posBefore:l.posAfter;s=l.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function g2(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let o=t.childNodes[s];if(o.nodeType==1){let l=o.getClientRects();for(let a=0;a<l.length;a++){let u=l[a];if(g1(e,u))return g2(o,e,u)}}if((s=(s+1)%r)==i)break}return t}function CO(t,e){let n=t.dom.ownerDocument,r,i=0,s=gO(n,e.left,e.top);s&&({node:r,offset:i}=s);let o=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let u=t.dom.getBoundingClientRect();if(!g1(e,u)||(o=g2(t.dom,e,u),!o))return null}if(Lt)for(let u=o;r&&u;u=ll(u))u.draggable&&(r=void 0);if(o=vO(o,e),r){if($n&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let c=r.childNodes[i],d;c.nodeName=="IMG"&&(d=c.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&i++}let u;$u&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=SO(t,r,i,e))}l==null&&(l=xO(t,o,e));let a=t.docView.nearestDesc(o,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function ME(t){return t.top<t.bottom||t.left<t.right}function hi(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(ME(r))return r}return Array.prototype.find.call(n,ME)||t.getBoundingClientRect()}const AO=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function m2(t,e,n){let{node:r,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),o=$u||$n;if(r.nodeType==3)if(o&&(AO.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let a=hi(Hr(r,i,i),n);if($n&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let u=hi(Hr(r,i-1,i-1),-1);if(u.top==a.top){let c=hi(Hr(r,i,i+1),-1);if(c.top!=a.top)return Yl(c,c.left<u.left)}}return a}else{let a=i,u=i,c=n<0?1:-1;return n<0&&!i?(u++,c=-1):n>=0&&i==r.nodeValue.length?(a--,c=1):n<0?a--:u++,Yl(hi(Hr(r,a,u),c),c<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==Fn(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return Ap(a.getBoundingClientRect(),!1)}if(s==null&&i<Fn(r)){let a=r.childNodes[i];if(a.nodeType==1)return Ap(a.getBoundingClientRect(),!0)}return Ap(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==Fn(r))){let a=r.childNodes[i-1],u=a.nodeType==3?Hr(a,Fn(a)-(o?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(u)return Yl(hi(u,1),!1)}if(s==null&&i<Fn(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let u=a?a.nodeType==3?Hr(a,0,o?0:1):a.nodeType==1?a:null:null;if(u)return Yl(hi(u,-1),!0)}return Yl(hi(r.nodeType==3?Hr(r):r,-n),n>=0)}function Yl(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Ap(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function b2(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function TO(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return b2(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let o=m2(t,i.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Hr(l,0,l.nodeValue.length).getClientRects();else continue;for(let u=0;u<a.length;u++){let c=a[u];if(c.bottom>c.top+1&&(n=="up"?o.top-c.top>(c.bottom-o.top)*2:c.bottom-o.bottom>(o.bottom-c.top)*2))return!1}}return!0})}const NO=/[\u0590-\u08ac]/;function MO(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,l=t.domSelection();return l?!NO.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?s:o:b2(t,e,()=>{let{focusNode:a,focusOffset:u,anchorNode:c,anchorOffset:d}=t.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:g}=t.domSelectionRange(),b=p&&!h.contains(p.nodeType==1?p:p.parentNode)||a==p&&u==g;try{l.collapse(c,d),a&&(a!=c||u!=d)&&l.extend&&l.extend(a,u)}catch{}return f!=null&&(l.caretBidiLevel=f),b}):r.pos==r.start()||r.pos==r.end()}let OE=null,DE=null,RE=!1;function OO(t,e,n){return OE==e&&DE==n?RE:(OE=e,DE=n,RE=n=="up"||n=="down"?TO(t,e,n):MO(t,e,n))}const Un=0,IE=1,As=2,Tr=3;class Uu{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Un,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,o;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>_t(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!n||s.node))if(r&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==e&&s!=r){for(;!i.border&&i.children.length;)for(let o=0;o<i.children.length;o++){let l=i.children[o];if(l.size){i=l;break}}return i}if(e<s)return i.descAt(e-r-i.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let o=this.children[r],l=s+o.size;if(l>e||o instanceof E2){i=e-s;break}s=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof y2&&s.side>=0;r--);if(n<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&n&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?_t(s.dom)+1:0}}else{let s,o=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?_t(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=r,l=0;;l++){let a=this.children[l],u=o+a.size;if(i==-1&&e<=u){let c=o+a.border;if(e>=c&&n<=u-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,n,c);e=o;for(let d=l;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=_t(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(u>n||l==this.children.length-1)){n=u;for(let c=l+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){s=_t(d.dom);break}n+=d.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=u}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let s=Math.min(e,n),o=Math.max(e,n);for(let h=0,p=0;h<this.children.length;h++){let g=this.children[h],b=p+g.size;if(s>p&&o<b)return g.setSelection(e-p-g.border,n-p-g.border,r,i);p=b}let l=this.domFromPos(e,e?-1:1),a=n==e?l:this.domFromPos(n,n?-1:1),u=r.root.getSelection(),c=r.domSelectionRange(),d=!1;if(($n||Lt)&&e==n){let{node:h,offset:p}=l;if(h.nodeType==3){if(d=!!(p&&h.nodeValue[p-1]==`
|
|
29
|
+
`),d&&p==h.nodeValue.length)for(let g=h,b;g;g=g.parentNode){if(b=g.nextSibling){b.nodeName=="BR"&&(l=a={node:b.parentNode,offset:_t(b)+1});break}let m=g.pmViewDesc;if(m&&m.node&&m.node.isBlock)break}}else{let g=h.childNodes[p-1];d=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if($n&&c.focusNode&&c.focusNode!=a.node&&c.focusNode.nodeType==1){let h=c.focusNode.childNodes[c.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||d&&Lt)&&Zs(l.node,l.offset,c.anchorNode,c.anchorOffset)&&Zs(a.node,a.offset,c.focusNode,c.focusOffset))return;let f=!1;if((u.extend||e==n)&&!(d&&$n)){u.collapse(l.node,l.offset);try{e!=n&&u.extend(a.node,a.offset),f=!0}catch{}}if(!f){if(e>n){let p=l;l=a,a=p}let h=document.createRange();h.setEnd(a.node,a.offset),h.setStart(l.node,l.offset),u.removeAllRanges(),u.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],o=r+s.size;if(r==o?e<=o&&n>=r:e<o&&n>r){let l=r+s.border,a=o-s.border;if(e>=l&&n<=a){this.dirty=e==r||n==o?As:IE,e==l&&n==a&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Tr:s.markDirty(e-l,n-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?As:Tr}r=o}this.dirty=As}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?As:IE;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class y2 extends Uu{constructor(e,n,r,i){let s,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(o.nodeType!=1){let l=document.createElement("span");l.appendChild(o),o=l}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==Un&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class DO extends Uu{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Xs extends Uu{constructor(e,n,r,i,s){super(e,[],r,i),this.mark=n,this.spec=s}static create(e,n,r,i){let s=i.nodeViews[n.type.name],o=s&&s(n,i,r);return(!o||!o.dom)&&(o=lo.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Xs(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Tr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Tr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Un){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Un}}slice(e,n,r){let i=Xs.create(this.parent,this.mark,!0,r),s=this.children,o=this.size;n<o&&(s=Cg(s,n,o,r)),e>0&&(s=Cg(s,0,e,r));for(let l=0;l<s.length;l++)s[l].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class ji extends Uu{constructor(e,n,r,i,s,o,l,a,u){super(e,[],s,o),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=l}static create(e,n,r,i,s,o){let l=s.nodeViews[n.type.name],a,u=l&&l(n,s,()=>{if(!a)return o;if(a.parent)return a.parent.posBeforeChild(a)},r,i),c=u&&u.dom,d=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:d}=lo.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let f=c;return c=_2(c,r,n),u?a=new RO(e,n,r,i,c,d||null,f,u,s,o+1):n.isText?new ph(e,n,r,i,c,f,s):new ji(e,n,r,i,c,d||null,f,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>R.empty)}return e}matchesNode(e,n,r){return this.dirty==Un&&e.eq(this.node)&&jd(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,o=s&&s.pos>-1?s:null,l=s&&s.pos<0,a=new LO(this,o&&o.node,e);BO(this.node,this.innerDeco,(u,c,d)=>{u.spec.marks?a.syncToMarks(u.spec.marks,r,e,c):u.type.side>=0&&!d&&a.syncToMarks(c==this.node.childCount?Ee.none:this.node.child(c).marks,r,e,c),a.placeWidget(u,e,i)},(u,c,d,f)=>{a.syncToMarks(u.marks,r,e,f);let h;a.findNodeMatch(u,c,d,f)||l&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(h=a.findIndexWithChild(s.node))>-1&&a.updateNodeAt(u,c,d,h,e)||a.updateNextNode(u,c,d,e,f,i)||a.addNode(u,c,d,e,i),i+=u.nodeSize}),a.syncToMarks([],r,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==As)&&(o&&this.protectLocalComposition(e,o),k2(this.contentDOM,this.children,e),al&&zO(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof X)||r<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,l=$O(this.node.content,o,r-n,i-n);return l<0?null:{node:s,pos:l,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new DO(this,s,n,i);e.input.compositionNodes.push(o),this.children=Cg(this.children,r,r+i.length,e,o)}update(e,n,r,i){return this.dirty==Tr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Un}updateOuterDeco(e){if(jd(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=w2(this.dom,this.nodeDOM,Sg(this.outerDeco,this.node,n),Sg(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function LE(t,e,n,r,i){_2(r,e,t);let s=new ji(void 0,t,e,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class ph extends ji{constructor(e,n,r,i,s,o,l){super(e,n,r,i,s,null,o,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==Tr||this.dirty!=Un&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Un||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Un,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new ph(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Tr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class E2 extends Uu{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Un&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class RO extends ji{constructor(e,n,r,i,s,o,l,a,u,c){super(e,n,r,i,s,o,l,u,c),this.spec=a}update(e,n,r,i){if(this.dirty==Tr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function k2(t,e,n){let r=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],l=o.dom;if(l.parentNode==t){for(;l!=r;)r=PE(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(l,r);if(o instanceof Xs){let a=r?r.previousSibling:t.lastChild;k2(o.contentDOM,o.children,n),r=a?a.nextSibling:t.firstChild}}for(;r;)r=PE(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const wa=function(t){t&&(this.nodeName=t)};wa.prototype=Object.create(null);const Ts=[new wa];function Sg(t,e,n){if(t.length==0)return Ts;let r=n?Ts[0]:new wa,i=[r];for(let s=0;s<t.length;s++){let o=t[s].type.attrs;if(o){o.nodeName&&i.push(r=new wa(o.nodeName));for(let l in o){let a=o[l];a!=null&&(n&&i.length==1&&i.push(r=new wa(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+a:l=="style"?r.style=(r.style?r.style+";":"")+a:l!="nodeName"&&(r[l]=a))}}}return i}function w2(t,e,n,r){if(n==Ts&&r==Ts)return e;let i=e;for(let s=0;s<r.length;s++){let o=r[s],l=n[s];if(s){let a;l&&l.nodeName==o.nodeName&&i!=t&&(a=i.parentNode)&&a.nodeName.toLowerCase()==o.nodeName||(a=document.createElement(o.nodeName),a.pmIsDeco=!0,a.appendChild(i),l=Ts[0]),i=a}IO(i,l||Ts[0],o)}return i}function IO(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function _2(t,e,n){return w2(t,t,Ts,Sg(e,n,t.nodeType!=1))}function jd(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function PE(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class LO{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=PO(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,i){let s=0,o=this.stack.length>>1,l=Math.min(o,e.length);for(;s<l&&(s==o-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<o;)this.destroyRest(),this.top.dirty=Un,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1,u=this.top.children.length;i<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let c=this.index;c<u;c++){let d=this.top.children[c];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){a=c;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let c=Xs.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))s=this.top.children.indexOf(o,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l<a;l++){let u=this.top.children[l];if(u.matchesNode(e,n,r)&&!this.preMatch.matched.has(u)){s=l;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,i,s){let o=this.top.children[i];return o.dirty==Tr&&o.dom==o.contentDOM&&(o.dirty=As),o.update(e,n,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,s,o){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof ji){let u=this.preMatch.matched.get(a);if(u!=null&&u!=s)return!1;let c=a.dom,d,f=this.isLocked(c)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=Tr&&jd(n,a.outerDeco));if(!f&&a.update(e,n,r,i))return this.destroyBetween(this.index,l),a.dom!=c&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(a,e,n,r,i,o)))return this.destroyBetween(this.index,l),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=As,d.updateChildren(i,o+1),d.dirty=Un),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,s,o){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!jd(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let l=ji.create(this.top,n,r,i,s,o);if(l.contentDOM){l.children=e.children,e.children=[];for(let a of l.children)a.parent=l}return e.destroy(),l}addNode(e,n,r,i,s){let o=ji.create(this.top,e,n,r,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new y2(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Xs;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof ph)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Lt||xt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new E2(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function PO(t,e){let n=e,r=n.children.length,i=t.childCount,s=new Map,o=[];e:for(;i>0;){let l;for(;;)if(r){let u=n.children[r-1];if(u instanceof Xs)n=u,r=u.children.length;else{l=u,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=t.child(i-1))break;--i,s.set(l,i),o.push(l)}}return{index:i,matched:s,matches:o.reverse()}}function FO(t,e){return t.type.side-e.type.side}function BO(t,e,n,r){let i=e.locals(t),s=0;if(i.length==0){for(let u=0;u<t.childCount;u++){let c=t.child(u);r(c,i,e.forChild(s,c),u),s+=c.nodeSize}return}let o=0,l=[],a=null;for(let u=0;;){let c,d;for(;o<i.length&&i[o].to==s;){let b=i[o++];b.widget&&(c?(d||(d=[c])).push(b):c=b)}if(c)if(d){d.sort(FO);for(let b=0;b<d.length;b++)n(d[b],u,!!a)}else n(c,u,!!a);let f,h;if(a)h=-1,f=a,a=null;else if(u<t.childCount)h=u,f=t.child(u++);else break;for(let b=0;b<l.length;b++)l[b].to<=s&&l.splice(b--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)l.push(i[o++]);let p=s+f.nodeSize;if(f.isText){let b=p;o<i.length&&i[o].from<b&&(b=i[o].from);for(let m=0;m<l.length;m++)l[m].to<b&&(b=l[m].to);b<p&&(a=f.cut(b-s),f=f.cut(0,b-s),p=b,h=-1)}else for(;o<i.length&&i[o].to<p;)o++;let g=f.isInline&&!f.isLeaf?l.filter(b=>!b.inline):l.slice();r(f,g,e.forChild(s,f),h),s=p}}function zO(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function $O(t,e,n,r){for(let i=0,s=0;i<t.childCount&&s<=r;){let o=t.child(i++),l=s;if(s+=o.nodeSize,!o.isText)continue;let a=o.text;for(;i<t.childCount;){let u=t.child(i++);if(s+=u.nodeSize,!u.isText)break;a+=u.text}if(s>=n){if(s>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let u=l<r?a.lastIndexOf(e,r-l-1):-1;if(u>=0&&u+e.length+l>=n)return l+u;if(n==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function Cg(t,e,n,r,i){let s=[];for(let o=0,l=0;o<t.length;o++){let a=t[o],u=l,c=l+=a.size;u>=n||c<=e?s.push(a):(u<e&&s.push(a.slice(0,e-u,r)),i&&(s.push(i),i=void 0),c>n&&s.push(a.slice(n-u,a.size,r)))}return s}function m1(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let l=r.resolve(o),a,u;if(hh(n)){for(a=o;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&J.isSelectable(d)&&i.parent&&!(d.isInline&&hO(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;u=new J(o==f?l:r.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=o,f=o;for(let h=0;h<n.rangeCount;h++){let p=n.getRangeAt(h);d=Math.min(d,t.docView.posFromDOM(p.startContainer,p.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(d<0)return null;[a,o]=f==t.state.selection.anchor?[f,d]:[d,f],l=r.resolve(o)}else a=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let c=r.resolve(a);if(!u){let d=e=="pointer"||t.state.selection.head<l.pos&&!s?1:-1;u=b1(t,c,l,d)}return u}function v2(t){return t.editable?t.hasFocus():S2(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Jr(t,e=!1){let n=t.state.selection;if(x2(t,n),!!v2(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&xt){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Zs(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)HO(t);else{let{anchor:r,head:i}=n,s,o;FE&&!(n instanceof X)&&(n.$from.parent.inlineContent||(s=BE(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=BE(t,n.to))),t.docView.setSelection(r,i,t,e),FE&&(s&&zE(s),o&&zE(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&UO(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const FE=Lt||xt&&c2<63;function BE(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Lt&&i&&i.contentEditable=="false")return Tp(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return Tp(i);if(s)return Tp(s)}}function Tp(t){return t.contentEditable="true",Lt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function zE(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function UO(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!v2(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function HO(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,_t(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&ln&&Ki<=11&&(n.disabled=!0,n.disabled=!1)}function x2(t,e){if(e instanceof J){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&($E(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else $E(t)}function $E(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function b1(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||X.between(e,n,r)}function UE(t){return t.editable&&!t.hasFocus()?!1:S2(t)}function S2(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function VO(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Zs(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Ag(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&ne.findFrom(s,e)}function mi(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function HE(t,e,n){let r=t.state.selection;if(r instanceof X)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return mi(t,new X(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Ag(t.state,e);return i&&i instanceof J?mi(t,i):!1}else if(!(In&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let l=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=t.docView.descAt(l))&&!o.contentDOM?J.isSelectable(s)?mi(t,new J(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):$u?mi(t,new X(t.state.doc.resolve(e<0?l:l+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof J&&r.node.isInline)return mi(t,new X(e>0?r.$to:r.$from));{let i=Ag(t.state,e);return i?mi(t,i):!1}}}function qd(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function _a(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function bo(t,e){return e<0?WO(t):KO(t)}function WO(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,s,o=!1;for($n&&n.nodeType==1&&r<qd(n)&&_a(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(_a(l,-1))i=n,s=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(C2(n))break;{let l=n.previousSibling;for(;l&&_a(l,-1);)i=n.parentNode,s=_t(l),l=l.previousSibling;if(l)n=l,r=qd(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?Tg(t,n,r):i&&Tg(t,i,s)}function KO(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=qd(n),s,o;for(;;)if(r<i){if(n.nodeType!=1)break;let l=n.childNodes[r];if(_a(l,1))s=n,o=++r;else break}else{if(C2(n))break;{let l=n.nextSibling;for(;l&&_a(l,1);)s=l.parentNode,o=_t(l)+1,l=l.nextSibling;if(l)n=l,r=0,i=qd(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}s&&Tg(t,s,o)}function C2(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function jO(t,e){for(;t&&e==t.childNodes.length&&!zu(t);)e=_t(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function qO(t,e){for(;t&&!e&&!zu(t);)e=_t(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Tg(t,e,n){if(e.nodeType!=3){let s,o;(o=jO(e,n))?(e=o,n=0):(s=qO(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(hh(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Jr(t)},50)}function VE(t,e){let n=t.state.doc.resolve(e);if(!(xt||d2)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function WE(t,e,n){let r=t.state.selection;if(r instanceof X&&!r.empty||n.indexOf("s")>-1||In&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=Ag(t.state,e);if(o&&o instanceof J)return mi(t,o)}if(!i.parent.inlineContent){let o=e<0?i:s,l=r instanceof on?ne.near(o,e):ne.findFrom(o,e);return l?mi(t,l):!1}return!1}function KE(t,e){if(!(t.state.selection instanceof X))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=t.state.tr;return e<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),t.dispatch(o),!0}return!1}function jE(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function GO(t){if(!Lt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;jE(t,r,"true"),setTimeout(()=>jE(t,r,"false"),20)}return!1}function YO(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function JO(t,e){let n=e.keyCode,r=YO(e);if(n==8||In&&n==72&&r=="c")return KE(t,-1)||bo(t,-1);if(n==46&&!e.shiftKey||In&&n==68&&r=="c")return KE(t,1)||bo(t,1);if(n==13||n==27)return!0;if(n==37||In&&n==66&&r=="c"){let i=n==37?VE(t,t.state.selection.from)=="ltr"?-1:1:-1;return HE(t,i,r)||bo(t,i)}else if(n==39||In&&n==70&&r=="c"){let i=n==39?VE(t,t.state.selection.from)=="ltr"?1:-1:1;return HE(t,i,r)||bo(t,i)}else{if(n==38||In&&n==80&&r=="c")return WE(t,-1,r)||bo(t,-1);if(n==40||In&&n==78&&r=="c")return GO(t)||WE(t,1,r)||bo(t,1);if(r==(In?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function y1(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let o=t.someProp("clipboardSerializer")||lo.fromSchema(t.state.schema),l=O2(),a=l.createElement("div");a.appendChild(o.serializeFragment(r,{document:l}));let u=a.firstChild,c,d=0;for(;u&&u.nodeType==1&&(c=M2[u.nodeName.toLowerCase()]);){for(let h=c.length-1;h>=0;h--){let p=l.createElement(c[h]);for(;a.firstChild;)p.appendChild(a.firstChild);a.appendChild(p),d++}u=a.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
|
|
30
|
+
|
|
31
|
+
`);return{dom:a,text:f,slice:e}}function E1(t,e,n,r,i){let s=i.parent.type.spec.code,o,l;if(!n&&!e)return null;let a=!!e&&(r||s||!n);if(a){if(t.someProp("transformPastedText",f=>{e=f(e,s||r,t)}),s)return l=new $(R.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
32
|
+
`))),0,0),t.someProp("transformPasted",f=>{l=f(l,t,!0)}),l;let d=t.someProp("clipboardTextParser",f=>f(e,i,r,t));if(d)l=d;else{let f=i.marks(),{schema:h}=t.state,p=lo.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let b=o.appendChild(document.createElement("p"));g&&b.appendChild(p.serializeNode(h.text(g,f)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),o=eD(n),$u&&tD(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let f=o.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;o=f}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Ea.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||c),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!ZO.test(f.parentNode.nodeName)?{ignore:!0}:null}})),c)l=nD(qE(l,+c[1],+c[2]),c[4]);else if(l=$.maxOpen(XO(l.content,i),!0),l.openStart||l.openEnd){let d=0,f=0;for(let h=l.content.firstChild;d<l.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=l.content.lastChild;f<l.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);l=qE(l,d,f)}return t.someProp("transformPasted",d=>{l=d(l,t,a)}),l}const ZO=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function XO(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),s,o=[];if(t.forEach(l=>{if(!o)return;let a=i.findWrapping(l.type),u;if(!a)return o=null;if(u=o.length&&s.length&&T2(a,s,l,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=N2(o[o.length-1],s.length));let c=A2(l,a);o.push(c),i=i.matchType(c.type),s=a}}),o)return R.from(o)}return t}function A2(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,R.from(t));return t}function T2(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=T2(t,e,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(R.from(A2(n,t,i+1))))}}function N2(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,N2(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(R.empty,!0);return t.copy(n.append(r))}function Ng(t,e,n,r,i,s){let o=e<0?t.firstChild:t.lastChild,l=o.content;return t.childCount>1&&(s=0),i<r-1&&(l=Ng(l,e,n,r,i+1,s)),i>=n&&(l=e<0?o.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(R.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(l))}function qE(t,e,n){return e<t.openStart&&(t=new $(Ng(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new $(Ng(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const M2={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let GE=null;function O2(){return GE||(GE=document.implementation.createHTMLDocument("title"))}let Np=null;function QO(t){let e=window.trustedTypes;return e?(Np||(Np=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Np.createHTML(t)):t}function eD(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=O2().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&M2[r[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=QO(t),i)for(let s=0;s<i.length;s++)n=n.querySelector(i[s])||n;return n}function tD(t){let e=t.querySelectorAll(xt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function nD(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:s,openEnd:o}=t;for(let l=r.length-2;l>=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;i=R.from(a.create(r[l+1],i)),s++,o++}return new $(i,s,o)}const jt={},qt={},rD={touchstart:!0,touchmove:!0};class iD{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function sD(t){for(let e in jt){let n=jt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{lD(t,r)&&!k1(t,r)&&(t.editable||!(r.type in qt))&&n(t,r)},rD[e]?{passive:!0}:void 0)}Lt&&t.dom.addEventListener("input",()=>null),Mg(t)}function Oi(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function oD(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Mg(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>k1(t,r))})}function k1(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function lD(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function aD(t,e){!k1(t,e)&&jt[e.type]&&(t.editable||!(e.type in qt))&&jt[e.type](t,e)}qt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!R2(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(jr&&xt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),al&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,ws(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||JO(t,n)?n.preventDefault():Oi(t,"key")};qt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};qt.keypress=(t,e)=>{let n=e;if(R2(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||In&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof X)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i,s))&&t.dispatch(s()),n.preventDefault()}};function gh(t){return{left:t.clientX,top:t.clientY}}function uD(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function w1(t,e,n,r,i){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(t.someProp(e,l=>o>s.depth?l(t,n,s.nodeAfter,s.before(o),i,!0):l(t,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function Yo(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function cD(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&J.isSelectable(r)?(Yo(t,new J(n)),!0):!1}function dD(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof J&&(r=n.node);let s=t.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let l=o>s.depth?s.nodeAfter:s.node(o);if(J.isSelectable(l)){r&&n.$from.depth>0&&o>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(o);break}}return i!=null?(Yo(t,J.create(t.state.doc,i)),!0):!1}function fD(t,e,n,r,i){return w1(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(i?dD(t,n):cD(t,n))}function hD(t,e,n,r){return w1(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function pD(t,e,n,r){return w1(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||gD(t,n,r)}function gD(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Yo(t,X.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),l=i.before(s);if(o.inlineContent)Yo(t,X.create(r,l+1,l+1+o.content.size));else if(J.isSelectable(o))Yo(t,J.create(r,l));else continue;return!0}}function _1(t){return eu(t)}const D2=In?"metaKey":"ctrlKey";jt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=_1(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&uD(n,t.input.lastClick)&&!n[D2]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button};let o=t.posAtCoords(gh(n));o&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new mD(t,o,n,!!r)):(s=="doubleClick"?hD:pD)(t,o.pos,o.inside,n)?n.preventDefault():Oi(t,"pointer"))};class mD{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[D2],this.allowDefault=r.shiftKey;let s,o;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),o=n.inside;else{let c=e.state.doc.resolve(n.pos);s=c.parent,o=c.depth?c.before():0}const l=i?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:u}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof J&&u.from<=o&&u.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&$n&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Oi(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Jr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(gh(e))),this.updateAllowDefault(e),this.allowDefault||!n?Oi(this.view,"pointer"):fD(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Lt&&this.mightDrag&&!this.mightDrag.node.isAtom||xt&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Yo(this.view,ne.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Oi(this.view,"pointer")}move(e){this.updateAllowDefault(e),Oi(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}jt.touchstart=t=>{t.input.lastTouch=Date.now(),_1(t),Oi(t,"pointer")};jt.touchmove=t=>{t.input.lastTouch=Date.now(),Oi(t,"pointer")};jt.contextmenu=t=>_1(t);function R2(t,e){return t.composing?!0:Lt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const bD=jr?5e3:-1;qt.compositionstart=qt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof X&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||xt&&d2&&yD(t)))t.markCursor=t.state.storedMarks||n.marks(),eu(t,!0),t.markCursor=null;else if(eu(t,!e.selection.empty),$n&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let l=t.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}t.input.composing=!0}I2(t,bD)};function yD(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}qt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,I2(t,20))};function I2(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>eu(t),e))}function L2(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=kD());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function ED(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=dO(e.focusNode,e.focusOffset),r=fO(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function kD(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function eu(t,e=!1){if(!(jr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),L2(t),e||t.docView&&t.docView.dirty){let n=m1(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function wD(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const tu=ln&&Ki<15||al&&mO<604;jt.copy=qt.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let s=tu?null:n.clipboardData,o=r.content(),{dom:l,text:a}=y1(t,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",a)):wD(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function _D(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function vD(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?nu(t,r.value,null,i,e):nu(t,r.textContent,r.innerHTML,i,e)},50)}function nu(t,e,n,r,i){let s=E1(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",a=>a(t,i,s||$.empty)))return!0;if(!s)return!1;let o=_D(s),l=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(s);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function P2(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}qt.paste=(t,e)=>{let n=e;if(t.composing&&!jr)return;let r=tu?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&nu(t,P2(r),r.getData("text/html"),i,n)?n.preventDefault():vD(t,n)};class F2{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const xD=In?"altKey":"ctrlKey";function B2(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[xD]}jt.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(gh(n)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof J?i.to-1:i.to))){if(r&&r.mightDrag)o=J.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(o=J.create(t.state.doc,d.posBefore))}}let l=(o||t.state.selection).content(),{dom:a,text:u,slice:c}=y1(t,l);(!n.dataTransfer.files.length||!xt||c2>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(tu?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",tu||n.dataTransfer.setData("text/plain",u),t.dragging=new F2(c,B2(t,n),o)};jt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};qt.dragover=qt.dragenter=(t,e)=>e.preventDefault();qt.drop=(t,e)=>{try{SD(t,e,t.dragging)}finally{t.dragging=null}};function SD(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(gh(e));if(!r)return;let i=t.state.doc.resolve(r.pos),s=n&&n.slice;s?t.someProp("transformPasted",h=>{s=h(s,t,!1)}):s=E1(t,P2(e.dataTransfer),tu?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(n&&B2(t,e));if(t.someProp("handleDrop",h=>h(t,e,s||$.empty,o))){e.preventDefault();return}if(!s)return;e.preventDefault();let l=s?t2(t.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let a=t.state.tr;if(o){let{node:h}=n;h?h.replace(a):a.deleteSelection()}let u=a.mapping.map(l),c=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=a.doc;if(c?a.replaceRangeWith(u,u,s.content.firstChild):a.replaceRange(u,u,s),a.doc.eq(d))return;let f=a.doc.resolve(u);if(c&&J.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))a.setSelection(new J(f));else{let h=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((p,g,b,m)=>h=m),a.setSelection(b1(t,f,a.doc.resolve(h)))}t.focus(),t.dispatch(a.setMeta("uiEvent","drop"))}jt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Jr(t)},20))};jt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};jt.beforeinput=(t,e)=>{if(xt&&jr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,ws(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in qt)jt[t]=qt[t];function ru(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Gd{constructor(e,n){this.toDOM=e,this.spec=n||Is,this.side=this.spec.side||0}map(e,n,r,i){let{pos:s,deleted:o}=e.mapResult(n.from+i,this.side<0?-1:1);return o?null:new ot(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Gd&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ru(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class qi{constructor(e,n){this.attrs=e,this.spec=n||Is}map(e,n,r,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new ot(s,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof qi&&ru(this.attrs,e.attrs)&&ru(this.spec,e.spec)}static is(e){return e.type instanceof qi}destroy(){}}class v1{constructor(e,n){this.attrs=e,this.spec=n||Is}map(e,n,r,i){let s=e.mapResult(n.from+i,1);if(s.deleted)return null;let o=e.mapResult(n.to+i,-1);return o.deleted||o.pos<=s.pos?null:new ot(s.pos-r,o.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),s;return i==n.from&&!(s=e.child(r)).isText&&i+s.nodeSize==n.to}eq(e){return this==e||e instanceof v1&&ru(this.attrs,e.attrs)&&ru(this.spec,e.spec)}destroy(){}}class ot{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new ot(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new ot(e,e,new Gd(n,r))}static inline(e,n,r,i){return new ot(e,n,new qi(r,i))}static node(e,n,r,i){return new ot(e,n,new v1(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof qi}get widget(){return this.type instanceof Gd}}const vo=[],Is={};class Te{constructor(e,n){this.local=e.length?e:vo,this.children=n.length?n:vo}static create(e,n){return n.length?Yd(n,e,0,Is):Ot}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,s){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=n&&l.to>=e&&(!s||s(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>e){let l=this.children[o]+1;this.children[o+2].findInner(e-l,n-l,r,i+l,s)}}map(e,n,r){return this==Ot||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Is)}mapInner(e,n,r,i,s){let o;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,r,i);a&&a.type.valid(n,a)?(o||(o=[])).push(a):s.onRemove&&s.onRemove(this.local[l].spec)}return this.children.length?CD(this.children,o||[],e,n,r,i,s):o?new Te(o.sort(Ls),vo):Ot}add(e,n){return n.length?this==Ot?Te.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,s=0;e.forEach((l,a)=>{let u=a+r,c;if(c=$2(n,l,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<a;)s+=3;i[s]==a?i[s+2]=i[s+2].addInner(l,c,u+1):i.splice(s,0,a,a+l.nodeSize,Yd(c,l,u+1,Is)),s+=3}});let o=z2(s?U2(n):n,-r);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||o.splice(l--,1);return new Te(o.length?this.local.concat(o).sort(Ls):this.local,i||this.children)}remove(e){return e.length==0||this==Ot?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let o,l=r[s]+n,a=r[s+1]+n;for(let c=0,d;c<e.length;c++)(d=e[c])&&d.from>l&&d.to<a&&(e[c]=null,(o||(o=[])).push(d));if(!o)continue;r==this.children&&(r=this.children.slice());let u=r[s+2].removeInner(o,l+1);u!=Ot?r[s+2]=u:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let l=0;l<i.length;l++)i[l].eq(o,n)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Te(i,r):Ot}forChild(e,n){if(this==Ot)return this;if(n.isLeaf)return Te.empty;let r,i;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let s=e+1,o=s+n.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<o&&a.to>s&&a.type instanceof qi){let u=Math.max(s,a.from)-s,c=Math.min(o,a.to)-s;u<c&&(i||(i=[])).push(a.copy(u,c))}}if(i){let l=new Te(i.sort(Ls),vo);return r?new _i([l,r]):l}return r||Ot}eq(e){if(this==e)return!0;if(!(e instanceof Te)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return x1(this.localsInner(e))}localsInner(e){if(this==Ot)return vo;if(e.inlineContent||!this.local.some(qi.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof qi||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Te.empty=new Te([],[]);Te.removeOverlap=x1;const Ot=Te.empty;class _i{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Is));return _i.from(r)}forChild(e,n){if(n.isLeaf)return Te.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=Ot&&(s instanceof _i?r=r.concat(s.members):r.push(s))}return _i.from(r)}eq(e){if(!(e instanceof _i)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let o=0;o<s.length;o++)n.push(s[o])}}return n?x1(r?n:n.sort(Ls)):vo}static from(e){switch(e.length){case 0:return Ot;case 1:return e[0];default:return new _i(e.every(n=>n instanceof Te)?e:e.reduce((n,r)=>n.concat(r instanceof Te?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function CD(t,e,n,r,i,s,o){let l=t.slice();for(let u=0,c=s;u<n.maps.length;u++){let d=0;n.maps[u].forEach((f,h,p,g)=>{let b=g-p-(h-f);for(let m=0;m<l.length;m+=3){let E=l[m+1];if(E<0||f>E+c-d)continue;let k=l[m]+c-d;h>=k?l[m+1]=f<=k?-2:-1:f>=c&&b&&(l[m]+=b,l[m+1]+=b)}d+=b}),c=n.maps[u].map(c,-1)}let a=!1;for(let u=0;u<l.length;u+=3)if(l[u+1]<0){if(l[u+1]==-2){a=!0,l[u+1]=-1;continue}let c=n.map(t[u]+s),d=c-i;if(d<0||d>=r.content.size){a=!0;continue}let f=n.map(t[u+1]+s,-1),h=f-i,{index:p,offset:g}=r.content.findIndex(d),b=r.maybeChild(p);if(b&&g==d&&g+b.nodeSize==h){let m=l[u+2].mapInner(n,b,c+1,t[u]+s+1,o);m!=Ot?(l[u]=d,l[u+1]=h,l[u+2]=m):(l[u+1]=-2,a=!0)}else a=!0}if(a){let u=AD(l,t,e,n,i,s,o),c=Yd(u,r,0,o);e=c.local;for(let d=0;d<l.length;d+=3)l[d+1]<0&&(l.splice(d,3),d-=3);for(let d=0,f=0;d<c.children.length;d+=3){let h=c.children[d];for(;f<l.length&&l[f]<h;)f+=3;l.splice(f,0,c.children[d],c.children[d+1],c.children[d+2])}}return new Te(e.sort(Ls),l)}function z2(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new ot(i.from+e,i.to+e,i.type))}return n}function AD(t,e,n,r,i,s,o){function l(a,u){for(let c=0;c<a.local.length;c++){let d=a.local[c].map(r,i,u);d?n.push(d):o.onRemove&&o.onRemove(a.local[c].spec)}for(let c=0;c<a.children.length;c+=3)l(a.children[c+2],a.children[c]+u+1)}for(let a=0;a<t.length;a+=3)t[a+1]==-1&&l(t[a+2],e[a]+s+1);return n}function $2(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let s=0,o;s<t.length;s++)(o=t[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),t[s]=null);return i}function U2(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Yd(t,e,n,r){let i=[],s=!1;e.forEach((l,a)=>{let u=$2(t,l,a+n);if(u){s=!0;let c=Yd(u,l,n+a+1,r);c!=Ot&&i.push(a,a+l.nodeSize,c)}});let o=z2(s?U2(t):t,-n).sort(Ls);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||(r.onRemove&&r.onRemove(o[l].spec),o.splice(l--,1));return o.length||i.length?new Te(o,i):Ot}function Ls(t,e){return t.from-e.from||t.to-e.to}function x1(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,r.to),YE(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),YE(e,i,r.copy(s.from,r.to)));break}}}return e}function YE(t,e,n){for(;e<t.length&&Ls(n,t[e])>0;)e++;t.splice(e,0,n)}function Mp(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Ot&&e.push(r)}),t.cursorWrapper&&e.push(Te.create(t.state.doc,[t.cursorWrapper.deco])),_i.from(e)}const TD={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ND=ln&&Ki<=11;class MD{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class OD{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new MD,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);ln&&Ki<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():Lt&&e.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),ND&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,TD)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(UE(this.view)){if(this.suppressingSelectionUpdates)return Jr(this.view);if(ln&&Ki<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Zs(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=ll(s))n.add(s);for(let s=e.anchorNode;s;s=ll(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&UE(e)&&!this.ignoreSelectionChange(r),s=-1,o=-1,l=!1,a=[];if(e.editable)for(let c=0;c<n.length;c++){let d=this.registerMutation(n[c],a);d&&(s=s<0?d.from:Math.min(d.from,s),o=o<0?d.to:Math.max(d.to,o),d.typeOver&&(l=!0))}if(a.some(c=>c.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let c of a)if(c.nodeName=="BR"&&c.parentNode){let d=c.nextSibling;d&&d.nodeType==1&&d.contentEditable=="false"&&c.parentNode.removeChild(c)}}else if($n&&a.length){let c=a.filter(d=>d.nodeName=="BR");if(c.length==2){let[d,f]=c;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of c){let h=f.parentNode;h&&h.nodeName=="LI"&&(!d||ID(e,d)!=h)&&f.remove()}}}let u=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&hh(r)&&(u=m1(e))&&u.eq(ne.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Jr(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),DD(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,LD(e,a)),this.handleDOMChange(s,o,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Jr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;c<e.addedNodes.length;c++){let d=e.addedNodes[c];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,s=e.nextSibling;if(ln&&Ki<=11&&e.addedNodes.length)for(let c=0;c<e.addedNodes.length;c++){let{previousSibling:d,nextSibling:f}=e.addedNodes[c];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(i=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(s=f)}let o=i&&i.parentNode==e.target?_t(i)+1:0,l=r.localPosFromDOM(e.target,o,-1),a=s&&s.parentNode==e.target?_t(s):e.target.childNodes.length,u=r.localPosFromDOM(e.target,a,1);return{from:l,to:u}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let JE=new WeakMap,ZE=!1;function DD(t){if(!JE.has(t)&&(JE.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=$n,ZE)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),ZE=!0}}function XE(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return Zs(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function RD(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return XE(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?XE(t,n):null}function ID(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function LD(t,e){var n;let{focusNode:r,focusOffset:i}=t.domSelectionRange();for(let s of e)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let o=s.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let l=o;for(;;){let a=l.firstChild;if(!a||a.nodeType!=1||a.contentEditable=="false"||/^(BR|IMG)$/.test(a.nodeName))break;l=a}l.insertBefore(s,l.firstChild),r==s&&t.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function PD(t,e,n){let{node:r,fromOffset:i,toOffset:s,from:o,to:l}=t.docView.parseRange(e,n),a=t.domSelectionRange(),u,c=a.anchorNode;if(c&&t.dom.contains(c.nodeType==1?c:c.parentNode)&&(u=[{node:c,offset:a.anchorOffset}],hh(a)||u.push({node:a.focusNode,offset:a.focusOffset})),xt&&t.input.lastKeyCode===8)for(let b=s;b>i;b--){let m=r.childNodes[b-1],E=m.pmViewDesc;if(m.nodeName=="BR"&&!E){s=b;break}if(!E||E.size)break}let d=t.state.doc,f=t.someProp("domParser")||Ea.fromSchema(t.state.schema),h=d.resolve(o),p=null,g=f.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:s,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:FD,context:h});if(u&&u[0].pos!=null){let b=u[0].pos,m=u[1]&&u[1].pos;m==null&&(m=b),p={anchor:b+o,head:m+o}}return{doc:g,sel:p,from:o,to:l}}function FD(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Lt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Lt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const BD=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function zD(t,e,n,r,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let x=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,S=m1(t,x);if(S&&!t.state.selection.eq(S)){if(xt&&jr&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",L=>L(t,ws(13,"Enter"))))return;let O=t.state.tr.setSelection(S);x=="pointer"?O.setMeta("pointer",!0):x=="key"&&O.scrollIntoView(),s&&O.setMeta("composition",s),t.dispatch(O)}return}let o=t.state.doc.resolve(e),l=o.sharedDepth(n);e=o.before(l+1),n=t.state.doc.resolve(n).after(l+1);let a=t.state.selection,u=PD(t,e,n),c=t.state.doc,d=c.slice(u.from,u.to),f,h;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,h="end"):(f=t.state.selection.from,h="start"),t.input.lastKeyCode=null;let p=HD(d.content,u.doc.content,u.from,f,h);if(p&&t.input.domChangeCount++,(al&&t.input.lastIOSEnter>Date.now()-225||jr)&&i.some(x=>x.nodeType==1&&!BD.test(x.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",x=>x(t,ws(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(r&&a instanceof X&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))p={start:a.from,endA:a.to,endB:a.to};else{if(u.sel){let x=QE(t,t.state.doc,u.sel);if(x&&!x.eq(t.state.selection)){let S=t.state.tr.setSelection(x);s&&S.setMeta("composition",s),t.dispatch(S)}}return}t.state.selection.from<t.state.selection.to&&p.start==p.endB&&t.state.selection instanceof X&&(p.start>t.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?p.start=t.state.selection.from:p.endA<t.state.selection.to&&p.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),ln&&Ki<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>u.from&&u.doc.textBetween(p.start-u.from-1,p.start-u.from+1)==" "&&(p.start--,p.endA--,p.endB--);let g=u.doc.resolveNoCache(p.start-u.from),b=u.doc.resolveNoCache(p.endB-u.from),m=c.resolve(p.start),E=g.sameParent(b)&&g.parent.inlineContent&&m.end()>=p.endA;if((al&&t.input.lastIOSEnter>Date.now()-225&&(!E||i.some(x=>x.nodeName=="DIV"||x.nodeName=="P"))||!E&&g.pos<u.doc.content.size&&(!g.sameParent(b)||!g.parent.inlineContent)&&g.pos<b.pos&&!/\S/.test(u.doc.textBetween(g.pos,b.pos,"","")))&&t.someProp("handleKeyDown",x=>x(t,ws(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&UD(c,p.start,p.endA,g,b)&&t.someProp("handleKeyDown",x=>x(t,ws(8,"Backspace")))){jr&&xt&&t.domObserver.suppressSelectionUpdates();return}xt&&p.endB==p.start&&(t.input.lastChromeDelete=Date.now()),jr&&!E&&g.start()!=b.start()&&b.parentOffset==0&&g.depth==b.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==p.endA&&(p.endB-=2,b=u.doc.resolveNoCache(p.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(x){return x(t,ws(13,"Enter"))})},20));let k=p.start,y=p.endA,_=x=>{let S=x||t.state.tr.replace(k,y,u.doc.slice(p.start-u.from,p.endB-u.from));if(u.sel){let O=QE(t,S.doc,u.sel);O&&!(xt&&t.composing&&O.empty&&(p.start!=p.endB||t.input.lastChromeDelete<Date.now()-100)&&(O.head==k||O.head==S.mapping.map(y)-1)||ln&&O.empty&&O.head==k)&&S.setSelection(O)}return s&&S.setMeta("composition",s),S.scrollIntoView()},w;if(E)if(g.pos==b.pos){ln&&Ki<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Jr(t),20));let x=_(t.state.tr.delete(k,y)),S=c.resolve(p.start).marksAcross(c.resolve(p.endA));S&&x.ensureMarks(S),t.dispatch(x)}else if(p.endA==p.endB&&(w=$D(g.parent.content.cut(g.parentOffset,b.parentOffset),m.parent.content.cut(m.parentOffset,p.endA-m.start())))){let x=_(t.state.tr);w.type=="add"?x.addMark(k,y,w.mark):x.removeMark(k,y,w.mark),t.dispatch(x)}else if(g.parent.child(g.index()).isText&&g.index()==b.index()-(b.textOffset?0:1)){let x=g.parent.textBetween(g.parentOffset,b.parentOffset),S=()=>_(t.state.tr.insertText(x,k,y));t.someProp("handleTextInput",O=>O(t,k,y,x,S))||t.dispatch(S())}else t.dispatch(_());else t.dispatch(_())}function QE(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:b1(t,e.resolve(n.anchor),e.resolve(n.head))}function $D(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,s=r,o,l,a;for(let c=0;c<r.length;c++)i=r[c].removeFromSet(i);for(let c=0;c<n.length;c++)s=n[c].removeFromSet(s);if(i.length==1&&s.length==0)l=i[0],o="add",a=c=>c.mark(l.addToSet(c.marks));else if(i.length==0&&s.length==1)l=s[0],o="remove",a=c=>c.mark(l.removeFromSet(c.marks));else return null;let u=[];for(let c=0;c<e.childCount;c++)u.push(a(e.child(c)));if(R.from(u).eq(t))return{mark:l,type:o}}function UD(t,e,n,r,i){if(n-e<=i.pos-r.pos||Op(r,!0,!1)<i.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let l=s.nodeAfter;return l!=null&&n==e+l.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=t.resolve(Op(s,!0,!0));return!o.parent.isTextblock||o.pos>n||Op(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Op(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function HD(t,e,n,r,i){let s=t.findDiffStart(e,n);if(s==null)return null;let{a:o,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let a=Math.max(0,s-Math.min(o,l));r-=o+a-s}if(o<s&&t.size<e.size){let a=r<=s&&r>=o?s-r:0;s-=a,s&&s<e.size&&ek(e.textBetween(s-1,s+1))&&(s+=a?1:-1),l=s+(l-o),o=s}else if(l<s){let a=r<=s&&r>=l?s-r:0;s-=a,s&&s<t.size&&ek(t.textBetween(s-1,s+1))&&(s+=a?1:-1),o=s+(o-l),l=s}return{start:s,endA:o,endB:l}}function ek(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}const VD=E1,WD=eu;class S1{constructor(e,n){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 iD,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(sk),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=rk(this),nk(this),this.nodeViews=ik(this),this.docView=LE(this.state.doc,tk(this),Mp(this),this.dom,this),this.domObserver=new OD(this,(r,i,s,o)=>zD(this,r,i,s,o)),this.domObserver.start(),sD(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Mg(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(sk),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(L2(this),o=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=ik(this);jD(h,this.nodeViews)&&(this.nodeViews=h,s=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&Mg(this),this.editable=rk(this),nk(this);let a=Mp(this),u=tk(this),c=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=s||!this.docView.matchesNode(e.doc,u,a);(d||!e.selection.eq(i.selection))&&(o=!0);let f=c=="preserve"&&o&&this.dom.style.overflowAnchor==null&&EO(this);if(o){this.domObserver.stop();let h=d&&(ln||xt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&KD(i.selection,e.selection);if(d){let p=xt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=ED(this)),(s||!this.docView.update(e.doc,u,a,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=LE(e.doc,u,a,this.dom,this)),p&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&VO(this))?Jr(this,h):(x2(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():f&&kO(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof J){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&NE(this,n.getBoundingClientRect(),e)}else NE(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new F2(e.slice,e.move,i<0?void 0:J.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let l=this.directPlugins[o].props[e];if(l!=null&&(i=n?n(l):l))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let l=s[o].props[e];if(l!=null&&(i=n?n(l):l))return i}}hasFocus(){if(ln){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&wO(this.dom),Jr(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return CO(this,e)}coordsAtPos(e,n=1){return m2(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return OO(this,n||this.state,e)}pasteHTML(e,n){return nu(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return nu(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return y1(this,e)}destroy(){this.docView&&(oD(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Mp(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,uO())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return aD(this,e)}domSelectionRange(){let e=this.domSelection();return e?Lt&&this.root.nodeType===11&&pO(this.dom.ownerDocument)==this.dom&&RD(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}S1.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function tk(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[ot.node(0,t.state.doc.content.size,e)]}function nk(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:ot.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function rk(t){return!t.someProp("editable",e=>e(t.state)===!1)}function KD(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function ik(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function jD(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function sk(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}const XV=Object.freeze(Object.defineProperty({__proto__:null,Decoration:ot,DecorationSet:Te,EditorView:S1,__endComposition:WD,__parseFromClipboard:VD},Symbol.toStringTag,{value:"Module"}));var Xi={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:"'"},Jd={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},qD=typeof navigator<"u"&&/Mac/.test(navigator.platform),GD=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var vt=0;vt<10;vt++)Xi[48+vt]=Xi[96+vt]=String(vt);for(var vt=1;vt<=24;vt++)Xi[vt+111]="F"+vt;for(var vt=65;vt<=90;vt++)Xi[vt]=String.fromCharCode(vt+32),Jd[vt]=String.fromCharCode(vt);for(var Dp in Xi)Jd.hasOwnProperty(Dp)||(Jd[Dp]=Xi[Dp]);function YD(t){var e=qD&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||GD&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Jd:Xi)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const JD=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),ZD=typeof navigator<"u"&&/Win/.test(navigator.platform);function XD(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,s,o;for(let l=0;l<e.length-1;l++){let a=e[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else if(/^s(hift)?$/i.test(a))s=!0;else if(/^mod$/i.test(a))JD?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),o&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function QD(t){let e=Object.create(null);for(let n in t)e[XD(n)]=t[n];return e}function Rp(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function e6(t){return new Ae({props:{handleKeyDown:C1(t)}})}function C1(t){let e=QD(t);return function(n,r){let i=YD(r),s,o=e[Rp(i,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=e[Rp(i,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(ZD&&r.ctrlKey&&r.altKey)&&(s=Xi[r.keyCode])&&s!=i){let l=e[Rp(s,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const A1=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function H2(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const V2=(t,e,n)=>{let r=H2(t,n);if(!r)return!1;let i=T1(r);if(!i){let o=r.blockRange(),l=o&&Ml(o);return l==null?!1:(e&&e(t.tr.lift(o,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(X2(t,i,e,-1))return!0;if(r.parent.content.size==0&&(ul(s,"end")||J.isSelectable(s)))for(let o=r.depth;;o--){let l=dh(t.doc,r.before(o),r.after(o),$.empty);if(l&&l.slice.size<l.to-l.from){if(e){let a=t.tr.step(l);a.setSelection(ul(s,"end")?ne.findFrom(a.doc.resolve(a.mapping.map(i.pos,-1)),-1):J.create(a.doc,i.pos-s.nodeSize)),e(a.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},t6=(t,e,n)=>{let r=H2(t,n);if(!r)return!1;let i=T1(r);return i?W2(t,i,e):!1},n6=(t,e,n)=>{let r=j2(t,n);if(!r)return!1;let i=N1(r);return i?W2(t,i,e):!1};function W2(t,e,n){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let o=e.nodeAfter,l=o,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let c=l.firstChild;if(!c)return!1;l=c}let u=dh(t.doc,s,a,$.empty);if(!u||u.from!=s||u instanceof ft&&u.slice.size>=a-s)return!1;if(n){let c=t.tr.step(u);c.setSelection(X.create(c.doc,s)),n(c.scrollIntoView())}return!0}function ul(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const K2=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=T1(r)}let o=s&&s.nodeBefore;return!o||!J.isSelectable(o)?!1:(e&&e(t.tr.setSelection(J.create(t.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function T1(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function j2(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const q2=(t,e,n)=>{let r=j2(t,n);if(!r)return!1;let i=N1(r);if(!i)return!1;let s=i.nodeAfter;if(X2(t,i,e,1))return!0;if(r.parent.content.size==0&&(ul(s,"start")||J.isSelectable(s))){let o=dh(t.doc,r.before(),r.after(),$.empty);if(o&&o.slice.size<o.to-o.from){if(e){let l=t.tr.step(o);l.setSelection(ul(s,"start")?ne.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):J.create(l.doc,l.mapping.map(i.pos))),e(l.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},G2=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=N1(r)}let o=s&&s.nodeAfter;return!o||!J.isSelectable(o)?!1:(e&&e(t.tr.setSelection(J.create(t.doc,s.pos)).scrollIntoView()),!0)};function N1(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const r6=(t,e)=>{let n=t.selection,r=n instanceof J,i;if(r){if(n.node.isTextblock||!us(t.doc,n.from))return!1;i=n.from}else if(i=ch(t.doc,n.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);r&&s.setSelection(J.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},i6=(t,e)=>{let n=t.selection,r;if(n instanceof J){if(n.node.isTextblock||!us(t.doc,n.to))return!1;r=n.to}else if(r=ch(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},s6=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&Ml(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},Y2=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
33
|
+
`).scrollIntoView()),!0)};function M1(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const o6=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),o=M1(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,o.createAndFill());a.setSelection(ne.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},J2=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof on||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=M1(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=t.tr.insert(o,s.createAndFill());l.setSelection(X.create(l.doc,o+1)),e(l.scrollIntoView())}return!0},Z2=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(Yr(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Ml(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function l6(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof J&&e.selection.node.isBlock)return!r.parentOffset||!Yr(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],o,l,a=!1,u=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){a=r.end(h)==r.pos+(r.depth-h),u=r.start(h)==r.pos-(r.depth-h),l=M1(r.node(h-1).contentMatchAt(r.indexAfter(h-1))),s.unshift(a&&l?{type:l}:null),o=h;break}else{if(h==1)return!1;s.unshift(null)}let c=e.tr;(e.selection instanceof X||e.selection instanceof on)&&c.deleteSelection();let d=c.mapping.map(r.pos),f=Yr(c.doc,d,s.length,s);if(f||(s[0]=l?{type:l}:null,f=Yr(c.doc,d,s.length,s)),!f)return!1;if(c.split(d,s.length,s),!a&&u&&r.node(o).type!=l){let h=c.mapping.map(r.before(o)),p=c.doc.resolve(h);l&&r.node(o-1).canReplaceWith(p.index(),p.index()+1,l)&&c.setNodeMarkup(c.mapping.map(r.before(o)),l)}return n&&n(c.scrollIntoView()),!0}}const a6=l6(),u6=(t,e)=>{let{$from:n,to:r}=t.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),e&&e(t.tr.setSelection(J.create(t.doc,i))),!0)};function c6(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||us(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function X2(t,e,n,r){let i=e.nodeBefore,s=e.nodeAfter,o,l,a=i.type.spec.isolating||s.type.spec.isolating;if(!a&&c6(t,e,n))return!0;let u=!a&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(l=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&l.matchType(o[0]||s.type).validEnd){if(n){let h=e.pos+s.nodeSize,p=R.empty;for(let m=o.length-1;m>=0;m--)p=R.from(o[m].create(null,p));p=R.from(i.copy(p));let g=t.tr.step(new gt(e.pos-1,h,e.pos,h,new $(p,1,0),o.length,!0)),b=g.doc.resolve(h+2*o.length);b.nodeAfter&&b.nodeAfter.type==i.type&&us(g.doc,b.pos)&&g.join(b.pos),n(g.scrollIntoView())}return!0}let c=s.type.spec.isolating||r>0&&a?null:ne.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),f=d&&Ml(d);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(d,f).scrollIntoView()),!0;if(u&&ul(s,"start",!0)&&ul(i,"end")){let h=i,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let g=s,b=1;for(;!g.isTextblock;g=g.firstChild)b++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(n){let m=R.empty;for(let k=p.length-1;k>=0;k--)m=R.from(p[k].copy(m));let E=t.tr.step(new gt(e.pos-p.length,e.pos+s.nodeSize,e.pos+b,e.pos+s.nodeSize-b,new $(m,p.length,0),0,!0));n(E.scrollIntoView())}return!0}}return!1}function Q2(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(e.tr.setSelection(X.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}const d6=Q2(-1),f6=Q2(1);function h6(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),l=o&&f1(o,t,e);return l?(r&&r(n.tr.wrap(o,l).scrollIntoView()),!0):!1}}function ok(t,e=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:l}}=n.selection.ranges[s];n.doc.nodesBetween(o,l,(a,u)=>{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(t,e)))if(a.type==t)i=!0;else{let c=n.doc.resolve(u),d=c.index();i=c.parent.canReplaceWith(d,d+1,t)}})}if(!i)return!1;if(r){let s=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:l},$to:{pos:a}}=n.selection.ranges[o];s.setBlockType(l,a,t,e)}r(s.scrollIntoView())}return!0}}function O1(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}O1(A1,V2,K2);O1(A1,q2,G2);O1(Y2,J2,Z2,a6);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function p6(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s);if(!o)return!1;let l=r?n.tr:null;return g6(l,o,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function g6(t,e,n,r=null){let i=!1,s=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let a=o.resolve(e.start-2);s=new Wd(a,a,e.depth),e.endIndex<e.parent.childCount&&(e=new Wd(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let l=f1(s,n,r,e);return l?(t&&m6(t,e,l,i,n),!0):!1}function m6(t,e,n,r,i){let s=R.empty;for(let c=n.length-1;c>=0;c--)s=R.from(n[c].type.create(n[c].attrs,s));t.step(new gt(e.start-(r?2:0),e.end,e.start,e.end,new $(s,0,0),n.length,!0));let o=0;for(let c=0;c<n.length;c++)n[c].type==i&&(o=c+1);let l=n.length-o,a=e.start+n.length-(r?2:0),u=e.parent;for(let c=e.startIndex,d=e.endIndex,f=!0;c<d;c++,f=!1)!f&&Yr(t.doc,a,l)&&(t.split(a,l),a+=2*l),a+=u.child(c).nodeSize;return t}function b6(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,o=>o.childCount>0&&o.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?y6(e,n,t,s):E6(e,n,s):!0:!1}}function y6(t,e,n,r){let i=t.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new gt(s-1,o,s,o,new $(R.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Wd(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const l=Ml(r);if(l==null)return!1;i.lift(r,l);let a=i.doc.resolve(i.mapping.map(s,-1)-1);return us(i.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&i.join(a.pos),e(i.scrollIntoView()),!0}function E6(t,e,n){let r=t.tr,i=n.parent;for(let h=n.end,p=n.endIndex-1,g=n.startIndex;p>g;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,a=n.endIndex==i.childCount,u=s.node(-1),c=s.index(-1);if(!u.canReplace(c+(l?0:1),c+1,o.content.append(a?R.empty:R.from(i))))return!1;let d=s.pos,f=d+o.nodeSize;return r.step(new gt(d-(l?1:0),f+(a?1:0),d+1,f-1,new $((l?R.empty:R.from(i.copy(R.empty))).append(a?R.empty:R.from(i.copy(R.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function k6(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,a=l.child(o-1);if(a.type!=t)return!1;if(n){let u=a.lastChild&&a.lastChild.type==l.type,c=R.from(u?t.create():null),d=new $(R.from(t.create(null,R.from(l.type.create(null,c)))),u?3:1,0),f=s.start,h=s.end;n(e.tr.step(new gt(f-(u?3:1),h,f,h,d,1,!0)).scrollIntoView())}return!0}}function mh(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}class bh{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:s}=r,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...c)=>{const d=a(...c)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,l=[],a=!!e,u=e||s.tr,c=()=>(!a&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),l.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,h])=>[f,(...g)=>{const b=this.buildProps(u,n),m=h(...g)(b);return l.push(m),d}])),run:c};return d}createCan(e){const{rawCommands:n,state:r}=this,i=!1,s=e||r.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(n).map(([a,u])=>[a,(...c)=>u(...c)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,l={tr:e,editor:i,view:o,state:mh({state:s,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([a,u])=>[a,(...c)=>u(...c)(l)]))}};return l}}class w6{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}once(e,n){const r=(...i)=>{this.off(e,r),n.apply(this,i)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function K(t,e,n){return t.config[e]===void 0&&t.parent?K(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?K(t.parent,e,n):null}):t.config[e]}function yh(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function eS(t){const e=[],{nodeExtensions:n,markExtensions:r}=yh(t),i=[...n,...r],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(o=>{const l={name:o.name,options:o.options,storage:o.storage,extensions:i},a=K(o,"addGlobalAttributes",l);if(!a)return;a().forEach(c=>{c.types.forEach(d=>{Object.entries(c.attributes).forEach(([f,h])=>{e.push({type:d,name:f,attribute:{...s,...h}})})})})}),i.forEach(o=>{const l={name:o.name,options:o.options,storage:o.storage},a=K(o,"addAttributes",l);if(!a)return;const u=a();Object.entries(u).forEach(([c,d])=>{const f={...s,...d};typeof f?.default=="function"&&(f.default=f.default()),f?.isRequired&&f?.default===void 0&&delete f.default,e.push({type:o.name,name:c,attribute:f})})}),e}function bt(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function Ce(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const l=s?String(s).split(" "):[],a=r[i]?r[i].split(" "):[],u=l.filter(c=>!a.includes(c));r[i]=[...a,...u].join(" ")}else if(i==="style"){const l=s?s.split(";").map(c=>c.trim()).filter(Boolean):[],a=r[i]?r[i].split(";").map(c=>c.trim()).filter(Boolean):[],u=new Map;a.forEach(c=>{const[d,f]=c.split(":").map(h=>h.trim());u.set(d,f)}),l.forEach(c=>{const[d,f]=c.split(":").map(h=>h.trim());u.set(d,f)}),r[i]=Array.from(u.entries()).map(([c,d])=>`${c}: ${d}`).join("; ")}else r[i]=s}),r},{})}function Zd(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Ce(n,r),{})}function tS(t){return typeof t=="function"}function ae(t,e=void 0,...n){return tS(t)?e?t.bind(e)(...n):t(...n):t}function _6(t={}){return Object.keys(t).length===0&&t.constructor===Object}function v6(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function lk(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((s,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(n):v6(n.getAttribute(o.name));return l==null?s:{...s,[o.name]:l}},{});return{...r,...i}}}}function ak(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&_6(n)?!1:n!=null))}function x6(t,e){var n;const r=eS(t),{nodeExtensions:i,markExtensions:s}=yh(t),o=(n=i.find(u=>K(u,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(u=>{const c=r.filter(m=>m.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=t.reduce((m,E)=>{const k=K(E,"extendNodeSchema",d);return{...m,...k?k(u):{}}},{}),h=ak({...f,content:ae(K(u,"content",d)),marks:ae(K(u,"marks",d)),group:ae(K(u,"group",d)),inline:ae(K(u,"inline",d)),atom:ae(K(u,"atom",d)),selectable:ae(K(u,"selectable",d)),draggable:ae(K(u,"draggable",d)),code:ae(K(u,"code",d)),whitespace:ae(K(u,"whitespace",d)),linebreakReplacement:ae(K(u,"linebreakReplacement",d)),defining:ae(K(u,"defining",d)),isolating:ae(K(u,"isolating",d)),attrs:Object.fromEntries(c.map(m=>{var E;return[m.name,{default:(E=m?.attribute)===null||E===void 0?void 0:E.default}]}))}),p=ae(K(u,"parseHTML",d));p&&(h.parseDOM=p.map(m=>lk(m,c)));const g=K(u,"renderHTML",d);g&&(h.toDOM=m=>g({node:m,HTMLAttributes:Zd(m,c)}));const b=K(u,"renderText",d);return b&&(h.toText=b),[u.name,h]})),a=Object.fromEntries(s.map(u=>{const c=r.filter(b=>b.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=t.reduce((b,m)=>{const E=K(m,"extendMarkSchema",d);return{...b,...E?E(u):{}}},{}),h=ak({...f,inclusive:ae(K(u,"inclusive",d)),excludes:ae(K(u,"excludes",d)),group:ae(K(u,"group",d)),spanning:ae(K(u,"spanning",d)),code:ae(K(u,"code",d)),attrs:Object.fromEntries(c.map(b=>{var m;return[b.name,{default:(m=b?.attribute)===null||m===void 0?void 0:m.default}]}))}),p=ae(K(u,"parseHTML",d));p&&(h.parseDOM=p.map(b=>lk(b,c)));const g=K(u,"renderHTML",d);return g&&(h.toDOM=b=>g({mark:b,HTMLAttributes:Zd(b,c)})),[u.name,h]}));return new u1({topNode:o,nodes:l,marks:a})}function Ip(t,e){return e.nodes[t]||e.marks[t]||null}function uk(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function D1(t,e){const n=lo.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}const S6=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,l)=>{var a,u;const c=((u=(a=i.type.spec).toText)===null||u===void 0?void 0:u.call(a,{node:i,pos:s,parent:o,index:l}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?c:c.slice(0,Math.max(0,r-s))}),n};function R1(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Eh{constructor(e){this.find=e.find,this.handler=e.handler}}const C6=(t,e)=>{if(R1(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Ec(t){var e;const{editor:n,from:r,to:i,text:s,rules:o,plugin:l}=t,{view:a}=n;if(a.composing)return!1;const u=a.state.doc.resolve(r);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let c=!1;const d=S6(u)+s;return o.forEach(f=>{if(c)return;const h=C6(d,f.find);if(!h)return;const p=a.state.tr,g=mh({state:a.state,transaction:p}),b={from:r-(h[0].length-s.length),to:i},{commands:m,chain:E,can:k}=new bh({editor:n,state:g});f.handler({state:g,range:b,match:h,commands:m,chain:E,can:k})===null||!p.steps.length||(p.setMeta(l,{transform:p,from:r,to:i,text:s}),a.dispatch(p),c=!0)}),c}function A6(t){const{editor:e,rules:n}=t,r=new Ae({state:{init(){return null},apply(i,s,o){const l=i.getMeta(r);if(l)return l;const a=i.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:c}=a;typeof c=="string"?c=c:c=D1(R.from(c),o.schema);const{from:d}=a,f=d+c.length;Ec({editor:e,from:d,to:f,text:c,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,l){return Ec({editor:e,from:s,to:o,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Ec({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?Ec({editor:e,from:o.pos,to:o.pos,text:`
|
|
34
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function T6(t){return Object.prototype.toString.call(t).slice(8,-1)}function kc(t){return T6(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function kh(t,e){const n={...t};return kc(t)&&kc(e)&&Object.keys(e).forEach(r=>{kc(e[r])&&kc(t[r])?n[r]=kh(t[r],e[r]):n[r]=e[r]}),n}class jn{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(K(this,"addOptions",{name:this.name}))),this.storage=ae(K(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new jn(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>kh(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new jn(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ae(K(n,"addOptions",{name:n.name})),n.storage=ae(K(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(u=>u?.type.name===n.name))return!1;const a=o.find(u=>u?.type.name===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}function N6(t){return typeof t=="number"}class nS{constructor(e){this.find=e.find,this.handler=e.handler}}const M6=(t,e,n)=>{if(R1(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=t,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function O6(t){const{editor:e,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:l}=t,{commands:a,chain:u,can:c}=new bh({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,i,(h,p)=>{if(!h.isTextblock||h.type.spec.code)return;const g=Math.max(r,p),b=Math.min(i,p+h.content.size),m=h.textBetween(g-p,b-p,void 0,"");M6(m,s.find,o).forEach(k=>{if(k.index===void 0)return;const y=g+k.index+1,_=y+k[0].length,w={from:n.tr.mapping.map(y),to:n.tr.mapping.map(_)},x=s.handler({state:n,range:w,match:k,commands:a,chain:u,can:c,pasteEvent:o,dropEvent:l});d.push(x)})}),d.every(h=>h!==null)}let wc=null;const D6=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function R6(t){const{editor:e,rules:n}=t;let r=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const a=({state:c,from:d,to:f,rule:h,pasteEvt:p})=>{const g=c.tr,b=mh({state:c,transaction:g});if(!(!O6({editor:e,state:b,from:Math.max(d-1,0),to:f.b-1,rule:h,pasteEvent:p,dropEvent:l})||!g.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(c=>new Ae({view(d){const f=p=>{var g;r=!((g=d.dom.parentElement)===null||g===void 0)&&g.contains(p.target)?d.dom.parentElement:null,r&&(wc=e)},h=()=>{wc&&(wc=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(d,f)=>{if(s=r===d.dom.parentElement,l=f,!s){const h=wc;h?.isEditable&&setTimeout(()=>{const p=h.state.selection;p&&h.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(d,f)=>{var h;const p=(h=f.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return o=f,i=!!p?.includes("data-pm-slice"),!1}}},appendTransaction:(d,f,h)=>{const p=d[0],g=p.getMeta("uiEvent")==="paste"&&!i,b=p.getMeta("uiEvent")==="drop"&&!s,m=p.getMeta("applyPasteRules"),E=!!m;if(!g&&!b&&!E)return;if(E){let{text:_}=m;typeof _=="string"?_=_:_=D1(R.from(_),h.schema);const{from:w}=m,x=w+_.length,S=D6(_);return a({rule:c,state:h,from:w,to:{b:x},pasteEvt:S})}const k=f.doc.content.findDiffStart(h.doc.content),y=f.doc.content.findDiffEnd(h.doc.content);if(!(!N6(k)||!y||k===y.b))return a({rule:c,state:h,from:k,to:y,pasteEvt:o})}}))}function I6(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class Uo{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Uo.resolve(e),this.schema=x6(this.extensions,n),this.setupExtensions()}static resolve(e){const n=Uo.sort(Uo.flatten(e)),r=I6(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=K(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const s=K(r,"priority")||100,o=K(i,"priority")||100;return s>o?-1:s<o?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Ip(n.name,this.schema)},i=K(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=Uo.sort([...this.extensions].reverse()),r=[],i=[],s=n.map(o=>{const l={name:o.name,options:o.options,storage:o.storage,editor:e,type:Ip(o.name,this.schema)},a=[],u=K(o,"addKeyboardShortcuts",l);let c={};if(o.type==="mark"&&K(o,"exitable",l)&&(c.ArrowRight=()=>jn.handleExit({editor:e,mark:o})),u){const g=Object.fromEntries(Object.entries(u()).map(([b,m])=>[b,()=>m({editor:e})]));c={...c,...g}}const d=e6(c);a.push(d);const f=K(o,"addInputRules",l);uk(o,e.options.enableInputRules)&&f&&r.push(...f());const h=K(o,"addPasteRules",l);uk(o,e.options.enablePasteRules)&&h&&i.push(...h());const p=K(o,"addProseMirrorPlugins",l);if(p){const g=p();a.push(...g)}return a}).flat();return[A6({editor:e,rules:r}),...R6({editor:e,rules:i}),...s]}get attributes(){return eS(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=yh(this.extensions);return Object.fromEntries(n.filter(r=>!!K(r,"addNodeView")).map(r=>{const i=this.attributes.filter(a=>a.type===r.name),s={name:r.name,options:r.options,storage:r.storage,editor:e,type:bt(r.name,this.schema)},o=K(r,"addNodeView",s);if(!o)return[];const l=(a,u,c,d,f)=>{const h=Zd(a,i);return o()({node:a,view:u,getPos:c,decorations:d,innerDecorations:f,editor:e,extension:r,HTMLAttributes:h})};return[r.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Ip(e.name,this.schema)};e.type==="mark"&&(!((n=ae(K(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=K(e,"onBeforeCreate",r),s=K(e,"onCreate",r),o=K(e,"onUpdate",r),l=K(e,"onSelectionUpdate",r),a=K(e,"onTransaction",r),u=K(e,"onFocus",r),c=K(e,"onBlur",r),d=K(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),o&&this.editor.on("update",o),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),u&&this.editor.on("focus",u),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}}class et{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(K(this,"addOptions",{name:this.name}))),this.storage=ae(K(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new et(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>kh(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new et({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ae(K(n,"addOptions",{name:n.name})),n.storage=ae(K(n,"addStorage",{name:n.name,options:n.options})),n}}function rS(t,e,n){const{from:r,to:i}=e,{blockSeparator:s=`
|
|
35
|
+
|
|
36
|
+
`,textSerializers:o={}}=n||{};let l="";return t.nodesBetween(r,i,(a,u,c,d)=>{var f;a.isBlock&&u>r&&(l+=s);const h=o?.[a.type.name];if(h)return c&&(l+=h({node:a,pos:u,parent:c,index:d,range:e})),!1;a.isText&&(l+=(f=a?.text)===null||f===void 0?void 0:f.slice(Math.max(r,u)-u,i-u))}),l}function iS(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const sS=et.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ae({key:new Le("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(c=>c.$from.pos)),l=Math.max(...s.map(c=>c.$to.pos)),a=iS(n);return rS(r,{from:o,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),L6=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),P6=(t=!1)=>({commands:e})=>e.setContent("",t),F6=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:o})=>{t.doc.nodesBetween(s.pos,o.pos,(l,a)=>{if(l.type.isText)return;const{doc:u,mapping:c}=e,d=u.resolve(c.map(a)),f=u.resolve(c.map(a+l.nodeSize)),h=d.blockRange(f);if(!h)return;const p=Ml(h);if(l.type.isTextblock){const{defaultType:g}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(h.start,g)}(p||p===0)&&e.lift(h,p)})}),!0},B6=t=>e=>t(e),z6=()=>({state:t,dispatch:e})=>J2(t,e),$6=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,s.content),r.setSelection(new X(r.doc.resolve(Math.max(o-1,0)))),!0},U6=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const l=i.before(s),a=i.after(s);t.delete(l,a).scrollIntoView()}return!0}return!1},H6=t=>({tr:e,state:n,dispatch:r})=>{const i=bt(t,n.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const a=s.before(o),u=s.after(o);e.delete(a,u).scrollIntoView()}return!0}return!1},V6=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},W6=()=>({state:t,dispatch:e})=>A1(t,e),K6=()=>({commands:t})=>t.keyboardShortcut("Enter"),j6=()=>({state:t,dispatch:e})=>o6(t,e);function Xd(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:R1(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function oS(t,e,n={}){return t.find(r=>r.type===e&&Xd(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function ck(t,e,n={}){return!!oS(t,e,n)}function I1(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(c=>c.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(c=>c.type===e)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!oS([...i.node.marks],e,n)))return;let o=i.index,l=t.start()+i.offset,a=o+1,u=l+i.node.nodeSize;for(;o>0&&ck([...t.parent.child(o-1).marks],e,n);)o-=1,l-=t.parent.child(o).nodeSize;for(;a<t.parent.childCount&&ck([...t.parent.child(a).marks],e,n);)u+=t.parent.child(a).nodeSize,a+=1;return{from:l,to:u}}function ds(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const q6=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const s=ds(t,r.schema),{doc:o,selection:l}=n,{$from:a,from:u,to:c}=l;if(i){const d=I1(a,s,e);if(d&&d.from<=u&&d.to>=c){const f=X.create(o,d.from,d.to);n.setSelection(f)}}return!0},G6=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function L1(t){return t instanceof X}function qr(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function lS(t,e=null){if(!e)return null;const n=ne.atStart(t),r=ne.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,s=r.to;return e==="all"?X.create(t,qr(0,i,s),qr(t.content.size,i,s)):X.create(t,qr(e,i,s),qr(e,i,s))}function Og(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function iu(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Y6(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const J6=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{(iu()||Og())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),Y6()&&!iu()&&!Og()&&r.dom.focus({preventScroll:!0}))})};if(r.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!L1(n.state.selection))return o(),!0;const l=lS(i.doc,t)||n.state.selection,a=n.state.selection.eq(l);return s&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Z6=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),X6=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),aS=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&aS(r)}return t};function _c(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return aS(n)}function su(t,e,n){if(t instanceof Wi||t instanceof R)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return R.fromArray(t.map(l=>e.nodeFromJSON(l)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),su("",e,n)}if(i){if(n.errorOnInvalidContent){let o=!1,l="";const a=new u1({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,l=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?Ea.fromSchema(a).parseSlice(_c(t),n.parseOptions):Ea.fromSchema(a).parse(_c(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const s=Ea.fromSchema(e);return n.slice?s.parseSlice(_c(t),n.parseOptions).content:s.parse(_c(t),n.parseOptions)}return su("",e,n)}function Q6(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof ft||i instanceof gt))return;const s=t.mapping.maps[r];let o=0;s.forEach((l,a,u,c)=>{o===0&&(o=c)}),t.setSelection(ne.near(t.doc.resolve(o),n))}const eR=t=>!("type"in t),tR=(t,e,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;const a=b=>{s.emit("contentError",{editor:s,error:b,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{su(e,s.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(b){a(b)}try{l=su(e,s.schema,{parseOptions:u,errorOnInvalidContent:(o=n.errorOnInvalidContent)!==null&&o!==void 0?o:s.options.enableContentCheck})}catch(b){return a(b),!1}let{from:c,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,h=!0;if((eR(l)?l:[l]).forEach(b=>{b.check(),f=f?b.isText&&b.marks.length===0:!1,h=h?b.isBlock:!1}),c===d&&h){const{parent:b}=r.doc.resolve(c);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(c-=1,d+=1)}let g;if(f){if(Array.isArray(e))g=e.map(b=>b.text||"").join("");else if(e instanceof R){let b="";e.forEach(m=>{m.text&&(b+=m.text)}),g=b}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,c,d)}else g=l,r.replaceWith(c,d,g);n.updateSelection&&Q6(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:g})}return!0},nR=()=>({state:t,dispatch:e})=>r6(t,e),rR=()=>({state:t,dispatch:e})=>i6(t,e),iR=()=>({state:t,dispatch:e})=>V2(t,e),sR=()=>({state:t,dispatch:e})=>q2(t,e),oR=()=>({state:t,dispatch:e,tr:n})=>{try{const r=ch(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},lR=()=>({state:t,dispatch:e,tr:n})=>{try{const r=ch(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},aR=()=>({state:t,dispatch:e})=>t6(t,e),uR=()=>({state:t,dispatch:e})=>n6(t,e);function uS(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function cR(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,s,o;for(let l=0;l<e.length-1;l+=1){const a=e[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else if(/^s(hift)?$/i.test(a))s=!0;else if(/^mod$/i.test(a))iu()||uS()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}const dR=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const s=cR(t).split(/-(?!$)/),o=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,l))});return a?.steps.forEach(u=>{const c=u.map(r.mapping);c&&i&&r.maybeStep(c)}),!0};function ou(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,o=e?bt(e,t.schema):null,l=[];t.doc.nodesBetween(r,i,(d,f)=>{if(d.isText)return;const h=Math.max(r,f),p=Math.min(i,f+d.nodeSize);l.push({node:d,from:h,to:p})});const a=i-r,u=l.filter(d=>o?o.name===d.node.type.name:!0).filter(d=>Xd(d.node.attrs,n,{strict:!1}));return s?!!u.length:u.reduce((d,f)=>d+f.to-f.from,0)>=a}const fR=(t,e={})=>({state:n,dispatch:r})=>{const i=bt(t,n.schema);return ou(n,i,e)?s6(n,r):!1},hR=()=>({state:t,dispatch:e})=>Z2(t,e),pR=t=>({state:e,dispatch:n})=>{const r=bt(t,e.schema);return b6(r)(e,n)},gR=()=>({state:t,dispatch:e})=>Y2(t,e);function wh(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function dk(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const mR=(t,e)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const l=wh(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(s=bt(t,r.schema)),l==="mark"&&(o=ds(t,r.schema)),i&&n.selection.ranges.forEach(a=>{r.doc.nodesBetween(a.$from.pos,a.$to.pos,(u,c)=>{s&&s===u.type&&n.setNodeMarkup(c,void 0,dk(u.attrs,e)),o&&u.marks.length&&u.marks.forEach(d=>{o===d.type&&n.addMark(c,c+u.nodeSize,o.create(dk(d.attrs,e)))})})}),!0):!1},bR=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),yR=()=>({tr:t,dispatch:e})=>{if(e){const n=new on(t.doc);t.setSelection(n)}return!0},ER=()=>({state:t,dispatch:e})=>K2(t,e),kR=()=>({state:t,dispatch:e})=>G2(t,e),wR=()=>({state:t,dispatch:e})=>u6(t,e),_R=()=>({state:t,dispatch:e})=>f6(t,e),vR=()=>({state:t,dispatch:e})=>d6(t,e);function Dg(t,e,n={},r={}){return su(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const xR=(t,e=!1,n={},r={})=>({editor:i,tr:s,dispatch:o,commands:l})=>{var a,u;const{doc:c}=s;if(n.preserveWhitespace!=="full"){const d=Dg(t,i.schema,n,{errorOnInvalidContent:(a=r.errorOnInvalidContent)!==null&&a!==void 0?a:i.options.enableContentCheck});return o&&s.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!e),!0}return o&&s.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:c.content.size},t,{parseOptions:n,errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck})};function cS(t,e){const n=ds(e,t.schema),{from:r,to:i,empty:s}=t.selection,o=[];s?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===n.name);return l?{...l.attrs}:{}}function SR(t,e){const n=new h1(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function CR(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Rg(t,e){const n=[];return t.descendants((r,i)=>{e(r)&&n.push({node:r,pos:i})}),n}function AR(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,s)=>{n(i)&&r.push({node:i,pos:s})}),r}function dS(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function P1(t){return e=>dS(e.$from,t)}function TR(t,e){const n={from:0,to:t.content.size};return rS(t,n,e)}function NR(t,e){const n=bt(e,t.schema),{from:r,to:i}=t.selection,s=[];t.doc.nodesBetween(r,i,l=>{s.push(l)});const o=s.reverse().find(l=>l.type.name===n.name);return o?{...o.attrs}:{}}function fS(t,e){const n=wh(typeof e=="string"?e:e.name,t.schema);return n==="node"?NR(t,e):n==="mark"?cS(t,e):{}}function MR(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function OR(t){const e=MR(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,o)=>o!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function DR(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((l,a)=>{o.push({from:l,to:a})});else{const{from:l,to:a}=n[s];if(l===void 0||a===void 0)return;o.push({from:l,to:a})}o.forEach(({from:l,to:a})=>{const u=e.slice(s).map(l,-1),c=e.slice(s).map(a),d=e.invert().map(u,-1),f=e.invert().map(c);r.push({oldRange:{from:d,to:f},newRange:{from:u,to:c}})})}),OR(r)}function F1(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t),o=I1(s,i.type);o&&r.push({mark:i,...o})}):n.nodesBetween(t,e,(i,s)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}function rd(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}function Ig(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?ds(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>s?s.name===d.type.name:!0).find(d=>Xd(d.attrs,n,{strict:!1}));let o=0;const l=[];if(i.forEach(({$from:d,$to:f})=>{const h=d.pos,p=f.pos;t.doc.nodesBetween(h,p,(g,b)=>{if(!g.isText&&!g.marks.length)return;const m=Math.max(h,b),E=Math.min(p,b+g.nodeSize),k=E-m;o+=k,l.push(...g.marks.map(y=>({mark:y,from:m,to:E})))})}),o===0)return!1;const a=l.filter(d=>s?s.name===d.mark.type.name:!0).filter(d=>Xd(d.mark.attrs,n,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),u=l.filter(d=>s?d.mark.type!==s&&d.mark.type.excludes(s):!0).reduce((d,f)=>d+f.to-f.from,0);return(a>0?a+u:a)>=o}function RR(t,e,n={}){if(!e)return ou(t,null,n)||Ig(t,null,n);const r=wh(e,t.schema);return r==="node"?ou(t,e,n):r==="mark"?Ig(t,e,n):!1}function fk(t,e){const{nodeExtensions:n}=yh(e),r=n.find(o=>o.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=ae(K(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function _h(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(_h(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function hS(t){return t instanceof J}function IR(t,e,n){const i=t.state.doc.content.size,s=qr(e,0,i),o=qr(n,0,i),l=t.coordsAtPos(s),a=t.coordsAtPos(o,-1),u=Math.min(l.top,a.top),c=Math.max(l.bottom,a.bottom),d=Math.min(l.left,a.left),f=Math.max(l.right,a.right),h=f-d,p=c-u,m={top:u,bottom:c,left:d,right:f,width:h,height:p,x:d,y:u};return{...m,toJSON:()=>m}}function LR(t,e,n){var r;const{selection:i}=e;let s=null;if(L1(i)&&(s=i.$cursor),s){const l=(r=t.storedMarks)!==null&&r!==void 0?r:s.marks();return!!n.isInSet(l)||!l.some(a=>a.type.excludes(n))}const{ranges:o}=i;return o.some(({$from:l,$to:a})=>{let u=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,a.pos,(c,d,f)=>{if(u)return!1;if(c.isInline){const h=!f||f.type.allowsMarkType(n),p=!!n.isInSet(c.marks)||!c.marks.some(g=>g.type.excludes(n));u=h&&p}return!u}),u})}const PR=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:l}=s,a=ds(t,r.schema);if(i)if(o){const u=cS(r,a);n.addStoredMark(a.create({...u,...e}))}else l.forEach(u=>{const c=u.$from.pos,d=u.$to.pos;r.doc.nodesBetween(c,d,(f,h)=>{const p=Math.max(h,c),g=Math.min(h+f.nodeSize,d);f.marks.find(m=>m.type===a)?f.marks.forEach(m=>{a===m.type&&n.addMark(p,g,a.create({...m.attrs,...e}))}):n.addMark(p,g,a.create(e))})});return LR(r,n,a)},FR=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),BR=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const s=bt(t,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:l})=>ok(s,{...o,...e})(n)?!0:l.clearNodes()).command(({state:l})=>ok(s,{...o,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},zR=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=qr(t,0,r.content.size),s=J.create(r,i);e.setSelection(s)}return!0},$R=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,o=X.atStart(r).from,l=X.atEnd(r).to,a=qr(i,o,l),u=qr(s,o,l),c=X.create(r,a,u);e.setSelection(c)}return!0},UR=t=>({state:e,dispatch:n})=>{const r=bt(t,e.schema);return k6(r)(e,n)};function hk(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r)}}const HR=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:l,$to:a}=s,u=i.extensionManager.attributes,c=rd(u,l.node().type.name,l.node().attrs);if(s instanceof J&&s.node.isBlock)return!l.parentOffset||!Yr(o,l.pos)?!1:(r&&(t&&hk(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const d=a.parentOffset===a.parent.content.size,f=l.depth===0?void 0:CR(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=d&&f?[{type:f,attrs:c}]:void 0,p=Yr(e.doc,e.mapping.map(l.pos),1,h);if(!h&&!p&&Yr(e.doc,e.mapping.map(l.pos),1,f?[{type:f}]:void 0)&&(p=!0,h=f?[{type:f,attrs:c}]:void 0),r){if(p&&(s instanceof X&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,h),f&&!d&&!l.parentOffset&&l.parent.type!==f)){const g=e.mapping.map(l.before()),b=e.doc.resolve(g);l.node(-1).canReplaceWith(b.index(),b.index()+1,f)&&e.setNodeMarkup(e.mapping.map(l.before()),f)}t&&hk(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return p},VR=(t,e={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const l=bt(t,r.schema),{$from:a,$to:u}=r.selection,c=r.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(u))return!1;const d=a.node(-1);if(d.type!==l)return!1;const f=s.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(i){let m=R.empty;const E=a.index(-1)?1:a.index(-2)?2:3;for(let S=a.depth-E;S>=a.depth-3;S-=1)m=R.from(a.node(S).copy(m));const k=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,y={...rd(f,a.node().type.name,a.node().attrs),...e},_=((o=l.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(y))||void 0;m=m.append(R.from(l.createAndFill(null,_)||void 0));const w=a.before(a.depth-(E-1));n.replace(w,a.after(-k),new $(m,4-E,0));let x=-1;n.doc.nodesBetween(w,n.doc.content.size,(S,O)=>{if(x>-1)return!1;S.isTextblock&&S.content.size===0&&(x=O+1)}),x>-1&&n.setSelection(X.near(n.doc.resolve(x))),n.scrollIntoView()}return!0}const h=u.pos===a.end()?d.contentMatchAt(0).defaultType:null,p={...rd(f,d.type.name,d.attrs),...e},g={...rd(f,a.node().type.name,a.node().attrs),...e};n.delete(a.pos,u.pos);const b=h?[{type:l,attrs:p},{type:h,attrs:g}]:[{type:l,attrs:p}];if(!Yr(n.doc,a.pos,2))return!1;if(i){const{selection:m,storedMarks:E}=r,{splittableMarks:k}=s.extensionManager,y=E||m.$to.parentOffset&&m.$from.marks();if(n.split(a.pos,2,b).scrollIntoView(),!y||!i)return!0;const _=y.filter(w=>k.includes(w.type.name));n.ensureMarks(_)}return!0},Lp=(t,e)=>{const n=P1(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===i?.type&&us(t.doc,n.pos)&&t.join(n.pos),!0},Pp=(t,e)=>{const n=P1(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===i?.type&&us(t.doc,r)&&t.join(r),!0},WR=(t,e,n,r={})=>({editor:i,tr:s,state:o,dispatch:l,chain:a,commands:u,can:c})=>{const{extensions:d,splittableMarks:f}=i.extensionManager,h=bt(t,o.schema),p=bt(e,o.schema),{selection:g,storedMarks:b}=o,{$from:m,$to:E}=g,k=m.blockRange(E),y=b||g.$to.parentOffset&&g.$from.marks();if(!k)return!1;const _=P1(w=>fk(w.type.name,d))(g);if(k.depth>=1&&_&&k.depth-_.depth<=1){if(_.node.type===h)return u.liftListItem(p);if(fk(_.node.type.name,d)&&h.validContent(_.node.content)&&l)return a().command(()=>(s.setNodeMarkup(_.pos,h),!0)).command(()=>Lp(s,h)).command(()=>Pp(s,h)).run()}return!n||!y||!l?a().command(()=>c().wrapInList(h,r)?!0:u.clearNodes()).wrapInList(h,r).command(()=>Lp(s,h)).command(()=>Pp(s,h)).run():a().command(()=>{const w=c().wrapInList(h,r),x=y.filter(S=>f.includes(S.type.name));return s.ensureMarks(x),w?!0:u.clearNodes()}).wrapInList(h,r).command(()=>Lp(s,h)).command(()=>Pp(s,h)).run()},KR=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=ds(t,r.schema);return Ig(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},jR=(t,e,n={})=>({state:r,commands:i})=>{const s=bt(t,r.schema),o=bt(e,r.schema),l=ou(r,s,n);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?i.setNode(o,a):i.setNode(s,{...a,...n})},qR=(t,e={})=>({state:n,commands:r})=>{const i=bt(t,n.schema);return ou(n,i,e)?r.lift(i):r.wrapIn(i,e)},GR=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const o=t.tr,l=s.transform;for(let a=l.steps.length-1;a>=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(s.text){const a=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,t.schema.text(s.text,a))}else o.delete(s.from,s.to)}return!0}}return!1},YR=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},JR=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=n,a=ds(t,r.schema),{$from:u,empty:c,ranges:d}=l;if(!i)return!0;if(c&&o){let{from:f,to:h}=l;const p=(s=u.marks().find(b=>b.type===a))===null||s===void 0?void 0:s.attrs,g=I1(u,a,p);g&&(f=g.from,h=g.to),n.removeMark(f,h,a)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,a)});return n.removeStoredMark(a),!0},ZR=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const l=wh(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(s=bt(t,r.schema)),l==="mark"&&(o=ds(t,r.schema)),i&&n.selection.ranges.forEach(a=>{const u=a.$from.pos,c=a.$to.pos;let d,f,h,p;n.selection.empty?r.doc.nodesBetween(u,c,(g,b)=>{s&&s===g.type&&(h=Math.max(b,u),p=Math.min(b+g.nodeSize,c),d=b,f=g)}):r.doc.nodesBetween(u,c,(g,b)=>{b<u&&s&&s===g.type&&(h=Math.max(b,u),p=Math.min(b+g.nodeSize,c),d=b,f=g),b>=u&&b<=c&&(s&&s===g.type&&n.setNodeMarkup(b,void 0,{...g.attrs,...e}),o&&g.marks.length&&g.marks.forEach(m=>{if(o===m.type){const E=Math.max(b,u),k=Math.min(b+g.nodeSize,c);n.addMark(E,k,o.create({...m.attrs,...e}))}}))}),f&&(d!==void 0&&n.setNodeMarkup(d,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(g=>{o===g.type&&n.addMark(h,p,o.create({...g.attrs,...e}))}))}),!0):!1},XR=(t,e={})=>({state:n,dispatch:r})=>{const i=bt(t,n.schema);return h6(i,e)(n,r)},QR=(t,e={})=>({state:n,dispatch:r})=>{const i=bt(t,n.schema);return p6(i,e)(n,r)};var e4=Object.freeze({__proto__:null,blur:L6,clearContent:P6,clearNodes:F6,command:B6,createParagraphNear:z6,cut:$6,deleteCurrentNode:U6,deleteNode:H6,deleteRange:V6,deleteSelection:W6,enter:K6,exitCode:j6,extendMarkRange:q6,first:G6,focus:J6,forEach:Z6,insertContent:X6,insertContentAt:tR,joinBackward:iR,joinDown:rR,joinForward:sR,joinItemBackward:oR,joinItemForward:lR,joinTextblockBackward:aR,joinTextblockForward:uR,joinUp:nR,keyboardShortcut:dR,lift:fR,liftEmptyBlock:hR,liftListItem:pR,newlineInCode:gR,resetAttributes:mR,scrollIntoView:bR,selectAll:yR,selectNodeBackward:ER,selectNodeForward:kR,selectParentNode:wR,selectTextblockEnd:_R,selectTextblockStart:vR,setContent:xR,setMark:PR,setMeta:FR,setNode:BR,setNodeSelection:zR,setTextSelection:$R,sinkListItem:UR,splitBlock:HR,splitListItem:VR,toggleList:WR,toggleMark:KR,toggleNode:jR,toggleWrap:qR,undoInputRule:GR,unsetAllMarks:YR,unsetMark:JR,updateAttributes:ZR,wrapIn:XR,wrapInList:QR});const pS=et.create({name:"commands",addCommands(){return{...e4}}}),gS=et.create({name:"drop",addProseMirrorPlugins(){return[new Ae({key:new Le("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),mS=et.create({name:"editable",addProseMirrorPlugins(){return[new Ae({key:new Le("editable"),props:{editable:()=>this.editor.options.editable}})]}}),bS=new Le("focusEvents"),yS=et.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ae({key:bS,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),ES=et.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:u}=l,{empty:c,$anchor:d}=a,{pos:f,parent:h}=d,p=d.parent.isTextblock&&f>0?l.doc.resolve(f-1):d,g=p.parent.type.spec.isolating,b=d.pos-d.parentOffset,m=g&&p.parent.childCount===1?b===d.pos:ne.atStart(u).from===f;return!c||!h.type.isTextblock||h.textContent.length||!m||m&&d.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return iu()||uS()?s:i},addProseMirrorPlugins(){return[new Ae({key:new Le("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),i=t.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:o,to:l}=e.selection,a=ne.atStart(e.doc).from,u=ne.atEnd(e.doc).to;if(s||!(o===a&&l===u)||!_h(n.doc))return;const f=n.tr,h=mh({state:n,transaction:f}),{commands:p}=new bh({editor:this.editor,state:h});if(p.clearNodes(),!!f.steps.length)return f}})]}}),kS=et.create({name:"paste",addProseMirrorPlugins(){return[new Ae({key:new Le("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),wS=et.create({name:"tabindex",addProseMirrorPlugins(){return[new Ae({key:new Le("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});var QV=Object.freeze({__proto__:null,ClipboardTextSerializer:sS,Commands:pS,Drop:gS,Editable:mS,FocusEvents:yS,Keymap:ES,Paste:kS,Tabindex:wS,focusEventsPluginKey:bS});class _s{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new _s(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new _s(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new _s(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,o=this.pos+r+(s?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(o);if(!i&&l.depth<=this.depth)return;const a=new _s(l,this.editor,i,i?n:null);i&&(a.actualDepth=this.depth+1),e.push(new _s(l,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,o=Object.keys(n);for(let l=0;l<o.length;l+=1){const a=o[l];if(s[a]!==n[a])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(o=>{r&&i.length>0||(o.node.type.name===e&&s.every(a=>n[a]===o.node.attrs[a])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const t4=`.ProseMirror {
|
|
37
|
+
position: relative;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ProseMirror {
|
|
41
|
+
word-wrap: break-word;
|
|
42
|
+
white-space: pre-wrap;
|
|
43
|
+
white-space: break-spaces;
|
|
44
|
+
-webkit-font-variant-ligatures: none;
|
|
45
|
+
font-variant-ligatures: none;
|
|
46
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ProseMirror [contenteditable="false"] {
|
|
50
|
+
white-space: normal;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
54
|
+
white-space: pre-wrap;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.ProseMirror pre {
|
|
58
|
+
white-space: pre-wrap;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
img.ProseMirror-separator {
|
|
62
|
+
display: inline !important;
|
|
63
|
+
border: none !important;
|
|
64
|
+
margin: 0 !important;
|
|
65
|
+
width: 0 !important;
|
|
66
|
+
height: 0 !important;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ProseMirror-gapcursor {
|
|
70
|
+
display: none;
|
|
71
|
+
pointer-events: none;
|
|
72
|
+
position: absolute;
|
|
73
|
+
margin: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.ProseMirror-gapcursor:after {
|
|
77
|
+
content: "";
|
|
78
|
+
display: block;
|
|
79
|
+
position: absolute;
|
|
80
|
+
top: -2px;
|
|
81
|
+
width: 20px;
|
|
82
|
+
border-top: 1px solid black;
|
|
83
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@keyframes ProseMirror-cursor-blink {
|
|
87
|
+
to {
|
|
88
|
+
visibility: hidden;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ProseMirror-hideselection *::selection {
|
|
93
|
+
background: transparent;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
97
|
+
background: transparent;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.ProseMirror-hideselection * {
|
|
101
|
+
caret-color: transparent;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
105
|
+
display: block;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
109
|
+
opacity: 0
|
|
110
|
+
}`;function n4(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}class r4 extends w6{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=n4(t4,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=tS(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(s=>{const o=typeof s=="string"?`${s}$`:s.key;r=r.filter(l=>!l.key.startsWith(o))}),n.length===r.length)return;const i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[mS,sS.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),pS,yS,ES,wS,gS,kS].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s?.type));this.extensionManager=new Uo(i,this)}createCommandManager(){this.commandManager=new bh({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=Dg(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(o){if(!(o instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(o.message))throw o;this.emit("contentError",{editor:this,error:o,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(l=>l.name!=="collaboration"),this.createExtensionManager()}}),n=Dg(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=lS(n,this.options.autofocus);this.view=new S1(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:$o.create({doc:n,selection:r||void 0})});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();const s=this.view.dom;s.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(o=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(o)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),s=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),s&&this.emit("blur",{editor:this,event:s.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return fS(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return RR(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return D1(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
|
|
111
|
+
|
|
112
|
+
`,textSerializers:r={}}=e||{};return TR(this.state.doc,{blockSeparator:n,textSerializers:{...iS(this.schema),...r}})}get isEmpty(){return _h(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new _s(n,this)}get $doc(){return this.$pos(0)}}function Qs(t){return new Eh({find:t.find,handler:({state:e,range:n,match:r})=>{const i=ae(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],l=r[0];if(o){const a=l.search(/\S/),u=n.from+l.indexOf(o),c=u+o.length;if(F1(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===t.type&&g!==h.mark.type)).filter(h=>h.to>u).length)return null;c<n.to&&s.delete(c,n.to),u>n.from&&s.delete(n.from+a,u);const f=n.from+a+o.length;s.addMark(n.from+a,f,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}function _S(t){return new Eh({find:t.find,handler:({state:e,range:n,match:r})=>{const i=ae(t.getAttributes,void 0,r)||{},{tr:s}=e,o=n.from;let l=n.to;const a=t.type.create(i);if(r[1]){const u=r[0].lastIndexOf(r[1]);let c=o+u;c>l?c=l:l=c+r[1].length;const d=r[0][r[0].length-1];s.insertText(d,o+r[0].length-1),s.replaceWith(c,l,a)}else if(r[0]){const u=t.type.isInline?o:o-1;s.insert(u,t.type.create(i)).delete(s.mapping.map(o),s.mapping.map(l))}s.scrollIntoView()}})}function Lg(t){return new Eh({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=ae(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)}})}function cl(t){return new Eh({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=ae(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),a=o.doc.resolve(n.from).blockRange(),u=a&&f1(a,t.type,s);if(!u)return null;if(o.wrap(a,u),t.keepMarks&&t.editor){const{selection:d,storedMarks:f}=e,{splittableMarks:h}=t.editor.extensionManager,p=f||d.$to.parentOffset&&d.$from.marks();if(p){const g=p.filter(b=>h.includes(b.type.name));o.ensureMarks(g)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,s).run()}const c=o.doc.resolve(n.from-1).nodeBefore;c&&c.type===t.type&&us(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,c))&&o.join(n.from-1)}})}class Ke{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(K(this,"addOptions",{name:this.name}))),this.storage=ae(K(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ke(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>kh(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ke(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ae(K(n,"addOptions",{name:n.name})),n.storage=ae(K(n,"addStorage",{name:n.name,options:n.options})),n}}class i4{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,i,s,o,l,a;const{view:u}=this.editor,c=e.target,d=c.nodeType===3?(n=c.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(c)||!d)return;let f=0,h=0;if(this.dom!==d){const E=this.dom.getBoundingClientRect(),k=d.getBoundingClientRect(),y=(i=e.offsetX)!==null&&i!==void 0?i:(s=e.nativeEvent)===null||s===void 0?void 0:s.offsetX,_=(o=e.offsetY)!==null&&o!==void 0?o:(l=e.nativeEvent)===null||l===void 0?void 0:l.offsetY;f=k.x-E.x+y,h=k.y-E.y+_}const p=this.dom.cloneNode(!0);(a=e.dataTransfer)===null||a===void 0||a.setDragImage(p,f,h);const g=this.getPos();if(typeof g!="number")return;const b=J.create(u.state.doc,g),m=u.state.tr.setSelection(b);u.dispatch(m)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const s=e.type.startsWith("drag"),o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o&&!s)return!0;const{isEditable:a}=this.editor,{isDragging:u}=this,c=!!this.node.type.spec.draggable,d=J.isSelectable(this.node),f=e.type==="copy",h=e.type==="paste",p=e.type==="cut",g=e.type==="mousedown";if(!c&&d&&s&&e.target===this.dom&&e.preventDefault(),c&&s&&!u&&e.target===this.dom)return e.preventDefault(),!1;if(c&&a&&!u&&g){const b=r.closest("[data-drag-handle]");b&&(this.dom===b||this.dom.contains(b))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(u||o||f||h||p||g&&d)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(iu()||Og())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return typeof r!="number"?!1:(n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function Qi(t){return new nS({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=ae(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,l=r[r.length-1],a=r[0];let u=n.to;if(l){const c=a.search(/\S/),d=n.from+a.indexOf(l),f=d+l.length;if(F1(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(b=>b===t.type&&b!==p.mark.type)).filter(p=>p.to>d).length)return null;f<n.to&&o.delete(f,n.to),d>n.from&&o.delete(n.from+c,d),u=n.from+c+l.length,o.addMark(n.from+c,u,t.type.create(s||{})),o.removeStoredMark(t.type)}}})}function s4(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof J){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}function o4(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function l4(t){return new nS({find:t.find,handler({match:e,chain:n,range:r,pasteEvent:i}){const s=ae(t.getAttributes,void 0,e,i),o=ae(t.getContent,void 0,s);if(s===!1||s===null)return null;const l={type:t.type.name,attrs:s};o&&(l.content=o),e.input&&n().deleteRange(r).insertContentAt(r.from,l)}})}var an="top",qn="bottom",Gn="right",un="left",B1="auto",Hu=[an,qn,Gn,un],dl="start",lu="end",a4="clippingParents",vS="viewport",Jl="popper",u4="reference",pk=Hu.reduce(function(t,e){return t.concat([e+"-"+dl,e+"-"+lu])},[]),xS=[].concat(Hu,[B1]).reduce(function(t,e){return t.concat([e,e+"-"+dl,e+"-"+lu])},[]),c4="beforeRead",d4="read",f4="afterRead",h4="beforeMain",p4="main",g4="afterMain",m4="beforeWrite",b4="write",y4="afterWrite",E4=[c4,d4,f4,h4,p4,g4,m4,b4,y4];function Nr(t){return t?(t.nodeName||"").toLowerCase():null}function Sn(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function eo(t){var e=Sn(t).Element;return t instanceof e||t instanceof Element}function Hn(t){var e=Sn(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function z1(t){if(typeof ShadowRoot>"u")return!1;var e=Sn(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function k4(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},s=e.elements[n];!Hn(s)||!Nr(s)||(Object.assign(s.style,r),Object.keys(i).forEach(function(o){var l=i[o];l===!1?s.removeAttribute(o):s.setAttribute(o,l===!0?"":l)}))})}function w4(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=o.reduce(function(a,u){return a[u]="",a},{});!Hn(i)||!Nr(i)||(Object.assign(i.style,l),Object.keys(s).forEach(function(a){i.removeAttribute(a)}))})}}const SS={name:"applyStyles",enabled:!0,phase:"write",fn:k4,effect:w4,requires:["computeStyles"]};function Sr(t){return t.split("-")[0]}var Ps=Math.max,Qd=Math.min,fl=Math.round;function Pg(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function CS(){return!/^((?!chrome|android).)*safari/i.test(Pg())}function hl(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,s=1;e&&Hn(t)&&(i=t.offsetWidth>0&&fl(r.width)/t.offsetWidth||1,s=t.offsetHeight>0&&fl(r.height)/t.offsetHeight||1);var o=eo(t)?Sn(t):window,l=o.visualViewport,a=!CS()&&n,u=(r.left+(a&&l?l.offsetLeft:0))/i,c=(r.top+(a&&l?l.offsetTop:0))/s,d=r.width/i,f=r.height/s;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function $1(t){var e=hl(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function AS(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&z1(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ri(t){return Sn(t).getComputedStyle(t)}function _4(t){return["table","td","th"].indexOf(Nr(t))>=0}function fs(t){return((eo(t)?t.ownerDocument:t.document)||window.document).documentElement}function vh(t){return Nr(t)==="html"?t:t.assignedSlot||t.parentNode||(z1(t)?t.host:null)||fs(t)}function gk(t){return!Hn(t)||ri(t).position==="fixed"?null:t.offsetParent}function v4(t){var e=/firefox/i.test(Pg()),n=/Trident/i.test(Pg());if(n&&Hn(t)){var r=ri(t);if(r.position==="fixed")return null}var i=vh(t);for(z1(i)&&(i=i.host);Hn(i)&&["html","body"].indexOf(Nr(i))<0;){var s=ri(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function Vu(t){for(var e=Sn(t),n=gk(t);n&&_4(n)&&ri(n).position==="static";)n=gk(n);return n&&(Nr(n)==="html"||Nr(n)==="body"&&ri(n).position==="static")?e:n||v4(t)||e}function U1(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function va(t,e,n){return Ps(t,Qd(e,n))}function x4(t,e,n){var r=va(t,e,n);return r>n?n:r}function TS(){return{top:0,right:0,bottom:0,left:0}}function NS(t){return Object.assign({},TS(),t)}function MS(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var S4=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,NS(typeof e!="number"?e:MS(e,Hu))};function C4(t){var e,n=t.state,r=t.name,i=t.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,l=Sr(n.placement),a=U1(l),u=[un,Gn].indexOf(l)>=0,c=u?"height":"width";if(!(!s||!o)){var d=S4(i.padding,n),f=$1(s),h=a==="y"?an:un,p=a==="y"?qn:Gn,g=n.rects.reference[c]+n.rects.reference[a]-o[a]-n.rects.popper[c],b=o[a]-n.rects.reference[a],m=Vu(s),E=m?a==="y"?m.clientHeight||0:m.clientWidth||0:0,k=g/2-b/2,y=d[h],_=E-f[c]-d[p],w=E/2-f[c]/2+k,x=va(y,w,_),S=a;n.modifiersData[r]=(e={},e[S]=x,e.centerOffset=x-w,e)}}function A4(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||AS(e.elements.popper,i)&&(e.elements.arrow=i))}const T4={name:"arrow",enabled:!0,phase:"main",fn:C4,effect:A4,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function pl(t){return t.split("-")[1]}var N4={top:"auto",right:"auto",bottom:"auto",left:"auto"};function M4(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:fl(n*i)/i||0,y:fl(r*i)/i||0}}function mk(t){var e,n=t.popper,r=t.popperRect,i=t.placement,s=t.variation,o=t.offsets,l=t.position,a=t.gpuAcceleration,u=t.adaptive,c=t.roundOffsets,d=t.isFixed,f=o.x,h=f===void 0?0:f,p=o.y,g=p===void 0?0:p,b=typeof c=="function"?c({x:h,y:g}):{x:h,y:g};h=b.x,g=b.y;var m=o.hasOwnProperty("x"),E=o.hasOwnProperty("y"),k=un,y=an,_=window;if(u){var w=Vu(n),x="clientHeight",S="clientWidth";if(w===Sn(n)&&(w=fs(n),ri(w).position!=="static"&&l==="absolute"&&(x="scrollHeight",S="scrollWidth")),w=w,i===an||(i===un||i===Gn)&&s===lu){y=qn;var O=d&&w===_&&_.visualViewport?_.visualViewport.height:w[x];g-=O-r.height,g*=a?1:-1}if(i===un||(i===an||i===qn)&&s===lu){k=Gn;var L=d&&w===_&&_.visualViewport?_.visualViewport.width:w[S];h-=L-r.width,h*=a?1:-1}}var G=Object.assign({position:l},u&&N4),U=c===!0?M4({x:h,y:g},Sn(n)):{x:h,y:g};if(h=U.x,g=U.y,a){var j;return Object.assign({},G,(j={},j[y]=E?"0":"",j[k]=m?"0":"",j.transform=(_.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",j))}return Object.assign({},G,(e={},e[y]=E?g+"px":"",e[k]=m?h+"px":"",e.transform="",e))}function O4(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,s=n.adaptive,o=s===void 0?!0:s,l=n.roundOffsets,a=l===void 0?!0:l,u={placement:Sr(e.placement),variation:pl(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,mk(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:a})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,mk(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const D4={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:O4,data:{}};var vc={passive:!0};function R4(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,s=i===void 0?!0:i,o=r.resize,l=o===void 0?!0:o,a=Sn(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&u.forEach(function(c){c.addEventListener("scroll",n.update,vc)}),l&&a.addEventListener("resize",n.update,vc),function(){s&&u.forEach(function(c){c.removeEventListener("scroll",n.update,vc)}),l&&a.removeEventListener("resize",n.update,vc)}}const I4={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:R4,data:{}};var L4={left:"right",right:"left",bottom:"top",top:"bottom"};function id(t){return t.replace(/left|right|bottom|top/g,function(e){return L4[e]})}var P4={start:"end",end:"start"};function bk(t){return t.replace(/start|end/g,function(e){return P4[e]})}function H1(t){var e=Sn(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function V1(t){return hl(fs(t)).left+H1(t).scrollLeft}function F4(t,e){var n=Sn(t),r=fs(t),i=n.visualViewport,s=r.clientWidth,o=r.clientHeight,l=0,a=0;if(i){s=i.width,o=i.height;var u=CS();(u||!u&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}return{width:s,height:o,x:l+V1(t),y:a}}function B4(t){var e,n=fs(t),r=H1(t),i=(e=t.ownerDocument)==null?void 0:e.body,s=Ps(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Ps(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+V1(t),a=-r.scrollTop;return ri(i||n).direction==="rtl"&&(l+=Ps(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:o,x:l,y:a}}function W1(t){var e=ri(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function OS(t){return["html","body","#document"].indexOf(Nr(t))>=0?t.ownerDocument.body:Hn(t)&&W1(t)?t:OS(vh(t))}function xa(t,e){var n;e===void 0&&(e=[]);var r=OS(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),s=Sn(r),o=i?[s].concat(s.visualViewport||[],W1(r)?r:[]):r,l=e.concat(o);return i?l:l.concat(xa(vh(o)))}function Fg(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function z4(t,e){var n=hl(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function yk(t,e,n){return e===vS?Fg(F4(t,n)):eo(e)?z4(e,n):Fg(B4(fs(t)))}function $4(t){var e=xa(vh(t)),n=["absolute","fixed"].indexOf(ri(t).position)>=0,r=n&&Hn(t)?Vu(t):t;return eo(r)?e.filter(function(i){return eo(i)&&AS(i,r)&&Nr(i)!=="body"}):[]}function U4(t,e,n,r){var i=e==="clippingParents"?$4(t):[].concat(e),s=[].concat(i,[n]),o=s[0],l=s.reduce(function(a,u){var c=yk(t,u,r);return a.top=Ps(c.top,a.top),a.right=Qd(c.right,a.right),a.bottom=Qd(c.bottom,a.bottom),a.left=Ps(c.left,a.left),a},yk(t,o,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function DS(t){var e=t.reference,n=t.element,r=t.placement,i=r?Sr(r):null,s=r?pl(r):null,o=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,a;switch(i){case an:a={x:o,y:e.y-n.height};break;case qn:a={x:o,y:e.y+e.height};break;case Gn:a={x:e.x+e.width,y:l};break;case un:a={x:e.x-n.width,y:l};break;default:a={x:e.x,y:e.y}}var u=i?U1(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(s){case dl:a[u]=a[u]-(e[c]/2-n[c]/2);break;case lu:a[u]=a[u]+(e[c]/2-n[c]/2);break}}return a}function au(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,s=n.strategy,o=s===void 0?t.strategy:s,l=n.boundary,a=l===void 0?a4:l,u=n.rootBoundary,c=u===void 0?vS:u,d=n.elementContext,f=d===void 0?Jl:d,h=n.altBoundary,p=h===void 0?!1:h,g=n.padding,b=g===void 0?0:g,m=NS(typeof b!="number"?b:MS(b,Hu)),E=f===Jl?u4:Jl,k=t.rects.popper,y=t.elements[p?E:f],_=U4(eo(y)?y:y.contextElement||fs(t.elements.popper),a,c,o),w=hl(t.elements.reference),x=DS({reference:w,element:k,placement:i}),S=Fg(Object.assign({},k,x)),O=f===Jl?S:w,L={top:_.top-O.top+m.top,bottom:O.bottom-_.bottom+m.bottom,left:_.left-O.left+m.left,right:O.right-_.right+m.right},G=t.modifiersData.offset;if(f===Jl&&G){var U=G[i];Object.keys(L).forEach(function(j){var te=[Gn,qn].indexOf(j)>=0?1:-1,Z=[an,qn].indexOf(j)>=0?"y":"x";L[j]+=U[Z]*te})}return L}function H4(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,s=n.rootBoundary,o=n.padding,l=n.flipVariations,a=n.allowedAutoPlacements,u=a===void 0?xS:a,c=pl(r),d=c?l?pk:pk.filter(function(p){return pl(p)===c}):Hu,f=d.filter(function(p){return u.indexOf(p)>=0});f.length===0&&(f=d);var h=f.reduce(function(p,g){return p[g]=au(t,{placement:g,boundary:i,rootBoundary:s,padding:o})[Sr(g)],p},{});return Object.keys(h).sort(function(p,g){return h[p]-h[g]})}function V4(t){if(Sr(t)===B1)return[];var e=id(t);return[bk(t),e,bk(e)]}function W4(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,s=i===void 0?!0:i,o=n.altAxis,l=o===void 0?!0:o,a=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,g=n.allowedAutoPlacements,b=e.options.placement,m=Sr(b),E=m===b,k=a||(E||!p?[id(b)]:V4(b)),y=[b].concat(k).reduce(function(fe,ie){return fe.concat(Sr(ie)===B1?H4(e,{placement:ie,boundary:c,rootBoundary:d,padding:u,flipVariations:p,allowedAutoPlacements:g}):ie)},[]),_=e.rects.reference,w=e.rects.popper,x=new Map,S=!0,O=y[0],L=0;L<y.length;L++){var G=y[L],U=Sr(G),j=pl(G)===dl,te=[an,qn].indexOf(U)>=0,Z=te?"width":"height",A=au(e,{placement:G,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),C=te?j?Gn:un:j?qn:an;_[Z]>w[Z]&&(C=id(C));var v=id(C),T=[];if(s&&T.push(A[U]<=0),l&&T.push(A[C]<=0,A[v]<=0),T.every(function(fe){return fe})){O=G,S=!1;break}x.set(G,T)}if(S)for(var D=p?3:1,B=function(ie){var ge=y.find(function(nt){var at=x.get(nt);if(at)return at.slice(0,ie).every(function(fn){return fn})});if(ge)return O=ge,"break"},V=D;V>0;V--){var de=B(V);if(de==="break")break}e.placement!==O&&(e.modifiersData[r]._skip=!0,e.placement=O,e.reset=!0)}}const K4={name:"flip",enabled:!0,phase:"main",fn:W4,requiresIfExists:["offset"],data:{_skip:!1}};function Ek(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function kk(t){return[an,Gn,qn,un].some(function(e){return t[e]>=0})}function j4(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,o=au(e,{elementContext:"reference"}),l=au(e,{altBoundary:!0}),a=Ek(o,r),u=Ek(l,i,s),c=kk(a),d=kk(u);e.modifiersData[n]={referenceClippingOffsets:a,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const q4={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:j4};function G4(t,e,n){var r=Sr(t),i=[un,an].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,o=s[0],l=s[1];return o=o||0,l=(l||0)*i,[un,Gn].indexOf(r)>=0?{x:l,y:o}:{x:o,y:l}}function Y4(t){var e=t.state,n=t.options,r=t.name,i=n.offset,s=i===void 0?[0,0]:i,o=xS.reduce(function(c,d){return c[d]=G4(d,e.rects,s),c},{}),l=o[e.placement],a=l.x,u=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=a,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=o}const J4={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Y4};function Z4(t){var e=t.state,n=t.name;e.modifiersData[n]=DS({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const X4={name:"popperOffsets",enabled:!0,phase:"read",fn:Z4,data:{}};function Q4(t){return t==="x"?"y":"x"}function eI(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,s=i===void 0?!0:i,o=n.altAxis,l=o===void 0?!1:o,a=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,h=f===void 0?!0:f,p=n.tetherOffset,g=p===void 0?0:p,b=au(e,{boundary:a,rootBoundary:u,padding:d,altBoundary:c}),m=Sr(e.placement),E=pl(e.placement),k=!E,y=U1(m),_=Q4(y),w=e.modifiersData.popperOffsets,x=e.rects.reference,S=e.rects.popper,O=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,L=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),G=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,U={x:0,y:0};if(w){if(s){var j,te=y==="y"?an:un,Z=y==="y"?qn:Gn,A=y==="y"?"height":"width",C=w[y],v=C+b[te],T=C-b[Z],D=h?-S[A]/2:0,B=E===dl?x[A]:S[A],V=E===dl?-S[A]:-x[A],de=e.elements.arrow,fe=h&&de?$1(de):{width:0,height:0},ie=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:TS(),ge=ie[te],nt=ie[Z],at=va(0,x[A],fe[A]),fn=k?x[A]/2-D-at-ge-L.mainAxis:B-at-ge-L.mainAxis,Jt=k?-x[A]/2+D+at+nt+L.mainAxis:V+at+nt+L.mainAxis,Nn=e.elements.arrow&&Vu(e.elements.arrow),dr=Nn?y==="y"?Nn.clientTop||0:Nn.clientLeft||0:0,Zt=(j=G?.[y])!=null?j:0,Xt=C+fn-Zt-dr,Je=C+Jt-Zt,oe=va(h?Qd(v,Xt):v,C,h?Ps(T,Je):T);w[y]=oe,U[y]=oe-C}if(l){var Tt,Y=y==="x"?an:un,Q=y==="x"?qn:Gn,ye=w[_],ee=_==="y"?"height":"width",pe=ye+b[Y],Ze=ye-b[Q],Et=[an,un].indexOf(m)!==-1,Mn=(Tt=G?.[_])!=null?Tt:0,z=Et?pe:ye-x[ee]-S[ee]-Mn+L.altAxis,N=Et?ye+x[ee]+S[ee]-Mn-L.altAxis:Ze,I=h&&Et?x4(z,ye,N):va(h?z:pe,ye,h?N:Ze);w[_]=I,U[_]=I-ye}e.modifiersData[r]=U}}const tI={name:"preventOverflow",enabled:!0,phase:"main",fn:eI,requiresIfExists:["offset"]};function nI(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function rI(t){return t===Sn(t)||!Hn(t)?H1(t):nI(t)}function iI(t){var e=t.getBoundingClientRect(),n=fl(e.width)/t.offsetWidth||1,r=fl(e.height)/t.offsetHeight||1;return n!==1||r!==1}function sI(t,e,n){n===void 0&&(n=!1);var r=Hn(e),i=Hn(e)&&iI(e),s=fs(e),o=hl(t,i,n),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(r||!r&&!n)&&((Nr(e)!=="body"||W1(s))&&(l=rI(e)),Hn(e)?(a=hl(e,!0),a.x+=e.clientLeft,a.y+=e.clientTop):s&&(a.x=V1(s))),{x:o.left+l.scrollLeft-a.x,y:o.top+l.scrollTop-a.y,width:o.width,height:o.height}}function oI(t){var e=new Map,n=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function i(s){n.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(l){if(!n.has(l)){var a=e.get(l);a&&i(a)}}),r.push(s)}return t.forEach(function(s){n.has(s.name)||i(s)}),r}function lI(t){var e=oI(t);return E4.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function aI(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function uI(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var wk={placement:"bottom",modifiers:[],strategy:"absolute"};function _k(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function cI(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,s=i===void 0?wk:i;return function(l,a,u){u===void 0&&(u=s);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},wk,s),modifiersData:{},elements:{reference:l,popper:a},attributes:{},styles:{}},d=[],f=!1,h={state:c,setOptions:function(m){var E=typeof m=="function"?m(c.options):m;g(),c.options=Object.assign({},s,c.options,E),c.scrollParents={reference:eo(l)?xa(l):l.contextElement?xa(l.contextElement):[],popper:xa(a)};var k=lI(uI([].concat(r,c.options.modifiers)));return c.orderedModifiers=k.filter(function(y){return y.enabled}),p(),h.update()},forceUpdate:function(){if(!f){var m=c.elements,E=m.reference,k=m.popper;if(_k(E,k)){c.rects={reference:sI(E,Vu(k),c.options.strategy==="fixed"),popper:$1(k)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(L){return c.modifiersData[L.name]=Object.assign({},L.data)});for(var y=0;y<c.orderedModifiers.length;y++){if(c.reset===!0){c.reset=!1,y=-1;continue}var _=c.orderedModifiers[y],w=_.fn,x=_.options,S=x===void 0?{}:x,O=_.name;typeof w=="function"&&(c=w({state:c,options:S,name:O,instance:h})||c)}}}},update:aI(function(){return new Promise(function(b){h.forceUpdate(),b(c)})}),destroy:function(){g(),f=!0}};if(!_k(l,a))return h;h.setOptions(u).then(function(b){!f&&u.onFirstUpdate&&u.onFirstUpdate(b)});function p(){c.orderedModifiers.forEach(function(b){var m=b.name,E=b.options,k=E===void 0?{}:E,y=b.effect;if(typeof y=="function"){var _=y({state:c,name:m,instance:h,options:k}),w=function(){};d.push(_||w)}})}function g(){d.forEach(function(b){return b()}),d=[]}return h}}var dI=[I4,X4,D4,SS,J4,K4,tI,T4,q4],fI=cI({defaultModifiers:dI}),hI="tippy-box",RS="tippy-content",pI="tippy-backdrop",IS="tippy-arrow",LS="tippy-svg-arrow",ks={passive:!0,capture:!0},PS=function(){return document.body};function Fp(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function K1(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function FS(t,e){return typeof t=="function"?t.apply(void 0,e):t}function vk(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function gI(t){return t.split(/\s+/).filter(Boolean)}function xo(t){return[].concat(t)}function xk(t,e){t.indexOf(e)===-1&&t.push(e)}function mI(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function bI(t){return t.split("-")[0]}function ef(t){return[].slice.call(t)}function Sk(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Sa(){return document.createElement("div")}function xh(t){return["Element","Fragment"].some(function(e){return K1(t,e)})}function yI(t){return K1(t,"NodeList")}function EI(t){return K1(t,"MouseEvent")}function kI(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function wI(t){return xh(t)?[t]:yI(t)?ef(t):Array.isArray(t)?t:ef(document.querySelectorAll(t))}function Bp(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function Ck(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function _I(t){var e,n=xo(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function vI(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var s=i.popperRect,o=i.popperState,l=i.props,a=l.interactiveBorder,u=bI(o.placement),c=o.modifiersData.offset;if(!c)return!0;var d=u==="bottom"?c.top.y:0,f=u==="top"?c.bottom.y:0,h=u==="right"?c.left.x:0,p=u==="left"?c.right.x:0,g=s.top-r+d>a,b=r-s.bottom-f>a,m=s.left-n+h>a,E=n-s.right-p>a;return g||b||m||E})}function zp(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function Ak(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var yr={isTouch:!1},Tk=0;function xI(){yr.isTouch||(yr.isTouch=!0,window.performance&&document.addEventListener("mousemove",BS))}function BS(){var t=performance.now();t-Tk<20&&(yr.isTouch=!1,document.removeEventListener("mousemove",BS)),Tk=t}function SI(){var t=document.activeElement;if(kI(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function CI(){document.addEventListener("touchstart",xI,ks),window.addEventListener("blur",SI)}var AI=typeof window<"u"&&typeof document<"u",TI=AI?!!window.msCrypto:!1,NI={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},MI={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},sr=Object.assign({appendTo:PS,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},NI,MI),OI=Object.keys(sr),DI=function(e){var n=Object.keys(e);n.forEach(function(r){sr[r]=e[r]})};function zS(t){var e=t.plugins||[],n=e.reduce(function(r,i){var s=i.name,o=i.defaultValue;if(s){var l;r[s]=t[s]!==void 0?t[s]:(l=sr[s])!=null?l:o}return r},{});return Object.assign({},t,n)}function RI(t,e){var n=e?Object.keys(zS(Object.assign({},sr,{plugins:e}))):OI,r=n.reduce(function(i,s){var o=(t.getAttribute("data-tippy-"+s)||"").trim();if(!o)return i;if(s==="content")i[s]=o;else try{i[s]=JSON.parse(o)}catch{i[s]=o}return i},{});return r}function Nk(t,e){var n=Object.assign({},e,{content:FS(e.content,[t])},e.ignoreAttributes?{}:RI(t,e.plugins));return n.aria=Object.assign({},sr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var II=function(){return"innerHTML"};function Bg(t,e){t[II()]=e}function Mk(t){var e=Sa();return t===!0?e.className=IS:(e.className=LS,xh(t)?e.appendChild(t):Bg(e,t)),e}function Ok(t,e){xh(e.content)?(Bg(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Bg(t,e.content):t.textContent=e.content)}function zg(t){var e=t.firstElementChild,n=ef(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(RS)}),arrow:n.find(function(r){return r.classList.contains(IS)||r.classList.contains(LS)}),backdrop:n.find(function(r){return r.classList.contains(pI)})}}function $S(t){var e=Sa(),n=Sa();n.className=hI,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Sa();r.className=RS,r.setAttribute("data-state","hidden"),Ok(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(s,o){var l=zg(e),a=l.box,u=l.content,c=l.arrow;o.theme?a.setAttribute("data-theme",o.theme):a.removeAttribute("data-theme"),typeof o.animation=="string"?a.setAttribute("data-animation",o.animation):a.removeAttribute("data-animation"),o.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?a.setAttribute("role",o.role):a.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&Ok(u,t.props),o.arrow?c?s.arrow!==o.arrow&&(a.removeChild(c),a.appendChild(Mk(o.arrow))):a.appendChild(Mk(o.arrow)):c&&a.removeChild(c)}return{popper:e,onUpdate:i}}$S.$$tippy=!0;var LI=1,xc=[],$p=[];function PI(t,e){var n=Nk(t,Object.assign({},sr,zS(Sk(e)))),r,i,s,o=!1,l=!1,a=!1,u=!1,c,d,f,h=[],p=vk(Xt,n.interactiveDebounce),g,b=LI++,m=null,E=mI(n.plugins),k={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:b,reference:t,popper:Sa(),popperInstance:m,props:n,state:k,plugins:E,clearDelayTimeouts:z,setProps:N,setContent:I,show:H,hide:re,hideWithInteractivity:ve,enable:Et,disable:Mn,unmount:hn,destroy:$l};if(!n.render)return y;var _=n.render(y),w=_.popper,x=_.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+y.id,y.popper=w,t._tippy=y,w._tippy=y;var S=E.map(function(M){return M.fn(y)}),O=t.hasAttribute("aria-expanded");return Nn(),D(),C(),v("onCreate",[y]),n.showOnCreate&&pe(),w.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),w.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&te().addEventListener("mousemove",p)}),y;function L(){var M=y.props.touch;return Array.isArray(M)?M:[M,0]}function G(){return L()[0]==="hold"}function U(){var M;return!!((M=y.props.render)!=null&&M.$$tippy)}function j(){return g||t}function te(){var M=j().parentNode;return M?_I(M):document}function Z(){return zg(w)}function A(M){return y.state.isMounted&&!y.state.isVisible||yr.isTouch||c&&c.type==="focus"?0:Fp(y.props.delay,M?0:1,sr.delay)}function C(M){M===void 0&&(M=!1),w.style.pointerEvents=y.props.interactive&&!M?"":"none",w.style.zIndex=""+y.props.zIndex}function v(M,q,se){if(se===void 0&&(se=!0),S.forEach(function(me){me[M]&&me[M].apply(me,q)}),se){var we;(we=y.props)[M].apply(we,q)}}function T(){var M=y.props.aria;if(M.content){var q="aria-"+M.content,se=w.id,we=xo(y.props.triggerTarget||t);we.forEach(function(me){var zt=me.getAttribute(q);if(y.state.isVisible)me.setAttribute(q,zt?zt+" "+se:se);else{var On=zt&&zt.replace(se,"").trim();On?me.setAttribute(q,On):me.removeAttribute(q)}})}}function D(){if(!(O||!y.props.aria.expanded)){var M=xo(y.props.triggerTarget||t);M.forEach(function(q){y.props.interactive?q.setAttribute("aria-expanded",y.state.isVisible&&q===j()?"true":"false"):q.removeAttribute("aria-expanded")})}}function B(){te().removeEventListener("mousemove",p),xc=xc.filter(function(M){return M!==p})}function V(M){if(!(yr.isTouch&&(a||M.type==="mousedown"))){var q=M.composedPath&&M.composedPath()[0]||M.target;if(!(y.props.interactive&&Ak(w,q))){if(xo(y.props.triggerTarget||t).some(function(se){return Ak(se,q)})){if(yr.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else v("onClickOutside",[y,M]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),l=!0,setTimeout(function(){l=!1}),y.state.isMounted||ge())}}}function de(){a=!0}function fe(){a=!1}function ie(){var M=te();M.addEventListener("mousedown",V,!0),M.addEventListener("touchend",V,ks),M.addEventListener("touchstart",fe,ks),M.addEventListener("touchmove",de,ks)}function ge(){var M=te();M.removeEventListener("mousedown",V,!0),M.removeEventListener("touchend",V,ks),M.removeEventListener("touchstart",fe,ks),M.removeEventListener("touchmove",de,ks)}function nt(M,q){fn(M,function(){!y.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&q()})}function at(M,q){fn(M,q)}function fn(M,q){var se=Z().box;function we(me){me.target===se&&(zp(se,"remove",we),q())}if(M===0)return q();zp(se,"remove",d),zp(se,"add",we),d=we}function Jt(M,q,se){se===void 0&&(se=!1);var we=xo(y.props.triggerTarget||t);we.forEach(function(me){me.addEventListener(M,q,se),h.push({node:me,eventType:M,handler:q,options:se})})}function Nn(){G()&&(Jt("touchstart",Zt,{passive:!0}),Jt("touchend",Je,{passive:!0})),gI(y.props.trigger).forEach(function(M){if(M!=="manual")switch(Jt(M,Zt),M){case"mouseenter":Jt("mouseleave",Je);break;case"focus":Jt(TI?"focusout":"blur",oe);break;case"focusin":Jt("focusout",oe);break}})}function dr(){h.forEach(function(M){var q=M.node,se=M.eventType,we=M.handler,me=M.options;q.removeEventListener(se,we,me)}),h=[]}function Zt(M){var q,se=!1;if(!(!y.state.isEnabled||Tt(M)||l)){var we=((q=c)==null?void 0:q.type)==="focus";c=M,g=M.currentTarget,D(),!y.state.isVisible&&EI(M)&&xc.forEach(function(me){return me(M)}),M.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||o)&&y.props.hideOnClick!==!1&&y.state.isVisible?se=!0:pe(M),M.type==="click"&&(o=!se),se&&!we&&Ze(M)}}function Xt(M){var q=M.target,se=j().contains(q)||w.contains(q);if(!(M.type==="mousemove"&&se)){var we=ee().concat(w).map(function(me){var zt,On=me._tippy,ho=(zt=On.popperInstance)==null?void 0:zt.state;return ho?{popperRect:me.getBoundingClientRect(),popperState:ho,props:n}:null}).filter(Boolean);vI(we,M)&&(B(),Ze(M))}}function Je(M){var q=Tt(M)||y.props.trigger.indexOf("click")>=0&&o;if(!q){if(y.props.interactive){y.hideWithInteractivity(M);return}Ze(M)}}function oe(M){y.props.trigger.indexOf("focusin")<0&&M.target!==j()||y.props.interactive&&M.relatedTarget&&w.contains(M.relatedTarget)||Ze(M)}function Tt(M){return yr.isTouch?G()!==M.type.indexOf("touch")>=0:!1}function Y(){Q();var M=y.props,q=M.popperOptions,se=M.placement,we=M.offset,me=M.getReferenceClientRect,zt=M.moveTransition,On=U()?zg(w).arrow:null,ho=me?{getBoundingClientRect:me,contextElement:me.contextElement||j()}:t,ny={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Xu){var po=Xu.state;if(U()){var uT=Z(),qh=uT.box;["placement","reference-hidden","escaped"].forEach(function(Qu){Qu==="placement"?qh.setAttribute("data-placement",po.placement):po.attributes.popper["data-popper-"+Qu]?qh.setAttribute("data-"+Qu,""):qh.removeAttribute("data-"+Qu)}),po.attributes.popper={}}}},ms=[{name:"offset",options:{offset:we}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!zt}},ny];U()&&On&&ms.push({name:"arrow",options:{element:On,padding:3}}),ms.push.apply(ms,q?.modifiers||[]),y.popperInstance=fI(ho,w,Object.assign({},q,{placement:se,onFirstUpdate:f,modifiers:ms}))}function Q(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function ye(){var M=y.props.appendTo,q,se=j();y.props.interactive&&M===PS||M==="parent"?q=se.parentNode:q=FS(M,[se]),q.contains(w)||q.appendChild(w),y.state.isMounted=!0,Y()}function ee(){return ef(w.querySelectorAll("[data-tippy-root]"))}function pe(M){y.clearDelayTimeouts(),M&&v("onTrigger",[y,M]),ie();var q=A(!0),se=L(),we=se[0],me=se[1];yr.isTouch&&we==="hold"&&me&&(q=me),q?r=setTimeout(function(){y.show()},q):y.show()}function Ze(M){if(y.clearDelayTimeouts(),v("onUntrigger",[y,M]),!y.state.isVisible){ge();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(M.type)>=0&&o)){var q=A(!1);q?i=setTimeout(function(){y.state.isVisible&&y.hide()},q):s=requestAnimationFrame(function(){y.hide()})}}function Et(){y.state.isEnabled=!0}function Mn(){y.hide(),y.state.isEnabled=!1}function z(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(s)}function N(M){if(!y.state.isDestroyed){v("onBeforeUpdate",[y,M]),dr();var q=y.props,se=Nk(t,Object.assign({},q,Sk(M),{ignoreAttributes:!0}));y.props=se,Nn(),q.interactiveDebounce!==se.interactiveDebounce&&(B(),p=vk(Xt,se.interactiveDebounce)),q.triggerTarget&&!se.triggerTarget?xo(q.triggerTarget).forEach(function(we){we.removeAttribute("aria-expanded")}):se.triggerTarget&&t.removeAttribute("aria-expanded"),D(),C(),x&&x(q,se),y.popperInstance&&(Y(),ee().forEach(function(we){requestAnimationFrame(we._tippy.popperInstance.forceUpdate)})),v("onAfterUpdate",[y,M])}}function I(M){y.setProps({content:M})}function H(){var M=y.state.isVisible,q=y.state.isDestroyed,se=!y.state.isEnabled,we=yr.isTouch&&!y.props.touch,me=Fp(y.props.duration,0,sr.duration);if(!(M||q||se||we)&&!j().hasAttribute("disabled")&&(v("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,U()&&(w.style.visibility="visible"),C(),ie(),y.state.isMounted||(w.style.transition="none"),U()){var zt=Z(),On=zt.box,ho=zt.content;Bp([On,ho],0)}f=function(){var ms;if(!(!y.state.isVisible||u)){if(u=!0,w.offsetHeight,w.style.transition=y.props.moveTransition,U()&&y.props.animation){var jh=Z(),Xu=jh.box,po=jh.content;Bp([Xu,po],me),Ck([Xu,po],"visible")}T(),D(),xk($p,y),(ms=y.popperInstance)==null||ms.forceUpdate(),v("onMount",[y]),y.props.animation&&U()&&at(me,function(){y.state.isShown=!0,v("onShown",[y])})}},ye()}}function re(){var M=!y.state.isVisible,q=y.state.isDestroyed,se=!y.state.isEnabled,we=Fp(y.props.duration,1,sr.duration);if(!(M||q||se)&&(v("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,u=!1,o=!1,U()&&(w.style.visibility="hidden"),B(),ge(),C(!0),U()){var me=Z(),zt=me.box,On=me.content;y.props.animation&&(Bp([zt,On],we),Ck([zt,On],"hidden"))}T(),D(),y.props.animation?U()&&nt(we,y.unmount):y.unmount()}}function ve(M){te().addEventListener("mousemove",p),xk(xc,p),p(M)}function hn(){y.state.isVisible&&y.hide(),y.state.isMounted&&(Q(),ee().forEach(function(M){M._tippy.unmount()}),w.parentNode&&w.parentNode.removeChild(w),$p=$p.filter(function(M){return M!==y}),y.state.isMounted=!1,v("onHidden",[y]))}function $l(){y.state.isDestroyed||(y.clearDelayTimeouts(),y.unmount(),dr(),delete t._tippy,y.state.isDestroyed=!0,v("onDestroy",[y]))}}function Wu(t,e){e===void 0&&(e={});var n=sr.plugins.concat(e.plugins||[]);CI();var r=Object.assign({},e,{plugins:n}),i=wI(t),s=i.reduce(function(o,l){var a=l&&PI(l,r);return a&&o.push(a),o},[]);return xh(t)?s[0]:s}Wu.defaultProps=sr;Wu.setDefaultProps=DI;Wu.currentInput=yr;Object.assign({},SS,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});Wu.setDefaultProps({render:$S});class FI{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:s=250,shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:l,state:a,from:u,to:c})=>{const{doc:d,selection:f}=a,{empty:h}=f,p=!d.textBetween(u,c).length&&L1(a.selection),g=this.element.contains(document.activeElement);return!(!(l.hasFocus()||g)||h||p||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var a;if(this.preventHide){this.preventHide=!1;return}l?.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(l.relatedTarget))||l?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,a)=>{const u=!a?.selection.eq(l.state.selection),c=!a?.doc.eq(l.state.doc);!u&&!c||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,u,c,a)},this.updateDelay))},this.updateHandler=(l,a,u,c)=>{var d,f,h;const{state:p,composing:g}=l,{selection:b}=p;if(g||!a&&!u)return;this.createTooltip();const{ranges:E}=b,k=Math.min(...E.map(w=>w.$from.pos)),y=Math.max(...E.map(w=>w.$to.pos));if(!((d=this.shouldShow)===null||d===void 0?void 0:d.call(this,{editor:this.editor,element:this.element,view:l,state:p,oldState:c,from:k,to:y}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((h=this.tippyOptions)===null||h===void 0?void 0:h.getReferenceClientRect)||(()=>{if(hS(p.selection)){let w=l.nodeDOM(k);if(w){const x=w.dataset.nodeViewWrapper?w:w.querySelector("[data-node-view-wrapper]");if(x&&(w=x.firstChild),w)return w.getBoundingClientRect()}}return IR(l,k,y)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=s,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.element.tabIndex=0,!(this.tippy||!n)&&(this.tippy=Wu(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}const s=!n?.selection.eq(e.state.selection),o=!n?.doc.eq(e.state.doc);this.updateHandler(e,s,o,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const US=t=>new Ae({key:typeof t.pluginKey=="string"?new Le(t.pluginKey):t.pluginKey,view:e=>new FI({view:e,...t})});et.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[US({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});function BI(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var HS={exports:{}},Up={};/**
|
|
113
|
+
* @license React
|
|
114
|
+
* use-sync-external-store-shim.production.min.js
|
|
115
|
+
*
|
|
116
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the MIT license found in the
|
|
119
|
+
* LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/var Dk;function zI(){if(Dk)return Up;Dk=1;var t=je;function e(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,o=t.useDebugValue;function l(d,f){var h=f(),p=r({inst:{value:h,getSnapshot:f}}),g=p[0].inst,b=p[1];return s(function(){g.value=h,g.getSnapshot=f,a(g)&&b({inst:g})},[d,h,f]),i(function(){return a(g)&&b({inst:g}),d(function(){a(g)&&b({inst:g})})},[d]),o(h),h}function a(d){var f=d.getSnapshot;d=d.value;try{var h=f();return!n(d,h)}catch{return!0}}function u(d,f){return f()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:l;return Up.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:c,Up}HS.exports=zI();var j1=HS.exports;const $I=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},UI=({contentComponent:t})=>{const e=j1.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return je.createElement(je.Fragment,null,Object.values(e))};function HI(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:pM.createPortal(r.reactElement,r.element,n)},t.forEach(i=>i())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(i=>i())}}}class VI extends je.Component{constructor(e){var n;super(e),this.editorContentRef=je.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=e.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=HI(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return je.createElement(je.Fragment,null,je.createElement("div",{ref:$I(n,this.editorContentRef),...r}),e?.contentComponent&&je.createElement(UI,{contentComponent:e.contentComponent}))}}const WI=Ge.forwardRef((t,e)=>{const n=je.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return je.createElement(VI,{key:n,innerRef:e,...t})}),KI=je.memo(WI);var jI=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;for(i of e.entries())if(!t(i[1],n.get(i[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(e[i]!==n[i])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!(o==="_owner"&&e.$$typeof)&&!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n},qI=BI(jI),VS={exports:{}},Hp={};/**
|
|
121
|
+
* @license React
|
|
122
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
123
|
+
*
|
|
124
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the MIT license found in the
|
|
127
|
+
* LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/var Rk;function GI(){if(Rk)return Hp;Rk=1;var t=je,e=j1;function n(u,c){return u===c&&(u!==0||1/u===1/c)||u!==u&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,l=t.useMemo,a=t.useDebugValue;return Hp.useSyncExternalStoreWithSelector=function(u,c,d,f,h){var p=s(null);if(p.current===null){var g={hasValue:!1,value:null};p.current=g}else g=p.current;p=l(function(){function m(w){if(!E){if(E=!0,k=w,w=f(w),h!==void 0&&g.hasValue){var x=g.value;if(h(x,w))return y=x}return y=w}if(x=y,r(k,w))return x;var S=f(w);return h!==void 0&&h(x,S)?x:(k=w,y=S)}var E=!1,k,y,_=d===void 0?null:d;return[function(){return m(c())},_===null?void 0:function(){return m(_())}]},[c,d,f,h]);var b=i(u,p[0],p[1]);return o(function(){g.hasValue=!0,g.value=b},[b]),a(b),b},Hp}VS.exports=GI();var YI=VS.exports;const JI=typeof window<"u"?Ge.useLayoutEffect:Ge.useEffect;class ZI{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function XI(t){var e;const[n]=Ge.useState(()=>new ZI(t.editor)),r=YI.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:qI);return JI(()=>n.watch(t.editor),[t.editor,n]),Ge.useDebugValue(r),r}const QI=!1,$g=typeof window>"u",e8=$g||!!(typeof window<"u"&&window.next);class q1{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?$g||e8?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)===null||s===void 0?void 0:s.call(i,...r)},onBlur:(...r)=>{var i,s;return(s=(i=this.options.current).onBlur)===null||s===void 0?void 0:s.call(i,...r)},onCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onCreate)===null||s===void 0?void 0:s.call(i,...r)},onDestroy:(...r)=>{var i,s;return(s=(i=this.options.current).onDestroy)===null||s===void 0?void 0:s.call(i,...r)},onFocus:(...r)=>{var i,s;return(s=(i=this.options.current).onFocus)===null||s===void 0?void 0:s.call(i,...r)},onSelectionUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)===null||s===void 0?void 0:s.call(i,...r)},onTransaction:(...r)=>{var i,s;return(s=(i=this.options.current).onTransaction)===null||s===void 0?void 0:s.call(i,...r)},onUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onUpdate)===null||s===void 0?void 0:s.call(i,...r)},onContentError:(...r)=>{var i,s;return(s=(i=this.options.current).onContentError)===null||s===void 0?void 0:s.call(i,...r)},onDrop:(...r)=>{var i,s;return(s=(i=this.options.current).onDrop)===null||s===void 0?void 0:s.call(i,...r)},onPaste:(...r)=>{var i,s;return(s=(i=this.options.current).onPaste)===null||s===void 0?void 0:s.call(i,...r)}};return new r4(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((i,s)=>{var o;return i===((o=n.extensions)===null||o===void 0?void 0:o[s])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?q1.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function t8(t={},e=[]){const n=Ge.useRef(t);n.current=t;const[r]=Ge.useState(()=>new q1(n)),i=j1.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return Ge.useDebugValue(i),Ge.useEffect(r.onRender(e)),XI({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&s===0?0:s+1}),i}const G1=Ge.createContext({editor:null}),n8=G1.Consumer,r8=()=>Ge.useContext(G1);function eW({children:t,slotAfter:e,slotBefore:n,editorContainerProps:r={},...i}){const s=t8(i);return s?je.createElement(G1.Provider,{value:{editor:s}},n,je.createElement(n8,null,({editor:o})=>je.createElement(KI,{editor:o,...r})),t,e):null}const tW=t=>{const[e,n]=Ge.useState(null),{editor:r}=r8();return Ge.useEffect(()=>{var i;if(!e||!((i=t.editor)===null||i===void 0)&&i.isDestroyed||r?.isDestroyed)return;const{pluginKey:s="bubbleMenu",editor:o,tippyOptions:l={},updateDelay:a,shouldShow:u=null}=t,c=o||r;if(!c){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const d=US({updateDelay:a,editor:c,element:e,pluginKey:s,shouldShow:u,tippyOptions:l});return c.registerPlugin(d),()=>{c.unregisterPlugin(s)}},[t.editor,r,e]),je.createElement("div",{ref:n,className:t.className,style:{visibility:"hidden"}},t.children)},WS=Ge.createContext({onDragStart:void 0}),i8=()=>Ge.useContext(WS),nW=je.forwardRef((t,e)=>{const{onDragStart:n}=i8(),r=t.as||"div";return je.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function Ik(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function Lk(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.forward_ref)"||t.$$typeof.description==="react.forward_ref"))}function s8(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.memo)"||t.$$typeof.description==="react.memo"))}function o8(t){if(Ik(t)||Lk(t))return!0;if(s8(t)){const e=t.type;if(e)return Ik(e)||Lk(e)}return!1}function l8(){try{if(Ge.version)return parseInt(Ge.version.split(".")[0],10)>=19}catch{}return!1}class a8{constructor(e,{editor:n,props:r={},as:i="div",className:s=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),s&&this.element.classList.add(...s.split(" ")),this.editor.isInitialized?Nx.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.render()})}render(){var e;const n=this.component,r=this.props,i=this.editor,s=l8(),o=o8(n),l={...r};l.ref&&!(s||o)&&delete l.ref,!l.ref&&(s||o)&&(l.ref=a=>{this.ref=a}),this.reactElement=je.createElement(n,{...l}),(e=i?.contentComponent)===null||e===void 0||e.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;const n=this.editor;(e=n?.contentComponent)===null||e===void 0||e.removeRenderer(this.id)}updateAttributes(e){Object.keys(e).forEach(n=>{this.element.setAttribute(n,e[n])})}}class u8 extends i4{constructor(e,n,r){if(super(e,n,r),!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const i=this.dom.querySelector("[data-node-view-content]");if(!i)return;i.appendChild(this.contentDOMElement)}}mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(u={})=>this.updateAttributes(u),deleteNode:()=>this.deleteNode(),ref:Ge.createRef()};if(!this.component.displayName){const u=c=>c.charAt(0).toUpperCase()+c.substring(1);this.component.displayName=u(this.extension.name)}const i={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:u=>{u&&this.contentDOMElement&&u.firstChild!==this.contentDOMElement&&(u.hasAttribute("data-node-view-wrapper")&&u.removeAttribute("data-node-view-wrapper"),u.appendChild(this.contentDOMElement))}},s=this.component,o=Ge.memo(u=>je.createElement(WS.Provider,{value:i},Ge.createElement(s,u)));o.displayName="ReactNodeView";let l=this.node.isInline?"span":"div";this.options.as&&(l=this.options.as);const{className:a=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new a8(o,{editor:this.editor,props:e,as:l,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!((e=this.renderer.element.firstElementChild)===null||e===void 0)&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:e,to:n}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(e<=r&&n>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n,r){const i=s=>{this.renderer.updateProps(s),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const s=this.node,o=this.decorations,l=this.innerDecorations;return this.node=e,this.decorations=n,this.innerDecorations=r,this.options.update({oldNode:s,oldDecorations:o,newNode:e,newDecorations:n,oldInnerDecorations:l,innerDecorations:r,updateProps:()=>i({node:e,decorations:n,innerDecorations:r})})}return e===this.node&&this.decorations===n&&this.innerDecorations===r||(this.node=e,this.decorations=n,this.innerDecorations=r,i({node:e,decorations:n,innerDecorations:r})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs=="function"){const n=this.editor.extensionManager.attributes,r=Zd(this.node,n);e=this.options.attrs({node:this.node,HTMLAttributes:r})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}}function rW(t,e){return n=>n.editor.contentComponent?new u8(t,n,e):{}}const c8=t=>{if(!t.children.length)return;const e=t.querySelectorAll("span");e&&e.forEach(n=>{var r,i;const s=n.getAttribute("style"),o=(i=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");n.setAttribute("style",`${o};${s}`)})},iW=jn.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&c8(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(s=>!!s))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),sW=et.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),d8=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,f8=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,oW=jn.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Qs({find:d8,type:this.type})]},addPasteRules(){return[Qi({find:f8,type:this.type})]}}),h8=Ke.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Ce(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!s4(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$from:r,$to:i}=n,s=t();return r.parentOffset===0?s.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):hS(n)?s.insertContentAt(i.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:o,dispatch:l})=>{var a;if(l){const{$to:u}=o.selection,c=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?o.setSelection(X.create(o.doc,u.pos+1)):u.nodeAfter.isBlock?o.setSelection(J.create(o.doc,u.pos)):o.setSelection(X.create(o.doc,u.pos));else{const d=(a=u.parent.type.contentMatch.defaultType)===null||a===void 0?void 0:a.create();d&&(o.insert(c,d),o.setSelection(X.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[_S({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),p8=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,lW=Ke.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Ce(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[_S({find:p8,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),g8="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",m8="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Ug="numeric",Hg="ascii",Vg="alpha",Ca="asciinumeric",la="alphanumeric",Wg="domain",KS="emoji",b8="scheme",y8="slashscheme",Vp="whitespace";function E8(t,e){return t in e||(e[t]=[]),e[t]}function Ns(t,e,n){e[Ug]&&(e[Ca]=!0,e[la]=!0),e[Hg]&&(e[Ca]=!0,e[Vg]=!0),e[Ca]&&(e[la]=!0),e[Vg]&&(e[la]=!0),e[la]&&(e[Wg]=!0),e[KS]&&(e[Wg]=!0);for(const r in e){const i=E8(r,n);i.indexOf(t)<0&&i.push(t)}}function k8(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function en(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}en.groups={};en.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],s=e.jr[r][1];if(s&&i.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){r=r||en.groups;let i;return e&&e.j?i=e:(i=new en(e),n&&r&&Ns(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const s=t.length;if(!s)return i;for(let o=0;o<s-1;o++)i=i.tt(t[o]);return i.tt(t[s-1],e,n,r)},tt(t,e,n,r){r=r||en.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const s=e;let o,l=i.go(t);if(l?(o=new en,Object.assign(o.j,l.j),o.jr.push.apply(o.jr,l.jr),o.jd=l.jd,o.t=l.t):o=new en,s){if(r)if(o.t&&typeof o.t=="string"){const a=Object.assign(k8(o.t,r),n);Ns(s,a,r)}else n&&Ns(s,n,r);o.t=s}return i.j[t]=o,o}};const he=(t,e,n,r,i)=>t.ta(e,n,r,i),$e=(t,e,n,r,i)=>t.tr(e,n,r,i),Pk=(t,e,n,r,i)=>t.ts(e,n,r,i),P=(t,e,n,r,i)=>t.tt(e,n,r,i),zr="WORD",Kg="UWORD",jS="ASCIINUMERICAL",qS="ALPHANUMERICAL",uu="LOCALHOST",jg="TLD",qg="UTLD",sd="SCHEME",So="SLASH_SCHEME",Y1="NUM",Gg="WS",J1="NL",Aa="OPENBRACE",Ta="CLOSEBRACE",tf="OPENBRACKET",nf="CLOSEBRACKET",rf="OPENPAREN",sf="CLOSEPAREN",of="OPENANGLEBRACKET",lf="CLOSEANGLEBRACKET",af="FULLWIDTHLEFTPAREN",uf="FULLWIDTHRIGHTPAREN",cf="LEFTCORNERBRACKET",df="RIGHTCORNERBRACKET",ff="LEFTWHITECORNERBRACKET",hf="RIGHTWHITECORNERBRACKET",pf="FULLWIDTHLESSTHAN",gf="FULLWIDTHGREATERTHAN",mf="AMPERSAND",bf="APOSTROPHE",yf="ASTERISK",bi="AT",Ef="BACKSLASH",kf="BACKTICK",wf="CARET",vi="COLON",Z1="COMMA",_f="DOLLAR",mr="DOT",vf="EQUALS",X1="EXCLAMATION",Rn="HYPHEN",Na="PERCENT",xf="PIPE",Sf="PLUS",Cf="POUND",Ma="QUERY",Q1="QUOTE",GS="FULLWIDTHMIDDLEDOT",eb="SEMI",br="SLASH",Oa="TILDE",Af="UNDERSCORE",YS="EMOJI",Tf="SYM";var JS=Object.freeze({__proto__:null,ALPHANUMERICAL:qS,AMPERSAND:mf,APOSTROPHE:bf,ASCIINUMERICAL:jS,ASTERISK:yf,AT:bi,BACKSLASH:Ef,BACKTICK:kf,CARET:wf,CLOSEANGLEBRACKET:lf,CLOSEBRACE:Ta,CLOSEBRACKET:nf,CLOSEPAREN:sf,COLON:vi,COMMA:Z1,DOLLAR:_f,DOT:mr,EMOJI:YS,EQUALS:vf,EXCLAMATION:X1,FULLWIDTHGREATERTHAN:gf,FULLWIDTHLEFTPAREN:af,FULLWIDTHLESSTHAN:pf,FULLWIDTHMIDDLEDOT:GS,FULLWIDTHRIGHTPAREN:uf,HYPHEN:Rn,LEFTCORNERBRACKET:cf,LEFTWHITECORNERBRACKET:ff,LOCALHOST:uu,NL:J1,NUM:Y1,OPENANGLEBRACKET:of,OPENBRACE:Aa,OPENBRACKET:tf,OPENPAREN:rf,PERCENT:Na,PIPE:xf,PLUS:Sf,POUND:Cf,QUERY:Ma,QUOTE:Q1,RIGHTCORNERBRACKET:df,RIGHTWHITECORNERBRACKET:hf,SCHEME:sd,SEMI:eb,SLASH:br,SLASH_SCHEME:So,SYM:Tf,TILDE:Oa,TLD:jg,UNDERSCORE:Af,UTLD:qg,UWORD:Kg,WORD:zr,WS:Gg});const Pr=/[a-z]/,Zl=/\p{L}/u,Wp=/\p{Emoji}/u,Fr=/\d/,Kp=/\s/,Fk="\r",jp=`
|
|
129
|
+
`,w8="️",_8="",qp="";let Sc=null,Cc=null;function v8(t=[]){const e={};en.groups=e;const n=new en;Sc==null&&(Sc=Bk(g8)),Cc==null&&(Cc=Bk(m8)),P(n,"'",bf),P(n,"{",Aa),P(n,"}",Ta),P(n,"[",tf),P(n,"]",nf),P(n,"(",rf),P(n,")",sf),P(n,"<",of),P(n,">",lf),P(n,"(",af),P(n,")",uf),P(n,"「",cf),P(n,"」",df),P(n,"『",ff),P(n,"』",hf),P(n,"<",pf),P(n,">",gf),P(n,"&",mf),P(n,"*",yf),P(n,"@",bi),P(n,"`",kf),P(n,"^",wf),P(n,":",vi),P(n,",",Z1),P(n,"$",_f),P(n,".",mr),P(n,"=",vf),P(n,"!",X1),P(n,"-",Rn),P(n,"%",Na),P(n,"|",xf),P(n,"+",Sf),P(n,"#",Cf),P(n,"?",Ma),P(n,'"',Q1),P(n,"/",br),P(n,";",eb),P(n,"~",Oa),P(n,"_",Af),P(n,"\\",Ef),P(n,"・",GS);const r=$e(n,Fr,Y1,{[Ug]:!0});$e(r,Fr,r);const i=$e(r,Pr,jS,{[Ca]:!0}),s=$e(r,Zl,qS,{[la]:!0}),o=$e(n,Pr,zr,{[Hg]:!0});$e(o,Fr,i),$e(o,Pr,o),$e(i,Fr,i),$e(i,Pr,i);const l=$e(n,Zl,Kg,{[Vg]:!0});$e(l,Pr),$e(l,Fr,s),$e(l,Zl,l),$e(s,Fr,s),$e(s,Pr),$e(s,Zl,s);const a=P(n,jp,J1,{[Vp]:!0}),u=P(n,Fk,Gg,{[Vp]:!0}),c=$e(n,Kp,Gg,{[Vp]:!0});P(n,qp,c),P(u,jp,a),P(u,qp,c),$e(u,Kp,c),P(c,Fk),P(c,jp),$e(c,Kp,c),P(c,qp,c);const d=$e(n,Wp,YS,{[KS]:!0});P(d,"#"),$e(d,Wp,d),P(d,w8,d);const f=P(d,_8);P(f,"#"),$e(f,Wp,d);const h=[[Pr,o],[Fr,i]],p=[[Pr,null],[Zl,l],[Fr,s]];for(let g=0;g<Sc.length;g++)di(n,Sc[g],jg,zr,h);for(let g=0;g<Cc.length;g++)di(n,Cc[g],qg,Kg,p);Ns(jg,{tld:!0,ascii:!0},e),Ns(qg,{utld:!0,alpha:!0},e),di(n,"file",sd,zr,h),di(n,"mailto",sd,zr,h),di(n,"http",So,zr,h),di(n,"https",So,zr,h),di(n,"ftp",So,zr,h),di(n,"ftps",So,zr,h),Ns(sd,{scheme:!0,ascii:!0},e),Ns(So,{slashscheme:!0,ascii:!0},e),t=t.sort((g,b)=>g[0]>b[0]?1:-1);for(let g=0;g<t.length;g++){const b=t[g][0],E=t[g][1]?{[b8]:!0}:{[y8]:!0};b.indexOf("-")>=0?E[Wg]=!0:Pr.test(b)?Fr.test(b)?E[Ca]=!0:E[Hg]=!0:E[Ug]=!0,Pk(n,b,b,E)}return Pk(n,"localhost",uu,{ascii:!0}),n.jd=new en(Tf),{start:n,tokens:Object.assign({groups:e},JS)}}function ZS(t,e){const n=x8(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[];let s=0,o=0;for(;o<r;){let l=t,a=null,u=0,c=null,d=-1,f=-1;for(;o<r&&(a=l.go(n[o]));)l=a,l.accepts()?(d=0,f=0,c=l):d>=0&&(d+=n[o].length,f++),u+=n[o].length,s+=n[o].length,o++;s-=d,o-=f,u-=d,i.push({t:c.t,v:e.slice(s-u,s),s:s-u,e:s})}return i}function x8(t){const e=[],n=t.length;let r=0;for(;r<n;){let i=t.charCodeAt(r),s,o=i<55296||i>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function di(t,e,n,r,i){let s;const o=e.length;for(let l=0;l<o-1;l++){const a=e[l];t.j[a]?s=t.j[a]:(s=new en(r),s.jr=i.slice(),t.j[a]=s),t=s}return s=new en(n),s.jr=i.slice(),t.j[e[o-1]]=s,s}function Bk(t){const e=[],n=[];let r=0,i="0123456789";for(;r<t.length;){let s=0;for(;i.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let o=parseInt(t.substring(r,r+s),10);o>0;o--)n.pop();r+=s}else n.push(t[r]),r++}return e}const cu={defaultProtocol:"http",events:null,format:zk,formatHref:zk,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function tb(t,e=null){let n=Object.assign({},cu);t&&(n=Object.assign(n,t instanceof tb?t.o:t));const r=n.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}tb.prototype={o:cu,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:cu[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function zk(t){return t}function XS(t,e){this.t="token",this.v=t,this.tk=e}XS.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=cu.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),s=this.toFormattedString(t),o={},l=t.get("className",n,e),a=t.get("target",n,e),u=t.get("rel",n,e),c=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return o.href=r,l&&(o.class=l),a&&(o.target=a),u&&(o.rel=u),c&&Object.assign(o,c),{tagName:i,attributes:o,content:s,eventListeners:d}}};function Sh(t,e){class n extends XS{constructor(i,s){super(i,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const $k=Sh("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Uk=Sh("text"),S8=Sh("nl"),Ac=Sh("url",{isLink:!0,toHref(t=cu.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==uu&&t[1].t===vi}}),Dn=t=>new en(t);function C8({groups:t}){const e=t.domain.concat([mf,yf,bi,Ef,kf,wf,_f,vf,Rn,Y1,Na,xf,Sf,Cf,br,Tf,Oa,Af]),n=[bf,vi,Z1,mr,X1,Na,Ma,Q1,eb,of,lf,Aa,Ta,nf,tf,rf,sf,af,uf,cf,df,ff,hf,pf,gf],r=[mf,bf,yf,Ef,kf,wf,_f,vf,Rn,Aa,Ta,Na,xf,Sf,Cf,Ma,br,Tf,Oa,Af],i=Dn(),s=P(i,Oa);he(s,r,s),he(s,t.domain,s);const o=Dn(),l=Dn(),a=Dn();he(i,t.domain,o),he(i,t.scheme,l),he(i,t.slashscheme,a),he(o,r,s),he(o,t.domain,o);const u=P(o,bi);P(s,bi,u),P(l,bi,u),P(a,bi,u);const c=P(s,mr);he(c,r,s),he(c,t.domain,s);const d=Dn();he(u,t.domain,d),he(d,t.domain,d);const f=P(d,mr);he(f,t.domain,d);const h=Dn($k);he(f,t.tld,h),he(f,t.utld,h),P(u,uu,h);const p=P(d,Rn);P(p,Rn,p),he(p,t.domain,d),he(h,t.domain,d),P(h,mr,f),P(h,Rn,p);const g=P(h,vi);he(g,t.numeric,$k);const b=P(o,Rn),m=P(o,mr);P(b,Rn,b),he(b,t.domain,o),he(m,r,s),he(m,t.domain,o);const E=Dn(Ac);he(m,t.tld,E),he(m,t.utld,E),he(E,t.domain,o),he(E,r,s),P(E,mr,m),P(E,Rn,b),P(E,bi,u);const k=P(E,vi),y=Dn(Ac);he(k,t.numeric,y);const _=Dn(Ac),w=Dn();he(_,e,_),he(_,n,w),he(w,e,_),he(w,n,w),P(E,br,_),P(y,br,_);const x=P(l,vi),S=P(a,vi),O=P(S,br),L=P(O,br);he(l,t.domain,o),P(l,mr,m),P(l,Rn,b),he(a,t.domain,o),P(a,mr,m),P(a,Rn,b),he(x,t.domain,_),P(x,br,_),P(x,Ma,_),he(L,t.domain,_),he(L,e,_),P(L,br,_);const G=[[Aa,Ta],[tf,nf],[rf,sf],[of,lf],[af,uf],[cf,df],[ff,hf],[pf,gf]];for(let U=0;U<G.length;U++){const[j,te]=G[U],Z=P(_,j);P(w,j,Z),P(Z,te,_);const A=Dn(Ac);he(Z,e,A);const C=Dn();he(Z,n),he(A,e,A),he(A,n,C),he(C,e,A),he(C,n,C),P(A,te,_),P(C,te,_)}return P(i,uu,E),P(i,J1,S8),{start:i,tokens:JS}}function A8(t,e,n){let r=n.length,i=0,s=[],o=[];for(;i<r;){let l=t,a=null,u=null,c=0,d=null,f=-1;for(;i<r&&!(a=l.go(n[i].t));)o.push(n[i++]);for(;i<r&&(u=a||l.go(n[i].t));)a=null,l=u,l.accepts()?(f=0,d=l):f>=0&&f++,i++,c++;if(f<0)i-=c,i<r&&(o.push(n[i]),i++);else{o.length>0&&(s.push(Gp(Uk,e,o)),o=[]),i-=f,c-=f;const h=d.t,p=n.slice(i-c,i);s.push(Gp(h,e,p))}}return o.length>0&&s.push(Gp(Uk,e,o)),s}function Gp(t,e,n){const r=n[0].s,i=n[n.length-1].e,s=e.slice(r,i);return new t(s,n)}const T8=typeof console<"u"&&console&&console.warn||(()=>{}),N8="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Re={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function M8(){return en.groups={},Re.scanner=null,Re.parser=null,Re.tokenQueue=[],Re.pluginQueue=[],Re.customSchemes=[],Re.initialized=!1,Re}function Hk(t,e=!1){if(Re.initialized&&T8(`linkifyjs: already initialized - will not register custom scheme "${t}" ${N8}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
130
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
131
|
+
2. Cannot start or end with "-"
|
|
132
|
+
3. "-" cannot repeat`);Re.customSchemes.push([t,e])}function O8(){Re.scanner=v8(Re.customSchemes);for(let t=0;t<Re.tokenQueue.length;t++)Re.tokenQueue[t][1]({scanner:Re.scanner});Re.parser=C8(Re.scanner.tokens);for(let t=0;t<Re.pluginQueue.length;t++)Re.pluginQueue[t][1]({scanner:Re.scanner,parser:Re.parser});return Re.initialized=!0,Re}function nb(t){return Re.initialized||O8(),A8(Re.parser.start,t,ZS(Re.scanner.start,t))}nb.scan=ZS;function QS(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new tb(n),i=nb(t),s=[];for(let o=0;o<i.length;o++){const l=i[o];l.isLink&&(!e||l.t===e)&&r.check(l)&&s.push(l.toFormattedObject(r))}return s}const rb="[\0- -\u2029 ]",D8=new RegExp(rb),R8=new RegExp(`${rb}$`),I8=new RegExp(rb,"g");function L8(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function P8(t){return new Ae({key:new Le("autolink"),appendTransaction:(e,n,r)=>{const i=e.some(u=>u.docChanged)&&!n.doc.eq(r.doc),s=e.some(u=>u.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=r,l=SR(n.doc,[...e]);if(DR(l).forEach(({newRange:u})=>{const c=AR(r.doc,u,h=>h.isTextblock);let d,f;if(c.length>1)d=c[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(c.length){const h=r.doc.textBetween(u.from,u.to," "," ");if(!R8.test(h))return;d=c[0],f=r.doc.textBetween(d.pos,u.to,void 0," ")}if(d&&f){const h=f.split(D8).filter(Boolean);if(h.length<=0)return!1;const p=h[h.length-1],g=d.pos+f.lastIndexOf(p);if(!p)return!1;const b=nb(p).map(m=>m.toObject(t.defaultProtocol));if(!L8(b))return!1;b.filter(m=>m.isLink).map(m=>({...m,from:g+m.start+1,to:g+m.end+1})).filter(m=>r.schema.marks.code?!r.doc.rangeHasMark(m.from,m.to,r.schema.marks.code):!0).filter(m=>t.validate(m.value)).filter(m=>t.shouldAutoLink(m.value)).forEach(m=>{F1(m.from,m.to,r.doc).some(E=>E.mark.type===t.type)||o.addMark(m.from,m.to,t.type.create({href:m.href}))})}}),!!o.steps.length)return o}})}function F8(t){return new Ae({key:new Le("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,s;if(r.button!==0||!e.editable)return!1;let o=r.target;const l=[];for(;o.nodeName!=="DIV";)l.push(o),o=o.parentNode;if(!l.find(f=>f.nodeName==="A"))return!1;const a=fS(e.state,t.type.name),u=r.target,c=(i=u?.href)!==null&&i!==void 0?i:a.href,d=(s=u?.target)!==null&&s!==void 0?s:a.target;return u&&c?(window.open(c,d),!0):!1}}})}function B8(t){return new Ae({key:new Le("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:i}=e,{selection:s}=i,{empty:o}=s;if(o)return!1;let l="";r.content.forEach(u=>{l+=u.textContent});const a=QS(l,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===l);return!l||!a?!1:t.editor.commands.setMark(t.type,{href:a.href})}}})}function bs(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(I8,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const aW=jn.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){Hk(t);return}Hk(t.scheme,t.optionalSlashes)})},onDestroy(){M8()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!bs(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!bs(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!bs(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Ce(this.options.HTMLAttributes,t),0]:["a",Ce(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!bs(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!bs(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Qi({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,i=QS(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:o=>!!bs(o,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(s=>e.push({text:s.value,data:{href:s.href},index:s.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(P8({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!bs(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(F8({type:this.type})),this.options.linkOnPaste&&t.push(B8({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),uW=et.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Ae({key:new Le("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;const s=this.editor.isEmpty;return t.descendants((o,l)=>{const a=r>=l&&r<=l+o.nodeSize,u=!o.isLeaf&&_h(o);if((a||!this.options.showOnlyCurrent)&&u){const c=[this.options.emptyNodeClass];s&&c.push(this.options.emptyEditorClass);const d=ot.node(l,l+o.nodeSize,{class:c.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:l,hasAnchor:a}):this.options.placeholder});i.push(d)}return this.options.includeChildren}),Te.create(t,i)}}})]}}),z8=/^\s*(\[([( |x])?\])\s$/,cW=Ke.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Ce(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),o=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div"),u=()=>{var c,d;l.ariaLabel=((d=(c=this.options.a11y)===null||c===void 0?void 0:c.checkboxLabel)===null||d===void 0?void 0:d.call(c,t,l.checked))||`Task item checkbox for ${t.textContent||"empty task item"}`};return u(),s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",c=>c.preventDefault()),l.addEventListener("change",c=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:d}=c.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{const h=n();if(typeof h!="number")return!1;const p=f.doc.nodeAt(h);return f.setNodeMarkup(h,void 0,{...p?.attrs,checked:d}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,d)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([c,d])=>{i.setAttribute(c,d)}),i.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,s.append(l,o),i.append(s,a),Object.entries(e).forEach(([c,d])=>{i.setAttribute(c,d)}),{dom:i,contentDOM:a,update:c=>c.type!==this.type?!1:(i.dataset.checked=c.attrs.checked,l.checked=c.attrs.checked,u(),!0)}}},addInputRules(){return[cl({find:z8,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),dW=Ke.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Ce(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),fW=jn.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),$8=/^\s*>\s$/,U8=Ke.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[cl({find:$8,type:this.type})]}}),H8=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,V8=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,W8=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,K8=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,j8=jn.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Qs({find:H8,type:this.type}),Qs({find:W8,type:this.type})]},addPasteRules(){return[Qi({find:V8,type:this.type}),Qi({find:K8,type:this.type})]}}),q8="listItem",Vk="textStyle",Wk=/^\s*([-+*])\s$/,G8=Ke.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(q8,this.editor.getAttributes(Vk)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=cl({find:Wk,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=cl({find:Wk,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Vk),editor:this.editor})),[t]}}),Y8=/(^|[^`])`([^`]+)`(?!`)/,J8=/(^|[^`])`([^`]+)`(?!`)/g,Z8=jn.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Qs({find:Y8,type:this.type})]},addPasteRules(){return[Qi({find:J8,type:this.type})]}}),X8=/^```([a-z]+)?[\s\n]$/,Q8=/^~~~([a-z]+)?[\s\n]$/,eC=Ke.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,s=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Ce(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
|
|
133
|
+
|
|
134
|
+
`);return!s||!o?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:u})=>(u.setSelection(ne.near(r.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[Lg({find:X8,type:this.type,getAttributes:t=>({language:t[1]})}),Lg({find:Q8,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Ae({key:new Le("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i?.mode;if(!n||!s)return!1;const{tr:o,schema:l}=t.state,a=l.text(n.replace(/\r\n?/g,`
|
|
135
|
+
`));return o.replaceSelectionWith(this.type.create({language:s},a)),o.selection.$from.parent.type!==this.type&&o.setSelection(X.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),eL=Ke.create({name:"doc",topNode:!0,content:"block+"});function tL(t={}){return new Ae({view(e){return new nL(e,t)}})}class nL{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,l=s.height/i.offsetHeight;if(n){let d=e.nodeBefore,f=e.nodeAfter;if(d||f){let h=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(h){let p=h.getBoundingClientRect(),g=d?p.bottom:p.top;d&&f&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let b=this.width/2*l;r={left:p.left,right:p.right,top:g-b,bottom:g+b}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;r={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let a=this.editorView.dom.offsetParent;this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let u,c;if(!a||a==document.body&&getComputedStyle(a).position=="static")u=-pageXOffset,c=-pageYOffset;else{let d=a.getBoundingClientRect(),f=d.width/a.offsetWidth,h=d.height/a.offsetHeight;u=d.left-a.scrollLeft*f,c=d.top-a.scrollTop*h}this.element.style.left=(r.left-u)/o+"px",this.element.style.top=(r.top-c)/l+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!s){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=t2(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const rL=et.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[tL(this.options)]}});class He extends ne{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return He.valid(r)?new He(r):ne.near(r)}content(){return $.empty}eq(e){return e instanceof He&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new He(e.resolve(n.pos))}getBookmark(){return new ib(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!iL(e)||!sL(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&He.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let l=e.node(o);if(n>0?e.indexAfter(o)<l.childCount:e.index(o)>0){s=l.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=n;let a=e.doc.resolve(i);if(He.valid(a))return a}for(;;){let o=n>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!J.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=o,i+=n;let l=e.doc.resolve(i);if(He.valid(l))return l}return null}}}He.prototype.visible=!1;He.findFrom=He.findGapCursorFrom;ne.jsonID("gapcursor",He);class ib{constructor(e){this.pos=e}map(e){return new ib(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return He.valid(n)?new He(n):ne.near(n)}}function tC(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function iL(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||tC(i.type))return!0;if(i.inlineContent)return!1}}return!0}function sL(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||tC(i.type))return!0;if(i.inlineContent)return!1}}return!0}function oL(){return new Ae({props:{decorations:cL,createSelectionBetween(t,e,n){return e.pos==n.pos&&He.valid(n)?new He(n):null},handleClick:aL,handleKeyDown:lL,handleDOMEvents:{beforeinput:uL}}})}const lL=C1({ArrowLeft:Tc("horiz",-1),ArrowRight:Tc("horiz",1),ArrowUp:Tc("vert",-1),ArrowDown:Tc("vert",1)});function Tc(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let o=r.selection,l=e>0?o.$to:o.$from,a=o.empty;if(o instanceof X){if(!s.endOfTextblock(n)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let u=He.findGapCursorFrom(l,e,a);return u?(i&&i(r.tr.setSelection(new He(u))),!0):!1}}function aL(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!He.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&J.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new He(r))),!0)}function uL(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof He))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=R.empty;for(let o=r.length-1;o>=0;o--)i=R.from(r[o].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new $(i,0,0));return s.setSelection(X.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function cL(t){if(!(t.selection instanceof He))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Te.create(t.doc,[ot.widget(t.selection.head,e,{key:"gapcursor"})])}const dL=et.create({name:"gapCursor",addProseMirrorPlugins(){return[oL()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ae(K(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),fL=Ke.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Ce(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
136
|
+
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=r.extensionManager,a=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&a&&o){const d=a.filter(f=>l.includes(f.type.name));u.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),hL=Ke.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Ce(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Lg({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Nf=200,mt=function(){};mt.prototype.append=function(e){return e.length?(e=mt.from(e),!this.length&&e||e.length<Nf&&this.leafAppend(e)||this.length<Nf&&e.leafPrepend(this)||this.appendInner(e)):this};mt.prototype.prepend=function(e){return e.length?mt.from(e).append(this):this};mt.prototype.appendInner=function(e){return new pL(this,e)};mt.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?mt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};mt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};mt.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};mt.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},n,r),i};mt.from=function(e){return e instanceof mt?e:e&&e.length?new nC(e):mt.empty};var nC=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,l){for(var a=s;a<o;a++)if(i(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,l){for(var a=s-1;a>=o;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Nf)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Nf)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(mt);mt.empty=new nC([]);var pL=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,o){var l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(s,l),o)===!1||s>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,s)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,o){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(s,l)-l,o+l)===!1||s<l&&this.left.forEachInvertedInner(r,Math.min(i,l),s,o)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(mt);const gL=500;class ir{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let o=e.tr,l,a,u=[],c=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(r,f+1),s=i.maps.length),s--,c.push(d);return}if(i){c.push(new fi(d.map));let h=d.step.map(i.slice(s)),p;h&&o.maybeStep(h).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],u.push(new fi(p,void 0,void 0,u.length+c.length))),s--,p&&i.appendMap(p,s)}else o.maybeStep(d.step);if(d.selection)return l=i?d.selection.map(i.slice(s)):d.selection,a=new ir(this.items.slice(0,r).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,n,r,i){let s=[],o=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let c=0;c<e.steps.length;c++){let d=e.steps[c].invert(e.docs[c]),f=new fi(e.mapping.maps[c],d,n),h;(h=a&&a.merge(f))&&(f=h,c?s.pop():l=l.slice(0,l.length-1)),s.push(f),n&&(o++,n=void 0),i||(a=f)}let u=o-r.depth;return u>bL&&(l=mL(l,u),o-=u),new ir(l.append(s),o)}remapping(e,n){let r=new Xa;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new ir(this.items.append(e.map(n=>new fi(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},i);let a=n;this.items.forEach(f=>{let h=s.getMirror(--a);if(h==null)return;o=Math.min(o,h);let p=s.maps[h];if(f.step){let g=e.steps[h].invert(e.docs[h]),b=f.selection&&f.selection.map(s.slice(a+1,h));b&&l++,r.push(new fi(p,g,b))}else r.push(new fi(p))},i);let u=[];for(let f=n;f<o;f++)u.push(new fi(s.maps[f]));let c=this.items.slice(0,i).append(u).append(r),d=new ir(c,l);return d.emptyItemCount()>gL&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],s=0;return this.items.forEach((o,l)=>{if(l>=e)i.push(o),o.selection&&s++;else if(o.step){let a=o.step.map(n.slice(r)),u=a&&a.getMap();if(r--,u&&n.appendMap(u,r),a){let c=o.selection&&o.selection.map(n.slice(r));c&&s++;let d=new fi(u.invert(),a,c),f,h=i.length-1;(f=i.length&&i[h].merge(d))?i[h]=f:i.push(d)}}else o.map&&r--},this.items.length,0),new ir(mt.from(i.reverse()),s)}}ir.empty=new ir(mt.empty,0);function mL(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}let fi=class rC{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new rC(n.getMap().invert(),n,this.selection)}}};class yi{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const bL=20;function yL(t,e,n,r){let i=n.getMeta(Fs),s;if(i)return i.historyState;n.getMeta(wL)&&(t=new yi(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Fs))return o.getMeta(Fs).redo?new yi(t.done.addTransform(n,void 0,r,od(e)),t.undone,Kk(n.mapping.maps),t.prevTime,t.prevComposition):new yi(t.done,t.undone.addTransform(n,void 0,r,od(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=t.prevTime==0||!o&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!EL(n,t.prevRanges)),u=o?Yp(t.prevRanges,n.mapping):Kk(n.mapping.maps);return new yi(t.done.addTransform(n,a?e.selection.getBookmark():void 0,r,od(e)),ir.empty,u,n.time,l??t.prevComposition)}else return(s=n.getMeta("rebased"))?new yi(t.done.rebased(n,s),t.undone.rebased(n,s),Yp(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new yi(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Yp(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function EL(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(n=!0)}),n}function Kk(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,s,o)=>e.push(s,o));return e}function Yp(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}function kL(t,e,n){let r=od(e),i=Fs.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),l=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),a=new yi(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(o).setMeta(Fs,{redo:n,historyState:a})}let Jp=!1,jk=null;function od(t){let e=t.plugins;if(jk!=e){Jp=!1,jk=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Jp=!0;break}}return Jp}const Fs=new Le("history"),wL=new Le("closeHistory");function _L(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ae({key:Fs,state:{init(){return new yi(ir.empty,ir.empty,null,0,-1)},apply(e,n,r){return yL(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?sC:r=="historyRedo"?oC:null;return!i||!e.editable?!1:(n.preventDefault(),i(e.state,e.dispatch))}}}})}function iC(t,e){return(n,r)=>{let i=Fs.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=kL(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const sC=iC(!1,!0),oC=iC(!0,!0),vL=et.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>sC(t,e),redo:()=>({state:t,dispatch:e})=>oC(t,e)}},addProseMirrorPlugins(){return[_L(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),xL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,SL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,CL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,AL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,TL=jn.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Qs({find:xL,type:this.type}),Qs({find:CL,type:this.type})]},addPasteRules(){return[Qi({find:SL,type:this.type}),Qi({find:AL,type:this.type})]}}),NL=Ke.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Ce(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),ML="listItem",qk="textStyle",Gk=/^(\d+)\.\s$/,OL=Ke.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Ce(this.options.HTMLAttributes,n),0]:["ol",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ML,this.editor.getAttributes(qk)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=cl({find:Gk,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=cl({find:Gk,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(qk)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),DL=Ke.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),RL=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,IL=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,LL=jn.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Qs({find:RL,type:this.type})]},addPasteRules(){return[Qi({find:IL,type:this.type})]}}),PL=Ke.create({name:"text",group:"inline"}),hW=et.create({name:"starterKit",addExtensions(){const t=[];return this.options.bold!==!1&&t.push(j8.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(U8.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(G8.configure(this.options.bulletList)),this.options.code!==!1&&t.push(Z8.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(eC.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(eL.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(rL.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(dL.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(fL.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(hL.configure(this.options.heading)),this.options.history!==!1&&t.push(vL.configure(this.options.history)),this.options.horizontalRule!==!1&&t.push(h8.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(TL.configure(this.options.italic)),this.options.listItem!==!1&&t.push(NL.configure(this.options.listItem)),this.options.orderedList!==!1&&t.push(OL.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(DL.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(LL.configure(this.options.strike)),this.options.text!==!1&&t.push(PL.configure(this.options.text)),t}}),Yk={};function FL(t){let e=Yk[t];if(e)return e;e=Yk[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);e.push(r)}for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return e}function gl(t,e){typeof e!="string"&&(e=gl.defaultChars);const n=FL(e);return t.replace(/(%[a-f0-9]{2})+/gi,function(r){let i="";for(let s=0,o=r.length;s<o;s+=3){const l=parseInt(r.slice(s+1,s+3),16);if(l<128){i+=n[l];continue}if((l&224)===192&&s+3<o){const a=parseInt(r.slice(s+4,s+6),16);if((a&192)===128){const u=l<<6&1984|a&63;u<128?i+="��":i+=String.fromCharCode(u),s+=3;continue}}if((l&240)===224&&s+6<o){const a=parseInt(r.slice(s+4,s+6),16),u=parseInt(r.slice(s+7,s+9),16);if((a&192)===128&&(u&192)===128){const c=l<<12&61440|a<<6&4032|u&63;c<2048||c>=55296&&c<=57343?i+="���":i+=String.fromCharCode(c),s+=6;continue}}if((l&248)===240&&s+9<o){const a=parseInt(r.slice(s+4,s+6),16),u=parseInt(r.slice(s+7,s+9),16),c=parseInt(r.slice(s+10,s+12),16);if((a&192)===128&&(u&192)===128&&(c&192)===128){let d=l<<18&1835008|a<<12&258048|u<<6&4032|c&63;d<65536||d>1114111?i+="����":(d-=65536,i+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),s+=9;continue}}i+="�"}return i})}gl.defaultChars=";/?:@&=+$,#";gl.componentChars="";const Jk={};function BL(t){let e=Jk[t];if(e)return e;e=Jk[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<t.length;n++)e[t.charCodeAt(n)]=t[n];return e}function Ku(t,e,n){typeof e!="string"&&(n=e,e=Ku.defaultChars),typeof n>"u"&&(n=!0);const r=BL(e);let i="";for(let s=0,o=t.length;s<o;s++){const l=t.charCodeAt(s);if(n&&l===37&&s+2<o&&/^[0-9a-f]{2}$/i.test(t.slice(s+1,s+3))){i+=t.slice(s,s+3),s+=2;continue}if(l<128){i+=r[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1<o){const a=t.charCodeAt(s+1);if(a>=56320&&a<=57343){i+=encodeURIComponent(t[s]+t[s+1]),s++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(t[s])}return i}Ku.defaultChars=";/?:@&=+$,-_.!~*'()#";Ku.componentChars="-_.!~*'()";function sb(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function Mf(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const zL=/^([a-z0-9.+-]+:)/i,$L=/:[0-9]*$/,UL=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,HL=["<",">",'"',"`"," ","\r",`
|
|
137
|
+
`," "],VL=["{","}","|","\\","^","`"].concat(HL),WL=["'"].concat(VL),Zk=["%","/","?",";","#"].concat(WL),Xk=["/","?","#"],KL=255,Qk=/^[+a-z0-9A-Z_-]{0,63}$/,jL=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ew={javascript:!0,"javascript:":!0},tw={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function ob(t,e){if(t&&t instanceof Mf)return t;const n=new Mf;return n.parse(t,e),n}Mf.prototype.parse=function(t,e){let n,r,i,s=t;if(s=s.trim(),!e&&t.split("#").length===1){const u=UL.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let o=zL.exec(s);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,s=s.substr(o.length)),(e||o||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=s.substr(0,2)==="//",i&&!(o&&ew[o])&&(s=s.substr(2),this.slashes=!0)),!ew[o]&&(i||o&&!tw[o])){let u=-1;for(let p=0;p<Xk.length;p++)r=s.indexOf(Xk[p]),r!==-1&&(u===-1||r<u)&&(u=r);let c,d;u===-1?d=s.lastIndexOf("@"):d=s.lastIndexOf("@",u),d!==-1&&(c=s.slice(0,d),s=s.slice(d+1),this.auth=c),u=-1;for(let p=0;p<Zk.length;p++)r=s.indexOf(Zk[p]),r!==-1&&(u===-1||r<u)&&(u=r);u===-1&&(u=s.length),s[u-1]===":"&&u--;const f=s.slice(0,u);s=s.slice(u),this.parseHost(f),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const p=this.hostname.split(/\./);for(let g=0,b=p.length;g<b;g++){const m=p[g];if(m&&!m.match(Qk)){let E="";for(let k=0,y=m.length;k<y;k++)m.charCodeAt(k)>127?E+="x":E+=m[k];if(!E.match(Qk)){const k=p.slice(0,g),y=p.slice(g+1),_=m.match(jL);_&&(k.push(_[1]),y.unshift(_[2])),y.length&&(s=y.join(".")+s),this.hostname=k.join(".");break}}}}this.hostname.length>KL&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));const a=s.indexOf("?");return a!==-1&&(this.search=s.substr(a),s=s.slice(0,a)),s&&(this.pathname=s),tw[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Mf.prototype.parseHost=function(t){let e=$L.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const qL=Object.freeze(Object.defineProperty({__proto__:null,decode:gl,encode:Ku,format:sb,parse:ob},Symbol.toStringTag,{value:"Module"})),lC=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,aC=/[\0-\x1F\x7F-\x9F]/,GL=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,lb=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,uC=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,cC=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,YL=Object.freeze(Object.defineProperty({__proto__:null,Any:lC,Cc:aC,Cf:GL,P:lb,S:uC,Z:cC},Symbol.toStringTag,{value:"Module"})),JL=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),ZL=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var Zp;const XL=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),QL=(Zp=String.fromCodePoint)!==null&&Zp!==void 0?Zp:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function e5(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=XL.get(t))!==null&&e!==void 0?e:t}var ht;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(ht||(ht={}));const t5=32;var Di;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Di||(Di={}));function Yg(t){return t>=ht.ZERO&&t<=ht.NINE}function n5(t){return t>=ht.UPPER_A&&t<=ht.UPPER_F||t>=ht.LOWER_A&&t<=ht.LOWER_F}function r5(t){return t>=ht.UPPER_A&&t<=ht.UPPER_Z||t>=ht.LOWER_A&&t<=ht.LOWER_Z||Yg(t)}function i5(t){return t===ht.EQUALS||r5(t)}var ut;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(ut||(ut={}));var xi;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(xi||(xi={}));class s5{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=ut.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=xi.Strict}startEntity(e){this.decodeMode=e,this.state=ut.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case ut.EntityStart:return e.charCodeAt(n)===ht.NUM?(this.state=ut.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=ut.NamedEntity,this.stateNamedEntity(e,n));case ut.NumericStart:return this.stateNumericStart(e,n);case ut.NumericDecimal:return this.stateNumericDecimal(e,n);case ut.NumericHex:return this.stateNumericHex(e,n);case ut.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|t5)===ht.LOWER_X?(this.state=ut.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=ut.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+parseInt(e.substr(n,s),i),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(Yg(i)||n5(i))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(Yg(i))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===ht.SEMI)this.consumed+=1;else if(this.decodeMode===xi.Strict)return 0;return this.emitCodePoint(e5(this.result),this.consumed),this.errors&&(e!==ht.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&Di.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const o=e.charCodeAt(n);if(this.treeIndex=o5(r,i,this.treeIndex+Math.max(1,s),o),this.treeIndex<0)return this.result===0||this.decodeMode===xi.Attribute&&(s===0||i5(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&Di.VALUE_LENGTH)>>14,s!==0){if(o===ht.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==xi.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&Di.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~Di.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case ut.NamedEntity:return this.result!==0&&(this.decodeMode!==xi.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ut.NumericDecimal:return this.emitNumericEntity(0,2);case ut.NumericHex:return this.emitNumericEntity(0,3);case ut.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ut.EntityStart:return 0}}}function dC(t){let e="";const n=new s5(t,r=>e+=QL(r));return function(i,s){let o=0,l=0;for(;(l=i.indexOf("&",l))>=0;){e+=i.slice(o,l),n.startEntity(s);const u=n.write(i,l+1);if(u<0){o=l+n.end();break}o=l+u,l=u===0?o+1:o}const a=e+i.slice(o);return e="",a}}function o5(t,e,n,r){const i=(e&Di.BRANCH_LENGTH)>>7,s=e&Di.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const a=r-s;return a<0||a>=i?-1:t[n+a]-1}let o=n,l=o+i-1;for(;o<=l;){const a=o+l>>>1,u=t[a];if(u<r)o=a+1;else if(u>r)l=a-1;else return t[a+i]}return-1}const l5=dC(JL);dC(ZL);function fC(t,e=xi.Legacy){return l5(t,e)}function a5(t){return Object.prototype.toString.call(t)}function ab(t){return a5(t)==="[object String]"}const u5=Object.prototype.hasOwnProperty;function c5(t,e){return u5.call(t,e)}function Ch(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){t[r]=n[r]})}}),t}function hC(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function ub(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function Of(t){if(t>65535){t-=65536;const e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}return String.fromCharCode(t)}const pC=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,d5=/&([a-z#][a-z0-9]{1,31});/gi,f5=new RegExp(pC.source+"|"+d5.source,"gi"),h5=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function p5(t,e){if(e.charCodeAt(0)===35&&h5.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return ub(r)?Of(r):t}const n=fC(t);return n!==t?n:t}function g5(t){return t.indexOf("\\")<0?t:t.replace(pC,"$1")}function ml(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(f5,function(e,n,r){return n||p5(e,r)})}const m5=/[&<>"]/,b5=/[&<>"]/g,y5={"&":"&","<":"<",">":">",'"':"""};function E5(t){return y5[t]}function es(t){return m5.test(t)?t.replace(b5,E5):t}const k5=/[.?*+^$[\]\\(){}|-]/g;function w5(t){return t.replace(k5,"\\$&")}function Me(t){switch(t){case 9:case 32:return!0}return!1}function du(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function fu(t){return lb.test(t)||uC.test(t)}function hu(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Ah(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}const _5={mdurl:qL,ucmicro:YL},v5=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:hC,assign:Ch,escapeHtml:es,escapeRE:w5,fromCodePoint:Of,has:c5,isMdAsciiPunct:hu,isPunctChar:fu,isSpace:Me,isString:ab,isValidEntityCode:ub,isWhiteSpace:du,lib:_5,normalizeReference:Ah,unescapeAll:ml,unescapeMd:g5},Symbol.toStringTag,{value:"Module"}));function x5(t,e,n){let r,i,s,o;const l=t.posMax,a=t.pos;for(t.pos=e+1,r=1;t.pos<l;){if(s=t.src.charCodeAt(t.pos),s===93&&(r--,r===0)){i=!0;break}if(o=t.pos,t.md.inline.skipToken(t),s===91){if(o===t.pos-1)r++;else if(n)return t.pos=a,-1}}let u=-1;return i&&(u=t.pos),t.pos=a,u}function S5(t,e,n){let r,i=e;const s={ok:!1,pos:0,str:""};if(t.charCodeAt(i)===60){for(i++;i<n;){if(r=t.charCodeAt(i),r===10||r===60)return s;if(r===62)return s.pos=i+1,s.str=ml(t.slice(e+1,i)),s.ok=!0,s;if(r===92&&i+1<n){i+=2;continue}i++}return s}let o=0;for(;i<n&&(r=t.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(t.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return s;if(r===41){if(o===0)break;o--}i++}return e===i||o!==0||(s.str=ml(t.slice(e,i)),s.pos=i,s.ok=!0),s}function C5(t,e,n,r){let i,s=e;const o={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(s>=n)return o;let l=t.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return o;e++,s++,l===40&&(l=41),o.marker=l}for(;s<n;){if(i=t.charCodeAt(s),i===o.marker)return o.pos=s+1,o.str+=ml(t.slice(e,s)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&s+1<n&&s++,s++}return o.can_continue=!0,o.str+=ml(t.slice(e,s)),o}const A5=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:S5,parseLinkLabel:x5,parseLinkTitle:C5},Symbol.toStringTag,{value:"Module"})),Or={};Or.code_inline=function(t,e,n,r,i){const s=t[e];return"<code"+i.renderAttrs(s)+">"+es(s.content)+"</code>"};Or.code_block=function(t,e,n,r,i){const s=t[e];return"<pre"+i.renderAttrs(s)+"><code>"+es(t[e].content)+`</code></pre>
|
|
138
|
+
`};Or.fence=function(t,e,n,r,i){const s=t[e],o=s.info?ml(s.info).trim():"";let l="",a="";if(o){const c=o.split(/(\s+)/g);l=c[0],a=c.slice(2).join("")}let u;if(n.highlight?u=n.highlight(s.content,l,a)||es(s.content):u=es(s.content),u.indexOf("<pre")===0)return u+`
|
|
139
|
+
`;if(o){const c=s.attrIndex("class"),d=s.attrs?s.attrs.slice():[];c<0?d.push(["class",n.langPrefix+l]):(d[c]=d[c].slice(),d[c][1]+=" "+n.langPrefix+l);const f={attrs:d};return`<pre><code${i.renderAttrs(f)}>${u}</code></pre>
|
|
140
|
+
`}return`<pre><code${i.renderAttrs(s)}>${u}</code></pre>
|
|
141
|
+
`};Or.image=function(t,e,n,r,i){const s=t[e];return s.attrs[s.attrIndex("alt")][1]=i.renderInlineAsText(s.children,n,r),i.renderToken(t,e,n)};Or.hardbreak=function(t,e,n){return n.xhtmlOut?`<br />
|
|
142
|
+
`:`<br>
|
|
143
|
+
`};Or.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?`<br />
|
|
144
|
+
`:`<br>
|
|
145
|
+
`:`
|
|
146
|
+
`};Or.text=function(t,e){return es(t[e].content)};Or.html_block=function(t,e){return t[e].content};Or.html_inline=function(t,e){return t[e].content};function Ol(){this.rules=Ch({},Or)}Ol.prototype.renderAttrs=function(e){let n,r,i;if(!e.attrs)return"";for(i="",n=0,r=e.attrs.length;n<r;n++)i+=" "+es(e.attrs[n][0])+'="'+es(e.attrs[n][1])+'"';return i};Ol.prototype.renderToken=function(e,n,r){const i=e[n];let s="";if(i.hidden)return"";i.block&&i.nesting!==-1&&n&&e[n-1].hidden&&(s+=`
|
|
147
|
+
`),s+=(i.nesting===-1?"</":"<")+i.tag,s+=this.renderAttrs(i),i.nesting===0&&r.xhtmlOut&&(s+=" /");let o=!1;if(i.block&&(o=!0,i.nesting===1&&n+1<e.length)){const l=e[n+1];(l.type==="inline"||l.hidden||l.nesting===-1&&l.tag===i.tag)&&(o=!1)}return s+=o?`>
|
|
148
|
+
`:">",s};Ol.prototype.renderInline=function(t,e,n){let r="";const i=this.rules;for(let s=0,o=t.length;s<o;s++){const l=t[s].type;typeof i[l]<"u"?r+=i[l](t,s,e,n,this):r+=this.renderToken(t,s,e)}return r};Ol.prototype.renderInlineAsText=function(t,e,n){let r="";for(let i=0,s=t.length;i<s;i++)switch(t[i].type){case"text":r+=t[i].content;break;case"image":r+=this.renderInlineAsText(t[i].children,e,n);break;case"html_inline":case"html_block":r+=t[i].content;break;case"softbreak":case"hardbreak":r+=`
|
|
149
|
+
`;break}return r};Ol.prototype.render=function(t,e,n){let r="";const i=this.rules;for(let s=0,o=t.length;s<o;s++){const l=t[s].type;l==="inline"?r+=this.renderInline(t[s].children,e,n):typeof i[l]<"u"?r+=i[l](t,s,e,n,this):r+=this.renderToken(t,s,e,n)}return r};function dn(){this.__rules__=[],this.__cache__=null}dn.prototype.__find__=function(t){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1};dn.prototype.__compile__=function(){const t=this,e=[""];t.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(r){e.indexOf(r)<0&&e.push(r)})}),t.__cache__={},e.forEach(function(n){t.__cache__[n]=[],t.__rules__.forEach(function(r){r.enabled&&(n&&r.alt.indexOf(n)<0||t.__cache__[n].push(r.fn))})})};dn.prototype.at=function(t,e,n){const r=this.__find__(t),i=n||{};if(r===-1)throw new Error("Parser rule not found: "+t);this.__rules__[r].fn=e,this.__rules__[r].alt=i.alt||[],this.__cache__=null};dn.prototype.before=function(t,e,n,r){const i=this.__find__(t),s=r||{};if(i===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(i,0,{name:e,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null};dn.prototype.after=function(t,e,n,r){const i=this.__find__(t),s=r||{};if(i===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(i+1,0,{name:e,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null};dn.prototype.push=function(t,e,n){const r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null};dn.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const i=this.__find__(r);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!0,n.push(r)},this),this.__cache__=null,n};dn.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,e)};dn.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const i=this.__find__(r);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!1,n.push(r)},this),this.__cache__=null,n};dn.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};function ur(t,e,n){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}ur.prototype.attrIndex=function(e){if(!this.attrs)return-1;const n=this.attrs;for(let r=0,i=n.length;r<i;r++)if(n[r][0]===e)return r;return-1};ur.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]};ur.prototype.attrSet=function(e,n){const r=this.attrIndex(e),i=[e,n];r<0?this.attrPush(i):this.attrs[r]=i};ur.prototype.attrGet=function(e){const n=this.attrIndex(e);let r=null;return n>=0&&(r=this.attrs[n][1]),r};ur.prototype.attrJoin=function(e,n){const r=this.attrIndex(e);r<0?this.attrPush([e,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function gC(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}gC.prototype.Token=ur;const T5=/\r\n?|\n/g,N5=/\0/g;function M5(t){let e;e=t.src.replace(T5,`
|
|
150
|
+
`),e=e.replace(N5,"�"),t.src=e}function O5(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function D5(t){const e=t.tokens;for(let n=0,r=e.length;n<r;n++){const i=e[n];i.type==="inline"&&t.md.inline.parse(i.content,t.md,t.env,i.children)}}function R5(t){return/^<a[>\s]/i.test(t)}function I5(t){return/^<\/a\s*>/i.test(t)}function L5(t){const e=t.tokens;if(t.md.options.linkify)for(let n=0,r=e.length;n<r;n++){if(e[n].type!=="inline"||!t.md.linkify.pretest(e[n].content))continue;let i=e[n].children,s=0;for(let o=i.length-1;o>=0;o--){const l=i[o];if(l.type==="link_close"){for(o--;i[o].level!==l.level&&i[o].type!=="link_open";)o--;continue}if(l.type==="html_inline"&&(R5(l.content)&&s>0&&s--,I5(l.content)&&s++),!(s>0)&&l.type==="text"&&t.md.linkify.test(l.content)){const a=l.content;let u=t.md.linkify.match(a);const c=[];let d=l.level,f=0;u.length>0&&u[0].index===0&&o>0&&i[o-1].type==="text_special"&&(u=u.slice(1));for(let h=0;h<u.length;h++){const p=u[h].url,g=t.md.normalizeLink(p);if(!t.md.validateLink(g))continue;let b=u[h].text;u[h].schema?u[h].schema==="mailto:"&&!/^mailto:/i.test(b)?b=t.md.normalizeLinkText("mailto:"+b).replace(/^mailto:/,""):b=t.md.normalizeLinkText(b):b=t.md.normalizeLinkText("http://"+b).replace(/^http:\/\//,"");const m=u[h].index;if(m>f){const _=new t.Token("text","",0);_.content=a.slice(f,m),_.level=d,c.push(_)}const E=new t.Token("link_open","a",1);E.attrs=[["href",g]],E.level=d++,E.markup="linkify",E.info="auto",c.push(E);const k=new t.Token("text","",0);k.content=b,k.level=d,c.push(k);const y=new t.Token("link_close","a",-1);y.level=--d,y.markup="linkify",y.info="auto",c.push(y),f=u[h].lastIndex}if(f<a.length){const h=new t.Token("text","",0);h.content=a.slice(f),h.level=d,c.push(h)}e[n].children=i=hC(i,o,c)}}}}const mC=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,P5=/\((c|tm|r)\)/i,F5=/\((c|tm|r)\)/ig,B5={c:"©",r:"®",tm:"™"};function z5(t,e){return B5[e.toLowerCase()]}function $5(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&(r.content=r.content.replace(F5,z5)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function U5(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&mC.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function H5(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(P5.test(t.tokens[e].content)&&$5(t.tokens[e].children),mC.test(t.tokens[e].content)&&U5(t.tokens[e].children))}const V5=/['"]/,nw=/['"]/g,rw="’";function Nc(t,e,n){return t.slice(0,e)+n+t.slice(e+1)}function W5(t,e){let n;const r=[];for(let i=0;i<t.length;i++){const s=t[i],o=t[i].level;for(n=r.length-1;n>=0&&!(r[n].level<=o);n--);if(r.length=n+1,s.type!=="text")continue;let l=s.content,a=0,u=l.length;e:for(;a<u;){nw.lastIndex=a;const c=nw.exec(l);if(!c)break;let d=!0,f=!0;a=c.index+1;const h=c[0]==="'";let p=32;if(c.index-1>=0)p=l.charCodeAt(c.index-1);else for(n=i-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){p=t[n].content.charCodeAt(t[n].content.length-1);break}let g=32;if(a<u)g=l.charCodeAt(a);else for(n=i+1;n<t.length&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n++)if(t[n].content){g=t[n].content.charCodeAt(0);break}const b=hu(p)||fu(String.fromCharCode(p)),m=hu(g)||fu(String.fromCharCode(g)),E=du(p),k=du(g);if(k?d=!1:m&&(E||b||(d=!1)),E?f=!1:b&&(k||m||(f=!1)),g===34&&c[0]==='"'&&p>=48&&p<=57&&(f=d=!1),d&&f&&(d=b,f=m),!d&&!f){h&&(s.content=Nc(s.content,c.index,rw));continue}if(f)for(n=r.length-1;n>=0;n--){let y=r[n];if(r[n].level<o)break;if(y.single===h&&r[n].level===o){y=r[n];let _,w;h?(_=e.md.options.quotes[2],w=e.md.options.quotes[3]):(_=e.md.options.quotes[0],w=e.md.options.quotes[1]),s.content=Nc(s.content,c.index,w),t[y.token].content=Nc(t[y.token].content,y.pos,_),a+=w.length-1,y.token===i&&(a+=_.length-1),l=s.content,u=l.length,r.length=n;continue e}}d?r.push({token:i,pos:c.index,single:h,level:o}):f&&h&&(s.content=Nc(s.content,c.index,rw))}}}function K5(t){if(t.md.options.typographer)for(let e=t.tokens.length-1;e>=0;e--)t.tokens[e].type!=="inline"||!V5.test(t.tokens[e].content)||W5(t.tokens[e].children,t)}function j5(t){let e,n;const r=t.tokens,i=r.length;for(let s=0;s<i;s++){if(r[s].type!=="inline")continue;const o=r[s].children,l=o.length;for(e=0;e<l;e++)o[e].type==="text_special"&&(o[e].type="text");for(e=n=0;e<l;e++)o[e].type==="text"&&e+1<l&&o[e+1].type==="text"?o[e+1].content=o[e].content+o[e+1].content:(e!==n&&(o[n]=o[e]),n++);e!==n&&(o.length=n)}}const Xp=[["normalize",M5],["block",O5],["inline",D5],["linkify",L5],["replacements",H5],["smartquotes",K5],["text_join",j5]];function cb(){this.ruler=new dn;for(let t=0;t<Xp.length;t++)this.ruler.push(Xp[t][0],Xp[t][1])}cb.prototype.process=function(t){const e=this.ruler.getRules("");for(let n=0,r=e.length;n<r;n++)e[n](t)};cb.prototype.State=gC;function Dr(t,e,n,r){this.src=t,this.md=e,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const i=this.src;for(let s=0,o=0,l=0,a=0,u=i.length,c=!1;o<u;o++){const d=i.charCodeAt(o);if(!c)if(Me(d)){l++,d===9?a+=4-a%4:a++;continue}else c=!0;(d===10||o===u-1)&&(d!==10&&o++,this.bMarks.push(s),this.eMarks.push(o),this.tShift.push(l),this.sCount.push(a),this.bsCount.push(0),c=!1,l=0,a=0,s=o+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Dr.prototype.push=function(t,e,n){const r=new ur(t,e,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r};Dr.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};Dr.prototype.skipEmptyLines=function(e){for(let n=this.lineMax;e<n&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e};Dr.prototype.skipSpaces=function(e){for(let n=this.src.length;e<n;e++){const r=this.src.charCodeAt(e);if(!Me(r))break}return e};Dr.prototype.skipSpacesBack=function(e,n){if(e<=n)return e;for(;e>n;)if(!Me(this.src.charCodeAt(--e)))return e+1;return e};Dr.prototype.skipChars=function(e,n){for(let r=this.src.length;e<r&&this.src.charCodeAt(e)===n;e++);return e};Dr.prototype.skipCharsBack=function(e,n,r){if(e<=r)return e;for(;e>r;)if(n!==this.src.charCodeAt(--e))return e+1;return e};Dr.prototype.getLines=function(e,n,r,i){if(e>=n)return"";const s=new Array(n-e);for(let o=0,l=e;l<n;l++,o++){let a=0;const u=this.bMarks[l];let c=u,d;for(l+1<n||i?d=this.eMarks[l]+1:d=this.eMarks[l];c<d&&a<r;){const f=this.src.charCodeAt(c);if(Me(f))f===9?a+=4-(a+this.bsCount[l])%4:a++;else if(c-u<this.tShift[l])a++;else break;c++}a>r?s[o]=new Array(a-r+1).join(" ")+this.src.slice(c,d):s[o]=this.src.slice(c,d)}return s.join("")};Dr.prototype.Token=ur;const q5=65536;function Qp(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function iw(t){const e=[],n=t.length;let r=0,i=t.charCodeAt(r),s=!1,o=0,l="";for(;r<n;)i===124&&(s?(l+=t.substring(o,r-1),o=r):(e.push(l+t.substring(o,r)),l="",o=r+1)),s=i===92,r++,i=t.charCodeAt(r);return e.push(l+t.substring(o)),e}function G5(t,e,n,r){if(e+2>n)return!1;let i=e+1;if(t.sCount[i]<t.blkIndent||t.sCount[i]-t.blkIndent>=4)return!1;let s=t.bMarks[i]+t.tShift[i];if(s>=t.eMarks[i])return!1;const o=t.src.charCodeAt(s++);if(o!==124&&o!==45&&o!==58||s>=t.eMarks[i])return!1;const l=t.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!Me(l)||o===45&&Me(l))return!1;for(;s<t.eMarks[i];){const y=t.src.charCodeAt(s);if(y!==124&&y!==45&&y!==58&&!Me(y))return!1;s++}let a=Qp(t,e+1),u=a.split("|");const c=[];for(let y=0;y<u.length;y++){const _=u[y].trim();if(!_){if(y===0||y===u.length-1)continue;return!1}if(!/^:?-+:?$/.test(_))return!1;_.charCodeAt(_.length-1)===58?c.push(_.charCodeAt(0)===58?"center":"right"):_.charCodeAt(0)===58?c.push("left"):c.push("")}if(a=Qp(t,e).trim(),a.indexOf("|")===-1||t.sCount[e]-t.blkIndent>=4)return!1;u=iw(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const d=u.length;if(d===0||d!==c.length)return!1;if(r)return!0;const f=t.parentType;t.parentType="table";const h=t.md.block.ruler.getRules("blockquote"),p=t.push("table_open","table",1),g=[e,0];p.map=g;const b=t.push("thead_open","thead",1);b.map=[e,e+1];const m=t.push("tr_open","tr",1);m.map=[e,e+1];for(let y=0;y<u.length;y++){const _=t.push("th_open","th",1);c[y]&&(_.attrs=[["style","text-align:"+c[y]]]);const w=t.push("inline","",0);w.content=u[y].trim(),w.children=[],t.push("th_close","th",-1)}t.push("tr_close","tr",-1),t.push("thead_close","thead",-1);let E,k=0;for(i=e+2;i<n&&!(t.sCount[i]<t.blkIndent);i++){let y=!1;for(let w=0,x=h.length;w<x;w++)if(h[w](t,i,n,!0)){y=!0;break}if(y||(a=Qp(t,i).trim(),!a)||t.sCount[i]-t.blkIndent>=4||(u=iw(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),k+=d-u.length,k>q5))break;if(i===e+2){const w=t.push("tbody_open","tbody",1);w.map=E=[e+2,0]}const _=t.push("tr_open","tr",1);_.map=[i,i+1];for(let w=0;w<d;w++){const x=t.push("td_open","td",1);c[w]&&(x.attrs=[["style","text-align:"+c[w]]]);const S=t.push("inline","",0);S.content=u[w]?u[w].trim():"",S.children=[],t.push("td_close","td",-1)}t.push("tr_close","tr",-1)}return E&&(t.push("tbody_close","tbody",-1),E[1]=i),t.push("table_close","table",-1),g[1]=i,t.parentType=f,t.line=i,!0}function Y5(t,e,n){if(t.sCount[e]-t.blkIndent<4)return!1;let r=e+1,i=r;for(;r<n;){if(t.isEmpty(r)){r++;continue}if(t.sCount[r]-t.blkIndent>=4){r++,i=r;continue}break}t.line=i;const s=t.push("code_block","code",0);return s.content=t.getLines(e,i,4+t.blkIndent,!1)+`
|
|
151
|
+
`,s.map=[e,t.line],!0}function J5(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||i+3>s)return!1;const o=t.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let l=i;i=t.skipChars(i,o);let a=i-l;if(a<3)return!1;const u=t.src.slice(l,i),c=t.src.slice(i,s);if(o===96&&c.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let d=e,f=!1;for(;d++,!(d>=n||(i=l=t.bMarks[d]+t.tShift[d],s=t.eMarks[d],i<s&&t.sCount[d]<t.blkIndent));)if(t.src.charCodeAt(i)===o&&!(t.sCount[d]-t.blkIndent>=4)&&(i=t.skipChars(i,o),!(i-l<a)&&(i=t.skipSpaces(i),!(i<s)))){f=!0;break}a=t.sCount[e],t.line=d+(f?1:0);const h=t.push("fence","code",0);return h.info=c,h.content=t.getLines(e+1,d,a,!0),h.markup=u,h.map=[e,t.line],!0}function Z5(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];const o=t.lineMax;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(i)!==62)return!1;if(r)return!0;const l=[],a=[],u=[],c=[],d=t.md.block.ruler.getRules("blockquote"),f=t.parentType;t.parentType="blockquote";let h=!1,p;for(p=e;p<n;p++){const k=t.sCount[p]<t.blkIndent;if(i=t.bMarks[p]+t.tShift[p],s=t.eMarks[p],i>=s)break;if(t.src.charCodeAt(i++)===62&&!k){let _=t.sCount[p]+1,w,x;t.src.charCodeAt(i)===32?(i++,_++,x=!1,w=!0):t.src.charCodeAt(i)===9?(w=!0,(t.bsCount[p]+_)%4===3?(i++,_++,x=!1):x=!0):w=!1;let S=_;for(l.push(t.bMarks[p]),t.bMarks[p]=i;i<s;){const O=t.src.charCodeAt(i);if(Me(O))O===9?S+=4-(S+t.bsCount[p]+(x?1:0))%4:S++;else break;i++}h=i>=s,a.push(t.bsCount[p]),t.bsCount[p]=t.sCount[p]+1+(w?1:0),u.push(t.sCount[p]),t.sCount[p]=S-_,c.push(t.tShift[p]),t.tShift[p]=i-t.bMarks[p];continue}if(h)break;let y=!1;for(let _=0,w=d.length;_<w;_++)if(d[_](t,p,n,!0)){y=!0;break}if(y){t.lineMax=p,t.blkIndent!==0&&(l.push(t.bMarks[p]),a.push(t.bsCount[p]),c.push(t.tShift[p]),u.push(t.sCount[p]),t.sCount[p]-=t.blkIndent);break}l.push(t.bMarks[p]),a.push(t.bsCount[p]),c.push(t.tShift[p]),u.push(t.sCount[p]),t.sCount[p]=-1}const g=t.blkIndent;t.blkIndent=0;const b=t.push("blockquote_open","blockquote",1);b.markup=">";const m=[e,0];b.map=m,t.md.block.tokenize(t,e,p);const E=t.push("blockquote_close","blockquote",-1);E.markup=">",t.lineMax=o,t.parentType=f,m[1]=t.line;for(let k=0;k<c.length;k++)t.bMarks[k+e]=l[k],t.tShift[k+e]=c[k],t.sCount[k+e]=u[k],t.bsCount[k+e]=a[k];return t.blkIndent=g,!0}function X5(t,e,n,r){const i=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let s=t.bMarks[e]+t.tShift[e];const o=t.src.charCodeAt(s++);if(o!==42&&o!==45&&o!==95)return!1;let l=1;for(;s<i;){const u=t.src.charCodeAt(s++);if(u!==o&&!Me(u))return!1;u===o&&l++}if(l<3)return!1;if(r)return!0;t.line=e+1;const a=t.push("hr","hr",0);return a.map=[e,t.line],a.markup=Array(l+1).join(String.fromCharCode(o)),!0}function sw(t,e){const n=t.eMarks[e];let r=t.bMarks[e]+t.tShift[e];const i=t.src.charCodeAt(r++);if(i!==42&&i!==45&&i!==43)return-1;if(r<n){const s=t.src.charCodeAt(r);if(!Me(s))return-1}return r}function ow(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];let i=n;if(i+1>=r)return-1;let s=t.src.charCodeAt(i++);if(s<48||s>57)return-1;for(;;){if(i>=r)return-1;if(s=t.src.charCodeAt(i++),s>=48&&s<=57){if(i-n>=10)return-1;continue}if(s===41||s===46)break;return-1}return i<r&&(s=t.src.charCodeAt(i),!Me(s))?-1:i}function Q5(t,e){const n=t.level+2;for(let r=e+2,i=t.tokens.length-2;r<i;r++)t.tokens[r].level===n&&t.tokens[r].type==="paragraph_open"&&(t.tokens[r+2].hidden=!0,t.tokens[r].hidden=!0,r+=2)}function e9(t,e,n,r){let i,s,o,l,a=e,u=!0;if(t.sCount[a]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[a]-t.listIndent>=4&&t.sCount[a]<t.blkIndent)return!1;let c=!1;r&&t.parentType==="paragraph"&&t.sCount[a]>=t.blkIndent&&(c=!0);let d,f,h;if((h=ow(t,a))>=0){if(d=!0,o=t.bMarks[a]+t.tShift[a],f=Number(t.src.slice(o,h-1)),c&&f!==1)return!1}else if((h=sw(t,a))>=0)d=!1;else return!1;if(c&&t.skipSpaces(h)>=t.eMarks[a])return!1;if(r)return!0;const p=t.src.charCodeAt(h-1),g=t.tokens.length;d?(l=t.push("ordered_list_open","ol",1),f!==1&&(l.attrs=[["start",f]])):l=t.push("bullet_list_open","ul",1);const b=[a,0];l.map=b,l.markup=String.fromCharCode(p);let m=!1;const E=t.md.block.ruler.getRules("list"),k=t.parentType;for(t.parentType="list";a<n;){s=h,i=t.eMarks[a];const y=t.sCount[a]+h-(t.bMarks[a]+t.tShift[a]);let _=y;for(;s<i;){const Z=t.src.charCodeAt(s);if(Z===9)_+=4-(_+t.bsCount[a])%4;else if(Z===32)_++;else break;s++}const w=s;let x;w>=i?x=1:x=_-y,x>4&&(x=1);const S=y+x;l=t.push("list_item_open","li",1),l.markup=String.fromCharCode(p);const O=[a,0];l.map=O,d&&(l.info=t.src.slice(o,h-1));const L=t.tight,G=t.tShift[a],U=t.sCount[a],j=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=S,t.tight=!0,t.tShift[a]=w-t.bMarks[a],t.sCount[a]=_,w>=i&&t.isEmpty(a+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,a,n,!0),(!t.tight||m)&&(u=!1),m=t.line-a>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=j,t.tShift[a]=G,t.sCount[a]=U,t.tight=L,l=t.push("list_item_close","li",-1),l.markup=String.fromCharCode(p),a=t.line,O[1]=a,a>=n||t.sCount[a]<t.blkIndent||t.sCount[a]-t.blkIndent>=4)break;let te=!1;for(let Z=0,A=E.length;Z<A;Z++)if(E[Z](t,a,n,!0)){te=!0;break}if(te)break;if(d){if(h=ow(t,a),h<0)break;o=t.bMarks[a]+t.tShift[a]}else if(h=sw(t,a),h<0)break;if(p!==t.src.charCodeAt(h-1))break}return d?l=t.push("ordered_list_close","ol",-1):l=t.push("bullet_list_close","ul",-1),l.markup=String.fromCharCode(p),b[1]=a,t.line=a,t.parentType=k,u&&Q5(t,g),!0}function t9(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e],o=e+1;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(i)!==91)return!1;function l(E){const k=t.lineMax;if(E>=k||t.isEmpty(E))return null;let y=!1;if(t.sCount[E]-t.blkIndent>3&&(y=!0),t.sCount[E]<0&&(y=!0),!y){const x=t.md.block.ruler.getRules("reference"),S=t.parentType;t.parentType="reference";let O=!1;for(let L=0,G=x.length;L<G;L++)if(x[L](t,E,k,!0)){O=!0;break}if(t.parentType=S,O)return null}const _=t.bMarks[E]+t.tShift[E],w=t.eMarks[E];return t.src.slice(_,w+1)}let a=t.src.slice(i,s+1);s=a.length;let u=-1;for(i=1;i<s;i++){const E=a.charCodeAt(i);if(E===91)return!1;if(E===93){u=i;break}else if(E===10){const k=l(o);k!==null&&(a+=k,s=a.length,o++)}else if(E===92&&(i++,i<s&&a.charCodeAt(i)===10)){const k=l(o);k!==null&&(a+=k,s=a.length,o++)}}if(u<0||a.charCodeAt(u+1)!==58)return!1;for(i=u+2;i<s;i++){const E=a.charCodeAt(i);if(E===10){const k=l(o);k!==null&&(a+=k,s=a.length,o++)}else if(!Me(E))break}const c=t.md.helpers.parseLinkDestination(a,i,s);if(!c.ok)return!1;const d=t.md.normalizeLink(c.str);if(!t.md.validateLink(d))return!1;i=c.pos;const f=i,h=o,p=i;for(;i<s;i++){const E=a.charCodeAt(i);if(E===10){const k=l(o);k!==null&&(a+=k,s=a.length,o++)}else if(!Me(E))break}let g=t.md.helpers.parseLinkTitle(a,i,s);for(;g.can_continue;){const E=l(o);if(E===null)break;a+=E,i=s,s=a.length,o++,g=t.md.helpers.parseLinkTitle(a,i,s,g)}let b;for(i<s&&p!==i&&g.ok?(b=g.str,i=g.pos):(b="",i=f,o=h);i<s;){const E=a.charCodeAt(i);if(!Me(E))break;i++}if(i<s&&a.charCodeAt(i)!==10&&b)for(b="",i=f,o=h;i<s;){const E=a.charCodeAt(i);if(!Me(E))break;i++}if(i<s&&a.charCodeAt(i)!==10)return!1;const m=Ah(a.slice(1,u));return m?(r||(typeof t.env.references>"u"&&(t.env.references={}),typeof t.env.references[m]>"u"&&(t.env.references[m]={title:b,href:d}),t.line=o),!0):!1}const n9=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],r9="[a-zA-Z_:][a-zA-Z0-9:._-]*",i9="[^\"'=<>`\\x00-\\x20]+",s9="'[^']*'",o9='"[^"]*"',l9="(?:"+i9+"|"+s9+"|"+o9+")",a9="(?:\\s+"+r9+"(?:\\s*=\\s*"+l9+")?)",bC="<[A-Za-z][A-Za-z0-9\\-]*"+a9+"*\\s*\\/?>",yC="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",u9="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",c9="<[?][\\s\\S]*?[?]>",d9="<![A-Za-z][^>]*>",f9="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",h9=new RegExp("^(?:"+bC+"|"+yC+"|"+u9+"|"+c9+"|"+d9+"|"+f9+")"),p9=new RegExp("^(?:"+bC+"|"+yC+")"),yo=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+n9.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(p9.source+"\\s*$"),/^$/,!1]];function g9(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(i)!==60)return!1;let o=t.src.slice(i,s),l=0;for(;l<yo.length&&!yo[l][0].test(o);l++);if(l===yo.length)return!1;if(r)return yo[l][2];let a=e+1;if(!yo[l][1].test(o)){for(;a<n&&!(t.sCount[a]<t.blkIndent);a++)if(i=t.bMarks[a]+t.tShift[a],s=t.eMarks[a],o=t.src.slice(i,s),yo[l][1].test(o)){o.length!==0&&a++;break}}t.line=a;const u=t.push("html_block","",0);return u.map=[e,a],u.content=t.getLines(e,a,t.blkIndent,!0),!0}function m9(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let o=t.src.charCodeAt(i);if(o!==35||i>=s)return!1;let l=1;for(o=t.src.charCodeAt(++i);o===35&&i<s&&l<=6;)l++,o=t.src.charCodeAt(++i);if(l>6||i<s&&!Me(o))return!1;if(r)return!0;s=t.skipSpacesBack(s,i);const a=t.skipCharsBack(s,35,i);a>i&&Me(t.src.charCodeAt(a-1))&&(s=a),t.line=e+1;const u=t.push("heading_open","h"+String(l),1);u.markup="########".slice(0,l),u.map=[e,t.line];const c=t.push("inline","",0);c.content=t.src.slice(i,s).trim(),c.map=[e,t.line],c.children=[];const d=t.push("heading_close","h"+String(l),-1);return d.markup="########".slice(0,l),!0}function b9(t,e,n){const r=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const i=t.parentType;t.parentType="paragraph";let s=0,o,l=e+1;for(;l<n&&!t.isEmpty(l);l++){if(t.sCount[l]-t.blkIndent>3)continue;if(t.sCount[l]>=t.blkIndent){let h=t.bMarks[l]+t.tShift[l];const p=t.eMarks[l];if(h<p&&(o=t.src.charCodeAt(h),(o===45||o===61)&&(h=t.skipChars(h,o),h=t.skipSpaces(h),h>=p))){s=o===61?1:2;break}}if(t.sCount[l]<0)continue;let f=!1;for(let h=0,p=r.length;h<p;h++)if(r[h](t,l,n,!0)){f=!0;break}if(f)break}if(!s)return!1;const a=t.getLines(e,l,t.blkIndent,!1).trim();t.line=l+1;const u=t.push("heading_open","h"+String(s),1);u.markup=String.fromCharCode(o),u.map=[e,t.line];const c=t.push("inline","",0);c.content=a,c.map=[e,t.line-1],c.children=[];const d=t.push("heading_close","h"+String(s),-1);return d.markup=String.fromCharCode(o),t.parentType=i,!0}function y9(t,e,n){const r=t.md.block.ruler.getRules("paragraph"),i=t.parentType;let s=e+1;for(t.parentType="paragraph";s<n&&!t.isEmpty(s);s++){if(t.sCount[s]-t.blkIndent>3||t.sCount[s]<0)continue;let u=!1;for(let c=0,d=r.length;c<d;c++)if(r[c](t,s,n,!0)){u=!0;break}if(u)break}const o=t.getLines(e,s,t.blkIndent,!1).trim();t.line=s;const l=t.push("paragraph_open","p",1);l.map=[e,t.line];const a=t.push("inline","",0);return a.content=o,a.map=[e,t.line],a.children=[],t.push("paragraph_close","p",-1),t.parentType=i,!0}const Mc=[["table",G5,["paragraph","reference"]],["code",Y5],["fence",J5,["paragraph","reference","blockquote","list"]],["blockquote",Z5,["paragraph","reference","blockquote","list"]],["hr",X5,["paragraph","reference","blockquote","list"]],["list",e9,["paragraph","reference","blockquote"]],["reference",t9],["html_block",g9,["paragraph","reference","blockquote"]],["heading",m9,["paragraph","reference","blockquote"]],["lheading",b9],["paragraph",y9]];function Th(){this.ruler=new dn;for(let t=0;t<Mc.length;t++)this.ruler.push(Mc[t][0],Mc[t][1],{alt:(Mc[t][2]||[]).slice()})}Th.prototype.tokenize=function(t,e,n){const r=this.ruler.getRules(""),i=r.length,s=t.md.options.maxNesting;let o=e,l=!1;for(;o<n&&(t.line=o=t.skipEmptyLines(o),!(o>=n||t.sCount[o]<t.blkIndent));){if(t.level>=s){t.line=n;break}const a=t.line;let u=!1;for(let c=0;c<i;c++)if(u=r[c](t,o,n,!1),u){if(a>=t.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");t.tight=!l,t.isEmpty(t.line-1)&&(l=!0),o=t.line,o<n&&t.isEmpty(o)&&(l=!0,o++,t.line=o)}};Th.prototype.parse=function(t,e,n,r){if(!t)return;const i=new this.State(t,e,n,r);this.tokenize(i,i.line,i.lineMax)};Th.prototype.State=Dr;function ju(t,e,n,r){this.src=t,this.env=n,this.md=e,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}ju.prototype.pushPending=function(){const t=new ur("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t};ju.prototype.push=function(t,e,n){this.pending&&this.pushPending();const r=new ur(t,e,n);let i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};ju.prototype.scanDelims=function(t,e){const n=this.posMax,r=this.src.charCodeAt(t),i=t>0?this.src.charCodeAt(t-1):32;let s=t;for(;s<n&&this.src.charCodeAt(s)===r;)s++;const o=s-t,l=s<n?this.src.charCodeAt(s):32,a=hu(i)||fu(String.fromCharCode(i)),u=hu(l)||fu(String.fromCharCode(l)),c=du(i),d=du(l),f=!d&&(!u||c||a),h=!c&&(!a||d||u);return{can_open:f&&(e||!h||a),can_close:h&&(e||!f||u),length:o}};ju.prototype.Token=ur;function E9(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function k9(t,e){let n=t.pos;for(;n<t.posMax&&!E9(t.src.charCodeAt(n));)n++;return n===t.pos?!1:(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}const w9=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function _9(t,e){if(!t.md.options.linkify||t.linkLevel>0)return!1;const n=t.pos,r=t.posMax;if(n+3>r||t.src.charCodeAt(n)!==58||t.src.charCodeAt(n+1)!==47||t.src.charCodeAt(n+2)!==47)return!1;const i=t.pending.match(w9);if(!i)return!1;const s=i[1],o=t.md.linkify.matchAtStart(t.src.slice(n-s.length));if(!o)return!1;let l=o.url;if(l.length<=s.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const u=t.md.normalizeLink(l);if(!t.md.validateLink(u))return!1;if(!e){t.pending=t.pending.slice(0,-s.length);const c=t.push("link_open","a",1);c.attrs=[["href",u]],c.markup="linkify",c.info="auto";const d=t.push("text","",0);d.content=t.md.normalizeLinkText(l);const f=t.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return t.pos+=l.length-s.length,!0}function v9(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==10)return!1;const r=t.pending.length-1,i=t.posMax;if(!e)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){let s=r-1;for(;s>=1&&t.pending.charCodeAt(s-1)===32;)s--;t.pending=t.pending.slice(0,s),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(n++;n<i&&Me(t.src.charCodeAt(n));)n++;return t.pos=n,!0}const db=[];for(let t=0;t<256;t++)db.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){db[t.charCodeAt(0)]=1});function x9(t,e){let n=t.pos;const r=t.posMax;if(t.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=t.src.charCodeAt(n);if(i===10){for(e||t.push("hardbreak","br",0),n++;n<r&&(i=t.src.charCodeAt(n),!!Me(i));)n++;return t.pos=n,!0}let s=t.src[n];if(i>=55296&&i<=56319&&n+1<r){const l=t.src.charCodeAt(n+1);l>=56320&&l<=57343&&(s+=t.src[n+1],n++)}const o="\\"+s;if(!e){const l=t.push("text_special","",0);i<256&&db[i]!==0?l.content=s:l.content=o,l.markup=o,l.info="escape"}return t.pos=n+1,!0}function S9(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==96)return!1;const i=n;n++;const s=t.posMax;for(;n<s&&t.src.charCodeAt(n)===96;)n++;const o=t.src.slice(i,n),l=o.length;if(t.backticksScanned&&(t.backticks[l]||0)<=i)return e||(t.pending+=o),t.pos+=l,!0;let a=n,u;for(;(u=t.src.indexOf("`",a))!==-1;){for(a=u+1;a<s&&t.src.charCodeAt(a)===96;)a++;const c=a-u;if(c===l){if(!e){const d=t.push("code_inline","code",0);d.markup=o,d.content=t.src.slice(n,u).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return t.pos=a,!0}t.backticks[c]=u}return t.backticksScanned=!0,e||(t.pending+=o),t.pos+=l,!0}function C9(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==126)return!1;const i=t.scanDelims(t.pos,!0);let s=i.length;const o=String.fromCharCode(r);if(s<2)return!1;let l;s%2&&(l=t.push("text","",0),l.content=o,s--);for(let a=0;a<s;a+=2)l=t.push("text","",0),l.content=o+o,t.delimiters.push({marker:r,length:0,token:t.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return t.pos+=i.length,!0}function lw(t,e){let n;const r=[],i=e.length;for(let s=0;s<i;s++){const o=e[s];if(o.marker!==126||o.end===-1)continue;const l=e[o.end];n=t.tokens[o.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=t.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",t.tokens[l.token-1].type==="text"&&t.tokens[l.token-1].content==="~"&&r.push(l.token-1)}for(;r.length;){const s=r.pop();let o=s+1;for(;o<t.tokens.length&&t.tokens[o].type==="s_close";)o++;o--,s!==o&&(n=t.tokens[o],t.tokens[o]=t.tokens[s],t.tokens[s]=n)}}function A9(t){const e=t.tokens_meta,n=t.tokens_meta.length;lw(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&lw(t,e[r].delimiters)}const EC={tokenize:C9,postProcess:A9};function T9(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==95&&r!==42)return!1;const i=t.scanDelims(t.pos,r===42);for(let s=0;s<i.length;s++){const o=t.push("text","",0);o.content=String.fromCharCode(r),t.delimiters.push({marker:r,length:i.length,token:t.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return t.pos+=i.length,!0}function aw(t,e){const n=e.length;for(let r=n-1;r>=0;r--){const i=e[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const s=e[i.end],o=r>0&&e[r-1].end===i.end+1&&e[r-1].marker===i.marker&&e[r-1].token===i.token-1&&e[i.end+1].token===s.token+1,l=String.fromCharCode(i.marker),a=t.tokens[i.token];a.type=o?"strong_open":"em_open",a.tag=o?"strong":"em",a.nesting=1,a.markup=o?l+l:l,a.content="";const u=t.tokens[s.token];u.type=o?"strong_close":"em_close",u.tag=o?"strong":"em",u.nesting=-1,u.markup=o?l+l:l,u.content="",o&&(t.tokens[e[r-1].token].content="",t.tokens[e[i.end+1].token].content="",r--)}}function N9(t){const e=t.tokens_meta,n=t.tokens_meta.length;aw(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&aw(t,e[r].delimiters)}const kC={tokenize:T9,postProcess:N9};function M9(t,e){let n,r,i,s,o="",l="",a=t.pos,u=!0;if(t.src.charCodeAt(t.pos)!==91)return!1;const c=t.pos,d=t.posMax,f=t.pos+1,h=t.md.helpers.parseLinkLabel(t,t.pos,!0);if(h<0)return!1;let p=h+1;if(p<d&&t.src.charCodeAt(p)===40){for(u=!1,p++;p<d&&(n=t.src.charCodeAt(p),!(!Me(n)&&n!==10));p++);if(p>=d)return!1;if(a=p,i=t.md.helpers.parseLinkDestination(t.src,p,t.posMax),i.ok){for(o=t.md.normalizeLink(i.str),t.md.validateLink(o)?p=i.pos:o="",a=p;p<d&&(n=t.src.charCodeAt(p),!(!Me(n)&&n!==10));p++);if(i=t.md.helpers.parseLinkTitle(t.src,p,t.posMax),p<d&&a!==p&&i.ok)for(l=i.str,p=i.pos;p<d&&(n=t.src.charCodeAt(p),!(!Me(n)&&n!==10));p++);}(p>=d||t.src.charCodeAt(p)!==41)&&(u=!0),p++}if(u){if(typeof t.env.references>"u")return!1;if(p<d&&t.src.charCodeAt(p)===91?(a=p+1,p=t.md.helpers.parseLinkLabel(t,p),p>=0?r=t.src.slice(a,p++):p=h+1):p=h+1,r||(r=t.src.slice(f,h)),s=t.env.references[Ah(r)],!s)return t.pos=c,!1;o=s.href,l=s.title}if(!e){t.pos=f,t.posMax=h;const g=t.push("link_open","a",1),b=[["href",o]];g.attrs=b,l&&b.push(["title",l]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=p,t.posMax=d,!0}function O9(t,e){let n,r,i,s,o,l,a,u,c="";const d=t.pos,f=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const h=t.pos+2,p=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(p<0)return!1;if(s=p+1,s<f&&t.src.charCodeAt(s)===40){for(s++;s<f&&(n=t.src.charCodeAt(s),!(!Me(n)&&n!==10));s++);if(s>=f)return!1;for(u=s,l=t.md.helpers.parseLinkDestination(t.src,s,t.posMax),l.ok&&(c=t.md.normalizeLink(l.str),t.md.validateLink(c)?s=l.pos:c=""),u=s;s<f&&(n=t.src.charCodeAt(s),!(!Me(n)&&n!==10));s++);if(l=t.md.helpers.parseLinkTitle(t.src,s,t.posMax),s<f&&u!==s&&l.ok)for(a=l.str,s=l.pos;s<f&&(n=t.src.charCodeAt(s),!(!Me(n)&&n!==10));s++);else a="";if(s>=f||t.src.charCodeAt(s)!==41)return t.pos=d,!1;s++}else{if(typeof t.env.references>"u")return!1;if(s<f&&t.src.charCodeAt(s)===91?(u=s+1,s=t.md.helpers.parseLinkLabel(t,s),s>=0?i=t.src.slice(u,s++):s=p+1):s=p+1,i||(i=t.src.slice(h,p)),o=t.env.references[Ah(i)],!o)return t.pos=d,!1;c=o.href,a=o.title}if(!e){r=t.src.slice(h,p);const g=[];t.md.inline.parse(r,t.md,t.env,g);const b=t.push("image","img",0),m=[["src",c],["alt",""]];b.attrs=m,b.children=g,b.content=r,a&&m.push(["title",a])}return t.pos=s,t.posMax=f,!0}const D9=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,R9=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function I9(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==60)return!1;const r=t.pos,i=t.posMax;for(;;){if(++n>=i)return!1;const o=t.src.charCodeAt(n);if(o===60)return!1;if(o===62)break}const s=t.src.slice(r+1,n);if(R9.test(s)){const o=t.md.normalizeLink(s);if(!t.md.validateLink(o))return!1;if(!e){const l=t.push("link_open","a",1);l.attrs=[["href",o]],l.markup="autolink",l.info="auto";const a=t.push("text","",0);a.content=t.md.normalizeLinkText(s);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=s.length+2,!0}if(D9.test(s)){const o=t.md.normalizeLink("mailto:"+s);if(!t.md.validateLink(o))return!1;if(!e){const l=t.push("link_open","a",1);l.attrs=[["href",o]],l.markup="autolink",l.info="auto";const a=t.push("text","",0);a.content=t.md.normalizeLinkText(s);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=s.length+2,!0}return!1}function L9(t){return/^<a[>\s]/i.test(t)}function P9(t){return/^<\/a\s*>/i.test(t)}function F9(t){const e=t|32;return e>=97&&e<=122}function B9(t,e){if(!t.md.options.html)return!1;const n=t.posMax,r=t.pos;if(t.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=t.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!F9(i))return!1;const s=t.src.slice(r).match(h9);if(!s)return!1;if(!e){const o=t.push("html_inline","",0);o.content=s[0],L9(o.content)&&t.linkLevel++,P9(o.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}const z9=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,$9=/^&([a-z][a-z0-9]{1,31});/i;function U9(t,e){const n=t.pos,r=t.posMax;if(t.src.charCodeAt(n)!==38||n+1>=r)return!1;if(t.src.charCodeAt(n+1)===35){const s=t.src.slice(n).match(z9);if(s){if(!e){const o=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),l=t.push("text_special","",0);l.content=ub(o)?Of(o):Of(65533),l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}else{const s=t.src.slice(n).match($9);if(s){const o=fC(s[0]);if(o!==s[0]){if(!e){const l=t.push("text_special","",0);l.content=o,l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}}return!1}function uw(t){const e={},n=t.length;if(!n)return;let r=0,i=-2;const s=[];for(let o=0;o<n;o++){const l=t[o];if(s.push(0),(t[r].marker!==l.marker||i!==l.token-1)&&(r=o),i=l.token,l.length=l.length||0,!l.close)continue;e.hasOwnProperty(l.marker)||(e[l.marker]=[-1,-1,-1,-1,-1,-1]);const a=e[l.marker][(l.open?3:0)+l.length%3];let u=r-s[r]-1,c=u;for(;u>a;u-=s[u]+1){const d=t[u];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=u>0&&!t[u-1].open?s[u-1]+1:0;s[o]=o-u+h,s[u]=h,l.open=!1,d.end=o,d.close=!1,c=-1,i=-2;break}}}c!==-1&&(e[l.marker][(l.open?3:0)+(l.length||0)%3]=c)}}function H9(t){const e=t.tokens_meta,n=t.tokens_meta.length;uw(t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&uw(e[r].delimiters)}function V9(t){let e,n,r=0;const i=t.tokens,s=t.tokens.length;for(e=n=0;e<s;e++)i[e].nesting<0&&r--,i[e].level=r,i[e].nesting>0&&r++,i[e].type==="text"&&e+1<s&&i[e+1].type==="text"?i[e+1].content=i[e].content+i[e+1].content:(e!==n&&(i[n]=i[e]),n++);e!==n&&(i.length=n)}const e0=[["text",k9],["linkify",_9],["newline",v9],["escape",x9],["backticks",S9],["strikethrough",EC.tokenize],["emphasis",kC.tokenize],["link",M9],["image",O9],["autolink",I9],["html_inline",B9],["entity",U9]],t0=[["balance_pairs",H9],["strikethrough",EC.postProcess],["emphasis",kC.postProcess],["fragments_join",V9]];function qu(){this.ruler=new dn;for(let t=0;t<e0.length;t++)this.ruler.push(e0[t][0],e0[t][1]);this.ruler2=new dn;for(let t=0;t<t0.length;t++)this.ruler2.push(t0[t][0],t0[t][1])}qu.prototype.skipToken=function(t){const e=t.pos,n=this.ruler.getRules(""),r=n.length,i=t.md.options.maxNesting,s=t.cache;if(typeof s[e]<"u"){t.pos=s[e];return}let o=!1;if(t.level<i){for(let l=0;l<r;l++)if(t.level++,o=n[l](t,!0),t.level--,o){if(e>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;o||t.pos++,s[e]=t.pos};qu.prototype.tokenize=function(t){const e=this.ruler.getRules(""),n=e.length,r=t.posMax,i=t.md.options.maxNesting;for(;t.pos<r;){const s=t.pos;let o=!1;if(t.level<i){for(let l=0;l<n;l++)if(o=e[l](t,!1),o){if(s>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(o){if(t.pos>=r)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};qu.prototype.parse=function(t,e,n,r){const i=new this.State(t,e,n,r);this.tokenize(i);const s=this.ruler2.getRules(""),o=s.length;for(let l=0;l<o;l++)s[l](i)};qu.prototype.State=ju;function W9(t){const e={};t=t||{},e.src_Any=lC.source,e.src_Cc=aC.source,e.src_Z=cC.source,e.src_P=lb.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");const n="[><|]";return e.src_pseudo_letter="(?:(?!"+n+"|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|"+n+"|"+e.src_ZPCc+")(?!"+(t["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]|$)|"+(t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+"|$)|;(?!"+e.src_ZCc+"|$)|\\!+(?!"+e.src_ZCc+"|[!]|$)|\\?(?!"+e.src_ZCc+"|[?]|$))+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}function Jg(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}function Nh(t){return Object.prototype.toString.call(t)}function K9(t){return Nh(t)==="[object String]"}function j9(t){return Nh(t)==="[object Object]"}function q9(t){return Nh(t)==="[object RegExp]"}function cw(t){return Nh(t)==="[object Function]"}function G9(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const wC={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Y9(t){return Object.keys(t||{}).reduce(function(e,n){return e||wC.hasOwnProperty(n)},!1)}const J9={"http:":{validate:function(t,e,n){const r=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){const r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){const r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},Z9="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",X9="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Q9(t){t.__index__=-1,t.__text_cache__=""}function eP(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function dw(){return function(t,e){e.normalize(t)}}function Df(t){const e=t.re=W9(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(Z9),n.push(e.src_xn),e.src_tlds=n.join("|");function r(l){return l.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");const i=[];t.__compiled__={};function s(l,a){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+a)}Object.keys(t.__schemas__).forEach(function(l){const a=t.__schemas__[l];if(a===null)return;const u={validate:null,link:null};if(t.__compiled__[l]=u,j9(a)){q9(a.validate)?u.validate=eP(a.validate):cw(a.validate)?u.validate=a.validate:s(l,a),cw(a.normalize)?u.normalize=a.normalize:a.normalize?s(l,a):u.normalize=dw();return}if(K9(a)){i.push(l);return}s(l,a)}),i.forEach(function(l){t.__compiled__[t.__schemas__[l]]&&(t.__compiled__[l].validate=t.__compiled__[t.__schemas__[l]].validate,t.__compiled__[l].normalize=t.__compiled__[t.__schemas__[l]].normalize)}),t.__compiled__[""]={validate:null,normalize:dw()};const o=Object.keys(t.__compiled__).filter(function(l){return l.length>0&&t.__compiled__[l]}).map(G9).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),Q9(t)}function tP(t,e){const n=t.__index__,r=t.__last_index__,i=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=i,this.text=i,this.url=i}function Zg(t,e){const n=new tP(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function Cn(t,e){if(!(this instanceof Cn))return new Cn(t,e);e||Y9(t)&&(e=t,t={}),this.__opts__=Jg({},wC,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Jg({},J9,t),this.__compiled__={},this.__tlds__=X9,this.__tlds_replaced__=!1,this.re={},Df(this)}Cn.prototype.add=function(e,n){return this.__schemas__[e]=n,Df(this),this};Cn.prototype.set=function(e){return this.__opts__=Jg(this.__opts__,e),this};Cn.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let n,r,i,s,o,l,a,u,c;if(this.re.schema_test.test(e)){for(a=this.re.schema_search,a.lastIndex=0;(n=a.exec(e))!==null;)if(s=this.testSchemaAt(e,n[2],a.lastIndex),s){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+s;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(u=e.search(this.re.host_fuzzy_test),u>=0&&(this.__index__<0||u<this.__index__)&&(r=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(o=r.index+r[1].length,(this.__index__<0||o<this.__index__)&&(this.__schema__="",this.__index__=o,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(c=e.indexOf("@"),c>=0&&(i=e.match(this.re.email_fuzzy))!==null&&(o=i.index+i[1].length,l=i.index+i[0].length,(this.__index__<0||o<this.__index__||o===this.__index__&&l>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=l))),this.__index__>=0};Cn.prototype.pretest=function(e){return this.re.pretest.test(e)};Cn.prototype.testSchemaAt=function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0};Cn.prototype.match=function(e){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===e&&(n.push(Zg(this,r)),r=this.__last_index__);let i=r?e.slice(r):e;for(;this.test(i);)n.push(Zg(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};Cn.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const n=this.re.schema_at_start.exec(e);if(!n)return null;const r=this.testSchemaAt(e,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,Zg(this,0)):null};Cn.prototype.tlds=function(e,n){return e=Array.isArray(e)?e:[e],n?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,i,s){return r!==s[i-1]}).reverse(),Df(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Df(this),this)};Cn.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};Cn.prototype.onCompile=function(){};const Jo=2147483647,wr=36,fb=1,pu=26,nP=38,rP=700,_C=72,vC=128,xC="-",iP=/^xn--/,sP=/[^\0-\x7F]/,oP=/[\x2E\u3002\uFF0E\uFF61]/g,lP={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},n0=wr-fb,_r=Math.floor,r0=String.fromCharCode;function Ei(t){throw new RangeError(lP[t])}function aP(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function SC(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(oP,".");const i=t.split("."),s=aP(i,e).join(".");return r+s}function CC(t){const e=[];let n=0;const r=t.length;for(;n<r;){const i=t.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){const s=t.charCodeAt(n++);(s&64512)==56320?e.push(((i&1023)<<10)+(s&1023)+65536):(e.push(i),n--)}else e.push(i)}return e}const uP=t=>String.fromCodePoint(...t),cP=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:wr},fw=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},AC=function(t,e,n){let r=0;for(t=n?_r(t/rP):t>>1,t+=_r(t/e);t>n0*pu>>1;r+=wr)t=_r(t/n0);return _r(r+(n0+1)*t/(t+nP))},TC=function(t){const e=[],n=t.length;let r=0,i=vC,s=_C,o=t.lastIndexOf(xC);o<0&&(o=0);for(let l=0;l<o;++l)t.charCodeAt(l)>=128&&Ei("not-basic"),e.push(t.charCodeAt(l));for(let l=o>0?o+1:0;l<n;){const a=r;for(let c=1,d=wr;;d+=wr){l>=n&&Ei("invalid-input");const f=cP(t.charCodeAt(l++));f>=wr&&Ei("invalid-input"),f>_r((Jo-r)/c)&&Ei("overflow"),r+=f*c;const h=d<=s?fb:d>=s+pu?pu:d-s;if(f<h)break;const p=wr-h;c>_r(Jo/p)&&Ei("overflow"),c*=p}const u=e.length+1;s=AC(r-a,u,a==0),_r(r/u)>Jo-i&&Ei("overflow"),i+=_r(r/u),r%=u,e.splice(r++,0,i)}return String.fromCodePoint(...e)},NC=function(t){const e=[];t=CC(t);const n=t.length;let r=vC,i=0,s=_C;for(const a of t)a<128&&e.push(r0(a));const o=e.length;let l=o;for(o&&e.push(xC);l<n;){let a=Jo;for(const c of t)c>=r&&c<a&&(a=c);const u=l+1;a-r>_r((Jo-i)/u)&&Ei("overflow"),i+=(a-r)*u,r=a;for(const c of t)if(c<r&&++i>Jo&&Ei("overflow"),c===r){let d=i;for(let f=wr;;f+=wr){const h=f<=s?fb:f>=s+pu?pu:f-s;if(d<h)break;const p=d-h,g=wr-h;e.push(r0(fw(h+p%g,0))),d=_r(p/g)}e.push(r0(fw(d,0))),s=AC(i,u,l===o),i=0,++l}++i,++r}return e.join("")},dP=function(t){return SC(t,function(e){return iP.test(e)?TC(e.slice(4).toLowerCase()):e})},fP=function(t){return SC(t,function(e){return sP.test(e)?"xn--"+NC(e):e})},MC={version:"2.3.1",ucs2:{decode:CC,encode:uP},decode:TC,encode:NC,toASCII:fP,toUnicode:dP},hP={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},pP={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},gP={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},mP={default:hP,zero:pP,commonmark:gP},bP=/^(vbscript|javascript|file|data):/,yP=/^data:image\/(gif|png|jpeg|webp);/;function EP(t){const e=t.trim().toLowerCase();return bP.test(e)?yP.test(e):!0}const OC=["http:","https:","mailto:"];function kP(t){const e=ob(t,!0);if(e.hostname&&(!e.protocol||OC.indexOf(e.protocol)>=0))try{e.hostname=MC.toASCII(e.hostname)}catch{}return Ku(sb(e))}function wP(t){const e=ob(t,!0);if(e.hostname&&(!e.protocol||OC.indexOf(e.protocol)>=0))try{e.hostname=MC.toUnicode(e.hostname)}catch{}return gl(sb(e),gl.defaultChars+"%")}function Yn(t,e){if(!(this instanceof Yn))return new Yn(t,e);e||ab(t)||(e=t||{},t="default"),this.inline=new qu,this.block=new Th,this.core=new cb,this.renderer=new Ol,this.linkify=new Cn,this.validateLink=EP,this.normalizeLink=kP,this.normalizeLinkText=wP,this.utils=v5,this.helpers=Ch({},A5),this.options={},this.configure(t),e&&this.set(e)}Yn.prototype.set=function(t){return Ch(this.options,t),this};Yn.prototype.configure=function(t){const e=this;if(ab(t)){const n=t;if(t=mP[n],!t)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(n){t.components[n].rules&&e[n].ruler.enableOnly(t.components[n].rules),t.components[n].rules2&&e[n].ruler2.enableOnly(t.components[n].rules2)}),this};Yn.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};Yn.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};Yn.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};Yn.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");const n=new this.core.State(t,this,e);return this.core.process(n),n.tokens};Yn.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};Yn.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};Yn.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const _P=new u1({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>({params:t.getAttribute("data-params")||""})}],toDOM(t){return["pre",t.attrs.params?{"data-params":t.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1,tight:t.hasAttribute("data-tight")}}}],toDOM(t){return["ol",{start:t.attrs.order==1?null:t.attrs.order,"data-tight":t.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:t=>({tight:t.hasAttribute("data-tight")})}],toDOM(t){return["ul",{"data-tight":t.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){return["a",t.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function vP(t,e){if(t.isText&&e.isText&&Ee.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}class xP{constructor(e,n){this.schema=e,this.tokenHandlers=n,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:Ee.none}]}top(){return this.stack[this.stack.length-1]}push(e){this.stack.length&&this.top().content.push(e)}addText(e){if(!e)return;let n=this.top(),r=n.content,i=r[r.length-1],s=this.schema.text(e,n.marks),o;i&&(o=vP(i,s))?r[r.length-1]=o:r.push(s)}openMark(e){let n=this.top();n.marks=e.addToSet(n.marks)}closeMark(e){let n=this.top();n.marks=e.removeFromSet(n.marks)}parseTokens(e){for(let n=0;n<e.length;n++){let r=e[n],i=this.tokenHandlers[r.type];if(!i)throw new Error("Token type `"+r.type+"` not supported by Markdown parser");i(this,r,e,n)}}addNode(e,n,r){let i=this.top(),s=e.createAndFill(n,r,i?i.marks:[]);return s?(this.push(s),s):null}openNode(e,n){this.stack.push({type:e,attrs:n,content:[],marks:Ee.none})}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content)}}function Xl(t,e,n,r){return t.getAttrs?t.getAttrs(e,n,r):t.attrs instanceof Function?t.attrs(e):t.attrs}function i0(t,e){return t.noCloseToken||e=="code_inline"||e=="code_block"||e=="fence"}function hw(t){return t[t.length-1]==`
|
|
152
|
+
`?t.slice(0,t.length-1):t}function s0(){}function SP(t,e){let n=Object.create(null);for(let r in e){let i=e[r];if(i.block){let s=t.nodeType(i.block);i0(i,r)?n[r]=(o,l,a,u)=>{o.openNode(s,Xl(i,l,a,u)),o.addText(hw(l.content)),o.closeNode()}:(n[r+"_open"]=(o,l,a,u)=>o.openNode(s,Xl(i,l,a,u)),n[r+"_close"]=o=>o.closeNode())}else if(i.node){let s=t.nodeType(i.node);n[r]=(o,l,a,u)=>o.addNode(s,Xl(i,l,a,u))}else if(i.mark){let s=t.marks[i.mark];i0(i,r)?n[r]=(o,l,a,u)=>{o.openMark(s.create(Xl(i,l,a,u))),o.addText(hw(l.content)),o.closeMark(s)}:(n[r+"_open"]=(o,l,a,u)=>o.openMark(s.create(Xl(i,l,a,u))),n[r+"_close"]=o=>o.closeMark(s))}else if(i.ignore)i0(i,r)?n[r]=s0:(n[r+"_open"]=s0,n[r+"_close"]=s0);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(i))}return n.text=(r,i)=>r.addText(i.content),n.inline=(r,i)=>r.parseTokens(i.children),n.softbreak=n.softbreak||(r=>r.addText(" ")),n}class CP{constructor(e,n,r){this.schema=e,this.tokenizer=n,this.tokens=r,this.tokenHandlers=SP(e,r)}parse(e,n={}){let r=new xP(this.schema,this.tokenHandlers),i;r.parseTokens(this.tokenizer.parse(e,n));do i=r.closeNode();while(r.stack.length);return i||this.schema.topNodeType.createAndFill()}}function pw(t,e){for(;++e<t.length;)if(t[e].type!="list_item_open")return t[e].hidden;return!1}new CP(_P,Yn("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(t,e,n)=>({tight:pw(e,n)})},ordered_list:{block:"ordered_list",getAttrs:(t,e,n)=>({order:+t.attrGet("start")||1,tight:pw(e,n)})},heading:{block:"heading",getAttrs:t=>({level:+t.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:t=>({params:t.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:t=>({src:t.attrGet("src"),title:t.attrGet("title")||null,alt:t.children[0]&&t.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:t=>({href:t.attrGet("href"),title:t.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});const AP={open:"",close:"",mixable:!0};class TP{constructor(e,n,r={}){this.nodes=e,this.marks=n,this.options=r}serialize(e,n={}){n=Object.assign({},this.options,n);let r=new MP(this.nodes,this.marks,n);return r.renderContent(e),r.out}}const pW=new TP({blockquote(t,e){t.wrapBlock("> ",null,e,()=>t.renderContent(e))},code_block(t,e){const n=e.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";t.write(r+(e.attrs.params||"")+`
|
|
153
|
+
`),t.text(e.textContent,!1),t.write(`
|
|
154
|
+
`),t.write(r),t.closeBlock(e)},heading(t,e){t.write(t.repeat("#",e.attrs.level)+" "),t.renderInline(e,!1),t.closeBlock(e)},horizontal_rule(t,e){t.write(e.attrs.markup||"---"),t.closeBlock(e)},bullet_list(t,e){t.renderList(e," ",()=>(e.attrs.bullet||"*")+" ")},ordered_list(t,e){let n=e.attrs.order||1,r=String(n+e.childCount-1).length,i=t.repeat(" ",r+2);t.renderList(e,i,s=>{let o=String(n+s);return t.repeat(" ",r-o.length)+o+". "})},list_item(t,e){t.renderContent(e)},paragraph(t,e){t.renderInline(e),t.closeBlock(e)},image(t,e){t.write("]/g,"\\$&")+(e.attrs.title?' "'+e.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(t,e,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=e.type){t.write(`\\
|
|
155
|
+
`);return}},text(t,e){t.text(e.text,!t.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(t,e,n,r){return t.inAutolink=NP(e,n,r),t.inAutolink?"<":"["},close(t,e,n,r){let{inAutolink:i}=t;return t.inAutolink=void 0,i?">":"]("+e.attrs.href.replace(/[\(\)"]/g,"\\$&")+(e.attrs.title?` "${e.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(t,e,n,r){return gw(n.child(r),-1)},close(t,e,n,r){return gw(n.child(r-1),1)},escape:!1}});function gw(t,e){let n=/`+/g,r,i=0;if(t.isText)for(;r=n.exec(t.text);)i=Math.max(i,r[0].length);let s=i>0&&e>0?" `":"`";for(let o=0;o<i;o++)s+="`";return i>0&&e<0&&(s+=" "),s}function NP(t,e,n){if(t.attrs.title||!/^\w+:/.test(t.attrs.href))return!1;let r=e.child(n);return!r.isText||r.text!=t.attrs.href||r.marks[r.marks.length-1]!=t?!1:n==e.childCount-1||!t.isInSet(e.child(n+1).marks)}let MP=class{constructor(e,n,r){this.nodes=e,this.marks=n,this.options=r,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(e=2){if(this.closed){if(this.atBlank()||(this.out+=`
|
|
156
|
+
`),e>1){let n=this.delim,r=/\s+$/.exec(n);r&&(n=n.slice(0,n.length-r[0].length));for(let i=1;i<e;i++)this.out+=n+`
|
|
157
|
+
`}this.closed=null}}getMark(e){let n=this.marks[e];if(!n){if(this.options.strict!==!1)throw new Error(`Mark type \`${e}\` not supported by Markdown renderer`);n=AP}return n}wrapBlock(e,n,r,i){let s=this.delim;this.write(n??e),this.delim+=e,i(),this.delim=s,this.closeBlock(r)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
|
|
158
|
+
`)}write(e){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),e&&(this.out+=e)}closeBlock(e){this.closed=e}text(e,n=!0){let r=e.split(`
|
|
159
|
+
`);for(let i=0;i<r.length;i++)this.write(),!n&&r[i][0]=="["&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=n?this.esc(r[i],this.atBlockStart):r[i],i!=r.length-1&&(this.out+=`
|
|
160
|
+
`)}render(e,n,r){if(this.nodes[e.type.name])this.nodes[e.type.name](this,e,n,r);else{if(this.options.strict!==!1)throw new Error("Token type `"+e.type.name+"` not supported by Markdown renderer");e.type.isLeaf||(e.type.inlineContent?this.renderInline(e):this.renderContent(e),e.isBlock&&this.closeBlock(e))}}renderContent(e){e.forEach((n,r,i)=>this.render(n,e,i))}renderInline(e,n=!0){this.atBlockStart=n;let r=[],i="",s=(o,l,a)=>{let u=o?o.marks:[];o&&o.type.name===this.options.hardBreakNodeName&&(u=u.filter(g=>{if(a+1==e.childCount)return!1;let b=e.child(a+1);return g.isInSet(b.marks)&&(!b.isText||/\S/.test(b.text))}));let c=i;if(i="",o&&o.isText&&u.some(g=>{let b=this.getMark(g.type.name);return b&&b.expelEnclosingWhitespace&&!g.isInSet(r)})){let[g,b,m]=/^(\s*)(.*)$/m.exec(o.text);b&&(c+=b,o=m?o.withText(m):null,o||(u=r))}if(o&&o.isText&&u.some(g=>{let b=this.getMark(g.type.name);return b&&b.expelEnclosingWhitespace&&!this.isMarkAhead(e,a+1,g)})){let[g,b,m]=/^(.*?)(\s*)$/m.exec(o.text);m&&(i=m,o=b?o.withText(b):null,o||(u=r))}let d=u.length?u[u.length-1]:null,f=d&&this.getMark(d.type.name).escape===!1,h=u.length-(f?1:0);e:for(let g=0;g<h;g++){let b=u[g];if(!this.getMark(b.type.name).mixable)break;for(let m=0;m<r.length;m++){let E=r[m];if(!this.getMark(E.type.name).mixable)break;if(b.eq(E)){g>m?u=u.slice(0,m).concat(b).concat(u.slice(m,g)).concat(u.slice(g+1,h)):m>g&&(u=u.slice(0,g).concat(u.slice(g+1,m)).concat(b).concat(u.slice(m,h)));continue e}}}let p=0;for(;p<Math.min(r.length,h)&&u[p].eq(r[p]);)++p;for(;p<r.length;)this.text(this.markString(r.pop(),!1,e,a),!1);if(c&&this.text(c),o){for(;r.length<h;){let g=u[r.length];r.push(g),this.text(this.markString(g,!0,e,a),!1),this.atBlockStart=!1}f&&o.isText?this.text(this.markString(d,!0,e,a)+o.text+this.markString(d,!1,e,a+1),!1):this.render(o,e,a),this.atBlockStart=!1}o?.isText&&o.nodeSize>0&&(this.atBlockStart=!1)};e.forEach(s),s(null,0,e.childCount),this.atBlockStart=!1}renderList(e,n,r){this.closed&&this.closed.type==e.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let i=typeof e.attrs.tight<"u"?e.attrs.tight:this.options.tightLists,s=this.inTightList;this.inTightList=i,e.forEach((o,l,a)=>{a&&i&&this.flushClose(1),this.wrapBlock(n,r(a),e,()=>this.render(o,e,a))}),this.inTightList=s}esc(e,n=!1){return e=e.replace(/[`*\\~\[\]_]/g,(r,i)=>r=="_"&&i>0&&i+1<e.length&&e[i-1].match(/\w/)&&e[i+1].match(/\w/)?r:"\\"+r),n&&(e=e.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(e=e.replace(this.options.escapeExtraCharacters,"\\$&")),e}quote(e){let n=e.indexOf('"')==-1?'""':e.indexOf("'")==-1?"''":"()";return n[0]+e+n[1]}repeat(e,n){let r="";for(let i=0;i<n;i++)r+=e;return r}markString(e,n,r,i){let s=this.getMark(e.type.name),o=n?s.open:s.close;return typeof o=="string"?o:o(this,e,r,i)}getEnclosingWhitespace(e){return{leading:(e.match(/^(\s+)/)||[void 0])[0],trailing:(e.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(e,n,r){for(;;n++){if(n>=e.childCount)return!1;let i=e.child(n);if(i.type.name!=this.options.hardBreakNodeName)return r.isInSet(i.marks);n++}}};const mW=et.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=t?.node||this.editor.state.doc;if((t?.mode||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=t?.node||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Ae({key:new Le("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const i=this.options.limit;if(i==null||i===0){t=!0;return}const s=this.storage.characters({node:r.doc});if(s>i){const o=s-i,l=0,a=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(l,a);return t=!0,u}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||i>r&&s>r&&s<=i)return!0;if(i>r&&s>r&&s>i||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,a=s-r,u=l-a,c=l;return e.deleteRange(u,c),!(this.storage.characters({node:e.doc})>r)}})]}});function OP(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function DC(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&DC(n)}),t}let mw=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function RC(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ri(t,...e){const n=Object.create(null);for(const r in t)n[r]=t[r];return e.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const DP="</span>",bw=t=>!!t.scope,RP=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`};let IP=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=RC(e)}openNode(e){if(!bw(e))return;const n=RP(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){bw(e)&&(this.buffer+=DP)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}};const yw=(t={})=>{const e={children:[]};return Object.assign(e,t),e};let LP=class IC{constructor(){this.rootNode=yw(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n=yw({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{IC._collapse(n)}))}},PP=class extends LP{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){const r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new IP(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function gu(t){return t?typeof t=="string"?t:t.source:null}function LC(t){return ao("(?=",t,")")}function FP(t){return ao("(?:",t,")*")}function BP(t){return ao("(?:",t,")?")}function ao(...t){return t.map(n=>gu(n)).join("")}function zP(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function hb(...t){return"("+(zP(t).capture?"":"?:")+t.map(r=>gu(r)).join("|")+")"}function PC(t){return new RegExp(t.toString()+"|").exec("").length-1}function $P(t,e){const n=t&&t.exec(e);return n&&n.index===0}const UP=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function pb(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;const i=n;let s=gu(r),o="";for(;s.length>0;){const l=UP.exec(s);if(!l){o+=s;break}o+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?o+="\\"+String(Number(l[1])+i):(o+=l[0],l[0]==="("&&n++)}return o}).map(r=>`(${r})`).join(e)}const HP=/\b\B/,FC="[a-zA-Z]\\w*",gb="[a-zA-Z_]\\w*",BC="\\b\\d+(\\.\\d+)?",zC="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",$C="\\b(0b[01]+)",VP="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",WP=(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=ao(e,/.*\b/,t.binary,/\b.*/)),Ri({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},mu={begin:"\\\\[\\s\\S]",relevance:0},KP={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[mu]},jP={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[mu]},qP={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Mh=function(t,e,n={}){const r=Ri({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=hb("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:ao(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},GP=Mh("//","$"),YP=Mh("/\\*","\\*/"),JP=Mh("#","$"),ZP={scope:"number",begin:BC,relevance:0},XP={scope:"number",begin:zC,relevance:0},QP={scope:"number",begin:$C,relevance:0},eF={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[mu,{begin:/\[/,end:/\]/,relevance:0,contains:[mu]}]},tF={scope:"title",begin:FC,relevance:0},nF={scope:"title",begin:gb,relevance:0},rF={begin:"\\.\\s*"+gb,relevance:0},iF=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})};var Oc=Object.freeze({__proto__:null,APOS_STRING_MODE:KP,BACKSLASH_ESCAPE:mu,BINARY_NUMBER_MODE:QP,BINARY_NUMBER_RE:$C,COMMENT:Mh,C_BLOCK_COMMENT_MODE:YP,C_LINE_COMMENT_MODE:GP,C_NUMBER_MODE:XP,C_NUMBER_RE:zC,END_SAME_AS_BEGIN:iF,HASH_COMMENT_MODE:JP,IDENT_RE:FC,MATCH_NOTHING_RE:HP,METHOD_GUARD:rF,NUMBER_MODE:ZP,NUMBER_RE:BC,PHRASAL_WORDS_MODE:qP,QUOTE_STRING_MODE:jP,REGEXP_MODE:eF,RE_STARTERS_RE:VP,SHEBANG:WP,TITLE_MODE:tF,UNDERSCORE_IDENT_RE:gb,UNDERSCORE_TITLE_MODE:nF});function sF(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function oF(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function lF(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=sF,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function aF(t,e){Array.isArray(t.illegal)&&(t.illegal=hb(...t.illegal))}function uF(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function cF(t,e){t.relevance===void 0&&(t.relevance=1)}const dF=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=ao(n.beforeMatch,LC(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},fF=["of","and","for","in","not","or","if","then","parent","list","value"],hF="keyword";function UC(t,e,n=hF){const r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(s){Object.assign(r,UC(t[s],e,s))}),r;function i(s,o){e&&(o=o.map(l=>l.toLowerCase())),o.forEach(function(l){const a=l.split("|");r[a[0]]=[s,pF(a[0],a[1])]})}}function pF(t,e){return e?Number(e):gF(t)?0:1}function gF(t){return fF.includes(t.toLowerCase())}const Ew={},Bs=t=>{console.error(t)},kw=(t,...e)=>{console.log(`WARN: ${t}`,...e)},Eo=(t,e)=>{Ew[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),Ew[`${t}/${e}`]=!0)},Rf=new Error;function HC(t,e,{key:n}){let r=0;const i=t[n],s={},o={};for(let l=1;l<=e.length;l++)o[l+r]=i[l],s[l+r]=!0,r+=PC(e[l-1]);t[n]=o,t[n]._emit=s,t[n]._multi=!0}function mF(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Bs("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Rf;if(typeof t.beginScope!="object"||t.beginScope===null)throw Bs("beginScope must be object"),Rf;HC(t,t.begin,{key:"beginScope"}),t.begin=pb(t.begin,{joinWith:""})}}function bF(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Bs("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Rf;if(typeof t.endScope!="object"||t.endScope===null)throw Bs("endScope must be object"),Rf;HC(t,t.end,{key:"endScope"}),t.end=pb(t.end,{joinWith:""})}}function yF(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function EF(t){yF(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),mF(t),bF(t)}function kF(t){function e(o,l){return new RegExp(gu(o),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,a){a.position=this.position++,this.matchIndexes[this.matchAt]=a,this.regexes.push([a,l]),this.matchAt+=PC(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(a=>a[1]);this.matcherRe=e(pb(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const a=this.matcherRe.exec(l);if(!a)return null;const u=a.findIndex((d,f)=>f>0&&d!==void 0),c=this.matchIndexes[u];return a.splice(0,u),Object.assign(a,c)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const a=new n;return this.rules.slice(l).forEach(([u,c])=>a.addRule(u,c)),a.compile(),this.multiRegexes[l]=a,a}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,a){this.rules.push([l,a]),a.type==="begin"&&this.count++}exec(l){const a=this.getMatcher(this.regexIndex);a.lastIndex=this.lastIndex;let u=a.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const c=this.getMatcher(0);c.lastIndex=this.lastIndex+1,u=c.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function i(o){const l=new r;return o.contains.forEach(a=>l.addRule(a.begin,{rule:a,type:"begin"})),o.terminatorEnd&&l.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&l.addRule(o.illegal,{type:"illegal"}),l}function s(o,l){const a=o;if(o.isCompiled)return a;[oF,uF,EF,dF].forEach(c=>c(o,l)),t.compilerExtensions.forEach(c=>c(o,l)),o.__beforeBegin=null,[lF,aF,cF].forEach(c=>c(o,l)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=UC(o.keywords,t.case_insensitive)),a.keywordPatternRe=e(u,!0),l&&(o.begin||(o.begin=/\B|\b/),a.beginRe=e(a.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(a.endRe=e(a.end)),a.terminatorEnd=gu(a.end)||"",o.endsWithParent&&l.terminatorEnd&&(a.terminatorEnd+=(o.end?"|":"")+l.terminatorEnd)),o.illegal&&(a.illegalRe=e(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(c){return wF(c==="self"?o:c)})),o.contains.forEach(function(c){s(c,a)}),o.starts&&s(o.starts,l),a.matcher=i(a),a}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Ri(t.classNameAliases||{}),s(t)}function VC(t){return t?t.endsWithParent||VC(t.starts):!1}function wF(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Ri(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:VC(t)?Ri(t,{starts:t.starts?Ri(t.starts):null}):Object.isFrozen(t)?Ri(t):t}var _F="11.10.0";let vF=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}};const o0=RC,ww=Ri,_w=Symbol("nomatch"),xF=7,WC=function(t){const e=Object.create(null),n=Object.create(null),r=[];let i=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:PP};function a(C){return l.noHighlightRe.test(C)}function u(C){let v=C.className+" ";v+=C.parentNode?C.parentNode.className:"";const T=l.languageDetectRe.exec(v);if(T){const D=O(T[1]);return D||(kw(s.replace("{}",T[1])),kw("Falling back to no-highlight mode for this block.",C)),D?T[1]:"no-highlight"}return v.split(/\s+/).find(D=>a(D)||O(D))}function c(C,v,T){let D="",B="";typeof v=="object"?(D=C,T=v.ignoreIllegals,B=v.language):(Eo("10.7.0","highlight(lang, code, ...args) has been deprecated."),Eo("10.7.0",`Please use highlight(code, options) instead.
|
|
161
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),B=C,D=v),T===void 0&&(T=!0);const V={code:D,language:B};Z("before:highlight",V);const de=V.result?V.result:d(V.language,V.code,T);return de.code=V.code,Z("after:highlight",de),de}function d(C,v,T,D){const B=Object.create(null);function V(N,I){return N.keywords[I]}function de(){if(!Q.keywords){ee.addText(pe);return}let N=0;Q.keywordPatternRe.lastIndex=0;let I=Q.keywordPatternRe.exec(pe),H="";for(;I;){H+=pe.substring(N,I.index);const re=oe.case_insensitive?I[0].toLowerCase():I[0],ve=V(Q,re);if(ve){const[hn,$l]=ve;if(ee.addText(H),H="",B[re]=(B[re]||0)+1,B[re]<=xF&&(Ze+=$l),hn.startsWith("_"))H+=I[0];else{const M=oe.classNameAliases[hn]||hn;ge(I[0],M)}}else H+=I[0];N=Q.keywordPatternRe.lastIndex,I=Q.keywordPatternRe.exec(pe)}H+=pe.substring(N),ee.addText(H)}function fe(){if(pe==="")return;let N=null;if(typeof Q.subLanguage=="string"){if(!e[Q.subLanguage]){ee.addText(pe);return}N=d(Q.subLanguage,pe,!0,ye[Q.subLanguage]),ye[Q.subLanguage]=N._top}else N=h(pe,Q.subLanguage.length?Q.subLanguage:null);Q.relevance>0&&(Ze+=N.relevance),ee.__addSublanguage(N._emitter,N.language)}function ie(){Q.subLanguage!=null?fe():de(),pe=""}function ge(N,I){N!==""&&(ee.startScope(I),ee.addText(N),ee.endScope())}function nt(N,I){let H=1;const re=I.length-1;for(;H<=re;){if(!N._emit[H]){H++;continue}const ve=oe.classNameAliases[N[H]]||N[H],hn=I[H];ve?ge(hn,ve):(pe=hn,de(),pe=""),H++}}function at(N,I){return N.scope&&typeof N.scope=="string"&&ee.openNode(oe.classNameAliases[N.scope]||N.scope),N.beginScope&&(N.beginScope._wrap?(ge(pe,oe.classNameAliases[N.beginScope._wrap]||N.beginScope._wrap),pe=""):N.beginScope._multi&&(nt(N.beginScope,I),pe="")),Q=Object.create(N,{parent:{value:Q}}),Q}function fn(N,I,H){let re=$P(N.endRe,H);if(re){if(N["on:end"]){const ve=new mw(N);N["on:end"](I,ve),ve.isMatchIgnored&&(re=!1)}if(re){for(;N.endsParent&&N.parent;)N=N.parent;return N}}if(N.endsWithParent)return fn(N.parent,I,H)}function Jt(N){return Q.matcher.regexIndex===0?(pe+=N[0],1):(z=!0,0)}function Nn(N){const I=N[0],H=N.rule,re=new mw(H),ve=[H.__beforeBegin,H["on:begin"]];for(const hn of ve)if(hn&&(hn(N,re),re.isMatchIgnored))return Jt(I);return H.skip?pe+=I:(H.excludeBegin&&(pe+=I),ie(),!H.returnBegin&&!H.excludeBegin&&(pe=I)),at(H,N),H.returnBegin?0:I.length}function dr(N){const I=N[0],H=v.substring(N.index),re=fn(Q,N,H);if(!re)return _w;const ve=Q;Q.endScope&&Q.endScope._wrap?(ie(),ge(I,Q.endScope._wrap)):Q.endScope&&Q.endScope._multi?(ie(),nt(Q.endScope,N)):ve.skip?pe+=I:(ve.returnEnd||ve.excludeEnd||(pe+=I),ie(),ve.excludeEnd&&(pe=I));do Q.scope&&ee.closeNode(),!Q.skip&&!Q.subLanguage&&(Ze+=Q.relevance),Q=Q.parent;while(Q!==re.parent);return re.starts&&at(re.starts,N),ve.returnEnd?0:I.length}function Zt(){const N=[];for(let I=Q;I!==oe;I=I.parent)I.scope&&N.unshift(I.scope);N.forEach(I=>ee.openNode(I))}let Xt={};function Je(N,I){const H=I&&I[0];if(pe+=N,H==null)return ie(),0;if(Xt.type==="begin"&&I.type==="end"&&Xt.index===I.index&&H===""){if(pe+=v.slice(I.index,I.index+1),!i){const re=new Error(`0 width match regex (${C})`);throw re.languageName=C,re.badRule=Xt.rule,re}return 1}if(Xt=I,I.type==="begin")return Nn(I);if(I.type==="illegal"&&!T){const re=new Error('Illegal lexeme "'+H+'" for mode "'+(Q.scope||"<unnamed>")+'"');throw re.mode=Q,re}else if(I.type==="end"){const re=dr(I);if(re!==_w)return re}if(I.type==="illegal"&&H==="")return 1;if(Mn>1e5&&Mn>I.index*3)throw new Error("potential infinite loop, way more iterations than matches");return pe+=H,H.length}const oe=O(C);if(!oe)throw Bs(s.replace("{}",C)),new Error('Unknown language: "'+C+'"');const Tt=kF(oe);let Y="",Q=D||Tt;const ye={},ee=new l.__emitter(l);Zt();let pe="",Ze=0,Et=0,Mn=0,z=!1;try{if(oe.__emitTokens)oe.__emitTokens(v,ee);else{for(Q.matcher.considerAll();;){Mn++,z?z=!1:Q.matcher.considerAll(),Q.matcher.lastIndex=Et;const N=Q.matcher.exec(v);if(!N)break;const I=v.substring(Et,N.index),H=Je(I,N);Et=N.index+H}Je(v.substring(Et))}return ee.finalize(),Y=ee.toHTML(),{language:C,value:Y,relevance:Ze,illegal:!1,_emitter:ee,_top:Q}}catch(N){if(N.message&&N.message.includes("Illegal"))return{language:C,value:o0(v),illegal:!0,relevance:0,_illegalBy:{message:N.message,index:Et,context:v.slice(Et-100,Et+100),mode:N.mode,resultSoFar:Y},_emitter:ee};if(i)return{language:C,value:o0(v),illegal:!1,relevance:0,errorRaised:N,_emitter:ee,_top:Q};throw N}}function f(C){const v={value:o0(C),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return v._emitter.addText(C),v}function h(C,v){v=v||l.languages||Object.keys(e);const T=f(C),D=v.filter(O).filter(G).map(ie=>d(ie,C,!1));D.unshift(T);const B=D.sort((ie,ge)=>{if(ie.relevance!==ge.relevance)return ge.relevance-ie.relevance;if(ie.language&&ge.language){if(O(ie.language).supersetOf===ge.language)return 1;if(O(ge.language).supersetOf===ie.language)return-1}return 0}),[V,de]=B,fe=V;return fe.secondBest=de,fe}function p(C,v,T){const D=v&&n[v]||T;C.classList.add("hljs"),C.classList.add(`language-${D}`)}function g(C){let v=null;const T=u(C);if(a(T))return;if(Z("before:highlightElement",{el:C,language:T}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(C)),l.throwUnescapedHTML))throw new vF("One of your code blocks includes unescaped HTML.",C.innerHTML);v=C;const D=v.textContent,B=T?c(D,{language:T,ignoreIllegals:!0}):h(D);C.innerHTML=B.value,C.dataset.highlighted="yes",p(C,T,B.language),C.result={language:B.language,re:B.relevance,relevance:B.relevance},B.secondBest&&(C.secondBest={language:B.secondBest.language,relevance:B.secondBest.relevance}),Z("after:highlightElement",{el:C,result:B,text:D})}function b(C){l=ww(l,C)}const m=()=>{y(),Eo("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function E(){y(),Eo("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function y(){if(document.readyState==="loading"){k=!0;return}document.querySelectorAll(l.cssSelector).forEach(g)}function _(){k&&y()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",_,!1);function w(C,v){let T=null;try{T=v(t)}catch(D){if(Bs("Language definition for '{}' could not be registered.".replace("{}",C)),i)Bs(D);else throw D;T=o}T.name||(T.name=C),e[C]=T,T.rawDefinition=v.bind(null,t),T.aliases&&L(T.aliases,{languageName:C})}function x(C){delete e[C];for(const v of Object.keys(n))n[v]===C&&delete n[v]}function S(){return Object.keys(e)}function O(C){return C=(C||"").toLowerCase(),e[C]||e[n[C]]}function L(C,{languageName:v}){typeof C=="string"&&(C=[C]),C.forEach(T=>{n[T.toLowerCase()]=v})}function G(C){const v=O(C);return v&&!v.disableAutodetect}function U(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=v=>{C["before:highlightBlock"](Object.assign({block:v.el},v))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=v=>{C["after:highlightBlock"](Object.assign({block:v.el},v))})}function j(C){U(C),r.push(C)}function te(C){const v=r.indexOf(C);v!==-1&&r.splice(v,1)}function Z(C,v){const T=C;r.forEach(function(D){D[T]&&D[T](v)})}function A(C){return Eo("10.7.0","highlightBlock will be removed entirely in v12.0"),Eo("10.7.0","Please use highlightElement now."),g(C)}Object.assign(t,{highlight:c,highlightAuto:h,highlightAll:y,highlightElement:g,highlightBlock:A,configure:b,initHighlighting:m,initHighlightingOnLoad:E,registerLanguage:w,unregisterLanguage:x,listLanguages:S,getLanguage:O,registerAliases:L,autoDetection:G,inherit:ww,addPlugin:j,removePlugin:te}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=_F,t.regex={concat:ao,lookahead:LC,either:hb,optional:BP,anyNumberOfTimes:FP};for(const C in Oc)typeof Oc[C]=="object"&&DC(Oc[C]);return Object.assign(t,Oc),t},bl=WC({});bl.newInstance=()=>WC({});var SF=bl;bl.HighlightJS=bl;bl.default=bl;var CF=OP(SF);function KC(t,e=[]){return t.map(n=>{const r=[...e,...n.properties?n.properties.className:[]];return n.children?KC(n.children,r):{text:n.value,classes:r}}).flat()}function vw(t){return t.value||t.children||[]}function AF(t){return!!CF.getLanguage(t)}function xw({doc:t,name:e,lowlight:n,defaultLanguage:r}){const i=[];return Rg(t,s=>s.type.name===e).forEach(s=>{var o;let l=s.pos+1;const a=s.node.attrs.language||r,u=n.listLanguages(),c=a&&(u.includes(a)||AF(a)||!((o=n.registered)===null||o===void 0)&&o.call(n,a))?vw(n.highlight(a,s.node.textContent)):vw(n.highlightAuto(s.node.textContent));KC(c).forEach(d=>{const f=l+d.text.length;if(d.classes.length){const h=ot.inline(l,f,{class:d.classes.join(" ")});i.push(h)}l=f})}),Te.create(t,i)}function TF(t){return typeof t=="function"}function NF({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>TF(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new Ae({key:new Le("lowlight"),state:{init:(i,{doc:s})=>xw({doc:s,name:t,lowlight:e,defaultLanguage:n}),apply:(i,s,o,l)=>{const a=o.selection.$head.parent.type.name,u=l.selection.$head.parent.type.name,c=Rg(o.doc,f=>f.type.name===t),d=Rg(l.doc,f=>f.type.name===t);return i.docChanged&&([a,u].includes(t)||d.length!==c.length||i.steps.some(f=>f.from!==void 0&&f.to!==void 0&&c.some(h=>h.pos>=f.from&&h.pos+h.node.nodeSize<=f.to)))?xw({doc:i.doc,name:t,lowlight:e,defaultLanguage:n}):s.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}const wW=eC.extend({addOptions(){var t;return{...(t=this.parent)===null||t===void 0?void 0:t.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var t;return[...((t=this.parent)===null||t===void 0?void 0:t.call(this))||[],NF({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),MF=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,OF=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/g,jC=t=>t.match(MF),DF=(t,e)=>e?"https://www.youtube-nocookie.com/embed/videoseries?list=":t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",RF=t=>t.searchParams.has("v")?{id:t.searchParams.get("v")}:t.hostname==="youtu.be"||t.pathname.includes("shorts")||t.pathname.includes("live")?{id:t.pathname.split("/").pop()}:t.searchParams.has("list")?{id:t.searchParams.get("list"),isPlaylist:!0}:null,IF=t=>{var e;const{url:n,allowFullscreen:r,autoplay:i,ccLanguage:s,ccLoadPolicy:o,controls:l,disableKBcontrols:a,enableIFrameApi:u,endTime:c,interfaceLanguage:d,ivLoadPolicy:f,loop:h,modestBranding:p,nocookie:g,origin:b,playlist:m,progressBarColor:E,startAt:k,rel:y}=t;if(!jC(n))return null;if(n.includes("/embed/"))return n;const _=new URL(n),{id:w,isPlaylist:x}=(e=RF(_))!==null&&e!==void 0?e:{};if(!w)return null;const S=new URL(`${DF(g,x)}${w}`);return _.searchParams.has("t")&&S.searchParams.set("start",_.searchParams.get("t").replaceAll("s","")),r===!1&&S.searchParams.set("fs","0"),i&&S.searchParams.set("autoplay","1"),s&&S.searchParams.set("cc_lang_pref",s),o&&S.searchParams.set("cc_load_policy","1"),l||S.searchParams.set("controls","0"),a&&S.searchParams.set("disablekb","1"),u&&S.searchParams.set("enablejsapi","1"),c&&S.searchParams.set("end",c.toString()),d&&S.searchParams.set("hl",d),f&&S.searchParams.set("iv_load_policy",f.toString()),h&&S.searchParams.set("loop","1"),p&&S.searchParams.set("modestbranding","1"),b&&S.searchParams.set("origin",b),m&&S.searchParams.set("playlist",m),k&&S.searchParams.set("start",k.toString()),E&&S.searchParams.set("color",E),y!==void 0&&S.searchParams.set("rel",y.toString()),S.toString()},_W=Ke.create({name:"youtube",addOptions(){return{addPasteHandler:!0,allowFullscreen:!0,autoplay:!1,ccLanguage:void 0,ccLoadPolicy:void 0,controls:!0,disableKBcontrols:!1,enableIFrameApi:!1,endTime:0,height:480,interfaceLanguage:void 0,ivLoadPolicy:0,loop:!1,modestBranding:!1,HTMLAttributes:{},inline:!1,nocookie:!1,origin:"",playlist:"",progressBarColor:void 0,width:640,rel:1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},start:{default:0},width:{default:this.options.width},height:{default:this.options.height}}},parseHTML(){return[{tag:"div[data-youtube-video] iframe"}]},addCommands(){return{setYoutubeVideo:t=>({commands:e})=>jC(t.src)?e.insertContent({type:this.name,attrs:t}):!1}},addPasteRules(){return this.options.addPasteHandler?[l4({find:OF,type:this.type,getAttributes:t=>({src:t.input})})]:[]},renderHTML({HTMLAttributes:t}){const e=IF({url:t.src,allowFullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,controls:this.options.controls,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,nocookie:this.options.nocookie,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,startAt:t.start||0,rel:this.options.rel});return t.src=e,["div",{"data-youtube-video":""},["iframe",Ce(this.options.HTMLAttributes,{width:this.options.width,height:this.options.height,allowfullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,rel:this.options.rel},t)]]}});function LF(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:o,$position:l}=t,a=r&&!i,u=o4(n),c=new RegExp(`\\s${u}$`),d=o?"^":"",f=i?"":u,h=a?new RegExp(`${d}${u}.*?(?=\\s${f}|$)`,"gm"):new RegExp(`${d}(?:^)?${u}[^\\s${f}]*`,"gm"),p=((e=l.nodeBefore)===null||e===void 0?void 0:e.isText)&&l.nodeBefore.text;if(!p)return null;const g=l.pos-p.length,b=Array.from(p.matchAll(h)).pop();if(!b||b.input===void 0||b.index===void 0)return null;const m=b.input.slice(Math.max(0,b.index-1),b.index),E=new RegExp(`^[${s?.join("")}\0]?$`).test(m);if(s!==null&&!E)return null;const k=g+b.index;let y=k+b[0].length;return a&&c.test(p.slice(y-1,y+1))&&(b[0]+=" ",y+=1),k<l.pos&&y>=l.pos?{range:{from:k,to:y},query:b[0].slice(n.length),text:b[0]}:null}const PF=new Le("suggestion");function vW({pluginKey:t=PF,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:s=[" "],startOfLine:o=!1,decorationTag:l="span",decorationClass:a="suggestion",decorationContent:u="",decorationEmptyClass:c="is-empty",command:d=()=>null,items:f=()=>[],render:h=()=>({}),allow:p=()=>!0,findSuggestionMatch:g=LF}){let b;const m=h?.(),E=new Ae({key:t,view(){return{update:async(k,y)=>{var _,w,x,S,O,L,G;const U=(_=this.key)===null||_===void 0?void 0:_.getState(y),j=(w=this.key)===null||w===void 0?void 0:w.getState(k.state),te=U.active&&j.active&&U.range.from!==j.range.from,Z=!U.active&&j.active,A=U.active&&!j.active,C=!Z&&!A&&U.query!==j.query,v=Z||te&&C,T=C||te,D=A||te&&C;if(!v&&!T&&!D)return;const B=D&&!v?U:j,V=k.dom.querySelector(`[data-decoration-id="${B.decorationId}"]`);b={editor:e,range:B.range,query:B.query,text:B.text,items:[],command:de=>d({editor:e,range:B.range,props:de}),decorationNode:V,clientRect:V?()=>{var de;const{decorationId:fe}=(de=this.key)===null||de===void 0?void 0:de.getState(e.state),ie=k.dom.querySelector(`[data-decoration-id="${fe}"]`);return ie?.getBoundingClientRect()||null}:null},v&&((x=m?.onBeforeStart)===null||x===void 0||x.call(m,b)),T&&((S=m?.onBeforeUpdate)===null||S===void 0||S.call(m,b)),(T||v)&&(b.items=await f({editor:e,query:B.query})),D&&((O=m?.onExit)===null||O===void 0||O.call(m,b)),T&&((L=m?.onUpdate)===null||L===void 0||L.call(m,b)),v&&((G=m?.onStart)===null||G===void 0||G.call(m,b))},destroy:()=>{var k;b&&((k=m?.onExit)===null||k===void 0||k.call(m,b))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(k,y,_,w){const{isEditable:x}=e,{composing:S}=e.view,{selection:O}=k,{empty:L,from:G}=O,U={...y};if(U.composing=S,x&&(L||e.view.composing)){(G<y.range.from||G>y.range.to)&&!S&&!y.composing&&(U.active=!1);const j=g({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:o,$position:O.$from}),te=`id_${Math.floor(Math.random()*4294967295)}`;j&&p({editor:e,state:w,range:j.range,isActive:y.active})?(U.active=!0,U.decorationId=y.decorationId?y.decorationId:te,U.range=j.range,U.query=j.query,U.text=j.text):U.active=!1}else U.active=!1;return U.active||(U.decorationId=null,U.range={from:0,to:0},U.query=null,U.text=null),U}},props:{handleKeyDown(k,y){var _;const{active:w,range:x}=E.getState(k.state);return w&&((_=m?.onKeyDown)===null||_===void 0?void 0:_.call(m,{view:k,event:y,range:x}))||!1},decorations(k){const{active:y,range:_,decorationId:w,query:x}=E.getState(k);if(!y)return null;const S=!x?.length,O=[a];return S&&O.push(c),Te.create(k.doc,[ot.inline(_.from,_.to,{nodeName:l,class:O.join(" "),"data-decoration-id":w,"data-decoration-content":u})])}}});return E}function FF(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},h=e.optional(i)+t.IDENT_RE+"\\s*\\(",p=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],b=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],m=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],y={type:g,keyword:p,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:b},_={className:"function.dispatch",relevance:0,keywords:{_hint:m},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},w=[_,d,l,n,t.C_BLOCK_COMMENT_MODE,c,u],x={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:y,contains:w.concat([{begin:/\(/,end:/\)/,keywords:y,contains:w.concat(["self"]),relevance:0}]),relevance:0},S={className:"function",begin:"("+o+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:y,relevance:0},{begin:h,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,c]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,u,c,l,{begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,u,c,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:y,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(x,S,_,w,[d,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:y,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:y},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function BF(t){const e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=FF(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function zF(t){const e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(l);const a={match:/\\"/},u={className:"string",begin:/'/,end:/'/},c={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=t.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),p={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],b=["true","false"],m={match:/(\/[a-z._-]+)+/},E=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],y=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],_=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:g,literal:b,built_in:[...E,...k,"set","shopt",...y,..._]},contains:[h,t.SHEBANG(),p,d,s,o,m,l,a,u,c,n]}}function $F(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},h=e.optional(i)+t.IDENT_RE+"\\s*\\(",b={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},m=[d,l,n,t.C_BLOCK_COMMENT_MODE,c,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:b,contains:m.concat([{begin:/\(/,end:/\)/,keywords:b,contains:m.concat(["self"]),relevance:0}]),relevance:0},k={begin:"("+o+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:b,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:b,relevance:0},{begin:h,returnBegin:!0,contains:[t.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,u,c,l,{begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,u,c,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C",aliases:["h"],keywords:b,disableAutodetect:!0,illegal:"</",contains:[].concat(E,k,m,[d,{begin:t.IDENT_RE+"::",keywords:b},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:d,strings:u,keywords:b}}}function UF(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},h=e.optional(i)+t.IDENT_RE+"\\s*\\(",p=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],b=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],m=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],y={type:g,keyword:p,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:b},_={className:"function.dispatch",relevance:0,keywords:{_hint:m},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},w=[_,d,l,n,t.C_BLOCK_COMMENT_MODE,c,u],x={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:y,contains:w.concat([{begin:/\(/,end:/\)/,keywords:y,contains:w.concat(["self"]),relevance:0}]),relevance:0},S={className:"function",begin:"("+o+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:y,relevance:0},{begin:h,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,c]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,u,c,l,{begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,u,c,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:y,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(x,S,_,w,[d,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:y,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:y},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function HF(t){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:i.concat(s),built_in:e,literal:r},l=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},c={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},d=t.inherit(c,{illegal:/\n/}),f={className:"subst",begin:/\{/,end:/\}/,keywords:o},h=t.inherit(f,{illegal:/\n/}),p={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,h]},g={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]},b=t.inherit(g,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]});f.contains=[g,p,c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,a,t.C_BLOCK_COMMENT_MODE],h.contains=[b,p,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,a,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const m={variants:[u,g,p,c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},E={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},k=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",y={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},m,a,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,E,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,E,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+k+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,E],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[m,a,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},y]}}const VF=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),WF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],KF=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],jF=[...WF,...KF],qF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),GF=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),YF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),JF=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function ZF(t){const e=t.regex,n=VF(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",l=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+GF.join("|")+")"},{begin:":(:)?("+YF.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+JF.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:qF.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+jF.join("|")+")\\b"}]}}function XF(t){const e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function QF(t){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}function eB(t){const e=t.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(n,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function tB(t){const e=t.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},r=t.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},o={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},l={begin:/\[/,end:/\]/,contains:[r,s,i,o,n,"self"],relevance:0},a=/[A-Za-z0-9_-]+/,u=/"(\\"|[^"])*"/,c=/'[^']*'/,d=e.either(a,u,c),f=e.concat(d,"(\\s*\\.\\s*",d,")*",e.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:f,className:"attr",starts:{end:/$/,contains:[r,l,s,i,o,n]}}]}}var Co="[0-9](_*[0-9])*",Dc=`\\.(${Co})`,Rc="[0-9a-fA-F](_*[0-9a-fA-F])*",Sw={className:"number",variants:[{begin:`(\\b(${Co})((${Dc})|\\.)?|(${Dc}))[eE][+-]?(${Co})[fFdD]?\\b`},{begin:`\\b(${Co})((${Dc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Dc})[fFdD]?\\b`},{begin:`\\b(${Co})[fFdD]\\b`},{begin:`\\b0[xX]((${Rc})\\.?|(${Rc})?\\.(${Rc}))[pP][+-]?(${Co})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Rc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function qC(t,e,n){return n===-1?"":t.replace(e,r=>qC(t,e,n-1))}function nB(t){const e=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+qC("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),a={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},c={className:"params",begin:/\(/,end:/\)/,keywords:a,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:a,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[c,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:a,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:a,relevance:0,contains:[u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Sw,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Sw,u]}}const Cw="[A-Za-z$_][0-9A-Za-z$_]*",rB=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],iB=["true","false","null","undefined","NaN","Infinity"],GC=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],YC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],JC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],sB=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],oB=[].concat(JC,GC,YC);function lB(t){const e=t.regex,n=(v,{after:T})=>{const D="</"+v[0].slice(1);return v.input.indexOf(D,T)!==-1},r=Cw,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,T)=>{const D=v[0].length+v.index,B=v.input[D];if(B==="<"||B===","){T.ignoreMatch();return}B===">"&&(n(v,{after:D})||T.ignoreMatch());let V;const de=v.input.substring(D);if(V=de.match(/^\s*=/)){T.ignoreMatch();return}if((V=de.match(/^\s+extends\s+/))&&V.index===0){T.ignoreMatch();return}}},l={$pattern:Cw,keyword:rB,literal:iB,built_in:oB,"variable.language":sB},a="[0-9](_?[0-9])*",u=`\\.(${a})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${a})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},E={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,p,g,b,{match:/\$\d+/},d];f.contains=k.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(k)});const y=[].concat(E,f.contains),_=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(y)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:_},x={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},S={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...GC,...YC]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},L={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},G={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(v){return e.concat("(?!",v.join("|"),")")}const j={match:e.concat(/\b/,U([...JC,"super","import"].map(v=>`${v}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},te={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",C={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,p,g,b,E,{match:/\$\d+/},d,S,{scope:"attr",match:r+e.lookahead(":"),relevance:0},C,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,t.REGEXP_MODE,{className:"function",begin:A,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},L,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},te,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},j,G,x,Z,{match:/\$[(.]/}]}}function aB(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[e,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Ao="[0-9](_*[0-9])*",Ic=`\\.(${Ao})`,Lc="[0-9a-fA-F](_*[0-9a-fA-F])*",uB={className:"number",variants:[{begin:`(\\b(${Ao})((${Ic})|\\.)?|(${Ic}))[eE][+-]?(${Ao})[fFdD]?\\b`},{begin:`\\b(${Ao})((${Ic})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ic})[fFdD]?\\b`},{begin:`\\b(${Ao})[fFdD]\\b`},{begin:`\\b0[xX]((${Lc})\\.?|(${Lc})?\\.(${Lc}))[pP][+-]?(${Ao})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Lc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function cB(t){const e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,s,i]}]};i.contains.push(o);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},a={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(o,{className:"string"}),"self"]}]},u=uB,c=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=d;return f.variants[1].contains=[d],d.variants[1].contains=[f],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,c,n,r,l,a,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,t.C_LINE_COMMENT_MODE,c],relevance:0},t.C_LINE_COMMENT_MODE,c,l,a,o,t.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,a]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
162
|
+
`},u]}}const dB=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),fB=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],hB=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],pB=[...fB,...hB],gB=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),ZC=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),XC=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),mB=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),bB=ZC.concat(XC).sort().reverse();function yB(t){const e=dB(t),n=bB,r="and or not only",i="[\\w-]+",s="("+i+"|@\\{"+i+"\\})",o=[],l=[],a=function(k){return{className:"string",begin:"~?"+k+".*?"+k}},u=function(k,y,_){return{className:k,begin:y,relevance:_}},c={$pattern:/[a-z-]+/,keyword:r,attribute:gB.join(" ")},d={begin:"\\(",end:"\\)",contains:l,keywords:c,relevance:0};l.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,a("'"),a('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,d,u("variable","@@?"+i,10),u("variable","@\\{"+i+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const f=l.concat({begin:/\{/,end:/\}/,contains:o}),h={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},p={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+mB.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:l,relevance:0}},b={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:f}},m={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,h,u("keyword","all\\b"),u("variable","@\\{"+i+"\\}"),{begin:"\\b("+pB.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,u("selector-tag",s,0),u("selector-id","#"+s),u("selector-class","\\."+s,0),u("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+ZC.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+XC.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},e.FUNCTION_DISPATCH]},E={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[m]};return o.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,g,b,E,p,m,h,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function EB(t){const e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function kB(t){const e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,n]},i={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},s={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,e,n,r,i,s,o]}}function wB(t){const e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,a={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},c={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},d=t.inherit(u,{contains:[]}),f=t.inherit(c,{contains:[]});u.contains.push(f),c.contains.push(d);let h=[n,a];return[u,c,d,f].forEach(m=>{m.contains=m.contains.concat(h)}),h=h.concat(u,c),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},n,s,u,c,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},i,r,a,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function _B(t){const e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},a={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"</",contains:[e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+a.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:a,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function vB(t){const e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},o={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},a={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},c=[t.BACKSLASH_ESCAPE,s,a],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(g,b,m="\\1")=>{const E=m==="\\1"?m:e.concat(m,b);return e.concat(e.concat("(?:",g,")"),b,/(?:\\.|[^\\\/])*?/,E,/(?:\\.|[^\\\/])*?/,m,r)},h=(g,b,m)=>e.concat(e.concat("(?:",g,")"),b,/(?:\\.|[^\\\/])*?/,m,r),p=[a,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:c,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",e.either(...d,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:h("(?:m|qr)?",/\//,/\//)},{begin:h("m|qr",e.either(...d,{capture:!0}),/\1/)},{begin:h("m|qr",/\(/,/\)/)},{begin:h("m|qr",/\[/,/\]/)},{begin:h("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,l,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=p,o.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:p}}function xB(t){const e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=e.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},a={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=t.inherit(t.APOS_STRING_MODE,{illegal:null}),c=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(a)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(a),"on:begin":(te,Z)=>{Z.data._beginMatch=te[1]||te[2]},"on:end":(te,Z)=>{Z.data._beginMatch!==te[1]&&Z.ignoreMatch()}},f=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),h=`[
|
|
163
|
+
]`,p={scope:"string",variants:[c,u,d,f]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},b=["false","null","true"],m=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],E=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],y={keyword:m,literal:(te=>{const Z=[];return te.forEach(A=>{Z.push(A),A.toLowerCase()===A?Z.push(A.toUpperCase()):Z.push(A.toLowerCase())}),Z})(b),built_in:E},_=te=>te.map(Z=>Z.replace(/\|\d+$/,"")),w={variants:[{match:[/new/,e.concat(h,"+"),e.concat("(?!",_(E).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},x=e.concat(r,"\\b(?!\\()"),S={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),x],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),x],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},O={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},L={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[O,o,S,t.C_BLOCK_COMMENT_MODE,p,g,w]},G={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",_(m).join("\\b|"),"|",_(E).join("\\b|"),"\\b)"),r,e.concat(h,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[L]};L.contains.push(G);const U=[O,S,t.C_BLOCK_COMMENT_MODE,p,g,w],j={begin:e.concat(/#\[\s*\\?/,e.either(i,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:b,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:b,keyword:["new","array"]},contains:["self",...U]},...U,{scope:"meta",variants:[{match:i},{match:s}]}]};return{case_insensitive:!1,keywords:y,contains:[j,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,G,S,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},w,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:y,contains:["self",j,o,S,t.C_BLOCK_COMMENT_MODE,p,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},p,g]}}function SB(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function CB(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function AB(t){const e=t.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},a={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},c={begin:/\{\{/,relevance:0},d={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,a,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,a,c,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,c,u]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",h=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,p=`\\b|${r.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${h}))[eE][+-]?(${f})[jJ]?(?=${p})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${p})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${p})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${p})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${p})`},{begin:`\\b(${f})[jJ](?=${p})`}]},b={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",a,g,d,t.HASH_COMMENT_MODE]}]};return u.contains=[d,g,a],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[a,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},d,b,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,m,d]}]}}function TB(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function NB(t){const e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[s,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function MB(t){const e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},a={begin:"#<",end:">"},u=[t.COMMENT("#","$",{contains:[l]}),t.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},d={className:"string",contains:[t.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,c]})]}]},f="[1-9](_?[0-9])*|0",h="[0-9](_?[0-9])*",p={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${h}))?([eE][+-]?(${h})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},g={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},w=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:n}],relevance:0},p,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(a,u),relevance:0}].concat(a,u);c.contains=w,g.contains=w;const L=[{begin:/^\s*=>/,starts:{end:"$",contains:w}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:w}}];return u.unshift(a),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(L).concat(u).concat(w)}}function OB(t){const e=t.regex,n=/(r#)?/,r=e.concat(n,t.UNDERSCORE_IDENT_RE),i=e.concat(n,t.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,e.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],a=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],c=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:c,keyword:l,literal:a,built_in:u},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:c}},{className:"punctuation",begin:"->"},s]}}const DB=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),RB=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],IB=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],LB=[...RB,...IB],PB=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),FB=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),BB=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),zB=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function $B(t){const e=DB(t),n=BB,r=FB,i="@[a-z-]+",s="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+LB.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+zB.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,l,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:PB.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function UB(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function HB(t){const e=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],a=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],c=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],d=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],h=c,p=[...u,...a].filter(_=>!c.includes(_)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},b={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},m={match:e.concat(/\b/,e.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function E(_){return e.concat(/\b/,e.either(..._.map(w=>w.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:E(f),relevance:0};function y(_,{exceptions:w,when:x}={}){const S=x;return w=w||[],_.map(O=>O.match(/\|\d+$/)||w.includes(O)?O:S(O)?`${O}|0`:O)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:y(p,{when:_=>_.length<3}),literal:s,type:l,built_in:d},contains:[{scope:"type",match:E(o)},k,m,g,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,b]}}function QC(t){return t?typeof t=="string"?t:t.source:null}function Ql(t){return xe("(?=",t,")")}function xe(...t){return t.map(n=>QC(n)).join("")}function VB(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function $t(...t){return"("+(VB(t).capture?"":"?:")+t.map(r=>QC(r)).join("|")+")"}const mb=t=>xe(/\b/,t,/\w$/.test(t)?/\b/:/\B/),WB=["Protocol","Type"].map(mb),Aw=["init","self"].map(mb),KB=["Any","Self"],l0=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Tw=["false","nil","true"],jB=["assignment","associativity","higherThan","left","lowerThan","none","right"],qB=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Nw=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],e3=$t(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),t3=$t(e3,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),a0=xe(e3,t3,"*"),n3=$t(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),If=$t(n3,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),pr=xe(n3,If,"*"),Pc=xe(/[A-Z]/,If,"*"),GB=["attached","autoclosure",xe(/convention\(/,$t("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",xe(/objc\(/,pr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],YB=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function JB(t){const e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,$t(...WB,...Aw)],className:{2:"keyword"}},s={match:xe(/\./,$t(...l0)),relevance:0},o=l0.filter(oe=>typeof oe=="string").concat(["_|0"]),l=l0.filter(oe=>typeof oe!="string").concat(KB).map(mb),a={variants:[{className:"keyword",match:$t(...l,...Aw)}]},u={$pattern:$t(/\b\w+/,/#\w+/),keyword:o.concat(qB),literal:Tw},c=[i,s,a],d={match:xe(/\./,$t(...Nw)),relevance:0},f={className:"built_in",match:xe(/\b/,$t(...Nw),/(?=\()/)},h=[d,f],p={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:a0},{match:`\\.(\\.|${t3})+`}]},b=[p,g],m="([0-9]_*)+",E="([0-9a-fA-F]_*)+",k={className:"number",relevance:0,variants:[{match:`\\b(${m})(\\.(${m}))?([eE][+-]?(${m}))?\\b`},{match:`\\b0x(${E})(\\.(${E}))?([pP][+-]?(${m}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},y=(oe="")=>({className:"subst",variants:[{match:xe(/\\/,oe,/[0\\tnr"']/)},{match:xe(/\\/,oe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(oe="")=>({className:"subst",match:xe(/\\/,oe,/[\t ]*(?:[\r\n]|\r\n)/)}),w=(oe="")=>({className:"subst",label:"interpol",begin:xe(/\\/,oe,/\(/),end:/\)/}),x=(oe="")=>({begin:xe(oe,/"""/),end:xe(/"""/,oe),contains:[y(oe),_(oe),w(oe)]}),S=(oe="")=>({begin:xe(oe,/"/),end:xe(/"/,oe),contains:[y(oe),w(oe)]}),O={className:"string",variants:[x(),x("#"),x("##"),x("###"),S(),S("#"),S("##"),S("###")]},L=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],G={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:L},U=oe=>{const Tt=xe(oe,/\//),Y=xe(/\//,oe);return{begin:Tt,end:Y,contains:[...L,{scope:"comment",begin:`#(?!.*${Y})`,end:/$/}]}},j={scope:"regexp",variants:[U("###"),U("##"),U("#"),G]},te={match:xe(/`/,pr,/`/)},Z={className:"variable",match:/\$\d+/},A={className:"variable",match:`\\$${If}+`},C=[te,Z,A],v={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:YB,contains:[...b,k,O]}]}},T={scope:"keyword",match:xe(/@/,$t(...GB),Ql($t(/\(/,/\s+/)))},D={scope:"meta",match:xe(/@/,pr)},B=[v,T,D],V={match:Ql(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:xe(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,If,"+")},{className:"type",match:Pc,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:xe(/\s+&\s+/,Ql(Pc)),relevance:0}]},de={begin:/</,end:/>/,keywords:u,contains:[...r,...c,...B,p,V]};V.contains.push(de);const fe={match:xe(pr,/\s*:/),keywords:"_|0",relevance:0},ie={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",fe,...r,j,...c,...h,...b,k,O,...C,...B,V]},ge={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,V]},nt={begin:$t(Ql(xe(pr,/\s*:/)),Ql(xe(pr,/\s+/,pr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:pr}]},at={begin:/\(/,end:/\)/,keywords:u,contains:[nt,...r,...c,...b,k,O,...B,V,ie],endsParent:!0,illegal:/["']/},fn={match:[/(func|macro)/,/\s+/,$t(te.match,pr,a0)],className:{1:"keyword",3:"title.function"},contains:[ge,at,e],illegal:[/\[/,/%/]},Jt={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ge,at,e],illegal:/\[|%/},Nn={match:[/operator/,/\s+/,a0],className:{1:"keyword",3:"title"}},dr={begin:[/precedencegroup/,/\s+/,Pc],className:{1:"keyword",3:"title"},contains:[V],keywords:[...jB,...Tw],end:/}/},Zt={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Xt={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Je={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,pr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[ge,...c,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:Pc},...c],relevance:0}]};for(const oe of O.variants){const Tt=oe.contains.find(Q=>Q.label==="interpol");Tt.keywords=u;const Y=[...c,...h,...b,k,O,...C];Tt.contains=[...Y,{begin:/\(/,end:/\)/,contains:["self",...Y]}]}return{name:"Swift",keywords:u,contains:[...r,fn,Jt,Zt,Xt,Je,Nn,dr,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},j,...c,...h,...b,k,O,...C,...B,V,ie]}}const Lf="[A-Za-z$_][0-9A-Za-z$_]*",r3=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],i3=["true","false","null","undefined","NaN","Infinity"],s3=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],o3=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],l3=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],a3=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],u3=[].concat(l3,s3,o3);function ZB(t){const e=t.regex,n=(v,{after:T})=>{const D="</"+v[0].slice(1);return v.input.indexOf(D,T)!==-1},r=Lf,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,T)=>{const D=v[0].length+v.index,B=v.input[D];if(B==="<"||B===","){T.ignoreMatch();return}B===">"&&(n(v,{after:D})||T.ignoreMatch());let V;const de=v.input.substring(D);if(V=de.match(/^\s*=/)){T.ignoreMatch();return}if((V=de.match(/^\s+extends\s+/))&&V.index===0){T.ignoreMatch();return}}},l={$pattern:Lf,keyword:r3,literal:i3,built_in:u3,"variable.language":a3},a="[0-9](_?[0-9])*",u=`\\.(${a})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${a})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},E={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,p,g,b,{match:/\$\d+/},d];f.contains=k.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(k)});const y=[].concat(E,f.contains),_=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(y)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:_},x={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},S={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...s3,...o3]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},L={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},G={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(v){return e.concat("(?!",v.join("|"),")")}const j={match:e.concat(/\b/,U([...l3,"super","import"].map(v=>`${v}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},te={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",C={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,p,g,b,E,{match:/\$\d+/},d,S,{scope:"attr",match:r+e.lookahead(":"),relevance:0},C,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,t.REGEXP_MODE,{className:"function",begin:A,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},L,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},te,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},j,G,x,Z,{match:/\$[(.]/}]}}function XB(t){const e=t.regex,n=ZB(t),r=Lf,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},a=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:Lf,keyword:r3.concat(a),literal:i3,built_in:u3.concat(i),"variable.language":a3},c={className:"meta",begin:"@"+r},d=(g,b,m)=>{const E=g.contains.findIndex(k=>k.label===b);if(E===-1)throw new Error("can not find mode to replace");g.contains.splice(E,1,m)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(c);const f=n.contains.find(g=>g.scope==="attr"),h=Object.assign({},f,{match:e.concat(r,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,f,h]),n.contains=n.contains.concat([c,s,o,h]),d(n,"shebang",t.SHEBANG()),d(n,"use_strict",l);const p=n.contains.find(g=>g.label==="func.def");return p.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function QB(t){const e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,a={className:"literal",variants:[{begin:e.concat(/# */,e.either(s,i),/ *#/)},{begin:e.concat(/# */,l,/ *#/)},{begin:e.concat(/# */,o,/ *#/)},{begin:e.concat(/# */,e.either(s,i),/ +/,e.either(o,l),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},c={className:"label",begin:/^\w+:/},d=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,a,u,c,d,f,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[f]}]}}function e7(t){t.regex;const e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");const n=t.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},a={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,i,t.QUOTE_STRING_MODE,a,u,l]}}function t7(t){const e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=t.inherit(s,{begin:/\(/,end:/\)/}),l=t.inherit(t.APOS_STRING_MODE,{className:"string"}),a=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,a,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,o,a,l]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function n7(t){const e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},l=t.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),f={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},p={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},b=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},f,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},p,g,s,o],m=[...b];return m.pop(),m.push(l),h.contains=m,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:b}}const xW={arduino:BF,bash:zF,c:$F,cpp:UF,csharp:HF,css:ZF,diff:XF,go:QF,graphql:eB,ini:tB,java:nB,javascript:lB,json:aB,kotlin:cB,less:yB,lua:EB,makefile:kB,markdown:wB,objectivec:_B,perl:vB,php:xB,"php-template":SB,plaintext:CB,python:AB,"python-repl":TB,r:NB,ruby:MB,rust:OB,scss:$B,shell:UB,sql:HB,swift:JB,typescript:XB,vbnet:QB,wasm:e7,xml:t7,yaml:n7};function c3(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&c3(n)}),t}class Mw{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function d3(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ii(t,...e){const n=Object.create(null);for(const r in t)n[r]=t[r];return e.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const r7="</span>",Ow=t=>!!t.scope,i7=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`};class s7{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=d3(e)}openNode(e){if(!Ow(e))return;const n=i7(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){Ow(e)&&(this.buffer+=r7)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const Dw=(t={})=>{const e={children:[]};return Object.assign(e,t),e};class bb{constructor(){this.rootNode=Dw(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n=Dw({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{bb._collapse(n)}))}}class o7 extends bb{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){const r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new s7(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function bu(t){return t?typeof t=="string"?t:t.source:null}function f3(t){return uo("(?=",t,")")}function l7(t){return uo("(?:",t,")*")}function a7(t){return uo("(?:",t,")?")}function uo(...t){return t.map(n=>bu(n)).join("")}function u7(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function yb(...t){return"("+(u7(t).capture?"":"?:")+t.map(r=>bu(r)).join("|")+")"}function h3(t){return new RegExp(t.toString()+"|").exec("").length-1}function c7(t,e){const n=t&&t.exec(e);return n&&n.index===0}const d7=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Eb(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;const i=n;let s=bu(r),o="";for(;s.length>0;){const l=d7.exec(s);if(!l){o+=s;break}o+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?o+="\\"+String(Number(l[1])+i):(o+=l[0],l[0]==="("&&n++)}return o}).map(r=>`(${r})`).join(e)}const f7=/\b\B/,p3="[a-zA-Z]\\w*",kb="[a-zA-Z_]\\w*",g3="\\b\\d+(\\.\\d+)?",m3="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",b3="\\b(0b[01]+)",h7="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",p7=(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=uo(e,/.*\b/,t.binary,/\b.*/)),Ii({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},yu={begin:"\\\\[\\s\\S]",relevance:0},g7={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[yu]},m7={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[yu]},b7={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Oh=function(t,e,n={}){const r=Ii({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=yb("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:uo(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},y7=Oh("//","$"),E7=Oh("/\\*","\\*/"),k7=Oh("#","$"),w7={scope:"number",begin:g3,relevance:0},_7={scope:"number",begin:m3,relevance:0},v7={scope:"number",begin:b3,relevance:0},x7={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[yu,{begin:/\[/,end:/\]/,relevance:0,contains:[yu]}]},S7={scope:"title",begin:p3,relevance:0},C7={scope:"title",begin:kb,relevance:0},A7={begin:"\\.\\s*"+kb,relevance:0},T7=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})};var Fc=Object.freeze({__proto__:null,APOS_STRING_MODE:g7,BACKSLASH_ESCAPE:yu,BINARY_NUMBER_MODE:v7,BINARY_NUMBER_RE:b3,COMMENT:Oh,C_BLOCK_COMMENT_MODE:E7,C_LINE_COMMENT_MODE:y7,C_NUMBER_MODE:_7,C_NUMBER_RE:m3,END_SAME_AS_BEGIN:T7,HASH_COMMENT_MODE:k7,IDENT_RE:p3,MATCH_NOTHING_RE:f7,METHOD_GUARD:A7,NUMBER_MODE:w7,NUMBER_RE:g3,PHRASAL_WORDS_MODE:b7,QUOTE_STRING_MODE:m7,REGEXP_MODE:x7,RE_STARTERS_RE:h7,SHEBANG:p7,TITLE_MODE:S7,UNDERSCORE_IDENT_RE:kb,UNDERSCORE_TITLE_MODE:C7});function N7(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function M7(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function O7(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=N7,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function D7(t,e){Array.isArray(t.illegal)&&(t.illegal=yb(...t.illegal))}function R7(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function I7(t,e){t.relevance===void 0&&(t.relevance=1)}const L7=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=uo(n.beforeMatch,f3(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},P7=["of","and","for","in","not","or","if","then","parent","list","value"],F7="keyword";function y3(t,e,n=F7){const r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(s){Object.assign(r,y3(t[s],e,s))}),r;function i(s,o){e&&(o=o.map(l=>l.toLowerCase())),o.forEach(function(l){const a=l.split("|");r[a[0]]=[s,B7(a[0],a[1])]})}}function B7(t,e){return e?Number(e):z7(t)?0:1}function z7(t){return P7.includes(t.toLowerCase())}const Rw={},zs=t=>{console.error(t)},Iw=(t,...e)=>{console.log(`WARN: ${t}`,...e)},ko=(t,e)=>{Rw[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),Rw[`${t}/${e}`]=!0)},Pf=new Error;function E3(t,e,{key:n}){let r=0;const i=t[n],s={},o={};for(let l=1;l<=e.length;l++)o[l+r]=i[l],s[l+r]=!0,r+=h3(e[l-1]);t[n]=o,t[n]._emit=s,t[n]._multi=!0}function $7(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw zs("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Pf;if(typeof t.beginScope!="object"||t.beginScope===null)throw zs("beginScope must be object"),Pf;E3(t,t.begin,{key:"beginScope"}),t.begin=Eb(t.begin,{joinWith:""})}}function U7(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw zs("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Pf;if(typeof t.endScope!="object"||t.endScope===null)throw zs("endScope must be object"),Pf;E3(t,t.end,{key:"endScope"}),t.end=Eb(t.end,{joinWith:""})}}function H7(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function V7(t){H7(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),$7(t),U7(t)}function W7(t){function e(o,l){return new RegExp(bu(o),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,a){a.position=this.position++,this.matchIndexes[this.matchAt]=a,this.regexes.push([a,l]),this.matchAt+=h3(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(a=>a[1]);this.matcherRe=e(Eb(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const a=this.matcherRe.exec(l);if(!a)return null;const u=a.findIndex((d,f)=>f>0&&d!==void 0),c=this.matchIndexes[u];return a.splice(0,u),Object.assign(a,c)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const a=new n;return this.rules.slice(l).forEach(([u,c])=>a.addRule(u,c)),a.compile(),this.multiRegexes[l]=a,a}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,a){this.rules.push([l,a]),a.type==="begin"&&this.count++}exec(l){const a=this.getMatcher(this.regexIndex);a.lastIndex=this.lastIndex;let u=a.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const c=this.getMatcher(0);c.lastIndex=this.lastIndex+1,u=c.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function i(o){const l=new r;return o.contains.forEach(a=>l.addRule(a.begin,{rule:a,type:"begin"})),o.terminatorEnd&&l.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&l.addRule(o.illegal,{type:"illegal"}),l}function s(o,l){const a=o;if(o.isCompiled)return a;[M7,R7,V7,L7].forEach(c=>c(o,l)),t.compilerExtensions.forEach(c=>c(o,l)),o.__beforeBegin=null,[O7,D7,I7].forEach(c=>c(o,l)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=y3(o.keywords,t.case_insensitive)),a.keywordPatternRe=e(u,!0),l&&(o.begin||(o.begin=/\B|\b/),a.beginRe=e(a.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(a.endRe=e(a.end)),a.terminatorEnd=bu(a.end)||"",o.endsWithParent&&l.terminatorEnd&&(a.terminatorEnd+=(o.end?"|":"")+l.terminatorEnd)),o.illegal&&(a.illegalRe=e(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(c){return K7(c==="self"?o:c)})),o.contains.forEach(function(c){s(c,a)}),o.starts&&s(o.starts,l),a.matcher=i(a),a}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Ii(t.classNameAliases||{}),s(t)}function k3(t){return t?t.endsWithParent||k3(t.starts):!1}function K7(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Ii(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:k3(t)?Ii(t,{starts:t.starts?Ii(t.starts):null}):Object.isFrozen(t)?Ii(t):t}var j7="11.11.1";class q7 extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}const u0=d3,Lw=Ii,Pw=Symbol("nomatch"),G7=7,w3=function(t){const e=Object.create(null),n=Object.create(null),r=[];let i=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:o7};function a(A){return l.noHighlightRe.test(A)}function u(A){let C=A.className+" ";C+=A.parentNode?A.parentNode.className:"";const v=l.languageDetectRe.exec(C);if(v){const T=S(v[1]);return T||(Iw(s.replace("{}",v[1])),Iw("Falling back to no-highlight mode for this block.",A)),T?v[1]:"no-highlight"}return C.split(/\s+/).find(T=>a(T)||S(T))}function c(A,C,v){let T="",D="";typeof C=="object"?(T=A,v=C.ignoreIllegals,D=C.language):(ko("10.7.0","highlight(lang, code, ...args) has been deprecated."),ko("10.7.0",`Please use highlight(code, options) instead.
|
|
164
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),D=A,T=C),v===void 0&&(v=!0);const B={code:T,language:D};te("before:highlight",B);const V=B.result?B.result:d(B.language,B.code,v);return V.code=B.code,te("after:highlight",V),V}function d(A,C,v,T){const D=Object.create(null);function B(z,N){return z.keywords[N]}function V(){if(!Y.keywords){ye.addText(ee);return}let z=0;Y.keywordPatternRe.lastIndex=0;let N=Y.keywordPatternRe.exec(ee),I="";for(;N;){I+=ee.substring(z,N.index);const H=Je.case_insensitive?N[0].toLowerCase():N[0],re=B(Y,H);if(re){const[ve,hn]=re;if(ye.addText(I),I="",D[H]=(D[H]||0)+1,D[H]<=G7&&(pe+=hn),ve.startsWith("_"))I+=N[0];else{const $l=Je.classNameAliases[ve]||ve;ie(N[0],$l)}}else I+=N[0];z=Y.keywordPatternRe.lastIndex,N=Y.keywordPatternRe.exec(ee)}I+=ee.substring(z),ye.addText(I)}function de(){if(ee==="")return;let z=null;if(typeof Y.subLanguage=="string"){if(!e[Y.subLanguage]){ye.addText(ee);return}z=d(Y.subLanguage,ee,!0,Q[Y.subLanguage]),Q[Y.subLanguage]=z._top}else z=h(ee,Y.subLanguage.length?Y.subLanguage:null);Y.relevance>0&&(pe+=z.relevance),ye.__addSublanguage(z._emitter,z.language)}function fe(){Y.subLanguage!=null?de():V(),ee=""}function ie(z,N){z!==""&&(ye.startScope(N),ye.addText(z),ye.endScope())}function ge(z,N){let I=1;const H=N.length-1;for(;I<=H;){if(!z._emit[I]){I++;continue}const re=Je.classNameAliases[z[I]]||z[I],ve=N[I];re?ie(ve,re):(ee=ve,V(),ee=""),I++}}function nt(z,N){return z.scope&&typeof z.scope=="string"&&ye.openNode(Je.classNameAliases[z.scope]||z.scope),z.beginScope&&(z.beginScope._wrap?(ie(ee,Je.classNameAliases[z.beginScope._wrap]||z.beginScope._wrap),ee=""):z.beginScope._multi&&(ge(z.beginScope,N),ee="")),Y=Object.create(z,{parent:{value:Y}}),Y}function at(z,N,I){let H=c7(z.endRe,I);if(H){if(z["on:end"]){const re=new Mw(z);z["on:end"](N,re),re.isMatchIgnored&&(H=!1)}if(H){for(;z.endsParent&&z.parent;)z=z.parent;return z}}if(z.endsWithParent)return at(z.parent,N,I)}function fn(z){return Y.matcher.regexIndex===0?(ee+=z[0],1):(Mn=!0,0)}function Jt(z){const N=z[0],I=z.rule,H=new Mw(I),re=[I.__beforeBegin,I["on:begin"]];for(const ve of re)if(ve&&(ve(z,H),H.isMatchIgnored))return fn(N);return I.skip?ee+=N:(I.excludeBegin&&(ee+=N),fe(),!I.returnBegin&&!I.excludeBegin&&(ee=N)),nt(I,z),I.returnBegin?0:N.length}function Nn(z){const N=z[0],I=C.substring(z.index),H=at(Y,z,I);if(!H)return Pw;const re=Y;Y.endScope&&Y.endScope._wrap?(fe(),ie(N,Y.endScope._wrap)):Y.endScope&&Y.endScope._multi?(fe(),ge(Y.endScope,z)):re.skip?ee+=N:(re.returnEnd||re.excludeEnd||(ee+=N),fe(),re.excludeEnd&&(ee=N));do Y.scope&&ye.closeNode(),!Y.skip&&!Y.subLanguage&&(pe+=Y.relevance),Y=Y.parent;while(Y!==H.parent);return H.starts&&nt(H.starts,z),re.returnEnd?0:N.length}function dr(){const z=[];for(let N=Y;N!==Je;N=N.parent)N.scope&&z.unshift(N.scope);z.forEach(N=>ye.openNode(N))}let Zt={};function Xt(z,N){const I=N&&N[0];if(ee+=z,I==null)return fe(),0;if(Zt.type==="begin"&&N.type==="end"&&Zt.index===N.index&&I===""){if(ee+=C.slice(N.index,N.index+1),!i){const H=new Error(`0 width match regex (${A})`);throw H.languageName=A,H.badRule=Zt.rule,H}return 1}if(Zt=N,N.type==="begin")return Jt(N);if(N.type==="illegal"&&!v){const H=new Error('Illegal lexeme "'+I+'" for mode "'+(Y.scope||"<unnamed>")+'"');throw H.mode=Y,H}else if(N.type==="end"){const H=Nn(N);if(H!==Pw)return H}if(N.type==="illegal"&&I==="")return ee+=`
|
|
165
|
+
`,1;if(Et>1e5&&Et>N.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ee+=I,I.length}const Je=S(A);if(!Je)throw zs(s.replace("{}",A)),new Error('Unknown language: "'+A+'"');const oe=W7(Je);let Tt="",Y=T||oe;const Q={},ye=new l.__emitter(l);dr();let ee="",pe=0,Ze=0,Et=0,Mn=!1;try{if(Je.__emitTokens)Je.__emitTokens(C,ye);else{for(Y.matcher.considerAll();;){Et++,Mn?Mn=!1:Y.matcher.considerAll(),Y.matcher.lastIndex=Ze;const z=Y.matcher.exec(C);if(!z)break;const N=C.substring(Ze,z.index),I=Xt(N,z);Ze=z.index+I}Xt(C.substring(Ze))}return ye.finalize(),Tt=ye.toHTML(),{language:A,value:Tt,relevance:pe,illegal:!1,_emitter:ye,_top:Y}}catch(z){if(z.message&&z.message.includes("Illegal"))return{language:A,value:u0(C),illegal:!0,relevance:0,_illegalBy:{message:z.message,index:Ze,context:C.slice(Ze-100,Ze+100),mode:z.mode,resultSoFar:Tt},_emitter:ye};if(i)return{language:A,value:u0(C),illegal:!1,relevance:0,errorRaised:z,_emitter:ye,_top:Y};throw z}}function f(A){const C={value:u0(A),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return C._emitter.addText(A),C}function h(A,C){C=C||l.languages||Object.keys(e);const v=f(A),T=C.filter(S).filter(L).map(fe=>d(fe,A,!1));T.unshift(v);const D=T.sort((fe,ie)=>{if(fe.relevance!==ie.relevance)return ie.relevance-fe.relevance;if(fe.language&&ie.language){if(S(fe.language).supersetOf===ie.language)return 1;if(S(ie.language).supersetOf===fe.language)return-1}return 0}),[B,V]=D,de=B;return de.secondBest=V,de}function p(A,C,v){const T=C&&n[C]||v;A.classList.add("hljs"),A.classList.add(`language-${T}`)}function g(A){let C=null;const v=u(A);if(a(v))return;if(te("before:highlightElement",{el:A,language:v}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),l.throwUnescapedHTML))throw new q7("One of your code blocks includes unescaped HTML.",A.innerHTML);C=A;const T=C.textContent,D=v?c(T,{language:v,ignoreIllegals:!0}):h(T);A.innerHTML=D.value,A.dataset.highlighted="yes",p(A,v,D.language),A.result={language:D.language,re:D.relevance,relevance:D.relevance},D.secondBest&&(A.secondBest={language:D.secondBest.language,relevance:D.secondBest.relevance}),te("after:highlightElement",{el:A,result:D,text:T})}function b(A){l=Lw(l,A)}const m=()=>{y(),ko("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function E(){y(),ko("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function y(){function A(){y()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",A,!1),k=!0;return}document.querySelectorAll(l.cssSelector).forEach(g)}function _(A,C){let v=null;try{v=C(t)}catch(T){if(zs("Language definition for '{}' could not be registered.".replace("{}",A)),i)zs(T);else throw T;v=o}v.name||(v.name=A),e[A]=v,v.rawDefinition=C.bind(null,t),v.aliases&&O(v.aliases,{languageName:A})}function w(A){delete e[A];for(const C of Object.keys(n))n[C]===A&&delete n[C]}function x(){return Object.keys(e)}function S(A){return A=(A||"").toLowerCase(),e[A]||e[n[A]]}function O(A,{languageName:C}){typeof A=="string"&&(A=[A]),A.forEach(v=>{n[v.toLowerCase()]=C})}function L(A){const C=S(A);return C&&!C.disableAutodetect}function G(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=C=>{A["before:highlightBlock"](Object.assign({block:C.el},C))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=C=>{A["after:highlightBlock"](Object.assign({block:C.el},C))})}function U(A){G(A),r.push(A)}function j(A){const C=r.indexOf(A);C!==-1&&r.splice(C,1)}function te(A,C){const v=A;r.forEach(function(T){T[v]&&T[v](C)})}function Z(A){return ko("10.7.0","highlightBlock will be removed entirely in v12.0"),ko("10.7.0","Please use highlightElement now."),g(A)}Object.assign(t,{highlight:c,highlightAuto:h,highlightAll:y,highlightElement:g,highlightBlock:Z,configure:b,initHighlighting:m,initHighlightingOnLoad:E,registerLanguage:_,unregisterLanguage:w,listLanguages:x,getLanguage:S,registerAliases:O,autoDetection:L,inherit:Lw,addPlugin:U,removePlugin:j}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=j7,t.regex={concat:uo,lookahead:f3,either:yb,optional:a7,anyNumberOfTimes:l7};for(const A in Fc)typeof Fc[A]=="object"&&c3(Fc[A]);return Object.assign(t,Fc),t},yl=w3({});yl.newInstance=()=>w3({});var Y7=yl;yl.HighlightJS=yl;yl.default=yl;const J7=A_(Y7),Fw={},Z7="hljs-";function SW(t){const e=J7.newInstance();return t&&s(t),{highlight:n,highlightAuto:r,listLanguages:i,register:s,registerAlias:o,registered:l};function n(a,u,c){const d=c||Fw,f=typeof d.prefix=="string"?d.prefix:Z7;if(!e.getLanguage(a))throw new Error("Unknown language: `"+a+"` is not registered");e.configure({__emitter:X7,classPrefix:f});const h=e.highlight(u,{ignoreIllegals:!0,language:a});if(h.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:h.errorRaised});const p=h._emitter.root,g=p.data;return g.language=h.language,g.relevance=h.relevance,p}function r(a,u){const d=(u||Fw).subset||i();let f=-1,h=0,p;for(;++f<d.length;){const g=d[f];if(!e.getLanguage(g))continue;const b=n(g,a,u);b.data&&b.data.relevance!==void 0&&b.data.relevance>h&&(h=b.data.relevance,p=b)}return p||{type:"root",children:[],data:{language:void 0,relevance:h}}}function i(){return e.listLanguages()}function s(a,u){if(typeof a=="string")e.registerLanguage(a,u);else{let c;for(c in a)Object.hasOwn(a,c)&&e.registerLanguage(c,a[c])}}function o(a,u){if(typeof a=="string")e.registerAliases(typeof u=="string"?u:[...u],{languageName:a});else{let c;for(c in a)if(Object.hasOwn(a,c)){const d=a[c];e.registerAliases(typeof d=="string"?d:[...d],{languageName:c})}}}function l(a){return!!e.getLanguage(a)}}class X7{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){const r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){const n=this,r=e.split(".").map(function(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),i=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}let Xg,Qg;if(typeof WeakMap<"u"){let t=new WeakMap;Xg=e=>t.get(e),Qg=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;Xg=r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},Qg=(r,i)=>(n==10&&(n=0),t[n++]=r,t[n++]=i)}var Ve=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,i=e/this.width|0;let s=r+1,o=i+1;for(let l=1;s<this.width&&this.map[e+l]==n;l++)s++;for(let l=1;o<this.height&&this.map[e+this.width*l]==n;l++)o++;return{left:r,top:i,right:s,bottom:o}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:i,top:s,bottom:o}=this.findCell(t);return e=="horiz"?(n<0?r==0:i==this.width)?null:this.map[s*this.width+(n<0?r-1:i)]:(n<0?s==0:o==this.height)?null:this.map[r+this.width*(n<0?s-1:o)]}rectBetween(t,e){const{left:n,right:r,top:i,bottom:s}=this.findCell(t),{left:o,right:l,top:a,bottom:u}=this.findCell(e);return{left:Math.min(n,o),top:Math.min(i,a),right:Math.max(r,l),bottom:Math.max(s,u)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){const s=r*this.width+i,o=this.map[s];n[o]||(n[o]=!0,!(i==t.left&&i&&this.map[s-1]==o||r==t.top&&r&&this.map[s-this.width]==o)&&e.push(o))}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){const s=i+n.child(r).nodeSize;if(r==t){let o=e+t*this.width;const l=(t+1)*this.width;for(;o<l&&this.map[o]<i;)o++;return o==l?s-1:this.map[o]}i=s}}static get(t){return Xg(t)||Qg(t,Q7(t))}};function Q7(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=ez(t),n=t.childCount,r=[];let i=0,s=null;const o=[];for(let u=0,c=e*n;u<c;u++)r[u]=0;for(let u=0,c=0;u<n;u++){const d=t.child(u);c++;for(let p=0;;p++){for(;i<r.length&&r[i]!=0;)i++;if(p==d.childCount)break;const g=d.child(p),{colspan:b,rowspan:m,colwidth:E}=g.attrs;for(let k=0;k<m;k++){if(k+u>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:c,n:m-k});break}const y=i+k*e;for(let _=0;_<b;_++){r[y+_]==0?r[y+_]=c:(s||(s=[])).push({type:"collision",row:u,pos:c,n:b-_});const w=E&&E[_];if(w){const x=(y+_)%e*2,S=o[x];S==null||S!=w&&o[x+1]==1?(o[x]=w,o[x+1]=1):S==w&&o[x+1]++}}}i+=b,c+=g.nodeSize}const f=(u+1)*e;let h=0;for(;i<f;)r[i++]==0&&h++;h&&(s||(s=[])).push({type:"missing",row:u,n:h}),c++}(e===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const l=new Ve(e,n,r,s);let a=!1;for(let u=0;!a&&u<o.length;u+=2)o[u]!=null&&o[u+1]<n&&(a=!0);return a&&tz(l,o,t),l}function ez(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const i=t.child(r);let s=0;if(n)for(let o=0;o<r;o++){const l=t.child(o);for(let a=0;a<l.childCount;a++){const u=l.child(a);o+u.attrs.rowspan>r&&(s+=u.attrs.colspan)}}for(let o=0;o<i.childCount;o++){const l=i.child(o);s+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function tz(t,e,n){t.problems||(t.problems=[]);const r={};for(let i=0;i<t.map.length;i++){const s=t.map[i];if(r[s])continue;r[s]=!0;const o=n.nodeAt(s);if(!o)throw new RangeError(`No cell with offset ${s} found`);let l=null;const a=o.attrs;for(let u=0;u<a.colspan;u++){const c=e[(i+u)%t.width*2];c!=null&&(!a.colwidth||a.colwidth[u]!=c)&&((l||(l=nz(a)))[u]=c)}l&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:l})}}function nz(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Pt(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}const Si=new Le("selectingCells");function to(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function rz(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function cr(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Dh(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=to(e.$head)||iz(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function iz(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function em(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function sz(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function wb(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function _3(t,e,n){const r=t.node(-1),i=Ve.get(r),s=t.start(-1),o=i.nextCell(t.pos-s,e,n);return o==null?null:t.node(0).resolve(s+o)}function no(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function v3(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(e,0,0)}return r}function oz(t,e,n){const r=Pt(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[n+i*t.width]).type!=r)return!1;return!0}var Oe=class $r extends ne{constructor(e,n=e){const r=e.node(-1),i=Ve.get(r),s=e.start(-1),o=i.rectBetween(e.pos-s,n.pos-s),l=e.node(0),a=i.cellsInRect(o).filter(c=>c!=n.pos-s);a.unshift(n.pos-s);const u=a.map(c=>{const d=r.nodeAt(c);if(!d)throw new RangeError(`No cell with offset ${c} found`);const f=s+c+1;return new o2(l.resolve(f),l.resolve(f+d.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(em(r)&&em(i)&&wb(r,i)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?$r.rowSelection(r,i):s&&this.isColSelection()?$r.colSelection(r,i):new $r(r,i)}return X.between(r,i)}content(){const e=this.$anchorCell.node(-1),n=Ve.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},o=[];for(let a=i.top;a<i.bottom;a++){const u=[];for(let c=a*n.width+i.left,d=i.left;d<i.right;d++,c++){const f=n.map[c];if(s[f])continue;s[f]=!0;const h=n.findCell(f);let p=e.nodeAt(f);if(!p)throw new RangeError(`No cell with offset ${f} found`);const g=i.left-h.left,b=h.right-i.right;if(g>0||b>0){let m=p.attrs;if(g>0&&(m=no(m,0,g)),b>0&&(m=no(m,m.colspan-b,b)),h.left<i.left){if(p=p.type.createAndFill(m),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(m)}`)}else p=p.type.create(m,p.content)}if(h.top<i.top||h.bottom>i.bottom){const m={...p.attrs,rowspan:Math.min(h.bottom,i.bottom)-Math.max(h.top,i.top)};h.top<i.top?p=p.type.createAndFill(m):p=p.type.create(m,p.content)}u.push(p)}o.push(e.child(a).copy(R.from(u)))}const l=this.isColSelection()&&this.isRowSelection()?e:o;return new $(R.from(l),1,1)}replace(e,n=$.empty){const r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){const{$from:l,$to:a}=i[o],u=e.mapping.slice(r);e.replace(u.map(l.pos),u.map(a.pos),o?$.empty:n)}const s=ne.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new $(R.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=Ve.get(n),i=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let o=0;o<s.length;o++)e(n.nodeAt(s[o]),i+s[o])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),i=Ve.get(r),s=e.start(-1),o=i.findCell(e.pos-s),l=i.findCell(n.pos-s),a=e.node(0);return o.top<=l.top?(o.top>0&&(e=a.resolve(s+i.map[o.left])),l.bottom<i.height&&(n=a.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))):(l.top>0&&(n=a.resolve(s+i.map[l.left])),o.bottom<i.height&&(e=a.resolve(s+i.map[i.width*(i.height-1)+o.right-1]))),new $r(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=Ve.get(e),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),s=n.colCount(this.$headCell.pos-r);if(Math.min(i,s)>0)return!1;const o=i+this.$anchorCell.nodeAfter.attrs.colspan,l=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,l)==n.width}eq(e){return e instanceof $r&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),i=Ve.get(r),s=e.start(-1),o=i.findCell(e.pos-s),l=i.findCell(n.pos-s),a=e.node(0);return o.left<=l.left?(o.left>0&&(e=a.resolve(s+i.map[o.top*i.width])),l.right<i.width&&(n=a.resolve(s+i.map[i.width*(l.top+1)-1]))):(l.left>0&&(n=a.resolve(s+i.map[l.top*i.width])),o.right<i.width&&(e=a.resolve(s+i.map[i.width*(o.top+1)-1]))),new $r(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new $r(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new $r(e.resolve(n),e.resolve(r))}getBookmark(){return new lz(this.$anchorCell.pos,this.$headCell.pos)}};Oe.prototype.visible=!1;ne.jsonID("cell",Oe);var lz=class x3{constructor(e,n){this.anchor=e,this.head=n}map(e){return new x3(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&wb(n,r)?new Oe(n,r):ne.near(r,1)}};function az(t){if(!(t.selection instanceof Oe))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(ot.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Te.create(t.doc,e)}function uz({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,n++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function cz({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function dz(t,e,n){const r=(e||t).selection,i=(e||t).doc;let s,o;if(r instanceof J&&(o=r.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")s=Oe.create(i,r.from);else if(o=="row"){const l=i.resolve(r.from+1);s=Oe.rowSelection(l,l)}else if(!n){const l=Ve.get(r.node),a=r.from+1,u=a+l.map[l.width*l.height-1];s=Oe.create(i,a+1,u)}}else r instanceof X&&uz(r)?s=X.create(i,r.from):r instanceof X&&cz(r)&&(s=X.create(i,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}const fz=new Le("fix-tables");function S3(t,e,n,r){const i=t.childCount,s=e.childCount;e:for(let o=0,l=0;o<s;o++){const a=e.child(o);for(let u=l,c=Math.min(i,o+3);u<c;u++)if(t.child(u)==a){l=u+1,n+=a.nodeSize;continue e}r(a,n),l<i&&t.child(l).sameMarkup(a)?S3(t.child(l),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function C3(t,e){let n;const r=(i,s)=>{i.type.spec.tableRole=="table"&&(n=hz(t,i,s,n))};return e?e.doc!=t.doc&&S3(e.doc,t.doc,0,r):t.doc.descendants(r),n}function hz(t,e,n,r){const i=Ve.get(e);if(!i.problems)return r;r||(r=t.tr);const s=[];for(let a=0;a<i.height;a++)s.push(0);for(let a=0;a<i.problems.length;a++){const u=i.problems[a];if(u.type=="collision"){const c=e.nodeAt(u.pos);if(!c)continue;const d=c.attrs;for(let f=0;f<d.rowspan;f++)s[u.row+f]+=u.n;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,no(d,d.colspan-u.n,u.n))}else if(u.type=="missing")s[u.row]+=u.n;else if(u.type=="overlong_rowspan"){const c=e.nodeAt(u.pos);if(!c)continue;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,{...c.attrs,rowspan:c.attrs.rowspan-u.n})}else if(u.type=="colwidth mismatch"){const c=e.nodeAt(u.pos);if(!c)continue;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,{...c.attrs,colwidth:u.colwidth})}else if(u.type=="zero_sized"){const c=r.mapping.map(n);r.delete(c,c+e.nodeSize)}}let o,l;for(let a=0;a<s.length;a++)s[a]&&(o==null&&(o=a),l=a);for(let a=0,u=n+1;a<i.height;a++){const c=e.child(a),d=u+c.nodeSize,f=s[a];if(f>0){let h="cell";c.firstChild&&(h=c.firstChild.type.spec.tableRole);const p=[];for(let b=0;b<f;b++){const m=Pt(t.schema)[h].createAndFill();m&&p.push(m)}const g=(a==0||o==a-1)&&l==a?u+1:d-1;r.insert(r.mapping.map(g),p)}u=d}return r.setMeta(fz,{fixTables:!0})}function Rr(t){const e=t.selection,n=Dh(t),r=n.node(-1),i=n.start(-1),s=Ve.get(r);return{...e instanceof Oe?s.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:r}}function A3(t,{map:e,tableStart:n,table:r},i){let s=i>0?-1:0;oz(e,r,i+s)&&(s=i==0||i==e.width?null:0);for(let o=0;o<e.height;o++){const l=o*e.width+i;if(i>0&&i<e.width&&e.map[l-1]==e.map[l]){const a=e.map[l],u=r.nodeAt(a);t.setNodeMarkup(t.mapping.map(n+a),null,v3(u.attrs,i-e.colCount(a))),o+=u.attrs.rowspan-1}else{const a=s==null?Pt(r.type.schema).cell:r.nodeAt(e.map[l+s]).type,u=e.positionAt(o,i,r);t.insert(t.mapping.map(n+u),a.createAndFill())}}return t}function pz(t,e){if(!cr(t))return!1;if(e){const n=Rr(t);e(A3(t.tr,n,n.left))}return!0}function gz(t,e){if(!cr(t))return!1;if(e){const n=Rr(t);e(A3(t.tr,n,n.right))}return!0}function mz(t,{map:e,table:n,tableStart:r},i){const s=t.mapping.maps.length;for(let o=0;o<e.height;){const l=o*e.width+i,a=e.map[l],u=n.nodeAt(a),c=u.attrs;if(i>0&&e.map[l-1]==a||i<e.width-1&&e.map[l+1]==a)t.setNodeMarkup(t.mapping.slice(s).map(r+a),null,no(c,i-e.colCount(a)));else{const d=t.mapping.slice(s).map(r+a);t.delete(d,d+u.nodeSize)}o+=c.rowspan}}function bz(t,e){if(!cr(t))return!1;if(e){const n=Rr(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;mz(r,n,i),i!=n.left;i--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=Ve.get(s)}e(r)}return!0}function yz(t,e,n){var r;const i=Pt(e.type.schema).header_cell;for(let s=0;s<t.width;s++)if(((r=e.nodeAt(t.map[s+n*t.width]))===null||r===void 0?void 0:r.type)!=i)return!1;return!0}function T3(t,{map:e,tableStart:n,table:r},i){let s=n;for(let u=0;u<i;u++)s+=r.child(u).nodeSize;const o=[];let l=i>0?-1:0;yz(e,r,i+l)&&(l=i==0||i==e.height?null:0);for(let u=0,c=e.width*i;u<e.width;u++,c++)if(i>0&&i<e.height&&e.map[c]==e.map[c-e.width]){const d=e.map[c],f=r.nodeAt(d).attrs;t.setNodeMarkup(n+d,null,{...f,rowspan:f.rowspan+1}),u+=f.colspan-1}else{var a;const d=l==null?Pt(r.type.schema).cell:(a=r.nodeAt(e.map[c+l*e.width]))===null||a===void 0?void 0:a.type,f=d?.createAndFill();f&&o.push(f)}return t.insert(s,Pt(r.type.schema).row.create(null,o)),t}function Ez(t,e){if(!cr(t))return!1;if(e){const n=Rr(t);e(T3(t.tr,n,n.top))}return!0}function kz(t,e){if(!cr(t))return!1;if(e){const n=Rr(t);e(T3(t.tr,n,n.bottom))}return!0}function wz(t,{map:e,table:n,tableStart:r},i){let s=0;for(let u=0;u<i;u++)s+=n.child(u).nodeSize;const o=s+n.child(i).nodeSize,l=t.mapping.maps.length;t.delete(s+r,o+r);const a=new Set;for(let u=0,c=i*e.width;u<e.width;u++,c++){const d=e.map[c];if(!a.has(d)){if(a.add(d),i>0&&d==e.map[c-e.width]){const f=n.nodeAt(d).attrs;t.setNodeMarkup(t.mapping.slice(l).map(d+r),null,{...f,rowspan:f.rowspan-1}),u+=f.colspan-1}else if(i<e.height&&d==e.map[c+e.width]){const f=n.nodeAt(d),h=f.attrs,p=f.type.create({...h,rowspan:f.attrs.rowspan-1},f.content),g=e.positionAt(i+1,u,n);t.insert(t.mapping.slice(l).map(r+g),p),u+=h.colspan-1}}}}function _z(t,e){if(!cr(t))return!1;if(e){const n=Rr(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;wz(r,n,i),i!=n.top;i--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=Ve.get(n.table)}e(r)}return!0}function Bw(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function vz({width:t,height:e,map:n},r){let i=r.top*t+r.left,s=i,o=(r.bottom-1)*t+r.left,l=i+(r.right-r.left-1);for(let a=r.top;a<r.bottom;a++){if(r.left>0&&n[s]==n[s-1]||r.right<t&&n[l]==n[l+1])return!0;s+=t,l+=t}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-t]||r.bottom<e&&n[o]==n[o+t])return!0;i++,o++}return!1}function zw(t,e){const n=t.selection;if(!(n instanceof Oe)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Rr(t),{map:i}=r;if(vz(i,r))return!1;if(e){const s=t.tr,o={};let l=R.empty,a,u;for(let c=r.top;c<r.bottom;c++)for(let d=r.left;d<r.right;d++){const f=i.map[c*i.width+d],h=r.table.nodeAt(f);if(!(o[f]||!h))if(o[f]=!0,a==null)a=f,u=h;else{Bw(h)||(l=l.append(h.content));const p=s.mapping.map(f+r.tableStart);s.delete(p,p+h.nodeSize)}}if(a==null||u==null)return!0;if(s.setNodeMarkup(a+r.tableStart,null,{...v3(u.attrs,u.attrs.colspan,r.right-r.left-u.attrs.colspan),rowspan:r.bottom-r.top}),l.size>0){const c=a+1+u.content.size,d=Bw(u)?a+1:c;s.replaceWith(d+r.tableStart,c+r.tableStart,l)}s.setSelection(new Oe(s.doc.resolve(a+r.tableStart))),e(s)}return!0}function $w(t,e){const n=Pt(t.schema);return xz(({node:r})=>n[r.type.spec.tableRole])(t,e)}function xz(t){return(e,n)=>{const r=e.selection;let i,s;if(r instanceof Oe){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,s=r.$anchorCell.pos}else{var o;if(i=rz(r.$from),!i)return!1;s=(o=to(r.$from))===null||o===void 0?void 0:o.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let l=i.attrs;const a=[],u=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const c=Rr(e),d=e.tr;for(let h=0;h<c.right-c.left;h++)a.push(u?{...l,colwidth:u&&u[h]?[u[h]]:null}:l);let f;for(let h=c.top;h<c.bottom;h++){let p=c.map.positionAt(h,c.left,c.table);h==c.top&&(p+=i.nodeSize);for(let g=c.left,b=0;g<c.right;g++,b++)g==c.left&&h==c.top||d.insert(f=d.mapping.map(p+c.tableStart,1),t({node:i,row:h,col:g}).createAndFill(a[b]))}d.setNodeMarkup(s,t({node:i,row:c.top,col:c.left}),a[0]),r instanceof Oe&&d.setSelection(new Oe(d.doc.resolve(r.$anchorCell.pos),f?d.doc.resolve(f):void 0)),n(d)}return!0}}function Sz(t,e){return function(n,r){if(!cr(n))return!1;const i=Dh(n);if(i.nodeAfter.attrs[t]===e)return!1;if(r){const s=n.tr;n.selection instanceof Oe?n.selection.forEachCell((o,l)=>{o.attrs[t]!==e&&s.setNodeMarkup(l,null,{...o.attrs,[t]:e})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(s)}return!0}}function Cz(t){return function(e,n){if(!cr(e))return!1;if(n){const r=Pt(e.schema),i=Rr(e),s=e.tr,o=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=o.map(a=>i.table.nodeAt(a));for(let a=0;a<o.length;a++)l[a].type==r.header_cell&&s.setNodeMarkup(i.tableStart+o[a],r.cell,l[a].attrs);if(s.steps.length===0)for(let a=0;a<o.length;a++)s.setNodeMarkup(i.tableStart+o[a],r.header_cell,l[a].attrs);n(s)}return!0}}function Uw(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const s=e.table.nodeAt(r[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function Eu(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Cz(t):function(n,r){if(!cr(n))return!1;if(r){const i=Pt(n.schema),s=Rr(n),o=n.tr,l=Uw("row",s,i),a=Uw("column",s,i),u=(t==="column"?l:t==="row"&&a)?1:0,c=t=="column"?{left:0,top:u,right:1,bottom:s.map.height}:t=="row"?{left:u,top:0,right:s.map.width,bottom:1}:s,d=t=="column"?a?i.cell:i.header_cell:t=="row"?l?i.cell:i.header_cell:i.cell;s.map.cellsInRect(c).forEach(f=>{const h=f+s.tableStart,p=o.doc.nodeAt(h);p&&o.setNodeMarkup(h,d,p.attrs)}),r(o)}return!0}}Eu("row",{useDeprecatedLogic:!0});Eu("column",{useDeprecatedLogic:!0});const Az=Eu("cell",{useDeprecatedLogic:!0});function Tz(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){const s=t.node(-1).child(r),o=s.lastChild;if(o)return i-1-o.nodeSize;i-=s.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),i=t.after();r<n.childCount;r++){const s=n.child(r);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function Hw(t){return function(e,n){if(!cr(e))return!1;const r=Tz(Dh(e),t);if(r==null)return!1;if(n){const i=e.doc.resolve(r);n(e.tr.setSelection(X.between(i,sz(i))).scrollIntoView())}return!0}}function Nz(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Bc(t,e){const n=t.selection;if(!(n instanceof Oe))return!1;if(e){const r=t.tr,i=Pt(t.schema).cell.createAndFill().content;n.forEachCell((s,o)=>{s.content.eq(i)||r.replace(r.mapping.map(o+1),r.mapping.map(o+s.nodeSize-1),new $(i,0,0))}),r.docChanged&&e(r)}return!0}function Mz(t){if(t.size===0)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const i=e.child(0),s=i.type.spec.tableRole,o=i.type.schema,l=[];if(s=="row")for(let a=0;a<e.childCount;a++){let u=e.child(a).content;const c=a?0:Math.max(0,n-1),d=a<e.childCount-1?0:Math.max(0,r-1);(c||d)&&(u=tm(Pt(o).row,new $(u,c,d)).content),l.push(u)}else if(s=="cell"||s=="header_cell")l.push(n||r?tm(Pt(o).row,new $(e,n,r)).content:e);else return null;return Oz(o,l)}function Oz(t,e){const n=[];for(let i=0;i<e.length;i++){const s=e[i];for(let o=s.childCount-1;o>=0;o--){const{rowspan:l,colspan:a}=s.child(o).attrs;for(let u=i;u<i+l;u++)n[u]=(n[u]||0)+a}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=e.length&&e.push(R.empty),n[i]<r){const s=Pt(t).cell.createAndFill(),o=[];for(let l=n[i];l<r;l++)o.push(s);e[i]=e[i].append(R.from(o))}return{height:e.length,width:r,rows:e}}function tm(t,e){const n=t.createAndFill();return new h1(n).replace(0,n.content.size,e).doc}function Dz({width:t,height:e,rows:n},r,i){if(t!=r){const s=[],o=[];for(let l=0;l<n.length;l++){const a=n[l],u=[];for(let c=s[l]||0,d=0;c<r;d++){let f=a.child(d%a.childCount);c+f.attrs.colspan>r&&(f=f.type.createChecked(no(f.attrs,f.attrs.colspan,c+f.attrs.colspan-r),f.content)),u.push(f),c+=f.attrs.colspan;for(let h=1;h<f.attrs.rowspan;h++)s[l+h]=(s[l+h]||0)+f.attrs.colspan}o.push(R.from(u))}n=o,t=r}if(e!=i){const s=[];for(let o=0,l=0;o<i;o++,l++){const a=[],u=n[l%e];for(let c=0;c<u.childCount;c++){let d=u.child(c);o+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),a.push(d)}s.push(R.from(a))}n=s,e=i}return{width:t,height:e,rows:n}}function Rz(t,e,n,r,i,s,o){const l=t.doc.type.schema,a=Pt(l);let u,c;if(i>e.width)for(let d=0,f=0;d<e.height;d++){const h=n.child(d);f+=h.nodeSize;const p=[];let g;h.lastChild==null||h.lastChild.type==a.cell?g=u||(u=a.cell.createAndFill()):g=c||(c=a.header_cell.createAndFill());for(let b=e.width;b<i;b++)p.push(g);t.insert(t.mapping.slice(o).map(f-1+r),p)}if(s>e.height){const d=[];for(let p=0,g=(e.height-1)*e.width;p<Math.max(e.width,i);p++){const b=p>=e.width?!1:n.nodeAt(e.map[g+p]).type==a.header_cell;d.push(b?c||(c=a.header_cell.createAndFill()):u||(u=a.cell.createAndFill()))}const f=a.row.create(null,R.from(d)),h=[];for(let p=e.height;p<s;p++)h.push(f);t.insert(t.mapping.slice(o).map(r+n.nodeSize-2),h)}return!!(u||c)}function Vw(t,e,n,r,i,s,o,l){if(o==0||o==e.height)return!1;let a=!1;for(let u=i;u<s;u++){const c=o*e.width+u,d=e.map[c];if(e.map[c-e.width]==d){a=!0;const f=n.nodeAt(d),{top:h,left:p}=e.findCell(d);t.setNodeMarkup(t.mapping.slice(l).map(d+r),null,{...f.attrs,rowspan:o-h}),t.insert(t.mapping.slice(l).map(e.positionAt(o,p,n)),f.type.createAndFill({...f.attrs,rowspan:h+f.attrs.rowspan-o})),u+=f.attrs.colspan-1}}return a}function Ww(t,e,n,r,i,s,o,l){if(o==0||o==e.width)return!1;let a=!1;for(let u=i;u<s;u++){const c=u*e.width+o,d=e.map[c];if(e.map[c-1]==d){a=!0;const f=n.nodeAt(d),h=e.colCount(d),p=t.mapping.slice(l).map(d+r);t.setNodeMarkup(p,null,no(f.attrs,o-h,f.attrs.colspan-(o-h))),t.insert(p+f.nodeSize,f.type.createAndFill(no(f.attrs,0,o-h))),u+=f.attrs.rowspan-1}}return a}function Kw(t,e,n,r,i){let s=n?t.doc.nodeAt(n-1):t.doc;if(!s)throw new Error("No table found");let o=Ve.get(s);const{top:l,left:a}=r,u=a+i.width,c=l+i.height,d=t.tr;let f=0;function h(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");o=Ve.get(s),f=d.mapping.maps.length}Rz(d,o,s,n,u,c,f)&&h(),Vw(d,o,s,n,a,u,l,f)&&h(),Vw(d,o,s,n,a,u,c,f)&&h(),Ww(d,o,s,n,l,c,a,f)&&h(),Ww(d,o,s,n,l,c,u,f)&&h();for(let p=l;p<c;p++){const g=o.positionAt(p,a,s),b=o.positionAt(p,u,s);d.replace(d.mapping.slice(f).map(g+n),d.mapping.slice(f).map(b+n),new $(i.rows[p-l],0,0))}h(),d.setSelection(new Oe(d.doc.resolve(n+o.positionAt(l,a,s)),d.doc.resolve(n+o.positionAt(c-1,u-1,s)))),e(d)}const Iz=C1({ArrowLeft:zc("horiz",-1),ArrowRight:zc("horiz",1),ArrowUp:zc("vert",-1),ArrowDown:zc("vert",1),"Shift-ArrowLeft":$c("horiz",-1),"Shift-ArrowRight":$c("horiz",1),"Shift-ArrowUp":$c("vert",-1),"Shift-ArrowDown":$c("vert",1),Backspace:Bc,"Mod-Backspace":Bc,Delete:Bc,"Mod-Delete":Bc});function ld(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function zc(t,e){return(n,r,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof Oe)return ld(n,r,ne.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const o=N3(i,t,e);if(o==null)return!1;if(t=="horiz")return ld(n,r,ne.near(n.doc.resolve(s.head+e),e));{const l=n.doc.resolve(o),a=_3(l,t,e);let u;return a?u=ne.near(a,1):e<0?u=ne.near(n.doc.resolve(l.before(-1)),-1):u=ne.near(n.doc.resolve(l.after(-1)),1),ld(n,r,u)}}}function $c(t,e){return(n,r,i)=>{if(!i)return!1;const s=n.selection;let o;if(s instanceof Oe)o=s;else{const a=N3(i,t,e);if(a==null)return!1;o=new Oe(n.doc.resolve(a))}const l=_3(o.$headCell,t,e);return l?ld(n,r,new Oe(o.$anchorCell,l)):!1}}function Lz(t,e){const n=t.state.doc,r=to(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Oe(r))),!0):!1}function Pz(t,e,n){if(!cr(t.state))return!1;let r=Mz(n);const i=t.state.selection;if(i instanceof Oe){r||(r={width:1,height:1,rows:[R.from(tm(Pt(t.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),l=Ve.get(s).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return r=Dz(r,l.right-l.left,l.bottom-l.top),Kw(t.state,t.dispatch,o,l,r),!0}else if(r){const s=Dh(t.state),o=s.start(-1);return Kw(t.state,t.dispatch,o,Ve.get(s.node(-1)).findCell(s.pos-o),r),!0}else return!1}function Fz(t,e){var n;if(e.button!=0||e.ctrlKey||e.metaKey)return;const r=jw(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof Oe)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=to(t.state.selection.$anchor))!=null&&((n=c0(t,e))===null||n===void 0?void 0:n.pos)!=i.pos)s(i,e),e.preventDefault();else if(!r)return;function s(a,u){let c=c0(t,u);const d=Si.getState(t.state)==null;if(!c||!wb(a,c))if(d)c=a;else return;const f=new Oe(a,c);if(d||!t.state.selection.eq(f)){const h=t.state.tr.setSelection(f);d&&h.setMeta(Si,a.pos),t.dispatch(h)}}function o(){t.root.removeEventListener("mouseup",o),t.root.removeEventListener("dragstart",o),t.root.removeEventListener("mousemove",l),Si.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Si,-1))}function l(a){const u=a,c=Si.getState(t.state);let d;if(c!=null)d=t.state.doc.resolve(c);else if(jw(t,u.target)!=r&&(d=c0(t,e),!d))return o();d&&s(d,u)}t.root.addEventListener("mouseup",o),t.root.addEventListener("dragstart",o),t.root.addEventListener("mousemove",l)}function N3(t,e,n){if(!(t.state.selection instanceof X))return null;const{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){const s=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const o=r.before(i),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?o:null}}return null}function jw(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function c0(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&to(t.state.doc.resolve(r))||to(t.state.doc.resolve(i))}var Bz=class{constructor(e,n){this.node=e,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),nm(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,nm(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function nm(t,e,n,r,i,s){let o=0,l=!0,a=e.firstChild;const u=t.firstChild;if(u){for(let d=0,f=0;d<u.childCount;d++){const{colspan:h,colwidth:p}=u.child(d).attrs;for(let g=0;g<h;g++,f++){const b=i==f?s:p&&p[g],m=b?b+"px":"";if(o+=b||r,b||(l=!1),a)a.style.width!=m&&(a.style.width=m),a=a.nextSibling;else{const E=document.createElement("col");E.style.width=m,e.appendChild(E)}}}for(;a;){var c;const d=a.nextSibling;(c=a.parentNode)===null||c===void 0||c.removeChild(a),a=d}l?(n.style.width=o+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=o+"px")}}const yn=new Le("tableColumnResizing");function zz({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=Bz,lastColumnResizable:i=!0}={}){const s=new Ae({key:yn,state:{init(o,l){var a;const u=(a=s.spec)===null||a===void 0||(a=a.props)===null||a===void 0?void 0:a.nodeViews,c=Pt(l.schema).table.name;return r&&u&&(u[c]=(d,f)=>new r(d,n,f)),new $z(-1,!1)},apply(o,l){return l.apply(o)}},props:{attributes:o=>{const l=yn.getState(o);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,l)=>{Uz(o,l,t,i)},mouseleave:o=>{Hz(o)},mousedown:(o,l)=>{Vz(o,l,e,n)}},decorations:o=>{const l=yn.getState(o);if(l&&l.activeHandle>-1)return Gz(o,l.activeHandle)},nodeViews:{}}});return s}var $z=class ad{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(yn);if(r&&r.setHandle!=null)return new ad(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new ad(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return em(e.doc.resolve(i))||(i=-1),new ad(i,n.dragging)}return n}};function Uz(t,e,n,r){if(!t.editable)return;const i=yn.getState(t.state);if(i&&!i.dragging){const s=Kz(e.target);let o=-1;if(s){const{left:l,right:a}=s.getBoundingClientRect();e.clientX-l<=n?o=qw(t,e,"left",n):a-e.clientX<=n&&(o=qw(t,e,"right",n))}if(o!=i.activeHandle){if(!r&&o!==-1){const l=t.state.doc.resolve(o),a=l.node(-1),u=Ve.get(a),c=l.start(-1);if(u.colCount(l.pos-c)+l.nodeAfter.attrs.colspan-1==u.width-1)return}M3(t,o)}}}function Hz(t){if(!t.editable)return;const e=yn.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&M3(t,-1)}function Vz(t,e,n,r){var i;if(!t.editable)return!1;const s=(i=t.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,o=yn.getState(t.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const l=t.state.doc.nodeAt(o.activeHandle),a=Wz(t,o.activeHandle,l.attrs);t.dispatch(t.state.tr.setMeta(yn,{setDragging:{startX:e.clientX,startWidth:a}}));function u(d){s.removeEventListener("mouseup",u),s.removeEventListener("mousemove",c);const f=yn.getState(t.state);f?.dragging&&(jz(t,f.activeHandle,Gw(f.dragging,d,n)),t.dispatch(t.state.tr.setMeta(yn,{setDragging:null})))}function c(d){if(!d.which)return u(d);const f=yn.getState(t.state);if(f&&f.dragging){const h=Gw(f.dragging,d,n);Yw(t,f.activeHandle,h,r)}}return Yw(t,o.activeHandle,a,r),s.addEventListener("mouseup",u),s.addEventListener("mousemove",c),e.preventDefault(),!0}function Wz(t,e,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const s=t.domAtPos(e);let o=s.node.childNodes[s.offset].offsetWidth,l=n;if(r)for(let a=0;a<n;a++)r[a]&&(o-=r[a],l--);return o/l}function Kz(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function qw(t,e,n,r){const i=n=="right"?-r:r,s=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!s)return-1;const{pos:o}=s,l=to(t.state.doc.resolve(o));if(!l)return-1;if(n=="right")return l.pos;const a=Ve.get(l.node(-1)),u=l.start(-1),c=a.map.indexOf(l.pos-u);return c%a.width==0?-1:u+a.map[c-1]}function Gw(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function M3(t,e){t.dispatch(t.state.tr.setMeta(yn,{setHandle:e}))}function jz(t,e,n){const r=t.state.doc.resolve(e),i=r.node(-1),s=Ve.get(i),o=r.start(-1),l=s.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,a=t.state.tr;for(let u=0;u<s.height;u++){const c=u*s.width+l;if(u&&s.map[c]==s.map[c-s.width])continue;const d=s.map[c],f=i.nodeAt(d).attrs,h=f.colspan==1?0:l-s.colCount(d);if(f.colwidth&&f.colwidth[h]==n)continue;const p=f.colwidth?f.colwidth.slice():qz(f.colspan);p[h]=n,a.setNodeMarkup(o+d,null,{...f,colwidth:p})}a.docChanged&&t.dispatch(a)}function Yw(t,e,n,r){const i=t.state.doc.resolve(e),s=i.node(-1),o=i.start(-1),l=Ve.get(s).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1;let a=t.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&nm(s,a.firstChild,a,r,l,n)}function qz(t){return Array(t).fill(0)}function Gz(t,e){const n=[],r=t.doc.resolve(e),i=r.node(-1);if(!i)return Te.empty;const s=Ve.get(i),o=r.start(-1),l=s.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let u=0;u<s.height;u++){const c=l+u*s.width;if((l==s.width-1||s.map[c]!=s.map[c+1])&&(u==0||s.map[c]!=s.map[c-s.width])){var a;const d=s.map[c],f=o+d+i.nodeAt(d).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",!((a=yn.getState(t))===null||a===void 0)&&a.dragging&&n.push(ot.node(o+d,o+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(ot.widget(f,h))}}return Te.create(t.doc,n)}function Yz({allowTableNodeSelection:t=!1}={}){return new Ae({key:Si,state:{init(){return null},apply(e,n){const r=e.getMeta(Si);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:i,pos:s}=e.mapping.mapResult(n);return i?null:s}},props:{decorations:az,handleDOMEvents:{mousedown:Fz},createSelectionBetween(e){return Si.getState(e.state)!=null?e.state.selection:null},handleTripleClick:Lz,handleKeyDown:Iz,handlePaste:Pz},appendTransaction(e,n,r){return dz(r,C3(r,n),t)}})}function rm(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function Jw(t,e,n,r,i,s){var o;let l=0,a=!0,u=e.firstChild;const c=t.firstChild;if(c!==null)for(let d=0,f=0;d<c.childCount;d+=1){const{colspan:h,colwidth:p}=c.child(d).attrs;for(let g=0;g<h;g+=1,f+=1){const b=i===f?s:p&&p[g],m=b?`${b}px`:"";if(l+=b||r,b||(a=!1),u){if(u.style.width!==m){const[E,k]=rm(r,b);u.style.setProperty(E,k)}u=u.nextSibling}else{const E=document.createElement("col"),[k,y]=rm(r,b);E.style.setProperty(k,y),e.appendChild(E)}}}for(;u;){const d=u.nextSibling;(o=u.parentNode)===null||o===void 0||o.removeChild(u),u=d}a?(n.style.width=`${l}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${l}px`)}class Jz{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Jw(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,Jw(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function Zz(t,e,n,r){let i=0,s=!0;const o=[],l=t.firstChild;if(!l)return{};for(let d=0,f=0;d<l.childCount;d+=1){const{colspan:h,colwidth:p}=l.child(d).attrs;for(let g=0;g<h;g+=1,f+=1){const b=n===f?r:p&&p[g];i+=b||e,b||(s=!1);const[m,E]=rm(e,b);o.push(["col",{style:`${m}: ${E}`}])}}const a=s?`${i}px`:"",u=s?"":`${i}px`;return{colgroup:["colgroup",{},...o],tableWidth:a,tableMinWidth:u}}function Zw(t,e){return t.createAndFill()}function Xz(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function Qz(t,e,n,r,i){const s=Xz(t),o=[],l=[];for(let u=0;u<n;u+=1){const c=Zw(s.cell);if(c&&l.push(c),r){const d=Zw(s.header_cell);d&&o.push(d)}}const a=[];for(let u=0;u<e;u+=1)a.push(s.row.createChecked(null,r&&u===0?o:l));return s.table.createChecked(null,a)}function e$(t){return t instanceof Oe}const Uc=({editor:t})=>{const{selection:e}=t.state;if(!e$(e))return!1;let n=0;const r=dS(e.ranges[0].$from,s=>s.type.name==="table");return r?.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},AW=Ke.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:Jz,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:i}=Zz(t,this.options.cellMinWidth),s=["table",Ce(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${i}`}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},s]:s},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:s})=>{const o=Qz(s.schema,t,e,n);if(i){const l=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(X.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>pz(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>gz(t,e),deleteColumn:()=>({state:t,dispatch:e})=>bz(t,e),addRowBefore:()=>({state:t,dispatch:e})=>Ez(t,e),addRowAfter:()=>({state:t,dispatch:e})=>kz(t,e),deleteRow:()=>({state:t,dispatch:e})=>_z(t,e),deleteTable:()=>({state:t,dispatch:e})=>Nz(t,e),mergeCells:()=>({state:t,dispatch:e})=>zw(t,e),splitCell:()=>({state:t,dispatch:e})=>$w(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Eu("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Eu("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>Az(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>zw(t,e)?!0:$w(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>Sz(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>Hw(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>Hw(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&C3(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=Oe.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Uc,"Mod-Backspace":Uc,Delete:Uc,"Mod-Delete":Uc}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[zz({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Yz({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:ae(K(t,"tableRole",e))}}}),TW=Ke.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",Ce(this.options.HTMLAttributes,t),0]}}),NW=Ke.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",Ce(this.options.HTMLAttributes,t),0]}}),MW=Ke.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",Ce(this.options.HTMLAttributes,t),0]}}),cn=()=>new Map,im=t=>{const e=cn();return t.forEach((n,r)=>{e.set(r,n)}),e},Ir=(t,e,n)=>{let r=t.get(e);return r===void 0&&t.set(e,r=n()),r},t$=(t,e)=>{const n=[];for(const[r,i]of t)n.push(e(i,r));return n},n$=(t,e)=>{for(const[n,r]of t)if(e(r,n))return!0;return!1},ts=()=>new Set,d0=t=>t[t.length-1],r$=(t,e)=>{for(let n=0;n<e.length;n++)t.push(e[n])},ii=Array.from,_b=(t,e)=>{for(let n=0;n<t.length;n++)if(!e(t[n],n,t))return!1;return!0},vb=(t,e)=>{for(let n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1},i$=(t,e)=>{const n=new Array(t);for(let r=0;r<t;r++)n[r]=e(r,n);return n},El=Array.isArray;class O3{constructor(){this._observers=cn()}on(e,n){return Ir(this._observers,e,ts).add(n),n}once(e,n){const r=(...i)=>{this.off(e,r),n(...i)};this.on(e,r)}off(e,n){const r=this._observers.get(e);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(e))}emit(e,n){return ii((this._observers.get(e)||cn()).values()).forEach(r=>r(...n))}destroy(){this._observers=cn()}}class s${constructor(){this._observers=cn()}on(e,n){Ir(this._observers,e,ts).add(n)}once(e,n){const r=(...i)=>{this.off(e,r),n(...i)};this.on(e,r)}off(e,n){const r=this._observers.get(e);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(e))}emit(e,n){return ii((this._observers.get(e)||cn()).values()).forEach(r=>r(...n))}destroy(){this._observers=cn()}}const Jn=Math.floor,ud=Math.abs,kl=(t,e)=>t<e?t:e,si=(t,e)=>t>e?t:e,D3=t=>t!==0?t<0:1/t<0,Xw=1,Qw=2,f0=4,h0=8,ku=32,Zr=64,Wt=128,o$=1<<29,Rh=31,sm=63,$s=127,l$=2147483647,Ff=Number.MAX_SAFE_INTEGER,e_=Number.MIN_SAFE_INTEGER,a$=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&Jn(t)===t),R3=String.fromCharCode,u$=t=>t.toLowerCase(),c$=/^\s*/g,d$=t=>t.replace(c$,""),f$=/([A-Z])/g,t_=(t,e)=>d$(t.replace(f$,n=>`${e}${u$(n)}`)),h$=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=e.codePointAt(i);return r},wu=typeof TextEncoder<"u"?new TextEncoder:null,p$=t=>wu.encode(t),g$=wu?p$:h$;let Da=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Da&&Da.decode(new Uint8Array).length===1&&(Da=null);const m$=(t,e)=>i$(e,()=>t).join("");class Gu{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const co=()=>new Gu,b$=t=>{const e=co();return t(e),_n(e)},y$=t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e},_n=t=>{const e=new Uint8Array(y$(t));let n=0;for(let r=0;r<t.bufs.length;r++){const i=t.bufs[r];e.set(i,n),n+=i.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},E$=(t,e)=>{const n=t.cbuf.length;n-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(si(n,e)*2),t.cpos=0)},ct=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},om=ct,ue=(t,e)=>{for(;e>$s;)ct(t,Wt|$s&e),e=Jn(e/128);ct(t,$s&e)},xb=(t,e)=>{const n=D3(e);for(n&&(e=-e),ct(t,(e>sm?Wt:0)|(n?Zr:0)|sm&e),e=Jn(e/64);e>0;)ct(t,(e>$s?Wt:0)|$s&e),e=Jn(e/128)},lm=new Uint8Array(3e4),k$=lm.length/3,w$=(t,e)=>{if(e.length<k$){const n=wu.encodeInto(e,lm).written||0;ue(t,n);for(let r=0;r<n;r++)ct(t,lm[r])}else pn(t,g$(e))},_$=(t,e)=>{const n=unescape(encodeURIComponent(e)),r=n.length;ue(t,r);for(let i=0;i<r;i++)ct(t,n.codePointAt(i))},Gi=wu&&wu.encodeInto?w$:_$,Ih=(t,e)=>{const n=t.cbuf.length,r=t.cpos,i=kl(n-r,e.length),s=e.length-i;t.cbuf.set(e.subarray(0,i),r),t.cpos+=i,s>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(si(n*2,s)),t.cbuf.set(e.subarray(i)),t.cpos=s)},pn=(t,e)=>{ue(t,e.byteLength),Ih(t,e)},Sb=(t,e)=>{E$(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},v$=(t,e)=>Sb(t,4).setFloat32(0,e,!1),x$=(t,e)=>Sb(t,8).setFloat64(0,e,!1),S$=(t,e)=>Sb(t,8).setBigInt64(0,e,!1),n_=new DataView(new ArrayBuffer(4)),C$=t=>(n_.setFloat32(0,t),n_.getFloat32(0)===t),wl=(t,e)=>{switch(typeof e){case"string":ct(t,119),Gi(t,e);break;case"number":a$(e)&&ud(e)<=l$?(ct(t,125),xb(t,e)):C$(e)?(ct(t,124),v$(t,e)):(ct(t,123),x$(t,e));break;case"bigint":ct(t,122),S$(t,e);break;case"object":if(e===null)ct(t,126);else if(El(e)){ct(t,117),ue(t,e.length);for(let n=0;n<e.length;n++)wl(t,e[n])}else if(e instanceof Uint8Array)ct(t,116),pn(t,e);else{ct(t,118);const n=Object.keys(e);ue(t,n.length);for(let r=0;r<n.length;r++){const i=n[r];Gi(t,i),wl(t,e[i])}}break;case"boolean":ct(t,e?120:121);break;default:ct(t,127)}};class r_ extends Gu{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&ue(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const i_=t=>{t.count>0&&(xb(t.encoder,t.count===1?t.s:-t.s),t.count>1&&ue(t.encoder,t.count-2))};class cd{constructor(){this.encoder=new Gu,this.s=0,this.count=0}write(e){this.s===e?this.count++:(i_(this),this.count=1,this.s=e)}toUint8Array(){return i_(this),_n(this.encoder)}}const s_=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);xb(t.encoder,e),t.count>1&&ue(t.encoder,t.count-2)}};class p0{constructor(){this.encoder=new Gu,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(s_(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return s_(this),_n(this.encoder)}}class A${constructor(){this.sarr=[],this.s="",this.lensE=new cd}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new Gu;return this.sarr.push(this.s),this.s="",Gi(e,this.sarr.join("")),Ih(e,this.lensE.toUint8Array()),_n(e)}}const Mr=t=>new Error(t),Vn=()=>{throw Mr("Method unimplemented")},Ft=()=>{throw Mr("Unexpected case")},I3=Mr("Unexpected end of array"),L3=Mr("Integer out of Range");class Lh{constructor(e){this.arr=e,this.pos=0}}const hs=t=>new Lh(t),T$=t=>t.pos!==t.arr.length,N$=(t,e)=>{const n=new Uint8Array(t.arr.buffer,t.pos+t.arr.byteOffset,e);return t.pos+=e,n},gn=t=>N$(t,le(t)),_l=t=>t.arr[t.pos++],le=t=>{let e=0,n=1;const r=t.arr.length;for(;t.pos<r;){const i=t.arr[t.pos++];if(e=e+(i&$s)*n,n*=128,i<Wt)return e;if(e>Ff)throw L3}throw I3},Cb=t=>{let e=t.arr[t.pos++],n=e&sm,r=64;const i=(e&Zr)>0?-1:1;if(!(e&Wt))return i*n;const s=t.arr.length;for(;t.pos<s;){if(e=t.arr[t.pos++],n=n+(e&$s)*r,r*=128,e<Wt)return i*n;if(n>Ff)throw L3}throw I3},M$=t=>{let e=le(t);if(e===0)return"";{let n=String.fromCodePoint(_l(t));if(--e<100)for(;e--;)n+=String.fromCodePoint(_l(t));else for(;e>0;){const r=e<1e4?e:1e4,i=t.arr.subarray(t.pos,t.pos+r);t.pos+=r,n+=String.fromCodePoint.apply(null,i),e-=r}return decodeURIComponent(escape(n))}},O$=t=>Da.decode(gn(t)),Yi=Da?O$:M$,Ab=(t,e)=>{const n=new DataView(t.arr.buffer,t.arr.byteOffset+t.pos,e);return t.pos+=e,n},D$=t=>Ab(t,4).getFloat32(0,!1),R$=t=>Ab(t,8).getFloat64(0,!1),I$=t=>Ab(t,8).getBigInt64(0,!1),L$=[t=>{},t=>null,Cb,D$,R$,I$,t=>!1,t=>!0,Yi,t=>{const e=le(t),n={};for(let r=0;r<e;r++){const i=Yi(t);n[i]=_u(t)}return n},t=>{const e=le(t),n=[];for(let r=0;r<e;r++)n.push(_u(t));return n},gn],_u=t=>L$[127-_l(t)](t);class o_ extends Lh{constructor(e,n){super(e),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),T$(this)?this.count=le(this)+1:this.count=-1),this.count--,this.s}}class dd extends Lh{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=Cb(this);const e=D3(this.s);this.count=1,e&&(this.s=-this.s,this.count=le(this)+2)}return this.count--,this.s}}class g0 extends Lh{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const e=Cb(this),n=e&1;this.diff=Jn(e/2),this.count=1,n&&(this.count=le(this)+2)}return this.s+=this.diff,this.count--,this.s}}class P${constructor(e){this.decoder=new dd(e),this.str=Yi(this.decoder),this.spos=0}read(){const e=this.spos+this.decoder.read(),n=this.str.slice(this.spos,e);return this.spos=e,n}}const F$=crypto.getRandomValues.bind(crypto),B$=Math.random,P3=()=>F$(new Uint32Array(1))[0],z$=t=>t[Jn(B$()*t.length)],$$="10000000-1000-4000-8000"+-1e11,U$=()=>$$.replace(/[018]/g,t=>(t^P3()&15>>t/4).toString(16)),vu=Date.now,l_=t=>new Promise(t);Promise.all.bind(Promise);const a_=t=>t===void 0?null:t;class H${constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}}let F3=new H$,V$=!0;try{typeof localStorage<"u"&&localStorage&&(F3=localStorage,V$=!1)}catch{}const W$=F3,xu=Symbol("Equality"),B3=(t,e)=>t===e||!!t?.[xu]?.(e)||!1,K$=t=>typeof t=="object",j$=Object.assign,z3=Object.keys,q$=(t,e)=>{for(const n in t)e(t[n],n)},Bf=t=>z3(t).length,G$=t=>{for(const e in t)return!1;return!0},Dl=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},Tb=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Y$=(t,e)=>t===e||Bf(t)===Bf(e)&&Dl(t,(n,r)=>(n!==void 0||Tb(e,r))&&B3(e[r],n)),J$=Object.freeze,$3=t=>{for(const e in t){const n=t[e];(typeof n=="object"||typeof n=="function")&&$3(t[e])}return J$(t)},Nb=(t,e,n=0)=>{try{for(;n<t.length;n++)t[n](...e)}finally{n<t.length&&Nb(t,e,n+1)}},Z$=t=>t,Zo=(t,e)=>{if(t===e)return!0;if(t==null||e==null||t.constructor!==e.constructor&&(t.constructor||Object)!==(e.constructor||Object))return!1;if(t[xu]!=null)return t[xu](e);switch(t.constructor){case ArrayBuffer:t=new Uint8Array(t),e=new Uint8Array(e);case Uint8Array:{if(t.byteLength!==e.byteLength)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;break}case Set:{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;break}case Map:{if(t.size!==e.size)return!1;for(const n of t.keys())if(!e.has(n)||!Zo(t.get(n),e.get(n)))return!1;break}case void 0:case Object:if(Bf(t)!==Bf(e))return!1;for(const n in t)if(!Tb(t,n)||!Zo(t[n],e[n]))return!1;break;case Array:if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!Zo(t[n],e[n]))return!1;break;default:return!1}return!0},X$=(t,e)=>e.includes(t);var U3={};const vl=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",H3=typeof window<"u"&&typeof document<"u"&&!vl;let hr;const Q$=()=>{if(hr===void 0)if(vl){hr=cn();const t=process.argv;let e=null;for(let n=0;n<t.length;n++){const r=t[n];r[0]==="-"?(e!==null&&hr.set(e,""),e=r):e!==null&&(hr.set(e,r),e=null)}e!==null&&hr.set(e,"")}else typeof location=="object"?(hr=cn(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){const[e,n]=t.split("=");hr.set(`--${t_(e,"-")}`,n),hr.set(`-${t_(e,"-")}`,n)}})):hr=cn();return hr},am=t=>Q$().has(t),zf=t=>a_(vl?U3[t.toUpperCase().replaceAll("-","_")]:W$.getItem(t)),V3=t=>am("--"+t)||zf(t)!==null,eU=V3("production"),tU=vl&&X$(U3.FORCE_COLOR,["true","1","2"]),nU=tU||!am("--no-colors")&&!V3("no-color")&&(!vl||process.stdout.isTTY)&&(!vl||am("--color")||zf("COLORTERM")!==null||(zf("TERM")||"").includes("color")),rU=t=>new Uint8Array(t),iU=t=>{let e="";for(let n=0;n<t.byteLength;n++)e+=R3(t[n]);return btoa(e)},sU=t=>Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("base64"),oU=H3?iU:sU,lU=t=>{const e=rU(t.byteLength);return e.set(t),e},aU=t=>b$(e=>wl(e,t));class uU{constructor(e,n){this.left=e,this.right=n}}const Br=(t,e)=>new uU(t,e),u_=t=>t.next()>=.5,m0=(t,e,n)=>Jn(t.next()*(n+1-e)+e),W3=(t,e,n)=>Jn(t.next()*(n+1-e)+e),Mb=(t,e,n)=>W3(t,e,n),cU=t=>R3(Mb(t,97,122)),dU=(t,e=0,n=20)=>{const r=Mb(t,e,n);let i="";for(let s=0;s<r;s++)i+=cU(t);return i},b0=(t,e)=>e[Mb(t,0,e.length-1)],fU=Symbol("0schema");class hU{constructor(){this._rerrs=[]}extend(e,n,r,i=null){this._rerrs.push({path:e,expected:n,has:r,message:i})}toString(){const e=[];for(let n=this._rerrs.length-1;n>0;n--){const r=this._rerrs[n];e.push(m$(" ",(this._rerrs.length-n)*2)+`${r.path!=null?`[${r.path}] `:""}${r.has} doesn't match ${r.expected}. ${r.message}`)}return e.join(`
|
|
166
|
+
`)}}const um=(t,e)=>t===e?!0:t==null||e==null||t.constructor!==e.constructor?!1:t[xu]?B3(t,e):El(t)?_b(t,n=>vb(e,r=>um(n,r))):K$(t)?Dl(t,(n,r)=>um(n,e[r])):!1;class Yt{static _dilutes=!1;extends(e){let[n,r]=[this.shape,e.shape];return this.constructor._dilutes&&([r,n]=[n,r]),um(n,r)}equals(e){return this.constructor===e.constructor&&Zo(this.shape,e.shape)}[fU](){return!0}[xu](e){return this.equals(e)}validate(e){return this.check(e)}check(e,n){Vn()}get nullable(){return Rl(this,$h)}get optional(){return new q3(this)}cast(e){return c_(e,this),e}expect(e){return c_(e,this),e}}class Ob extends Yt{constructor(e,n){super(),this.shape=e,this._c=n}check(e,n=void 0){const r=e?.constructor===this.shape&&(this._c==null||this._c(e));return!r&&n?.extend(null,this.shape.name,e?.constructor.name,e?.constructor!==this.shape?"Constructor match failed":"Check failed"),r}}const tt=(t,e=null)=>new Ob(t,e);tt(Ob);class Db extends Yt{constructor(e){super(),this.shape=e}check(e,n){const r=this.shape(e);return!r&&n?.extend(null,"custom prop",e?.constructor.name,"failed to check custom prop"),r}}const yt=t=>new Db(t);tt(Db);class Ph extends Yt{constructor(e){super(),this.shape=e}check(e,n){const r=this.shape.some(i=>i===e);return!r&&n?.extend(null,this.shape.join(" | "),e.toString()),r}}const Fh=(...t)=>new Ph(t),K3=tt(Ph),pU=RegExp.escape||(t=>t.replace(/[().|&,$^[\]]/g,e=>"\\"+e)),j3=t=>{if(xl.check(t))return[pU(t)];if(K3.check(t))return t.shape.map(e=>e+"");if(nA.check(t))return["[+-]?\\d+.?\\d*"];if(rA.check(t))return[".*"];if($f.check(t))return t.shape.map(j3).flat(1);Ft()};class gU extends Yt{constructor(e){super(),this.shape=e,this._r=new RegExp("^"+e.map(j3).map(n=>`(${n.join("|")})`).join("")+"$")}check(e,n){const r=this._r.exec(e)!=null;return!r&&n?.extend(null,this._r.toString(),e.toString(),"String doesn't match string template."),r}}tt(gU);const mU=Symbol("optional");class q3 extends Yt{constructor(e){super(),this.shape=e}check(e,n){const r=e===void 0||this.shape.check(e);return!r&&n?.extend(null,"undefined (optional)","()"),r}get[mU](){return!0}}const bU=tt(q3);class yU extends Yt{check(e,n){return n?.extend(null,"never",typeof e),!1}}tt(yU);class Bh extends Yt{constructor(e,n=!1){super(),this.shape=e,this._isPartial=n}static _dilutes=!0;get partial(){return new Bh(this.shape,!0)}check(e,n){return e==null?(n?.extend(null,"object","null"),!1):Dl(this.shape,(r,i)=>{const s=this._isPartial&&!Tb(e,i)||r.check(e[i],n);return!s&&n?.extend(i.toString(),r.toString(),typeof e[i],"Object property does not match"),s})}}const EU=t=>new Bh(t),kU=tt(Bh),wU=yt(t=>t!=null&&(t.constructor===Object||t.constructor==null));class G3 extends Yt{constructor(e,n){super(),this.shape={keys:e,values:n}}check(e,n){return e!=null&&Dl(e,(r,i)=>{const s=this.shape.keys.check(i,n);return!s&&n?.extend(i+"","Record",typeof e,s?"Key doesn't match schema":"Value doesn't match value"),s&&this.shape.values.check(r,n)})}}const Y3=(t,e)=>new G3(t,e),_U=tt(G3);class J3 extends Yt{constructor(e){super(),this.shape=e}check(e,n){return e!=null&&Dl(this.shape,(r,i)=>{const s=r.check(e[i],n);return!s&&n?.extend(i.toString(),"Tuple",typeof r),s})}}const vU=(...t)=>new J3(t);tt(J3);class Z3 extends Yt{constructor(e){super(),this.shape=e.length===1?e[0]:new Rb(e)}check(e,n){const r=El(e)&&_b(e,i=>this.shape.check(i));return!r&&n?.extend(null,"Array",""),r}}const X3=(...t)=>new Z3(t),xU=tt(Z3),SU=yt(t=>El(t));class Q3 extends Yt{constructor(e,n){super(),this.shape=e,this._c=n}check(e,n){const r=e instanceof this.shape&&(this._c==null||this._c(e));return!r&&n?.extend(null,this.shape.name,e?.constructor.name),r}}const CU=(t,e=null)=>new Q3(t,e);tt(Q3);const AU=CU(Yt);class TU extends Yt{constructor(e){super(),this.len=e.length-1,this.args=vU(...e.slice(-1)),this.res=e[this.len]}check(e,n){const r=e.constructor===Function&&e.length<=this.len;return!r&&n?.extend(null,"function",typeof e),r}}const NU=tt(TU),MU=yt(t=>typeof t=="function");class OU extends Yt{constructor(e){super(),this.shape=e}check(e,n){const r=_b(this.shape,i=>i.check(e,n));return!r&&n?.extend(null,"Intersectinon",typeof e),r}}tt(OU,t=>t.shape.length>0);class Rb extends Yt{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,n){const r=vb(this.shape,i=>i.check(e,n));return n?.extend(null,"Union",typeof e),r}}const Rl=(...t)=>t.findIndex(e=>$f.check(e))>=0?Rl(...t.map(e=>Su(e)).map(e=>$f.check(e)?e.shape:[e]).flat(1)):t.length===1?t[0]:new Rb(t),$f=tt(Rb),eA=()=>!0,Uf=yt(eA),DU=tt(Db,t=>t.shape===eA),Ib=yt(t=>typeof t=="bigint"),RU=yt(t=>t===Ib),tA=yt(t=>typeof t=="symbol");yt(t=>t===tA);const Xo=yt(t=>typeof t=="number"),nA=yt(t=>t===Xo),xl=yt(t=>typeof t=="string"),rA=yt(t=>t===xl),zh=yt(t=>typeof t=="boolean"),IU=yt(t=>t===zh),iA=Fh(void 0);tt(Ph,t=>t.shape.length===1&&t.shape[0]===void 0);Fh(void 0);const $h=Fh(null),LU=tt(Ph,t=>t.shape.length===1&&t.shape[0]===null);tt(Uint8Array);tt(Ob,t=>t.shape===Uint8Array);const PU=Rl(Xo,xl,$h,iA,Ib,zh,tA);(()=>{const t=X3(Uf),e=Y3(xl,Uf),n=Rl(Xo,xl,$h,zh,t,e);return t.shape=n,e.shape.values=n,n})();const Su=t=>{if(AU.check(t))return t;if(wU.check(t)){const e={};for(const n in t)e[n]=Su(t[n]);return EU(e)}else{if(SU.check(t))return Rl(...t.map(Su));if(PU.check(t))return Fh(t);if(MU.check(t))return tt(t)}Ft()},c_=eU?()=>{}:(t,e)=>{const n=new hU;if(!e.check(t,n))throw Mr(`Expected value to be of type ${e.constructor.name}.
|
|
167
|
+
${n.toString()}`)};class FU{constructor(e){this.patterns=[],this.$state=e}if(e,n){return this.patterns.push({if:Su(e),h:n}),this}else(e){return this.if(Uf,e)}done(){return(e,n)=>{for(let r=0;r<this.patterns.length;r++){const i=this.patterns[r];if(i.if.check(e))return i.h(e,n)}throw Mr("Unhandled pattern")}}}const BU=t=>new FU(t),sA=BU(Uf).if(nA,(t,e)=>m0(e,e_,Ff)).if(rA,(t,e)=>dU(e)).if(IU,(t,e)=>u_(e)).if(RU,(t,e)=>BigInt(m0(e,e_,Ff))).if($f,(t,e)=>wo(e,b0(e,t.shape))).if(kU,(t,e)=>{const n={};for(const r in t.shape){let i=t.shape[r];if(bU.check(i)){if(u_(e))continue;i=i.shape}n[r]=sA(i,e)}return n}).if(xU,(t,e)=>{const n=[],r=W3(e,0,42);for(let i=0;i<r;i++)n.push(wo(e,t.shape));return n}).if(K3,(t,e)=>b0(e,t.shape)).if(LU,(t,e)=>null).if(NU,(t,e)=>{const n=wo(e,t.res);return()=>n}).if(DU,(t,e)=>wo(e,b0(e,[Xo,xl,$h,iA,Ib,zh,X3(Xo),Y3(Rl("a","b","c"),Xo)]))).if(_U,(t,e)=>{const n={},r=m0(e,0,3);for(let i=0;i<r;i++){const s=wo(e,t.shape.keys),o=wo(e,t.shape.values);n[s]=o}return n}).done(),wo=(t,e)=>sA(Su(e),t),Yu=typeof document<"u"?document:{};yt(t=>t.nodeType===VU);typeof DOMParser<"u"&&new DOMParser;yt(t=>t.nodeType===$U);yt(t=>t.nodeType===UU);const zU=t=>t$(t,(e,n)=>`${n}:${e};`).join(""),$U=Yu.ELEMENT_NODE,UU=Yu.TEXT_NODE,HU=Yu.DOCUMENT_NODE,VU=Yu.DOCUMENT_FRAGMENT_NODE;yt(t=>t.nodeType===HU);const WU=t=>class{constructor(n){this._=n}destroy(){t(this._)}},KU=WU(clearTimeout),oA=(t,e)=>new KU(setTimeout(e,t)),ui=Symbol,lA=ui(),aA=ui(),jU=ui(),qU=ui(),GU=ui(),uA=ui(),YU=ui(),Lb=ui(),JU=ui(),ZU=t=>{t.length===1&&t[0]?.constructor===Function&&(t=t[0]());const e=[],n=[];let r=0;for(;r<t.length;r++){const i=t[r];if(i===void 0)break;if(i.constructor===String||i.constructor===Number)e.push(i);else if(i.constructor===Object)break}for(r>0&&n.push(e.join(""));r<t.length;r++){const i=t[r];i instanceof Symbol||n.push(i)}return n},XU={[lA]:Br("font-weight","bold"),[aA]:Br("font-weight","normal"),[jU]:Br("color","blue"),[GU]:Br("color","green"),[qU]:Br("color","grey"),[uA]:Br("color","red"),[YU]:Br("color","purple"),[Lb]:Br("color","orange"),[JU]:Br("color","black")},QU=t=>{t.length===1&&t[0]?.constructor===Function&&(t=t[0]());const e=[],n=[],r=cn();let i=[],s=0;for(;s<t.length;s++){const o=t[s],l=XU[o];if(l!==void 0)r.set(l.left,l.right);else{if(o===void 0)break;if(o.constructor===String||o.constructor===Number){const a=zU(r);s>0||a.length>0?(e.push("%c"+o),n.push(a)):e.push(o)}else break}}for(s>0&&(i=n,i.unshift(e.join("")));s<t.length;s++){const o=t[s];o instanceof Symbol||i.push(o)}return i},cA=nU?QU:ZU,eH=(...t)=>{console.log(...cA(t)),fA.forEach(e=>e.print(t))},dA=(...t)=>{console.warn(...cA(t)),t.unshift(Lb),fA.forEach(e=>e.print(t))},fA=ts(),hA=t=>({[Symbol.iterator](){return this},next:t}),tH=(t,e)=>hA(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),y0=(t,e)=>hA(()=>{const{done:n,value:r}=t.next();return{done:n,value:n?void 0:e(r)}});class Pb{constructor(e,n){this.clock=e,this.len=n}}class Il{constructor(){this.clients=new Map}}const oi=(t,e,n)=>e.clients.forEach((r,i)=>{const s=t.doc.store.clients.get(i);if(s!=null){const o=s[s.length-1],l=o.id.clock+o.length;for(let a=0,u=r[a];a<r.length&&u.clock<l;u=r[++a])CA(t,s,u.clock,u.len,n)}}),nH=(t,e)=>{let n=0,r=t.length-1;for(;n<=r;){const i=Jn((n+r)/2),s=t[i],o=s.clock;if(o<=e){if(e<o+s.len)return i;n=i+1}else r=i-1}return null},fo=(t,e)=>{const n=t.clients.get(e.client);return n!==void 0&&nH(n,e.clock)!==null},Fb=t=>{t.clients.forEach(e=>{e.sort((i,s)=>i.clock-s.clock);let n,r;for(n=1,r=1;n<e.length;n++){const i=e[r-1],s=e[n];i.clock+i.len>=s.clock?i.len=si(i.len,s.clock+s.len-i.clock):(r<n&&(e[r]=s),r++)}e.length=r})},Hf=t=>{const e=new Il;for(let n=0;n<t.length;n++)t[n].clients.forEach((r,i)=>{if(!e.clients.has(i)){const s=r.slice();for(let o=n+1;o<t.length;o++)r$(s,t[o].clients.get(i)||[]);e.clients.set(i,s)}});return Fb(e),e},Cu=(t,e,n,r)=>{Ir(t.clients,e,()=>[]).push(new Pb(n,r))},Bb=()=>new Il,zb=t=>{const e=Bb();return t.clients.forEach((n,r)=>{const i=[];for(let s=0;s<n.length;s++){const o=n[s];if(o.deleted){const l=o.id.clock;let a=o.length;if(s+1<n.length)for(let u=n[s+1];s+1<n.length&&u.deleted;u=n[++s+1])a+=u.length;i.push(new Pb(l,a))}}i.length>0&&e.clients.set(r,i)}),e},Ll=(t,e)=>{ue(t.restEncoder,e.clients.size),ii(e.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{t.resetDsCurVal(),ue(t.restEncoder,n);const i=r.length;ue(t.restEncoder,i);for(let s=0;s<i;s++){const o=r[s];t.writeDsClock(o.clock),t.writeDsLen(o.len)}})},$b=t=>{const e=new Il,n=le(t.restDecoder);for(let r=0;r<n;r++){t.resetDsCurVal();const i=le(t.restDecoder),s=le(t.restDecoder);if(s>0){const o=Ir(e.clients,i,()=>[]);for(let l=0;l<s;l++)o.push(new Pb(t.readDsClock(),t.readDsLen()))}}return e},d_=(t,e,n)=>{const r=new Il,i=le(t.restDecoder);for(let s=0;s<i;s++){t.resetDsCurVal();const o=le(t.restDecoder),l=le(t.restDecoder),a=n.clients.get(o)||[],u=We(n,o);for(let c=0;c<l;c++){const d=t.readDsClock(),f=d+t.readDsLen();if(d<u){u<f&&Cu(r,o,u,f-u);let h=Zn(a,d),p=a[h];for(!p.deleted&&p.id.clock<d&&(a.splice(h+1,0,Kf(e,p,d-p.id.clock)),h++);h<a.length&&(p=a[h++],p.id.clock<f);)p.deleted||(f<p.id.clock+p.length&&a.splice(h,0,Kf(e,p,f-p.id.clock)),p.delete(e))}else Cu(r,o,d,f-d)}}if(r.clients.size>0){const s=new ns;return ue(s.restEncoder,0),Ll(s,r),s.toUint8Array()}return null},pA=P3;class ps extends O3{constructor({guid:e=U$(),collectionid:n=null,gc:r=!0,gcFilter:i=()=>!0,meta:s=null,autoLoad:o=!1,shouldLoad:l=!0}={}){super(),this.gc=r,this.gcFilter=i,this.clientID=pA(),this.guid=e,this.collectionid=n,this.share=new Map,this.store=new xA,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=l,this.autoLoad=o,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=l_(u=>{this.on("load",()=>{this.isLoaded=!0,u(this)})});const a=()=>l_(u=>{const c=d=>{(d===void 0||d===!0)&&(this.off("sync",c),u())};this.on("sync",c)});this.on("sync",u=>{u===!1&&this.isSynced&&(this.whenSynced=a()),this.isSynced=u===void 0||u===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=a()}load(){const e=this._item;e!==null&&!this.shouldLoad&&Se(e.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(ii(this.subdocs).map(e=>e.guid))}transact(e,n=null){return Se(this,e,n)}get(e,n=lt){const r=Ir(this.share,e,()=>{const s=new n;return s._integrate(this,null),s}),i=r.constructor;if(n!==lt&&i!==n)if(i===lt){const s=new n;s._map=r._map,r._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=s}),s._start=r._start;for(let o=s._start;o!==null;o=o.right)o.parent=s;return s._length=r._length,this.share.set(e,s),s._integrate(this,null),s}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return r}getArray(e=""){return this.get(e,Vs)}getText(e=""){return this.get(e,li)}getMap(e=""){return this.get(e,io)}getXmlElement(e=""){return this.get(e,St)}getXmlFragment(e=""){return this.get(e,rs)}toJSON(){const e={};return this.share.forEach((n,r)=>{e[r]=n.toJSON()}),e}destroy(){this.isDestroyed=!0,ii(this.subdocs).forEach(n=>n.destroy());const e=this._item;if(e!==null){this._item=null;const n=e.content;n.doc=new ps({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=e,Se(e.parent.doc,r=>{const i=n.doc;e.deleted||r.subdocsAdded.add(i),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class gA{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return le(this.restDecoder)}readDsLen(){return le(this.restDecoder)}}class Ub extends gA{readLeftID(){return ce(le(this.restDecoder),le(this.restDecoder))}readRightID(){return ce(le(this.restDecoder),le(this.restDecoder))}readClient(){return le(this.restDecoder)}readInfo(){return _l(this.restDecoder)}readString(){return Yi(this.restDecoder)}readParentInfo(){return le(this.restDecoder)===1}readTypeRef(){return le(this.restDecoder)}readLen(){return le(this.restDecoder)}readAny(){return _u(this.restDecoder)}readBuf(){return lU(gn(this.restDecoder))}readJSON(){return JSON.parse(Yi(this.restDecoder))}readKey(){return Yi(this.restDecoder)}}class rH{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=le(this.restDecoder),this.dsCurrVal}readDsLen(){const e=le(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class ro extends rH{constructor(e){super(e),this.keys=[],le(e),this.keyClockDecoder=new g0(gn(e)),this.clientDecoder=new dd(gn(e)),this.leftClockDecoder=new g0(gn(e)),this.rightClockDecoder=new g0(gn(e)),this.infoDecoder=new o_(gn(e),_l),this.stringDecoder=new P$(gn(e)),this.parentInfoDecoder=new o_(gn(e),_l),this.typeRefDecoder=new dd(gn(e)),this.lenDecoder=new dd(gn(e))}readLeftID(){return new Us(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Us(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return _u(this.restDecoder)}readBuf(){return gn(this.restDecoder)}readJSON(){return _u(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{const n=this.stringDecoder.read();return this.keys.push(n),n}}}class mA{constructor(){this.restEncoder=co()}toUint8Array(){return _n(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){ue(this.restEncoder,e)}writeDsLen(e){ue(this.restEncoder,e)}}class Pl extends mA{writeLeftID(e){ue(this.restEncoder,e.client),ue(this.restEncoder,e.clock)}writeRightID(e){ue(this.restEncoder,e.client),ue(this.restEncoder,e.clock)}writeClient(e){ue(this.restEncoder,e)}writeInfo(e){om(this.restEncoder,e)}writeString(e){Gi(this.restEncoder,e)}writeParentInfo(e){ue(this.restEncoder,e?1:0)}writeTypeRef(e){ue(this.restEncoder,e)}writeLen(e){ue(this.restEncoder,e)}writeAny(e){wl(this.restEncoder,e)}writeBuf(e){pn(this.restEncoder,e)}writeJSON(e){Gi(this.restEncoder,JSON.stringify(e))}writeKey(e){Gi(this.restEncoder,e)}}class bA{constructor(){this.restEncoder=co(),this.dsCurrVal=0}toUint8Array(){return _n(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const n=e-this.dsCurrVal;this.dsCurrVal=e,ue(this.restEncoder,n)}writeDsLen(e){e===0&&Ft(),ue(this.restEncoder,e-1),this.dsCurrVal+=e}}class ns extends bA{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new p0,this.clientEncoder=new cd,this.leftClockEncoder=new p0,this.rightClockEncoder=new p0,this.infoEncoder=new r_(om),this.stringEncoder=new A$,this.parentInfoEncoder=new r_(om),this.typeRefEncoder=new cd,this.lenEncoder=new cd}toUint8Array(){const e=co();return ue(e,0),pn(e,this.keyClockEncoder.toUint8Array()),pn(e,this.clientEncoder.toUint8Array()),pn(e,this.leftClockEncoder.toUint8Array()),pn(e,this.rightClockEncoder.toUint8Array()),pn(e,_n(this.infoEncoder)),pn(e,this.stringEncoder.toUint8Array()),pn(e,_n(this.parentInfoEncoder)),pn(e,this.typeRefEncoder.toUint8Array()),pn(e,this.lenEncoder.toUint8Array()),Ih(e,_n(this.restEncoder)),_n(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){wl(this.restEncoder,e)}writeBuf(e){pn(this.restEncoder,e)}writeJSON(e){wl(this.restEncoder,e)}writeKey(e){const n=this.keyMap.get(e);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(n)}}const iH=(t,e,n,r)=>{r=si(r,e[0].id.clock);const i=Zn(e,r);ue(t.restEncoder,e.length-i),t.writeClient(n),ue(t.restEncoder,r);const s=e[i];s.write(t,r-s.id.clock);for(let o=i+1;o<e.length;o++)e[o].write(t,0)},Hb=(t,e,n)=>{const r=new Map;n.forEach((i,s)=>{We(e,s)>i&&r.set(s,i)}),Ju(e).forEach((i,s)=>{n.has(s)||r.set(s,0)}),ue(t.restEncoder,r.size),ii(r.entries()).sort((i,s)=>s[0]-i[0]).forEach(([i,s])=>{iH(t,e.clients.get(i),i,s)})},sH=(t,e)=>{const n=cn(),r=le(t.restDecoder);for(let i=0;i<r;i++){const s=le(t.restDecoder),o=new Array(s),l=t.readClient();let a=le(t.restDecoder);n.set(l,{i:0,refs:o});for(let u=0;u<s;u++){const c=t.readInfo();switch(Rh&c){case 0:{const d=t.readLen();o[u]=new En(ce(l,a),d),a+=d;break}case 10:{const d=le(t.restDecoder);o[u]=new kn(ce(l,a),d),a+=d;break}default:{const d=(c&(Zr|Wt))===0,f=new ke(ce(l,a),null,(c&Wt)===Wt?t.readLeftID():null,null,(c&Zr)===Zr?t.readRightID():null,d?t.readParentInfo()?e.get(t.readString()):t.readLeftID():null,d&&(c&ku)===ku?t.readString():null,nT(t,c));o[u]=f,a+=f.length}}}}return n},oH=(t,e,n)=>{const r=[];let i=ii(n.keys()).sort((h,p)=>h-p);if(i.length===0)return null;const s=()=>{if(i.length===0)return null;let h=n.get(i[i.length-1]);for(;h.refs.length===h.i;)if(i.pop(),i.length>0)h=n.get(i[i.length-1]);else return null;return h};let o=s();if(o===null)return null;const l=new xA,a=new Map,u=(h,p)=>{const g=a.get(h);(g==null||g>p)&&a.set(h,p)};let c=o.refs[o.i++];const d=new Map,f=()=>{for(const h of r){const p=h.id.client,g=n.get(p);g?(g.i--,l.clients.set(p,g.refs.slice(g.i)),n.delete(p),g.i=0,g.refs=[]):l.clients.set(p,[h]),i=i.filter(b=>b!==p)}r.length=0};for(;;){if(c.constructor!==kn){const p=Ir(d,c.id.client,()=>We(e,c.id.client))-c.id.clock;if(p<0)r.push(c),u(c.id.client,c.id.clock-1),f();else{const g=c.getMissing(t,e);if(g!==null){r.push(c);const b=n.get(g)||{refs:[],i:0};if(b.refs.length===b.i)u(g,We(e,g)),f();else{c=b.refs[b.i++];continue}}else(p===0||p<c.length)&&(c.integrate(t,p),d.set(c.id.client,c.id.clock+c.length))}}if(r.length>0)c=r.pop();else if(o!==null&&o.i<o.refs.length)c=o.refs[o.i++];else{if(o=s(),o===null)break;c=o.refs[o.i++]}}if(l.clients.size>0){const h=new ns;return Hb(h,l,new Map),ue(h.restEncoder,0),{missing:a,update:h.toUint8Array()}}return null},lH=(t,e)=>Hb(t,e.doc.store,e.beforeState),yA=(t,e,n,r=new ro(t))=>Se(e,i=>{i.local=!1;let s=!1;const o=i.doc,l=o.store,a=sH(r,o),u=oH(i,l,a),c=l.pendingStructs;if(c){for(const[f,h]of c.missing)if(h<We(l,f)){s=!0;break}if(u){for(const[f,h]of u.missing){const p=c.missing.get(f);(p==null||p>h)&&c.missing.set(f,h)}c.update=Nu([c.update,u.update])}}else l.pendingStructs=u;const d=d_(r,i,l);if(l.pendingDs){const f=new ro(hs(l.pendingDs));le(f.restDecoder);const h=d_(f,i,l);d&&h?l.pendingDs=Nu([d,h]):l.pendingDs=d||h}else l.pendingDs=d;if(s){const f=l.pendingStructs.update;l.pendingStructs=null,Au(i.doc,f)}},n,!1),Au=(t,e,n,r=ro)=>{const i=hs(e);yA(i,t,n,new r(i))},aH=(t,e,n)=>Au(t,e,n,Ub),uH=(t,e,n=new Map)=>{Hb(t,e.store,n),Ll(t,zb(e.store))},EA=(t,e=new Uint8Array([0]),n=new ns)=>{const r=Vb(e);uH(n,t,r);const i=[n.toUint8Array()];if(t.store.pendingDs&&i.push(t.store.pendingDs),t.store.pendingStructs&&i.push(MA(t.store.pendingStructs.update,e)),i.length>1){if(n.constructor===Pl)return NA(i.map((s,o)=>o===0?s:DA(s)));if(n.constructor===ns)return Nu(i)}return i[0]},cH=(t,e)=>EA(t,e,new Pl),dH=t=>{const e=new Map,n=le(t.restDecoder);for(let r=0;r<n;r++){const i=le(t.restDecoder),s=le(t.restDecoder);e.set(i,s)}return e},Vb=t=>dH(new gA(hs(t))),kA=(t,e)=>(ue(t.restEncoder,e.size),ii(e.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{ue(t.restEncoder,n),ue(t.restEncoder,r)}),t),fH=(t,e)=>kA(t,Ju(e.store)),hH=(t,e=new bA)=>(t instanceof Map?kA(e,t):fH(e,t),e.toUint8Array()),pH=t=>hH(t,new mA);class gH{constructor(){this.l=[]}}const f_=()=>new gH,h_=(t,e)=>t.l.push(e),p_=(t,e)=>{const n=t.l,r=n.length;t.l=n.filter(i=>e!==i),r===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},wA=(t,e,n)=>Nb(t.l,[e,n]);class Us{constructor(e,n){this.client=e,this.clock=n}}const aa=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,ce=(t,e)=>new Us(t,e),Sl=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw Ft()},Cl=(t,e)=>{for(;e!==null;){if(e.parent===t)return!0;e=e.parent._item}return!1};class Tu{constructor(e,n,r,i=0){this.type=e,this.tname=n,this.item=r,this.assoc=i}}class _A{constructor(e,n,r=0){this.type=e,this.index=n,this.assoc=r}}const mH=(t,e,n=0)=>new _A(t,e,n),Hc=(t,e,n)=>{let r=null,i=null;return t._item===null?i=Sl(t):r=ce(t._item.id.client,t._item.id.clock),new Tu(r,i,e,n)},fd=(t,e,n=0)=>{let r=t._start;if(n<0){if(e===0)return Hc(t,null,n);e--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>e)return Hc(t,ce(r.id.client,r.id.clock+e),n);e-=r.length}if(r.right===null&&n<0)return Hc(t,r.lastId,n);r=r.right}return Hc(t,null,n)},bH=(t,e)=>{const n=Hs(t,e),r=e.clock-n.id.clock;return{item:n,diff:r}},vA=(t,e,n=!0)=>{const r=e.store,i=t.item,s=t.type,o=t.tname,l=t.assoc;let a=null,u=0;if(i!==null){if(We(r,i.client)<=i.clock)return null;const c=n?pm(r,i):bH(r,i),d=c.item;if(!(d instanceof ke))return null;if(a=d.parent,a._item===null||!a._item.deleted){u=d.deleted||!d.countable?0:c.diff+(l>=0?0:1);let f=d.left;for(;f!==null;)!f.deleted&&f.countable&&(u+=f.length),f=f.left}}else{if(o!==null)a=e.get(o);else if(s!==null){if(We(r,s.client)<=s.clock)return null;const{item:c}=n?pm(r,s):{item:Hs(r,s)};if(c instanceof ke&&c.content instanceof Qn)a=c.content.type;else return null}else throw Ft();l>=0?u=a._length:u=0}return mH(a,u,t.assoc)};class Uh{constructor(e,n){this.ds=e,this.sv=n}}const Wb=(t,e)=>new Uh(t,e),hd=t=>Wb(zb(t.store),Ju(t.store)),vs=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!fo(e.ds,t.id),cm=(t,e)=>{const n=Ir(t.meta,cm,ts),r=t.doc.store;n.has(e)||(e.sv.forEach((i,s)=>{i<We(r,s)&&Ht(t,ce(s,i))}),oi(t,e.ds,i=>{}),n.add(e))};class xA{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const Ju=t=>{const e=new Map;return t.clients.forEach((n,r)=>{const i=n[n.length-1];e.set(r,i.id.clock+i.length)}),e},We=(t,e)=>{const n=t.clients.get(e);if(n===void 0)return 0;const r=n[n.length-1];return r.id.clock+r.length},SA=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{const r=n[n.length-1];if(r.id.clock+r.length!==e.id.clock)throw Ft()}n.push(e)},Zn=(t,e)=>{let n=0,r=t.length-1,i=t[r],s=i.id.clock;if(s===e)return r;let o=Jn(e/(s+i.length-1)*r);for(;n<=r;){if(i=t[o],s=i.id.clock,s<=e){if(e<s+i.length)return o;n=o+1}else r=o-1;o=Jn((n+r)/2)}throw Ft()},yH=(t,e)=>{const n=t.clients.get(e.client);return n[Zn(n,e.clock)]},Hs=yH,dm=(t,e,n)=>{const r=Zn(e,n),i=e[r];return i.id.clock<n&&i instanceof ke?(e.splice(r+1,0,Kf(t,i,n-i.id.clock)),r+1):r},Ht=(t,e)=>{const n=t.doc.store.clients.get(e.client);return n[dm(t,n,e.clock)]},fm=(t,e,n)=>{const r=e.clients.get(n.client),i=Zn(r,n.clock),s=r[i];return n.clock!==s.id.clock+s.length-1&&s.constructor!==En&&r.splice(i+1,0,Kf(t,s,n.clock-s.id.clock+1)),s},EH=(t,e,n)=>{const r=t.clients.get(e.id.client);r[Zn(r,e.id.clock)]=n},CA=(t,e,n,r,i)=>{if(r===0)return;const s=n+r;let o=dm(t,e,n),l;do l=e[o++],s<l.id.clock+l.length&&dm(t,e,s),i(l);while(o<e.length&&e[o].id.clock<s)};class AA{constructor(e,n,r){this.doc=e,this.deleteSet=new Il,this.beforeState=Ju(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=r,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const g_=(t,e)=>e.deleteSet.clients.size===0&&!n$(e.afterState,(n,r)=>e.beforeState.get(r)!==n)?!1:(Fb(e.deleteSet),lH(t,e),Ll(t,e.deleteSet),!0),m_=(t,e,n)=>{const r=e._item;(r===null||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)&&Ir(t.changed,e,ts).add(n)},pd=(t,e)=>{let n=t[e],r=t[e-1],i=e;for(;i>0;n=r,r=t[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof ke&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}const s=e-i;return s&&t.splice(e+1-s,s),s},kH=(t,e,n)=>{for(const[r,i]of t.clients.entries()){const s=e.clients.get(r);for(let o=i.length-1;o>=0;o--){const l=i[o],a=l.clock+l.len;for(let u=Zn(s,l.clock),c=s[u];u<s.length&&c.id.clock<a;c=s[++u]){const d=s[u];if(l.clock+l.len<=d.id.clock)break;d instanceof ke&&d.deleted&&!d.keep&&n(d)&&d.gc(e,!1)}}}},wH=(t,e)=>{t.clients.forEach((n,r)=>{const i=e.clients.get(r);for(let s=n.length-1;s>=0;s--){const o=n[s],l=kl(i.length-1,1+Zn(i,o.clock+o.len-1));for(let a=l,u=i[a];a>0&&u.id.clock>=o.clock;u=i[a])a-=1+pd(i,a)}})},TA=(t,e)=>{if(e<t.length){const n=t[e],r=n.doc,i=r.store,s=n.deleteSet,o=n._mergeStructs;try{Fb(s),n.afterState=Ju(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const l=[];n.changed.forEach((a,u)=>l.push(()=>{(u._item===null||!u._item.deleted)&&u._callObserver(n,a)})),l.push(()=>{n.changedParentTypes.forEach((a,u)=>{u._dEH.l.length>0&&(u._item===null||!u._item.deleted)&&(a=a.filter(c=>c.target._item===null||!c.target._item.deleted),a.forEach(c=>{c.currentTarget=u,c._path=null}),a.sort((c,d)=>c.path.length-d.path.length),l.push(()=>{wA(u._dEH,a,n)}))}),l.push(()=>r.emit("afterTransaction",[n,r])),l.push(()=>{n._needFormattingCleanup&&LH(n)})}),Nb(l,[])}finally{r.gc&&kH(s,i,r.gcFilter),wH(s,i),n.afterState.forEach((c,d)=>{const f=n.beforeState.get(d)||0;if(f!==c){const h=i.clients.get(d),p=si(Zn(h,f),1);for(let g=h.length-1;g>=p;)g-=1+pd(h,g)}});for(let c=o.length-1;c>=0;c--){const{client:d,clock:f}=o[c].id,h=i.clients.get(d),p=Zn(h,f);p+1<h.length&&pd(h,p+1)>1||p>0&&pd(h,p)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(eH(Lb,lA,"[yjs] ",aA,uA,"Changed the client-id because another client seems to be using it."),r.clientID=pA()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const c=new Pl;g_(c,n)&&r.emit("update",[c.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const c=new ns;g_(c,n)&&r.emit("updateV2",[c.toUint8Array(),n.origin,r,n])}const{subdocsAdded:l,subdocsLoaded:a,subdocsRemoved:u}=n;(l.size>0||u.size>0||a.size>0)&&(l.forEach(c=>{c.clientID=r.clientID,c.collectionid==null&&(c.collectionid=r.collectionid),r.subdocs.add(c)}),u.forEach(c=>r.subdocs.delete(c)),r.emit("subdocs",[{loaded:a,added:l,removed:u},r,n]),u.forEach(c=>c.destroy())),t.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t])):TA(t,e+1)}}},Se=(t,e,n=null,r=!0)=>{const i=t._transactionCleanups;let s=!1,o=null;t._transaction===null&&(s=!0,t._transaction=new AA(t,n,r),i.push(t._transaction),i.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{o=e(t._transaction)}finally{if(s){const l=t._transaction===i[0];t._transaction=null,l&&TA(i,0)}}return o};class _H{constructor(e,n){this.insertions=n,this.deletions=e,this.meta=new Map}}const b_=(t,e,n)=>{oi(t,n.deletions,r=>{r instanceof ke&&e.scope.some(i=>i===t.doc||Cl(i,r))&&Qb(r,!1)})},y_=(t,e,n)=>{let r=null;const i=t.doc,s=t.scope;Se(i,l=>{for(;e.length>0&&t.currStackItem===null;){const a=i.store,u=e.pop(),c=new Set,d=[];let f=!1;oi(l,u.insertions,h=>{if(h instanceof ke){if(h.redone!==null){let{item:p,diff:g}=pm(a,h.id);g>0&&(p=Ht(l,ce(p.id.client,p.id.clock+g))),h=p}!h.deleted&&s.some(p=>p===l.doc||Cl(p,h))&&d.push(h)}}),oi(l,u.deletions,h=>{h instanceof ke&&s.some(p=>p===l.doc||Cl(p,h))&&!fo(u.insertions,h.id)&&c.add(h)}),c.forEach(h=>{f=tT(l,h,c,u.insertions,t.ignoreRemoteMapChanges,t)!==null||f});for(let h=d.length-1;h>=0;h--){const p=d[h];t.deleteFilter(p)&&(p.delete(l),f=!0)}t.currStackItem=f?u:null}l.changed.forEach((a,u)=>{a.has(null)&&u._searchMarker&&(u._searchMarker.length=0)}),r=l},t);const o=t.currStackItem;if(o!=null){const l=r.changedParentTypes;t.emit("stack-item-popped",[{stackItem:o,type:n,changedParentTypes:l,origin:t},t]),t.currStackItem=null}return o};class Kb extends O3{constructor(e,{captureTimeout:n=500,captureTransaction:r=a=>!0,deleteFilter:i=()=>!0,trackedOrigins:s=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:l=El(e)?e[0].doc:e instanceof ps?e:e.doc}={}){super(),this.scope=[],this.doc=l,this.addToScope(e),this.deleteFilter=i,s.add(this),this.trackedOrigins=s,this.captureTransaction=r,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=o,this.captureTimeout=n,this.afterTransactionHandler=a=>{if(!this.captureTransaction(a)||!this.scope.some(b=>a.changedParentTypes.has(b)||b===this.doc)||!this.trackedOrigins.has(a.origin)&&(!a.origin||!this.trackedOrigins.has(a.origin.constructor)))return;const u=this.undoing,c=this.redoing,d=u?this.redoStack:this.undoStack;u?this.stopCapturing():c||this.clear(!1,!0);const f=new Il;a.afterState.forEach((b,m)=>{const E=a.beforeState.get(m)||0,k=b-E;k>0&&Cu(f,m,E,k)});const h=vu();let p=!1;if(this.lastChange>0&&h-this.lastChange<this.captureTimeout&&d.length>0&&!u&&!c){const b=d[d.length-1];b.deletions=Hf([b.deletions,a.deleteSet]),b.insertions=Hf([b.insertions,f])}else d.push(new _H(a.deleteSet,f)),p=!0;!u&&!c&&(this.lastChange=h),oi(a,a.deleteSet,b=>{b instanceof ke&&this.scope.some(m=>m===a.doc||Cl(m,b))&&Qb(b,!0)});const g=[{stackItem:d[d.length-1],origin:a.origin,type:u?"redo":"undo",changedParentTypes:a.changedParentTypes},this];p?this.emit("stack-item-added",g):this.emit("stack-item-updated",g)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(e){const n=new Set(this.scope);e=El(e)?e:[e],e.forEach(r=>{n.has(r)||(n.add(r),(r instanceof lt?r.doc!==this.doc:r!==this.doc)&&dA("[yjs#509] Not same Y.Doc"),this.scope.push(r))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,n=!0){(e&&this.canUndo()||n&&this.canRedo())&&this.doc.transact(r=>{e&&(this.undoStack.forEach(i=>b_(r,this,i)),this.undoStack=[]),n&&(this.redoStack.forEach(i=>b_(r,this,i)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:n}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=y_(this,this.undoStack,"undo")}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=y_(this,this.redoStack,"redo")}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}function*vH(t){const e=le(t.restDecoder);for(let n=0;n<e;n++){const r=le(t.restDecoder),i=t.readClient();let s=le(t.restDecoder);for(let o=0;o<r;o++){const l=t.readInfo();if(l===10){const a=le(t.restDecoder);yield new kn(ce(i,s),a),s+=a}else if(Rh&l){const a=(l&(Zr|Wt))===0,u=new ke(ce(i,s),null,(l&Wt)===Wt?t.readLeftID():null,null,(l&Zr)===Zr?t.readRightID():null,a?t.readParentInfo()?t.readString():t.readLeftID():null,a&&(l&ku)===ku?t.readString():null,nT(t,l));yield u,s+=u.length}else{const a=t.readLen();yield new En(ce(i,s),a),s+=a}}}}class jb{constructor(e,n){this.gen=vH(e),this.curr=null,this.done=!1,this.filterSkips=n,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===kn);return this.curr}}class qb{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const NA=t=>Nu(t,Ub,Pl),xH=(t,e)=>{if(t.constructor===En){const{client:n,clock:r}=t.id;return new En(ce(n,r+e),t.length-e)}else if(t.constructor===kn){const{client:n,clock:r}=t.id;return new kn(ce(n,r+e),t.length-e)}else{const n=t,{client:r,clock:i}=n.id;return new ke(ce(r,i+e),null,ce(r,i+e-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(e))}},Nu=(t,e=ro,n=ns)=>{if(t.length===1)return t[0];const r=t.map(c=>new e(hs(c)));let i=r.map(c=>new jb(c,!0)),s=null;const o=new n,l=new qb(o);for(;i=i.filter(f=>f.curr!==null),i.sort((f,h)=>{if(f.curr.id.client===h.curr.id.client){const p=f.curr.id.clock-h.curr.id.clock;return p===0?f.curr.constructor===h.curr.constructor?0:f.curr.constructor===kn?1:-1:p}else return h.curr.id.client-f.curr.id.client}),i.length!==0;){const c=i[0],d=c.curr.id.client;if(s!==null){let f=c.curr,h=!1;for(;f!==null&&f.id.clock+f.length<=s.struct.id.clock+s.struct.length&&f.id.client>=s.struct.id.client;)f=c.next(),h=!0;if(f===null||f.id.client!==d||h&&f.id.clock>s.struct.id.clock+s.struct.length)continue;if(d!==s.struct.id.client)Ci(l,s.struct,s.offset),s={struct:f,offset:0},c.next();else if(s.struct.id.clock+s.struct.length<f.id.clock)if(s.struct.constructor===kn)s.struct.length=f.id.clock+f.length-s.struct.id.clock;else{Ci(l,s.struct,s.offset);const p=f.id.clock-s.struct.id.clock-s.struct.length;s={struct:new kn(ce(d,s.struct.id.clock+s.struct.length),p),offset:0}}else{const p=s.struct.id.clock+s.struct.length-f.id.clock;p>0&&(s.struct.constructor===kn?s.struct.length-=p:f=xH(f,p)),s.struct.mergeWith(f)||(Ci(l,s.struct,s.offset),s={struct:f,offset:0},c.next())}}else s={struct:c.curr,offset:0},c.next();for(let f=c.curr;f!==null&&f.id.client===d&&f.id.clock===s.struct.id.clock+s.struct.length&&f.constructor!==kn;f=c.next())Ci(l,s.struct,s.offset),s={struct:f,offset:0}}s!==null&&(Ci(l,s.struct,s.offset),s=null),Gb(l);const a=r.map(c=>$b(c)),u=Hf(a);return Ll(o,u),o.toUint8Array()},MA=(t,e,n=ro,r=ns)=>{const i=Vb(e),s=new r,o=new qb(s),l=new n(hs(t)),a=new jb(l,!1);for(;a.curr;){const c=a.curr,d=c.id.client,f=i.get(d)||0;if(a.curr.constructor===kn){a.next();continue}if(c.id.clock+c.length>f)for(Ci(o,c,si(f-c.id.clock,0)),a.next();a.curr&&a.curr.id.client===d;)Ci(o,a.curr,0),a.next();else for(;a.curr&&a.curr.id.client===d&&a.curr.id.clock+a.curr.length<=f;)a.next()}Gb(o);const u=$b(l);return Ll(s,u),s.toUint8Array()},OA=t=>{t.written>0&&(t.clientStructs.push({written:t.written,restEncoder:_n(t.encoder.restEncoder)}),t.encoder.restEncoder=co(),t.written=0)},Ci=(t,e,n)=>{t.written>0&&t.currClient!==e.id.client&&OA(t),t.written===0&&(t.currClient=e.id.client,t.encoder.writeClient(e.id.client),ue(t.encoder.restEncoder,e.id.clock+n)),e.write(t.encoder,n),t.written++},Gb=t=>{OA(t);const e=t.encoder.restEncoder;ue(e,t.clientStructs.length);for(let n=0;n<t.clientStructs.length;n++){const r=t.clientStructs[n];ue(e,r.written),Ih(e,r.restEncoder)}},SH=(t,e,n,r)=>{const i=new n(hs(t)),s=new jb(i,!1),o=new r,l=new qb(o);for(let u=s.curr;u!==null;u=s.next())Ci(l,e(u),0);Gb(l);const a=$b(i);return Ll(o,a),o.toUint8Array()},DA=t=>SH(t,Z$,ro,Pl),E_="You must not compute changes after the event-handler fired.";class Zu{constructor(e,n){this.target=e,this.currentTarget=e,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=CH(this.currentTarget,this.target))}deletes(e){return fo(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Mr(E_);const e=new Map,n=this.target;this.transaction.changed.get(n).forEach(i=>{if(i!==null){const s=n._map.get(i);let o,l;if(this.adds(s)){let a=s.left;for(;a!==null&&this.adds(a);)a=a.left;if(this.deletes(s))if(a!==null&&this.deletes(a))o="delete",l=d0(a.content.getContent());else return;else a!==null&&this.deletes(a)?(o="update",l=d0(a.content.getContent())):(o="add",l=void 0)}else if(this.deletes(s))o="delete",l=d0(s.content.getContent());else return;e.set(i,{action:o,oldValue:l})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw Mr(E_);const n=this.target,r=ts(),i=ts(),s=[];if(e={added:r,deleted:i,delta:s,keys:this.keys},this.transaction.changed.get(n).has(null)){let l=null;const a=()=>{l&&s.push(l)};for(let u=n._start;u!==null;u=u.right)u.deleted?this.deletes(u)&&!this.adds(u)&&((l===null||l.delete===void 0)&&(a(),l={delete:0}),l.delete+=u.length,i.add(u)):this.adds(u)?((l===null||l.insert===void 0)&&(a(),l={insert:[]}),l.insert=l.insert.concat(u.content.getContent()),r.add(u)):((l===null||l.retain===void 0)&&(a(),l={retain:0}),l.retain+=u.length);l!==null&&l.retain===void 0&&a()}this._changes=e}return e}}const CH=(t,e)=>{const n=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let r=0,i=e._item.parent._start;for(;i!==e._item&&i!==null;)!i.deleted&&i.countable&&(r+=i.length),i=i.right;n.unshift(r)}e=e._item.parent}return n},Rt=()=>{dA("Invalid access: Add Yjs type to a document before reading data.")},RA=80;let Yb=0;class AH{constructor(e,n){e.marker=!0,this.p=e,this.index=n,this.timestamp=Yb++}}const TH=t=>{t.timestamp=Yb++},IA=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=Yb++},NH=(t,e,n)=>{if(t.length>=RA){const r=t.reduce((i,s)=>i.timestamp<s.timestamp?i:s);return IA(r,e,n),r}else{const r=new AH(e,n);return t.push(r),r}},Hh=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;const n=t._searchMarker.length===0?null:t._searchMarker.reduce((s,o)=>ud(e-s.index)<ud(e-o.index)?s:o);let r=t._start,i=0;for(n!==null&&(r=n.p,i=n.index,TH(n));r.right!==null&&i<e;){if(!r.deleted&&r.countable){if(e<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>e;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&ud(n.index-i)<r.parent.length/RA?(IA(n,r,i),n):NH(t._searchMarker,r,i)},Mu=(t,e,n)=>{for(let r=t.length-1;r>=0;r--){const i=t[r];if(n>0){let s=i.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(i.index-=s.length);if(s===null||s.marker===!0){t.splice(r,1);continue}i.p=s,s.marker=!0}(e<i.index||n>0&&e===i.index)&&(i.index=si(e,i.index+n))}},Vh=(t,e,n)=>{const r=t,i=e.changedParentTypes;for(;Ir(i,t,()=>[]).push(n),t._item!==null;)t=t._item.parent;wA(r._eH,n,e)};class lt{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=f_(),this._dEH=f_(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,n){this.doc=e,this._item=n}_copy(){throw Vn()}clone(){throw Vn()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,n){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){h_(this._eH,e)}observeDeep(e){h_(this._dEH,e)}unobserve(e){p_(this._eH,e)}unobserveDeep(e){p_(this._dEH,e)}toJSON(){}}const LA=(t,e,n)=>{t.doc??Rt(),e<0&&(e=t._length+e),n<0&&(n=t._length+n);let r=n-e;const i=[];let s=t._start;for(;s!==null&&r>0;){if(s.countable&&!s.deleted){const o=s.content.getContent();if(o.length<=e)e-=o.length;else{for(let l=e;l<o.length&&r>0;l++)i.push(o[l]),r--;e=0}}s=s.right}return i},PA=t=>{t.doc??Rt();const e=[];let n=t._start;for(;n!==null;){if(n.countable&&!n.deleted){const r=n.content.getContent();for(let i=0;i<r.length;i++)e.push(r[i])}n=n.right}return e},Jb=(t,e)=>{const n=[];let r=t._start;for(;r!==null;){if(r.countable&&vs(r,e)){const i=r.content.getContent();for(let s=0;s<i.length;s++)n.push(i[s])}r=r.right}return n},Ou=(t,e)=>{let n=0,r=t._start;for(t.doc??Rt();r!==null;){if(r.countable&&!r.deleted){const i=r.content.getContent();for(let s=0;s<i.length;s++)e(i[s],n++,t)}r=r.right}},FA=(t,e)=>{const n=[];return Ou(t,(r,i)=>{n.push(e(r,i,t))}),n},MH=t=>{let e=t._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};n=e.content.getContent(),r=0,e=e.right}const i=n[r++];return n.length<=r&&(n=null),{done:!1,value:i}}}},BA=(t,e)=>{t.doc??Rt();const n=Hh(t,e);let r=t._start;for(n!==null&&(r=n.p,e-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(e<r.length)return r.content.getContent()[e];e-=r.length}},Vf=(t,e,n,r)=>{let i=n;const s=t.doc,o=s.clientID,l=s.store,a=n===null?e._start:n.right;let u=[];const c=()=>{u.length>0&&(i=new ke(ce(o,We(l,o)),i,i&&i.lastId,a,a&&a.id,e,null,new is(u)),i.integrate(t,0),u=[])};r.forEach(d=>{if(d===null)u.push(d);else switch(d.constructor){case Number:case Object:case Boolean:case Array:case String:u.push(d);break;default:switch(c(),d.constructor){case Uint8Array:case ArrayBuffer:i=new ke(ce(o,We(l,o)),i,i&&i.lastId,a,a&&a.id,e,null,new Bl(new Uint8Array(d))),i.integrate(t,0);break;case ps:i=new ke(ce(o,We(l,o)),i,i&&i.lastId,a,a&&a.id,e,null,new zl(d)),i.integrate(t,0);break;default:if(d instanceof lt)i=new ke(ce(o,We(l,o)),i,i&&i.lastId,a,a&&a.id,e,null,new Qn(d)),i.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),c()},zA=()=>Mr("Length exceeded!"),$A=(t,e,n,r)=>{if(n>e._length)throw zA();if(n===0)return e._searchMarker&&Mu(e._searchMarker,n,r.length),Vf(t,e,null,r);const i=n,s=Hh(e,n);let o=e._start;for(s!==null&&(o=s.p,n-=s.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&Ht(t,ce(o.id.client,o.id.clock+n));break}n-=o.length}return e._searchMarker&&Mu(e._searchMarker,i,r.length),Vf(t,e,o,r)},OH=(t,e,n)=>{let i=(e._searchMarker||[]).reduce((s,o)=>o.index>s.index?o:s,{index:0,p:e._start}).p;if(i)for(;i.right;)i=i.right;return Vf(t,e,i,n)},UA=(t,e,n,r)=>{if(r===0)return;const i=n,s=r,o=Hh(e,n);let l=e._start;for(o!==null&&(l=o.p,n-=o.index);l!==null&&n>0;l=l.right)!l.deleted&&l.countable&&(n<l.length&&Ht(t,ce(l.id.client,l.id.clock+n)),n-=l.length);for(;r>0&&l!==null;)l.deleted||(r<l.length&&Ht(t,ce(l.id.client,l.id.clock+r)),l.delete(t),r-=l.length),l=l.right;if(r>0)throw zA();e._searchMarker&&Mu(e._searchMarker,i,-s+r)},Wf=(t,e,n)=>{const r=e._map.get(n);r!==void 0&&r.delete(t)},Zb=(t,e,n,r)=>{const i=e._map.get(n)||null,s=t.doc,o=s.clientID;let l;if(r==null)l=new is([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:l=new is([r]);break;case Uint8Array:l=new Bl(r);break;case ps:l=new zl(r);break;default:if(r instanceof lt)l=new Qn(r);else throw new Error("Unexpected content type")}new ke(ce(o,We(s.store,o)),i,i&&i.lastId,null,null,e,n,l).integrate(t,0)},Xb=(t,e)=>{t.doc??Rt();const n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},HA=t=>{const e={};return t.doc??Rt(),t._map.forEach((n,r)=>{n.deleted||(e[r]=n.content.getContent()[n.length-1])}),e},VA=(t,e)=>{t.doc??Rt();const n=t._map.get(e);return n!==void 0&&!n.deleted},WA=(t,e)=>{const n={};return t._map.forEach((r,i)=>{let s=r;for(;s!==null&&(!e.sv.has(s.id.client)||s.id.clock>=(e.sv.get(s.id.client)||0));)s=s.left;s!==null&&vs(s,e)&&(n[i]=s.content.getContent()[s.length-1])}),n},Vc=t=>(t.doc??Rt(),tH(t._map.entries(),e=>!e[1].deleted));class KA extends Zu{}class Vs extends lt{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const n=new Vs;return n.push(e),n}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Vs}clone(){const e=new Vs;return e.insert(0,this.toArray().map(n=>n instanceof lt?n.clone():n)),e}get length(){return this.doc??Rt(),this._length}_callObserver(e,n){super._callObserver(e,n),Vh(this,e,new KA(this,e))}insert(e,n){this.doc!==null?Se(this.doc,r=>{$A(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}push(e){this.doc!==null?Se(this.doc,n=>{OH(n,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,n=1){this.doc!==null?Se(this.doc,r=>{UA(r,this,e,n)}):this._prelimContent.splice(e,n)}get(e){return BA(this,e)}toArray(){return PA(this)}slice(e=0,n=this.length){return LA(this,e,n)}toJSON(){return this.map(e=>e instanceof lt?e.toJSON():e)}map(e){return FA(this,e)}forEach(e){Ou(this,e)}[Symbol.iterator](){return MH(this)}_write(e){e.writeTypeRef(XH)}}const DH=t=>new Vs;class jA extends Zu{constructor(e,n,r){super(e,n),this.keysChanged=r}}class io extends lt{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,n){super._integrate(e,n),this._prelimContent.forEach((r,i)=>{this.set(i,r)}),this._prelimContent=null}_copy(){return new io}clone(){const e=new io;return this.forEach((n,r)=>{e.set(r,n instanceof lt?n.clone():n)}),e}_callObserver(e,n){Vh(this,e,new jA(this,e,n))}toJSON(){this.doc??Rt();const e={};return this._map.forEach((n,r)=>{if(!n.deleted){const i=n.content.getContent()[n.length-1];e[r]=i instanceof lt?i.toJSON():i}}),e}get size(){return[...Vc(this)].length}keys(){return y0(Vc(this),e=>e[0])}values(){return y0(Vc(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return y0(Vc(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??Rt(),this._map.forEach((n,r)=>{n.deleted||e(n.content.getContent()[n.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?Se(this.doc,n=>{Wf(n,this,e)}):this._prelimContent.delete(e)}set(e,n){return this.doc!==null?Se(this.doc,r=>{Zb(r,this,e,n)}):this._prelimContent.set(e,n),n}get(e){return Xb(this,e)}has(e){return VA(this,e)}clear(){this.doc!==null?Se(this.doc,e=>{this.forEach(function(n,r,i){Wf(e,i,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(QH)}}const RH=t=>new io,Li=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&Y$(t,e);class hm{constructor(e,n,r,i){this.left=e,this.right=n,this.index=r,this.currentAttributes=i}forward(){switch(this.right===null&&Ft(),this.right.content.constructor){case Ye:this.right.deleted||Fl(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const k_=(t,e,n)=>{for(;e.right!==null&&n>0;){switch(e.right.content.constructor){case Ye:e.right.deleted||Fl(e.currentAttributes,e.right.content);break;default:e.right.deleted||(n<e.right.length&&Ht(t,ce(e.right.id.client,e.right.id.clock+n)),e.index+=e.right.length,n-=e.right.length);break}e.left=e.right,e.right=e.right.right}return e},Wc=(t,e,n,r)=>{const i=new Map,s=r?Hh(e,n):null;if(s){const o=new hm(s.p.left,s.p,s.index,i);return k_(t,o,n-s.index)}else{const o=new hm(null,e._start,0,i);return k_(t,o,n)}},qA=(t,e,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===Ye&&Li(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const i=t.doc,s=i.clientID;r.forEach((o,l)=>{const a=n.left,u=n.right,c=new ke(ce(s,We(i.store,s)),a,a&&a.lastId,u,u&&u.id,e,null,new Ye(l,o));c.integrate(t,0),n.right=c,n.forward()})},Fl=(t,e)=>{const{key:n,value:r}=e;r===null?t.delete(n):t.set(n,r)},GA=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===Ye&&Li(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},YA=(t,e,n,r)=>{const i=t.doc,s=i.clientID,o=new Map;for(const l in r){const a=r[l],u=n.currentAttributes.get(l)??null;if(!Li(u,a)){o.set(l,u);const{left:c,right:d}=n;n.right=new ke(ce(s,We(i.store,s)),c,c&&c.lastId,d,d&&d.id,e,null,new Ye(l,a)),n.right.integrate(t,0),n.forward()}}return o},E0=(t,e,n,r,i)=>{n.currentAttributes.forEach((f,h)=>{i[h]===void 0&&(i[h]=null)});const s=t.doc,o=s.clientID;GA(n,i);const l=YA(t,e,n,i),a=r.constructor===String?new Xn(r):r instanceof lt?new Qn(r):new gs(r);let{left:u,right:c,index:d}=n;e._searchMarker&&Mu(e._searchMarker,n.index,a.getLength()),c=new ke(ce(o,We(s.store,o)),u,u&&u.lastId,c,c&&c.id,e,null,a),c.integrate(t,0),n.right=c,n.index=d,n.forward(),qA(t,e,n,l)},w_=(t,e,n,r,i)=>{const s=t.doc,o=s.clientID;GA(n,i);const l=YA(t,e,n,i);e:for(;n.right!==null&&(r>0||l.size>0&&(n.right.deleted||n.right.content.constructor===Ye));){if(!n.right.deleted)switch(n.right.content.constructor){case Ye:{const{key:a,value:u}=n.right.content,c=i[a];if(c!==void 0){if(Li(c,u))l.delete(a);else{if(r===0)break e;l.set(a,u)}n.right.delete(t)}else n.currentAttributes.set(a,u);break}default:r<n.right.length&&Ht(t,ce(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let a="";for(;r>0;r--)a+=`
|
|
168
|
+
`;n.right=new ke(ce(o,We(s.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new Xn(a)),n.right.integrate(t,0),n.forward()}qA(t,e,n,l)},JA=(t,e,n,r,i)=>{let s=e;const o=cn();for(;s&&(!s.countable||s.deleted);){if(!s.deleted&&s.content.constructor===Ye){const u=s.content;o.set(u.key,u)}s=s.right}let l=0,a=!1;for(;e!==s;){if(n===e&&(a=!0),!e.deleted){const u=e.content;switch(u.constructor){case Ye:{const{key:c,value:d}=u,f=r.get(c)??null;(o.get(c)!==u||f===d)&&(e.delete(t),l++,!a&&(i.get(c)??null)===d&&f!==d&&(f===null?i.delete(c):i.set(c,f))),!a&&!e.deleted&&Fl(i,u);break}}}e=e.right}return l},IH=(t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const n=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===Ye){const r=e.content.key;n.has(r)?e.delete(t):n.add(r)}e=e.left}},ZA=t=>{let e=0;return Se(t.doc,n=>{let r=t._start,i=t._start,s=cn();const o=im(s);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case Ye:Fl(o,i.content);break;default:e+=JA(n,r,i,s,o),s=im(o),r=i;break}i=i.right}}),e},LH=t=>{const e=new Set,n=t.doc;for(const[r,i]of t.afterState.entries()){const s=t.beforeState.get(r)||0;i!==s&&CA(t,n.store.clients.get(r),s,i,o=>{!o.deleted&&o.content.constructor===Ye&&o.constructor!==En&&e.add(o.parent)})}Se(n,r=>{oi(t,t.deleteSet,i=>{if(i instanceof En||!i.parent._hasFormatting||e.has(i.parent))return;const s=i.parent;i.content.constructor===Ye?e.add(s):IH(r,i)});for(const i of e)ZA(i)})},__=(t,e,n)=>{const r=n,i=im(e.currentAttributes),s=e.right;for(;n>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case Qn:case gs:case Xn:n<e.right.length&&Ht(t,ce(e.right.id.client,e.right.id.clock+n)),n-=e.right.length,e.right.delete(t);break}e.forward()}s&&JA(t,s,e.right,i,e.currentAttributes);const o=(e.left||e.right).parent;return o._searchMarker&&Mu(o._searchMarker,e.index,-r+n),e};class XA extends Zu{constructor(e,n,r){super(e,n),this.childListChanged=!1,this.keysChanged=new Set,r.forEach(i=>{i===null?this.childListChanged=!0:this.keysChanged.add(i)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,n=[];Se(e,r=>{const i=new Map,s=new Map;let o=this.target._start,l=null;const a={};let u="",c=0,d=0;const f=()=>{if(l!==null){let h=null;switch(l){case"delete":d>0&&(h={delete:d}),d=0;break;case"insert":(typeof u=="object"||u.length>0)&&(h={insert:u},i.size>0&&(h.attributes={},i.forEach((p,g)=>{p!==null&&(h.attributes[g]=p)}))),u="";break;case"retain":c>0&&(h={retain:c},G$(a)||(h.attributes=j$({},a))),c=0;break}h&&n.push(h),l=null}};for(;o!==null;){switch(o.content.constructor){case Qn:case gs:this.adds(o)?this.deletes(o)||(f(),l="insert",u=o.content.getContent()[0],f()):this.deletes(o)?(l!=="delete"&&(f(),l="delete"),d+=1):o.deleted||(l!=="retain"&&(f(),l="retain"),c+=1);break;case Xn:this.adds(o)?this.deletes(o)||(l!=="insert"&&(f(),l="insert"),u+=o.content.str):this.deletes(o)?(l!=="delete"&&(f(),l="delete"),d+=o.length):o.deleted||(l!=="retain"&&(f(),l="retain"),c+=o.length);break;case Ye:{const{key:h,value:p}=o.content;if(this.adds(o)){if(!this.deletes(o)){const g=i.get(h)??null;Li(g,p)?p!==null&&o.delete(r):(l==="retain"&&f(),Li(p,s.get(h)??null)?delete a[h]:a[h]=p)}}else if(this.deletes(o)){s.set(h,p);const g=i.get(h)??null;Li(g,p)||(l==="retain"&&f(),a[h]=g)}else if(!o.deleted){s.set(h,p);const g=a[h];g!==void 0&&(Li(g,p)?g!==null&&o.delete(r):(l==="retain"&&f(),p===null?delete a[h]:a[h]=p))}o.deleted||(l==="insert"&&f(),Fl(i,o.content));break}}o=o.right}for(f();n.length>0;){const h=n[n.length-1];if(h.retain!==void 0&&h.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class li extends lt{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Rt(),this._length}_integrate(e,n){super._integrate(e,n);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new li}clone(){const e=new li;return e.applyDelta(this.toDelta()),e}_callObserver(e,n){super._callObserver(e,n);const r=new XA(this,e,n);Vh(this,e,r),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??Rt();let e="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===Xn&&(e+=n.content.str),n=n.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:n=!0}={}){this.doc!==null?Se(this.doc,r=>{const i=new hm(null,this._start,0,new Map);for(let s=0;s<e.length;s++){const o=e[s];if(o.insert!==void 0){const l=!n&&typeof o.insert=="string"&&s===e.length-1&&i.right===null&&o.insert.slice(-1)===`
|
|
169
|
+
`?o.insert.slice(0,-1):o.insert;(typeof l!="string"||l.length>0)&&E0(r,this,i,l,o.attributes||{})}else o.retain!==void 0?w_(r,this,i,o.retain,o.attributes||{}):o.delete!==void 0&&__(r,i,o.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,n,r){this.doc??Rt();const i=[],s=new Map,o=this.doc;let l="",a=this._start;function u(){if(l.length>0){const d={};let f=!1;s.forEach((p,g)=>{f=!0,d[g]=p});const h={insert:l};f&&(h.attributes=d),i.push(h),l=""}}const c=()=>{for(;a!==null;){if(vs(a,e)||n!==void 0&&vs(a,n))switch(a.content.constructor){case Xn:{const d=s.get("ychange");e!==void 0&&!vs(a,e)?(d===void 0||d.user!==a.id.client||d.type!=="removed")&&(u(),s.set("ychange",r?r("removed",a.id):{type:"removed"})):n!==void 0&&!vs(a,n)?(d===void 0||d.user!==a.id.client||d.type!=="added")&&(u(),s.set("ychange",r?r("added",a.id):{type:"added"})):d!==void 0&&(u(),s.delete("ychange")),l+=a.content.str;break}case Qn:case gs:{u();const d={insert:a.content.getContent()[0]};if(s.size>0){const f={};d.attributes=f,s.forEach((h,p)=>{f[p]=h})}i.push(d);break}case Ye:vs(a,e)&&(u(),Fl(s,a.content));break}a=a.right}u()};return e||n?Se(o,d=>{e&&cm(d,e),n&&cm(d,n),c()},"cleanup"):c(),i}insert(e,n,r){if(n.length<=0)return;const i=this.doc;i!==null?Se(i,s=>{const o=Wc(s,this,e,!r);r||(r={},o.currentAttributes.forEach((l,a)=>{r[a]=l})),E0(s,this,o,n,r)}):this._pending.push(()=>this.insert(e,n,r))}insertEmbed(e,n,r){const i=this.doc;i!==null?Se(i,s=>{const o=Wc(s,this,e,!r);E0(s,this,o,n,r||{})}):this._pending.push(()=>this.insertEmbed(e,n,r||{}))}delete(e,n){if(n===0)return;const r=this.doc;r!==null?Se(r,i=>{__(i,Wc(i,this,e,!0),n)}):this._pending.push(()=>this.delete(e,n))}format(e,n,r){if(n===0)return;const i=this.doc;i!==null?Se(i,s=>{const o=Wc(s,this,e,!1);o.right!==null&&w_(s,this,o,n,r)}):this._pending.push(()=>this.format(e,n,r))}removeAttribute(e){this.doc!==null?Se(this.doc,n=>{Wf(n,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,n){this.doc!==null?Se(this.doc,r=>{Zb(r,this,e,n)}):this._pending.push(()=>this.setAttribute(e,n))}getAttribute(e){return Xb(this,e)}getAttributes(){return HA(this)}_write(e){e.writeTypeRef(eV)}}const PH=t=>new li;class k0{constructor(e,n=()=>!0){this._filter=n,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??Rt()}[Symbol.iterator](){return this}next(){let e=this._currentNode,n=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(n)))do if(n=e.content.type,!e.deleted&&(n.constructor===St||n.constructor===rs)&&n._start!==null)e=n._start;else for(;e!==null;){const r=e.next;if(r!==null){e=r;break}else e.parent===this._root?e=null:e=e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class rs extends lt{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new rs}clone(){const e=new rs;return e.insert(0,this.toArray().map(n=>n instanceof lt?n.clone():n)),e}get length(){return this.doc??Rt(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new k0(this,e)}querySelector(e){e=e.toUpperCase();const r=new k0(this,i=>i.nodeName&&i.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),ii(new k0(this,n=>n.nodeName&&n.nodeName.toUpperCase()===e))}_callObserver(e,n){Vh(this,e,new QA(this,n,e))}toString(){return FA(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,n={},r){const i=e.createDocumentFragment();return r!==void 0&&r._createAssociation(i,this),Ou(this,s=>{i.insertBefore(s.toDOM(e,n,r),null)}),i}insert(e,n){this.doc!==null?Se(this.doc,r=>{$A(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}insertAfter(e,n){if(this.doc!==null)Se(this.doc,r=>{const i=e&&e instanceof lt?e._item:e;Vf(r,this,i,n)});else{const r=this._prelimContent,i=e===null?0:r.findIndex(s=>s===e)+1;if(i===0&&e!==null)throw Mr("Reference item not found");r.splice(i,0,...n)}}delete(e,n=1){this.doc!==null?Se(this.doc,r=>{UA(r,this,e,n)}):this._prelimContent.splice(e,n)}toArray(){return PA(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return BA(this,e)}slice(e=0,n=this.length){return LA(this,e,n)}forEach(e){Ou(this,e)}_write(e){e.writeTypeRef(nV)}}const FH=t=>new rs;class St extends rs{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,n){super._integrate(e,n),this._prelimAttrs.forEach((r,i)=>{this.setAttribute(i,r)}),this._prelimAttrs=null}_copy(){return new St(this.nodeName)}clone(){const e=new St(this.nodeName),n=this.getAttributes();return q$(n,(r,i)=>{e.setAttribute(i,r)}),e.insert(0,this.toArray().map(r=>r instanceof lt?r.clone():r)),e}toString(){const e=this.getAttributes(),n=[],r=[];for(const l in e)r.push(l);r.sort();const i=r.length;for(let l=0;l<i;l++){const a=r[l];n.push(a+'="'+e[a]+'"')}const s=this.nodeName.toLocaleLowerCase(),o=n.length>0?" "+n.join(" "):"";return`<${s}${o}>${super.toString()}</${s}>`}removeAttribute(e){this.doc!==null?Se(this.doc,n=>{Wf(n,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,n){this.doc!==null?Se(this.doc,r=>{Zb(r,this,e,n)}):this._prelimAttrs.set(e,n)}getAttribute(e){return Xb(this,e)}hasAttribute(e){return VA(this,e)}getAttributes(e){return e?WA(this,e):HA(this)}toDOM(e=document,n={},r){const i=e.createElement(this.nodeName),s=this.getAttributes();for(const o in s){const l=s[o];typeof l=="string"&&i.setAttribute(o,l)}return Ou(this,o=>{i.appendChild(o.toDOM(e,n,r))}),r!==void 0&&r._createAssociation(i,this),i}_write(e){e.writeTypeRef(tV),e.writeKey(this.nodeName)}}const BH=t=>new St(t.readKey());class QA extends Zu{constructor(e,n,r){super(e,r),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(i=>{i===null?this.childListChanged=!0:this.attributesChanged.add(i)})}}class Du extends io{constructor(e){super(),this.hookName=e}_copy(){return new Du(this.hookName)}clone(){const e=new Du(this.hookName);return this.forEach((n,r)=>{e.set(r,n)}),e}toDOM(e=document,n={},r){const i=n[this.hookName];let s;return i!==void 0?s=i.createDom(this):s=document.createElement(this.hookName),s.setAttribute("data-yjs-hook",this.hookName),r!==void 0&&r._createAssociation(s,this),s}_write(e){e.writeTypeRef(rV),e.writeKey(this.hookName)}}const zH=t=>new Du(t.readKey());class Kt extends li{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new Kt}clone(){const e=new Kt;return e.applyDelta(this.toDelta()),e}toDOM(e=document,n,r){const i=e.createTextNode(this.toString());return r!==void 0&&r._createAssociation(i,this),i}toString(){return this.toDelta().map(e=>{const n=[];for(const i in e.attributes){const s=[];for(const o in e.attributes[i])s.push({key:o,value:e.attributes[i][o]});s.sort((o,l)=>o.key<l.key?-1:1),n.push({nodeName:i,attrs:s})}n.sort((i,s)=>i.nodeName<s.nodeName?-1:1);let r="";for(let i=0;i<n.length;i++){const s=n[i];r+=`<${s.nodeName}`;for(let o=0;o<s.attrs.length;o++){const l=s.attrs[o];r+=` ${l.key}="${l.value}"`}r+=">"}r+=e.insert;for(let i=n.length-1;i>=0;i--)r+=`</${n[i].nodeName}>`;return r}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(iV)}}const $H=t=>new Kt;class Wh{constructor(e,n){this.id=e,this.length=n}get deleted(){throw Vn()}mergeWith(e){return!1}write(e,n,r){throw Vn()}integrate(e,n){throw Vn()}}const UH=0;class En extends Wh{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){n>0&&(this.id.clock+=n,this.length-=n),SA(e.doc.store,this)}write(e,n){e.writeInfo(UH),e.writeLen(this.length-n)}getMissing(e,n){return null}}class Bl{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Bl(this.content)}splice(e){throw Vn()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeBuf(this.content)}getRef(){return 3}}const HH=t=>new Bl(t.readBuf());class Al{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Al(this.len)}splice(e){const n=new Al(this.len-e);return this.len=e,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,n){Cu(e.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(e){}gc(e){}write(e,n){e.writeLen(this.len-n)}getRef(){return 1}}const VH=t=>new Al(t.readLen()),eT=(t,e)=>new ps({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class zl{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const n={};this.opts=n,e.gc||(n.gc=!1),e.autoLoad&&(n.autoLoad=!0),e.meta!==null&&(n.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new zl(eT(this.doc.guid,this.opts))}splice(e){throw Vn()}mergeWith(e){return!1}integrate(e,n){this.doc._item=n,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,n){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}const WH=t=>new zl(eT(t.readString(),t.readAny()));class gs{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new gs(this.embed)}splice(e){throw Vn()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeJSON(this.embed)}getRef(){return 5}}const KH=t=>new gs(t.readJSON());class Ye{constructor(e,n){this.key=e,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Ye(this.key,this.value)}splice(e){throw Vn()}mergeWith(e){return!1}integrate(e,n){const r=n.parent;r._searchMarker=null,r._hasFormatting=!0}delete(e){}gc(e){}write(e,n){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}const jH=t=>new Ye(t.readKey(),t.readJSON());class Ru{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Ru(this.arr)}splice(e){const n=new Ru(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const r=this.arr.length;e.writeLen(r-n);for(let i=n;i<r;i++){const s=this.arr[i];e.writeString(s===void 0?"undefined":JSON.stringify(s))}}getRef(){return 2}}const qH=t=>{const e=t.readLen(),n=[];for(let r=0;r<e;r++){const i=t.readString();i==="undefined"?n.push(void 0):n.push(JSON.parse(i))}return new Ru(n)},GH=zf("node_env")==="development";class is{constructor(e){this.arr=e,GH&&$3(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new is(this.arr)}splice(e){const n=new is(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const r=this.arr.length;e.writeLen(r-n);for(let i=n;i<r;i++){const s=this.arr[i];e.writeAny(s)}}getRef(){return 8}}const YH=t=>{const e=t.readLen(),n=[];for(let r=0;r<e;r++)n.push(t.readAny());return new is(n)};class Xn{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new Xn(this.str)}splice(e){const n=new Xn(this.str.slice(e));this.str=this.str.slice(0,e);const r=this.str.charCodeAt(e-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,e-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const JH=t=>new Xn(t.readString()),ZH=[DH,RH,PH,BH,FH,zH,$H],XH=0,QH=1,eV=2,tV=3,nV=4,rV=5,iV=6;class Qn{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Qn(this.type._copy())}splice(e){throw Vn()}mergeWith(e){return!1}integrate(e,n){this.type._integrate(e.doc,n)}delete(e){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e),n=n.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e)}),e.changed.delete(this.type)}gc(e){let n=this.type._start;for(;n!==null;)n.gc(e,!0),n=n.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(e,!0),r=r.left}),this.type._map=new Map}write(e,n){this.type._write(e)}getRef(){return 7}}const sV=t=>new Qn(ZH[t.readTypeRef()](t)),pm=(t,e)=>{let n=e,r=0,i;do r>0&&(n=ce(n.client,n.clock+r)),i=Hs(t,n),r=n.clock-i.id.clock,n=i.redone;while(n!==null&&i instanceof ke);return{item:i,diff:r}},Qb=(t,e)=>{for(;t!==null&&t.keep!==e;)t.keep=e,t=t.parent._item},Kf=(t,e,n)=>{const{client:r,clock:i}=e.id,s=new ke(ce(r,i+n),e,ce(r,i+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));return e.deleted&&s.markDeleted(),e.keep&&(s.keep=!0),e.redone!==null&&(s.redone=ce(e.redone.client,e.redone.clock+n)),e.right=s,s.right!==null&&(s.right.left=s),t._mergeStructs.push(s),s.parentSub!==null&&s.right===null&&s.parent._map.set(s.parentSub,s),e.length=n,s},v_=(t,e)=>vb(t,n=>fo(n.deletions,e)),tT=(t,e,n,r,i,s)=>{const o=t.doc,l=o.store,a=o.clientID,u=e.redone;if(u!==null)return Ht(t,u);let c=e.parent._item,d=null,f;if(c!==null&&c.deleted===!0){if(c.redone===null&&(!n.has(c)||tT(t,c,n,r,i,s)===null))return null;for(;c.redone!==null;)c=Ht(t,c.redone)}const h=c===null?e.parent:c.content.type;if(e.parentSub===null){for(d=e.left,f=e;d!==null;){let m=d;for(;m!==null&&m.parent._item!==c;)m=m.redone===null?null:Ht(t,m.redone);if(m!==null&&m.parent._item===c){d=m;break}d=d.left}for(;f!==null;){let m=f;for(;m!==null&&m.parent._item!==c;)m=m.redone===null?null:Ht(t,m.redone);if(m!==null&&m.parent._item===c){f=m;break}f=f.right}}else if(f=null,e.right&&!i){for(d=e;d!==null&&d.right!==null&&(d.right.redone||fo(r,d.right.id)||v_(s.undoStack,d.right.id)||v_(s.redoStack,d.right.id));)for(d=d.right;d.redone;)d=Ht(t,d.redone);if(d&&d.right!==null)return null}else d=h._map.get(e.parentSub)||null;const p=We(l,a),g=ce(a,p),b=new ke(g,d,d&&d.lastId,f,f&&f.id,h,e.parentSub,e.content.copy());return e.redone=g,Qb(b,!0),b.integrate(t,0),b};class ke extends Wh{constructor(e,n,r,i,s,o,l,a){super(e,a.getLength()),this.origin=r,this.left=n,this.right=i,this.rightOrigin=s,this.parent=o,this.parentSub=l,this.redone=null,this.content=a,this.info=this.content.isCountable()?Qw:0}set marker(e){(this.info&h0)>0!==e&&(this.info^=h0)}get marker(){return(this.info&h0)>0}get keep(){return(this.info&Xw)>0}set keep(e){this.keep!==e&&(this.info^=Xw)}get countable(){return(this.info&Qw)>0}get deleted(){return(this.info&f0)>0}set deleted(e){this.deleted!==e&&(this.info^=f0)}markDeleted(){this.info|=f0}getMissing(e,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=We(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=We(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Us&&this.id.client!==this.parent.client&&this.parent.clock>=We(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=fm(e,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=Ht(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===En||this.right&&this.right.constructor===En)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===ke?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===ke&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===Us){const r=Hs(n,this.parent);r.constructor===En?this.parent=null:this.parent=r.content.type}return null}integrate(e,n){if(n>0&&(this.id.clock+=n,this.left=fm(e,e.doc.store,ce(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,i;if(r!==null)i=r.right;else if(this.parentSub!==null)for(i=this.parent._map.get(this.parentSub)||null;i!==null&&i.left!==null;)i=i.left;else i=this.parent._start;const s=new Set,o=new Set;for(;i!==null&&i!==this.right;){if(o.add(i),s.add(i),aa(this.origin,i.origin)){if(i.id.client<this.id.client)r=i,s.clear();else if(aa(this.rightOrigin,i.rightOrigin))break}else if(i.origin!==null&&o.has(Hs(e.doc.store,i.origin)))s.has(Hs(e.doc.store,i.origin))||(r=i,s.clear());else break;i=i.right}this.left=r}if(this.left!==null){const r=this.left.right;this.right=r,this.left.right=this}else{let r;if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start,this.parent._start=this;this.right=r}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),SA(e.doc.store,this),this.content.integrate(e,this),m_(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new En(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:ce(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&aa(e.origin,this.lastId)&&this.right===e&&aa(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const n=this.parent._searchMarker;return n&&n.forEach(r=>{r.p===e&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),Cu(e.deleteSet,this.id.client,this.id.clock,this.length),m_(e,n,this.parentSub),this.content.delete(e)}}gc(e,n){if(!this.deleted)throw Ft();this.content.gc(e),n?EH(e,this,new En(this.id,this.length)):this.content=new Al(this.length)}write(e,n){const r=n>0?ce(this.id.client,this.id.clock+n-1):this.origin,i=this.rightOrigin,s=this.parentSub,o=this.content.getRef()&Rh|(r===null?0:Wt)|(i===null?0:Zr)|(s===null?0:ku);if(e.writeInfo(o),r!==null&&e.writeLeftID(r),i!==null&&e.writeRightID(i),r===null&&i===null){const l=this.parent;if(l._item!==void 0){const a=l._item;if(a===null){const u=Sl(l);e.writeParentInfo(!0),e.writeString(u)}else e.writeParentInfo(!1),e.writeLeftID(a.id)}else l.constructor===String?(e.writeParentInfo(!0),e.writeString(l)):l.constructor===Us?(e.writeParentInfo(!1),e.writeLeftID(l)):Ft();s!==null&&e.writeString(s)}this.content.write(e,n)}}const nT=(t,e)=>oV[e&Rh](t),oV=[()=>{Ft()},VH,qH,HH,JH,KH,jH,sV,YH,WH,()=>{Ft()}],lV=10;class kn extends Wh{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){Ft()}write(e,n){e.writeInfo(lV),ue(e.restEncoder,this.length-n)}getMissing(e,n){return null}}const rT=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},iT="__ $YJS$ __";rT[iT]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");rT[iT]=!0;const DW=Object.freeze(Object.defineProperty({__proto__:null,AbsolutePosition:_A,AbstractStruct:Wh,AbstractType:lt,Array:Vs,ContentAny:is,ContentBinary:Bl,ContentDeleted:Al,ContentDoc:zl,ContentEmbed:gs,ContentFormat:Ye,ContentJSON:Ru,ContentString:Xn,ContentType:Qn,Doc:ps,GC:En,ID:Us,Item:ke,Map:io,RelativePosition:Tu,Skip:kn,Snapshot:Uh,Text:li,Transaction:AA,UndoManager:Kb,UpdateDecoderV1:Ub,UpdateDecoderV2:ro,UpdateEncoderV1:Pl,UpdateEncoderV2:ns,XmlElement:St,XmlFragment:rs,XmlHook:Du,XmlText:Kt,YArrayEvent:KA,YEvent:Zu,YMapEvent:jA,YTextEvent:XA,YXmlEvent:QA,applyUpdate:aH,applyUpdateV2:Au,cleanupYTextFormatting:ZA,compareIDs:aa,convertUpdateFormatV2ToV1:DA,createAbsolutePositionFromRelativePosition:vA,createDeleteSet:Bb,createDeleteSetFromStructStore:zb,createID:ce,createRelativePositionFromTypeIndex:fd,createSnapshot:Wb,decodeStateVector:Vb,diffUpdateV2:MA,encodeStateAsUpdate:cH,encodeStateAsUpdateV2:EA,encodeStateVector:pH,findIndexSS:Zn,findRootTypeKey:Sl,getItem:Hs,getItemCleanEnd:fm,getItemCleanStart:Ht,getState:We,isDeleted:fo,isParentOf:Cl,iterateDeletedStructs:oi,mergeDeleteSets:Hf,mergeUpdates:NA,mergeUpdatesV2:Nu,readUpdateV2:yA,snapshot:hd,transact:Se,typeListToArraySnapshot:Jb,typeMapGetAllSnapshot:WA},Symbol.toStringTag,{value:"Module"})),gd=3e4;class aV extends s${constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const n=vu();this.getLocalState()!==null&&gd/2<=n-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const r=[];this.meta.forEach((i,s)=>{s!==this.clientID&&gd<=n-i.lastUpdated&&this.states.has(s)&&r.push(s)}),r.length>0&&sT(this,r,"timeout")},Jn(gd/10)),e.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){const n=this.clientID,r=this.meta.get(n),i=r===void 0?0:r.clock+1,s=this.states.get(n);e===null?this.states.delete(n):this.states.set(n,e),this.meta.set(n,{clock:i,lastUpdated:vu()});const o=[],l=[],a=[],u=[];e===null?u.push(n):s==null?e!=null&&o.push(n):(l.push(n),Zo(s,e)||a.push(n)),(o.length>0||a.length>0||u.length>0)&&this.emit("change",[{added:o,updated:a,removed:u},"local"]),this.emit("update",[{added:o,updated:l,removed:u},"local"])}setLocalStateField(e,n){const r=this.getLocalState();r!==null&&this.setLocalState({...r,[e]:n})}getStates(){return this.states}}const sT=(t,e,n)=>{const r=[];for(let i=0;i<e.length;i++){const s=e[i];if(t.states.has(s)){if(t.states.delete(s),s===t.clientID){const o=t.meta.get(s);t.meta.set(s,{clock:o.clock+1,lastUpdated:vu()})}r.push(s)}}r.length>0&&(t.emit("change",[{added:[],updated:[],removed:r},n]),t.emit("update",[{added:[],updated:[],removed:r},n]))},uV=(t,e,n=t.states)=>{const r=e.length,i=co();ue(i,r);for(let s=0;s<r;s++){const o=e[s],l=n.get(o)||null,a=t.meta.get(o).clock;ue(i,o),ue(i,a),Gi(i,JSON.stringify(l))}return _n(i)},cV=(t,e)=>{const n=hs(t),r=co(),i=le(n);ue(r,i);for(let s=0;s<i;s++){const o=le(n),l=le(n),a=JSON.parse(Yi(n)),u=e(a);ue(r,o),ue(r,l),Gi(r,JSON.stringify(u))}return _n(r)},dV=(t,e,n)=>{const r=hs(e),i=vu(),s=[],o=[],l=[],a=[],u=le(r);for(let c=0;c<u;c++){const d=le(r);let f=le(r);const h=JSON.parse(Yi(r)),p=t.meta.get(d),g=t.states.get(d),b=p===void 0?0:p.clock;(b<f||b===f&&h===null&&t.states.has(d))&&(h===null?d===t.clientID&&t.getLocalState()!=null?f++:t.states.delete(d):t.states.set(d,h),t.meta.set(d,{clock:f,lastUpdated:i}),p===void 0&&h!==null?s.push(d):p!==void 0&&h===null?a.push(d):h!==null&&(Zo(h,g)||l.push(d),o.push(d)))}(s.length>0||l.length>0||a.length>0)&&t.emit("change",[{added:s,updated:l,removed:a},n]),(s.length>0||o.length>0||a.length>0)&&t.emit("update",[{added:s,updated:o,removed:a},n])},RW=Object.freeze(Object.defineProperty({__proto__:null,Awareness:aV,applyAwarenessUpdate:dV,encodeAwarenessUpdate:uV,modifyAwarenessUpdate:cV,outdatedTimeout:gd,removeAwarenessStates:sT},Symbol.toStringTag,{value:"Module"})),fV=()=>{let t=!0;return(e,n)=>{if(t){t=!1;try{e()}finally{t=!0}}else n!==void 0&&n()}},hV=/[\uD800-\uDBFF]/,pV=/[\uDC00-\uDFFF]/,gV=(t,e)=>{let n=0,r=0;for(;n<t.length&&n<e.length&&t[n]===e[n];)n++;for(n>0&&hV.test(t[n-1])&&n--;r+n<t.length&&r+n<e.length&&t[t.length-r-1]===e[e.length-r-1];)r++;return r>0&&pV.test(t[t.length-r])&&r--,{index:n,remove:t.length-n-r,insert:e.slice(n,e.length-r)}},mV=gV,it=new Le("y-sync"),Xr=new Le("y-undo");new Le("yjs-cursor");const Cr=(t,e)=>t>>>e|t<<32-e,bV=t=>Cr(t,2)^Cr(t,13)^Cr(t,22),yV=t=>Cr(t,6)^Cr(t,11)^Cr(t,25),EV=t=>Cr(t,7)^Cr(t,18)^t>>>3,kV=t=>Cr(t,17)^Cr(t,19)^t>>>10,wV=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),_V=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);class vV{constructor(){const e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(_V),this._W=new Uint32Array(e,64,64)}_updateHash(){const e=this._H,n=this._W;for(let d=16;d<64;d++)n[d]=kV(n[d-2])+n[d-7]+EV(n[d-15])+n[d-16];let r=e[0],i=e[1],s=e[2],o=e[3],l=e[4],a=e[5],u=e[6],c=e[7];for(let d=0,f,h;d<64;d++)f=c+yV(l)+(l&a^~l&u)+wV[d]+n[d]>>>0,h=bV(r)+(r&i^r&s^i&s)>>>0,c=u,u=a,a=l,l=o+f>>>0,o=s,s=i,i=r,r=f+h>>>0;e[0]+=r,e[1]+=i,e[2]+=s,e[3]+=o,e[4]+=l,e[5]+=a,e[6]+=u,e[7]+=c}digest(e){let n=0;for(;n+56<=e.length;){let o=0;for(;o<16&&n+3<e.length;o++)this._W[o]=e[n++]<<24|e[n++]<<16|e[n++]<<8|e[n++];if(n%64!==0){for(this._W.fill(0,o,16);n<e.length;)this._W[o]|=e[n]<<(3-n%4)*8,n++;this._W[o]|=Wt<<(3-n%4)*8}this._updateHash()}const r=n%64!==0;this._W.fill(0,0,16);let i=0;for(;n<e.length;i++)for(let o=3;o>=0&&n<e.length;o--)this._W[i]|=e[n++]<<o*8;r||(this._W[i-(n%4===0?0:1)]|=Wt<<(3-n%4)*8),this._W[14]=e.byteLength/o$,this._W[15]=e.byteLength*8,this._updateHash();const s=new Uint8Array(32);for(let o=0;o<this._H.length;o++)for(let l=0;l<4;l++)s[o*4+l]=this._H[o]>>>(3-l)*8;return s}}const xV=t=>new vV().digest(t),SV=t=>{for(let n=6;n<t.length;n++)t[n%6]=t[n%6]^t[n];return t.slice(0,6)},CV=t=>oU(SV(xV(aU(t)))),jf=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&e.sv.get(t.id.client)>t.id.clock&&!fo(e.ds,t.id),AV=[{light:"#ecd44433",dark:"#ecd444"}],TV=(t,e,n)=>{if(!t.has(n)){if(t.size<e.length){const r=ts();t.forEach(i=>r.add(i)),e=e.filter(i=>!r.has(i))}t.set(n,z$(e))}return t.get(n)},NV=(t,{colors:e=AV,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:s}={})=>{let o=!1;const l=new OV(t,s),a=new Ae({props:{editable:u=>{const c=it.getState(u);return c.snapshot==null&&c.prevSnapshot==null}},key:it,state:{init:(u,c)=>({type:t,doc:t.doc,binding:l,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:e,colorMapping:n,permanentUserData:r}),apply:(u,c)=>{const d=u.getMeta(it);if(d!==void 0){c=Object.assign({},c);for(const f in d)c[f]=d[f]}return c.addToHistory=u.getMeta("addToHistory")!==!1,c.isChangeOrigin=d!==void 0&&!!d.isChangeOrigin,c.isUndoRedoOperation=d!==void 0&&!!d.isChangeOrigin&&!!d.isUndoRedoOperation,l.prosemirrorView!==null&&d!==void 0&&(d.snapshot!=null||d.prevSnapshot!=null)&&oA(0,()=>{l.prosemirrorView!=null&&(d.restore==null?l._renderSnapshot(d.snapshot,d.prevSnapshot,c):(l._renderSnapshot(d.snapshot,d.snapshot,c),delete c.restore,delete c.snapshot,delete c.prevSnapshot,l.mux(()=>{l._prosemirrorChanged(l.prosemirrorView.state.doc)})))}),c}},view:u=>(l.initView(u),s==null&&l._forceRerender(),i(),{update:()=>{const c=a.getState(u.state);if(c.snapshot==null&&c.prevSnapshot==null&&(o||u.state.doc.content.findDiffStart(u.state.doc.type.createAndFill().content)!==null)){if(o=!0,c.addToHistory===!1&&!c.isChangeOrigin){const d=Xr.getState(u.state),f=d&&d.undoManager;f&&f.stopCapturing()}l.mux(()=>{c.doc.transact(d=>{d.meta.set("addToHistory",c.addToHistory),l._prosemirrorChanged(u.state.doc)},it)})}},destroy:()=>{l.destroy()}})});return a},MV=(t,e,n)=>{if(e!==null&&e.anchor!==null&&e.head!==null)if(e.type==="all")t.setSelection(new on(t.doc));else if(e.type==="node"){const r=w0(n.doc,n.type,e.anchor,n.mapping);t.setSelection(J.create(t.doc,r))}else{const r=w0(n.doc,n.type,e.anchor,n.mapping),i=w0(n.doc,n.type,e.head,n.mapping);if(r!==null&&i!==null){const s=X.between(t.doc.resolve(r),t.doc.resolve(i));t.setSelection(s)}}},gm=(t,e)=>({type:e.selection.jsonID,anchor:C_(e.selection.anchor,t.type,t.mapping),head:C_(e.selection.head,t.type,t.mapping)});class OV{constructor(e,n=new Map){this.type=e,this.prosemirrorView=null,this.mux=fV(),this.mapping=n,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=gm(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta("addToHistory",!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(H3&&this._domSelectionInView===null&&(oA(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){const e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;const n=this.prosemirrorView._root.createRange();n.setStart(e.anchorNode,e.anchorOffset),n.setEnd(e.focusNode,e.focusOffset),n.getClientRects().length===0&&n.startContainer&&n.collapsed&&n.selectNodeContents(n.startContainer);const i=n.getBoundingClientRect(),s=Yu.documentElement;return i.bottom>=0&&i.right>=0&&i.left<=(window.innerWidth||s.clientWidth||0)&&i.top<=(window.innerHeight||s.clientHeight||0)}renderSnapshot(e,n){n||(n=Wb(Bb(),new Map)),this.prosemirrorView.dispatch(this._tr.setMeta(it,{snapshot:e,prevSnapshot:n}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{const e=this.type.toArray().map(r=>md(r,this.prosemirrorView.state.schema,this)).filter(r=>r!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new $(R.from(e),0,0));n.setMeta(it,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(n)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{const e=this.beforeTransactionSelection!==null?null:this.prosemirrorView.state.selection,n=this.type.toArray().map(i=>md(i,this.prosemirrorView.state.schema,this)).filter(i=>i!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new $(R.from(n),0,0));if(e){const i=kl(si(e.anchor,0),r.doc.content.size),s=kl(si(e.head,0),r.doc.content.size);r.setSelection(X.create(r.doc,i,s))}this.prosemirrorView.dispatch(r.setMeta(it,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,n,r){let i=this.doc,s=this.type;if(e||(e=hd(this.doc)),e instanceof Uint8Array||n instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(n instanceof Uint8Array))&&Ft(),i=new ps({gc:!1}),Au(i,n),n=hd(i),Au(i,e),e=hd(i),s._item===null){const o=Array.from(this.doc.share.keys()).find(l=>this.doc.share.get(l)===this.type);s=i.getXmlFragment(o)}else{const o=i.store.clients.get(s._item.id.client)??[],l=Zn(o,s._item.id.clock);s=o[l].content.type}this.mapping.clear(),this.mux(()=>{i.transact(o=>{const l=r.permanentUserData;l&&l.dss.forEach(d=>{oi(o,d,f=>{})});const a=(d,f)=>{const h=d==="added"?l.getUserByClientId(f.client):l.getUserByDeletedId(f);return{user:h,type:d,color:TV(r.colorMapping,r.colors,h)}},u=Jb(s,new Uh(n.ds,e.sv)).map(d=>!d._item.deleted||jf(d._item,e)||jf(d._item,n)?md(d,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,n,a):null).filter(d=>d!==null),c=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new $(R.from(u),0,0));this.prosemirrorView.dispatch(c.setMeta(it,{isChangeOrigin:!0}))},it)})}_typeChanged(e,n){if(this.prosemirrorView==null)return;const r=it.getState(this.prosemirrorView.state);if(e.length===0||r.snapshot!=null||r.prevSnapshot!=null){this.renderSnapshot(r.snapshot,r.prevSnapshot);return}this.mux(()=>{const i=(l,a)=>this.mapping.delete(a);oi(n,n.deleteSet,l=>{if(l.constructor===ke){const a=l.content.type;a&&this.mapping.delete(a)}}),n.changed.forEach(i),n.changedParentTypes.forEach(i);const s=this.type.toArray().map(l=>oT(l,this.prosemirrorView.state.schema,this)).filter(l=>l!==null);let o=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new $(R.from(s),0,0));MV(o,this.beforeTransactionSelection,this),o=o.setMeta(it,{isChangeOrigin:!0,isUndoRedoOperation:n.origin instanceof Kb}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&o.scrollIntoView(),this.prosemirrorView.dispatch(o)})}_prosemirrorChanged(e){this.doc.transact(()=>{bm(this.doc,this.type,e,this),this.beforeTransactionSelection=gm(this,this.prosemirrorView.state)},it)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on("beforeAllTransactions",this.beforeAllTransactions),this.doc.on("afterAllTransactions",this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off("beforeAllTransactions",this.beforeAllTransactions),this.doc.off("afterAllTransactions",this.afterAllTransactions))}}const oT=(t,e,n,r,i,s)=>{const o=n.mapping.get(t);if(o===void 0){if(t instanceof St)return md(t,e,n,r,i,s);throw Vn()}return o},md=(t,e,n,r,i,s)=>{const o=[],l=a=>{if(a instanceof St){const u=oT(a,e,n,r,i,s);u!==null&&o.push(u)}else{const u=a._item.right?.content?.type;u instanceof li&&!u._item.deleted&&u._item.id.client===u.doc.clientID&&(a.applyDelta([{retain:a.length},...u.toDelta()]),u.doc.transact(d=>{u._item.delete(d)}));const c=DV(a,e,n,r,i,s);c!==null&&c.forEach(d=>{d!==null&&o.push(d)})}};r===void 0||i===void 0?t.toArray().forEach(l):Jb(t,new Uh(i.ds,r.sv)).forEach(l);try{const a=t.getAttributes(r);r!==void 0&&(jf(t._item,r)?jf(t._item,i)||(a.ychange=s?s("added",t._item.id):{type:"added"}):a.ychange=s?s("removed",t._item.id):{type:"removed"});const u=e.node(t.nodeName,a,o);return n.mapping.set(t,u),u}catch{return t.doc.transact(u=>{t._item.delete(u)},it),n.mapping.delete(t),null}},DV=(t,e,n,r,i,s)=>{const o=[],l=t.toDelta(r,i,s);try{for(let a=0;a<l.length;a++){const u=l[a];o.push(e.text(u.insert,BV(u.attributes,e)))}}catch{return t.doc.transact(u=>{t._item.delete(u)},it),null}return o},RV=(t,e)=>{const n=new Kt,r=t.map(i=>({insert:i.text,attributes:aT(i.marks,e)}));return n.applyDelta(r),e.mapping.set(n,t),n},IV=(t,e)=>{const n=new St(t.type.name);for(const r in t.attrs){const i=t.attrs[r];i!==null&&r!=="ychange"&&n.setAttribute(r,i)}return n.insert(0,Kh(t).map(r=>mm(r,e))),e.mapping.set(n,t),n},mm=(t,e)=>t instanceof Array?RV(t,e):IV(t,e),x_=t=>typeof t=="object"&&t!==null,ey=(t,e)=>{const n=Object.keys(t).filter(i=>t[i]!==null);let r=n.length===(e==null?0:Object.keys(e).filter(i=>e[i]!==null).length);for(let i=0;i<n.length&&r;i++){const s=n[i],o=t[s],l=e[s];r=s==="ychange"||o===l||x_(o)&&x_(l)&&ey(o,l)}return r},Kh=t=>{const e=t.content.content,n=[];for(let r=0;r<e.length;r++){const i=e[r];if(i.isText){const s=[];for(let o=e[r];r<e.length&&o.isText;o=e[++r])s.push(o);r--,n.push(s)}else n.push(i)}return n},lT=(t,e)=>{const n=t.toDelta();return n.length===e.length&&n.every((r,i)=>r.insert===e[i].text&&z3(r.attributes||{}).length===e[i].marks.length&&Dl(r.attributes,(s,o)=>{const l=ty(o),a=e[i].marks;return ey(s,a.find(u=>u.type.name===l)?.attrs)}))},Iu=(t,e)=>{if(t instanceof St&&!(e instanceof Array)&&ym(t,e)){const n=Kh(e);return t._length===n.length&&ey(t.getAttributes(),e.attrs)&&t.toArray().every((r,i)=>Iu(r,n[i]))}return t instanceof Kt&&e instanceof Array&&lT(t,e)},qf=(t,e)=>t===e||t instanceof Array&&e instanceof Array&&t.length===e.length&&t.every((n,r)=>e[r]===n),S_=(t,e,n)=>{const r=t.toArray(),i=Kh(e),s=i.length,o=r.length,l=kl(o,s);let a=0,u=0,c=!1;for(;a<l;a++){const d=r[a],f=i[a];if(qf(n.mapping.get(d),f))c=!0;else if(!Iu(d,f))break}for(;a+u<l;u++){const d=r[o-u-1],f=i[s-u-1];if(qf(n.mapping.get(d),f))c=!0;else if(!Iu(d,f))break}return{equalityFactor:a+u,foundMappedChild:c}},LV=t=>{let e="",n=t._start;const r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof Xn?e+=n.content.str:n.content instanceof Ye&&(r[n.content.key]=null)),n=n.right;return{str:e,nAttrs:r}},PV=(t,e,n)=>{n.mapping.set(t,e);const{nAttrs:r,str:i}=LV(t),s=e.map(u=>({insert:u.text,attributes:Object.assign({},r,aT(u.marks,n))})),{insert:o,remove:l,index:a}=mV(i,s.map(u=>u.insert).join(""));t.delete(a,l),t.insert(a,o),t.applyDelta(s.map(u=>({retain:u.insert.length,attributes:u.attributes})))},FV=/(.*)(--[a-zA-Z0-9+/=]{8})$/,ty=t=>FV.exec(t)?.[1]??t,BV=(t,e)=>{const n=[];for(const r in t)n.push(e.mark(ty(r),t[r]));return n},aT=(t,e)=>{const n={};return t.forEach(r=>{if(r.type.name!=="ychange"){const i=Ir(e.isOMark,r.type,()=>!r.type.excludes(r.type));n[i?`${r.type.name}--${CV(r.toJSON())}`:r.type.name]=r.attrs}}),n},bm=(t,e,n,r)=>{if(e instanceof St&&e.nodeName!==n.type.name)throw new Error("node name mismatch!");if(r.mapping.set(e,n),e instanceof St){const d=e.getAttributes(),f=n.attrs;for(const h in f)f[h]!==null?d[h]!==f[h]&&h!=="ychange"&&e.setAttribute(h,f[h]):e.removeAttribute(h);for(const h in d)f[h]===void 0&&e.removeAttribute(h)}const i=Kh(n),s=i.length,o=e.toArray(),l=o.length,a=kl(s,l);let u=0,c=0;for(;u<a;u++){const d=o[u],f=i[u];if(!qf(r.mapping.get(d),f))if(Iu(d,f))r.mapping.set(d,f);else break}for(;c+u<a;c++){const d=o[l-c-1],f=i[s-c-1];if(!qf(r.mapping.get(d),f))if(Iu(d,f))r.mapping.set(d,f);else break}t.transact(()=>{for(;l-u-c>0&&s-u-c>0;){const f=o[u],h=i[u],p=o[l-c-1],g=i[s-c-1];if(f instanceof Kt&&h instanceof Array)lT(f,h)||PV(f,h,r),u+=1;else{let b=f instanceof St&&ym(f,h),m=p instanceof St&&ym(p,g);if(b&&m){const E=S_(f,h,r),k=S_(p,g,r);E.foundMappedChild&&!k.foundMappedChild?m=!1:!E.foundMappedChild&&k.foundMappedChild||E.equalityFactor<k.equalityFactor?b=!1:m=!1}b?(bm(t,f,h,r),u+=1):m?(bm(t,p,g,r),c+=1):(r.mapping.delete(e.get(u)),e.delete(u,1),e.insert(u,[mm(h,r)]),u+=1)}}const d=l-u-c;if(l===1&&s===0&&o[0]instanceof Kt?(r.mapping.delete(o[0]),o[0].delete(0,o[0].length)):d>0&&(e.slice(u,u+d).forEach(f=>r.mapping.delete(f)),e.delete(u,d)),u+c<s){const f=[];for(let h=u;h<s-c;h++)f.push(mm(i[h],r));e.insert(u,f)}},it)},ym=(t,e)=>!(e instanceof Array)&&t.nodeName===e.type.name,C_=(t,e,n)=>{if(t===0)return fd(e,0,e.length===0?-1:0);let r=e._first===null?null:e._first.content.type;for(;r!==null&&e!==r;){if(r instanceof Kt){if(r._length>=t)return fd(r,t,e.length===0?-1:0);if(t-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,t--;while(r!==e&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==e&&(r=r._item===null?null:r._item.next.content.type)}}else{const i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&t<i)r=r._first.content.type,t--;else{if(t===1&&r._length===0&&i>1)return new Tu(r._item===null?null:r._item.id,r._item===null?Sl(r):null,null);if(t-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(t===0)return r=r._item===null?r:r._item.parent,new Tu(r._item===null?null:r._item.id,r._item===null?Sl(r):null,null);do r=r._item.parent,t--;while(r!==e&&r._item.next===null);r!==e&&(r=r._item.next.content.type)}}}if(r===null)throw Ft();if(t===0&&r.constructor!==Kt&&r!==e)return zV(r._item.parent,r._item)}return fd(e,e._length,e.length===0?-1:0)},zV=(t,e)=>{let n=null,r=null;return t._item===null?r=Sl(t):n=ce(t._item.id.client,t._item.id.clock),new Tu(n,r,e.id)},w0=(t,e,n,r)=>{const i=vA(n,t);if(i===null||i.type!==e&&!Cl(e,i.type._item))return null;let s=i.type,o=0;if(s.constructor===Kt)o=i.index;else if(s._item===null||!s._item.deleted){let l=s._first,a=0;for(;a<s._length&&a<i.index&&l!==null;){if(!l.deleted){const u=l.content.type;a++,u instanceof Kt?o+=u._length:o+=r.get(u).nodeSize}l=l.right}o+=1}for(;s!==e&&s._item!==null;){const l=s._item.parent;if(l._item===null||!l._item.deleted){o+=1;let a=l._first;for(;a!==null;){const u=a.content.type;if(u===s)break;a.deleted||(u instanceof Kt?o+=u._length:o+=r.get(u).nodeSize),a=a.right}}s=l}return o-1};function $V(t){const e=t.toArray(),n=r=>{let i;if(r instanceof Kt)i=r.toDelta().map(o=>{const l={type:"text",text:o.insert};return o.attributes&&(l.marks=Object.keys(o.attributes).map(a=>{const u=o.attributes[a],d={type:ty(a)};return Object.keys(u)&&(d.attrs=u),d})),l});else if(r instanceof St){i={type:r.nodeName};const s=r.getAttributes();Object.keys(s).length&&(i.attrs=s);const o=r.toArray();o.length&&(i.content=o.map(n).flat())}else Ft();return i};return{type:"doc",content:e.map(n)}}const UV=t=>Xr.getState(t)?.undoManager?.undo()!=null,HV=t=>Xr.getState(t)?.undoManager?.redo()!=null,VV=new Set(["paragraph"]),WV=(t,e)=>!(t instanceof ke)||!(t.content instanceof Qn)||!(t.content.type instanceof li||t.content.type instanceof St&&e.has(t.content.type.nodeName))||t.content.type._length===0,KV=({protectedNodes:t=VV,trackedOrigins:e=[],undoManager:n=null}={})=>new Ae({key:Xr,state:{init:(r,i)=>{const s=it.getState(i),o=n||new Kb(s.type,{trackedOrigins:new Set([it].concat(e)),deleteFilter:l=>WV(l,t),captureTransaction:l=>l.meta.get("addToHistory")!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(r,i,s,o)=>{const l=it.getState(o).binding,a=i.undoManager,u=a.undoStack.length>0,c=a.redoStack.length>0;return l?{undoManager:a,prevSel:gm(l,s),hasUndoOps:u,hasRedoOps:c}:u!==i.hasUndoOps||c!==i.hasRedoOps?Object.assign({},i,{hasUndoOps:a.undoStack.length>0,hasRedoOps:a.redoStack.length>0}):i}},view:r=>{const i=it.getState(r.state),s=Xr.getState(r.state).undoManager;return s.on("stack-item-added",({stackItem:o})=>{const l=i.binding;l&&o.meta.set(l,Xr.getState(r.state).prevSel)}),s.on("stack-item-popped",({stackItem:o})=>{const l=i.binding;l&&(l.beforeTransactionSelection=o.meta.get(l)||l.beforeTransactionSelection)}),{destroy:()=>{s.destroy()}}}}),IW=et.create({name:"collaboration",priority:1e3,addOptions(){return{document:null,field:"default",fragment:null}},addStorage(){return{isDisabled:!1}},onCreate(){this.editor.extensionManager.extensions.find(t=>t.name==="history")&&console.warn('[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-history".')},addCommands(){return{undo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),Xr.getState(e).undoManager.undoStack.length===0?!1:n?UV(e):!0),redo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),Xr.getState(e).undoManager.redoStack.length===0?!1:n?HV(e):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){var t;const e=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),n=KV(this.options.yUndoOptions),r=n.spec.view;n.spec.view=o=>{const{undoManager:l}=Xr.getState(o.state);l.restore&&(l.restore(),l.restore=()=>{});const a=r?r(o):void 0;return{destroy:()=>{const u=l.trackedOrigins.has(l),c=l._observers;l.restore=()=>{u&&l.trackedOrigins.add(l),l.doc.on("afterTransaction",l.afterTransactionHandler),l._observers=c},a?.destroy&&a.destroy()}}};const i={...this.options.ySyncOptions,onFirstRender:this.options.onFirstRender},s=NV(e,i);return this.editor.options.enableContentCheck&&((t=e.doc)===null||t===void 0||t.on("beforeTransaction",()=>{try{const o=$V(e);if(o.content.length===0)return;this.editor.schema.nodeFromJSON(o).check()}catch(o){return this.editor.emit("contentError",{error:o,editor:this.editor,disableCollaboration:()=>{var l;(l=e.doc)===null||l===void 0||l.destroy(),this.storage.isDisabled=!0}}),!1}})),[s,n,this.editor.options.enableContentCheck&&new Ae({key:new Le("filterInvalidContent"),filterTransaction:()=>{var o;return this.storage.isDisabled&&((o=e.doc)===null||o===void 0||o.destroy()),!0}})].filter(Boolean)}});export{cW as $,hS as A,tW as B,IW as C,ps as D,et as E,R as F,nW as G,oW as H,lW as I,Qi as J,Qs as K,AW as L,Yn as M,Ke as N,MW as O,Ae as P,TW as Q,rW as R,$ as S,X as T,NW as U,fW as V,iW as W,sW as X,hW as Y,aW as Z,dW as _,aH as a,wW as a0,SW as a1,_W as a2,mW as a3,xW as a4,GV as a5,YV as a6,pM as a7,DW as a8,RW as a9,Le as b,Ea as c,MP as d,pH as e,dS as f,jn as g,D1 as h,QV as i,pW as j,J as k,uW as l,NA as m,eW as n,ot as o,XV as p,Te as q,Nx as r,h8 as s,Eh as t,r8 as u,Ce as v,l4 as w,vW as x,a8 as y,Wu as z};
|