@halo-dev/richtext-editor 2.20.21 → 2.22.0

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.
Files changed (149) hide show
  1. package/README.md +61 -0
  2. package/dist/components/Editor.vue.d.ts +5 -4
  3. package/dist/components/EditorHeader.vue.d.ts +4 -4
  4. package/dist/components/base/DropdownItem.vue.d.ts +29 -0
  5. package/dist/components/base/Input.vue.d.ts +29 -0
  6. package/dist/components/base/index.d.ts +2 -0
  7. package/dist/components/block/BlockActionButton.vue.d.ts +13 -8
  8. package/dist/{dev/App.vue.d.ts → components/block/BlockActionHorizontalSeparator.vue.d.ts} +1 -1
  9. package/dist/components/block/BlockActionSeparator.vue.d.ts +2 -1
  10. package/dist/components/block/index.d.ts +1 -2
  11. package/dist/components/bubble/BubbleButton.vue.d.ts +28 -0
  12. package/dist/components/bubble/BubbleItem.vue.d.ts +3 -37
  13. package/dist/components/{EditorBubbleMenu.vue.d.ts → bubble/EditorBubbleMenu.vue.d.ts} +3 -3
  14. package/dist/components/bubble/index.d.ts +2 -1
  15. package/dist/components/common/ColorPickerDropdown.vue.d.ts +7 -7
  16. package/dist/components/drag/EditorDragButtonItem.vue.d.ts +8 -0
  17. package/dist/components/drag/EditorDragHandle.vue.d.ts +14 -0
  18. package/dist/components/drag/EditorDragMenu.vue.d.ts +43 -0
  19. package/dist/components/drag/default-drag.d.ts +8 -0
  20. package/dist/components/drag/index.d.ts +4 -0
  21. package/dist/components/index.d.ts +4 -2
  22. package/dist/components/toolbar/ToolbarItem.vue.d.ts +2 -24
  23. package/dist/components/toolbar/ToolbarSubItem.vue.d.ts +2 -20
  24. package/dist/components/toolbox/ToolboxItem.vue.d.ts +2 -21
  25. package/dist/components/upload/EditorLinkObtain.vue.d.ts +52 -0
  26. package/dist/components/upload/ResourceReplaceButton.vue.d.ts +14 -0
  27. package/dist/components/upload/index.d.ts +2 -0
  28. package/dist/composables/use-attachment.d.ts +7 -0
  29. package/dist/extensions/audio/AudioView.vue.d.ts +107 -2
  30. package/dist/extensions/audio/BubbleItemAudioLink.vue.d.ts +2 -29
  31. package/dist/extensions/audio/BubbleItemAudioPosition.vue.d.ts +7 -0
  32. package/dist/extensions/audio/index.d.ts +9 -4
  33. package/dist/extensions/blockquote/index.d.ts +2 -2
  34. package/dist/extensions/bold/index.d.ts +2 -2
  35. package/dist/extensions/bullet-list/index.d.ts +3 -3
  36. package/dist/extensions/character-count/index.d.ts +1 -0
  37. package/dist/extensions/clear-format/index.d.ts +2 -2
  38. package/dist/extensions/code/index.d.ts +2 -2
  39. package/dist/extensions/code-block/CodeBlockSelect.vue.d.ts +8 -9
  40. package/dist/extensions/code-block/code-block.d.ts +7 -5
  41. package/dist/extensions/code-block/index.d.ts +0 -1
  42. package/dist/extensions/color/ColorBubbleItem.vue.d.ts +2 -29
  43. package/dist/extensions/color/ColorToolbarItem.vue.d.ts +2 -24
  44. package/dist/extensions/color/index.d.ts +2 -2
  45. package/dist/extensions/columns/column.d.ts +6 -2
  46. package/dist/extensions/columns/columns.d.ts +11 -4
  47. package/dist/extensions/columns/index.d.ts +2 -2
  48. package/dist/extensions/commands-menu/CommandsView.vue.d.ts +1 -1
  49. package/dist/extensions/commands-menu/commands.d.ts +2 -3
  50. package/dist/extensions/commands-menu/index.d.ts +1 -1
  51. package/dist/extensions/details/index.d.ts +6 -0
  52. package/dist/extensions/document/index.d.ts +2 -0
  53. package/dist/extensions/drop-cursor/index.d.ts +1 -0
  54. package/dist/extensions/extensions-kit.d.ts +91 -0
  55. package/dist/extensions/figure/FigureCaptionView.vue.d.ts +3 -0
  56. package/dist/extensions/figure/figure-caption.d.ts +2 -0
  57. package/dist/extensions/figure/index.d.ts +15 -0
  58. package/dist/extensions/font-size/index.d.ts +4 -14
  59. package/dist/extensions/format-brush/index.d.ts +4 -4
  60. package/dist/extensions/gallery/BubbleItemAddImage.vue.d.ts +7 -0
  61. package/dist/extensions/gallery/BubbleItemGap.vue.d.ts +493 -0
  62. package/dist/extensions/gallery/BubbleItemGroupSize.vue.d.ts +493 -0
  63. package/dist/extensions/gallery/BubbleItemLayout.vue.d.ts +493 -0
  64. package/dist/extensions/gallery/GalleryView.vue.d.ts +3 -0
  65. package/dist/extensions/gallery/gallery-bubble.d.ts +8 -0
  66. package/dist/extensions/gallery/index.d.ts +28 -0
  67. package/dist/extensions/gallery/useGalleryImages.d.ts +7 -0
  68. package/dist/extensions/gap-cursor/index.d.ts +1 -17
  69. package/dist/extensions/hard-break/index.d.ts +1 -0
  70. package/dist/extensions/heading/index.d.ts +2 -2
  71. package/dist/extensions/highlight/HighlightBubbleItem.vue.d.ts +2 -29
  72. package/dist/extensions/highlight/HighlightToolbarItem.vue.d.ts +2 -24
  73. package/dist/extensions/highlight/index.d.ts +2 -2
  74. package/dist/extensions/history/index.d.ts +1 -3
  75. package/dist/extensions/horizontal-rule/index.d.ts +1 -0
  76. package/dist/extensions/iframe/BubbleItemIframeAlign.vue.d.ts +7 -0
  77. package/dist/extensions/iframe/BubbleItemIframeLink.vue.d.ts +2 -29
  78. package/dist/extensions/iframe/BubbleItemIframeSize.vue.d.ts +2 -6
  79. package/dist/extensions/iframe/IframeView.vue.d.ts +54 -1
  80. package/dist/extensions/iframe/index.d.ts +4 -4
  81. package/dist/extensions/image/BubbleItemImageAlt.vue.d.ts +2 -29
  82. package/dist/extensions/image/BubbleItemImageHref.vue.d.ts +2 -29
  83. package/dist/extensions/image/BubbleItemImageLink.vue.d.ts +2 -29
  84. package/dist/extensions/image/BubbleItemImagePosition.vue.d.ts +7 -0
  85. package/dist/extensions/image/BubbleItemImageSize.vue.d.ts +2 -29
  86. package/dist/extensions/image/ImageView.vue.d.ts +109 -2
  87. package/dist/extensions/image/index.d.ts +8 -2
  88. package/dist/extensions/indent/index.d.ts +5 -5
  89. package/dist/extensions/index.d.ts +49 -47
  90. package/dist/extensions/italic/index.d.ts +2 -2
  91. package/dist/extensions/link/LinkBubbleButton.vue.d.ts +2 -29
  92. package/dist/extensions/link/index.d.ts +2 -2
  93. package/dist/extensions/list-extra/index.d.ts +6 -0
  94. package/dist/extensions/list-keymap/index.d.ts +4 -4
  95. package/dist/extensions/node-selected/index.d.ts +3 -4
  96. package/dist/extensions/ordered-list/index.d.ts +3 -3
  97. package/dist/extensions/paragraph/index.d.ts +2 -2
  98. package/dist/extensions/placeholder/index.d.ts +1 -0
  99. package/dist/extensions/range-selection/index.d.ts +2 -2
  100. package/dist/extensions/search-and-replace/IconButton.vue.d.ts +20 -0
  101. package/dist/extensions/search-and-replace/MatchToggleButton.vue.d.ts +20 -0
  102. package/dist/extensions/search-and-replace/SearchAndReplace.vue.d.ts +5 -2
  103. package/dist/extensions/search-and-replace/SearchAndReplacePlugin.d.ts +3 -2
  104. package/dist/extensions/search-and-replace/index.d.ts +2 -3
  105. package/dist/extensions/strike/index.d.ts +2 -2
  106. package/dist/extensions/subscript/index.d.ts +2 -2
  107. package/dist/extensions/superscript/index.d.ts +2 -2
  108. package/dist/extensions/table/index.d.ts +4 -2
  109. package/dist/extensions/table/table-row.d.ts +1 -1
  110. package/dist/extensions/task-list/index.d.ts +3 -3
  111. package/dist/extensions/text/BubbleItemTextType.vue.d.ts +3 -0
  112. package/dist/extensions/text/index.d.ts +4 -2
  113. package/dist/extensions/text-align/index.d.ts +2 -2
  114. package/dist/extensions/text-style/index.d.ts +3 -3
  115. package/dist/extensions/trailing-node/index.d.ts +1 -2
  116. package/dist/extensions/underline/index.d.ts +2 -2
  117. package/dist/extensions/upload/index.d.ts +8 -0
  118. package/dist/extensions/video/BubbleItemVideoLink.vue.d.ts +2 -29
  119. package/dist/extensions/video/BubbleItemVideoPosition.vue.d.ts +7 -0
  120. package/dist/extensions/video/BubbleItemVideoSize.vue.d.ts +2 -29
  121. package/dist/extensions/video/VideoView.vue.d.ts +107 -2
  122. package/dist/extensions/video/index.d.ts +18 -4
  123. package/dist/index.d.ts +1 -4
  124. package/dist/index.es.js +39156 -0
  125. package/dist/index.iife.js +176 -0
  126. package/dist/style.css +2 -1
  127. package/dist/tiptap/index.d.ts +3 -3
  128. package/dist/tiptap/pm/index.d.ts +0 -1
  129. package/dist/types/index.d.ts +115 -59
  130. package/dist/utils/attachment.d.ts +3 -0
  131. package/dist/utils/clipboard.d.ts +9 -0
  132. package/dist/utils/delete-node.d.ts +1 -1
  133. package/dist/utils/filter-duplicate-extensions.d.ts +2 -0
  134. package/dist/utils/index.d.ts +8 -0
  135. package/dist/utils/{isListActive.d.ts → is-list-active.d.ts} +2 -2
  136. package/dist/utils/is-node-empty.d.ts +6 -0
  137. package/dist/utils/keyboard.d.ts +37 -0
  138. package/dist/utils/upload.d.ts +67 -0
  139. package/package.json +46 -58
  140. package/dist/components/block/BlockActionInput.vue.d.ts +0 -15
  141. package/dist/components/block/BlockCard.vue.d.ts +0 -30
  142. package/dist/components/bubble/BubbleMenu.vue.d.ts +0 -84
  143. package/dist/components/bubble/BubbleMenuPlugin.d.ts +0 -52
  144. package/dist/dev/main.d.ts +0 -1
  145. package/dist/extensions/draggable/index.d.ts +0 -13
  146. package/dist/rich-text-editor.es.js +0 -41779
  147. package/dist/rich-text-editor.iife.js +0 -140
  148. package/dist/utils/isNodeEmpty.d.ts +0 -4
  149. /package/dist/components/icon/{MdiDeleteForeverOutline.vue.d.ts → MingcuteDelete2Line.vue.d.ts} +0 -0
@@ -0,0 +1,176 @@
1
+ var RichTextEditor=(function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=Object.create,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,l=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),f=(e,t)=>{let n={};for(var r in e)o(n,r,{get:e[r],enumerable:!0});return t&&o(n,Symbol.toStringTag,{value:`Module`}),n},p=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=c(t),a=0,l=i.length,d;a<l;a++)d=i[a],!u.call(e,d)&&d!==n&&o(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=s(t,d))||r.enumerable});return e},m=(e,t,n)=>(n=e==null?{}:a(l(e)),p(t||!e||!e.__esModule?o(n,`default`,{value:e,enumerable:!0}):n,e)),h=[`disabled`],g=(0,t.defineComponent)({__name:`BlockActionButton`,props:{tooltip:{default:void 0},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},isActive:{type:Boolean,default:!1},visible:{type:Boolean,default:!0}},setup(e){return(r,i)=>e.visible?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:(0,t.normalizeClass)([`editor-block__actions-button`,{"editor-block__actions-button--selected":e.selected,"editor-block__actions-button--active":e.isActive}]),disabled:e.disabled},[(0,t.renderSlot)(r.$slots,`icon`)],10,h)),[[(0,t.unref)(n.vTooltip),e.tooltip]]):(0,t.createCommentVNode)(``,!0)}}),_=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},v={},y={class:`editor-block__actions-horizontal-separator`};function b(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,y)}var x=_(v,[[`render`,b]]),S={key:0,class:`editor-block__actions-separator`},C=(0,t.defineComponent)({__name:`BlockActionSeparator`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},setup(e){let n=e,r=(0,t.computed)(()=>n.visible?n.editor&&n.visible?.({editor:n.editor}):!0);return(e,n)=>r.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,S)):(0,t.createCommentVNode)(``,!0)}}),w={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function T(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,w,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`M24 0v24H0V0zM12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.105.074l.014.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.092l.01-.009l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M12.707 14.536a1 1 0 0 1-1.414 0l-2.829-2.829A1 1 0 0 1 9.172 10h5.656a1 1 0 0 1 .708 1.707z`})],-1)]])}var ee=(0,t.markRaw)({name:`mingcute-down-small-fill`,render:T}),te=[`disabled`],E=(0,t.defineComponent)({__name:`ToolbarItem`,props:{editor:{},isActive:{type:Boolean},disabled:{type:Boolean},icon:{},title:{},action:{type:Function},children:{}},setup(e){return(r,i)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{class:(0,t.normalizeClass)([[{"bg-gray-200/70":e.isActive},{"cursor-not-allowed opacity-70":e.disabled},{"hover:bg-gray-100":!e.disabled},{"h-8 w-auto px-1.5":!!e.children?.length},{"size-8":!e.children?.length}],`inline-flex items-center justify-center rounded-md p-1 transition-colors active:!bg-gray-200`]),disabled:e.disabled,tabindex:`-1`,onClick:i[0]||=(...t)=>e.action&&e.action(...t)},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon))),e.children?.length?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(ee),{key:0})):(0,t.createCommentVNode)(``,!0)],10,te)),[[(0,t.unref)(n.vTooltip),e.title]])}}),ne={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function re(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,ne,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 2a8 8 0 1 0 0 16a8 8 0 0 0 0-16m3.535 4.381a1 1 0 0 1 1.498 1.32l-.083.094l-5.586 5.587a1.1 1.1 0 0 1-1.46.085l-.096-.085l-2.758-2.758a1 1 0 0 1 1.32-1.498l.094.084l2.122 2.121l4.95-4.95Z`})],-1)]])}var ie=(0,t.markRaw)({name:`mingcute-check-circle-line`,render:re}),ae=(0,t.defineComponent)({__name:`DropdownItem`,props:{disabled:{type:Boolean,default:!1},isActive:{type:Boolean,default:!1}},emits:[`click`],setup(e,{emit:n}){let r=e,i=n;function a(e){r.disabled||i(`click`,e)}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{role:`menuitem`,tabindex:`-1`,class:(0,t.normalizeClass)([[{"cursor-not-allowed opacity-70":e.disabled},{"hover:bg-gray-100":!e.disabled},{"px-3":!n.$slots.icon},{"px-1.5":!!n.$slots.icon}],`group my-1.5 flex min-h-9 cursor-pointer flex-row items-center gap-3 rounded py-1 transition-colors first:mt-0 last:mb-0`]),onClick:a},[n.$slots.icon?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)([`size-7 flex-none rounded bg-gray-100 p-1.5 [&>svg]:size-full`,{"group-hover:bg-white":!e.disabled}])},[(0,t.renderSlot)(n.$slots,`icon`)],2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`min-w-0 flex-1 shrink text-sm text-gray-600`,[{"!font-medium !text-gray-900":e.isActive},{"group-hover:font-medium group-hover:text-gray-900":!e.disabled}]])},[(0,t.renderSlot)(n.$slots,`default`)],2),e.isActive?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(ie),{key:1,class:`size-4 flex-none text-gray-900`})):(0,t.createCommentVNode)(``,!0)],2))}}),D=(0,t.defineComponent)({__name:`ToolbarSubItem`,props:{editor:{},isActive:{type:Boolean},disabled:{type:Boolean},icon:{},title:{},action:{type:Function},children:{}},setup(e){let n=e,r=()=>{n.disabled||n.action?.()};return(n,i)=>((0,t.openBlock)(),(0,t.createBlock)(ae,{disabled:e.disabled,"is-active":e.isActive,onClick:r},(0,t.createSlots)({default:(0,t.withCtx)(()=>[(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.title),1)]),_:2},[e.icon?{name:`icon`,fn:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon)))]),key:`0`}:void 0]),1032,[`disabled`,`is-active`]))}});function oe(e,t){typeof console<`u`&&(console.warn(`[intlify] `+e),t&&console.warn(t.stack))}var se=typeof window<`u`,ce=(e,t=!1)=>t?Symbol.for(e):Symbol(e),le=(e,t,n)=>ue({l:e,k:t,s:n}),ue=e=>JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`).replace(/\u0027/g,`\\u0027`),de=e=>typeof e==`number`&&isFinite(e),fe=e=>ke(e)===`[object Date]`,pe=e=>ke(e)===`[object RegExp]`,me=e=>j(e)&&Object.keys(e).length===0,he=Object.assign,ge=Object.create,O=(e=null)=>ge(e),_e,ve=()=>_e||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:O();function ye(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`).replace(/\//g,`&#x2F;`).replace(/=/g,`&#x3D;`)}function be(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,`&amp;`).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function xe(e){return e=e.replace(/(\w+)\s*=\s*"([^"]*)"/g,(e,t,n)=>`${t}="${be(n)}"`),e=e.replace(/(\w+)\s*=\s*'([^']*)'/g,(e,t,n)=>`${t}='${be(n)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,`$1&#111;n$3`)),[/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach(t=>{e=e.replace(t,`$1javascript&#58;`)}),e}var Se=Object.prototype.hasOwnProperty;function Ce(e,t){return Se.call(e,t)}var we=Array.isArray,Te=e=>typeof e==`function`,k=e=>typeof e==`string`,Ee=e=>typeof e==`boolean`,A=e=>typeof e==`object`&&!!e,De=e=>A(e)&&Te(e.then)&&Te(e.catch),Oe=Object.prototype.toString,ke=e=>Oe.call(e),j=e=>ke(e)===`[object Object]`,Ae=e=>e==null?``:we(e)||j(e)&&e.toString===Oe?JSON.stringify(e,null,2):String(e);function je(e,t=``){return e.reduce((e,n,r)=>r===0?e+n:e+t+n,``)}var Me=e=>!A(e)||we(e);function Ne(e,t){if(Me(e)||Me(t))throw Error(`Invalid value`);let n=[{src:e,des:t}];for(;n.length;){let{src:e,des:t}=n.pop();Object.keys(e).forEach(r=>{r!==`__proto__`&&(A(e[r])&&!A(t[r])&&(t[r]=Array.isArray(e[r])?[]:O()),Me(t[r])||Me(e[r])?t[r]=e[r]:n.push({src:e[r],des:t[r]}))})}}function Pe(e,t,n){return{line:e,column:t,offset:n}}function Fe(e,t,n){let r={start:e,end:t};return n!=null&&(r.source=n),r}var M={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16};M.EXPECTED_TOKEN,M.INVALID_TOKEN_IN_PLACEHOLDER,M.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,M.UNKNOWN_ESCAPE_SEQUENCE,M.INVALID_UNICODE_ESCAPE_SEQUENCE,M.UNBALANCED_CLOSING_BRACE,M.UNTERMINATED_CLOSING_BRACE,M.EMPTY_PLACEHOLDER,M.NOT_ALLOW_NEST_PLACEHOLDER,M.INVALID_LINKED_FORMAT,M.MUST_HAVE_MESSAGES_IN_PLURAL,M.UNEXPECTED_EMPTY_LINKED_MODIFIER,M.UNEXPECTED_EMPTY_LINKED_KEY,M.UNEXPECTED_LEXICAL_ANALYSIS,M.UNHANDLED_CODEGEN_NODE_TYPE,M.UNHANDLED_MINIFIER_NODE_TYPE;function Ie(e,t,n={}){let{domain:r,messages:i,args:a}=n,o=e,s=SyntaxError(String(o));return s.code=e,t&&(s.location=t),s.domain=r,s}function Le(e){throw e}var Re=` `,ze=`\r`,Be=`
2
+ `,Ve=`\u2028`,He=`\u2029`;function Ue(e){let t=e,n=0,r=1,i=1,a=0,o=e=>t[e]===ze&&t[e+1]===Be,s=e=>t[e]===Be,c=e=>t[e]===He,l=e=>t[e]===Ve,u=e=>o(e)||s(e)||c(e)||l(e),d=()=>n,f=()=>r,p=()=>i,m=()=>a,h=e=>o(e)||c(e)||l(e)?Be:t[e],g=()=>h(n),_=()=>h(n+a);function v(){return a=0,u(n)&&(r++,i=0),o(n)&&n++,n++,i++,t[n]}function y(){return o(n+a)&&a++,a++,t[n+a]}function b(){n=0,r=1,i=1,a=0}function x(e=0){a=e}function S(){let e=n+a;for(;e!==n;)v();a=0}return{index:d,line:f,column:p,peekOffset:m,charAt:h,currentChar:g,currentPeek:_,next:v,peek:y,reset:b,resetPeek:x,skipToPeek:S}}var We=void 0,Ge=`'`,Ke=`tokenizer`;function qe(e,t={}){let n=t.location!==!1,r=Ue(e),i=()=>r.index(),a=()=>Pe(r.line(),r.column(),r.index()),o=a(),s=i(),c={currentType:13,offset:s,startLoc:o,endLoc:o,lastType:13,lastOffset:s,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:``},l=()=>c,{onError:u}=t;function d(e,t,r,...i){let a=l();t.column+=r,t.offset+=r,u&&u(Ie(e,n?Fe(a.startLoc,t):null,{domain:Ke,args:i}))}function f(e,t,r){e.endLoc=a(),e.currentType=t;let i={type:t};return n&&(i.loc=Fe(e.startLoc,e.endLoc)),r!=null&&(i.value=r),i}let p=e=>f(e,13);function m(e,t){return e.currentChar()===t?(e.next(),t):(d(M.EXPECTED_TOKEN,a(),0,t),``)}function h(e){let t=``;for(;e.currentPeek()===Re||e.currentPeek()===Be;)t+=e.currentPeek(),e.peek();return t}function g(e){let t=h(e);return e.skipToPeek(),t}function _(e){if(e===We)return!1;let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t===95}function v(e){if(e===We)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57}function y(e,t){let{currentType:n}=t;if(n!==2)return!1;h(e);let r=_(e.currentPeek());return e.resetPeek(),r}function b(e,t){let{currentType:n}=t;if(n!==2)return!1;h(e);let r=v(e.currentPeek()===`-`?e.peek():e.currentPeek());return e.resetPeek(),r}function x(e,t){let{currentType:n}=t;if(n!==2)return!1;h(e);let r=e.currentPeek()===Ge;return e.resetPeek(),r}function S(e,t){let{currentType:n}=t;if(n!==7)return!1;h(e);let r=e.currentPeek()===`.`;return e.resetPeek(),r}function C(e,t){let{currentType:n}=t;if(n!==8)return!1;h(e);let r=_(e.currentPeek());return e.resetPeek(),r}function w(e,t){let{currentType:n}=t;if(!(n===7||n===11))return!1;h(e);let r=e.currentPeek()===`:`;return e.resetPeek(),r}function T(e,t){let{currentType:n}=t;if(n!==9)return!1;let r=()=>{let t=e.currentPeek();return t===`{`?_(e.peek()):t===`@`||t===`|`||t===`:`||t===`.`||t===Re||!t?!1:t===Be?(e.peek(),r()):te(e,!1)},i=r();return e.resetPeek(),i}function ee(e){h(e);let t=e.currentPeek()===`|`;return e.resetPeek(),t}function te(e,t=!0){let n=(t=!1,r=``)=>{let i=e.currentPeek();return i===`{`||i===`@`||!i?t:i===`|`?!(r===Re||r===Be):i===Re?(e.peek(),n(!0,Re)):i===Be?(e.peek(),n(!0,Be)):!0},r=n();return t&&e.resetPeek(),r}function E(e,t){let n=e.currentChar();return n===We?We:t(n)?(e.next(),n):null}function ne(e){let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||t===95||t===36}function re(e){return E(e,ne)}function ie(e){let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||t===95||t===36||t===45}function ae(e){return E(e,ie)}function D(e){let t=e.charCodeAt(0);return t>=48&&t<=57}function oe(e){return E(e,D)}function se(e){let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function ce(e){return E(e,se)}function le(e){let t=``,n=``;for(;t=oe(e);)n+=t;return n}function ue(e){let t=``;for(;;){let n=e.currentChar();if(n===`{`||n===`}`||n===`@`||n===`|`||!n)break;if(n===Re||n===Be)if(te(e))t+=n,e.next();else if(ee(e))break;else t+=n,e.next();else t+=n,e.next()}return t}function de(e){g(e);let t=``,n=``;for(;t=ae(e);)n+=t;let r=e.currentChar();if(r&&r!==`}`&&r!==We&&r!==Re&&r!==Be&&r!==` `){let t=_e(e);return d(M.INVALID_TOKEN_IN_PLACEHOLDER,a(),0,n+t),n+t}return e.currentChar()===We&&d(M.UNTERMINATED_CLOSING_BRACE,a(),0),n}function fe(e){g(e);let t=``;return e.currentChar()===`-`?(e.next(),t+=`-${le(e)}`):t+=le(e),e.currentChar()===We&&d(M.UNTERMINATED_CLOSING_BRACE,a(),0),t}function pe(e){return e!==Ge&&e!==Be}function me(e){g(e),m(e,`'`);let t=``,n=``;for(;t=E(e,pe);)t===`\\`?n+=he(e):n+=t;let r=e.currentChar();return r===Be||r===We?(d(M.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,a(),0),r===Be&&(e.next(),m(e,`'`)),n):(m(e,`'`),n)}function he(e){let t=e.currentChar();switch(t){case`\\`:case`'`:return e.next(),`\\${t}`;case`u`:return ge(e,t,4);case`U`:return ge(e,t,6);default:return d(M.UNKNOWN_ESCAPE_SEQUENCE,a(),0,t),``}}function ge(e,t,n){m(e,t);let r=``;for(let i=0;i<n;i++){let n=ce(e);if(!n){d(M.INVALID_UNICODE_ESCAPE_SEQUENCE,a(),0,`\\${t}${r}${e.currentChar()}`);break}r+=n}return`\\${t}${r}`}function O(e){return e!==`{`&&e!==`}`&&e!==Re&&e!==Be}function _e(e){g(e);let t=``,n=``;for(;t=E(e,O);)n+=t;return n}function ve(e){let t=``,n=``;for(;t=re(e);)n+=t;return n}function ye(e){let t=n=>{let r=e.currentChar();return r===`{`||r===`@`||r===`|`||r===`(`||r===`)`||!r||r===Re?n:(n+=r,e.next(),t(n))};return t(``)}function be(e){g(e);let t=m(e,`|`);return g(e),t}function xe(e,t){let n=null;switch(e.currentChar()){case`{`:return t.braceNest>=1&&d(M.NOT_ALLOW_NEST_PLACEHOLDER,a(),0),e.next(),n=f(t,2,`{`),g(e),t.braceNest++,n;case`}`:return t.braceNest>0&&t.currentType===2&&d(M.EMPTY_PLACEHOLDER,a(),0),e.next(),n=f(t,3,`}`),t.braceNest--,t.braceNest>0&&g(e),t.inLinked&&t.braceNest===0&&(t.inLinked=!1),n;case`@`:return t.braceNest>0&&d(M.UNTERMINATED_CLOSING_BRACE,a(),0),n=Se(e,t)||p(t),t.braceNest=0,n;default:{let r=!0,i=!0,o=!0;if(ee(e))return t.braceNest>0&&d(M.UNTERMINATED_CLOSING_BRACE,a(),0),n=f(t,1,be(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(t.currentType===4||t.currentType===5||t.currentType===6))return d(M.UNTERMINATED_CLOSING_BRACE,a(),0),t.braceNest=0,Ce(e,t);if(r=y(e,t))return n=f(t,4,de(e)),g(e),n;if(i=b(e,t))return n=f(t,5,fe(e)),g(e),n;if(o=x(e,t))return n=f(t,6,me(e)),g(e),n;if(!r&&!i&&!o)return n=f(t,12,_e(e)),d(M.INVALID_TOKEN_IN_PLACEHOLDER,a(),0,n.value),g(e),n;break}}return n}function Se(e,t){let{currentType:n}=t,r=null,i=e.currentChar();switch((n===7||n===8||n===11||n===9)&&(i===Be||i===Re)&&d(M.INVALID_LINKED_FORMAT,a(),0),i){case`@`:return e.next(),r=f(t,7,`@`),t.inLinked=!0,r;case`.`:return g(e),e.next(),f(t,8,`.`);case`:`:return g(e),e.next(),f(t,9,`:`);default:return ee(e)?(r=f(t,1,be(e)),t.braceNest=0,t.inLinked=!1,r):S(e,t)||w(e,t)?(g(e),Se(e,t)):C(e,t)?(g(e),f(t,11,ve(e))):T(e,t)?(g(e),i===`{`?xe(e,t)||r:f(t,10,ye(e))):(n===7&&d(M.INVALID_LINKED_FORMAT,a(),0),t.braceNest=0,t.inLinked=!1,Ce(e,t))}}function Ce(e,t){let n={type:13};if(t.braceNest>0)return xe(e,t)||p(t);if(t.inLinked)return Se(e,t)||p(t);switch(e.currentChar()){case`{`:return xe(e,t)||p(t);case`}`:return d(M.UNBALANCED_CLOSING_BRACE,a(),0),e.next(),f(t,3,`}`);case`@`:return Se(e,t)||p(t);default:if(ee(e))return n=f(t,1,be(e)),t.braceNest=0,t.inLinked=!1,n;if(te(e))return f(t,0,ue(e));break}return n}function we(){let{currentType:e,offset:t,startLoc:n,endLoc:o}=c;return c.lastType=e,c.lastOffset=t,c.lastStartLoc=n,c.lastEndLoc=o,c.offset=i(),c.startLoc=a(),r.currentChar()===We?f(c,13):Ce(r,c)}return{nextToken:we,currentOffset:i,currentPosition:a,context:l}}var Je=`parser`,Ye=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function Xe(e,t,n){switch(e){case`\\\\`:return`\\`;case`\\'`:return`'`;default:{let e=parseInt(t||n,16);return e<=55295||e>=57344?String.fromCodePoint(e):`�`}}}function Ze(e={}){let t=e.location!==!1,{onError:n}=e;function r(e,r,i,a,...o){let s=e.currentPosition();s.offset+=a,s.column+=a,n&&n(Ie(r,t?Fe(i,s):null,{domain:Je,args:o}))}function i(e,n,r){let i={type:e};return t&&(i.start=n,i.end=n,i.loc={start:r,end:r}),i}function a(e,n,r,i){t&&(e.end=n,e.loc&&(e.loc.end=r))}function o(e,t){let n=e.context(),r=i(3,n.offset,n.startLoc);return r.value=t,a(r,e.currentOffset(),e.currentPosition()),r}function s(e,t){let{lastOffset:n,lastStartLoc:r}=e.context(),o=i(5,n,r);return o.index=parseInt(t,10),e.nextToken(),a(o,e.currentOffset(),e.currentPosition()),o}function c(e,t){let{lastOffset:n,lastStartLoc:r}=e.context(),o=i(4,n,r);return o.key=t,e.nextToken(),a(o,e.currentOffset(),e.currentPosition()),o}function l(e,t){let{lastOffset:n,lastStartLoc:r}=e.context(),o=i(9,n,r);return o.value=t.replace(Ye,Xe),e.nextToken(),a(o,e.currentOffset(),e.currentPosition()),o}function u(e){let t=e.nextToken(),n=e.context(),{lastOffset:o,lastStartLoc:s}=n,c=i(8,o,s);return t.type===11?(t.value??r(e,M.UNEXPECTED_LEXICAL_ANALYSIS,n.lastStartLoc,0,Qe(t)),c.value=t.value||``,a(c,e.currentOffset(),e.currentPosition()),{node:c}):(r(e,M.UNEXPECTED_EMPTY_LINKED_MODIFIER,n.lastStartLoc,0),c.value=``,a(c,o,s),{nextConsumeToken:t,node:c})}function d(e,t){let n=e.context(),r=i(7,n.offset,n.startLoc);return r.value=t,a(r,e.currentOffset(),e.currentPosition()),r}function f(e){let t=e.context(),n=i(6,t.offset,t.startLoc),o=e.nextToken();if(o.type===8){let t=u(e);n.modifier=t.node,o=t.nextConsumeToken||e.nextToken()}switch(o.type!==9&&r(e,M.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Qe(o)),o=e.nextToken(),o.type===2&&(o=e.nextToken()),o.type){case 10:o.value??r(e,M.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Qe(o)),n.key=d(e,o.value||``);break;case 4:o.value??r(e,M.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Qe(o)),n.key=c(e,o.value||``);break;case 5:o.value??r(e,M.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Qe(o)),n.key=s(e,o.value||``);break;case 6:o.value??r(e,M.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Qe(o)),n.key=l(e,o.value||``);break;default:{r(e,M.UNEXPECTED_EMPTY_LINKED_KEY,t.lastStartLoc,0);let s=e.context(),c=i(7,s.offset,s.startLoc);return c.value=``,a(c,s.offset,s.startLoc),n.key=c,a(n,s.offset,s.startLoc),{nextConsumeToken:o,node:n}}}return a(n,e.currentOffset(),e.currentPosition()),{node:n}}function p(e){let t=e.context(),n=i(2,t.currentType===1?e.currentOffset():t.offset,t.currentType===1?t.endLoc:t.startLoc);n.items=[];let u=null;do{let i=u||e.nextToken();switch(u=null,i.type){case 0:i.value??r(e,M.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Qe(i)),n.items.push(o(e,i.value||``));break;case 5:i.value??r(e,M.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Qe(i)),n.items.push(s(e,i.value||``));break;case 4:i.value??r(e,M.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Qe(i)),n.items.push(c(e,i.value||``));break;case 6:i.value??r(e,M.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Qe(i)),n.items.push(l(e,i.value||``));break;case 7:{let t=f(e);n.items.push(t.node),u=t.nextConsumeToken||null;break}}}while(t.currentType!==13&&t.currentType!==1);return a(n,t.currentType===1?t.lastOffset:e.currentOffset(),t.currentType===1?t.lastEndLoc:e.currentPosition()),n}function m(e,t,n,o){let s=e.context(),c=o.items.length===0,l=i(1,t,n);l.cases=[],l.cases.push(o);do{let t=p(e);c||=t.items.length===0,l.cases.push(t)}while(s.currentType!==13);return c&&r(e,M.MUST_HAVE_MESSAGES_IN_PLURAL,n,0),a(l,e.currentOffset(),e.currentPosition()),l}function h(e){let t=e.context(),{offset:n,startLoc:r}=t,i=p(e);return t.currentType===13?i:m(e,n,r,i)}function g(n){let o=qe(n,he({},e)),s=o.context(),c=i(0,s.offset,s.startLoc);return t&&c.loc&&(c.loc.source=n),c.body=h(o),e.onCacheKey&&(c.cacheKey=e.onCacheKey(n)),s.currentType!==13&&r(o,M.UNEXPECTED_LEXICAL_ANALYSIS,s.lastStartLoc,0,n[s.offset]||``),a(c,o.currentOffset(),o.currentPosition()),c}return{parse:g}}function Qe(e){if(e.type===13)return`EOF`;let t=(e.value||``).replace(/\r?\n/gu,`\\n`);return t.length>10?t.slice(0,9)+`…`:t}function $e(e,t={}){let n={ast:e,helpers:new Set};return{context:()=>n,helper:e=>(n.helpers.add(e),e)}}function et(e,t){for(let n=0;n<e.length;n++)tt(e[n],t)}function tt(e,t){switch(e.type){case 1:et(e.cases,t),t.helper(`plural`);break;case 2:et(e.items,t);break;case 6:tt(e.key,t),t.helper(`linked`),t.helper(`type`);break;case 5:t.helper(`interpolate`),t.helper(`list`);break;case 4:t.helper(`interpolate`),t.helper(`named`);break}}function nt(e,t={}){let n=$e(e);n.helper(`normalize`),e.body&&tt(e.body,n);let r=n.context();e.helpers=Array.from(r.helpers)}function rt(e){let t=e.body;return t.type===2?it(t):t.cases.forEach(e=>it(e)),e}function it(e){if(e.items.length===1){let t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{let t=[];for(let n=0;n<e.items.length;n++){let r=e.items[n];if(!(r.type===3||r.type===9)||r.value==null)break;t.push(r.value)}if(t.length===e.items.length){e.static=je(t);for(let t=0;t<e.items.length;t++){let n=e.items[t];(n.type===3||n.type===9)&&delete n.value}}}}function at(e){switch(e.t=e.type,e.type){case 0:{let t=e;at(t.body),t.b=t.body,delete t.body;break}case 1:{let t=e,n=t.cases;for(let e=0;e<n.length;e++)at(n[e]);t.c=n,delete t.cases;break}case 2:{let t=e,n=t.items;for(let e=0;e<n.length;e++)at(n[e]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{let t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{let t=e;at(t.key),t.k=t.key,delete t.key,t.modifier&&(at(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{let t=e;t.i=t.index,delete t.index;break}case 4:{let t=e;t.k=t.key,delete t.key;break}default:}delete e.type}function ot(e,t){let{sourceMap:n,filename:r,breakLineCode:i,needIndent:a}=t,o=t.location!==!1,s={filename:r,code:``,column:1,line:1,offset:0,map:void 0,breakLineCode:i,needIndent:a,indentLevel:0};o&&e.loc&&(s.source=e.loc.source);let c=()=>s;function l(e,t){s.code+=e}function u(e,t=!0){let n=t?i:``;l(a?n+` `.repeat(e):n)}function d(e=!0){let t=++s.indentLevel;e&&u(t)}function f(e=!0){let t=--s.indentLevel;e&&u(t)}function p(){u(s.indentLevel)}return{context:c,push:l,indent:d,deindent:f,newline:p,helper:e=>`_${e}`,needIndent:()=>s.needIndent}}function st(e,t){let{helper:n}=e;e.push(`${n(`linked`)}(`),dt(e,t.key),t.modifier?(e.push(`, `),dt(e,t.modifier),e.push(`, _type`)):e.push(`, undefined, _type`),e.push(`)`)}function ct(e,t){let{helper:n,needIndent:r}=e;e.push(`${n(`normalize`)}([`),e.indent(r());let i=t.items.length;for(let n=0;n<i&&(dt(e,t.items[n]),n!==i-1);n++)e.push(`, `);e.deindent(r()),e.push(`])`)}function lt(e,t){let{helper:n,needIndent:r}=e;if(t.cases.length>1){e.push(`${n(`plural`)}([`),e.indent(r());let i=t.cases.length;for(let n=0;n<i&&(dt(e,t.cases[n]),n!==i-1);n++)e.push(`, `);e.deindent(r()),e.push(`])`)}}function ut(e,t){t.body?dt(e,t.body):e.push(`null`)}function dt(e,t){let{helper:n}=e;switch(t.type){case 0:ut(e,t);break;case 1:lt(e,t);break;case 2:ct(e,t);break;case 6:st(e,t);break;case 8:e.push(JSON.stringify(t.value),t);break;case 7:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n(`interpolate`)}(${n(`list`)}(${t.index}))`,t);break;case 4:e.push(`${n(`interpolate`)}(${n(`named`)}(${JSON.stringify(t.key)}))`,t);break;case 9:e.push(JSON.stringify(t.value),t);break;case 3:e.push(JSON.stringify(t.value),t);break;default:}}var ft=(e,t={})=>{let n=k(t.mode)?t.mode:`normal`,r=k(t.filename)?t.filename:`message.intl`,i=!!t.sourceMap,a=t.breakLineCode==null?n===`arrow`?`;`:`
3
+ `:t.breakLineCode,o=t.needIndent?t.needIndent:n!==`arrow`,s=e.helpers||[],c=ot(e,{mode:n,filename:r,sourceMap:i,breakLineCode:a,needIndent:o});c.push(n===`normal`?`function __msg__ (ctx) {`:`(ctx) => {`),c.indent(o),s.length>0&&(c.push(`const { ${je(s.map(e=>`${e}: _${e}`),`, `)} } = ctx`),c.newline()),c.push(`return `),dt(c,e),c.deindent(o),c.push(`}`),delete e.helpers;let{code:l,map:u}=c.context();return{ast:e,code:l,map:u?u.toJSON():void 0}};function pt(e,t={}){let n=he({},t),r=!!n.jit,i=!!n.minify,a=n.optimize==null?!0:n.optimize,o=Ze(n).parse(e);return r?(a&&rt(o),i&&at(o),{ast:o,code:``}):(nt(o,n),ft(o,n))}function mt(){typeof __INTLIFY_PROD_DEVTOOLS__!=`boolean`&&(ve().__INTLIFY_PROD_DEVTOOLS__=!1)}function ht(e){return A(e)&&Tt(e)===0&&(Ce(e,`b`)||Ce(e,`body`))}var gt=[`b`,`body`];function _t(e){return Mt(e,gt)}var vt=[`c`,`cases`];function yt(e){return Mt(e,vt,[])}var bt=[`s`,`static`];function xt(e){return Mt(e,bt)}var St=[`i`,`items`];function Ct(e){return Mt(e,St,[])}var wt=[`t`,`type`];function Tt(e){return Mt(e,wt)}var Et=[`v`,`value`];function Dt(e,t){let n=Mt(e,Et);if(n!=null)return n;throw Pt(t)}var Ot=[`m`,`modifier`];function kt(e){return Mt(e,Ot)}var At=[`k`,`key`];function jt(e){let t=Mt(e,At);if(t)return t;throw Pt(6)}function Mt(e,t,n){for(let n=0;n<t.length;n++){let r=t[n];if(Ce(e,r)&&e[r]!=null)return e[r]}return n}var Nt=[...gt,...vt,...bt,...St,...At,...Ot,...Et,...wt];function Pt(e){return Error(`unhandled node type: ${e}`)}function Ft(e){return t=>It(t,e)}function It(e,t){let n=_t(t);if(n==null)throw Pt(0);if(Tt(n)===1){let t=yt(n);return e.plural(t.reduce((t,n)=>[...t,Lt(e,n)],[]))}else return Lt(e,n)}function Lt(e,t){let n=xt(t);if(n!=null)return e.type===`text`?n:e.normalize([n]);{let n=Ct(t).reduce((t,n)=>[...t,Rt(e,n)],[]);return e.normalize(n)}}function Rt(e,t){let n=Tt(t);switch(n){case 3:return Dt(t,n);case 9:return Dt(t,n);case 4:{let r=t;if(Ce(r,`k`)&&r.k)return e.interpolate(e.named(r.k));if(Ce(r,`key`)&&r.key)return e.interpolate(e.named(r.key));throw Pt(n)}case 5:{let r=t;if(Ce(r,`i`)&&de(r.i))return e.interpolate(e.list(r.i));if(Ce(r,`index`)&&de(r.index))return e.interpolate(e.list(r.index));throw Pt(n)}case 6:{let n=t,r=kt(n),i=jt(n);return e.linked(Rt(e,i),r?Rt(e,r):void 0,e.type)}case 7:return Dt(t,n);case 8:return Dt(t,n);default:throw Error(`unhandled node on format message part: ${n}`)}}var zt=e=>e,Bt=O();function Vt(e,t={}){let n=!1,r=t.onError||Le;return t.onError=e=>{n=!0,r(e)},{...pt(e,t),detectError:n}}function Ht(e,t){if(k(e)){Ee(t.warnHtmlMessage)&&t.warnHtmlMessage;let n=(t.onCacheKey||zt)(e),r=Bt[n];if(r)return r;let{ast:i,detectError:a}=Vt(e,{...t,location:!1,jit:!0}),o=Ft(i);return a?o:Bt[n]=o}else{let t=e.cacheKey;return t?Bt[t]||(Bt[t]=Ft(e)):Ft(e)}}var Ut=null;function Wt(e){Ut=e}function Gt(e,t,n){Ut&&Ut.emit(`i18n:init`,{timestamp:Date.now(),i18n:e,version:t,meta:n})}var Kt=qt(`function:translate`);function qt(e){return t=>Ut&&Ut.emit(e,t)}var Jt={INVALID_ARGUMENT:17,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23};function Yt(e){return Ie(e,null,void 0)}Jt.INVALID_ARGUMENT,Jt.INVALID_DATE_ARGUMENT,Jt.INVALID_ISO_DATE_ARGUMENT,Jt.NOT_SUPPORT_NON_STRING_MESSAGE,Jt.NOT_SUPPORT_LOCALE_PROMISE_VALUE,Jt.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION,Jt.NOT_SUPPORT_LOCALE_TYPE;function Xt(e,t){return t.locale==null?Qt(e.locale):Qt(t.locale)}var Zt;function Qt(e){if(k(e))return e;if(Te(e)){if(e.resolvedOnce&&Zt!=null)return Zt;if(e.constructor.name===`Function`){let t=e();if(De(t))throw Yt(Jt.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Zt=t}else throw Yt(Jt.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Yt(Jt.NOT_SUPPORT_LOCALE_TYPE)}function $t(e,t,n){return[...new Set([n,...we(t)?t:A(t)?Object.keys(t):k(t)?[t]:[n]])]}function en(e,t,n){let r=k(n)?n:_n,i=e;i.__localeChainCache||=new Map;let a=i.__localeChainCache.get(r);if(!a){a=[];let e=[n];for(;we(e);)e=tn(a,e,t);let o=we(t)||!j(t)?t:t.default?t.default:null;e=k(o)?[o]:o,we(e)&&tn(a,e,!1),i.__localeChainCache.set(r,a)}return a}function tn(e,t,n){let r=!0;for(let i=0;i<t.length&&Ee(r);i++){let a=t[i];k(a)&&(r=nn(e,t[i],n))}return r}function nn(e,t,n){let r,i=t.split(`-`);do r=rn(e,i.join(`-`),n),i.splice(-1,1);while(i.length&&r===!0);return r}function rn(e,t,n){let r=!1;if(!e.includes(t)&&(r=!0,t)){r=t[t.length-1]!==`!`;let i=t.replace(/!/g,``);e.push(i),(we(n)||j(n))&&n[i]&&(r=n[i])}return r}var an=[];an[0]={w:[0],i:[3,0],"[":[4],o:[7]},an[1]={w:[1],".":[2],"[":[4],o:[7]},an[2]={w:[2],i:[3,0],0:[3,0]},an[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},an[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},an[5]={"'":[4,0],o:8,l:[5,0]},an[6]={'"':[4,0],o:8,l:[6,0]};var on=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function sn(e){return on.test(e)}function cn(e){let t=e.charCodeAt(0);return t===e.charCodeAt(e.length-1)&&(t===34||t===39)?e.slice(1,-1):e}function ln(e){if(e==null)return`o`;switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return`i`;case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return`w`}return`i`}function un(e){let t=e.trim();return e.charAt(0)===`0`&&isNaN(parseInt(e))?!1:sn(t)?cn(t):`*`+t}function dn(e){let t=[],n=-1,r=0,i=0,a,o,s,c,l,u,d,f=[];f[0]=()=>{o===void 0?o=s:o+=s},f[1]=()=>{o!==void 0&&(t.push(o),o=void 0)},f[2]=()=>{f[0](),i++},f[3]=()=>{if(i>0)i--,r=4,f[0]();else{if(i=0,o===void 0||(o=un(o),o===!1))return!1;f[1]()}};function p(){let t=e[n+1];if(r===5&&t===`'`||r===6&&t===`"`)return n++,s=`\\`+t,f[0](),!0}for(;r!==null;)if(n++,a=e[n],!(a===`\\`&&p())){if(c=ln(a),d=an[r],l=d[c]||d.l||8,l===8||(r=l[0],l[1]!==void 0&&(u=f[l[1]],u&&(s=a,u()===!1))))return;if(r===7)return t}}var fn=new Map;function pn(e,t){return A(e)?e[t]:null}function mn(e,t){if(!A(e))return null;let n=fn.get(t);if(n||(n=dn(t),n&&fn.set(t,n)),!n)return null;let r=n.length,i=e,a=0;for(;a<r;){let e=n[a];if(Nt.includes(e)&&ht(i))return null;let t=i[e];if(t===void 0||Te(i))return null;i=t,a++}return i}var hn={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7};hn.NOT_FOUND_KEY,hn.FALLBACK_TO_TRANSLATE,hn.CANNOT_FORMAT_NUMBER,hn.FALLBACK_TO_NUMBER_FORMAT,hn.CANNOT_FORMAT_DATE,hn.FALLBACK_TO_DATE_FORMAT,hn.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER;var gn=`11.1.12`,_n=`en-US`,vn=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function yn(){return{upper:(e,t)=>t===`text`&&k(e)?e.toUpperCase():t===`vnode`&&A(e)&&`__v_isVNode`in e?e.children.toUpperCase():e,lower:(e,t)=>t===`text`&&k(e)?e.toLowerCase():t===`vnode`&&A(e)&&`__v_isVNode`in e?e.children.toLowerCase():e,capitalize:(e,t)=>t===`text`&&k(e)?vn(e):t===`vnode`&&A(e)&&`__v_isVNode`in e?vn(e.children):e}}var bn;function xn(e){bn=e}var Sn;function Cn(e){Sn=e}var wn;function Tn(e){wn=e}var En=null,Dn=()=>En,On=null,kn=e=>{On=e},An=()=>On,jn=0;function Mn(e={}){let t=Te(e.onWarn)?e.onWarn:oe,n=k(e.version)?e.version:gn,r=k(e.locale)||Te(e.locale)?e.locale:_n,i=Te(r)?_n:r,a=we(e.fallbackLocale)||j(e.fallbackLocale)||k(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:i,o=j(e.messages)?e.messages:Nn(i),s=j(e.datetimeFormats)?e.datetimeFormats:Nn(i),c=j(e.numberFormats)?e.numberFormats:Nn(i),l=he(O(),e.modifiers,yn()),u=e.pluralRules||O(),d=Te(e.missing)?e.missing:null,f=Ee(e.missingWarn)||pe(e.missingWarn)?e.missingWarn:!0,p=Ee(e.fallbackWarn)||pe(e.fallbackWarn)?e.fallbackWarn:!0,m=!!e.fallbackFormat,h=!!e.unresolving,g=Te(e.postTranslation)?e.postTranslation:null,_=j(e.processor)?e.processor:null,v=Ee(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter,b=Te(e.messageCompiler)?e.messageCompiler:bn,x=Te(e.messageResolver)?e.messageResolver:Sn||pn,S=Te(e.localeFallbacker)?e.localeFallbacker:wn||$t,C=A(e.fallbackContext)?e.fallbackContext:void 0,w=e,T=A(w.__datetimeFormatters)?w.__datetimeFormatters:new Map,ee=A(w.__numberFormatters)?w.__numberFormatters:new Map,te=A(w.__meta)?w.__meta:{};jn++;let E={version:n,cid:jn,locale:r,fallbackLocale:a,messages:o,modifiers:l,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:p,fallbackFormat:m,unresolving:h,postTranslation:g,processor:_,warnHtmlMessage:v,escapeParameter:y,messageCompiler:b,messageResolver:x,localeFallbacker:S,fallbackContext:C,onWarn:t,__meta:te};return E.datetimeFormats=s,E.numberFormats=c,E.__datetimeFormatters=T,E.__numberFormatters=ee,__INTLIFY_PROD_DEVTOOLS__&&Gt(E,n,te),E}var Nn=e=>({[e]:O()});function Pn(e,t,n,r,i){let{missing:a,onWarn:o}=e;if(a!==null){let r=a(e,n,t,i);return k(r)?r:t}else return t}function Fn(e,t,n){let r=e;r.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function In(e,t){return e===t?!1:e.split(`-`)[0]===t.split(`-`)[0]}function Ln(e,t){let n=t.indexOf(e);if(n===-1)return!1;for(let r=n+1;r<t.length;r++)if(In(e,t[r]))return!0;return!1}var Rn=typeof Intl<`u`;Rn&&Intl.DateTimeFormat,Rn&&Intl.NumberFormat;function zn(e,...t){let{datetimeFormats:n,unresolving:r,fallbackLocale:i,onWarn:a,localeFallbacker:o}=e,{__datetimeFormatters:s}=e,[c,l,u,d]=Vn(...t),f=Ee(u.missingWarn)?u.missingWarn:e.missingWarn;Ee(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;let p=!!u.part,m=Xt(e,u),h=o(e,i,m);if(!k(c)||c===``)return new Intl.DateTimeFormat(m,d).format(l);let g={},_,v=null;for(let t=0;t<h.length&&(_=h[t],g=n[_]||{},v=g[c],!j(v));t++)Pn(e,c,_,f,`datetime format`);if(!j(v)||!k(_))return r?-1:c;let y=`${_}__${c}`;me(d)||(y=`${y}__${JSON.stringify(d)}`);let b=s.get(y);return b||(b=new Intl.DateTimeFormat(_,he({},v,d)),s.set(y,b)),p?b.formatToParts(l):b.format(l)}var Bn=[`localeMatcher`,`weekday`,`era`,`year`,`month`,`day`,`hour`,`minute`,`second`,`timeZoneName`,`formatMatcher`,`hour12`,`timeZone`,`dateStyle`,`timeStyle`,`calendar`,`dayPeriod`,`numberingSystem`,`hourCycle`,`fractionalSecondDigits`];function Vn(...e){let[t,n,r,i]=e,a=O(),o=O(),s;if(k(t)){let e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Yt(Jt.INVALID_ISO_DATE_ARGUMENT);let n=e[3]?e[3].trim().startsWith(`T`)?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();s=new Date(n);try{s.toISOString()}catch{throw Yt(Jt.INVALID_ISO_DATE_ARGUMENT)}}else if(fe(t)){if(isNaN(t.getTime()))throw Yt(Jt.INVALID_DATE_ARGUMENT);s=t}else if(de(t))s=t;else throw Yt(Jt.INVALID_ARGUMENT);return k(n)?a.key=n:j(n)&&Object.keys(n).forEach(e=>{Bn.includes(e)?o[e]=n[e]:a[e]=n[e]}),k(r)?a.locale=r:j(r)&&(o=r),j(i)&&(o=i),[a.key||``,s,a,o]}function Hn(e,t,n){let r=e;for(let e in n){let n=`${t}__${e}`;r.__datetimeFormatters.has(n)&&r.__datetimeFormatters.delete(n)}}function Un(e,...t){let{numberFormats:n,unresolving:r,fallbackLocale:i,onWarn:a,localeFallbacker:o}=e,{__numberFormatters:s}=e,[c,l,u,d]=Gn(...t),f=Ee(u.missingWarn)?u.missingWarn:e.missingWarn;Ee(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;let p=!!u.part,m=Xt(e,u),h=o(e,i,m);if(!k(c)||c===``)return new Intl.NumberFormat(m,d).format(l);let g={},_,v=null;for(let t=0;t<h.length&&(_=h[t],g=n[_]||{},v=g[c],!j(v));t++)Pn(e,c,_,f,`number format`);if(!j(v)||!k(_))return r?-1:c;let y=`${_}__${c}`;me(d)||(y=`${y}__${JSON.stringify(d)}`);let b=s.get(y);return b||(b=new Intl.NumberFormat(_,he({},v,d)),s.set(y,b)),p?b.formatToParts(l):b.format(l)}var Wn=[`localeMatcher`,`style`,`currency`,`currencyDisplay`,`currencySign`,`useGrouping`,`minimumIntegerDigits`,`minimumFractionDigits`,`maximumFractionDigits`,`minimumSignificantDigits`,`maximumSignificantDigits`,`compactDisplay`,`notation`,`signDisplay`,`unit`,`unitDisplay`,`roundingMode`,`roundingPriority`,`roundingIncrement`,`trailingZeroDisplay`];function Gn(...e){let[t,n,r,i]=e,a=O(),o=O();if(!de(t))throw Yt(Jt.INVALID_ARGUMENT);let s=t;return k(n)?a.key=n:j(n)&&Object.keys(n).forEach(e=>{Wn.includes(e)?o[e]=n[e]:a[e]=n[e]}),k(r)?a.locale=r:j(r)&&(o=r),j(i)&&(o=i),[a.key||``,s,a,o]}function Kn(e,t,n){let r=e;for(let e in n){let n=`${t}__${e}`;r.__numberFormatters.has(n)&&r.__numberFormatters.delete(n)}}var qn=e=>e,Jn=e=>``,Yn=`text`,Xn=e=>e.length===0?``:je(e),Zn=Ae;function Qn(e,t){return e=Math.abs(e),t===2?e?e>1?1:0:1:e?Math.min(e,2):0}function $n(e){let t=de(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(de(e.named.count)||de(e.named.n))?de(e.named.count)?e.named.count:de(e.named.n)?e.named.n:t:t}function er(e,t){t.count||=e,t.n||=e}function tr(e={}){let t=e.locale,n=$n(e),r=A(e.pluralRules)&&k(t)&&Te(e.pluralRules[t])?e.pluralRules[t]:Qn,i=A(e.pluralRules)&&k(t)&&Te(e.pluralRules[t])?Qn:void 0,a=e=>e[r(n,e.length,i)],o=e.list||[],s=e=>o[e],c=e.named||O();de(e.pluralIndex)&&er(n,c);let l=e=>c[e];function u(t,n){return(Te(e.messages)?e.messages(t,!!n):A(e.messages)?e.messages[t]:!1)||(e.parent?e.parent.message(t):Jn)}let d=t=>e.modifiers?e.modifiers[t]:qn,f=j(e.processor)&&Te(e.processor.normalize)?e.processor.normalize:Xn,p=j(e.processor)&&Te(e.processor.interpolate)?e.processor.interpolate:Zn,m={list:s,named:l,plural:a,linked:(e,...t)=>{let[n,r]=t,i=`text`,a=``;t.length===1?A(n)?(a=n.modifier||a,i=n.type||i):k(n)&&(a=n||a):t.length===2&&(k(n)&&(a=n||a),k(r)&&(i=r||i));let o=u(e,!0)(m),s=i===`vnode`&&we(o)&&a?o[0]:o;return a?d(a)(s,i):s},message:u,type:j(e.processor)&&k(e.processor.type)?e.processor.type:Yn,interpolate:p,normalize:f,values:he(O(),o,c)};return m}var nr=()=>``,rr=e=>Te(e);function ir(e,...t){let{fallbackFormat:n,postTranslation:r,unresolving:i,messageCompiler:a,fallbackLocale:o,messages:s}=e,[c,l]=lr(...t),u=Ee(l.missingWarn)?l.missingWarn:e.missingWarn,d=Ee(l.fallbackWarn)?l.fallbackWarn:e.fallbackWarn,f=Ee(l.escapeParameter)?l.escapeParameter:e.escapeParameter,p=!!l.resolvedMessage,m=k(l.default)||Ee(l.default)?Ee(l.default)?a?c:()=>c:l.default:n?a?c:()=>c:null,h=n||m!=null&&(k(m)||Te(m)),g=Xt(e,l);f&&ar(l);let[_,v,y]=p?[c,g,s[g]||O()]:or(e,c,g,o,d,u),b=_,x=c;if(!p&&!(k(b)||ht(b)||rr(b))&&h&&(b=m,x=b),!p&&(!(k(b)||ht(b)||rr(b))||!k(v)))return i?-1:c;let S=!1,C=rr(b)?b:sr(e,c,v,b,x,()=>{S=!0});if(S)return b;let w=cr(e,C,tr(dr(e,v,y,l))),T=r?r(w,c):w;if(f&&k(T)&&(T=xe(T)),__INTLIFY_PROD_DEVTOOLS__){let t={timestamp:Date.now(),key:k(c)?c:rr(b)?b.key:``,locale:v||(rr(b)?b.locale:``),format:k(b)?b:rr(b)?b.source:``,message:T};t.meta=he({},e.__meta,Dn()||{}),Kt(t)}return T}function ar(e){we(e.list)?e.list=e.list.map(e=>k(e)?ye(e):e):A(e.named)&&Object.keys(e.named).forEach(t=>{k(e.named[t])&&(e.named[t]=ye(e.named[t]))})}function or(e,t,n,r,i,a){let{messages:o,onWarn:s,messageResolver:c,localeFallbacker:l}=e,u=l(e,r,n),d=O(),f,p=null;for(let n=0;n<u.length&&(f=u[n],d=o[f]||O(),(p=c(d,t))===null&&(p=d[t]),!(k(p)||ht(p)||rr(p)));n++)if(!Ln(f,u)){let n=Pn(e,t,f,a,`translate`);n!==t&&(p=n)}return[p,f,d]}function sr(e,t,n,r,i,a){let{messageCompiler:o,warnHtmlMessage:s}=e;if(rr(r)){let e=r;return e.locale=e.locale||n,e.key=e.key||t,e}if(o==null){let e=(()=>r);return e.locale=n,e.key=t,e}let c=o(r,ur(e,n,i,r,s,a));return c.locale=n,c.key=t,c.source=r,c}function cr(e,t,n){return t(n)}function lr(...e){let[t,n,r]=e,i=O();if(!k(t)&&!de(t)&&!rr(t)&&!ht(t))throw Yt(Jt.INVALID_ARGUMENT);let a=de(t)?String(t):(rr(t),t);return de(n)?i.plural=n:k(n)?i.default=n:j(n)&&!me(n)?i.named=n:we(n)&&(i.list=n),de(r)?i.plural=r:k(r)?i.default=r:j(r)&&he(i,r),[a,i]}function ur(e,t,n,r,i,a){return{locale:t,key:n,warnHtmlMessage:i,onError:e=>{throw a&&a(e),e},onCacheKey:e=>le(t,n,e)}}function dr(e,t,n,r){let{modifiers:i,pluralRules:a,messageResolver:o,fallbackLocale:s,fallbackWarn:c,missingWarn:l,fallbackContext:u}=e,d={locale:t,modifiers:i,pluralRules:a,messages:(r,i)=>{let a=o(n,r);if(a==null&&(u||i)){let[,,n]=or(u||e,r,t,s,c,l);a=o(n,r)}if(k(a)||ht(a)){let n=!1,i=sr(e,r,t,a,r,()=>{n=!0});return n?nr:i}else if(rr(a))return a;else return nr}};return e.processor&&(d.processor=e.processor),r.list&&(d.list=r.list),r.named&&(d.named=r.named),de(r.plural)&&(d.pluralIndex=r.plural),d}mt();var fr=`11.1.12`;function pr(){typeof __INTLIFY_PROD_DEVTOOLS__!=`boolean`&&(ve().__INTLIFY_PROD_DEVTOOLS__=!1)}var mr={UNEXPECTED_RETURN_TYPE:24,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function hr(e,...t){return Ie(e,null,void 0)}mr.UNEXPECTED_RETURN_TYPE,mr.INVALID_ARGUMENT,mr.MUST_BE_CALL_SETUP_TOP,mr.NOT_INSTALLED,mr.UNEXPECTED_ERROR,mr.REQUIRED_VALUE,mr.INVALID_VALUE,mr.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN,mr.NOT_INSTALLED_WITH_PROVIDE,mr.NOT_COMPATIBLE_LEGACY_VUE_I18N,mr.NOT_AVAILABLE_COMPOSITION_IN_LEGACY;var gr=ce(`__translateVNode`),_r=ce(`__datetimeParts`),vr=ce(`__numberParts`),yr=ce(`__setPluralRules`);ce(`__intlifyMeta`);var br=ce(`__injectWithOption`),xr=ce(`__dispose`),Sr={FALLBACK_TO_ROOT:8,NOT_FOUND_PARENT_SCOPE:9,IGNORE_OBJ_FLATTEN:10,DEPRECATE_LEGACY_MODE:11,DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE:12,DUPLICATE_USE_I18N_CALLING:13};Sr.FALLBACK_TO_ROOT,Sr.NOT_FOUND_PARENT_SCOPE,Sr.IGNORE_OBJ_FLATTEN,Sr.DEPRECATE_LEGACY_MODE,Sr.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE,Sr.DUPLICATE_USE_I18N_CALLING;function Cr(e){if(!A(e)||ht(e))return e;for(let t in e)if(Ce(e,t))if(!t.includes(`.`))A(e[t])&&Cr(e[t]);else{let n=t.split(`.`),r=n.length-1,i=e,a=!1;for(let e=0;e<r;e++){if(n[e]===`__proto__`)throw Error(`unsafe key: ${n[e]}`);if(n[e]in i||(i[n[e]]=O()),!A(i[n[e]])){a=!0;break}i=i[n[e]]}if(a||(ht(i)?Nt.includes(n[r])||delete e[t]:(i[n[r]]=e[t],delete e[t])),!ht(i)){let e=i[n[r]];A(e)&&Cr(e)}}return e}function wr(e,t){let{messages:n,__i18n:r,messageResolver:i,flatJson:a}=t,o=j(n)?n:we(r)?O():{[e]:O()};if(we(r)&&r.forEach(e=>{if(`locale`in e&&`resource`in e){let{locale:t,resource:n}=e;t?(o[t]=o[t]||O(),Ne(n,o[t])):Ne(n,o)}else k(e)&&Ne(JSON.parse(e),o)}),i==null&&a)for(let e in o)Ce(o,e)&&Cr(o[e]);return o}function Tr(e){return e.type}function Er(e,t,n){let r=A(t.messages)?t.messages:O();`__i18nGlobal`in n&&(r=wr(e.locale.value,{messages:r,__i18n:n.__i18nGlobal}));let i=Object.keys(r);if(i.length&&i.forEach(t=>{e.mergeLocaleMessage(t,r[t])}),A(t.datetimeFormats)){let n=Object.keys(t.datetimeFormats);n.length&&n.forEach(n=>{e.mergeDateTimeFormat(n,t.datetimeFormats[n])})}if(A(t.numberFormats)){let n=Object.keys(t.numberFormats);n.length&&n.forEach(n=>{e.mergeNumberFormat(n,t.numberFormats[n])})}}function Dr(e){return(0,t.createVNode)(t.Text,null,e,0)}var Or=()=>[],kr=()=>!1,Ar=0;function jr(e){return((n,r,i,a)=>e(r,i,(0,t.getCurrentInstance)()||void 0,a))}function Mr(e={}){let{__root:n,__injectWithOption:r}=e,i=n===void 0,a=e.flatJson,o=se?t.ref:t.shallowRef,s=Ee(e.inheritLocale)?e.inheritLocale:!0,c=o(n&&s?n.locale.value:k(e.locale)?e.locale:_n),l=o(n&&s?n.fallbackLocale.value:k(e.fallbackLocale)||we(e.fallbackLocale)||j(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:c.value),u=o(wr(c.value,e)),d=o(j(e.datetimeFormats)?e.datetimeFormats:{[c.value]:{}}),f=o(j(e.numberFormats)?e.numberFormats:{[c.value]:{}}),p=n?n.missingWarn:Ee(e.missingWarn)||pe(e.missingWarn)?e.missingWarn:!0,m=n?n.fallbackWarn:Ee(e.fallbackWarn)||pe(e.fallbackWarn)?e.fallbackWarn:!0,h=n?n.fallbackRoot:Ee(e.fallbackRoot)?e.fallbackRoot:!0,g=!!e.fallbackFormat,_=Te(e.missing)?e.missing:null,v=Te(e.missing)?jr(e.missing):null,y=Te(e.postTranslation)?e.postTranslation:null,b=n?n.warnHtmlMessage:Ee(e.warnHtmlMessage)?e.warnHtmlMessage:!0,x=!!e.escapeParameter,S=n?n.modifiers:j(e.modifiers)?e.modifiers:{},C=e.pluralRules||n&&n.pluralRules,w;w=(()=>{i&&kn(null);let t={version:fr,locale:c.value,fallbackLocale:l.value,messages:u.value,modifiers:S,pluralRules:C,missing:v===null?void 0:v,missingWarn:p,fallbackWarn:m,fallbackFormat:g,unresolving:!0,postTranslation:y===null?void 0:y,warnHtmlMessage:b,escapeParameter:x,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:`vue`}};t.datetimeFormats=d.value,t.numberFormats=f.value,t.__datetimeFormatters=j(w)?w.__datetimeFormatters:void 0,t.__numberFormatters=j(w)?w.__numberFormatters:void 0;let n=Mn(t);return i&&kn(n),n})(),Fn(w,c.value,l.value);function T(){return[c.value,l.value,u.value,d.value,f.value]}let ee=(0,t.computed)({get:()=>c.value,set:e=>{w.locale=e,c.value=e}}),te=(0,t.computed)({get:()=>l.value,set:e=>{w.fallbackLocale=e,l.value=e,Fn(w,c.value,e)}}),E=(0,t.computed)(()=>u.value),ne=(0,t.computed)(()=>d.value),re=(0,t.computed)(()=>f.value);function ie(){return Te(y)?y:null}function ae(e){y=e,w.postTranslation=e}function D(){return _}function oe(e){e!==null&&(v=jr(e)),_=e,w.missing=v}let ce=(e,t,r,a,o,s)=>{T();let c;try{__INTLIFY_PROD_DEVTOOLS__,i||(w.fallbackContext=n?An():void 0),c=e(w)}finally{__INTLIFY_PROD_DEVTOOLS__,i||(w.fallbackContext=void 0)}if(r!==`translate exists`&&de(c)&&c===-1||r===`translate exists`&&!c){let[e,r]=t();return n&&h?a(n):o(e)}else if(s(c))return c;else throw hr(mr.UNEXPECTED_RETURN_TYPE)};function le(...e){return ce(t=>Reflect.apply(ir,null,[t,...e]),()=>lr(...e),`translate`,t=>Reflect.apply(t.t,t,[...e]),e=>e,e=>k(e))}function ue(...e){let[t,n,r]=e;if(r&&!A(r))throw hr(mr.INVALID_ARGUMENT);return le(t,n,he({resolvedMessage:!0},r||{}))}function fe(...e){return ce(t=>Reflect.apply(zn,null,[t,...e]),()=>Vn(...e),`datetime format`,t=>Reflect.apply(t.d,t,[...e]),()=>``,e=>k(e)||we(e))}function me(...e){return ce(t=>Reflect.apply(Un,null,[t,...e]),()=>Gn(...e),`number format`,t=>Reflect.apply(t.n,t,[...e]),()=>``,e=>k(e)||we(e))}function ge(e){return e.map(e=>k(e)||de(e)||Ee(e)?Dr(String(e)):e)}let O={normalize:ge,interpolate:e=>e,type:`vnode`};function _e(...e){return ce(t=>{let n,r=t;try{r.processor=O,n=Reflect.apply(ir,null,[r,...e])}finally{r.processor=null}return n},()=>lr(...e),`translate`,t=>t[gr](...e),e=>[Dr(e)],e=>we(e))}function ve(...e){return ce(t=>Reflect.apply(Un,null,[t,...e]),()=>Gn(...e),`number format`,t=>t[vr](...e),Or,e=>k(e)||we(e))}function ye(...e){return ce(t=>Reflect.apply(zn,null,[t,...e]),()=>Vn(...e),`datetime format`,t=>t[_r](...e),Or,e=>k(e)||we(e))}function be(e){C=e,w.pluralRules=C}function xe(e,t){return ce(()=>{if(!e)return!1;let n=Oe(k(t)?t:c.value),r=w.messageResolver(n,e);return ht(r)||rr(r)||k(r)},()=>[e],`translate exists`,n=>Reflect.apply(n.te,n,[e,t]),kr,e=>Ee(e))}function Se(e){let t=null,n=en(w,l.value,c.value);for(let r=0;r<n.length;r++){let i=u.value[n[r]]||{},a=w.messageResolver(i,e);if(a!=null){t=a;break}}return t}function De(e){return Se(e)??(n&&n.tm(e)||{})}function Oe(e){return u.value[e]||{}}function ke(e,t){if(a){let n={[e]:t};for(let e in n)Ce(n,e)&&Cr(n[e]);t=n[e]}u.value[e]=t,w.messages=u.value}function Ae(e,t){u.value[e]=u.value[e]||{};let n={[e]:t};if(a)for(let e in n)Ce(n,e)&&Cr(n[e]);t=n[e],Ne(t,u.value[e]),w.messages=u.value}function je(e){return d.value[e]||{}}function Me(e,t){d.value[e]=t,w.datetimeFormats=d.value,Hn(w,e,t)}function Pe(e,t){d.value[e]=he(d.value[e]||{},t),w.datetimeFormats=d.value,Hn(w,e,t)}function Fe(e){return f.value[e]||{}}function M(e,t){f.value[e]=t,w.numberFormats=f.value,Kn(w,e,t)}function Ie(e,t){f.value[e]=he(f.value[e]||{},t),w.numberFormats=f.value,Kn(w,e,t)}Ar++,n&&se&&((0,t.watch)(n.locale,e=>{s&&(c.value=e,w.locale=e,Fn(w,c.value,l.value))}),(0,t.watch)(n.fallbackLocale,e=>{s&&(l.value=e,w.fallbackLocale=e,Fn(w,c.value,l.value))}));let Le={id:Ar,locale:ee,fallbackLocale:te,get inheritLocale(){return s},set inheritLocale(e){s=e,e&&n&&(c.value=n.locale.value,l.value=n.fallbackLocale.value,Fn(w,c.value,l.value))},get availableLocales(){return Object.keys(u.value).sort()},messages:E,get modifiers(){return S},get pluralRules(){return C||{}},get isGlobal(){return i},get missingWarn(){return p},set missingWarn(e){p=e,w.missingWarn=p},get fallbackWarn(){return m},set fallbackWarn(e){m=e,w.fallbackWarn=m},get fallbackRoot(){return h},set fallbackRoot(e){h=e},get fallbackFormat(){return g},set fallbackFormat(e){g=e,w.fallbackFormat=g},get warnHtmlMessage(){return b},set warnHtmlMessage(e){b=e,w.warnHtmlMessage=e},get escapeParameter(){return x},set escapeParameter(e){x=e,w.escapeParameter=e},t:le,getLocaleMessage:Oe,setLocaleMessage:ke,mergeLocaleMessage:Ae,getPostTranslationHandler:ie,setPostTranslationHandler:ae,getMissingHandler:D,setMissingHandler:oe,[yr]:be};return Le.datetimeFormats=ne,Le.numberFormats=re,Le.rt=ue,Le.te=xe,Le.tm=De,Le.d=fe,Le.n=me,Le.getDateTimeFormat=je,Le.setDateTimeFormat=Me,Le.mergeDateTimeFormat=Pe,Le.getNumberFormat=Fe,Le.setNumberFormat=M,Le.mergeNumberFormat=Ie,Le[br]=r,Le[gr]=_e,Le[_r]=ye,Le[vr]=ve,Le}var Nr={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e===`parent`||e===`global`,default:`parent`},i18n:{type:Object}};function Pr({slots:e},n){return n.length===1&&n[0]===`default`?(e.default?e.default():[]).reduce((e,n)=>[...e,...n.type===t.Fragment?n.children:[n]],[]):n.reduce((t,n)=>{let r=e[n];return r&&(t[n]=r()),t},O())}function Fr(){return t.Fragment}var Ir=(0,t.defineComponent)({name:`i18n-t`,props:he({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>de(e)||!isNaN(e)}},Nr),setup(e,n){let{slots:r,attrs:i}=n,a=e.i18n||qr({useScope:e.scope,__useComponent:!0});return()=>{let o=Object.keys(r).filter(e=>e[0]!==`_`),s=O();e.locale&&(s.locale=e.locale),e.plural!==void 0&&(s.plural=k(e.plural)?+e.plural:e.plural);let c=Pr(n,o),l=a[gr](e.keypath,c,s),u=he(O(),i);return(0,t.h)(k(e.tag)||A(e.tag)?e.tag:Fr(),u,l)}}});function Lr(e){return we(e)&&!k(e[0])}function Rr(e,n,r,i){let{slots:a,attrs:o}=n;return()=>{let n={part:!0},s=O();e.locale&&(n.locale=e.locale),k(e.format)?n.key=e.format:A(e.format)&&(k(e.format.key)&&(n.key=e.format.key),s=Object.keys(e.format).reduce((t,n)=>r.includes(n)?he(O(),t,{[n]:e.format[n]}):t,O()));let c=i(e.value,n,s),l=[n.key];we(c)?l=c.map((e,t)=>{let n=a[e.type],r=n?n({[e.type]:e.value,index:t,parts:c}):[e.value];return Lr(r)&&(r[0].key=`${e.type}-${t}`),r}):k(c)&&(l=[c]);let u=he(O(),o);return(0,t.h)(k(e.tag)||A(e.tag)?e.tag:Fr(),u,l)}}var zr=(0,t.defineComponent)({name:`i18n-n`,props:he({value:{type:Number,required:!0},format:{type:[String,Object]}},Nr),setup(e,t){let n=e.i18n||qr({useScope:e.scope,__useComponent:!0});return Rr(e,t,Wn,(...e)=>n[vr](...e))}});function Br(e,t){let n=e;if(e.mode===`composition`)return n.__getInstance(t)||e.global;{let r=n.__getInstance(t);return r==null?e.global.__composer:r.__composer}}function Vr(e){let n=t=>{let{instance:n,value:r}=t;if(!n||!n.$)throw hr(mr.UNEXPECTED_ERROR);let i=Br(e,n.$),a=Hr(r);return[Reflect.apply(i.t,i,[...Ur(a)]),i]};return{created:(r,i)=>{let[a,o]=n(i);se&&e.global===o&&(r.__i18nWatcher=(0,t.watch)(o.locale,()=>{i.instance&&i.instance.$forceUpdate()})),r.__composer=o,r.textContent=a},unmounted:e=>{se&&e.__i18nWatcher&&(e.__i18nWatcher(),e.__i18nWatcher=void 0,delete e.__i18nWatcher),e.__composer&&(e.__composer=void 0,delete e.__composer)},beforeUpdate:(e,{value:t})=>{if(e.__composer){let n=e.__composer,r=Hr(t);e.textContent=Reflect.apply(n.t,n,[...Ur(r)])}},getSSRProps:e=>{let[t]=n(e);return{textContent:t}}}}function Hr(e){if(k(e))return{path:e};if(j(e)){if(!(`path`in e))throw hr(mr.REQUIRED_VALUE,`path`);return e}else throw hr(mr.INVALID_VALUE)}function Ur(e){let{path:t,locale:n,args:r,choice:i,plural:a}=e,o={},s=r||{};return k(n)&&(o.locale=n),de(i)&&(o.plural=i),de(a)&&(o.plural=a),[t,s,o]}function Wr(e,t,...n){let r=j(n[0])?n[0]:{};(!Ee(r.globalInstall)||r.globalInstall)&&([Ir.name,`I18nT`].forEach(t=>e.component(t,Ir)),[zr.name,`I18nN`].forEach(t=>e.component(t,zr)),[ii.name,`I18nD`].forEach(t=>e.component(t,ii))),e.directive(`t`,Vr(t))}var Gr=ce(`global-vue-i18n`);function Kr(e={}){let t=Ee(e.globalInjection)?e.globalInjection:!0,n=new Map,[r,i]=Jr(e,!1),a=ce(``);function o(e){return n.get(e)||null}function s(e,t){n.set(e,t)}function c(e){n.delete(e)}let l={get mode(){return`composition`},async install(e,...n){if(e.__VUE_I18N_SYMBOL__=a,e.provide(e.__VUE_I18N_SYMBOL__,l),j(n[0])){let e=n[0];l.__composerExtend=e.__composerExtend,l.__vueI18nExtend=e.__vueI18nExtend}let r=null;t&&(r=ri(e,l.global)),Wr(e,l,...n);let i=e.unmount;e.unmount=()=>{r&&r(),l.dispose(),i()}},get global(){return i},dispose(){r.stop()},__instances:n,__getInstance:o,__setInstance:s,__deleteInstance:c};return l}function qr(e={}){let n=(0,t.getCurrentInstance)();if(n==null)throw hr(mr.MUST_BE_CALL_SETUP_TOP);if(!n.isCE&&n.appContext.app!=null&&!n.appContext.app.__VUE_I18N_SYMBOL__)throw hr(mr.NOT_INSTALLED);let r=Yr(n),i=Zr(r),a=Tr(n),o=Xr(e,a);if(o===`global`)return Er(i,e,a),i;if(o===`parent`){let t=Qr(r,n,e.__useComponent);return t??=i,t}let s=r,c=s.__getInstance(n);if(c==null){let t=he({},e);`__i18n`in a&&(t.__i18n=a.__i18n),i&&(t.__root=i),c=Mr(t),s.__composerExtend&&(c[xr]=s.__composerExtend(c)),ei(s,n,c),s.__setInstance(n,c)}return c}function Jr(e,n){let r=(0,t.effectScope)(),i=r.run(()=>Mr(e));if(i==null)throw hr(mr.UNEXPECTED_ERROR);return[r,i]}function Yr(e){let n=(0,t.inject)(e.isCE?Gr:e.appContext.app.__VUE_I18N_SYMBOL__);if(!n)throw hr(e.isCE?mr.NOT_INSTALLED_WITH_PROVIDE:mr.UNEXPECTED_ERROR);return n}function Xr(e,t){return me(e)?`__i18n`in t?`local`:`global`:e.useScope?e.useScope:`local`}function Zr(e){return e.mode===`composition`?e.global:e.global.__composer}function Qr(e,t,n=!1){let r=null,i=t.root,a=$r(t,n);for(;a!=null;){let t=e;if(e.mode===`composition`&&(r=t.__getInstance(a)),r!=null||i===a)break;a=a.parent}return r}function $r(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function ei(e,n,r){(0,t.onMounted)(()=>{},n),(0,t.onUnmounted)(()=>{let t=r;e.__deleteInstance(n);let i=t[xr];i&&(i(),delete t[xr])},n)}var ti=[`locale`,`fallbackLocale`,`availableLocales`],ni=[`t`,`rt`,`d`,`n`,`tm`,`te`];function ri(e,n){let r=Object.create(null);return ti.forEach(e=>{let i=Object.getOwnPropertyDescriptor(n,e);if(!i)throw hr(mr.UNEXPECTED_ERROR);let a=(0,t.isRef)(i.value)?{get(){return i.value.value},set(e){i.value.value=e}}:{get(){return i.get&&i.get()}};Object.defineProperty(r,e,a)}),e.config.globalProperties.$i18n=r,ni.forEach(t=>{let r=Object.getOwnPropertyDescriptor(n,t);if(!r||!r.value)throw hr(mr.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${t}`,r)}),()=>{delete e.config.globalProperties.$i18n,ni.forEach(t=>{delete e.config.globalProperties[`$${t}`]})}}var ii=(0,t.defineComponent)({name:`i18n-d`,props:he({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Nr),setup(e,t){let n=e.i18n||qr({useScope:e.scope,__useComponent:!0});return Rr(e,t,Bn,(...e)=>n[_r](...e))}});if(pr(),xn(Ht),Cn(mn),Tn(en),__INTLIFY_PROD_DEVTOOLS__){let e=ve();e.__INTLIFY__=!0,Wt(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}var ai={editor:{drag:{button:{insert_block:{t:0,b:{t:2,i:[{t:3}],s:`Insert block`}},drag_handle:{t:0,b:{t:2,i:[{t:3}],s:`Drag handle`}}},menu:{convert_to:{t:0,b:{t:2,i:[{t:3}],s:`Convert to`}},copy:{t:0,b:{t:2,i:[{t:3}],s:`Copy`}},cut:{t:0,b:{t:2,i:[{t:3}],s:`Cut`}},delete:{t:0,b:{t:2,i:[{t:3}],s:`Delete`}}}},menus:{undo:{t:0,b:{t:2,i:[{t:3}],s:`Undo`}},redo:{t:0,b:{t:2,i:[{t:3}],s:`Redo`}},table:{title:{t:0,b:{t:2,i:[{t:3}],s:`Table`}},add:{t:0,b:{t:2,i:[{t:3}],s:`Add table`}},add_column_before:{t:0,b:{t:2,i:[{t:3}],s:`Add column before`}},add_column_after:{t:0,b:{t:2,i:[{t:3}],s:`Add column after`}},delete_column:{t:0,b:{t:2,i:[{t:3}],s:`Delete column`}},add_row_before:{t:0,b:{t:2,i:[{t:3}],s:`Add row before`}},add_row_after:{t:0,b:{t:2,i:[{t:3}],s:`Add row after`}},toggle_header_column:{t:0,b:{t:2,i:[{t:3}],s:`Set/Unset First Column Header`}},toggle_header_row:{t:0,b:{t:2,i:[{t:3}],s:`Set/Unset First Row Header`}},toggle_header_cell:{t:0,b:{t:2,i:[{t:3}],s:`Set/Unset Current Cell as Header`}},delete_row:{t:0,b:{t:2,i:[{t:3}],s:`Delete row`}},merge_cells:{t:0,b:{t:2,i:[{t:3}],s:`Merge cells`}},split_cell:{t:0,b:{t:2,i:[{t:3}],s:`Split cell`}},delete_table:{t:0,b:{t:2,i:[{t:3}],s:`Delete table`}}}},extensions:{commands_menu:{columns:{t:0,b:{t:2,i:[{t:3}],s:`Column Card`}},iframe:{t:0,b:{t:2,i:[{t:3}],s:`Iframe`}},image:{t:0,b:{t:2,i:[{t:3}],s:`image`}},video:{t:0,b:{t:2,i:[{t:3}],s:`Video`}},audio:{t:0,b:{t:2,i:[{t:3}],s:`Audio`}},table:{t:0,b:{t:2,i:[{t:3}],s:`Table`}},gallery:{t:0,b:{t:2,i:[{t:3}],s:`Gallery`}},no_results:{t:0,b:{t:2,i:[{t:3}],s:`No results`}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Enter / to select input type`}}},figure_caption:{empty_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Add description`}}},link:{add_link:{t:0,b:{t:2,i:[{t:3}],s:`Add link`}},edit_link:{t:0,b:{t:2,i:[{t:3}],s:`Edit link`}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Link address`}},open_in_new_window:{t:0,b:{t:2,i:[{t:3}],s:`Open in new window`}},cancel_link:{t:0,b:{t:2,i:[{t:3}],s:`Cancel link`}},nofollow:{t:0,b:{t:2,i:[{t:3}],s:`No follow`}}},audio:{src_input_label:{t:0,b:{t:2,i:[{t:3}],s:`Audio link`}},disable_autoplay:{t:0,b:{t:2,i:[{t:3}],s:`Disable auto play`}},enable_autoplay:{t:0,b:{t:2,i:[{t:3}],s:`Enable auto play`}},disable_loop:{t:0,b:{t:2,i:[{t:3}],s:`Disable loop`}},enable_loop:{t:0,b:{t:2,i:[{t:3}],s:`Disable loop`}}},iframe:{src_input_label:{t:0,b:{t:2,i:[{t:3}],s:`Web link`}},resize:{t:0,b:{t:2,i:[{t:3}],s:`Resize`}},disable_frameborder:{t:0,b:{t:2,i:[{t:3}],s:`Hide frameborder`}},enable_frameborder:{t:0,b:{t:2,i:[{t:3}],s:`Show frameborder`}},phone_size:{t:0,b:{t:2,i:[{t:3}],s:`Mobile phone size`}},tablet_vertical_size:{t:0,b:{t:2,i:[{t:3}],s:`Tablet portrait size`}},tablet_horizontal_size:{t:0,b:{t:2,i:[{t:3}],s:`Tablet landscape size`}},desktop_size:{t:0,b:{t:2,i:[{t:3}],s:`Desktop size`}}},image:{src_input_label:{t:0,b:{t:2,i:[{t:3}],s:`Image link`}},href_input_label:{t:0,b:{t:2,i:[{t:3}],s:`Image hyperlink`}},resize:{t:0,b:{t:2,i:[{t:3}],s:`Resize`}},small_size:{t:0,b:{t:2,i:[{t:3}],s:`Small size`}},medium_size:{t:0,b:{t:2,i:[{t:3}],s:`Medium size`}},large_size:{t:0,b:{t:2,i:[{t:3}],s:`Large size`}},restore_size:{t:0,b:{t:2,i:[{t:3}],s:`Restore original size`}},edit_link:{t:0,b:{t:2,i:[{t:3}],s:`Edit link`}},edit_alt:{t:0,b:{t:2,i:[{t:3}],s:`Edit alt`}},edit_href:{t:0,b:{t:2,i:[{t:3}],s:`Edit the image hyperlink`}},edit_caption:{t:0,b:{t:2,i:[{t:3}],s:`Image description`}},image_load_error:{t:0,b:{t:2,i:[{t:3}],s:`Image load failed`}}},video:{src_input_label:{t:0,b:{t:2,i:[{t:3}],s:`Video link`}},resize:{t:0,b:{t:2,i:[{t:3}],s:`Resize`}},disable_controls:{t:0,b:{t:2,i:[{t:3}],s:`Hide controls`}},enable_controls:{t:0,b:{t:2,i:[{t:3}],s:`Show controls`}},disable_autoplay:{t:0,b:{t:2,i:[{t:3}],s:`Disable auto play`}},enable_autoplay:{t:0,b:{t:2,i:[{t:3}],s:`Enable auto play`}},disable_loop:{t:0,b:{t:2,i:[{t:3}],s:`Disable loop`}},enable_loop:{t:0,b:{t:2,i:[{t:3}],s:`Enable loop`}},small_size:{t:0,b:{t:2,i:[{t:3}],s:`Small size`}},medium_size:{t:0,b:{t:2,i:[{t:3}],s:`Medium size`}},large_size:{t:0,b:{t:2,i:[{t:3}],s:`Large size`}},edit_caption:{t:0,b:{t:2,i:[{t:3}],s:`Video description`}}},highlight:{unset:{t:0,b:{t:2,i:[{t:3}],s:`Unset`}}},columns:{add_column_before:{t:0,b:{t:2,i:[{t:3}],s:`Add column before`}},add_column_after:{t:0,b:{t:2,i:[{t:3}],s:`Add column after`}},delete_column:{t:0,b:{t:2,i:[{t:3}],s:`Delete column`}}},search_and_replace:{title:{t:0,b:{t:2,i:[{t:3}],s:`Search and Replace`}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Search`}},not_found:{t:0,b:{t:2,i:[{t:3}],s:`Not Found`}},occurrence_found:{t:0,b:{t:2,i:[{t:4,k:`index`},{t:3,v:` of `},{t:4,k:`total`},{t:3,v:` occurrences`}]}},find_previous:{t:0,b:{t:2,i:[{t:3}],s:`Find Previous`}},find_next:{t:0,b:{t:2,i:[{t:3}],s:`Find Next`}},replace_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Replace`}},replace:{t:0,b:{t:2,i:[{t:3}],s:`Replace`}},replace_all:{t:0,b:{t:2,i:[{t:3}],s:`Replace All`}},case_sensitive:{t:0,b:{t:2,i:[{t:3}],s:`Case Sensitive`}},match_word:{t:0,b:{t:2,i:[{t:3}],s:`Match Whole Word`}},use_regex:{t:0,b:{t:2,i:[{t:3}],s:`Use Regular Expression`}},close:{t:0,b:{t:2,i:[{t:3}],s:`Close`}}},format_brush:{toolbar_item:{title:{t:0,b:{t:2,i:[{t:3}],s:`Format Brush`}},cancel:{t:0,b:{t:2,i:[{t:3}],s:`Cancel Format Brush`}}}},details:{command_item:{t:0,b:{t:2,i:[{t:3}],s:`Details`}}},gallery:{title:{t:0,b:{t:2,i:[{t:3}],s:`Gallery`}},add_image:{t:0,b:{t:2,i:[{t:3}],s:`Add image`}},empty_prompt:{t:0,b:{t:2,i:[{t:3}],s:`Click to select images or drag images here`}},group_size:{t:0,b:{t:2,i:[{t:3}],s:`Images per row`}},group_size_label:{t:0,b:{t:2,i:[{t:4,k:`count`},{t:3,v:` images per row`}]}},layout:{title:{t:0,b:{t:2,i:[{t:3}],s:`Layout`}},auto:{t:0,b:{t:2,i:[{t:3}],s:`Auto`}},square:{t:0,b:{t:2,i:[{t:3}],s:`Square`}}},gap:{t:0,b:{t:2,i:[{t:3}],s:`Gap`}}},upload:{error:{t:0,b:{t:2,i:[{t:3}],s:`Upload failed`}},click_retry:{t:0,b:{t:2,i:[{t:3}],s:`Click to retry`}},loading:{t:0,b:{t:2,i:[{t:3}],s:`Loading`}},attachment:{title:{t:0,b:{t:2,i:[{t:3}],s:`Attachment Library`}}},permalink:{title:{t:0,b:{t:2,i:[{t:3}],s:`Input Link`}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:`Input link and press Enter to confirm`}}},operations:{remove:{button:{t:0,b:{t:2,i:[{t:3}],s:`Delete`}}},replace:{button:{t:0,b:{t:2,i:[{t:3}],s:`Replace`}}},transfer:{button:{t:0,b:{t:2,i:[{t:3}],s:`Save locally`}},tooltip:{t:0,b:{t:2,i:[{t:3}],s:`This resource is detected as an external resource. Click this button to save it to the attachment library.`}}},transfer_in_batch:{description:{t:0,b:{t:2,i:[{t:3}],s:`External link detected. Would you like to automatically upload it to the attachment library?`}}}}},font_size:{title:{t:0,b:{t:2,i:[{t:3}],s:`Font size`}}}},components:{color_picker:{more_color:{t:0,b:{t:2,i:[{t:3}],s:`More`}}}},common:{alt:{t:0,b:{t:2,i:[{t:3}],s:`Alternative text`}},width:{t:0,b:{t:2,i:[{t:3}],s:`Width`}},height:{t:0,b:{t:2,i:[{t:3}],s:`Height`}},align_method:{t:0,b:{t:2,i:[{t:3}],s:`Align method`}},align_left:{t:0,b:{t:2,i:[{t:3}],s:`Align left`}},align_center:{t:0,b:{t:2,i:[{t:3}],s:`Align center`}},align_right:{t:0,b:{t:2,i:[{t:3}],s:`Align right`}},align_justify:{t:0,b:{t:2,i:[{t:3}],s:`Align justify`}},bold:{t:0,b:{t:2,i:[{t:3}],s:`Bold`}},italic:{t:0,b:{t:2,i:[{t:3}],s:`Italic`}},underline:{t:0,b:{t:2,i:[{t:3}],s:`Underline`}},strike:{t:0,b:{t:2,i:[{t:3}],s:`Strike`}},quote:{t:0,b:{t:2,i:[{t:3}],s:`Quote`}},code:{t:0,b:{t:2,i:[{t:3}],s:`Code`}},superscript:{t:0,b:{t:2,i:[{t:3}],s:`Super Script`}},subscript:{t:0,b:{t:2,i:[{t:3}],s:`Sub Script`}},codeblock:{title:{t:0,b:{t:2,i:[{t:3}],s:`Code block`}},copy_code:{t:0,b:{t:2,i:[{t:3}],s:`Copy code`}},copy_code_success:{t:0,b:{t:2,i:[{t:3}],s:`Copy success`}}},image:{t:0,b:{t:2,i:[{t:3}],s:`Image`}},heading:{title:{t:0,b:{t:2,i:[{t:3}],s:`Text type`}},paragraph:{t:0,b:{t:2,i:[{t:3}],s:`Paragraph`}},heading1:{t:0,b:{t:2,i:[{t:3}],s:`Heading 1`}},heading2:{t:0,b:{t:2,i:[{t:3}],s:`Heading 2`}},heading3:{t:0,b:{t:2,i:[{t:3}],s:`Heading 3`}},heading4:{t:0,b:{t:2,i:[{t:3}],s:`Heading 4`}},heading5:{t:0,b:{t:2,i:[{t:3}],s:`Heading 5`}},heading6:{t:0,b:{t:2,i:[{t:3}],s:`Heading 6`}}},list:{t:0,b:{t:2,i:[{t:3}],s:`List`}},bullet_list:{t:0,b:{t:2,i:[{t:3}],s:`Bullet list`}},ordered_list:{t:0,b:{t:2,i:[{t:3}],s:`Ordered list`}},task_list:{t:0,b:{t:2,i:[{t:3}],s:`Task list`}},highlight:{t:0,b:{t:2,i:[{t:3}],s:`Highlight`}},color:{t:0,b:{t:2,i:[{t:3}],s:`Color`}},tooltip:{custom_width_input:{t:0,b:{t:2,i:[{t:3}],s:`Custom width, press Enter to take effect`}},custom_height_input:{t:0,b:{t:2,i:[{t:3}],s:`Customize height, press Enter to take effect`}},open_link:{t:0,b:{t:2,i:[{t:3}],s:`Open link`}}},placeholder:{link_input:{t:0,b:{t:2,i:[{t:3}],s:`Enter the link and press enter to confirm.`}},alt_input:{t:0,b:{t:2,i:[{t:3}],s:`Enter the image alt and press enter to confirm.`}},alt_href:{t:0,b:{t:2,i:[{t:3}],s:`Enter the image hyperlink and press enter to confirm.`}}},button:{new_line:{t:0,b:{t:2,i:[{t:3}],s:`New line`}},delete:{t:0,b:{t:2,i:[{t:3}],s:`Delete`}},edit_link:{t:0,b:{t:2,i:[{t:3}],s:`Edit link`}},refresh:{t:0,b:{t:2,i:[{t:3}],s:`Refresh`}},restore_default:{t:0,b:{t:2,i:[{t:3}],s:`Restore default`}},add:{t:0,b:{t:2,i:[{t:3}],s:`Add`}},cancel:{t:0,b:{t:2,i:[{t:3}],s:`Cancel`}},upload:{t:0,b:{t:2,i:[{t:3}],s:`Upload`}},confirm:{t:0,b:{t:2,i:[{t:3}],s:`Confirm`}}},text:{default:{t:0,b:{t:2,i:[{t:3}],s:`Default`}},tip:{t:0,b:{t:2,i:[{t:3}],s:`Tip`}}},toast:{save_success:{t:0,b:{t:2,i:[{t:3}],s:`Saved successfully`}}},line_height:{t:0,b:{t:2,i:[{t:3}],s:`Line height`}},clear_format:{t:0,b:{t:2,i:[{t:3}],s:`Clear format`}}}}},oi={editor:{drag:{button:{insert_block:{t:0,b:{t:2,i:[{t:3}],s:`插入块`}},drag_handle:{t:0,b:{t:2,i:[{t:3}],s:`按住拖动`}}},menu:{convert_to:{t:0,b:{t:2,i:[{t:3}],s:`转化为`}},copy:{t:0,b:{t:2,i:[{t:3}],s:`复制`}},cut:{t:0,b:{t:2,i:[{t:3}],s:`剪切`}},delete:{t:0,b:{t:2,i:[{t:3}],s:`删除`}}}},menus:{undo:{t:0,b:{t:2,i:[{t:3}],s:`撤销`}},redo:{t:0,b:{t:2,i:[{t:3}],s:`恢复`}},table:{title:{t:0,b:{t:2,i:[{t:3}],s:`表格`}},add:{t:0,b:{t:2,i:[{t:3}],s:`插入表格`}},add_column_before:{t:0,b:{t:2,i:[{t:3}],s:`向前插入列`}},add_column_after:{t:0,b:{t:2,i:[{t:3}],s:`向后插入列`}},delete_column:{t:0,b:{t:2,i:[{t:3}],s:`删除当前列`}},add_row_before:{t:0,b:{t:2,i:[{t:3}],s:`向上插入行`}},add_row_after:{t:0,b:{t:2,i:[{t:3}],s:`向下插入行`}},toggle_header_column:{t:0,b:{t:2,i:[{t:3}],s:`设置/取消首列表头`}},toggle_header_row:{t:0,b:{t:2,i:[{t:3}],s:`设置/取消首行表头`}},toggle_header_cell:{t:0,b:{t:2,i:[{t:3}],s:`设置/取消当前单元格为表头`}},delete_row:{t:0,b:{t:2,i:[{t:3}],s:`删除当前行`}},merge_cells:{t:0,b:{t:2,i:[{t:3}],s:`合并单元格`}},split_cell:{t:0,b:{t:2,i:[{t:3}],s:`分割单元格`}},delete_table:{t:0,b:{t:2,i:[{t:3}],s:`删除表格`}}}},extensions:{commands_menu:{columns:{t:0,b:{t:2,i:[{t:3}],s:`分栏卡片`}},iframe:{t:0,b:{t:2,i:[{t:3}],s:`嵌入网页`}},image:{t:0,b:{t:2,i:[{t:3}],s:`图片`}},video:{t:0,b:{t:2,i:[{t:3}],s:`视频`}},audio:{t:0,b:{t:2,i:[{t:3}],s:`音频`}},table:{t:0,b:{t:2,i:[{t:3}],s:`表格`}},gallery:{t:0,b:{t:2,i:[{t:3}],s:`图片集`}},no_results:{t:0,b:{t:2,i:[{t:3}],s:`没有搜索结果`}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:`输入 / 以选择输入类型`}}},figure_caption:{empty_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`添加描述`}}},link:{add_link:{t:0,b:{t:2,i:[{t:3}],s:`添加链接`}},edit_link:{t:0,b:{t:2,i:[{t:3}],s:`修改链接`}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:`链接地址`}},open_in_new_window:{t:0,b:{t:2,i:[{t:3}],s:`在新窗口中打开`}},cancel_link:{t:0,b:{t:2,i:[{t:3}],s:`取消链接`}},nofollow:{t:0,b:{t:2,i:[{t:3}],s:`搜索引擎忽略链接关系`}}},audio:{src_input_label:{t:0,b:{t:2,i:[{t:3}],s:`音频链接`}},disable_autoplay:{t:0,b:{t:2,i:[{t:3}],s:`关闭自动播放`}},enable_autoplay:{t:0,b:{t:2,i:[{t:3}],s:`开启自动播放`}},disable_loop:{t:0,b:{t:2,i:[{t:3}],s:`关闭循环播放`}},enable_loop:{t:0,b:{t:2,i:[{t:3}],s:`开启循环播放`}}},iframe:{src_input_label:{t:0,b:{t:2,i:[{t:3}],s:`网页链接`}},resize:{t:0,b:{t:2,i:[{t:3}],s:`调整尺寸`}},disable_frameborder:{t:0,b:{t:2,i:[{t:3}],s:`取消边框`}},enable_frameborder:{t:0,b:{t:2,i:[{t:3}],s:`设置边框`}},phone_size:{t:0,b:{t:2,i:[{t:3}],s:`手机尺寸`}},tablet_vertical_size:{t:0,b:{t:2,i:[{t:3}],s:`平板电脑纵向尺寸`}},tablet_horizontal_size:{t:0,b:{t:2,i:[{t:3}],s:`平板电脑横向尺寸`}},desktop_size:{t:0,b:{t:2,i:[{t:3}],s:`桌面电脑尺寸`}}},image:{src_input_label:{t:0,b:{t:2,i:[{t:3}],s:`图片链接`}},href_input_label:{t:0,b:{t:2,i:[{t:3}],s:`图片跳转链接`}},resize:{t:0,b:{t:2,i:[{t:3}],s:`调整尺寸`}},small_size:{t:0,b:{t:2,i:[{t:3}],s:`小尺寸`}},medium_size:{t:0,b:{t:2,i:[{t:3}],s:`中尺寸`}},large_size:{t:0,b:{t:2,i:[{t:3}],s:`大尺寸`}},restore_size:{t:0,b:{t:2,i:[{t:3}],s:`恢复原始尺寸`}},edit_link:{t:0,b:{t:2,i:[{t:3}],s:`修改链接`}},edit_alt:{t:0,b:{t:2,i:[{t:3}],s:`修改图片的替代文本(alt 属性)`}},edit_href:{t:0,b:{t:2,i:[{t:3}],s:`修改图片跳转链接`}},edit_caption:{t:0,b:{t:2,i:[{t:3}],s:`图片描述文本`}},image_load_error:{t:0,b:{t:2,i:[{t:3}],s:`图片加载失败`}}},video:{src_input_label:{t:0,b:{t:2,i:[{t:3}],s:`视频链接`}},resize:{t:0,b:{t:2,i:[{t:3}],s:`调整尺寸`}},disable_controls:{t:0,b:{t:2,i:[{t:3}],s:`隐藏控制面板`}},enable_controls:{t:0,b:{t:2,i:[{t:3}],s:`显示控制面板`}},disable_autoplay:{t:0,b:{t:2,i:[{t:3}],s:`关闭自动播放`}},enable_autoplay:{t:0,b:{t:2,i:[{t:3}],s:`开启自动播放`}},disable_loop:{t:0,b:{t:2,i:[{t:3}],s:`关闭循环播放`}},enable_loop:{t:0,b:{t:2,i:[{t:3}],s:`开启循环播放`}},small_size:{t:0,b:{t:2,i:[{t:3}],s:`小尺寸`}},medium_size:{t:0,b:{t:2,i:[{t:3}],s:`中尺寸`}},large_size:{t:0,b:{t:2,i:[{t:3}],s:`大尺寸`}},edit_caption:{t:0,b:{t:2,i:[{t:3}],s:`视频描述`}}},highlight:{unset:{t:0,b:{t:2,i:[{t:3}],s:`移除高亮颜色`}}},columns:{add_column_before:{t:0,b:{t:2,i:[{t:3}],s:`向前插入列`}},add_column_after:{t:0,b:{t:2,i:[{t:3}],s:`向后插入列`}},delete_column:{t:0,b:{t:2,i:[{t:3}],s:`删除当前列`}}},search_and_replace:{title:{t:0,b:{t:2,i:[{t:3}],s:`查找替换`}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`查找`}},not_found:{t:0,b:{t:2,i:[{t:3}],s:`无结果`}},occurrence_found:{t:0,b:{t:2,i:[{t:3,v:`第 `},{t:4,k:`index`},{t:3,v:` 项,共 `},{t:4,k:`total`},{t:3,v:` 项`}]}},find_previous:{t:0,b:{t:2,i:[{t:3}],s:`上一个匹配项`}},find_next:{t:0,b:{t:2,i:[{t:3}],s:`下一个匹配项`}},replace_placeholder:{t:0,b:{t:2,i:[{t:3}],s:`替换`}},replace:{t:0,b:{t:2,i:[{t:3}],s:`替换`}},replace_all:{t:0,b:{t:2,i:[{t:3}],s:`全部替换`}},case_sensitive:{t:0,b:{t:2,i:[{t:3}],s:`区分大小写`}},match_word:{t:0,b:{t:2,i:[{t:3}],s:`全字匹配`}},use_regex:{t:0,b:{t:2,i:[{t:3}],s:`使用正则表达式`}},close:{t:0,b:{t:2,i:[{t:3}],s:`关闭`}}},format_brush:{toolbar_item:{title:{t:0,b:{t:2,i:[{t:3}],s:`格式刷`}},cancel:{t:0,b:{t:2,i:[{t:3}],s:`取消格式刷`}}}},details:{command_item:{t:0,b:{t:2,i:[{t:3}],s:`折叠内容`}}},gallery:{title:{t:0,b:{t:2,i:[{t:3}],s:`图片集`}},add_image:{t:0,b:{t:2,i:[{t:3}],s:`添加图片`}},empty_prompt:{t:0,b:{t:2,i:[{t:3}],s:`点击选择图片或拖拽图片到这里`}},group_size:{t:0,b:{t:2,i:[{t:3}],s:`每行图片数`}},group_size_label:{t:0,b:{t:2,i:[{t:3,v:`每行 `},{t:4,k:`count`},{t:3,v:` 张图片`}]}},layout:{title:{t:0,b:{t:2,i:[{t:3}],s:`布局`}},auto:{t:0,b:{t:2,i:[{t:3}],s:`自适应`}},square:{t:0,b:{t:2,i:[{t:3}],s:`等比矩形`}}},gap:{t:0,b:{t:2,i:[{t:3}],s:`间距`}}},upload:{error:{t:0,b:{t:2,i:[{t:3}],s:`上传失败`}},click_retry:{t:0,b:{t:2,i:[{t:3}],s:`点击重试`}},loading:{t:0,b:{t:2,i:[{t:3}],s:`等待中`}},attachment:{title:{t:0,b:{t:2,i:[{t:3}],s:`附件库`}}},permalink:{title:{t:0,b:{t:2,i:[{t:3}],s:`输入链接`}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:`输入链接,按回车确定`}}},operations:{remove:{button:{t:0,b:{t:2,i:[{t:3}],s:`删除`}}},replace:{button:{t:0,b:{t:2,i:[{t:3}],s:`替换`}}},transfer:{button:{t:0,b:{t:2,i:[{t:3}],s:`转存`}},tooltip:{t:0,b:{t:2,i:[{t:3}],s:`检测到此资源为外部资源,点击此按钮以转存到附件库`}}},transfer_in_batch:{description:{t:0,b:{t:2,i:[{t:3}],s:`检测到具有外部链接,是否需要自动上传到附件库?`}}}}},font_size:{title:{t:0,b:{t:2,i:[{t:3}],s:`字体大小`}}}},components:{color_picker:{more_color:{t:0,b:{t:2,i:[{t:3}],s:`更多颜色`}}}},common:{alt:{t:0,b:{t:2,i:[{t:3}],s:`替代文本`}},width:{t:0,b:{t:2,i:[{t:3}],s:`宽度`}},height:{t:0,b:{t:2,i:[{t:3}],s:`高度`}},align_method:{t:0,b:{t:2,i:[{t:3}],s:`对齐方式`}},align_left:{t:0,b:{t:2,i:[{t:3}],s:`左对齐`}},align_center:{t:0,b:{t:2,i:[{t:3}],s:`居中`}},align_right:{t:0,b:{t:2,i:[{t:3}],s:`右对齐`}},align_justify:{t:0,b:{t:2,i:[{t:3}],s:`两端对齐`}},bold:{t:0,b:{t:2,i:[{t:3}],s:`粗体`}},italic:{t:0,b:{t:2,i:[{t:3}],s:`斜体`}},underline:{t:0,b:{t:2,i:[{t:3}],s:`下划线`}},strike:{t:0,b:{t:2,i:[{t:3}],s:`删除线`}},quote:{t:0,b:{t:2,i:[{t:3}],s:`引用`}},code:{t:0,b:{t:2,i:[{t:3}],s:`行内代码`}},superscript:{t:0,b:{t:2,i:[{t:3}],s:`上角标`}},subscript:{t:0,b:{t:2,i:[{t:3}],s:`下角标`}},codeblock:{title:{t:0,b:{t:2,i:[{t:3}],s:`代码块`}},copy_code:{t:0,b:{t:2,i:[{t:3}],s:`复制代码`}},copy_code_success:{t:0,b:{t:2,i:[{t:3}],s:`复制成功`}}},image:{t:0,b:{t:2,i:[{t:3}],s:`图片`}},heading:{title:{t:0,b:{t:2,i:[{t:3}],s:`文本类型`}},paragraph:{t:0,b:{t:2,i:[{t:3}],s:`普通文本`}},heading1:{t:0,b:{t:2,i:[{t:3}],s:`一级标题`}},heading2:{t:0,b:{t:2,i:[{t:3}],s:`二级标题`}},heading3:{t:0,b:{t:2,i:[{t:3}],s:`三级标题`}},heading4:{t:0,b:{t:2,i:[{t:3}],s:`四级标题`}},heading5:{t:0,b:{t:2,i:[{t:3}],s:`五级标题`}},heading6:{t:0,b:{t:2,i:[{t:3}],s:`六级标题`}}},list:{t:0,b:{t:2,i:[{t:3}],s:`列表`}},bullet_list:{t:0,b:{t:2,i:[{t:3}],s:`无序列表`}},ordered_list:{t:0,b:{t:2,i:[{t:3}],s:`有序列表`}},task_list:{t:0,b:{t:2,i:[{t:3}],s:`任务列表`}},highlight:{t:0,b:{t:2,i:[{t:3}],s:`高亮`}},color:{t:0,b:{t:2,i:[{t:3}],s:`字体颜色`}},tooltip:{custom_width_input:{t:0,b:{t:2,i:[{t:3}],s:`自定义宽度,按回车键生效`}},custom_height_input:{t:0,b:{t:2,i:[{t:3}],s:`自定义高度,按回车键生效`}},open_link:{t:0,b:{t:2,i:[{t:3}],s:`打开链接`}}},placeholder:{link_input:{t:0,b:{t:2,i:[{t:3}],s:`输入链接,按回车确定`}},alt_input:{t:0,b:{t:2,i:[{t:3}],s:`输入图片 alt 属性值,按回车确认`}},alt_href:{t:0,b:{t:2,i:[{t:3}],s:`输入图片跳转链接,按回车确认`}}},button:{new_line:{t:0,b:{t:2,i:[{t:3}],s:`换行`}},delete:{t:0,b:{t:2,i:[{t:3}],s:`删除`}},edit_link:{t:0,b:{t:2,i:[{t:3}],s:`修改链接`}},refresh:{t:0,b:{t:2,i:[{t:3}],s:`刷新`}},restore_default:{t:0,b:{t:2,i:[{t:3}],s:`恢复为默认`}},add:{t:0,b:{t:2,i:[{t:3}],s:`添加`}},cancel:{t:0,b:{t:2,i:[{t:3}],s:`取消`}},upload:{t:0,b:{t:2,i:[{t:3}],s:`上传`}},confirm:{t:0,b:{t:2,i:[{t:3}],s:`确定`}}},text:{default:{t:0,b:{t:2,i:[{t:3}],s:`默认`}},tip:{t:0,b:{t:2,i:[{t:3}],s:`提示`}}},toast:{save_success:{t:0,b:{t:2,i:[{t:3}],s:`保存成功`}}},line_height:{t:0,b:{t:2,i:[{t:3}],s:`行高`}},clear_format:{t:0,b:{t:2,i:[{t:3}],s:`清除格式`}}}}},N=Kr({legacy:!1,locale:`en`,fallbackLocale:`zh-CN`,messages:{en:ai,zh:oi,"en-US":ai,"zh-CN":oi}});function si(e){return encodeURIComponent(String(e).trim().toLowerCase().replace(/\s+/g,`-`))}let ci=(e,t)=>{let n=si(e),r=n;for(;t.includes(r);){let e=r.replace(n,``).match(/-(\d+)$/);r=e?`${n}-${Number(e[1])+1}`:`${n}-1`}return r};function li(e){this.content=e}li.prototype={constructor:li,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new li(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new li(n)},addToStart:function(e,t){return new li([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new li(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new li(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=li.from(e),e.size?new li(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=li.from(e),e.size?new li(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=li.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},li.from=function(e){if(e instanceof li)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new li(t)};var ui=li;function di(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=di(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function fi(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=fi(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var P=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return di(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return fi(this,e,t,n)}findIndex(e,t=-1){if(e==0)return mi(0,e);if(e==this.size)return mi(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),a=r+i.nodeSize;if(a>=e)return a==e||t>0?mi(n+1,a):mi(n,r);r=a}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};P.empty=new P([],0);var pi={index:0,offset:0};function mi(e,t){return pi.index=e,pi.offset=t,pi}function hi(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!hi(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!hi(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var F=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&hi(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};F.none=[];var gi=class extends Error{},I=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=vi(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(_i(this.content,t+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(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(P.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};I.empty=new I(P.empty,0,0);function _i(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(_i(a.content,t-i-1,n-i-1)))}function vi(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=vi(o.content,t-a-1,n);return s&&e.replaceChild(i,o.copy(s))}function yi(e,t,n){if(n.openStart>e.depth)throw new gi(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new gi(`Inconsistent open depths`);return bi(e,t,n,0)}function bi(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=bi(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Ti(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=Oi(n,e);return Ti(a,Ei(e,i,o,t,r))}else return Ti(a,Di(e,t,r))}function xi(e,t){if(!t.type.compatibleContent(e.type))throw new gi(`Cannot join `+t.type.name+` onto `+e.type.name)}function Si(e,t,n){let r=e.node(n);return xi(r,t.node(n)),r}function Ci(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function wi(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Ci(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Ci(i.child(e),r);t&&t.depth==n&&t.textOffset&&Ci(t.nodeBefore,r)}function Ti(e,t){return e.type.checkContent(t),e.copy(t)}function Ei(e,t,n,r,i){let a=e.depth>i&&Si(e,t,i+1),o=r.depth>i&&Si(n,r,i+1),s=[];return wi(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(xi(a,o),Ci(Ti(a,Ei(e,t,n,r,i+1)),s)):(a&&Ci(Ti(a,Di(e,t,i+1)),s),wi(t,n,i,s),o&&Ci(Ti(o,Di(n,r,i+1)),s)),wi(r,null,i,s),new P(s)}function Di(e,t,n){let r=[];return wi(null,e,n,r),e.depth>n&&Ci(Ti(Si(e,t,n+1),Di(e,t,n+1)),r),wi(t,null,n,r),new P(r)}function Oi(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(P.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var ki=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.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 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 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,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return F.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Ni(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Mi.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Mi.set(t,r=new Ai);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%ji,i}},Ai=class{constructor(){this.elts=[],this.i=0}},ji=12,Mi=new WeakMap,Ni=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Pi=Object.create(null),Fi=class e{constructor(e,t,n,r=F.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||P.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,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&hi(this.attrs,t||e.defaultAttrs||Pi)&&F.sameSet(this.marks,n||F.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return I.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new I(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return yi(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return ki.resolveCached(this,e)}resolveNoCache(e){return ki.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Li(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=P.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.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=F.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!F.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=P.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};Fi.prototype.text=void 0;var Ii=class e extends Fi{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Li(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Li(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Ri=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new zi(t,n);if(r.next==null)return e.empty;let i=Bi(r);r.next&&r.err(`Unexpected trailing text`);let a=Xi(qi(i));return Zi(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}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:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return P.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
4
+ `)}};Ri.empty=new Ri(!0);var zi=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Bi(e){let t=[];do t.push(Vi(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Vi(e){let t=[];do t.push(Hi(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Hi(e){let t=Ki(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Wi(e,t);else break;return t}function Ui(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Wi(e,t){let n=Ui(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Ui(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Gi(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Ki(e){if(e.eat(`(`)){let t=Bi(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Gi(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function qi(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function Ji(e,t){return t-e}function Yi(e,t){let n=[];return r(t),n.sort(Ji);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Xi(e){let t=Object.create(null);return n(Yi(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Yi(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Ri(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Ji);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Zi(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Qi(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function $i(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function ea(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function ta(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new ia(e,r,t[r]);return n}var na=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=ta(e,n.attrs),this.defaultAttrs=Qi(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ri.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:$i(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new Fi(this,this.computeAttrs(e),P.from(t),F.setFrom(n))}createChecked(e=null,t,n){return t=P.from(t),this.checkContent(t),new Fi(this,this.computeAttrs(e),t,F.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=P.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(P.empty,!0);return i?new Fi(this,e,t.append(i),F.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){ea(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 t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:F.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function ra(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var ia=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?ra(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},aa=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=ta(e,r.attrs),this.excluded=null;let i=Qi(this.attrs);this.instance=i?new F(this,i):null}create(e=null){return!e&&this.instance?this.instance:new F(this,$i(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){ea(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},oa=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=ui.from(e.nodes),t.marks=ui.from(e.marks||{}),this.nodes=na.compile(this.spec.nodes,this),this.marks=aa.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Ri.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?sa(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:sa(this,n.split(` `))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(e instanceof na){if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`)}else throw RangeError(`Invalid node type: `+e);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Ii(n,n.defaultAttrs,e,F.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Fi.fromJSON(this,e)}markFromJSON(e){return F.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function sa(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function ca(e){return e.tag!=null}function la(e){return e.style!=null}var ua=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(ca(e))this.tags.push(e);else if(la(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new ya(this,t,!1);return n.addAll(e,F.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new ya(this,t,!0);return n.addAll(e,F.none,t.from,t.to),I.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(xa(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Sa(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Sa(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},da={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},fa={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},pa={ol:!0,ul:!0},ma=1,ha=2,ga=4;function _a(e,t,n){return t==null?e&&e.whitespace==`pre`?ma|ha:n&~ga:(t?ma:0)|(t===`full`?ha:0)}var va=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=F.none,this.match=i||(a&ga?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(P.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ma)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=P.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(P.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!da.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},ya=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=_a(null,t.preserveWhitespace,0)|(n?ga:0);i=r?new va(r.type,r.attrs,F.none,!0,t.topMatch||r.type.contentMatch,a):n?new va(null,null,F.none,!0,null,a):new va(e.schema.topNodeType,null,F.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&ha?`full`:this.localPreserveWS||(r.options&ma)>0;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)n=i===`full`?n.replace(/\r\n?/g,`
5
+ `):n.replace(/\r?\n|\r/g,` `);else if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;pa.hasOwnProperty(a)&&this.parser.normalizeLists&&ba(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:fa.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(da.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
6
+ `),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=F.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):Ca(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=_a(e,i,a.options);a.options&ga&&a.content.length==0&&(o|=ga);let s=F.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):Ca(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new va(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=ma);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function ba(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&pa.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function xa(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Sa(e){let t={};for(let n in e)t[n]=e[n];return t}function Ca(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var wa=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=Ea(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=Aa(Ea(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Aa(Ea(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return Aa(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Ta(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Ta(e.marks)}};function Ta(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Ea(e){return e.document||window.document}var Da=new WeakMap;function Oa(e){let t=Da.get(e);return t===void 0&&Da.set(e,t=ka(e)),t}function ka(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function Aa(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=Oa(r))&&a.indexOf(t)>-1)throw 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 s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){for(let e in u=2,l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=Aa(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var ja=65535,Ma=2**16;function Na(e,t){return e+t*Ma}function Pa(e){return e&ja}function Fa(e){return(e-(e&ja))/Ma}var Ia=1,La=2,Ra=4,za=8,Ba=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&za)>0}get deletedBefore(){return(this.delInfo&(Ia|Ra))>0}get deletedAfter(){return(this.delInfo&(La|Ra))>0}get deletedAcross(){return(this.delInfo&Ra)>0}},Va=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Pa(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+Fa(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:Na(o/3,e-s),f=e==s?La:e==u?Ia:Ra;return(t<0?e!=s:e!=u)&&(f|=za),new Ba(a,f,d)}r+=l-c}return n?e+r:new Ba(e+r,0,null)}touches(e,t){let n=0,r=Pa(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Va.empty=new Va([]);var Ha=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Ba(e,r,null)}},Ua=Object.create(null),Wa=class{getMap(){return Va.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Ua[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Ua)throw RangeError(`Duplicate use of step JSON ID `+e);return Ua[e]=t,t.prototype.jsonID=e,t}},Ga=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof gi)return e.fail(t.message);throw t}}};function Ka(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Ka(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return P.fromArray(r)}var qa=class e extends Wa{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new I(Ka(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Ga.fromReplace(e,this.from,this.to,i)}invert(){return new Ja(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Wa.jsonID(`addMark`,qa);var Ja=class e extends Wa{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new I(Ka(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Ga.fromReplace(e,this.from,this.to,n)}invert(){return new qa(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Wa.jsonID(`removeMark`,Ja);var Ya=class e extends Wa{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ga.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ga.fromReplace(e,this.pos,this.pos+1,new I(P.from(n),0,t.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Xa(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Wa.jsonID(`addNodeMark`,Ya);var Xa=class e extends Wa{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ga.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Ga.fromReplace(e,this.pos,this.pos+1,new I(P.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Ya(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Wa.jsonID(`removeNodeMark`,Xa);var Za=class e extends Wa{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&$a(e,this.from,this.to)?Ga.fail(`Structure replace would overwrite content`):Ga.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Va([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?I.empty:new I(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?I.empty:new I(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.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(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,I.fromJSON(t,n.slice),!!n.structure)}};Wa.jsonID(`replace`,Za);var Qa=class e extends Wa{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&($a(e,this.from,this.gapFrom)||$a(e,this.gapTo,this.to)))return Ga.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ga.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Ga.fromReplace(e,this.from,this.to,n):Ga.fail(`Content does not fit in gap`)}getMap(){return new Va([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,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(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,I.fromJSON(t,n.slice),n.insert,!!n.structure)}};Wa.jsonID(`replaceAround`,Qa);function $a(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function eo(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new Ja(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new qa(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function to(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof aa){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new Ja(t.from,t.to,t.style)))}function no(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Za(s,l,I.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Ja(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new I(P.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new Za(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(P.empty,!0);e.replace(s,s,new I(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function ro(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function io(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),a=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,a,t))return n;if(n==0||r.type.spec.isolating||!ro(r,i,a))break}return null}function ao(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=P.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=P.from(r.node(e).copy(u)),d++):c--;let f=P.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=P.from(i.node(e).copy(f)),p++):l++;e.step(new Qa(c,l,o,s,new I(u.append(f),d,p),u.size-d,!0))}function oo(e,t,n=null,r=e){let i=co(e,t),a=i&&lo(r,t);return a?i.map(so).concat({type:t,attrs:n}).concat(a.map(so)):null}function so(e){return{type:e,attrs:null}}function co(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function lo(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function uo(e,t,n){let r=P.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=P.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new Qa(i,a,i,a,new I(r,0,0),n.length,!0))}function fo(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&ho(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&mo(e,t,n,a),no(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Qa(c,l,c+1,l-1,new I(P.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&po(e,t,n,a),!1}})}function po(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function mo(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
7
+ `))}})}function ho(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function go(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new Qa(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new I(P.from(o),0,0),1,!0))}function _o(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<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 e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function vo(e,t,n=1,r){let i=e.doc.resolve(t),a=P.empty,o=P.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=P.from(i.node(e).copy(a));let t=r&&r[s];o=P.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new Za(t,t,new I(a.append(o),n,n),!0))}function yo(e,t){let n=e.resolve(t),r=n.index();return xo(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function bo(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function xo(e,t){return!!(e&&t&&!e.isLeaf&&bo(e,t))}function So(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&xo(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function Co(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);mo(e,r.node(),r.before(),s)}o.inlineContent&&no(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new Za(l,c.map(t+n,-1),I.empty,!0)),r===!0){let t=e.doc.resolve(l);po(e,t.node(),t.before(),e.steps.length)}return e}function wo(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function To(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+(n>0?1:0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Eo(e,t,n=t,r=I.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Do(i,a,r)?new Za(t,n,r):new Oo(i,a,r).fit()}function Do(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var Oo=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=P.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=P.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new I(i,a,o);return e>-1?new Qa(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Za(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=jo(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(P.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=jo(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new I(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=jo(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new I(ko(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new I(ko(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(Mo(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=Ao(this.placed,t,P.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?I.empty:new I(ko(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new I(ko(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!No(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=No(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=No(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Ao(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Ao(this.placed,this.depth,P.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(P.empty,!0);e.childCount&&(this.placed=Ao(this.placed,this.frontier.length,e))}};function ko(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(ko(e.firstChild.content,t-1,n)))}function Ao(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Ao(e.lastChild.content,t-1,n)))}function jo(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Mo(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Mo(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(P.empty,!0)))),e.copy(r)}function No(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!Po(n,a.content,o)?s:null}function Po(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function Fo(e){return e.spec.defining||e.spec.definingForContent}function Io(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(Do(i,a,r))return e.step(new Za(t,n,r));let o=Bo(i,e.doc.resolve(n));o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=Fo(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new I(Lo(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function Lo(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Lo(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(P.empty,!0))}return e}function Ro(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=wo(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new I(P.from(r),0,0))}function zo(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),a=Bo(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function Bo(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var Vo=class e extends Wa{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ga.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Ga.fromReplace(e,this.pos,this.pos+1,new I(P.from(r),0,t.isLeaf?0:1))}getMap(){return Va.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};Wa.jsonID(`attr`,Vo);var Ho=class e extends Wa{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Ga.ok(n)}getMap(){return Va.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};Wa.jsonID(`docAttr`,Ho);var Uo=class extends Error{};Uo=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},Uo.prototype=Object.create(Error.prototype),Uo.prototype.constructor=Uo,Uo.prototype.name=`TransformError`;var Wo=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ha}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Uo(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=I.empty){let r=Eo(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new I(P.from(n),0,0))}delete(e,t){return this.replace(e,t,I.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return Io(this,e,t,n),this}replaceRangeWith(e,t,n){return Ro(this,e,t,n),this}deleteRange(e,t){return zo(this,e,t),this}lift(e,t){return ao(this,e,t),this}join(e,t=1){return Co(this,e,t),this}wrap(e,t){return uo(this,e,t),this}setBlockType(e,t=e,n,r=null){return fo(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return go(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Vo(e,t,n)),this}setDocAttribute(e,t){return this.step(new Ho(e,t)),this}addNodeMark(e,t){return this.step(new Ya(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof F)t.isInSet(n.marks)&&this.step(new Xa(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new Xa(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return vo(this,e,t,n),this}addMark(e,t,n){return eo(this,e,t,n),this}removeMark(e,t,n){return to(this,e,t,n),this}clearIncompatible(e,t,n){return no(this,e,t,n),this}},Go=Object.create(null),L=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Ko(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=I.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?I.empty:t),o==0&&es(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),es(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new R(e):$o(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?$o(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):$o(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Zo(e.node(0))}static atStart(e){return $o(e,e,0,0,1)||new Zo(e)}static atEnd(e){return $o(e,e,e.content.size,e.childCount,-1)||new Zo(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=Go[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Go)throw RangeError(`Duplicate use of selection JSON ID `+e);return Go[e]=t,t.prototype.jsonID=e,t}getBookmark(){return R.between(this.$anchor,this.$head).getBookmark()}};L.prototype.visible=!0;var Ko=class{constructor(e,t){this.$from=e,this.$to=t}},qo=!1;function Jo(e){!qo&&!e.parent.inlineContent&&(qo=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var R=class e extends L{constructor(e,t=e){Jo(e),Jo(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return L.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=I.empty){if(super.replace(e,t),t==I.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Yo(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=L.findFrom(n,r,!0)||L.findFrom(n,-r,!0);if(e)n=e.$head;else return L.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(L.findFrom(t,-r,!0)||L.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};L.jsonID(`text`,R);var Yo=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return R.between(e.resolve(this.anchor),e.resolve(this.head))}},z=class e extends L{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?L.near(a):new e(a)}content(){return new I(P.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new Xo(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};z.prototype.visible=!1,L.jsonID(`node`,z);var Xo=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Yo(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&z.isSelectable(n)?new z(t):L.near(t)}},Zo=class e extends L{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=I.empty){if(t==I.empty){e.delete(0,e.doc.content.size);let t=L.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return Qo}};L.jsonID(`all`,Zo);var Qo={map(){return this},resolve(e){return new Zo(e)}};function $o(e,t,n,r,i,a=!1){if(t.inlineContent)return R.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(r.isAtom){if(!a&&z.isSelectable(r))return z.create(e,n-(i<0?r.nodeSize:0))}else{let t=$o(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}n+=r.nodeSize*i}return null}function es(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Za||i instanceof Qa))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(L.near(e.doc.resolve(o),n))}var ts=1,ns=2,rs=4,is=class extends Wo{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 RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|ts)&~ns,this.storedMarks=null,this}get selectionSet(){return(this.updated&ts)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ns,this}ensureMarks(e){return F.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&ns)>0}addStep(e,t){super.addStep(e,t),this.updated&=~ns,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||F.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(L.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,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|=rs,this}get scrolledIntoView(){return(this.updated&rs)>0}};function as(e,t){return!t||!e?e:e.bind(t)}var ss=class{constructor(e,t,n){this.name=e,this.init=as(t.init,n),this.apply=as(t.apply,n)}},cs=[new ss(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new ss(`selection`,{init(e,t){return e.selection||L.atStart(t.doc)},apply(e){return e.selection}}),new ss(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new ss(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],ls=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=cs.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new ss(e.key,e.spec.state,e))})}},us=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new is(this)}static create(t){let n=new ls(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new ls(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new ls(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=Fi.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=L.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function ds(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=ds(i,t,{})),n[r]=i}return n}var B=class{constructor(e){this.spec=e,this.props={},e.props&&ds(e.props,this,this.props),this.key=e.key?e.key.key:ps(`plugin`)}getState(e){return e[this.key]}},fs=Object.create(null);function ps(e){return e in fs?e+`$`+ ++fs[e]:(fs[e]=0,e+`$`)}var V=class{constructor(e=`key`){this.key=ps(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},ms=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function hs(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var gs=(e,t,n)=>{let r=hs(e,n);if(!r)return!1;let i=Ss(r);if(!i){let n=r.blockRange(),i=n&&io(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(Bs(e,i,t,-1))return!0;if(r.parent.content.size==0&&(bs(a,`end`)||z.isSelectable(a)))for(let n=r.depth;;n--){let o=Eo(e.doc,r.before(n),r.after(n),I.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(bs(a,`end`)?L.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):z.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},_s=(e,t,n)=>{let r=hs(e,n);if(!r)return!1;let i=Ss(r);return i?ys(e,i,t):!1},vs=(e,t,n)=>{let r=Cs(e,n);if(!r)return!1;let i=Es(r);return i?ys(e,i,t):!1};function ys(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=Eo(e.doc,i,o,I.empty);if(!s||s.from!=i||s instanceof Za&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(R.create(t.doc,i)),n(t.scrollIntoView())}return!0}function bs(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var xs=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=Ss(r)}let o=a&&a.nodeBefore;return!o||!z.isSelectable(o)?!1:(t&&t(e.tr.setSelection(z.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function Ss(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Cs(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var ws=(e,t,n)=>{let r=Cs(e,n);if(!r)return!1;let i=Es(r);if(!i)return!1;let a=i.nodeAfter;if(Bs(e,i,t,1))return!0;if(r.parent.content.size==0&&(bs(a,`start`)||z.isSelectable(a))){let n=Eo(e.doc,r.before(),r.after(),I.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(bs(a,`start`)?L.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):z.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},Ts=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=Es(r)}let o=a&&a.nodeAfter;return!o||!z.isSelectable(o)?!1:(t&&t(e.tr.setSelection(z.create(e.doc,a.pos)).scrollIntoView()),!0)};function Es(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var Ds=(e,t)=>{let n=e.selection,r=n instanceof z,i;if(r){if(n.node.isTextblock||!yo(e.doc,n.from))return!1;i=n.from}else if(i=So(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(z.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},Os=(e,t)=>{let n=e.selection,r;if(n instanceof z){if(n.node.isTextblock||!yo(e.doc,n.to))return!1;r=n.to}else if(r=So(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},ks=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&io(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},As=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
8
+ `).scrollIntoView()),!0)};function js(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var Ms=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=js(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(L.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Ns=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Zo||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=js(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(R.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},Ps=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(_o(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&io(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function Fs(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof z&&t.selection.node.isBlock)return!r.parentOffset||!_o(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=js(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof R||t.selection instanceof Zo)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=_o(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,_o(u.doc,d,a.length,a)),u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}var Is=Fs(),Ls=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(z.create(e.doc,i))),!0)},Rs=(e,t)=>(t&&t(e.tr.setSelection(new Zo(e.doc))),!0);function zs(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||yo(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function Bs(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&zs(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=P.empty;for(let e=o.length-1;e>=0;e--)s=P.from(o[e].create(null,s));s=P.from(i.copy(s));let c=e.tr.step(new Qa(t.pos-1,r,t.pos,r,new I(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&yo(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:L.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&io(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&bs(a,`start`,!0)&&bs(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=P.empty;for(let e=o.length-1;e>=0;e--)r=P.from(o[e].copy(r));n(e.tr.step(new Qa(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new I(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Vs(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(R.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var Hs=Vs(-1),Us=Vs(1);function Ws(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&oo(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function Gs(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function Ks(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var qs=Ks(ms,gs,xs),Js=Ks(ms,ws,Ts),Ys={Enter:Ks(As,Ns,Ps,Is),"Mod-Enter":Ms,Backspace:qs,"Mod-Backspace":qs,"Shift-Backspace":qs,Delete:Js,"Mod-Delete":Js,"Mod-a":Rs},Xs={"Ctrl-h":Ys.Backspace,"Alt-Backspace":Ys[`Mod-Backspace`],"Ctrl-d":Ys.Delete,"Ctrl-Alt-Backspace":Ys[`Mod-Delete`],"Alt-Delete":Ys[`Mod-Delete`],"Alt-d":Ys[`Mod-Delete`],"Ctrl-a":Hs,"Ctrl-e":Us};for(let e in Ys)Xs[e]=Ys[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();var Zs=[`ol`,0],Qs=[`ul`,0],$s=[`li`,0],ec={attrs:{order:{default:1,validate:`number`}},parseDOM:[{tag:`ol`,getAttrs(e){return{order:e.hasAttribute(`start`)?+e.getAttribute(`start`):1}}}],toDOM(e){return e.attrs.order==1?Zs:[`ol`,{start:e.attrs.order},0]}},tc={parseDOM:[{tag:`ul`}],toDOM(){return Qs}},nc={parseDOM:[{tag:`li`}],toDOM(){return $s},defining:!0};function rc(e,t){let n={};for(let t in e)n[t]=e[t];for(let e in t)n[e]=t[e];return n}function ic(e,t,n){return e.append({ordered_list:rc(ec,{content:`list_item+`,group:n}),bullet_list:rc(tc,{content:`list_item+`,group:n}),list_item:rc(nc,{content:t})})}function ac(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return oc(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function oc(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new Ni(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new Ni(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=oo(a,n,r,t);return s?(e&&sc(e,t,s,i,n),!0):!1}function sc(e,t,n,r,i){let a=P.empty;for(let e=n.length-1;e>=0;e--)a=P.from(n[e].type.create(n[e].attrs,a));e.step(new Qa(t.start-(r?2:0),t.end,t.start,t.end,new I(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&_o(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function cc(e,t){return function(n,r){let{$from:i,$to:a,node:o}=n.selection;if(o&&o.isBlock||i.depth<2||!i.sameParent(a))return!1;let s=i.node(-1);if(s.type!=e)return!1;if(i.parent.content.size==0&&i.node(-1).childCount==i.indexAfter(-1)){if(i.depth==3||i.node(-3).type!=e||i.index(-2)!=i.node(-2).childCount-1)return!1;if(r){let t=P.empty,a=i.index(-1)?1:i.index(-2)?2:3;for(let e=i.depth-a;e>=i.depth-3;e--)t=P.from(i.node(e).copy(t));let o=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3;t=t.append(P.from(e.createAndFill()));let s=i.before(i.depth-(a-1)),c=n.tr.replace(s,i.after(-o),new I(t,4-a,0)),l=-1;c.doc.nodesBetween(s,c.doc.content.size,(e,t)=>{if(l>-1)return!1;e.isTextblock&&e.content.size==0&&(l=t+1)}),l>-1&&c.setSelection(L.near(c.doc.resolve(l))),r(c.scrollIntoView())}return!0}let c=a.pos==i.end()?s.contentMatchAt(0).defaultType:null,l=n.tr.delete(i.pos,a.pos),u=c?[t?{type:e,attrs:t}:null,{type:c}]:void 0;return _o(l.doc,i.pos,2,u)?(r&&r(l.split(i.pos,2,u).scrollIntoView()),!0):!1}}function lc(e,t){let n=cc(e,t);return(e,t)=>n(e,t&&(n=>{let r=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();r&&n.ensureMarks(r),t(n)}))}function uc(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?dc(t,n,e,a):fc(t,n,a):!0:!1}}function dc(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new Qa(a-1,o,a,o,new I(P.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ni(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=io(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return yo(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function fc(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+(s?0:1),u+1,o.content.append(c?P.empty:P.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new Qa(d-(s?1:0),f+(c?1:0),d+1,f-1,new I((s?P.empty:P.from(i.copy(P.empty))).append(c?P.empty:P.from(i.copy(P.empty))),s?0:1,c?0:1),s?0:1)),t(r.scrollIntoView()),!0}function pc(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=P.from(r?e.create():null),o=new I(P.from(e.create(null,P.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new Qa(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var mc=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},hc=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},gc=null,_c=function(e,t,n){let r=gc||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},vc=function(){gc=null},yc=function(e,t,n,r){return n&&(xc(e,t,n,r,-1)||xc(e,t,n,r,1))},bc=/^(img|br|input|textarea|hr)$/i;function xc(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Sc(e))){let n=e.parentNode;if(!n||n.nodeType!=1||Ec(e)||bc.test(e.nodeName)||e.contentEditable==`false`)return!1;t=mc(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?Sc(e):0}else return!1}}function Sc(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Cc(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=Sc(e)}else if(e.parentNode&&!Ec(e))t=mc(e),e=e.parentNode;else return null}}function wc(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!Ec(e))t=mc(e)+1,e=e.parentNode;else return null}}function Tc(e,t,n){for(let r=t==0,i=t==Sc(e);r||i;){if(e==n)return!0;let t=mc(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==Sc(e)}}function Ec(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var Dc=function(e){return e.focusNode&&yc(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Oc(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function kc(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Ac(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Sc(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Sc(r.startContainer),r.startOffset)}}}var jc=typeof navigator<`u`?navigator:null,Mc=typeof document<`u`?document:null,Nc=jc&&jc.userAgent||``,Pc=/Edge\/(\d+)/.exec(Nc),Fc=/MSIE \d/.exec(Nc),Ic=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Nc),Lc=!!(Fc||Ic||Pc),Rc=Fc?document.documentMode:Ic?+Ic[1]:Pc?+Pc[1]:0,zc=!Lc&&/gecko\/(\d+)/i.test(Nc);zc&&+(/Firefox\/(\d+)/.exec(Nc)||[0,0])[1];var Bc=!Lc&&/Chrome\/(\d+)/.exec(Nc),Vc=!!Bc,Hc=Bc?+Bc[1]:0,Uc=!Lc&&!!jc&&/Apple Computer/.test(jc.vendor),Wc=Uc&&(/Mobile\/\w+/.test(Nc)||!!jc&&jc.maxTouchPoints>2),Gc=Wc||(jc?/Mac/.test(jc.platform):!1),Kc=jc?/Win/.test(jc.platform):!1,qc=/Android \d/.test(Nc),Jc=!!Mc&&`webkitFontSmoothing`in Mc.documentElement.style,Yc=Jc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Xc(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Zc(e,t){return typeof e==`number`?e:e[t]}function Qc(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function $c(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=hc(o);continue}let e=o,n=e==a.body,s=n?Xc(a):Qc(e),c=0,l=0;if(t.top<s.top+Zc(r,`top`)?l=-(s.top-t.top+Zc(i,`top`)):t.bottom>s.bottom-Zc(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+Zc(i,`top`)-s.top:t.bottom-s.bottom+Zc(i,`bottom`)),t.left<s.left+Zc(r,`left`)?c=-(s.left-t.left+Zc(i,`left`)):t.right>s.right-Zc(r,`right`)&&(c=t.right-s.right+Zc(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:hc(o)}}function el(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:tl(e.dom)}}function tl(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=hc(r));return t}function nl({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;rl(n,r==0?0:r-t)}function rl(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var il=null;function al(e){if(e.setActive)return e.setActive();if(il)return e.focus(il);let t=tl(e);e.focus(il==null?{get preventScroll(){return il={preventScroll:!0},!0}}:void 0),il||(il=!1,rl(t,0))}function ol(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=_c(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?sl(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:ol(n,i)}function sl(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=hl(r,1);if(n.top!=n.bottom&&cl(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}function cl(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function ll(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function ul(e,t,n){let{node:r,offset:i}=ol(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function dl(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function fl(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(cl(t,i))return fl(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function pl(e,t){let n=e.dom.ownerDocument,r,i=0,a=Ac(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!cl(t,n)||(o=fl(e.dom,t,n),!o))return null}if(Uc)for(let e=o;r&&e;e=hc(e))e.draggable&&(r=void 0);if(o=ll(o,t),r){if(zc&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;Jc&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=dl(e,r,i,t))}s??=ul(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function ml(e){return e.top<e.bottom||e.left<e.right}function hl(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(ml(e))return e}return Array.prototype.find.call(n,ml)||e.getBoundingClientRect()}var gl=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function _l(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=Jc||zc;if(r.nodeType==3)if(o&&(gl.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=hl(_c(r,i,i),n);if(zc&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=hl(_c(r,i-1,i-1),-1);if(t.top==e.top){let n=hl(_c(r,i,i+1),-1);if(n.top!=e.top)return vl(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,vl(hl(_c(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==Sc(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return yl(e.getBoundingClientRect(),!1)}if(a==null&&i<Sc(r)){let e=r.childNodes[i];if(e.nodeType==1)return yl(e.getBoundingClientRect(),!0)}return yl(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==Sc(r))){let e=r.childNodes[i-1],t=e.nodeType==3?_c(e,Sc(e)-(o?0:1)):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return vl(hl(t,1),!1)}if(a==null&&i<Sc(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?_c(e,0,o?0:1):e.nodeType==1?e:null:null;if(t)return vl(hl(t,-1),!0)}return vl(hl(r.nodeType==3?_c(r):r,-n),n>=0)}function vl(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function yl(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function bl(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function xl(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return bl(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=_l(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=_c(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var Sl=/[\u0590-\u08ac]/;function Cl(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!Sl.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:bl(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var wl=null,Tl=null,El=!1;function Dl(e,t,n){return wl==t&&Tl==n?El:(wl=t,Tl=n,El=n==`up`||n==`down`?xl(e,t,n):Cl(e,t,n))}var Ol=0,kl=1,Al=2,jl=3,Ml=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=Ol,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>mc(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof zl){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof Nl&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?mc(e.dom)+1:0}}else{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?mc(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=mc(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=mc(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((zc||Uc)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
9
+ `),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:mc(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(zc&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&Uc)&&yc(o.node,o.offset,l.anchorNode,l.anchorOffset)&&yc(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!u){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?Al:kl,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=jl:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Al:jl}n=a}this.dirty=Al}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?Al:kl;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},Nl=class extends Ml{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==Ol&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(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}},Pl=class extends Ml{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},Fl=class e extends Ml{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=wa.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&jl||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=jl&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Ol){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=Ol}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=nu(a,n,o,r)),t>0&&(a=nu(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},Il=class e extends Ml{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=wa.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=ql(u,r,n),l?c=new Bl(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new Rl(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,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 t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>P.empty)}return e}matchesNode(e,t,n){return this.dirty==Ol&&e.eq(this.node)&&Jl(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new Xl(this,a&&a.node,e);$l(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?F.none:this.node.child(i).marks,n,e),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==Al)&&(a&&this.protectLocalComposition(e,a),Vl(this.contentDOM,this.children,e),Wc&&eu(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof R)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=tu(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new Pl(this,i,t,r);e.input.compositionNodes.push(a),this.children=nu(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==jl||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Ol}updateOuterDeco(e){if(Jl(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Gl(this.dom,this.nodeDOM,Wl(this.outerDeco,this.node,t),Wl(e,this.node,t)),this.dom!=n&&(n.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.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function Ll(e,t,n,r,i){ql(r,t,e);let a=new Il(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var Rl=class e extends Il{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==jl||this.dirty!=Ol&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Ol||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=Ol,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=jl)}get domAtom(){return!1}isText(e){return this.node.text==e}},zl=class extends Ml{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ol&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},Bl=class extends Il{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==jl)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Vl(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=Yl(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof Fl){let t=r?r.previousSibling:e.lastChild;Vl(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Yl(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var Hl=function(e){e&&(this.nodeName=e)};Hl.prototype=Object.create(null);var Ul=[new Hl];function Wl(e,t,n){if(e.length==0)return Ul;let r=n?Ul[0]:new Hl,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o)for(let e in o.nodeName&&i.push(r=new Hl(o.nodeName)),o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new Hl(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}return i}function Gl(e,t,n,r){if(n==Ul&&r==Ul)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=Ul[0],i=t)}Kl(i,o||Ul[0],a)}return i}function Kl(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function ql(e,t,n){return Gl(e,e,Ul,Wl(t,n,e.nodeType!=1))}function Jl(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Yl(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var Xl=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Zl(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,i=this.stack.length>>1,a=Math.min(i,e.length);for(;r<a&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&e[r].type.spec.spanning!==!1;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=Ol,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++){let n=this.top.children[t];if(n.matchesMark(e[i])&&!this.isLocked(n.dom)){r=t;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=Fl.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==jl&&a.dom==a.contentDOM&&(a.dirty=Al),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof Il){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=jl&&Jl(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=Al,u.updateChildren(r,a+1),u.dirty=Ol),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Jl(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=Il.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=Il.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new Nl(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Fl;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Rl)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Uc||Vc)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new zl(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function Zl(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof Fl)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function Ql(e,t){return e.type.side-t.type.side}function $l(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(Ql);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function eu(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function tu(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function nu(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function ru(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(Dc(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&z.isSelectable(e)&&i.parent&&!(e.isInline&&Tc(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new z(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=mu(e,u,s,n)}return l}function iu(e){return e.editable?e.hasFocus():gu(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function au(e,t=!1){let n=e.state.selection;if(fu(e,n),iu(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Vc){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&yc(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)du(e);else{let{anchor:r,head:i}=n,a,o;ou&&!(n instanceof R)&&(n.$from.parent.inlineContent||(a=su(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=su(e,n.to))),e.docView.setSelection(r,i,e,t),ou&&(a&&lu(a),o&&lu(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&uu(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var ou=Uc||Vc&&Hc<63;function su(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(Uc&&i&&i.contentEditable==`false`)return cu(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return cu(i);if(a)return cu(a)}}function cu(e){return e.contentEditable=`true`,Uc&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function lu(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function uu(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!iu(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function du(e){let t=e.domSelection(),n=document.createRange();if(!t)return;let r=e.cursorWrapper.dom,i=r.nodeName==`IMG`;i?n.setStart(r.parentNode,mc(r)+1):n.setStart(r,0),n.collapse(!0),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&Lc&&Rc<=11&&(r.disabled=!0,r.disabled=!1)}function fu(e,t){if(t instanceof z){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(pu(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else pu(e)}function pu(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function mu(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||R.between(t,n,r)}function hu(e){return e.editable&&!e.hasFocus()?!1:gu(e)}function gu(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function _u(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return yc(t.node,t.offset,n.anchorNode,n.anchorOffset)}function vu(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&L.findFrom(a,t)}function yu(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function bu(e,t,n){let r=e.state.selection;if(r instanceof R)if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return yu(e,new R(r.$anchor,a))}else if(r.empty){if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=vu(e.state,t);return n&&n instanceof z?yu(e,n):!1}else if(!(Gc&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?z.isSelectable(i)?yu(e,new z(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):Jc?yu(e,new R(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else return!1;else if(r instanceof z&&r.node.isInline)return yu(e,new R(t>0?r.$to:r.$from));else{let n=vu(e.state,t);return n?yu(e,n):!1}}function xu(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Su(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function Cu(e,t){return t<0?wu(e):Tu(e)}function wu(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(zc&&n.nodeType==1&&r<xu(n)&&Su(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(Su(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(Eu(n))break;else{let t=n.previousSibling;for(;t&&Su(t,-1);)i=n.parentNode,a=mc(t),t=t.previousSibling;if(t)n=t,r=xu(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?ku(e,n,r):i&&ku(e,i,a)}function Tu(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=xu(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(Su(e,1))a=n,o=++r;else break}else if(Eu(n))break;else{let t=n.nextSibling;for(;t&&Su(t,1);)a=t.parentNode,o=mc(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=xu(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&ku(e,a,o)}function Eu(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Du(e,t){for(;e&&t==e.childNodes.length&&!Ec(e);)t=mc(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function Ou(e,t){for(;e&&!t&&!Ec(e);)t=mc(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function ku(e,t,n){if(t.nodeType!=3){let e,r;(r=Du(t,n))?(t=r,n=0):(e=Ou(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Dc(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&au(e)},50)}function Au(e,t){let n=e.state.doc.resolve(t);if(!(Vc||Kc)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function ju(e,t,n){let r=e.state.selection;if(r instanceof R&&!r.empty||n.indexOf(`s`)>-1||Gc&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=vu(e.state,t);if(n&&n instanceof z)return yu(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof Zo?L.near(n,t):L.findFrom(n,t);return o?yu(e,o):!1}return!1}function Mu(e,t){if(!(e.state.selection instanceof R))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function Nu(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Pu(e){if(!Uc||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;Nu(e,n,`true`),setTimeout(()=>Nu(e,n,`false`),20)}return!1}function Fu(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function Iu(e,t){let n=t.keyCode,r=Fu(t);if(n==8||Gc&&n==72&&r==`c`)return Mu(e,-1)||Cu(e,-1);if(n==46&&!t.shiftKey||Gc&&n==68&&r==`c`)return Mu(e,1)||Cu(e,1);if(n==13||n==27)return!0;if(n==37||Gc&&n==66&&r==`c`){let t=n==37?Au(e,e.state.selection.from)==`ltr`?-1:1:-1;return bu(e,t,r)||Cu(e,t)}else if(n==39||Gc&&n==70&&r==`c`){let t=n==39?Au(e,e.state.selection.from)==`ltr`?1:-1:1;return bu(e,t,r)||Cu(e,t)}else if(n==38||Gc&&n==80&&r==`c`)return ju(e,-1,r)||Cu(e,-1);else if(n==40||Gc&&n==78&&r==`c`)return Pu(e)||ju(e,1,r)||Cu(e,1);else if(r==(Gc?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function Lu(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||wa.fromSchema(e.state.schema),s=Ju(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=Ku[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
10
+
11
+ `),slice:t}}function Ru(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return t?new I(P.from(e.state.schema.text(t.replace(/\r\n?/g,`
12
+ `))),0,0):I.empty;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=wa.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=Zu(n),Jc&&Qu(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||ua.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!zu.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=$u(Gu(s,+u[1],+u[2]),u[4]);else if(s=I.maxOpen(Bu(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Gu(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e)}),s}var zu=/^(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 Bu(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&Hu(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=Uu(a[a.length-1],i.length));let n=Vu(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return P.from(a)}return e}function Vu(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,P.from(e));return e}function Hu(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=Hu(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(P.from(Vu(n,e,i+1))))}}function Uu(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,Uu(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(P.empty,!0);return e.copy(n.append(r))}function Wu(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=Wu(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(P.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function Gu(e,t,n){return t<e.openStart&&(e=new I(Wu(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new I(Wu(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Ku={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},qu=null;function Ju(){return qu||=document.implementation.createHTMLDocument(`title`)}var Yu=null;function Xu(e){let t=window.trustedTypes;return t?(Yu||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),Yu.createHTML(e)):e}function Zu(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Ju().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&Ku[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=Xu(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function Qu(e){let t=e.querySelectorAll(Vc?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function $u(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=P.from(t.create(r[e+1],i)),a++,o++}return new I(i,a,o)}var ed={},td={},nd={touchstart:!0,touchmove:!0},rd=class{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.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function id(e){for(let t in ed){let n=ed[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{ld(e,t)&&!cd(e,t)&&(e.editable||!(t.type in td))&&n(e,t)},nd[t]?{passive:!0}:void 0)}Uc&&e.dom.addEventListener(`input`,()=>null),sd(e)}function ad(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function od(e){for(let t in e.domObserver.stop(),e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function sd(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>cd(e,t))})}function cd(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function ld(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function ud(e,t){!cd(e,t)&&ed[t.type]&&(e.editable||!(t.type in td))&&ed[t.type](e,t)}td.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!wd(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(qc&&Vc&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Wc&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,Oc(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||Iu(e,n)?n.preventDefault():ad(e,`key`)},td.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},td.keypress=(e,t)=>{let n=t;if(wd(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Gc&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof R)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function dd(e){return{left:e.clientX,top:e.clientY}}function fd(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function pd(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function md(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function hd(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&z.isSelectable(r)?(md(e,new z(n),`pointer`),!0):!1}function gd(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof z&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(z.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(md(e,z.create(e.state.doc,i),`pointer`),!0)}function _d(e,t,n,r,i){return pd(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?gd(e,n):hd(e,n))}function vd(e,t,n,r){return pd(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function yd(e,t,n,r){return pd(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||bd(e,n,r)}function bd(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(md(e,R.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)md(e,R.create(r,a+1,a+1+n.content.size),`pointer`);else if(z.isSelectable(n))md(e,z.create(r,a),`pointer`);else continue;return!0}}function xd(e){return Ad(e)}var Sd=Gc?`metaKey`:`ctrlKey`;ed.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=xd(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&fd(n,e.input.lastClick)&&!n[Sd]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(dd(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Cd(e,o,n,!!r)):(a==`doubleClick`?vd:yd)(e,o.pos,o.inside,n)?n.preventDefault():ad(e,`pointer`))};var Cd=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Sd],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.dom.nodeType==1?s.dom:null;let{selection:c}=e.state;(n.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof z&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&zc&&!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)),ad(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(()=>au(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(dd(e))),this.updateAllowDefault(e),this.allowDefault||!t?ad(this.view,`pointer`):_d(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Uc&&this.mightDrag&&!this.mightDrag.node.isAtom||Vc&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(md(this.view,L.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):ad(this.view,`pointer`)}move(e){this.updateAllowDefault(e),ad(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)}};ed.touchstart=e=>{e.input.lastTouch=Date.now(),xd(e),ad(e,`pointer`)},ed.touchmove=e=>{e.input.lastTouch=Date.now(),ad(e,`pointer`)},ed.contextmenu=e=>xd(e);function wd(e,t){return e.composing?!0:Uc&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var Td=qc?5e3:-1;td.compositionstart=td.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof R&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),Ad(e,!0),e.markCursor=null;else if(Ad(e,!t.selection.empty),zc&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}Ed(e,Td)},td.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Ed(e,20))};function Ed(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Ad(e),t))}function Dd(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=kd());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Od(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Cc(t.focusNode,t.focusOffset),r=wc(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function kd(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function Ad(e,t=!1){if(!(qc&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Dd(e),t||e.docView&&e.docView.dirty){let n=ru(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function jd(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var Md=Lc&&Rc<15||Wc&&Yc<604;ed.copy=td.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=Md?null:n.clipboardData,{dom:o,text:s}=Lu(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):jd(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function Nd(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Pd(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Fd(e,r.value,null,i,t):Fd(e,r.textContent,r.innerHTML,i,t)},50)}function Fd(e,t,n,r,i){let a=Ru(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||I.empty)))return!0;if(!a)return!1;let o=Nd(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function Id(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}td.paste=(e,t)=>{let n=t;if(e.composing&&!qc)return;let r=Md?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Fd(e,Id(r),r.getData(`text/html`),i,n)?n.preventDefault():Pd(e,n)};var Ld=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},Rd=Gc?`altKey`:`ctrlKey`;function zd(e,t){return e.someProp(`dragCopies`,e=>!e(t))??!t[Rd]}for(let e in ed.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(dd(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof z?i.to-1:i.to))){if(r&&r.mightDrag)o=z.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=z.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=Lu(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!Vc||Hc>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Md?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,Md||n.dataTransfer.setData(`text/plain`,c),e.dragging=new Ld(l,zd(e,n),o)},ed.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},td.dragover=td.dragenter=(e,t)=>t.preventDefault(),td.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(dd(n));if(!i)return;let a=e.state.doc.resolve(i.pos),o=r&&r.slice;o?e.someProp(`transformPasted`,t=>{o=t(o,e)}):o=Ru(e,Id(n.dataTransfer),Md?null:n.dataTransfer.getData(`text/html`),!1,a);let s=!!(r&&zd(e,n));if(e.someProp(`handleDrop`,t=>t(e,n,o||I.empty,s))){n.preventDefault();return}if(!o)return;n.preventDefault();let c=o?To(e.state.doc,a.pos,o):a.pos;c??=a.pos;let l=e.state.tr;if(s){let{node:e}=r;e?e.replace(l):l.deleteSelection()}let u=l.mapping.map(c),d=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,f=l.doc;if(d?l.replaceRangeWith(u,u,o.content.firstChild):l.replaceRange(u,u,o),l.doc.eq(f))return;let p=l.doc.resolve(u);if(d&&z.isSelectable(o.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(o.content.firstChild))l.setSelection(new z(p));else{let t=l.mapping.map(c);l.mapping.maps[l.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),l.setSelection(mu(e,p,l.doc.resolve(t)))}e.focus(),e.dispatch(l.setMeta(`uiEvent`,`drop`))},ed.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&au(e)},20))},ed.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},ed.beforeinput=(e,t)=>{if(Vc&&qc&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,Oc(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}},td)ed[e]=td[e];function Bd(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var Vd=class e{constructor(e,t){this.toDOM=e,this.spec=t||Kd,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new Wd(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Bd(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Hd=class e{constructor(e,t){this.attrs=e,this.spec=t||Kd}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new Wd(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&Bd(this.attrs,t.attrs)&&Bd(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},Ud=class e{constructor(e,t){this.attrs=e,this.spec=t||Kd}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new Wd(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&Bd(this.attrs,t.attrs)&&Bd(this.spec,t.spec)}destroy(){}},Wd=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new Vd(n,r))}static inline(t,n,r,i){return new e(t,n,new Hd(r,i))}static node(t,n,r,i){return new e(t,n,new Ud(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Hd}get widget(){return this.type instanceof Vd}},Gd=[],Kd={},H=class e{constructor(e,t){this.local=e.length?e:Gd,this.children=t.length?t:Gd}static create(e,t){return t.length?ef(t,e,0,Kd):qd}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==qd||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Kd)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?Yd(this.children,o||[],t,n,r,i,a):o?new e(o.sort(tf),Gd):qd}add(t,n){return n.length?this==qd?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=Qd(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,ef(s,e,o+1,Kd)),a+=3}});let o=Xd(a?$d(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(tf):this.local,i||this.children)}remove(e){return e.length==0||this==qd?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==qd?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):qd}forChild(t,n){if(this==qd)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof Hd){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(tf),Gd);return r?new Jd([t,r]):t}return r||qd}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return nf(this.localsInner(e))}localsInner(e){if(this==qd)return Gd;if(e.inlineContent||!this.local.some(Hd.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Hd||t.push(this.local[e]);return t}forEachSet(e){e(this)}};H.empty=new H([],[]),H.removeOverlap=nf;var qd=H.empty,Jd=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,Kd));return e.from(r)}forChild(t,n){if(n.isLeaf)return H.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=qd&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?nf(n?t:t.sort(tf)):Gd}static from(t){switch(t.length){case 0:return qd;case 1:return t[0];default:return new e(t.every(e=>e instanceof H)?t:t.reduce((e,t)=>e.concat(t instanceof H?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function Yd(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==qd?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=ef(Zd(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new H(t.sort(tf),s)}function Xd(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Wd(i.from+t,i.to+t,i.type))}return n}function Zd(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function Qd(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function $d(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function ef(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=Qd(e,t,o+n);if(s){a=!0;let e=ef(s,t,n+o+1,r);e!=qd&&i.push(o,o+t.nodeSize,e)}});let o=Xd(a?$d(e):e,-n).sort(tf);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new H(o,i):qd}function tf(e,t){return e.from-t.from||e.to-t.to}function nf(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),rf(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),rf(t,i,r.copy(a.from,r.to)));break}}}return t}function rf(e,t,n){for(;t<e.length&&tf(n,e[t])>0;)t++;e.splice(t,0,n)}function af(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=qd&&t.push(r)}),e.cursorWrapper&&t.push(H.create(e.state.doc,[e.cursorWrapper.deco])),Jd.from(t)}var of={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},sf=Lc&&Rc<=11,cf=class{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}},lf=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new cf,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);Lc&&Rc<=11&&e.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),sf&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,of)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(hu(this.view)){if(this.suppressingSelectionUpdates)return au(this.view);if(Lc&&Rc<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&yc(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=hc(n))t.add(n);for(let r=e.anchorNode;r;r=hc(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))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 t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&hu(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(zc&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||hf(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Dc(n)&&(c=ru(e))&&c.eq(L.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,au(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),ff(e)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||au(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(Lc&&Rc<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?mc(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?mc(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},uf=new WeakMap,df=!1;function ff(e){if(!uf.has(e)&&(uf.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=zc,df)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.`),df=!0}}function pf(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return yc(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function mf(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return pf(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?pf(e,n):null}function hf(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function gf(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],Dc(c)||l.push({node:c.focusNode,offset:c.focusOffset})),Vc&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||ua.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:_f,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function _f(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(Uc&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||Uc&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}var vf=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function yf(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=ru(e,t);if(n&&!e.state.selection.eq(n)){if(Vc&&qc&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,Oc(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=gf(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=wf(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(Wc&&e.input.lastIOSEnter>Date.now()-225||qc)&&i.some(e=>e.nodeType==1&&!vf.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,Oc(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof R&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=bf(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof R&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),Lc&&Rc<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA,y;if((Wc&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``))&&(y=L.findFrom(l.doc.resolve(h.pos+1),1,!0))&&y.head>h.pos)&&e.someProp(`handleKeyDown`,t=>t(e,Oc(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&Sf(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,Oc(8,`Backspace`)))){qc&&Vc&&e.domObserver.suppressSelectionUpdates();return}Vc&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),qc&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,Oc(13,`Enter`))})},20));let b=m.start,x=m.endA,S=t=>{let n=t||e.state.tr.replace(b,x,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=bf(e,n.doc,l.sel);t&&!(Vc&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==b||t.head==n.mapping.map(x)-1)||Lc&&t.empty&&t.head==b)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},C;if(v){if(h.pos==g.pos){Lc&&Rc<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>au(e),20));let t=S(e.state.tr.delete(b,x)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(C=xf(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=S(e.state.tr);C.type==`add`?t.addMark(b,x,C.mark):t.removeMark(b,x,C.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-(g.textOffset?0:1)){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>S(e.state.tr.insertText(t,b,x));e.someProp(`handleTextInput`,r=>r(e,b,x,t,n))||e.dispatch(n())}}else e.dispatch(S())}function bf(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:mu(e,t.resolve(n.anchor),t.resolve(n.head))}function xf(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(P.from(l).eq(e))return{mark:s,type:o}}function Sf(e,t,n,r,i){if(n-t<=i.pos-r.pos||Cf(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(Cf(a,!0,!0));return!o.parent.isTextblock||o.pos>n||Cf(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Cf(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function wf(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&Tf(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&Tf(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function Tf(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}var Ef=Ru,Df=Ad,Of=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new rd,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Ff),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=jf(this),Af(this),this.nodeViews=Nf(this),this.docView=Ll(this.state.doc,kf(this),af(this),this.dom,this),this.domObserver=new lf(this,(e,t,n,r)=>yf(this,e,t,n,r)),this.domObserver.start(),id(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;for(let t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&sd(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Ff),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];for(let n in t.state=this.state,e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(Dd(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Nf(this);Pf(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&sd(this),this.editable=jf(this),Af(this);let o=af(this),s=kf(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&el(this);if(i){this.domObserver.stop();let t=l&&(Lc||Vc)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&Mf(n.selection,e.selection);if(l){let n=Vc?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Od(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=Ll(e.doc,s,o,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&_u(this))?au(this,t):(fu(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&nl(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof z){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&$c(this,t.getBoundingClientRect(),e)}else $c(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 e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new Ld(e.slice,e.move,r<0?void 0:z.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(Lc){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&&al(this.dom),au(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return pl(this,e)}coordsAtPos(e,t=1){return _l(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return Dl(this,t||this.state,e)}pasteHTML(e,t){return Fd(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return Fd(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return Lu(this,e)}destroy(){this.docView&&(od(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],af(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,vc())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return ud(this,e)}domSelectionRange(){let e=this.domSelection();return e?Uc&&this.root.nodeType===11&&kc(this.dom.ownerDocument)==this.dom&&mf(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};Of.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function kf(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[Wd.node(0,e.state.doc.content.size,t)]}function Af(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:Wd.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function jf(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function Mf(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function Nf(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function Pf(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function Ff(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}var If={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:`'`},Lf={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},Rf=typeof navigator<`u`&&/Chrome\/(\d+)/.exec(navigator.userAgent);typeof navigator<`u`&&/Gecko\/\d+/.test(navigator.userAgent);for(var zf=typeof navigator<`u`&&/Mac/.test(navigator.platform),Bf=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Vf=zf||Rf&&+Rf[1]<57,Hf=0;Hf<10;Hf++)If[48+Hf]=If[96+Hf]=String(Hf);for(var Hf=1;Hf<=24;Hf++)If[Hf+111]=`F`+Hf;for(var Hf=65;Hf<=90;Hf++)If[Hf]=String.fromCharCode(Hf+32),Lf[Hf]=String.fromCharCode(Hf);for(var Uf in If)Lf.hasOwnProperty(Uf)||(Lf[Uf]=If[Uf]);function Wf(e){var t=!(Vf&&(e.ctrlKey||e.altKey||e.metaKey)||Bf&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?Lf:If)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var Gf=typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Kf(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))Gf?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function qf(e){let t=Object.create(null);for(let n in e)t[Kf(n)]=e[n];return t}function Jf(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function Yf(e){return new B({props:{handleKeyDown:Xf(e)}})}function Xf(e){let t=qf(e);return function(e,n){let r=Wf(n),i,a=t[Jf(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[Jf(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.shiftKey||n.altKey||n.metaKey||r.charCodeAt(0)>127)&&(i=If[n.keyCode])&&i!=r){let r=t[Jf(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var Zf=Object.defineProperty,Qf=(e,t)=>{for(var n in t)Zf(e,n,{get:t[n],enumerable:!0})};function $f(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var ep=class{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(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:$f({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},tp={};Qf(tp,{blur:()=>np,clearContent:()=>rp,clearNodes:()=>ip,command:()=>ap,createParagraphNear:()=>op,cut:()=>sp,deleteCurrentNode:()=>cp,deleteNode:()=>up,deleteRange:()=>dp,deleteSelection:()=>fp,enter:()=>pp,exitCode:()=>mp,extendMarkRange:()=>xp,first:()=>Sp,focus:()=>Op,forEach:()=>kp,insertContent:()=>Ap,insertContentAt:()=>Ip,joinBackward:()=>zp,joinDown:()=>Rp,joinForward:()=>Bp,joinItemBackward:()=>Vp,joinItemForward:()=>Hp,joinTextblockBackward:()=>Up,joinTextblockForward:()=>Wp,joinUp:()=>Lp,keyboardShortcut:()=>qp,lift:()=>Yp,liftEmptyBlock:()=>Xp,liftListItem:()=>Zp,newlineInCode:()=>Qp,resetAttributes:()=>tm,scrollIntoView:()=>nm,selectAll:()=>rm,selectNodeBackward:()=>im,selectNodeForward:()=>am,selectParentNode:()=>om,selectTextblockEnd:()=>sm,selectTextblockStart:()=>cm,setContent:()=>um,setMark:()=>lh,setMeta:()=>uh,setNode:()=>dh,setNodeSelection:()=>fh,setTextDirection:()=>ph,setTextSelection:()=>mh,sinkListItem:()=>hh,splitBlock:()=>_h,splitListItem:()=>vh,toggleList:()=>xh,toggleMark:()=>Sh,toggleNode:()=>Ch,toggleWrap:()=>wh,undoInputRule:()=>Th,unsetAllMarks:()=>Eh,unsetMark:()=>Dh,unsetTextDirection:()=>Oh,updateAttributes:()=>kh,wrapIn:()=>Ah,wrapInList:()=>jh});var np=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),rp=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),ip=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=io(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},ap=e=>t=>e(t),op=()=>({state:e,dispatch:t})=>Ns(e,t),sp=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new R(r.doc.resolve(Math.max(o-1,0)))),!0},cp=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function lp(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var up=e=>({tr:t,state:n,dispatch:r})=>{let i=lp(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},dp=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},fp=()=>({state:e,dispatch:t})=>ms(e,t),pp=()=>({commands:e})=>e.keyboardShortcut(`Enter`),mp=()=>({state:e,dispatch:t})=>Ms(e,t);function hp(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function gp(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:hp(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function _p(e,t,n={}){return e.find(e=>e.type===t&&gp(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function vp(e,t,n={}){return!!_p(e,t,n)}function yp(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t)||(n||=r.node.marks[0]?.attrs,!_p([...r.node.marks],t,n)))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&vp([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&vp([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function bp(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var xp=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=bp(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=yp(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=R.create(o,e.from,e.to);n.setSelection(t)}}return!0},Sp=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function Cp(e){return e instanceof R}function wp(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Tp(e,t=null){if(!t)return null;let n=L.atStart(e),r=L.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?R.create(e,wp(0,i,a),wp(e.content.size,i,a)):R.create(e,wp(t,i,a),wp(t,i,a))}function Ep(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function Dp(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}var Op=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(Dp()||Ep())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(a&&e===null&&!Cp(n.state.selection))return o(),!0;let s=Tp(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},kp=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),Ap=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),jp=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&jp(r)}return e};function Mp(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return jp(n)}function Np(e,t,n){if(e instanceof Fi||e instanceof P)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return P.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),Np(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new oa({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?ua.fromSchema(a).parseSlice(Mp(e),n.parseOptions):ua.fromSchema(a).parse(Mp(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=ua.fromSchema(t);return n.slice?r.parseSlice(Mp(e),n.parseOptions).content:r.parse(Mp(e),n.parseOptions)}return Np(``,t,n)}function Pp(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Za||i instanceof Qa))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(L.near(e.doc.resolve(o),n))}var Fp=e=>!(`type`in e),Ip=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{Np(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=Np(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((Fp(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof P){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&Pp(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},Lp=()=>({state:e,dispatch:t})=>Ds(e,t),Rp=()=>({state:e,dispatch:t})=>Os(e,t),zp=()=>({state:e,dispatch:t})=>gs(e,t),Bp=()=>({state:e,dispatch:t})=>ws(e,t),Vp=()=>({state:e,dispatch:t,tr:n})=>{try{let r=So(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Hp=()=>({state:e,dispatch:t,tr:n})=>{try{let r=So(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Up=()=>({state:e,dispatch:t})=>_s(e,t),Wp=()=>({state:e,dispatch:t})=>vs(e,t);function Gp(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function Kp(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))Dp()||Gp()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var qp=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=Kp(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function Jp(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?lp(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>gp(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var Yp=(e,t={})=>({state:n,dispatch:r})=>Jp(n,lp(e,n.schema),t)?ks(n,r):!1,Xp=()=>({state:e,dispatch:t})=>Ps(e,t),Zp=e=>({state:t,dispatch:n})=>uc(lp(e,t.schema))(t,n),Qp=()=>({state:e,dispatch:t})=>As(e,t);function $p(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function em(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var tm=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=$p(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=lp(e,r.schema)),s===`mark`&&(o=bp(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,em(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(em(a.attrs,t))))})})}),c},nm=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),rm=()=>({tr:e,dispatch:t})=>{if(t){let t=new Zo(e.doc);e.setSelection(t)}return!0},im=()=>({state:e,dispatch:t})=>xs(e,t),am=()=>({state:e,dispatch:t})=>Ts(e,t),om=()=>({state:e,dispatch:t})=>Ls(e,t),sm=()=>({state:e,dispatch:t})=>Us(e,t),cm=()=>({state:e,dispatch:t})=>Hs(e,t);function lm(e,t,n={},r={}){return Np(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var um=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=lm(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function dm(e,t){let n=bp(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function fm(e,t){let n=new Wo(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function pm(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function mm(e,t){let n=[];return e.descendants((e,r)=>{t(e)&&n.push({node:e,pos:r})}),n}function hm(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function gm(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function _m(e){return t=>gm(t.$from,e)}function U(e,t,n){return e.config[t]===void 0&&e.parent?U(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?U(e.parent,t,n):null}):e.config[t]}function vm(e){return e.map(e=>{let t=U(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...vm(t())]:e}).flat(10)}function ym(e,t){let n=wa.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function bm(e){return typeof e==`function`}function W(e,t=void 0,...n){return bm(e)?t?e.bind(t)(...n):e(...n):e}function xm(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Sm(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function Cm(e){let t=[],{nodeExtensions:n,markExtensions:r}=Sm(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(e=>{let n=U(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{e.types.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=U(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function G(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=t?t.split(`;`).map(e=>e.trim()).filter(Boolean):[],i=n[e]?n[e].split(`;`).map(e=>e.trim()).filter(Boolean):[],a=new Map;i.forEach(e=>{let[t,n]=e.split(`:`).map(e=>e.trim());a.set(t,n)}),r.forEach(e=>{let[t,n]=e.split(`:`).map(e=>e.trim());a.set(t,n)}),n[e]=Array.from(a.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function wm(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>G(e,t),{})}function Tm(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function Em(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):Tm(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function Dm(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&xm(t)?!1:t!=null))}function Om(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function km(e,t){let n=Cm(e),{nodeExtensions:r,markExtensions:i}=Sm(e);return new oa({topNode:r.find(e=>U(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Dm({...e.reduce((e,t)=>{let n=U(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:W(U(r,`content`,a)),marks:W(U(r,`marks`,a)),group:W(U(r,`group`,a)),inline:W(U(r,`inline`,a)),atom:W(U(r,`atom`,a)),selectable:W(U(r,`selectable`,a)),draggable:W(U(r,`draggable`,a)),code:W(U(r,`code`,a)),whitespace:W(U(r,`whitespace`,a)),linebreakReplacement:W(U(r,`linebreakReplacement`,a)),defining:W(U(r,`defining`,a)),isolating:W(U(r,`isolating`,a)),attrs:Object.fromEntries(i.map(Om))}),s=W(U(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Em(e,i)));let c=U(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:wm(e,i)}));let l=U(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Dm({...e.reduce((e,t)=>{let n=U(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:W(U(r,`inclusive`,a)),excludes:W(U(r,`excludes`,a)),group:W(U(r,`group`,a)),spanning:W(U(r,`spanning`,a)),code:W(U(r,`code`,a)),attrs:Object.fromEntries(i.map(Om))}),s=W(U(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Em(e,i)));let c=U(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:wm(e,i)})),[r.name,o]}))})}function Am(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function jm(e){return e.sort((e,t)=>{let n=U(e,`priority`)||100,r=U(t,`priority`)||100;return n>r?-1:n<r?1:0})}function Mm(e){let t=jm(vm(e)),n=Am(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function Nm(e,t){return km(Mm(e),t)}function Pm(e,t){let n=Nm(t);return ym(Fi.fromJSON(n,e).content,n)}function Fm(e,t){let n=Nm(t),r=Mp(e);return ua.fromSchema(n).parse(r).toJSON()}function Im(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
13
+
14
+ `,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function Lm(e,t){return Im(e,{from:0,to:e.content.size},t)}function Rm(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function zm(e,t,n){let{blockSeparator:r=`
15
+
16
+ `,textSerializers:i={}}=n||{},a=Nm(t);return Lm(Fi.fromJSON(a,e),{blockSeparator:r,textSerializers:{...Rm(a),...i}})}function Bm(e,t){let n=lp(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function Vm(e,t){let n=$p(typeof t==`string`?t:t.name,e.schema);return n===`node`?Bm(e,t):n===`mark`?dm(e,t):{}}function Hm(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Um(e){let t=Hm(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function Wm(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),Um(r)}function Gm(e,t=0){let n=e.type===e.type.schema.topNodeType?0:1,r=t,i=r+e.nodeSize,a=e.marks.map(e=>{let t={type:e.type.name};return Object.keys(e.attrs).length&&(t.attrs={...e.attrs}),t}),o={...e.attrs},s={type:e.type.name,from:r,to:i};return Object.keys(o).length&&(s.attrs=o),a.length&&(s.marks=a),e.content.childCount&&(s.content=[],e.forEach((e,r)=>{var i;(i=s.content)==null||i.push(Gm(e,t+r+n))})),e.text&&(s.text=e.text),s}function Km(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=yp(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var qm=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]};function Jm(e,t){return t.nodes[e]||t.marks[e]||null}function Ym(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var Xm=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function Zm(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?bp(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>gp(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize),c=a-n;o+=c,s.push(...e.marks.map(e=>({mark:e,from:n,to:a})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>gp(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function Qm(e,t,n={}){if(!t)return Jp(e,null,n)||Zm(e,null,n);let r=$p(t,e.schema);return r===`node`?Jp(e,t,n):r===`mark`?Zm(e,t,n):!1}var $m=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=_m(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},eh=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function th(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function nh(e,t){let{nodeExtensions:n}=Sm(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=W(U(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function rh(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return/^\s*$/m.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(rh(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function ih(e){return e instanceof z}function ah(e,t,n){let r=e.state.doc.content.size,i=wp(t,0,r),a=wp(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return{...f,toJSON:()=>f}}function oh({json:e,validMarks:t,validNodes:n,options:r,rewrittenContent:i=[]}){return e.marks&&Array.isArray(e.marks)&&(e.marks=e.marks.filter(e=>{let n=typeof e==`string`?e:e.type;return t.has(n)?!0:(i.push({original:JSON.parse(JSON.stringify(e)),unsupported:n}),!1)})),e.content&&Array.isArray(e.content)&&(e.content=e.content.map(e=>oh({json:e,validMarks:t,validNodes:n,options:r,rewrittenContent:i}).json).filter(e=>e!=null)),e.type&&!n.has(e.type)?(i.push({original:JSON.parse(JSON.stringify(e)),unsupported:e.type}),e.content&&Array.isArray(e.content)&&r?.fallbackToParagraph!==!1?(e.type=`paragraph`,{json:e,rewrittenContent:i}):{json:null,rewrittenContent:i}):{json:e,rewrittenContent:i}}function sh(e,t,n){return oh({json:e,validNodes:new Set(Object.keys(t.nodes)),validMarks:new Set(Object.keys(t.marks)),options:n})}function ch(e,t,n){let{selection:r}=t,i=null;if(Cp(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var lh=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=bp(e,r.schema);if(i)if(o){let e=dm(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return ch(r,n,c)},uh=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),dh=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=lp(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>Gs(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>Gs(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},fh=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=wp(e,0,n.content.size),i=z.create(n,r);t.setSelection(i)}return!0},ph=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},mh=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=R.atStart(n).from,o=R.atEnd(n).to,s=wp(r,a,o),c=wp(i,a,o),l=R.create(n,s,c);t.setSelection(l)}return!0},hh=e=>({state:t,dispatch:n})=>pc(lp(e,t.schema))(t,n);function gh(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var _h=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=Ym(l,s.node().type.name,s.node().attrs);if(a instanceof z&&a.node.isBlock)return!s.parentOffset||!_o(o,s.pos)?!1:(r&&(e&&gh(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:pm(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=_o(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&_o(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof R&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&gh(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},vh=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=lp(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=P.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=P.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...Ym(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(P.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new I(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(R.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...Ym(d,u.type.name,u.attrs),...t},m={...Ym(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!_o(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},yh=(e,t)=>{let n=_m(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&yo(e.doc,n.pos)&&e.join(n.pos),!0},bh=(e,t)=>{let n=_m(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&yo(e.doc,r)&&e.join(r),!0},xh=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=lp(e,o.schema),m=lp(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=_m(e=>nh(e.type.name,d))(h);if(y.depth>=1&&x&&y.depth-x.depth<=1){if(x.node.type===p)return l.liftListItem(m);if(nh(x.node.type.name,d)&&p.validContent(x.node.content)&&s)return c().command(()=>(a.setNodeMarkup(x.pos,p),!0)).command(()=>yh(a,p)).command(()=>bh(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>yh(a,p)).command(()=>bh(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>yh(a,p)).command(()=>bh(a,p)).run()},Sh=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=bp(e,r.schema);return Zm(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},Ch=(e,t,n={})=>({state:r,commands:i})=>{let a=lp(e,r.schema),o=lp(t,r.schema),s=Jp(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},wh=(e,t={})=>({state:n,commands:r})=>{let i=lp(e,n.schema);return Jp(n,i,t)?r.lift(i):r.wrapIn(i,t)},Th=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},Eh=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},Dh=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=bp(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=yp(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},Oh=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},kh=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=$p(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=lp(e,r.schema)),s===`mark`&&(o=bp(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},Ah=(e,t={})=>({state:n,dispatch:r})=>Ws(lp(e,n.schema),t)(n,r),jh=(e,t={})=>({state:n,dispatch:r})=>ac(lp(e,n.schema),t)(n,r),Mh=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},Nh=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},Ph=(e,t)=>{if(hp(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function Fh(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=Xm(c)+i;return a.forEach(e=>{if(l)return;let a=Ph(u,e.find);if(!a)return;let c=s.state.tr,d=$f({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new ep({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function Ih(e){let{editor:t,rules:n}=e,r=new B({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:ym(P.from(e),a.schema);let{from:i}=s;Fh({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return Fh({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&Fh({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?Fh({editor:t,from:a.pos,to:a.pos,text:`
17
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Lh(e){return Object.prototype.toString.call(e).slice(8,-1)}function Rh(e){return Lh(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}function zh(e,t){let n={...e};return Rh(e)&&Rh(t)&&Object.keys(t).forEach(r=>{Rh(t[r])&&Rh(e[r])?n[r]=zh(e[r],t[r]):n[r]=t[r]}),n}var Bh=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...W(U(this,`addOptions`,{name:this.name}))||{}}}get storage(){return{...W(U(this,`addStorage`,{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>zh(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},Vh=class e extends Bh{constructor(){super(...arguments),this.type=`mark`}static create(t={}){return new e(typeof t==`function`?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function Hh(e){return typeof e==`number`}var Uh=class{constructor(e){this.find=e.find,this.handler=e.handler}},Wh=(e,t,n)=>{if(hp(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function Gh(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new ep({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||Wh(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var Kh=null,qh=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function Jh(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr;if(!(!Gh({editor:t,state:$f({state:e,transaction:c}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new B({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(Kh=t)},i=()=>{Kh&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=Kh;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:ym(P.from(t),r.schema);let{from:n}=d,i=n+t.length,a=qh(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!Hh(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var Yh=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=Mm(e),this.schema=km(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=U(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Jm(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return jm([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Jm(t.name,this.schema)},r=[],i=U(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&U(t,`exitable`,n)&&(a.ArrowRight=()=>Vh.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=Yf(a);r.push(o);let s=U(t,`addInputRules`,n);if(th(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=Ih({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=U(t,`addPasteRules`,n);if(th(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=Jh({editor:e,rules:t});r.push(...n)}}let l=U(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return Cm(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=Sm(this.extensions);return Object.fromEntries(t.filter(e=>!!U(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=U(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:lp(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:wm(r,n)})]:[]}))}get markViews(){let{editor:e}=this,{markExtensions:t}=Sm(this.extensions);return Object.fromEntries(t.filter(e=>!!U(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=U(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:bp(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=wm(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{Pg(i,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Jm(e.name,this.schema)};e.type===`mark`&&(W(U(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name);let n=U(e,`onBeforeCreate`,t),r=U(e,`onCreate`,t),i=U(e,`onUpdate`,t),a=U(e,`onSelectionUpdate`,t),o=U(e,`onTransaction`,t),s=U(e,`onFocus`,t),c=U(e,`onBlur`,t),l=U(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};Yh.resolve=Mm,Yh.sort=jm,Yh.flatten=vm;var Xh={};Qf(Xh,{ClipboardTextSerializer:()=>Zh,Commands:()=>Qh,Delete:()=>$h,Drop:()=>eg,Editable:()=>tg,FocusEvents:()=>rg,Keymap:()=>ig,Paste:()=>ag,Tabindex:()=>og,TextDirection:()=>sg,focusEventsPluginKey:()=>ng});var K=class e extends Bh{constructor(){super(...arguments),this.type=`extension`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Zh=K.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new B({key:new V(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:a}=i,o=Math.min(...a.map(e=>e.$from.pos)),s=Math.max(...a.map(e=>e.$to.pos)),c=Rm(n);return Im(r,{from:o,to:s},{...this.options.blockSeparator===void 0?{}:{blockSeparator:this.options.blockSeparator},textSerializers:c})}}})]}}),Qh=K.create({name:`commands`,addCommands(){return{...tp}}}),$h=K.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=fm(e.before,[e,...t]);Wm(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof Ja){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)),u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),eg=K.create({name:`drop`,addProseMirrorPlugins(){return[new B({key:new V(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),tg=K.create({name:`editable`,addProseMirrorPlugins(){return[new B({key:new V(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),ng=new V(`focusEvents`),rg=K.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new B({key:ng,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),ig=K.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:L.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Dp()||Gp()?i:r},addProseMirrorPlugins(){return[new B({key:new V(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=L.atStart(t.doc).from,l=L.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!rh(n.doc))return;let u=n.tr,d=$f({state:n,transaction:u}),{commands:f}=new ep({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),ag=K.create({name:`paste`,addProseMirrorPlugins(){return[new B({key:new V(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),og=K.create({name:`tabindex`,addProseMirrorPlugins(){return[new B({key:new V(`tabindex`),props:{attributes:()=>this.editor.isEditable?{tabindex:`0`}:{}}})]}}),sg=K.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=Sm(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new B({key:new V(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),cg=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},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;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=this.pos+r+(a?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;let s=this.resolvedPos.doc.resolve(o);if(!i&&s.depth<=this.depth)return;let c=new e(s,this.editor,i,i?n:null);i&&(c.actualDepth=this.depth+1),t.push(new e(s,this.editor,i,i?n:null))}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},lg=`.ProseMirror {
18
+ position: relative;
19
+ }
20
+
21
+ .ProseMirror {
22
+ word-wrap: break-word;
23
+ white-space: pre-wrap;
24
+ white-space: break-spaces;
25
+ -webkit-font-variant-ligatures: none;
26
+ font-variant-ligatures: none;
27
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
28
+ }
29
+
30
+ .ProseMirror [contenteditable="false"] {
31
+ white-space: normal;
32
+ }
33
+
34
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
35
+ white-space: pre-wrap;
36
+ }
37
+
38
+ .ProseMirror pre {
39
+ white-space: pre-wrap;
40
+ }
41
+
42
+ img.ProseMirror-separator {
43
+ display: inline !important;
44
+ border: none !important;
45
+ margin: 0 !important;
46
+ width: 0 !important;
47
+ height: 0 !important;
48
+ }
49
+
50
+ .ProseMirror-gapcursor {
51
+ display: none;
52
+ pointer-events: none;
53
+ position: absolute;
54
+ margin: 0;
55
+ }
56
+
57
+ .ProseMirror-gapcursor:after {
58
+ content: "";
59
+ display: block;
60
+ position: absolute;
61
+ top: -2px;
62
+ width: 20px;
63
+ border-top: 1px solid black;
64
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
65
+ }
66
+
67
+ @keyframes ProseMirror-cursor-blink {
68
+ to {
69
+ visibility: hidden;
70
+ }
71
+ }
72
+
73
+ .ProseMirror-hideselection *::selection {
74
+ background: transparent;
75
+ }
76
+
77
+ .ProseMirror-hideselection *::-moz-selection {
78
+ background: transparent;
79
+ }
80
+
81
+ .ProseMirror-hideselection * {
82
+ caret-color: transparent;
83
+ }
84
+
85
+ .ProseMirror-focused .ProseMirror-gapcursor {
86
+ display: block;
87
+ }`;function ug(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}var dg=class extends Mh{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>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(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),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:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc(),n=Tp(t,this.options.autofocus);this.editorState=us.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}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&&typeof document<`u`&&(this.css=ug(lg,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=bm(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){this.extensionManager=new Yh([...this.options.enableCoreExtensions?[tg,Zh.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),Qh,rg,ig,og,eg,ag,$h,sg.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions==`object`?this.options.enableCoreExtensions[e.name]!==!1:!0):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type)),this)}createCommandManager(){this.commandManager=new ep({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=lm(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(t.message))throw t;this.emit(`contentError`,{editor:this,error:t,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),e=lm(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){this.editorView=new Of(e,{...this.options.editorProps,attributes:{role:`textbox`,...this.options.editorProps?.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let t=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(t),this.prependClass(),this.injectCSS();let n=this.view.dom;n.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return Vm(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return Qm(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ym(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
88
+
89
+ `,textSerializers:n={}}=e||{};return Lm(this.state.doc,{blockSeparator:t,textSerializers:{...Rm(this.schema),...n}})}get isEmpty(){return rh(this.state.doc)}destroy(){this.emit(`destroy`),this.unmount(),this.removeAllListeners()}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){return new cg(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}};function fg(e){return new Nh({find:e.find,handler:({state:t,range:n,match:r})=>{let i=W(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(Km(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function pg(e){return new Nh({find:e.find,handler:({state:t,range:n,match:r})=>{let i=W(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function mg(e){return new Nh({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=W(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function hg(e){return new Nh({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,a=n.from,o=n.to;if(r[1]){let e=r[0].lastIndexOf(r[1]);i+=r[0].slice(e+r[1].length),a+=e;let t=a-o;t>0&&(i=r[0].slice(e-t,e)+i,a=o)}t.tr.insertText(i,a,o)},undoable:e.undoable})}function gg(e){return new Nh({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=W(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&oo(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&yo(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var _g=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]},vg=e=>`touches`in e,yg=class{constructor(e){this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e?.options?.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles()}get dom(){return this.container}get contentDOM(){return this.contentElement}update(e,t,n){return e.type===this.node.type?(this.node=e,this.onUpdate?this.onUpdate(e,t,n):!0):!1}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=`flex`,e.style.justifyContent=`flex-start`,e.style.alignItems=`flex-start`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t=this.createHandle(e);this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.wrapper.appendChild(t)})}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,vg(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}},bg=yg;function xg(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof z){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function Sg(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)}function Cg(e){return typeof e==`string`}var wg={};Qf(wg,{createAtomBlockMarkdownSpec:()=>Dg,createBlockMarkdownSpec:()=>Og,createInlineMarkdownSpec:()=>jg,parseAttributes:()=>Tg,parseIndentedBlocks:()=>Mg,renderNestedMarkdownContent:()=>Ng,serializeAttributes:()=>Eg});function Tg(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=n[parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10)];i&&(t[e]=i.slice(1,-1))});let o=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,``).replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,``).replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,``).trim();return o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function Eg(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e===`class`||e===`id`||(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function Dg(e){let{nodeName:t,name:n,parseAttributes:r=Tg,serializeAttributes:i=Eg,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=r(s[1]||``);if(!o.find(e=>!(e in l)))return{type:t,raw:s[0],attributes:l}}},renderMarkdown:e=>{let t=i(l(e.attrs||{}));return`:::${c}${t?` {${t}}`:``} :::`}}}function Og(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=Tg,serializeAttributes:a=Eg,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m)if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m);return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=a(u(e.attrs||{}));return`:::${l}${n?` {${n}}`:``}
90
+
91
+ ${t.renderChildren(e.content||[],`
92
+
93
+ `)}
94
+
95
+ :::`}}}function kg(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function Ag(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function jg(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=kg,serializeAttributes:a=Ag,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=s?RegExp(`\\[${d}\\s*[^\\]]*\\]`):RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=s?RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=a(u(e.attrs||{})),i=n?` ${n}`:``;return s?`[${l}${i}]`:`[${l}${i}]${t}[/${l}]`}}}function Mg(e,t,n){let r=e.split(`
96
+ `),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}
97
+ `;continue}else return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}
98
+ `;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e}
99
+ `,o+=1;continue}else break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}
100
+ `,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`
101
+ `);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function Ng(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=[`${i}${t.renderChildren([a])}`];return o&&o.length>0&&o.forEach(e=>{let n=t.renderChildren([e]);if(n){let e=n.split(`
102
+ `).map(e=>e?t.indent(e):``).join(`
103
+ `);s.push(e)}}),s.join(`
104
+ `)}function Pg(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var Fg=class{constructor(e,t,n){this.component=e,this.editor=t.editor,this.options={...n},this.mark=t.mark,this.HTMLAttributes=t.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(e,t){Pg(t||this.mark,this.editor,e)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation==`function`?this.options.ignoreMutation({mutation:e}):e.type===`selection`||this.dom.contains(e.target)&&e.type===`childList`&&(Dp()||Ep())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===e.target&&e.type===`attributes`?!0:!this.contentDOM.contains(e.target)}},q=class e extends Bh{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Ig=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t;let{view:n}=this.editor,r=e.target,i=r.nodeType===3?r.parentElement?.closest(`[data-drag-handle]`):r.closest(`[data-drag-handle]`);if(!this.dom||this.contentDOM?.contains(r)||!i)return;let a=0,o=0;if(this.dom!==i){let t=this.dom.getBoundingClientRect(),n=i.getBoundingClientRect(),r=e.offsetX??e.nativeEvent?.offsetX,s=e.offsetY??e.nativeEvent?.offsetY;a=n.x-t.x+r,o=n.y-t.y+s}let s=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();s.style.width=`${Math.round(e.width)}px`,s.style.height=`${Math.round(e.height)}px`,s.style.boxSizing=`border-box`,s.style.pointerEvents=`none`}catch{}let c=null;try{c=document.createElement(`div`),c.style.position=`absolute`,c.style.top=`-9999px`,c.style.left=`-9999px`,c.style.pointerEvents=`none`,c.appendChild(s),document.body.appendChild(c),(t=e.dataTransfer)==null||t.setDragImage(s,a,o)}finally{c&&setTimeout(()=>{try{c?.remove()}catch{}},0)}let l=this.getPos();if(typeof l!=`number`)return;let u=z.create(n.state.doc,l),d=n.state.tr.setSelection(u);n.dispatch(d)}stopEvent(e){if(!this.dom)return!1;if(typeof this.options.stopEvent==`function`)return this.options.stopEvent({event:e});let t=e.target;if(!(this.dom.contains(t)&&!this.contentDOM?.contains(t)))return!1;let n=e.type.startsWith(`drag`),r=e.type===`drop`;if(([`INPUT`,`BUTTON`,`SELECT`,`TEXTAREA`].includes(t.tagName)||t.isContentEditable)&&!r&&!n)return!0;let{isEditable:i}=this.editor,{isDragging:a}=this,o=!!this.node.type.spec.draggable,s=z.isSelectable(this.node),c=e.type===`copy`,l=e.type===`paste`,u=e.type===`cut`,d=e.type===`mousedown`;if(!o&&s&&n&&e.target===this.dom&&e.preventDefault(),o&&n&&!a&&e.target===this.dom)return e.preventDefault(),!1;if(o&&i&&!a&&d){let e=t.closest(`[data-drag-handle]`);e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener(`dragend`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`drop`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`mouseup`,()=>{this.isDragging=!1},{once:!0}))}return!(a||r||c||l||u||d&&s)}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`&&(Dp()||Ep())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===e.target&&e.type===`attributes`?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return typeof n==`number`?(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0):!1})}deleteNode(){let e=this.getPos();if(typeof e!=`number`)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function Lg(e){return new Uh({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=W(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let r=c.search(/\S/),i=n.from+c.indexOf(s),u=i+s.length;if(Km(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>i).length)return null;u<n.to&&o.delete(u,n.to),i>n.from&&o.delete(n.from+r,i),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(a||{})),o.removeStoredMark(e.type)}}})}function Rg(e){return new Uh({find:e.find,handler({match:t,chain:n,range:r,pasteEvent:i}){let a=W(e.getAttributes,void 0,t,i),o=W(e.getContent,void 0,a);if(a===!1||a===null)return null;let s={type:e.type.name,attrs:a};o&&(s.content=o),t.input&&n().deleteRange(r).insertContentAt(r.from,s)}})}function zg(e){return new Uh({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,a=n.from,o=n.to;if(r[1]){let e=r[0].lastIndexOf(r[1]);i+=r[0].slice(e+r[1].length),a+=e;let t=a-o;t>0&&(i=r[0].slice(e-t,e)+i,a=o)}t.tr.insertText(i,a,o)}})}var Bg=class{constructor(e){this.transaction=e,this.currentStep=this.transaction.steps.length}map(e){let t=!1;return{position:this.transaction.steps.slice(this.currentStep).reduce((e,n)=>{let r=n.getMap().mapResult(e);return r.deleted&&(t=!0),r.pos},e),deleted:t}}};function Vg(e){let t=e.schema.cached.changeSetIDs||(e.schema.cached.changeSetIDs=Object.create(null)),n=t[e.name];return n??(t[e.name]=n=Object.keys(e.schema.nodes).indexOf(e.name)+1),n}var Hg={encodeCharacter:e=>e,encodeNodeStart:e=>e.type.name,encodeNodeEnd:e=>-Vg(e.type),compareTokens:(e,t)=>e===t};function Ug(e,t,n,r,i){for(let a=0,o=0;a<e.childCount;a++){let s=e.child(a),c=o+s.nodeSize,l=Math.max(o,n),u=Math.min(c,r);if(l<u)if(s.isText)for(let e=l;e<u;e++)i.push(t.encodeCharacter(s.text.charCodeAt(e-o),s.marks));else s.isLeaf?i.push(t.encodeNodeStart(s)):(l==o&&i.push(t.encodeNodeStart(s)),Ug(s.content,t,Math.max(o+1,l)-o-1,Math.min(c-1,u)-o-1,i),u==c&&i.push(t.encodeNodeEnd(s)));o=c}return i}var Wg=5e3;function Gg(e,t){return Math.min(15,Math.max(2,Math.floor(Math.max(e,t)/10)))}function Kg(e,t,n,r=Hg){let i=Ug(e,r,n.fromA,n.toA,[]),a=Ug(t,r,n.fromB,n.toB,[]),o=0,s=i.length,c=a.length,l=r.compareTokens;for(;o<i.length&&o<a.length&&l(i[o],a[o]);)o++;if(o==i.length&&o==a.length)return[];for(;s>o&&c>o&&l(i[s-1],a[c-1]);)s--,c--;if(s==o||c==o||s==c&&s==o+1)return[n.slice(o,s,o,c)];let u=s-o,d=c-o,f=Math.min(Wg,u+d),p=f+1,m=[],h=[];for(let e=p*2,t=0;t<e;t++)h[t]=-1;for(let e=0;e<=f;e++){for(let t=-e;t<=e;t+=2){let r=h[t+1+f],p=h[t-1+f],g=r<p?p:r+1,_=g+t;for(;g<u&&_<d&&l(i[o+g],a[o+_]);)g++,_++;if(h[t+f]=g,g>=u&&_>=d){let r=[],i=Gg(s-o,c-o),a=-1,l=-1,u=-1,d=-1,p=(e,t,o,s)=>{a>-1&&a<t+i?(a=e,u=o):(a>-1&&r.push(n.slice(a,l,u,d)),a=e,l=t,u=o,d=s)};for(let n=e-1;n>=0;n--){let e=h[t+1+f],r=h[t-1+f];e<r?(t--,g=r+o,_=g+t,p(g,g,_,_+1)):(t++,g=e+o,_=g+t,p(g,g+1,_,_)),h=m[n>>1]}return a>-1&&r.push(n.slice(a,l,u,d)),r.reverse()}}e%2==0&&m.push(h.slice())}return[n.slice(o,s,o,c)]}var qg=class e{constructor(e,t){this.length=e,this.data=t}cut(t){return t==this.length?this:new e(t,this.data)}static slice(t,n,r){if(n==r)return e.none;if(n==0&&r==e.len(t))return t;let i=[];for(let e=0,a=0;a<r;e++){let o=t[e],s=a+o.length,c=Math.min(r,s)-Math.max(n,a);c>0&&i.push(o.cut(c)),a=s}return i}static join(t,n,r){if(t.length==0)return n;if(n.length==0)return t;let i=r(t[t.length-1].data,n[0].data);if(i==null)return t.concat(n);let a=t.slice(0,t.length-1);a.push(new e(t[t.length-1].length+n[0].length,i));for(let e=1;e<n.length;e++)a.push(n[e]);return a}static len(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].length;return t}};qg.none=[];var Jg=class e{constructor(e,t,n,r,i,a){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r,this.deleted=i,this.inserted=a}get lenA(){return this.toA-this.fromA}get lenB(){return this.toB-this.fromB}slice(t,n,r,i){return t==0&&r==0&&n==this.toA-this.fromA&&i==this.toB-this.fromB?this:new e(this.fromA+t,this.fromA+n,this.fromB+r,this.fromB+i,qg.slice(this.deleted,t,n),qg.slice(this.inserted,r,i))}static merge(t,n,r){if(t.length==0)return n;if(n.length==0)return t;let i=[];for(let a=0,o=0,s=t[0],c=n[0];;)if(!s&&!c)return i;else if(s&&(!c||s.toB<c.fromA)){let r=o?n[o-1].toB-n[o-1].toA:0;i.push(r==0?s:new e(s.fromA,s.toA,s.fromB+r,s.toB+r,s.deleted,s.inserted)),s=a++==t.length?null:t[a]}else if(c&&(!s||c.toA<s.fromB)){let r=a?t[a-1].toB-t[a-1].toA:0;i.push(r==0?c:new e(c.fromA-r,c.toA-r,c.fromB,c.toB,c.deleted,c.inserted)),c=o++==n.length?null:n[o]}else{let l=Math.min(s.fromB,c.fromA),u=Math.min(s.fromA,c.fromA-(a?t[a-1].toB-t[a-1].toA:0)),d=u,f=Math.min(c.fromB,s.fromB+(o?n[o-1].toB-n[o-1].toA:0)),p=f,m=qg.none,h=qg.none,g=!1,_=!1;for(;;){let e=s?l>=s.fromB?s.toB:s.fromB:2e8,i=c?l>=c.fromA?c.toA:c.fromA:2e8,u=Math.min(e,i),f=s&&l>=s.fromB,v=c&&l>=c.fromA;if(!f&&!v)break;f&&l==s.fromB&&!g&&(m=qg.join(m,s.deleted,r),d+=s.lenA,g=!0),f&&!v&&(h=qg.join(h,qg.slice(s.inserted,l-s.fromB,u-s.fromB),r),p+=u-l),v&&l==c.fromA&&!_&&(h=qg.join(h,c.inserted,r),p+=c.lenB,_=!0),v&&!f&&(m=qg.join(m,qg.slice(c.deleted,l-c.fromA,u-c.fromA),r),d+=u-l),f&&u==s.toB&&(s=a++==t.length?null:t[a],g=!1),v&&u==c.toA&&(c=o++==n.length?null:n[o],_=!1),l=u}(u<d||f<p)&&i.push(new e(u,d,f,p,m,h))}}},Yg;try{Yg=RegExp(`[\\p{Alphabetic}_]`,`u`)}catch{}var Xg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Zg(e){if(e<128)return e>=48&&e<=57||e>=65&&e<=90||e>=79&&e<=122;let t=String.fromCharCode(e);return Yg?Yg.test(t):t.toUpperCase()!=t.toLowerCase()||Xg.test(t)}function Qg(e,t,n){let r=``;function i(e,t,n){for(let a=0,o=0;a<e.childCount;a++){let s=e.child(a),c=o+s.nodeSize,l=Math.max(o,t),u=Math.min(c,n);l<u&&(s.isText?r+=s.text.slice(Math.max(0,t-o),Math.min(s.text.length,n-o)):s.isLeaf?r+=` `:(l==o&&(r+=` `),i(s.content,Math.max(0,l-o-1),Math.min(s.content.size,n-o)),u==c&&(r+=` `))),o=c}}return i(e,t,n),r}var $g=30;function e_(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r].toB,a=r;for(;r<e.length-1&&e[r+1].fromB<=i+$g;)i=e[++r].toB;t_(e,a,r+1,t,n)}return n}function t_(e,t,n,r,i){let a=Math.max(0,e[t].fromB-$g),o=Math.min(r.content.size,e[n-1].toB+$g),s=Qg(r.content,a,o);for(let r=t;r<n;r++){let t=r,c=e[r],l=c.lenA,u=c.lenB;for(;r<n-1;){let n=e[r+1],i=!1,d=c.toB==o?!1:Zg(s.charCodeAt(c.toB-1-a));for(let r=c.toB;!i&&r<n.fromB;r++){let n=r==o?!1:Zg(s.charCodeAt(r-a));(!d||!n)&&r!=e[t].fromB&&(i=!0),d=n}if(i)break;l+=n.lenA,u+=n.lenB,c=n,r++}if(u>0&&l>0&&!(u==1&&l==1)){let n=e[t].fromB,c=e[r].toB;if(n<o&&Zg(s.charCodeAt(n-a)))for(;n>a&&Zg(s.charCodeAt(n-1-a));)n--;if(c>a&&Zg(s.charCodeAt(c-1-a)))for(;c<o&&Zg(s.charCodeAt(c-a));)c++;let l=r_(e.slice(t,r+1),n,c),u=i.length?i[i.length-1]:null;u&&u.toA==l.fromA?i[i.length-1]=new Jg(u.fromA,l.toA,u.fromB,l.toB,u.deleted.concat(l.deleted),u.inserted.concat(l.inserted)):i.push(l)}else for(let n=t;n<=r;n++)i.push(e[n])}return e}function n_(e,t){return e===t?e:null}function r_(e,t,n){let r=e[0].fromA-(e[0].fromB-t),i=e[e.length-1],a=i.toA+(n-i.toB),o=qg.none,s=qg.none,c=(e[0].deleted.length?e[0].deleted:e[0].inserted)[0].data,l=(e[0].inserted.length?e[0].inserted:e[0].deleted)[0].data;for(let i=r,u=t,d=0;;d++){let t=d==e.length?null:e[d],r=t?t.fromA:a,f=t?t.fromB:n;if(r>i&&(o=qg.join(o,[new qg(r-i,c)],n_)),f>u&&(s=qg.join(s,[new qg(f-u,l)],n_)),!t)break;o=qg.join(o,t.deleted,n_),s=qg.join(s,t.inserted,n_),o.length&&(c=o[o.length-1].data),s.length&&(l=s[s.length-1].data),i=t.toA,u=t.toB}return new Jg(r,a,t,n,o,s)}var i_=class e{constructor(e,t){this.config=e,this.changes=t}addSteps(t,n,r){let i=[];for(let e=0;e<n.length;e++){let t=Array.isArray(r)?r[e]:r,a=0;n[e].forEach((e,n,r,o)=>{i.push(new Jg(e+a,n+a,r,o,e==n?qg.none:[new qg(n-e,t)],r==o?qg.none:[new qg(o-r,t)])),a=o-r-(n-e)})}if(i.length==0)return this;let a=a_(i,this.config.combine),o=Jg.merge(this.changes,a,this.config.combine),s=o;for(let e=0;e<s.length;e++){let n=s[e];if(n.fromA==n.toA||n.fromB==n.toB||!a.some(e=>e.toB>n.fromB&&e.fromB<n.toB))continue;let r=Kg(this.config.doc.content,t.content,n,this.config.encoder);r.length==1&&r[0].fromB==0&&r[0].toB==n.toB-n.fromB||(s==o&&(s=o.slice()),r.length==1?s[e]=r[0]:(s.splice(e,1,...r),e+=r.length-1))}return new e(this.config,s)}get startDoc(){return this.config.doc}map(t){let n=e=>{let n=t(e);return n===e.data?e:new qg(e.length,n)};return new e(this.config,this.changes.map(e=>new Jg(e.fromA,e.toA,e.fromB,e.toB,e.deleted.map(n),e.inserted.map(n))))}changedRange(e,t){if(e==this)return null;let n=t&&s_(t),r=n?n.toB-n.fromB-(n.toA-n.fromA):0;function i(e){return!n||e<=n.fromA?e:e+r}let a=n?n.fromB:2e8,o=n?n.toB:-2e8;function s(e,t=e){a=Math.min(e,a),o=Math.max(t,o)}let c=this.changes,l=e.changes;for(let e=0,t=0;e<c.length&&t<l.length;){let n=c[e],r=l[t];n&&r&&c_(n,r,i)?(e++,t++):r&&(!n||i(n.fromB)>=r.fromB)?(s(r.fromB,r.toB),t++):(s(i(n.fromB),i(n.toB)),e++)}return a<=o?{from:a,to:o}:null}static create(t,n=(e,t)=>e===t?e:null,r=Hg){return new e({combine:n,doc:t,encoder:r},[])}};i_.computeDiff=Kg;function a_(e,t,n=0,r=e.length){if(r==n+1)return[e[n]];let i=n+r>>1;return Jg.merge(a_(e,t,n,i),a_(e,t,i,r),t)}function o_(e){let t=2e8,n=-2e8;for(let r=0;r<e.length;r++){let i=e[r];t!=2e8&&(t=i.map(t,-1),n=i.map(n,1)),i.forEach((e,r,i,a)=>{t=Math.min(t,i),n=Math.max(n,a)})}return t==2e8?null:{from:t,to:n}}function s_(e){let t=o_(e);if(!t)return null;let n=o_(e.map(e=>e.invert()).reverse());return{fromA:n.from,toA:n.to,fromB:t.from,toB:t.to}}function c_(e,t,n){return n(e.fromB)==t.fromB&&n(e.toB)==t.toB&&l_(e.deleted,t.deleted)&&l_(e.inserted,t.inserted)}function l_(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].length!=t[n].length||e[n].data!==t[n].data)return!1;return!0}var u_=class{constructor(e,t,n){this.step=e,this.inverted=t,this.origin=n}};function d_(e,t,n){for(let t=e.length-1;t>=0;t--)n.step(e[t].inverted);for(let e=0;e<t.length;e++)n.step(t[e]);let r=[];for(let t=0,i=e.length;t<e.length;t++){let a=e[t].step.map(n.mapping.slice(i));i--,a&&!n.maybeStep(a).failed&&(n.mapping.setMirror(i,n.steps.length-1),r.push(new u_(a,a.invert(n.docs[n.docs.length-1]),e[t].origin)))}return r}var f_=class{constructor(e,t){this.version=e,this.unconfirmed=t}};function p_(e){let t=[];for(let n=0;n<e.steps.length;n++)t.push(new u_(e.steps[n],e.steps[n].invert(e.docs[n]),e));return t}var m_=new V(`collab`);function h_(e={}){let t={version:e.version||0,clientID:e.clientID==null?Math.floor(Math.random()*4294967295):e.clientID};return new B({key:m_,state:{init:()=>new f_(t.version,[]),apply(e,t){return e.getMeta(m_)||(e.docChanged?new f_(t.version,t.unconfirmed.concat(p_(e))):t)}},config:t,historyPreserveItems:!0})}function g_(e,t,n,r={}){let i=m_.getState(e),a=i.version+t.length,o=m_.get(e).spec.config.clientID,s=0;for(;s<n.length&&n[s]==o;)++s;let c=i.unconfirmed.slice(s);if(t=s?t.slice(s):t,!t.length)return e.tr.setMeta(m_,new f_(a,c));let l=c.length,u=e.tr;if(l)c=d_(c,t,u);else{for(let e=0;e<t.length;e++)u.step(t[e]);c=[]}let d=new f_(a,c);return r&&r.mapSelectionBackward&&e.selection instanceof R&&(u.setSelection(R.between(u.doc.resolve(u.mapping.map(e.selection.anchor,-1)),u.doc.resolve(u.mapping.map(e.selection.head,-1)),-1)),u.updated&=-2),u.setMeta(`rebased`,l).setMeta(`addToHistory`,!1).setMeta(m_,d)}function __(e){let t=m_.getState(e);return t.unconfirmed.length==0?null:{version:t.version,steps:t.unconfirmed.map(e=>e.step),clientID:m_.get(e).spec.config.clientID,get origins(){return this._origins||=t.unconfirmed.map(e=>e.origin)}}}function v_(e){return m_.getState(e).version}function y_(e={}){return new B({view(t){return new b_(t,e)}})}var b_=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),n={left:i.left,right:i.right,top:a-this.width/2,bottom:a+this.width/2}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos);n={left:e.left-this.width/2,right:e.left+this.width/2,top:e.top,bottom:e.bottom}}let r=this.editorView.dom.offsetParent;this.element||(this.element=r.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`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let i,a;if(!r||r==document.body&&getComputedStyle(r).position==`static`)i=-pageXOffset,a=-pageYOffset;else{let e=r.getBoundingClientRect();i=e.left-r.scrollLeft,a=e.top-r.scrollTop}this.element.style.left=n.left-i+`px`,this.element.style.top=n.top-a+`px`,this.element.style.width=n.right-n.left+`px`,this.element.style.height=n.bottom-n.top+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=To(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}},x_=class e extends L{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):L.near(r)}content(){return I.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new S_(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!C_(e)||!w_(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!z.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};x_.prototype.visible=!1,x_.findFrom=x_.findGapCursorFrom,L.jsonID(`gapcursor`,x_);var S_=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return x_.valid(t)?new x_(t):L.near(t)}};function C_(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}}return!0}function w_(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}}return!0}function T_(){return new B({props:{decorations:A_,createSelectionBetween(e,t,n){return t.pos==n.pos&&x_.valid(n)?new x_(n):null},handleClick:O_,handleKeyDown:E_,handleDOMEvents:{beforeinput:k_}}})}var E_=Xf({ArrowLeft:D_(`horiz`,-1),ArrowRight:D_(`horiz`,1),ArrowUp:D_(`vert`,-1),ArrowDown:D_(`vert`,1)});function D_(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof R){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=x_.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new x_(c))),!0):!1}}function O_(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!x_.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&z.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new x_(r))),!0)}function k_(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof x_))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=P.empty;for(let e=r.length-1;e>=0;e--)i=P.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new I(i,0,0));return a.setSelection(R.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function A_(e){if(!(e.selection instanceof x_))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,H.create(e.doc,[Wd.widget(e.selection.head,t,{key:`gapcursor`})])}var j_=200,M_=function(){};M_.prototype.append=function(e){return e.length?(e=M_.from(e),!this.length&&e||e.length<j_&&this.leafAppend(e)||this.length<j_&&e.leafPrepend(this)||this.appendInner(e)):this},M_.prototype.prepend=function(e){return e.length?M_.from(e).append(this):this},M_.prototype.appendInner=function(e){return new P_(this,e)},M_.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?M_.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},M_.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},M_.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},M_.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},M_.from=function(e){return e instanceof M_?e:e&&e.length?new N_(e):M_.empty};var N_=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=j_)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=j_)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(M_);M_.empty=new N_([]);var P_=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(M_),F_=M_,I_=500,L_=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,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,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new z_(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new z_(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new z_(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>V_&&(s=R_(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Ha;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new z_(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new z_(i,o,l))}else r.push(new z_(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new z_(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>I_&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new z_(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(F_.from(i.reverse()),a)}};L_.empty=new L_(F_.empty,0);function R_(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var z_=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},B_=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},V_=20;function H_(e,t,n,r){let i=n.getMeta(Z_),a;if(i)return i.historyState;n.getMeta(Q_)&&(e=new B_(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(Z_))return o.getMeta(Z_).redo?new B_(e.done.addTransform(n,void 0,r,Y_(t)),e.undone,W_(n.mapping.maps),e.prevTime,e.prevComposition):new B_(e.done,e.undone.addTransform(n,void 0,r,Y_(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!U_(n,e.prevRanges)),s=o?G_(e.prevRanges,n.mapping):W_(n.mapping.maps);return new B_(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,Y_(t)),L_.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new B_(e.done.rebased(n,a),e.undone.rebased(n,a),G_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new B_(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),G_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function U_(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function W_(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function G_(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function K_(e,t,n){let r=Y_(t),i=Z_.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new B_(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(Z_,{redo:n,historyState:c})}var q_=!1,J_=null;function Y_(e){let t=e.plugins;if(J_!=t){q_=!1,J_=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){q_=!0;break}}return q_}function X_(e){return e.setMeta(Q_,!0)}var Z_=new V(`history`),Q_=new V(`closeHistory`);function $_(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new B({key:Z_,state:{init(){return new B_(L_.empty,L_.empty,null,0,-1)},apply(t,n,r){return H_(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?tv:n==`historyRedo`?nv:null;return r?(t.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function ev(e,t){return(n,r)=>{let i=Z_.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=K_(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var tv=ev(!1,!0),nv=ev(!0,!0),rv=ev(!1,!1),iv=ev(!0,!1);function av(e){let t=Z_.getState(e);return t?t.done.eventCount:0}function ov(e){let t=Z_.getState(e);return t?t.undone.eventCount:0}var sv=class{constructor(e,t,n={}){this.match=e,this.match=e,this.handler=typeof t==`string`?cv(t):t,this.undoable=n.undoable!==!1,this.inCode=n.inCode||!1}};function cv(e){return function(t,n,r,i){let a=e;if(n[1]){let e=n[0].lastIndexOf(n[1]);a+=n[0].slice(e+n[1].length),r+=e;let t=r-i;t>0&&(a=n[0].slice(e-t,e)+a,r=i)}return t.tr.insertText(a,r,i)}}var lv=500;function uv({rules:e}){let t=new B({state:{init(){return null},apply(e,t){return e.getMeta(this)||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput(n,r,i,a){return dv(n,r,i,a,e,t)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&dv(n,r.pos,r.pos,``,e,t)})}}},isInputRules:!0});return t}function dv(e,t,n,r,i,a){if(e.composing)return!1;let o=e.state,s=o.doc.resolve(t),c=s.parent.textBetween(Math.max(0,s.parentOffset-lv),s.parentOffset,null,``)+r;for(let l=0;l<i.length;l++){let u=i[l];if(s.parent.type.spec.code){if(!u.inCode)continue}else if(u.inCode===`only`)continue;let d=u.match.exec(c),f=d&&u.handler(o,d,t-(d[0].length-r.length),n);if(f)return u.undoable&&f.setMeta(a,{transform:f,from:t,to:n,text:r}),e.dispatch(f),!0}return!1}var fv=(e,t)=>{let n=e.plugins;for(let r=0;r<n.length;r++){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let n=e.tr,r=a.transform;for(let e=r.steps.length-1;e>=0;e--)n.step(r.steps[e].invert(r.docs[e]));if(a.text){let t=n.doc.resolve(a.from).marks();n.replaceWith(a.from,a.to,e.schema.text(a.text,t))}else n.delete(a.from,a.to);t(n)}return!0}}return!1},pv=new sv(/--$/,`—`),mv=new sv(/\.\.\.$/,`…`),hv=new sv(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,`“`),gv=new sv(/"$/,`”`),_v=new sv(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,`‘`),vv=new sv(/'$/,`’`),yv=[hv,gv,_v,vv];function bv(e,t,n=null,r){return new sv(e,(e,i,a,o)=>{let s=n instanceof Function?n(i):n,c=e.tr.delete(a,o),l=c.doc.resolve(a).blockRange(),u=l&&oo(l,t,s);if(!u)return null;c.wrap(l,u);let d=c.doc.resolve(a-1).nodeBefore;return d&&d.type==t&&yo(c.doc,a-1)&&(!r||r(i,d))&&c.join(a-1),c})}function xv(e,t,n=null){return new sv(e,(e,r,i,a)=>{let o=e.doc.resolve(i),s=n instanceof Function?n(r):n;return o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t)?e.tr.delete(i,a).setBlockType(i,i,t,s):null})}var Sv={};function Cv(e){let t=Sv[e];if(t)return t;t=Sv[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]=`%`+(`0`+r.toString(16).toUpperCase()).slice(-2)}return t}function wv(e,t){typeof t!=`string`&&(t=wv.defaultChars);let n=Cv(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t=``;for(let r=0,i=e.length;r<i;r+=3){let a=parseInt(e.slice(r+1,r+3),16);if(a<128){t+=n[a];continue}if((a&224)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((n&192)==128){let e=a<<6&1984|n&63;e<128?t+=`��`:t+=String.fromCharCode(e),r+=3;continue}}if((a&240)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((n&192)==128&&(i&192)==128){let e=a<<12&61440|n<<6&4032|i&63;e<2048||e>=55296&&e<=57343?t+=`���`:t+=String.fromCharCode(e),r+=6;continue}}if((a&248)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((n&192)==128&&(i&192)==128&&(o&192)==128){let e=a<<18&1835008|n<<12&258048|i<<6&4032|o&63;e<65536||e>1114111?t+=`����`:(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(e&1023))),r+=9;continue}}t+=`�`}return t})}wv.defaultChars=`;/?:@&=+$,#`,wv.componentChars=``;var Tv=wv,Ev={};function Dv(e){let t=Ev[e];if(t)return t;t=Ev[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push(`%`+(`0`+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Ov(e,t,n){typeof t!=`string`&&(n=t,t=Ov.defaultChars),n===void 0&&(n=!0);let r=Dv(t),i=``;for(let t=0,a=e.length;t<a;t++){let o=e.charCodeAt(t);if(n&&o===37&&t+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue}if(o<128){i+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<a){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+=`%EF%BF%BD`;continue}i+=encodeURIComponent(e[t])}return i}Ov.defaultChars=`;/?:@&=+$,-_.!~*'()#`,Ov.componentChars=`-_.!~*'()`;var kv=Ov;function Av(e){let t=``;return t+=e.protocol||``,t+=e.slashes?`//`:``,t+=e.auth?e.auth+`@`:``,e.hostname&&e.hostname.indexOf(`:`)!==-1?t+=`[`+e.hostname+`]`:t+=e.hostname||``,t+=e.port?`:`+e.port:``,t+=e.pathname||``,t+=e.search||``,t+=e.hash||``,t}function jv(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var Mv=/^([a-z0-9.+-]+:)/i,Nv=/:[0-9]*$/,Pv=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Fv=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
105
+ `,` `],Iv=[`/`,`?`,`#`],Lv=255,Rv=/^[+a-z0-9A-Z_-]{0,63}$/,zv=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Bv={javascript:!0,"javascript:":!0},Vv={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Hv(e,t){if(e&&e instanceof jv)return e;let n=new jv;return n.parse(e,t),n}jv.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=Pv.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=Mv.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)===`//`,i&&!(o&&Bv[o])&&(a=a.substr(2),this.slashes=!0)),!Bv[o]&&(i||o&&!Vv[o])){let e=-1;for(let t=0;t<Iv.length;t++)r=a.indexOf(Iv[t]),r!==-1&&(e===-1||r<e)&&(e=r);let t,n;n=e===-1?a.lastIndexOf(`@`):a.lastIndexOf(`@`,e),n!==-1&&(t=a.slice(0,n),a=a.slice(n+1),this.auth=t),e=-1;for(let t=0;t<Fv.length;t++)r=a.indexOf(Fv[t]),r!==-1&&(e===-1||r<e)&&(e=r);e===-1&&(e=a.length),a[e-1]===`:`&&e--;let i=a.slice(0,e);a=a.slice(e),this.parseHost(i),this.hostname=this.hostname||``;let o=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(Rv)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(Rv)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(zv);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>Lv&&(this.hostname=``),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=a.indexOf(`#`);s!==-1&&(this.hash=a.substr(s),a=a.slice(0,s));let c=a.indexOf(`?`);return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),Vv[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},jv.prototype.parseHost=function(e){let t=Nv.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var Uv=Hv,Wv=f({decode:()=>Tv,encode:()=>kv,format:()=>Av,parse:()=>Uv},1),Gv=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Kv=/[\0-\x1F\x7F-\x9F]/,qv=/[\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]/,Jv=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,Yv=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Xv=f({Any:()=>Gv,Cc:()=>Kv,Cf:()=>qv,P:()=>Jv,Z:()=>Yv},1),Zv=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୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢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;怳Ādp໩໮uct;戏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ǣጓ\0጖y;䐎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Ā;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀ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Ā;e᜚᜜lƀ;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\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩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ↄⅪ←ٖ↛ǰ↉\0↎proø₞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肻\xA0ଷ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;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\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\0⹻m;櫳;櫽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(e=>e.charCodeAt(0))),Qv=new Uint16Array(`Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢`.split(``).map(e=>e.charCodeAt(0))),$v=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]]);let ey=String.fromCodePoint??function(e){let t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function ty(e){return e>=55296&&e<=57343||e>1114111?65533:$v.get(e)??e}var ny;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(ny||={});var ry=32,iy;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(iy||={});function ay(e){return e>=ny.ZERO&&e<=ny.NINE}function oy(e){return e>=ny.UPPER_A&&e<=ny.UPPER_F||e>=ny.LOWER_A&&e<=ny.LOWER_F}function sy(e){return e>=ny.UPPER_A&&e<=ny.UPPER_Z||e>=ny.LOWER_A&&e<=ny.LOWER_Z||ay(e)}function cy(e){return e===ny.EQUALS||sy(e)}var ly;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(ly||={});var uy;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(uy||={});var dy=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ly.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=uy.Strict}startEntity(e){this.decodeMode=e,this.state=ly.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ly.EntityStart:return e.charCodeAt(t)===ny.NUM?(this.state=ly.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ly.NamedEntity,this.stateNamedEntity(e,t));case ly.NumericStart:return this.stateNumericStart(e,t);case ly.NumericDecimal:return this.stateNumericDecimal(e,t);case ly.NumericHex:return this.stateNumericHex(e,t);case ly.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|ry)===ny.LOWER_X?(this.state=ly.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ly.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(ay(r)||oy(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(ay(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===ny.SEMI)this.consumed+=1;else if(this.decodeMode===uy.Strict)return 0;return this.emitCodePoint(ty(this.result),this.consumed),this.errors&&(e!==ny.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&iy.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=py(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===uy.Attribute&&(i===0||cy(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&iy.VALUE_LENGTH)>>14,i!==0){if(a===ny.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==uy.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&iy.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~iy.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case ly.NamedEntity:return this.result!==0&&(this.decodeMode!==uy.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ly.NumericDecimal:return this.emitNumericEntity(0,2);case ly.NumericHex:return this.emitNumericEntity(0,3);case ly.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ly.EntityStart:return 0}}};function fy(e){let t=``,n=new dy(e,e=>t+=ey(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function py(e,t,n,r){let i=(t&iy.BRANCH_LENGTH)>>7,a=t&iy.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var my=fy(Zv);fy(Qv);function hy(e,t=uy.Legacy){return my(e,t)}var gy=f({arrayReplaceAt:()=>Sy,assign:()=>xy,escapeHtml:()=>Fy,escapeRE:()=>Ly,fromCodePoint:()=>wy,has:()=>by,isMdAsciiPunct:()=>Vy,isPunctChar:()=>By,isSpace:()=>Ry,isString:()=>vy,isValidEntityCode:()=>Cy,isWhiteSpace:()=>zy,lib:()=>Uy,normalizeReference:()=>Hy,unescapeAll:()=>Ay,unescapeMd:()=>ky},1);function _y(e){return Object.prototype.toString.call(e)}function vy(e){return _y(e)===`[object String]`}var yy=Object.prototype.hasOwnProperty;function by(e,t){return yy.call(e,t)}function xy(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!=`object`)throw TypeError(t+`must be object`);Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function Sy(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Cy(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function wy(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var Ty=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Ey=RegExp(Ty.source+`|&([a-z#][a-z0-9]{1,31});`,`gi`),Dy=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Oy(e,t){if(t.charCodeAt(0)===35&&Dy.test(t)){let n=t[1].toLowerCase()===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Cy(n)?wy(n):e}let n=hy(e);return n===e?e:n}function ky(e){return e.indexOf(`\\`)<0?e:e.replace(Ty,`$1`)}function Ay(e){return e.indexOf(`\\`)<0&&e.indexOf(`&`)<0?e:e.replace(Ey,function(e,t,n){return t||Oy(e,n)})}var jy=/[&<>"]/,My=/[&<>"]/g,Ny={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`};function Py(e){return Ny[e]}function Fy(e){return jy.test(e)?e.replace(My,Py):e}var Iy=/[.?*+^$[\]\\(){}|-]/g;function Ly(e){return e.replace(Iy,`\\$&`)}function Ry(e){switch(e){case 9:case 32:return!0}return!1}function zy(e){if(e>=8192&&e<=8202)return!0;switch(e){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 By(e){return Jv.test(e)}function Vy(e){switch(e){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 Hy(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}var Uy={mdurl:Wv,ucmicro:Xv};function Wy(e,t,n){let r,i,a,o,s=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<s;){if(a=e.src.charCodeAt(e.pos),a===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)r++;else if(n)return e.pos=c,-1}}let l=-1;return i&&(l=e.pos),e.pos=c,l}function Gy(e,t,n){let r,i=t,a={ok:!1,pos:0,lines:0,str:``};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return a;if(r===62)return a.pos=i+1,a.str=Ay(e.slice(t+1,i)),a.ok=!0,a;if(r===92&&i+1<n){i+=2;continue}i++}return a}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return a;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0?a:(a.str=Ay(e.slice(t,i)),a.pos=i,a.ok=!0,a)}function Ky(e,t,n){let r,i,a=0,o=t,s={ok:!1,pos:0,lines:0,str:``};if(o>=n||(i=e.charCodeAt(o),i!==34&&i!==39&&i!==40))return s;for(o++,i===40&&(i=41);o<n;){if(r=e.charCodeAt(o),r===i)return s.pos=o+1,s.lines=a,s.str=Ay(e.slice(t+1,o)),s.ok=!0,s;if(r===40&&i===41)return s;r===10?a++:r===92&&o+1<n&&(o++,e.charCodeAt(o)===10&&a++),o++}return s}var qy=f({parseLinkDestination:()=>Gy,parseLinkLabel:()=>Wy,parseLinkTitle:()=>Ky},1),Jy={};Jy.code_inline=function(e,t,n,r,i){let a=e[t];return`<code`+i.renderAttrs(a)+`>`+Fy(a.content)+`</code>`},Jy.code_block=function(e,t,n,r,i){let a=e[t];return`<pre`+i.renderAttrs(a)+`><code>`+Fy(e[t].content)+`</code></pre>
106
+ `},Jy.fence=function(e,t,n,r,i){let a=e[t],o=a.info?Ay(a.info).trim():``,s=``,c=``;if(o){let e=o.split(/(\s+)/g);s=e[0],c=e.slice(2).join(``)}let l;if(l=n.highlight&&n.highlight(a.content,s,c)||Fy(a.content),l.indexOf(`<pre`)===0)return l+`
107
+ `;if(o){let e=a.attrIndex(`class`),t=a.attrs?a.attrs.slice():[];e<0?t.push([`class`,n.langPrefix+s]):(t[e]=t[e].slice(),t[e][1]+=` `+n.langPrefix+s);let r={attrs:t};return`<pre><code${i.renderAttrs(r)}>${l}</code></pre>\n`}return`<pre><code${i.renderAttrs(a)}>${l}</code></pre>\n`},Jy.image=function(e,t,n,r,i){let a=e[t];return a.attrs[a.attrIndex(`alt`)][1]=i.renderInlineAsText(a.children,n,r),i.renderToken(e,t,n)},Jy.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
108
+ `:`<br>
109
+ `},Jy.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
110
+ `:`<br>
111
+ `:`
112
+ `},Jy.text=function(e,t){return Fy(e[t].content)},Jy.html_block=function(e,t){return e[t].content},Jy.html_inline=function(e,t){return e[t].content};function Yy(){this.rules=xy({},Jy)}Yy.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return``;for(r=``,t=0,n=e.attrs.length;t<n;t++)r+=` `+Fy(e.attrs[t][0])+`="`+Fy(e.attrs[t][1])+`"`;return r},Yy.prototype.renderToken=function(e,t,n){let r=e[t],i=``;if(r.hidden)return``;r.block&&r.nesting!==-1&&t&&e[t-1].hidden&&(i+=`
113
+ `),i+=(r.nesting===-1?`</`:`<`)+r.tag,i+=this.renderAttrs(r),r.nesting===0&&n.xhtmlOut&&(i+=` /`);let a=!1;if(r.block&&(a=!0,r.nesting===1&&t+1<e.length)){let n=e[t+1];(n.type===`inline`||n.hidden||n.nesting===-1&&n.tag===r.tag)&&(a=!1)}return i+=a?`>
114
+ `:`>`,i},Yy.prototype.renderInline=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;i[o]===void 0?r+=this.renderToken(e,a,t):r+=i[o](e,a,t,n,this)}return r},Yy.prototype.renderInlineAsText=function(e,t,n){let r=``;for(let i=0,a=e.length;i<a;i++)switch(e[i].type){case`text`:r+=e[i].content;break;case`image`:r+=this.renderInlineAsText(e[i].children,t,n);break;case`html_inline`:case`html_block`:r+=e[i].content;break;case`softbreak`:case`hardbreak`:r+=`
115
+ `;break;default:}return r},Yy.prototype.render=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;o===`inline`?r+=this.renderInline(e[a].children,t,n):i[o]===void 0?r+=this.renderToken(e,a,t,n):r+=i[o](e,a,t,n,this)}return r};var Xy=Yy;function Zy(){this.__rules__=[],this.__cache__=null}Zy.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},Zy.prototype.__compile__=function(){let e=this,t=[``];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},Zy.prototype.at=function(e,t,n){let r=this.__find__(e),i=n||{};if(r===-1)throw Error(`Parser rule not found: `+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null},Zy.prototype.before=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},Zy.prototype.after=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},Zy.prototype.push=function(e,t,n){let r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},Zy.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!0,n.push(e)},this),this.__cache__=null,n},Zy.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},Zy.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!1,n.push(e)},this),this.__cache__=null,n},Zy.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};var Qy=Zy;function $y(e,t,n){this.type=e,this.tag=t,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}$y.prototype.attrIndex=function(e){if(!this.attrs)return-1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1},$y.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},$y.prototype.attrSet=function(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},$y.prototype.attrGet=function(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n},$y.prototype.attrJoin=function(e,t){let n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+` `+t};var eb=$y;function tb(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}tb.prototype.Token=eb;var nb=tb,rb=/\r\n?|\n/g,ib=/\0/g;function ab(e){let t;t=e.src.replace(rb,`
116
+ `),t=t.replace(ib,`�`),e.src=t}function ob(e){let t;e.inlineMode?(t=new e.Token(`inline`,``,0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function sb(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let r=t[n];r.type===`inline`&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function cb(e){return/^<a[>\s]/i.test(e)}function lb(e){return/^<\/a\s*>/i.test(e)}function ub(e){let t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!==`inline`||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,i=0;for(let a=r.length-1;a>=0;a--){let o=r[a];if(o.type===`link_close`){for(a--;r[a].level!==o.level&&r[a].type!==`link_open`;)a--;continue}if(o.type===`html_inline`&&(cb(o.content)&&i>0&&i--,lb(o.content)&&i++),!(i>0)&&o.type===`text`&&e.md.linkify.test(o.content)){let i=o.content,s=e.md.linkify.match(i),c=[],l=o.level,u=0;s.length>0&&s[0].index===0&&a>0&&r[a-1].type===`text_special`&&(s=s.slice(1));for(let t=0;t<s.length;t++){let n=s[t].url,r=e.md.normalizeLink(n);if(!e.md.validateLink(r))continue;let a=s[t].text;a=s[t].schema?s[t].schema===`mailto:`&&!/^mailto:/i.test(a)?e.md.normalizeLinkText(`mailto:`+a).replace(/^mailto:/,``):e.md.normalizeLinkText(a):e.md.normalizeLinkText(`http://`+a).replace(/^http:\/\//,``);let o=s[t].index;if(o>u){let t=new e.Token(`text`,``,0);t.content=i.slice(u,o),t.level=l,c.push(t)}let d=new e.Token(`link_open`,`a`,1);d.attrs=[[`href`,r]],d.level=l++,d.markup=`linkify`,d.info=`auto`,c.push(d);let f=new e.Token(`text`,``,0);f.content=a,f.level=l,c.push(f);let p=new e.Token(`link_close`,`a`,-1);p.level=--l,p.markup=`linkify`,p.info=`auto`,c.push(p),u=s[t].lastIndex}if(u<i.length){let t=new e.Token(`text`,``,0);t.content=i.slice(u),t.level=l,c.push(t)}t[n].children=r=Sy(r,a,c)}}}}var db=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,fb=/\((c|tm|r)\)/i,pb=/\((c|tm|r)\)/gi,mb={c:`©`,r:`®`,tm:`™`};function hb(e,t){return mb[t.toLowerCase()]}function gb(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&(r.content=r.content.replace(pb,hb)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function _b(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&db.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(/(^|[^-])---(?=[^-]|$)/gm,`$1—`).replace(/(^|\s)--(?=\s|$)/gm,`$1–`).replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,`$1–`)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function vb(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(fb.test(e.tokens[t].content)&&gb(e.tokens[t].children),db.test(e.tokens[t].content)&&_b(e.tokens[t].children))}var yb=/['"]/,bb=/['"]/g,xb=`’`;function Sb(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function Cb(e,t){let n,r=[];for(let i=0;i<e.length;i++){let a=e[i],o=e[i].level;for(n=r.length-1;n>=0&&!(r[n].level<=o);n--);if(r.length=n+1,a.type!==`text`)continue;let s=a.content,c=0,l=s.length;OUTER:for(;c<l;){bb.lastIndex=c;let u=bb.exec(s);if(!u)break;let d=!0,f=!0;c=u.index+1;let p=u[0]===`'`,m=32;if(u.index-1>=0)m=s.charCodeAt(u.index-1);else for(n=i-1;n>=0&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let h=32;if(c<l)h=s.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n++)if(e[n].content){h=e[n].content.charCodeAt(0);break}let g=Vy(m)||By(String.fromCharCode(m)),_=Vy(h)||By(String.fromCharCode(h)),v=zy(m),y=zy(h);if(y?d=!1:_&&(v||g||(d=!1)),v?f=!1:g&&(y||_||(f=!1)),h===34&&u[0]===`"`&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=g,f=_),!d&&!f){p&&(a.content=Sb(a.content,u.index,xb));continue}if(f)for(n=r.length-1;n>=0;n--){let d=r[n];if(r[n].level<o)break;if(d.single===p&&r[n].level===o){d=r[n];let o,f;p?(o=t.md.options.quotes[2],f=t.md.options.quotes[3]):(o=t.md.options.quotes[0],f=t.md.options.quotes[1]),a.content=Sb(a.content,u.index,f),e[d.token].content=Sb(e[d.token].content,d.pos,o),c+=f.length-1,d.token===i&&(c+=o.length-1),s=a.content,l=s.length,r.length=n;continue OUTER}}d?r.push({token:i,pos:u.index,single:p,level:o}):f&&p&&(a.content=Sb(a.content,u.index,xb))}}}function wb(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!==`inline`||!yb.test(e.tokens[t].content)||Cb(e.tokens[t].children,e)}function Tb(e){let t,n,r=e.tokens,i=r.length;for(let e=0;e<i;e++){if(r[e].type!==`inline`)continue;let i=r[e].children,a=i.length;for(t=0;t<a;t++)i[t].type===`text_special`&&(i[t].type=`text`);for(t=n=0;t<a;t++)i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var Eb=[[`normalize`,ab],[`block`,ob],[`inline`,sb],[`linkify`,ub],[`replacements`,vb],[`smartquotes`,wb],[`text_join`,Tb]];function Db(){this.ruler=new Qy;for(let e=0;e<Eb.length;e++)this.ruler.push(Eb[e][0],Eb[e][1])}Db.prototype.process=function(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)},Db.prototype.State=nb;var Ob=Db;function kb(e,t,n,r){this.src=e,this.md=t,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;let i=this.src;for(let e=0,t=0,n=0,r=0,a=i.length,o=!1;t<a;t++){let s=i.charCodeAt(t);if(!o)if(Ry(s)){n++,s===9?r+=4-r%4:r++;continue}else o=!0;(s===10||t===a-1)&&(s!==10&&t++,this.bMarks.push(e),this.eMarks.push(t),this.tShift.push(n),this.sCount.push(r),this.bsCount.push(0),o=!1,n=0,r=0,e=t+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}kb.prototype.push=function(e,t,n){let r=new eb(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},kb.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},kb.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},kb.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t&&Ry(this.src.charCodeAt(e));e++);return e},kb.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!Ry(this.src.charCodeAt(--e)))return e+1;return e},kb.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},kb.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},kb.prototype.getLines=function(e,t,n,r){if(e>=t)return``;let i=Array(t-e);for(let a=0,o=e;o<t;o++,a++){let e=0,s=this.bMarks[o],c=s,l;for(l=o+1<t||r?this.eMarks[o]+1:this.eMarks[o];c<l&&e<n;){let t=this.src.charCodeAt(c);if(Ry(t))t===9?e+=4-(e+this.bsCount[o])%4:e++;else if(c-s<this.tShift[o])e++;else break;c++}e>n?i[a]=Array(e-n+1).join(` `)+this.src.slice(c,l):i[a]=this.src.slice(c,l)}return i.join(``)},kb.prototype.Token=eb;var Ab=kb;function jb(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function Mb(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),a=!1,o=0,s=``;for(;r<n;)i===124&&(a?(s+=e.substring(o,r-1),o=r):(t.push(s+e.substring(o,r)),s=``,o=r+1)),a=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(o)),t}function Nb(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58&&!Ry(s)||o===45&&Ry(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!Ry(t))return!1;a++}let c=jb(e,t+1),l=c.split(`|`),u=[];for(let e=0;e<l.length;e++){let t=l[e].trim();if(!t){if(e===0||e===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;t.charCodeAt(t.length-1)===58?u.push(t.charCodeAt(0)===58?`center`:`right`):t.charCodeAt(0)===58?u.push(`left`):u.push(``)}if(c=jb(e,t).trim(),c.indexOf(`|`)===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=Mb(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop();let d=l.length;if(d===0||d!==u.length)return!1;if(r)return!0;let f=e.parentType;e.parentType=`table`;let p=e.md.block.ruler.getRules(`blockquote`),m=e.push(`table_open`,`table`,1),h=[t,0];m.map=h;let g=e.push(`thead_open`,`thead`,1);g.map=[t,t+1];let _=e.push(`tr_open`,`tr`,1);_.map=[t,t+1];for(let t=0;t<l.length;t++){let n=e.push(`th_open`,`th`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t].trim(),r.children=[],e.push(`th_close`,`th`,-1)}e.push(`tr_close`,`tr`,-1),e.push(`thead_close`,`thead`,-1);let v;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,a=p.length;t<a;t++)if(p[t](e,i,n,!0)){r=!0;break}if(r||(c=jb(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4)break;if(l=Mb(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),i===t+2){let n=e.push(`tbody_open`,`tbody`,1);n.map=v=[t+2,0]}let a=e.push(`tr_open`,`tr`,1);a.map=[i,i+1];for(let t=0;t<d;t++){let n=e.push(`td_open`,`td`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t]?l[t].trim():``,r.children=[],e.push(`td_close`,`td`,-1)}e.push(`tr_close`,`tr`,-1)}return v&&(e.push(`tbody_close`,`tbody`,-1),v[1]=i),e.push(`table_close`,`table`,-1),h[1]=i,e.parentType=f,e.line=i,!0}function Pb(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;let a=e.push(`code_block`,`code`,0);return a.content=e.getLines(t,i,4+e.blkIndent,!1)+`
117
+ `,a.map=[t,e.line],!0}function Fb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+(f?1:0);let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}function Ib(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;let s=[],c=[],l=[],u=[],d=e.md.block.ruler.getRules(`blockquote`),f=e.parentType;e.parentType=`blockquote`;let p=!1,m;for(m=t;m<n;m++){let t=e.sCount[m]<e.blkIndent;if(i=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],i>=a)break;if(e.src.charCodeAt(i++)===62&&!t){let t=e.sCount[m]+1,n,r;e.src.charCodeAt(i)===32?(i++,t++,r=!1,n=!0):e.src.charCodeAt(i)===9?(n=!0,(e.bsCount[m]+t)%4==3?(i++,t++,r=!1):r=!0):n=!1;let o=t;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i<a;){let t=e.src.charCodeAt(i);if(Ry(t))t===9?o+=4-(o+e.bsCount[m]+(r?1:0))%4:o++;else break;i++}p=i>=a,c.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+(n?1:0),l.push(e.sCount[m]),e.sCount[m]=o-t,u.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let r=!1;for(let t=0,i=d.length;t<i;t++)if(d[t](e,m,n,!0)){r=!0;break}if(r){e.lineMax=m,e.blkIndent!==0&&(s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]=-1}let h=e.blkIndent;e.blkIndent=0;let g=e.push(`blockquote_open`,`blockquote`,1);g.markup=`>`;let _=[t,0];g.map=_,e.md.block.tokenize(e,t,m);let v=e.push(`blockquote_close`,`blockquote`,-1);v.markup=`>`,e.lineMax=o,e.parentType=f,_[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=s[n],e.tShift[n+t]=u[n],e.sCount[n+t]=l[n],e.bsCount[n+t]=c[n];return e.blkIndent=h,!0}function Lb(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!Ry(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=Array(s+1).join(String.fromCharCode(o)),!0}function Rb(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!Ry(e.src.charCodeAt(r))?-1:r}function zb(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let a=e.src.charCodeAt(i++);if(a<48||a>57)return-1;for(;;){if(i>=r)return-1;if(a=e.src.charCodeAt(i++),a>=48&&a<=57){if(i-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return i<r&&(a=e.src.charCodeAt(i),!Ry(a))?-1:i}function Bb(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type===`paragraph_open`&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function Vb(e,t,n,r){let i,a,o,s,c=t,l=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let u=!1;r&&e.parentType===`paragraph`&&e.sCount[c]>=e.blkIndent&&(u=!0);let d,f,p;if((p=zb(e,c))>=0){if(d=!0,o=e.bMarks[c]+e.tShift[c],f=Number(e.src.slice(o,p-1)),u&&f!==1)return!1}else if((p=Rb(e,c))>=0)d=!1;else return!1;if(u&&e.skipSpaces(p)>=e.eMarks[c])return!1;if(r)return!0;let m=e.src.charCodeAt(p-1),h=e.tokens.length;d?(s=e.push(`ordered_list_open`,`ol`,1),f!==1&&(s.attrs=[[`start`,f]])):s=e.push(`bullet_list_open`,`ul`,1);let g=[c,0];s.map=g,s.markup=String.fromCharCode(m);let _=!1,v=e.md.block.ruler.getRules(`list`),y=e.parentType;for(e.parentType=`list`;c<n;){a=p,i=e.eMarks[c];let t=e.sCount[c]+p-(e.bMarks[c]+e.tShift[c]),r=t;for(;a<i;){let t=e.src.charCodeAt(a);if(t===9)r+=4-(r+e.bsCount[c])%4;else if(t===32)r++;else break;a++}let u=a,f;f=u>=i?1:r-t,f>4&&(f=1);let h=t+f;s=e.push(`list_item_open`,`li`,1),s.markup=String.fromCharCode(m);let g=[c,0];s.map=g,d&&(s.info=e.src.slice(o,p-1));let y=e.tight,b=e.tShift[c],x=e.sCount[c],S=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=h,e.tight=!0,e.tShift[c]=u-e.bMarks[c],e.sCount[c]=r,u>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||_)&&(l=!1),_=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[c]=b,e.sCount[c]=x,e.tight=y,s=e.push(`list_item_close`,`li`,-1),s.markup=String.fromCharCode(m),c=e.line,g[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let C=!1;for(let t=0,r=v.length;t<r;t++)if(v[t](e,c,n,!0)){C=!0;break}if(C)break;if(d){if(p=zb(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=Rb(e,c),p<0)break;if(m!==e.src.charCodeAt(p-1))break}return s=d?e.push(`ordered_list_close`,`ol`,-1):e.push(`bullet_list_close`,`ul`,-1),s.markup=String.fromCharCode(m),g[1]=c,e.line=c,e.parentType=y,l&&Bb(e,h),!0}function Hb(e,t,n,r){let i=0,a=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],s=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(a)!==91)return!1;for(;++a<o;)if(e.src.charCodeAt(a)===93&&e.src.charCodeAt(a-1)!==92){if(a+1===o||e.src.charCodeAt(a+1)!==58)return!1;break}let c=e.lineMax,l=e.md.block.ruler.getRules(`reference`),u=e.parentType;for(e.parentType=`reference`;s<c&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3||e.sCount[s]<0)continue;let t=!1;for(let n=0,r=l.length;n<r;n++)if(l[n](e,s,c,!0)){t=!0;break}if(t)break}let d=e.getLines(t,s,e.blkIndent,!1).trim();o=d.length;let f=-1;for(a=1;a<o;a++){let e=d.charCodeAt(a);if(e===91)return!1;if(e===93){f=a;break}else e===10?i++:e===92&&(a++,a<o&&d.charCodeAt(a)===10&&i++)}if(f<0||d.charCodeAt(f+1)!==58)return!1;for(a=f+2;a<o;a++){let e=d.charCodeAt(a);if(e===10)i++;else if(!Ry(e))break}let p=e.md.helpers.parseLinkDestination(d,a,o);if(!p.ok)return!1;let m=e.md.normalizeLink(p.str);if(!e.md.validateLink(m))return!1;a=p.pos,i+=p.lines;let h=a,g=i,_=a;for(;a<o;a++){let e=d.charCodeAt(a);if(e===10)i++;else if(!Ry(e))break}let v=e.md.helpers.parseLinkTitle(d,a,o),y;for(a<o&&_!==a&&v.ok?(y=v.str,a=v.pos,i+=v.lines):(y=``,a=h,i=g);a<o&&Ry(d.charCodeAt(a));)a++;if(a<o&&d.charCodeAt(a)!==10&&y)for(y=``,a=h,i=g;a<o&&Ry(d.charCodeAt(a));)a++;if(a<o&&d.charCodeAt(a)!==10)return!1;let b=Hy(d.slice(1,f));return b?r?!0:(e.env.references===void 0&&(e.env.references={}),e.env.references[b]===void 0&&(e.env.references[b]={title:y,href:m}),e.parentType=u,e.line=t+i+1,!0):!1}var Ub=`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.section.source.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Wb=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Gb=RegExp(`^(?:`+Wb+`|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>|<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->|<[?][\\s\\S]*?[?]>|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Kb=RegExp(`^(?:`+Wb+`|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>)`),qb=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(`+Ub.join(`|`)+`)(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(Kb.source+`\\s*$`),/^$/,!1]];function Jb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<qb.length&&!qb[s][0].test(o);s++);if(s===qb.length)return!1;if(r)return qb[s][2];let c=t+1;if(!qb[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent);c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),qb[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let l=e.push(`html_block`,``,0);return l.map=[t,c],l.content=e.getLines(t,c,e.blkIndent,!0),!0}function Yb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=a)return!1;let s=1;for(o=e.src.charCodeAt(++i);o===35&&i<a&&s<=6;)s++,o=e.src.charCodeAt(++i);if(s>6||i<a&&!Ry(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&Ry(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;let l=e.push(`heading_open`,`h`+String(s),1);l.markup=`########`.slice(0,s),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=e.src.slice(i,a).trim(),u.map=[t,e.line],u.children=[];let d=e.push(`heading_close`,`h`+String(s),-1);return d.markup=`########`.slice(0,s),!0}function Xb(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`);if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType=`paragraph`;let a=0,o,s=t+1;for(;s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let t=e.bMarks[s]+e.tShift[s],n=e.eMarks[s];if(t<n&&(o=e.src.charCodeAt(t),(o===45||o===61)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){a=o===61?1:2;break}}if(e.sCount[s]<0)continue;let t=!1;for(let i=0,a=r.length;i<a;i++)if(r[i](e,s,n,!0)){t=!0;break}if(t)break}if(!a)return!1;let c=e.getLines(t,s,e.blkIndent,!1).trim();e.line=s+1;let l=e.push(`heading_open`,`h`+String(a),1);l.markup=String.fromCharCode(o),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=c,u.map=[t,e.line-1],u.children=[];let d=e.push(`heading_close`,`h`+String(a),-1);return d.markup=String.fromCharCode(o),e.parentType=i,!0}function Zb(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`),i=e.parentType,a=t+1;for(e.parentType=`paragraph`;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}let o=e.getLines(t,a,e.blkIndent,!1).trim();e.line=a;let s=e.push(`paragraph_open`,`p`,1);s.map=[t,e.line];let c=e.push(`inline`,``,0);return c.content=o,c.map=[t,e.line],c.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}var Qb=[[`table`,Nb,[`paragraph`,`reference`]],[`code`,Pb],[`fence`,Fb,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,Ib,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,Lb,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,Vb,[`paragraph`,`reference`,`blockquote`]],[`reference`,Hb],[`html_block`,Jb,[`paragraph`,`reference`,`blockquote`]],[`heading`,Yb,[`paragraph`,`reference`,`blockquote`]],[`lheading`,Xb],[`paragraph`,Zb]];function $b(){this.ruler=new Qy;for(let e=0;e<Qb.length;e++)this.ruler.push(Qb[e][0],Qb[e][1],{alt:(Qb[e][2]||[]).slice()})}$b.prototype.tokenize=function(e,t,n){let r=this.ruler.getRules(``),i=r.length,a=e.md.options.maxNesting,o=t,s=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n||e.sCount[o]<e.blkIndent));){if(e.level>=a){e.line=n;break}let t=e.line,c=!1;for(let a=0;a<i;a++)if(c=r[a](e,o,n,!1),c){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!c)throw Error(`none of the block rules matched`);e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),o=e.line,o<n&&e.isEmpty(o)&&(s=!0,o++,e.line=o)}},$b.prototype.parse=function(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)},$b.prototype.State=Ab;var ex=$b;function tx(e,t,n,r){this.src=e,this.env=n,this.md=t,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}tx.prototype.pushPending=function(){let e=new eb(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e},tx.prototype.push=function(e,t,n){this.pending&&this.pushPending();let r=new eb(e,t,n),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},tx.prototype.scanDelims=function(e,t){let n,r,i=!0,a=!0,o=this.posMax,s=this.src.charCodeAt(e),c=e>0?this.src.charCodeAt(e-1):32,l=e;for(;l<o&&this.src.charCodeAt(l)===s;)l++;let u=l-e,d=l<o?this.src.charCodeAt(l):32,f=Vy(c)||By(String.fromCharCode(c)),p=Vy(d)||By(String.fromCharCode(d)),m=zy(c),h=zy(d);return h?i=!1:p&&(m||f||(i=!1)),m?a=!1:f&&(h||p||(a=!1)),t?(n=i,r=a):(n=i&&(!a||f),r=a&&(!i||p)),{can_open:n,can_close:r,length:u}},tx.prototype.Token=eb;var nx=tx;function rx(e){switch(e){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 ix(e,t){let n=e.pos;for(;n<e.posMax&&!rx(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var ax=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function ox(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=e.pending.match(ax);if(!i)return!1;let a=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let s=o.url;if(s.length<=a.length)return!1;s=s.replace(/\*+$/,``);let c=e.md.normalizeLink(s);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,c]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-a.length,!0}function sx(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.push(`hardbreak`,`br`,0)}else e.pending=e.pending.slice(0,-1),e.push(`softbreak`,`br`,0);else e.push(`softbreak`,`br`,0);for(n++;n<i&&Ry(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var cx=[];for(let e=0;e<256;e++)cx.push(0);`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``).forEach(function(e){cx[e.charCodeAt(0)]=1});function lx(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push(`hardbreak`,`br`,0),n++;n<r&&(i=e.src.charCodeAt(n),Ry(i));)n++;return e.pos=n,!0}let a=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(a+=e.src[n+1],n++)}let o=`\\`+a;if(!t){let t=e.push(`text_special`,``,0);i<256&&cx[i]!==0?t.content=a:t.content=o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function ux(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;let r=n;n++;let i=e.posMax;for(;n<i&&e.src.charCodeAt(n)===96;)n++;let a=e.src.slice(r,n),o=a.length;if(e.backticksScanned&&(e.backticks[o]||0)<=r)return t||(e.pending+=a),e.pos+=o,!0;let s=n,c;for(;(c=e.src.indexOf("`",s))!==-1;){for(s=c+1;s<i&&e.src.charCodeAt(s)===96;)s++;let r=s-c;if(r===o){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=a,t.content=e.src.slice(n,c).replace(/\n/g,` `).replace(/^ (.+) $/,`$1`)}return e.pos=s,!0}e.backticks[r]=c}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=o,!0}function dx(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function fx(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function px(e){let t=e.tokens_meta,n=e.tokens_meta.length;fx(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&fx(e,t[r].delimiters)}var mx={tokenize:dx,postProcess:px};function hx(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;let i=e.scanDelims(e.pos,r===42);for(let t=0;t<i.length;t++){let t=e.push(`text`,``,0);t.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function gx(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let i=t[n.end],a=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,o=String.fromCharCode(n.marker),s=e.tokens[n.token];s.type=a?`strong_open`:`em_open`,s.tag=a?`strong`:`em`,s.nesting=1,s.markup=a?o+o:o,s.content=``;let c=e.tokens[i.token];c.type=a?`strong_close`:`em_close`,c.tag=a?`strong`:`em`,c.nesting=-1,c.markup=a?o+o:o,c.content=``,a&&(e.tokens[t[r-1].token].content=``,e.tokens[t[n.end+1].token].content=``,r--)}}function _x(e){let t=e.tokens_meta,n=e.tokens_meta.length;gx(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&gx(e,t[r].delimiters)}var vx={tokenize:hx,postProcess:_x};function yx(e,t){let n,r,i,a,o=``,s=``,c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let u=e.pos,d=e.posMax,f=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let m=p+1;if(m<d&&e.src.charCodeAt(m)===40){for(l=!1,m++;m<d&&(n=e.src.charCodeAt(m),!(!Ry(n)&&n!==10));m++);if(m>=d)return!1;if(c=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?m=i.pos:o=``,c=m;m<d&&(n=e.src.charCodeAt(m),!(!Ry(n)&&n!==10));m++);if(i=e.md.helpers.parseLinkTitle(e.src,m,e.posMax),m<d&&c!==m&&i.ok)for(s=i.str,m=i.pos;m<d&&(n=e.src.charCodeAt(m),!(!Ry(n)&&n!==10));m++);}(m>=d||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(e.env.references===void 0)return!1;if(m<d&&e.src.charCodeAt(m)===91?(c=m+1,m=e.md.helpers.parseLinkLabel(e,m),m>=0?r=e.src.slice(c,m++):m=p+1):m=p+1,r||=e.src.slice(f,p),a=e.env.references[Hy(r)],!a)return e.pos=u,!1;o=a.href,s=a.title}if(!t){e.pos=f,e.posMax=p;let t=e.push(`link_open`,`a`,1),n=[[`href`,o]];t.attrs=n,s&&n.push([`title`,s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=m,e.posMax=d,!0}function bx(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),!(!Ry(n)&&n!==10));a++);if(a>=f)return!1;for(l=a,s=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),s.ok&&(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``),l=a;a<f&&(n=e.src.charCodeAt(a),!(!Ry(n)&&n!==10));a++);if(s=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),!(!Ry(n)&&n!==10));a++);else c=``;if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[Hy(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0),i=[[`src`,u],[`alt`,``]];n.attrs=i,n.children=t,n.content=r,c&&i.push([`title`,c])}return e.pos=a,e.posMax=f,!0}var xx=/^([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])?)*)$/,Sx=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Cx(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(t===60)return!1;if(t===62)break}let a=e.src.slice(r+1,n);if(Sx.test(a)){let n=e.md.normalizeLink(a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}if(xx.test(a)){let n=e.md.normalizeLink(`mailto:`+a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}return!1}function wx(e){return/^<a[>\s]/i.test(e)}function Tx(e){return/^<\/a\s*>/i.test(e)}function Ex(e){let t=e|32;return t>=97&&t<=122}function Dx(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!Ex(i))return!1;let a=e.src.slice(r).match(Gb);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],wx(t.content)&&e.linkLevel++,Tx(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}var Ox=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,kx=/^&([a-z][a-z0-9]{1,31});/i;function Ax(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let r=e.src.slice(n).match(Ox);if(r){if(!t){let t=r[1][0].toLowerCase()===`x`?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=e.push(`text_special`,``,0);n.content=Cy(t)?wy(t):wy(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(kx);if(r){let n=hy(r[0]);if(n!==r[0]){if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=r[0],t.info=`entity`}return e.pos+=r[0].length,!0}}}return!1}function jx(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function Mx(e){let t=e.tokens_meta,n=e.tokens_meta.length;jx(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&jx(t[e].delimiters)}function Nx(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}var Px=[[`text`,ix],[`linkify`,ox],[`newline`,sx],[`escape`,lx],[`backticks`,ux],[`strikethrough`,mx.tokenize],[`emphasis`,vx.tokenize],[`link`,yx],[`image`,bx],[`autolink`,Cx],[`html_inline`,Dx],[`entity`,Ax]],Fx=[[`balance_pairs`,Mx],[`strikethrough`,mx.postProcess],[`emphasis`,vx.postProcess],[`fragments_join`,Nx]];function Ix(){this.ruler=new Qy;for(let e=0;e<Px.length;e++)this.ruler.push(Px[e][0],Px[e][1]);this.ruler2=new Qy;for(let e=0;e<Fx.length;e++)this.ruler2.push(Fx[e][0],Fx[e][1])}Ix.prototype.skipToken=function(e){let t=e.pos,n=this.ruler.getRules(``),r=n.length,i=e.md.options.maxNesting,a=e.cache;if(a[t]!==void 0){e.pos=a[t];return}let o=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,o=n[i](e,!0),e.level--,o){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;o||e.pos++,a[t]=e.pos},Ix.prototype.tokenize=function(e){let t=this.ruler.getRules(``),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<i){for(let r=0;r<n;r++)if(o=t[r](e,!1),o){if(a>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(o){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Ix.prototype.parse=function(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let a=this.ruler2.getRules(``),o=a.length;for(let e=0;e<o;e++)a[e](i)},Ix.prototype.State=nx;var Lx=Ix;function Rx(e){let t={};e||={},t.src_Any=Gv.source,t.src_Cc=Kv.source,t.src_Z=Yv.source,t.src_P=Jv.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join(`|`),t.src_ZCc=[t.src_Z,t.src_Cc].join(`|`);let n=`[><|]`;return t.src_pseudo_letter=`(?:(?!`+n+`|`+t.src_ZPCc+`)`+t.src_Any+`)`,t.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]?)`,t.src_auth=`(?:(?:(?!`+t.src_ZCc+`|[@/\\[\\]()]).)+@)?`,t.src_port=`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`,t.src_host_terminator=`(?=$|`+n+`|`+t.src_ZPCc+`)(?!`+(e[`---`]?`-(?!--)|`:`-|`)+`_|:\\d|\\.-|\\.(?!$|`+t.src_ZPCc+`))`,t.src_path=`(?:[/?#](?:(?!`+t.src_ZCc+`|[><|]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+`|\\]).)*\\]|\\((?:(?!`+t.src_ZCc+`|[)]).)*\\)|\\{(?:(?!`+t.src_ZCc+`|[}]).)*\\}|\\"(?:(?!`+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+`|[']).)+\\'|\\'(?=`+t.src_pseudo_letter+`|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!`+t.src_ZCc+`|[.]|$)|`+(e[`---`]?`\\-(?!--(?:[^-]|$))(?:-*)|`:`\\-+|`)+`,(?!`+t.src_ZCc+`|$)|;(?!`+t.src_ZCc+`|$)|\\!+(?!`+t.src_ZCc+`|[!]|$)|\\?(?!`+t.src_ZCc+`|[?]|$))+|\\/)?`,t.src_email_name=`[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*`,t.src_xn=`xn--[a-z0-9\\-]{1,59}`,t.src_domain_root=`(?:`+t.src_xn+`|`+t.src_pseudo_letter+`{1,63})`,t.src_domain=`(?:`+t.src_xn+`|(?:`+t.src_pseudo_letter+`)|(?:`+t.src_pseudo_letter+`(?:-|`+t.src_pseudo_letter+`){0,61}`+t.src_pseudo_letter+`))`,t.src_host=`(?:(?:(?:(?:`+t.src_domain+`)\\.)*`+t.src_domain+`))`,t.tpl_host_fuzzy=`(?:`+t.src_ip4+`|(?:(?:(?:`+t.src_domain+`)\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:`+t.src_domain+`)\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:`+t.src_ZPCc+`|>|$))`,t.tpl_email_fuzzy=`(^|`+n+`|"|\\(|`+t.src_ZCc+`)(`+t.src_email_name+`@`+t.tpl_host_fuzzy_strict+`)`,t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+`)`,t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+`)`,t}function zx(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Bx(e){return Object.prototype.toString.call(e)}function Vx(e){return Bx(e)===`[object String]`}function Hx(e){return Bx(e)===`[object Object]`}function Ux(e){return Bx(e)===`[object RegExp]`}function Wx(e){return Bx(e)===`[object Function]`}function Gx(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var Kx={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function qx(e){return Object.keys(e||{}).reduce(function(e,t){return e||Kx.hasOwnProperty(t)},!1)}var Jx={"http:":{validate:function(e,t,n){let r=e.slice(t);return n.re.http||(n.re.http=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(e,t,n){let r=e.slice(t);return n.re.no_http||(n.re.no_http=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)?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return n.re.mailto||(n.re.mailto=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}}},Yx=`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]`,Xx=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function Zx(e){e.__index__=-1,e.__text_cache__=``}function Qx(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function $x(){return function(e,t){t.normalize(e)}}function eS(e){let t=e.re=Rx(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(Yx),n.push(t.src_xn),t.src_tlds=n.join(`|`);function r(e){return e.replace(`%TLDS%`,t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),`i`),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),`i`),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),`i`),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),`i`);let i=[];e.__compiled__={};function a(e,t){throw Error(`(LinkifyIt) Invalid schema "`+e+`": `+t)}Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(n===null)return;let r={validate:null,link:null};if(e.__compiled__[t]=r,Hx(n)){Ux(n.validate)?r.validate=Qx(n.validate):Wx(n.validate)?r.validate=n.validate:a(t,n),Wx(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=$x();return}if(Vx(n)){i.push(t);return}a(t,n)}),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[``]={validate:null,normalize:$x()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(Gx).join(`|`);e.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|`+t.src_ZPCc+`))(`+o+`)`,`i`),e.re.schema_search=RegExp(`(^|(?!_)(?:[><|]|`+t.src_ZPCc+`))(`+o+`)`,`ig`),e.re.schema_at_start=RegExp(`^`+e.re.schema_search.source,`i`),e.re.pretest=RegExp(`(`+e.re.schema_test.source+`)|(`+e.re.host_fuzzy_test.source+`)|@`,`i`),Zx(e)}function tS(e,t){let n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function nS(e,t){let n=new tS(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function rS(e,t){if(!(this instanceof rS))return new rS(e,t);t||qx(e)&&(t=e,e={}),this.__opts__=zx({},Kx,t),this.__index__=-1,this.__last_index__=-1,this.__schema__=``,this.__text_cache__=``,this.__schemas__=zx({},Jx,e),this.__compiled__={},this.__tlds__=Xx,this.__tlds_replaced__=!1,this.re={},eS(this)}rS.prototype.add=function(e,t){return this.__schemas__[e]=t,eS(this),this},rS.prototype.set=function(e){return this.__opts__=zx(this.__opts__,e),this},rS.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,n,r,i,a,o,s,c,l;if(this.re.schema_test.test(e)){for(s=this.re.schema_search,s.lastIndex=0;(t=s.exec(e))!==null;)if(i=this.testSchemaAt(e,t[2],s.lastIndex),i){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__[`http:`]&&(c=e.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(a=n.index+n[1].length,(this.__index__<0||a<this.__index__)&&(this.__schema__=``,this.__index__=a,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`]&&(l=e.indexOf(`@`),l>=0&&(r=e.match(this.re.email_fuzzy))!==null&&(a=r.index+r[1].length,o=r.index+r[0].length,(this.__index__<0||a<this.__index__||a===this.__index__&&o>this.__last_index__)&&(this.__schema__=`mailto:`,this.__index__=a,this.__last_index__=o))),this.__index__>=0},rS.prototype.pretest=function(e){return this.re.pretest.test(e)},rS.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},rS.prototype.match=function(e){let t=[],n=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(nS(this,n)),n=this.__last_index__);let r=n?e.slice(n):e;for(;this.test(r);)t.push(nS(this,n)),r=r.slice(this.__last_index__),n+=this.__last_index__;return t.length?t:null},rS.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);return n?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n,nS(this,0)):null},rS.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),eS(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,eS(this),this)},rS.prototype.normalize=function(e){e.schema||(e.url=`http://`+e.url),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:`+e.url)},rS.prototype.onCompile=function(){};var iS=rS,aS=2147483647,oS=36,sS=1,cS=26,lS=38,uS=700,dS=72,fS=128,pS=`-`,mS=/^xn--/,hS=/[^\0-\x7F]/,gS=/[\x2E\u3002\uFF0E\uFF61]/g,_S={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},vS=oS-sS,yS=Math.floor,bS=String.fromCharCode;function xS(e){throw RangeError(_S[e])}function SS(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function CS(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(gS,`.`);let i=SS(e.split(`.`),t).join(`.`);return r+i}function wS(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}var TS=e=>String.fromCodePoint(...e),ES=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:oS},DS=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},OS=function(e,t,n){let r=0;for(e=n?yS(e/uS):e>>1,e+=yS(e/t);e>vS*cS>>1;r+=oS)e=yS(e/vS);return yS(r+(vS+1)*e/(e+lS))},kS=function(e){let t=[],n=e.length,r=0,i=fS,a=dS,o=e.lastIndexOf(pS);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&xS(`not-basic`),t.push(e.charCodeAt(n));for(let s=o>0?o+1:0;s<n;){let o=r;for(let t=1,i=oS;;i+=oS){s>=n&&xS(`invalid-input`);let o=ES(e.charCodeAt(s++));o>=oS&&xS(`invalid-input`),o>yS((aS-r)/t)&&xS(`overflow`),r+=o*t;let c=i<=a?sS:i>=a+cS?cS:i-a;if(o<c)break;let l=oS-c;t>yS(aS/l)&&xS(`overflow`),t*=l}let c=t.length+1;a=OS(r-o,c,o==0),yS(r/c)>aS-i&&xS(`overflow`),i+=yS(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},AS=function(e){let t=[];e=wS(e);let n=e.length,r=fS,i=0,a=dS;for(let n of e)n<128&&t.push(bS(n));let o=t.length,s=o;for(o&&t.push(pS);s<n;){let n=aS;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>yS((aS-i)/c)&&xS(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>aS&&xS(`overflow`),n===r){let e=i;for(let n=oS;;n+=oS){let r=n<=a?sS:n>=a+cS?cS:n-a;if(e<r)break;let i=e-r,o=oS-r;t.push(bS(DS(r+i%o,0))),e=yS(i/o)}t.push(bS(DS(e,0))),a=OS(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},jS={version:`2.3.1`,ucs2:{decode:wS,encode:TS},decode:kS,encode:AS,toASCII:function(e){return CS(e,function(e){return hS.test(e)?`xn--`+AS(e):e})},toUnicode:function(e){return CS(e,function(e){return mS.test(e)?kS(e.slice(4).toLowerCase()):e})}},MS={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{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`]}}},commonmark:{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`]}}}},NS=/^(vbscript|javascript|file|data):/,PS=/^data:image\/(gif|png|jpeg|webp);/;function FS(e){let t=e.trim().toLowerCase();return NS.test(t)?PS.test(t):!0}var IS=[`http:`,`https:`,`mailto:`];function LS(e){let t=Uv(e,!0);if(t.hostname&&(!t.protocol||IS.indexOf(t.protocol)>=0))try{t.hostname=jS.toASCII(t.hostname)}catch{}return kv(Av(t))}function RS(e){let t=Uv(e,!0);if(t.hostname&&(!t.protocol||IS.indexOf(t.protocol)>=0))try{t.hostname=jS.toUnicode(t.hostname)}catch{}return Tv(Av(t),Tv.defaultChars+`%`)}function zS(e,t){if(!(this instanceof zS))return new zS(e,t);t||vy(e)||(t=e||{},e=`default`),this.inline=new Lx,this.block=new ex,this.core=new Ob,this.renderer=new Xy,this.linkify=new iS,this.validateLink=FS,this.normalizeLink=LS,this.normalizeLinkText=RS,this.utils=gy,this.helpers=xy({},qy),this.options={},this.configure(e),t&&this.set(t)}zS.prototype.set=function(e){return xy(this.options,e),this},zS.prototype.configure=function(e){let t=this;if(vy(e)){let t=e;if(e=MS[t],!e)throw Error('Wrong `markdown-it` preset "'+t+`", check name`)}if(!e)throw Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},zS.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to enable unknown rule(s): `+r);return this},zS.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to disable unknown rule(s): `+r);return this},zS.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},zS.prototype.parse=function(e,t){if(typeof e!=`string`)throw Error(`Input data should be a String`);let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},zS.prototype.render=function(e,t){return t||={},this.renderer.render(this.parse(e,t),this.options,t)},zS.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},zS.prototype.renderInline=function(e,t){return t||={},this.renderer.render(this.parseInline(e,t),this.options,t)};var BS=zS,VS=new oa({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(e){return[`h`+e.attrs.level,0]}},code_block:{content:`text*`,group:`block`,code:!0,defining:!0,marks:``,attrs:{params:{default:``}},parseDOM:[{tag:`pre`,preserveWhitespace:`full`,getAttrs:e=>({params:e.getAttribute(`data-params`)||``})}],toDOM(e){return[`pre`,e.attrs.params?{"data-params":e.attrs.params}:{},[`code`,0]]}},ordered_list:{content:`list_item+`,group:`block`,attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:`ol`,getAttrs(e){return{order:e.hasAttribute(`start`)?+e.getAttribute(`start`):1,tight:e.hasAttribute(`data-tight`)}}}],toDOM(e){return[`ol`,{start:e.attrs.order==1?null:e.attrs.order,"data-tight":e.attrs.tight?`true`:null},0]}},bullet_list:{content:`list_item+`,group:`block`,attrs:{tight:{default:!1}},parseDOM:[{tag:`ul`,getAttrs:e=>({tight:e.hasAttribute(`data-tight`)})}],toDOM(e){return[`ul`,{"data-tight":e.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(e){return{src:e.getAttribute(`src`),title:e.getAttribute(`title`),alt:e.getAttribute(`alt`)}}}],toDOM(e){return[`img`,e.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:e=>e.type.name==`em`}],toDOM(){return[`em`]}},strong:{parseDOM:[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!=`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name==`strong`},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM(){return[`strong`]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:`a[href]`,getAttrs(e){return{href:e.getAttribute(`href`),title:e.getAttribute(`title`)}}}],toDOM(e){return[`a`,e.attrs]}},code:{parseDOM:[{tag:`code`}],toDOM(){return[`code`]}}}});function HS(e,t){if(e.isText&&t.isText&&F.sameSet(e.marks,t.marks))return e.withText(e.text+t.text)}var US=class{constructor(e,t){this.schema=e,this.tokenHandlers=t,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:F.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 t=this.top(),n=t.content,r=n[n.length-1],i=this.schema.text(e,t.marks),a;r&&(a=HS(r,i))?n[n.length-1]=a:n.push(i)}openMark(e){let t=this.top();t.marks=e.addToSet(t.marks)}closeMark(e){let t=this.top();t.marks=e.removeFromSet(t.marks)}parseTokens(e){for(let t=0;t<e.length;t++){let n=e[t],r=this.tokenHandlers[n.type];if(!r)throw Error("Token type `"+n.type+"` not supported by Markdown parser");r(this,n,e,t)}}addNode(e,t,n){let r=this.top(),i=e.createAndFill(t,n,r?r.marks:[]);return i?(this.push(i),i):null}openNode(e,t){this.stack.push({type:e,attrs:t,content:[],marks:F.none})}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content)}};function WS(e,t,n,r){return e.getAttrs?e.getAttrs(t,n,r):e.attrs instanceof Function?e.attrs(t):e.attrs}function GS(e,t){return e.noCloseToken||t==`code_inline`||t==`code_block`||t==`fence`}function KS(e){return e[e.length-1]==`
118
+ `?e.slice(0,e.length-1):e}function qS(){}function JS(e,t){let n=Object.create(null);for(let r in t){let i=t[r];if(i.block){let t=e.nodeType(i.block);GS(i,r)?n[r]=(e,n,r,a)=>{e.openNode(t,WS(i,n,r,a)),e.addText(KS(n.content)),e.closeNode()}:(n[r+`_open`]=(e,n,r,a)=>e.openNode(t,WS(i,n,r,a)),n[r+`_close`]=e=>e.closeNode())}else if(i.node){let t=e.nodeType(i.node);n[r]=(e,n,r,a)=>e.addNode(t,WS(i,n,r,a))}else if(i.mark){let t=e.marks[i.mark];GS(i,r)?n[r]=(e,n,r,a)=>{e.openMark(t.create(WS(i,n,r,a))),e.addText(KS(n.content)),e.closeMark(t)}:(n[r+`_open`]=(e,n,r,a)=>e.openMark(t.create(WS(i,n,r,a))),n[r+`_close`]=e=>e.closeMark(t))}else if(i.ignore)GS(i,r)?n[r]=qS:(n[r+`_open`]=qS,n[r+`_close`]=qS);else throw RangeError(`Unrecognized parsing spec `+JSON.stringify(i))}return n.text=(e,t)=>e.addText(t.content),n.inline=(e,t)=>e.parseTokens(t.children),n.softbreak=n.softbreak||(e=>e.addText(` `)),n}var YS=class{constructor(e,t,n){this.schema=e,this.tokenizer=t,this.tokens=n,this.tokenHandlers=JS(e,n)}parse(e,t={}){let n=new US(this.schema,this.tokenHandlers),r;n.parseTokens(this.tokenizer.parse(e,t));do r=n.closeNode();while(n.stack.length);return r||this.schema.topNodeType.createAndFill()}};function XS(e,t){for(;++t<e.length;)if(e[t].type!=`list_item_open`)return e[t].hidden;return!1}var ZS=new YS(VS,BS(`commonmark`,{html:!1}),{blockquote:{block:`blockquote`},paragraph:{block:`paragraph`},list_item:{block:`list_item`},bullet_list:{block:`bullet_list`,getAttrs:(e,t,n)=>({tight:XS(t,n)})},ordered_list:{block:`ordered_list`,getAttrs:(e,t,n)=>({order:+e.attrGet(`start`)||1,tight:XS(t,n)})},heading:{block:`heading`,getAttrs:e=>({level:+e.tag.slice(1)})},code_block:{block:`code_block`,noCloseToken:!0},fence:{block:`code_block`,getAttrs:e=>({params:e.info||``}),noCloseToken:!0},hr:{node:`horizontal_rule`},image:{node:`image`,getAttrs:e=>({src:e.attrGet(`src`),title:e.attrGet(`title`)||null,alt:e.children[0]&&e.children[0].content||null})},hardbreak:{node:`hard_break`},em:{mark:`em`},strong:{mark:`strong`},link:{mark:`link`,getAttrs:e=>({href:e.attrGet(`href`),title:e.attrGet(`title`)||null})},code_inline:{mark:`code`,noCloseToken:!0}}),QS={open:``,close:``,mixable:!0},$S=class{constructor(e,t,n={}){this.nodes=e,this.marks=t,this.options=n}serialize(e,t={}){t=Object.assign({},this.options,t);let n=new rC(this.nodes,this.marks,t);return n.renderContent(e),n.out}},eC=new $S({blockquote(e,t){e.wrapBlock(`> `,null,t,()=>e.renderContent(t))},code_block(e,t){let n=t.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";e.write(r+(t.attrs.params||``)+`
119
+ `),e.text(t.textContent,!1),e.write(`
120
+ `),e.write(r),e.closeBlock(t)},heading(e,t){e.write(e.repeat(`#`,t.attrs.level)+` `),e.renderInline(t,!1),e.closeBlock(t)},horizontal_rule(e,t){e.write(t.attrs.markup||`---`),e.closeBlock(t)},bullet_list(e,t){e.renderList(t,` `,()=>(t.attrs.bullet||`*`)+` `)},ordered_list(e,t){let n=t.attrs.order||1,r=String(n+t.childCount-1).length,i=e.repeat(` `,r+2);e.renderList(t,i,t=>{let i=String(n+t);return e.repeat(` `,r-i.length)+i+`. `})},list_item(e,t){e.renderContent(t)},paragraph(e,t){e.renderInline(t),e.closeBlock(t)},image(e,t){e.write(`![`+e.esc(t.attrs.alt||``)+`](`+t.attrs.src.replace(/[\(\)]/g,`\\$&`)+(t.attrs.title?` "`+t.attrs.title.replace(/"/g,`\\"`)+`"`:``)+`)`)},hard_break(e,t,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=t.type){e.write(`\\
121
+ `);return}},text(e,t){e.text(t.text,!e.inAutolink)}},{em:{open:`*`,close:`*`,mixable:!0,expelEnclosingWhitespace:!0},strong:{open:`**`,close:`**`,mixable:!0,expelEnclosingWhitespace:!0},link:{open(e,t,n,r){return e.inAutolink=nC(t,n,r),e.inAutolink?`<`:`[`},close(e,t,n,r){let{inAutolink:i}=e;return e.inAutolink=void 0,i?`>`:`](`+t.attrs.href.replace(/[\(\)"]/g,`\\$&`)+(t.attrs.title?` "${t.attrs.title.replace(/"/g,`\\"`)}"`:``)+`)`},mixable:!0},code:{open(e,t,n,r){return tC(n.child(r),-1)},close(e,t,n,r){return tC(n.child(r-1),1)},escape:!1}});function tC(e,t){let n=/`+/g,r,i=0;if(e.isText)for(;r=n.exec(e.text);)i=Math.max(i,r[0].length);let a=i>0&&t>0?" `":"`";for(let e=0;e<i;e++)a+="`";return i>0&&t<0&&(a+=` `),a}function nC(e,t,n){if(e.attrs.title||!/^\w+:/.test(e.attrs.href))return!1;let r=t.child(n);return!r.isText||r.text!=e.attrs.href||r.marks[r.marks.length-1]!=e?!1:n==t.childCount-1||!e.isInSet(t.child(n+1).marks)}var rC=class{constructor(e,t,n){this.nodes=e,this.marks=t,this.options=n,this.delim=``,this.out=``,this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,this.options.tightLists===void 0&&(this.options.tightLists=!1),this.options.hardBreakNodeName===void 0&&(this.options.hardBreakNodeName=`hard_break`)}flushClose(e=2){if(this.closed){if(this.atBlank()||(this.out+=`
122
+ `),e>1){let t=this.delim,n=/\s+$/.exec(t);n&&(t=t.slice(0,t.length-n[0].length));for(let n=1;n<e;n++)this.out+=t+`
123
+ `}this.closed=null}}getMark(e){let t=this.marks[e];if(!t){if(this.options.strict!==!1)throw Error(`Mark type \`${e}\` not supported by Markdown renderer`);t=QS}return t}wrapBlock(e,t,n,r){let i=this.delim;this.write(t??e),this.delim+=e,r(),this.delim=i,this.closeBlock(n)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
124
+ `)}write(e){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),e&&(this.out+=e)}closeBlock(e){this.closed=e}text(e,t=!0){let n=e.split(`
125
+ `);for(let e=0;e<n.length;e++)this.write(),!t&&n[e][0]==`[`&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+`\\!`),this.out+=t?this.esc(n[e],this.atBlockStart):n[e],e!=n.length-1&&(this.out+=`
126
+ `)}render(e,t,n){if(this.nodes[e.type.name])this.nodes[e.type.name](this,e,t,n);else if(this.options.strict!==!1)throw Error("Token type `"+e.type.name+"` not supported by Markdown renderer");else e.type.isLeaf||(e.type.inlineContent?this.renderInline(e):this.renderContent(e),e.isBlock&&this.closeBlock(e))}renderContent(e){e.forEach((t,n,r)=>this.render(t,e,r))}renderInline(e,t=!0){this.atBlockStart=t;let n=[],r=``,i=(t,i,a)=>{let o=t?t.marks:[];t&&t.type.name===this.options.hardBreakNodeName&&(o=o.filter(t=>{if(a+1==e.childCount)return!1;let n=e.child(a+1);return t.isInSet(n.marks)&&(!n.isText||/\S/.test(n.text))}));let s=r;if(r=``,t&&t.isText&&o.some(e=>{let t=this.getMark(e.type.name);return t&&t.expelEnclosingWhitespace&&!e.isInSet(n)})){let[e,r,i]=/^(\s*)(.*)$/m.exec(t.text);r&&(s+=r,t=i?t.withText(i):null,t||(o=n))}if(t&&t.isText&&o.some(t=>{let n=this.getMark(t.type.name);return n&&n.expelEnclosingWhitespace&&(a==e.childCount-1||!t.isInSet(e.child(a+1).marks))})){let[e,i,a]=/^(.*?)(\s*)$/m.exec(t.text);a&&(r=a,t=i?t.withText(i):null,t||(o=n))}let c=o.length?o[o.length-1]:null,l=c&&this.getMark(c.type.name).escape===!1,u=o.length-(l?1:0);outer:for(let e=0;e<u;e++){let t=o[e];if(!this.getMark(t.type.name).mixable)break;for(let r=0;r<n.length;r++){let i=n[r];if(!this.getMark(i.type.name).mixable)break;if(t.eq(i)){e>r?o=o.slice(0,r).concat(t).concat(o.slice(r,e)).concat(o.slice(e+1,u)):r>e&&(o=o.slice(0,e).concat(o.slice(e+1,r)).concat(t).concat(o.slice(r,u)));continue outer}}}let d=0;for(;d<Math.min(n.length,u)&&o[d].eq(n[d]);)++d;for(;d<n.length;)this.text(this.markString(n.pop(),!1,e,a),!1);if(s&&this.text(s),t){for(;n.length<u;){let t=o[n.length];n.push(t),this.text(this.markString(t,!0,e,a),!1),this.atBlockStart=!1}l&&t.isText?this.text(this.markString(c,!0,e,a)+t.text+this.markString(c,!1,e,a+1),!1):this.render(t,e,a),this.atBlockStart=!1}t?.isText&&t.nodeSize>0&&(this.atBlockStart=!1)};e.forEach(i),i(null,0,e.childCount),this.atBlockStart=!1}renderList(e,t,n){this.closed&&this.closed.type==e.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let r=e.attrs.tight===void 0?this.options.tightLists:e.attrs.tight,i=this.inTightList;this.inTightList=r,e.forEach((i,a,o)=>{o&&r&&this.flushClose(1),this.wrapBlock(t,n(o),e,()=>this.render(i,e,o))}),this.inTightList=i}esc(e,t=!1){return e=e.replace(/[`*\\~\[\]_]/g,(t,n)=>t==`_`&&n>0&&n+1<e.length&&e[n-1].match(/\w/)&&e[n+1].match(/\w/)?t:`\\`+t),t&&(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 t=e.indexOf(`"`)==-1?`""`:e.indexOf(`'`)==-1?`''`:`()`;return t[0]+e+t[1]}repeat(e,t){let n=``;for(let r=0;r<t;r++)n+=e;return n}markString(e,t,n,r){let i=this.getMark(e.type.name),a=t?i.open:i.close;return typeof a==`string`?a:a(this,e,n,r)}getEnclosingWhitespace(e){return{leading:(e.match(/^(\s+)/)||[void 0])[0],trailing:(e.match(/(\s+)$/)||[void 0])[0]}}};function iC(){var e=arguments[0];typeof e==`string`&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n==`object`&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i==`string`?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)aC(e,arguments[t]);return e}function aC(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)aC(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}var oC=`http://www.w3.org/2000/svg`,sC=`http://www.w3.org/1999/xlink`,cC=`ProseMirror-icon`;function lC(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t}function uC(e,t){let n=(e.nodeType==9?e:e.ownerDocument)||document,r=n.createElement(`div`);if(r.className=cC,t.path){let{path:i,width:a,height:o}=t,s=`pm-icon-`+lC(i).toString(16);n.getElementById(s)||dC(e,s,t);let c=r.appendChild(n.createElementNS(oC,`svg`));c.style.width=a/o+`em`,c.appendChild(n.createElementNS(oC,`use`)).setAttributeNS(sC,`href`,/([^#]*)/.exec(n.location.toString())[1]+`#`+s)}else if(t.dom)r.appendChild(t.dom.cloneNode(!0));else{let{text:e,css:i}=t;r.appendChild(n.createElement(`span`)).textContent=e||``,i&&(r.firstChild.style.cssText=i)}return r}function dC(e,t,n){let[r,i]=e.nodeType==9?[e,e.body]:[e.ownerDocument||document,e],a=r.getElementById(cC+`-collection`);a||(a=r.createElementNS(oC,`svg`),a.id=cC+`-collection`,a.style.display=`none`,i.insertBefore(a,i.firstChild));let o=r.createElementNS(oC,`symbol`);o.id=t,o.setAttribute(`viewBox`,`0 0 `+n.width+` `+n.height),o.appendChild(r.createElementNS(oC,`path`)).setAttribute(`d`,n.path),a.appendChild(o)}var fC=`ProseMirror-menu`,pC=class{constructor(e){this.spec=e}render(e){let t=this.spec,n=t.render?t.render(e):t.icon?uC(e.root,t.icon):t.label?iC(`div`,null,mC(e,t.label)):null;if(!n)throw RangeError(`MenuItem without icon or label property`);if(t.title){let r=typeof t.title==`function`?t.title(e.state):t.title;n.setAttribute(`title`,mC(e,r))}t.class&&n.classList.add(t.class),t.css&&(n.style.cssText+=t.css),n.addEventListener(`mousedown`,r=>{r.preventDefault(),n.classList.contains(fC+`-disabled`)||t.run(e.state,e.dispatch,e,r)});function r(e){if(t.select){let r=t.select(e);if(n.style.display=r?``:`none`,!r)return!1}let r=!0;if(t.enable&&(r=t.enable(e)||!1,MC(n,fC+`-disabled`,!r)),t.active){let i=r&&t.active(e)||!1;MC(n,fC+`-active`,i)}return!0}return{dom:n,update:r}}};function mC(e,t){return e._props.translate?e._props.translate(t):t}var hC={time:0,node:null};function gC(e){hC.time=Date.now(),hC.node=e.target}function _C(e){return Date.now()-100<hC.time&&hC.node&&e.contains(hC.node)}var vC=class{constructor(e,t={}){this.options=t,this.options=t||{},this.content=Array.isArray(e)?e:[e]}render(e){let t=yC(this.content,e),n=e.dom.ownerDocument.defaultView||window,r=iC(`div`,{class:fC+`-dropdown `+(this.options.class||``),style:this.options.css},mC(e,this.options.label||``));this.options.title&&r.setAttribute(`title`,mC(e,this.options.title));let i=iC(`div`,{class:fC+`-dropdown-wrap`},r),a=null,o=null,s=()=>{a&&a.close()&&(a=null,n.removeEventListener(`mousedown`,o))};r.addEventListener(`mousedown`,e=>{e.preventDefault(),gC(e),a?s():(a=this.expand(i,t.dom),n.addEventListener(`mousedown`,o=()=>{_C(i)||s()}))});function c(e){let n=t.update(e);return i.style.display=n?``:`none`,n}return{dom:i,update:c}}expand(e,t){let n=iC(`div`,{class:fC+`-dropdown-menu `+(this.options.class||``)},t),r=!1;function i(){return r?!1:(r=!0,e.removeChild(n),!0)}return e.appendChild(n),{close:i,node:n}}};function yC(e,t){let n=[],r=[];for(let i=0;i<e.length;i++){let{dom:a,update:o}=e[i].render(t);n.push(iC(`div`,{class:fC+`-dropdown-item`},a)),r.push(o)}return{dom:n,update:bC(r,n)}}function bC(e,t){return n=>{let r=!1;for(let i=0;i<e.length;i++){let a=e[i](n);t[i].style.display=a?``:`none`,a&&(r=!0)}return r}}var xC=class{constructor(e,t={}){this.options=t,this.content=Array.isArray(e)?e:[e]}render(e){let t=yC(this.content,e),n=e.dom.ownerDocument.defaultView||window,r=iC(`div`,{class:fC+`-submenu-label`},mC(e,this.options.label||``)),i=iC(`div`,{class:fC+`-submenu-wrap`},r,iC(`div`,{class:fC+`-submenu`},t.dom)),a=null;r.addEventListener(`mousedown`,e=>{e.preventDefault(),gC(e),MC(i,fC+`-submenu-wrap-active`,!1),a||n.addEventListener(`mousedown`,a=()=>{_C(i)||(i.classList.remove(fC+`-submenu-wrap-active`),n.removeEventListener(`mousedown`,a),a=null)})});function o(e){let n=t.update(e);return i.style.display=n?``:`none`,n}return{dom:i,update:o}}};function SC(e,t){let n=document.createDocumentFragment(),r=[],i=[];for(let a=0;a<t.length;a++){let o=t[a],s=[],c=[];for(let t=0;t<o.length;t++){let{dom:r,update:i}=o[t].render(e),a=iC(`span`,{class:fC+`item`},r);n.appendChild(a),c.push(a),s.push(i)}s.length&&(r.push(bC(s,c)),a<t.length-1&&i.push(n.appendChild(CC())))}function a(e){let t=!1,n=!1;for(let a=0;a<r.length;a++){let o=r[a](e);a&&(i[a-1].style.display=n&&o?``:`none`),n=o,o&&(t=!0)}return t}return{dom:n,update:a}}function CC(){return iC(`span`,{class:fC+`separator`})}var wC={join:{width:800,height:900,path:`M0 75h800v125h-800z M0 825h800v-125h-800z M250 400h100v-100h100v100h100v100h-100v100h-100v-100h-100z`},lift:{width:1024,height:1024,path:`M219 310v329q0 7-5 12t-12 5q-8 0-13-5l-164-164q-5-5-5-13t5-13l164-164q5-5 13-5 7 0 12 5t5 12zM1024 749v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12zM1024 530v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 310v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 91v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12z`},selectParentNode:{text:`⬚`,css:`font-weight: bold`},undo:{width:1024,height:1024,path:`M761 1024c113-206 132-520-313-509v253l-384-384 384-384v248c534-13 594 472 313 775z`},redo:{width:1024,height:1024,path:`M576 248v-248l384 384-384 384v-253c-446-10-427 303-313 509-280-303-221-789 313-775z`},strong:{width:805,height:1024,path:`M317 869q42 18 80 18 214 0 214-191 0-65-23-102-15-25-35-42t-38-26-46-14-48-6-54-1q-41 0-57 5 0 30-0 90t-0 90q0 4-0 38t-0 55 2 47 6 38zM309 442q24 4 62 4 46 0 81-7t62-25 42-51 14-81q0-40-16-70t-45-46-61-24-70-8q-28 0-74 7 0 28 2 86t2 86q0 15-0 45t-0 45q0 26 0 39zM0 950l1-53q8-2 48-9t60-15q4-6 7-15t4-19 3-18 1-21 0-19v-37q0-561-12-585-2-4-12-8t-25-6-28-4-27-2-17-1l-2-47q56-1 194-6t213-5q13 0 39 0t38 0q40 0 78 7t73 24 61 40 42 59 16 78q0 29-9 54t-22 41-36 32-41 25-48 22q88 20 146 76t58 141q0 57-20 102t-53 74-78 48-93 27-100 8q-25 0-75-1t-75-1q-60 0-175 6t-132 6z`},em:{width:585,height:1024,path:`M0 949l9-48q3-1 46-12t63-21q16-20 23-57 0-4 35-165t65-310 29-169v-14q-13-7-31-10t-39-4-33-3l10-58q18 1 68 3t85 4 68 1q27 0 56-1t69-4 56-3q-2 22-10 50-17 5-58 16t-62 19q-4 10-8 24t-5 22-4 26-3 24q-15 84-50 239t-44 203q-1 5-7 33t-11 51-9 47-3 32l0 10q9 2 105 17-1 25-9 56-6 0-18 0t-18 0q-16 0-49-5t-49-5q-78-1-117-1-29 0-81 5t-69 6z`},code:{width:896,height:1024,path:`M608 192l-96 96 224 224-224 224 96 96 288-320-288-320zM288 192l-288 320 288 320 96-96-224-224 224-224-96-96z`},link:{width:951,height:1024,path:`M832 694q0-22-16-38l-118-118q-16-16-38-16-24 0-41 18 1 1 10 10t12 12 8 10 7 14 2 15q0 22-16 38t-38 16q-8 0-15-2t-14-7-10-8-12-12-10-10q-18 17-18 41 0 22 16 38l117 118q15 15 38 15 22 0 38-14l84-83q16-16 16-38zM430 292q0-22-16-38l-117-118q-16-16-38-16-22 0-38 15l-84 83q-16 16-16 38 0 22 16 38l118 118q15 15 38 15 24 0 41-17-1-1-10-10t-12-12-8-10-7-14-2-15q0-22 16-38t38-16q8 0 15 2t14 7 10 8 12 12 10 10q18-17 18-41zM941 694q0 68-48 116l-84 83q-47 47-116 47-69 0-116-48l-117-118q-47-47-47-116 0-70 50-119l-50-50q-49 50-118 50-68 0-116-48l-118-118q-48-48-48-116t48-116l84-83q47-47 116-47 69 0 116 48l117 118q47 47 47 116 0 70-50 119l50 50q49-50 118-50 68 0 116 48l118 118q48 48 48 116z`},bulletList:{width:768,height:896,path:`M0 512h128v-128h-128v128zM0 256h128v-128h-128v128zM0 768h128v-128h-128v128zM256 512h512v-128h-512v128zM256 256h512v-128h-512v128zM256 768h512v-128h-512v128z`},orderedList:{width:768,height:896,path:`M320 512h448v-128h-448v128zM320 768h448v-128h-448v128zM320 128v128h448v-128h-448zM79 384h78v-256h-36l-85 23v50l43-2v185zM189 590c0-36-12-78-96-78-33 0-64 6-83 16l1 66c21-10 42-15 67-15s32 11 32 28c0 26-30 58-110 112v50h192v-67l-91 2c49-30 87-66 87-113l1-1z`},blockquote:{width:640,height:896,path:`M0 448v256h256v-256h-128c0 0 0-128 128-128v-128c0 0-256 0-256 256zM640 320v-128c0 0-256 0-256 256v256h256v-256h-128c0 0 0-128 128-128z`}},TC=new pC({title:`Join with above block`,run:Ds,select:e=>Ds(e),icon:wC.join}),EC=new pC({title:`Lift out of enclosing block`,run:ks,select:e=>ks(e),icon:wC.lift}),DC=new pC({title:`Select parent node`,run:Ls,select:e=>Ls(e),icon:wC.selectParentNode}),OC=new pC({title:`Undo last change`,run:tv,enable:e=>tv(e),icon:wC.undo}),kC=new pC({title:`Redo last undone change`,run:nv,enable:e=>nv(e),icon:wC.redo});function AC(e,t){let n={run(n,r){return Ws(e,t.attrs)(n,r)},select(n){return Ws(e,t.attrs)(n)}};for(let e in t)n[e]=t[e];return new pC(n)}function jC(e,t){let n=Gs(e,t.attrs),r={run:n,enable(e){return n(e)},active(n){let{$from:r,to:i,node:a}=n.selection;return a?a.hasMarkup(e,t.attrs):i<=r.end()&&r.parent.hasMarkup(e,t.attrs)}};for(let e in t)r[e]=t[e];return new pC(r)}function MC(e,t,n){n?e.classList.add(t):e.classList.remove(t)}var NC=`ProseMirror-menubar`;function PC(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent;return!/Edge\/\d/.test(e)&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e)}function FC(e){return new B({view(t){return new IC(t,e)}})}var IC=class{constructor(e,t){this.editorView=e,this.options=t,this.spacer=null,this.maxHeight=0,this.widthForMaxHeight=0,this.floating=!1,this.scrollHandler=null,this.wrapper=iC(`div`,{class:NC+`-wrapper`}),this.menu=this.wrapper.appendChild(iC(`div`,{class:NC})),this.menu.className=NC,e.dom.parentNode&&e.dom.parentNode.replaceChild(this.wrapper,e.dom),this.wrapper.appendChild(e.dom);let{dom:n,update:r}=SC(this.editorView,this.options.content);if(this.contentUpdate=r,this.menu.appendChild(n),this.update(),t.floating&&!PC()){this.updateFloat();let e=zC(this.wrapper);this.scrollHandler=t=>{let n=this.editorView.root;(n.body||n).contains(this.wrapper)?this.updateFloat(t.target.getBoundingClientRect?t.target:void 0):e.forEach(e=>e.removeEventListener(`scroll`,this.scrollHandler))},e.forEach(e=>e.addEventListener(`scroll`,this.scrollHandler))}}update(){this.contentUpdate(this.editorView.state),this.floating?this.updateScrollCursor():(this.menu.offsetWidth!=this.widthForMaxHeight&&(this.widthForMaxHeight=this.menu.offsetWidth,this.maxHeight=0),this.menu.offsetHeight>this.maxHeight&&(this.maxHeight=this.menu.offsetHeight,this.menu.style.minHeight=this.maxHeight+`px`))}updateScrollCursor(){let e=this.editorView.root.getSelection();if(!e.focusNode)return;let t=e.getRangeAt(0).getClientRects(),n=t[LC(e)?0:t.length-1];if(!n)return;let r=this.menu.getBoundingClientRect();if(n.top<r.bottom&&n.bottom>r.top){let e=RC(this.wrapper);e&&(e.scrollTop-=r.bottom-n.top)}}updateFloat(e){let t=this.wrapper,n=t.getBoundingClientRect(),r=e?Math.max(0,e.getBoundingClientRect().top):0;if(this.floating)if(n.top>=r||n.bottom<this.menu.offsetHeight+10)this.floating=!1,this.menu.style.position=this.menu.style.left=this.menu.style.top=this.menu.style.width=``,this.menu.style.display=``,this.spacer.parentNode.removeChild(this.spacer),this.spacer=null;else{let i=(t.offsetWidth-t.clientWidth)/2;this.menu.style.left=n.left+i+`px`,this.menu.style.display=n.top>(this.editorView.dom.ownerDocument.defaultView||window).innerHeight?`none`:``,e&&(this.menu.style.top=r+`px`)}else if(n.top<r&&n.bottom>=this.menu.offsetHeight+10){this.floating=!0;let n=this.menu.getBoundingClientRect();this.menu.style.left=n.left+`px`,this.menu.style.width=n.width+`px`,e&&(this.menu.style.top=r+`px`),this.menu.style.position=`fixed`,this.spacer=iC(`div`,{class:NC+`-spacer`,style:`height: ${n.height}px`}),t.insertBefore(this.spacer,this.menu)}}destroy(){this.wrapper.parentNode&&this.wrapper.parentNode.replaceChild(this.editorView.dom,this.wrapper)}};function LC(e){return e.anchorNode==e.focusNode?e.anchorOffset>e.focusOffset:e.anchorNode.compareDocumentPosition(e.focusNode)==Node.DOCUMENT_POSITION_FOLLOWING}function RC(e){for(let t=e.parentNode;t;t=t.parentNode)if(t.scrollHeight>t.clientHeight)return t}function zC(e){let t=[e.ownerDocument.defaultView||window];for(let n=e.parentNode;n;n=n.parentNode)t.push(n);return t}var BC=[`p`,0],VC=[`blockquote`,0],HC=[`hr`],UC=[`pre`,[`code`,0]],WC=[`br`],GC={doc:{content:`block+`},paragraph:{content:`inline*`,group:`block`,parseDOM:[{tag:`p`}],toDOM(){return BC}},blockquote:{content:`block+`,group:`block`,defining:!0,parseDOM:[{tag:`blockquote`}],toDOM(){return VC}},horizontal_rule:{group:`block`,parseDOM:[{tag:`hr`}],toDOM(){return HC}},heading:{attrs:{level:{default:1,validate:`number`}},content:`inline*`,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(e){return[`h`+e.attrs.level,0]}},code_block:{content:`text*`,marks:``,group:`block`,code:!0,defining:!0,parseDOM:[{tag:`pre`,preserveWhitespace:`full`}],toDOM(){return UC}},text:{group:`inline`},image:{inline:!0,attrs:{src:{validate:`string`},alt:{default:null,validate:`string|null`},title:{default:null,validate:`string|null`}},group:`inline`,draggable:!0,parseDOM:[{tag:`img[src]`,getAttrs(e){return{src:e.getAttribute(`src`),title:e.getAttribute(`title`),alt:e.getAttribute(`alt`)}}}],toDOM(e){let{src:t,alt:n,title:r}=e.attrs;return[`img`,{src:t,alt:n,title:r}]}},hard_break:{inline:!0,group:`inline`,selectable:!1,parseDOM:[{tag:`br`}],toDOM(){return WC}}},KC=[`em`,0],qC=[`strong`,0],JC=[`code`,0],YC={link:{attrs:{href:{validate:`string`},title:{default:null,validate:`string|null`}},inclusive:!1,parseDOM:[{tag:`a[href]`,getAttrs(e){return{href:e.getAttribute(`href`),title:e.getAttribute(`title`)}}}],toDOM(e){let{href:t,title:n}=e.attrs;return[`a`,{href:t,title:n},0]}},em:{parseDOM:[{tag:`i`},{tag:`em`},{style:`font-style=italic`},{style:`font-style=normal`,clearMark:e=>e.type.name==`em`}],toDOM(){return KC}},strong:{parseDOM:[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!=`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name==`strong`},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM(){return qC}},code:{parseDOM:[{tag:`code`}],toDOM(){return JC}}},XC=new oa({nodes:GC,marks:YC}),ZC,QC;if(typeof WeakMap<`u`){let e=new WeakMap;ZC=t=>e.get(t),QC=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;ZC=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},QC=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var J=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return ZC(e)||QC(e,$C(e))}};function $C(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=ew(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new J(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&tw(s,o,e),s}function ew(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function tw(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=nw(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function nw(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function rw(e,t){if(typeof e==`string`)return{};let n=e.getAttribute(`data-colwidth`),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(`,`).map(e=>Number(e)):null,i=Number(e.getAttribute(`colspan`)||1),a={colspan:i,rowspan:Number(e.getAttribute(`rowspan`)||1),colwidth:r&&r.length==i?r:null};for(let n in t){let r=t[n].getFromDOM,i=r&&r(e);i!=null&&(a[n]=i)}return a}function iw(e,t){let n={};for(let r in e.attrs.colspan!=1&&(n.colspan=e.attrs.colspan),e.attrs.rowspan!=1&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n[`data-colwidth`]=e.attrs.colwidth.join(`,`)),t){let i=t[r].setDOMAttr;i&&i(e.attrs[r],n)}return n}function aw(e){if(e!==null){if(!Array.isArray(e))throw TypeError(`colwidth must be null or an array`);for(let t of e)if(typeof t!=`number`)throw TypeError(`colwidth must be null or an array of numbers`)}}function ow(e){let t=e.cellAttributes||{},n={colspan:{default:1,validate:`number`},rowspan:{default:1,validate:`number`},colwidth:{default:null,validate:aw}};for(let e in t)n[e]={default:t[e].default,validate:t[e].validate};return{table:{content:`table_row+`,tableRole:`table`,isolating:!0,group:e.tableGroup,parseDOM:[{tag:`table`}],toDOM(){return[`table`,[`tbody`,0]]}},table_row:{content:`(table_cell | table_header)*`,tableRole:`row`,parseDOM:[{tag:`tr`}],toDOM(){return[`tr`,0]}},table_cell:{content:e.cellContent,attrs:n,tableRole:`cell`,isolating:!0,parseDOM:[{tag:`td`,getAttrs:e=>rw(e,t)}],toDOM(e){return[`td`,iw(e,t),0]}},table_header:{content:e.cellContent,attrs:n,tableRole:`header_cell`,isolating:!0,parseDOM:[{tag:`th`,getAttrs:e=>rw(e,t)}],toDOM(e){return[`th`,iw(e,t),0]}}}}function sw(e){let t=e.cached.tableNodeTypes;if(!t)for(let n in t=e.cached.tableNodeTypes={},e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}return t}var cw=new V(`selectingCells`);function lw(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function uw(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function dw(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function fw(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=lw(t.$head)||pw(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function pw(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function mw(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function hw(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function gw(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function _w(e){return J.get(e.node(-1)).findCell(e.pos-e.start(-1))}function vw(e){return J.get(e.node(-1)).colCount(e.pos-e.start(-1))}function yw(e,t,n){let r=e.node(-1),i=J.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function bw(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function xw(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function Sw(e,t,n){let r=sw(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var Y=class e extends L{constructor(e,t=e){let n=e.node(-1),r=J.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new Ko(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(mw(r)&&mw(i)&&gw(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return R.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=J.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=bw(e,0,l)),u>0&&(e=bw(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(P.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new I(P.from(o),1,1)}replace(e,t=I.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?I.empty:t)}let i=L.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new I(P.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=J.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=J.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=J.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=J.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new Cw(this.$anchorCell.pos,this.$headCell.pos)}};Y.prototype.visible=!1,L.jsonID(`cell`,Y);var Cw=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&gw(t,n)?new Y(t,n):L.near(n,1)}};function ww(e){if(!(e.selection instanceof Y))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(Wd.node(n,n+e.nodeSize,{class:`selectedCell`}))}),H.create(e.doc,t)}function Tw({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function Ew({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function Dw(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof z&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=Y.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=Y.rowSelection(e,e)}else if(!n){let e=J.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=Y.create(i,t+1,n)}}else r instanceof R&&Tw(r)?a=R.create(i,r.from):r instanceof R&&Ew(r)&&(a=R.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var Ow=new V(`fix-tables`);function kw(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?kw(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function Aw(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=jw(e,t,r,n))};return t?t.doc!=e.doc&&kw(t.doc,e.doc,0,r):e.doc.descendants(r),n}function jw(e,t,n,r){let i=J.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,bw(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=sw(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(Ow,{fixTables:!0})}function Mw(e){let t=e.selection,n=fw(e),r=n.node(-1),i=n.start(-1),a=J.get(r);return{...t instanceof Y?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function Nw(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;Sw(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,xw(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?sw(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function Pw(e,t){if(!dw(e))return!1;if(t){let n=Mw(e);t(Nw(e.tr,n,n.left))}return!0}function Fw(e,t){if(!dw(e))return!1;if(t){let n=Mw(e);t(Nw(e.tr,n,n.right))}return!0}function Iw(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,bw(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function Lw(e,t){if(!dw(e))return!1;if(t){let n=Mw(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;Iw(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=J.get(e)}t(r)}return!0}function Rw(e,t,n){let r=sw(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function zw(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;Rw(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?sw(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,sw(r.type.schema).row.create(null,o)),e}function Bw(e,t){if(!dw(e))return!1;if(t){let n=Mw(e);t(zw(e.tr,n,n.top))}return!0}function Vw(e,t){if(!dw(e))return!1;if(t){let n=Mw(e);t(zw(e.tr,n,n.bottom))}return!0}function Hw(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function Uw(e,t){if(!dw(e))return!1;if(t){let n=Mw(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;Hw(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=J.get(n.table)}t(r)}return!0}function Ww(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Gw({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function Kw(e,t){let n=e.selection;if(!(n instanceof Y)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=Mw(e),{map:i}=r;if(Gw(i,r))return!1;if(t){let n=e.tr,a={},o=P.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{Ww(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...xw(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size){let e=s+1+c.content.size,t=Ww(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new Y(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function qw(e,t){let n=sw(e.schema);return Jw(({node:e})=>n[e.type.spec.tableRole])(e,t)}function Jw(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof Y){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=uw(r.$from),!i)return!1;a=lw(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=Mw(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof Y&&u.setSelection(new Y(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function Yw(e,t){return function(n,r){if(!dw(n))return!1;let i=fw(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof Y?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function Xw(e){return function(t,n){if(!dw(t))return!1;if(n){let r=sw(t.schema),i=Mw(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length==0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function Zw(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function Qw(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?Xw(e):function(t,n){if(!dw(t))return!1;if(n){let r=sw(t.schema),i=Mw(t),a=t.tr,o=Zw(`row`,i,r),s=Zw(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}var $w=Qw(`row`,{useDeprecatedLogic:!0}),eT=Qw(`column`,{useDeprecatedLogic:!0}),tT=Qw(`cell`,{useDeprecatedLogic:!0});function nT(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function rT(e){return function(t,n){if(!dw(t))return!1;let r=nT(fw(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(R.between(e,hw(e))).scrollIntoView())}return!0}}function iT(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function aT(e,t){let n=e.selection;if(!(n instanceof Y))return!1;if(t){let r=e.tr,i=sw(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new I(i,0,0))}),r.docChanged&&t(r)}return!0}function oT(e){if(!e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=cT(sw(o).row,new I(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?cT(sw(o).row,new I(t,n,r)).content:t);else return null;return sT(o,s)}function sT(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(P.empty),n[i]<r){let a=sw(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(P.from(o))}return{height:t.length,width:r,rows:t}}function cT(e,t){let n=e.createAndFill();return new Wo(n).replace(0,n.content.size,t).doc}function lT({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(bw(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(P.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(P.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function uT(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=sw(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,P.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function dT(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function fT(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,bw(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(bw(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function pT(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=J.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=J.get(a),f=d.mapping.maps.length}uT(d,o,a,n,l,u,f)&&p(),dT(d,o,a,n,c,l,s,f)&&p(),dT(d,o,a,n,c,l,u,f)&&p(),fT(d,o,a,n,s,u,c,f)&&p(),fT(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new I(i.rows[e-s],0,0))}p(),d.setSelection(new Y(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var mT=Xf({ArrowLeft:gT(`horiz`,-1),ArrowRight:gT(`horiz`,1),ArrowUp:gT(`vert`,-1),ArrowDown:gT(`vert`,1),"Shift-ArrowLeft":_T(`horiz`,-1),"Shift-ArrowRight":_T(`horiz`,1),"Shift-ArrowUp":_T(`vert`,-1),"Shift-ArrowDown":_T(`vert`,1),Backspace:aT,"Mod-Backspace":aT,Delete:aT,"Mod-Delete":aT});function hT(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function gT(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof Y)return hT(n,r,L.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=xT(i,e,t);if(o==null)return!1;if(e==`horiz`)return hT(n,r,L.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=yw(i,e,t),s;return s=a?L.near(a,1):t<0?L.near(n.doc.resolve(i.before(-1)),-1):L.near(n.doc.resolve(i.after(-1)),1),hT(n,r,s)}}}function _T(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof Y)o=a;else{let r=xT(i,e,t);if(r==null)return!1;o=new Y(n.doc.resolve(r))}let s=yw(o.$headCell,e,t);return s?hT(n,r,new Y(o.$anchorCell,s)):!1}}function vT(e,t){let n=e.state.doc,r=lw(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new Y(r))),!0):!1}function yT(e,t,n){if(!dw(e.state))return!1;let r=oT(n),i=e.state.selection;if(i instanceof Y){r||={width:1,height:1,rows:[P.from(cT(sw(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=J.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=lT(r,o.right-o.left,o.bottom-o.top),pT(e.state,e.dispatch,a,o,r),!0}else if(r){let t=fw(e.state),n=t.start(-1);return pT(e.state,e.dispatch,n,J.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function bT(e,t){if(t.ctrlKey||t.metaKey)return;let n=ST(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof Y)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=lw(e.state.selection.$anchor))!=null&&CT(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=CT(e,n),i=cw.getState(e.state)==null;if(!r||!gw(t,r))if(i)r=t;else return;let a=new Y(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(cw,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),cw.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(cw,-1))}function o(r){let o=r,s=cw.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(ST(e,o.target)!=n&&(c=CT(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function xT(e,t,n){if(!(e.state.selection instanceof R))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function ST(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function CT(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?lw(e.state.doc.resolve(n.pos)):null}var wT=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,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`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),TT(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,TT(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function TT(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u){for(let e=0,n=0;e<u.childCount;e++){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e++,n++){let o=i==n?a:d&&d[e],u=o?o+`px`:``;if(s+=o||r,o||(c=!1),l)l.style.width!=u&&(l.style.width=u),l=l.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}c?(n.style.width=s+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=s+`px`)}}var ET=new V(`tableColumnResizing`);function DT({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=wT,lastColumnResizable:i=!0}={}){let a=new B({key:ET,state:{init(e,t){let i=a.spec?.props?.nodeViews,o=sw(t.schema).table.name;return r&&i&&(i[o]=(e,t)=>new r(e,n,t)),new OT(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=ET.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{kT(t,n,e,i)},mouseleave:e=>{AT(e)},mousedown:(e,r)=>{jT(e,r,t,n)}},decorations:e=>{let t=ET.getState(e);if(t&&t.activeHandle>-1)return BT(e,t.activeHandle)},nodeViews:{}}});return a}var OT=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(ET);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return mw(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function kT(e,t,n,r){if(!e.editable)return;let i=ET.getState(e.state);if(i&&!i.dragging){let a=NT(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=PT(e,t,`left`,n):i-t.clientX<=n&&(o=PT(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=J.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}IT(e,o)}}}function AT(e){if(!e.editable)return;let t=ET.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&IT(e,-1)}function jT(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=ET.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=MT(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(ET,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=ET.getState(e.state);r?.dragging&&(LT(e,r.activeHandle,FT(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(ET,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=ET.getState(e.state);if(i&&i.dragging){let a=FT(i.dragging,t,n);RT(e,i.activeHandle,a,r)}}return RT(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function MT(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function NT(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function PT(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=lw(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=J.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function FT(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function IT(e,t){e.dispatch(e.state.tr.setMeta(ET,{setHandle:t}))}function LT(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=J.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():zT(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function RT(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=J.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&TT(a,c.firstChild,c,r,s,n)}function zT(e){return Array(e).fill(0)}function BT(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return H.empty;let a=J.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,ET.getState(e)?.dragging&&n.push(Wd.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(Wd.widget(s,c))}}return H.create(e.doc,n)}function VT({allowTableNodeSelection:e=!1}={}){return new B({key:cw,state:{init(){return null},apply(e,t){let n=e.getMeta(cw);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:ww,handleDOMEvents:{mousedown:bT},createSelectionBetween(e){return cw.getState(e.state)==null?null:e.state.selection},handleTripleClick:vT,handleKeyDown:mT,handlePaste:yT},appendTransaction(t,n,r){return Dw(r,Aw(r,n),e)}})}var HT=new V(`trailingNode`);function UT(e){let{ignoredNodes:t=[],nodeName:n=`paragraph`}=e??{},r=new Set([...t,n]),i,a;return new B({key:HT,appendTransaction(e,t,n){let{doc:r,tr:a}=n,o=HT.getState(n),s=r.content.size;if(o)return a.insert(s,i.create())},state:{init:(e,{doc:t,schema:o})=>{let s=o.nodes[n];if(!s)throw Error(`Invalid node being used for trailing node extension: '${n}'`);return i=s,a=Object.values(o.nodes).map(e=>e).filter(e=>!r.has(e.name)),a.includes(t.lastChild?.type)},apply:(e,t)=>e.docChanged?a.includes(e.doc.lastChild?.type):t}})}function WT(e){return(0,t.customRef)((t,n)=>({get(){return t(),e},set(t){e=t,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var GT=class extends dg{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=WT(this.view.state),this.reactiveExtensionStorage=WT(this.extensionStorage),this.on(`beforeTransaction`,({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),(0,t.markRaw)(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){let n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){let t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},KT=(0,t.defineComponent)({name:`EditorContent`,props:{editor:{default:null,type:Object}},setup(e){let n=(0,t.ref)(),r=(0,t.getCurrentInstance)();return(0,t.watchEffect)(()=>{let i=e.editor;i&&i.options.element&&n.value&&(0,t.nextTick)(()=>{if(!n.value||!i.view.dom?.firstChild)return;let e=(0,t.unref)(n.value);n.value.append(i.view.dom),i.contentComponent=r.ctx._,r&&(i.appContext={...r.appContext,provides:r.provides}),i.setOptions({element:e}),i.createNodeViews()})}),(0,t.onBeforeUnmount)(()=>{let t=e.editor;t&&(t.contentComponent=null,t.appContext=null)}),{rootEl:n}},render(){return(0,t.h)(`div`,{ref:e=>{this.rootEl=e}})}}),qT=(0,t.defineComponent)({name:`NodeViewContent`,props:{as:{type:String,default:`div`}},render(){return(0,t.h)(this.as,{style:{whiteSpace:`pre-wrap`},"data-node-view-content":``})}}),JT=(0,t.defineComponent)({name:`NodeViewWrapper`,props:{as:{type:String,default:`div`}},inject:[`onDragStart`,`decorationClasses`],render(){var e;return(0,t.h)(this.as,{class:this.decorationClasses,style:{whiteSpace:`normal`},"data-node-view-wrapper":``,onDragstart:this.onDragStart},(e=this.$slots).default?.call(e))}}),YT=(e={})=>{let n=(0,t.shallowRef)();return(0,t.onMounted)(()=>{n.value=new GT(e)}),(0,t.onBeforeUnmount)(()=>{var e,t;let r=n.value?.view.dom,i=r?.cloneNode(!0);(e=r?.parentNode)==null||e.replaceChild(i,r),(t=n.value)==null||t.destroy()}),n},XT=class{constructor(e,{props:n={},editor:r}){this.editor=r,this.component=(0,t.markRaw)(e),this.el=document.createElement(`div`),this.props=(0,t.reactive)(n),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){return this.renderedComponent.vNode?.component?.exposed?this.renderedComponent.vNode.component.exposed:this.renderedComponent.vNode?.component?.proxy}renderComponent(){let e=(0,t.h)(this.component,this.props);return this.editor.appContext&&(e.appContext=this.editor.appContext),typeof document<`u`&&this.el&&(0,t.render)(e,this.el),{vNode:e,destroy:()=>{this.el&&(0,t.render)(null,this.el),this.el=null,e=null},el:this.el?this.el.firstElementChild:null}}updateProps(e={}){Object.entries(e).forEach(([e,t])=>{this.props[e]=t}),this.renderComponent()}destroy(){this.renderedComponent.destroy()}},ZT={editor:{type:Object,required:!0},mark:{type:Object,required:!0},extension:{type:Object,required:!0},inline:{type:Boolean,required:!0},view:{type:Object,required:!0},updateAttributes:{type:Function,required:!0},HTMLAttributes:{type:Object,required:!0}},QT=(0,t.defineComponent)({name:`MarkViewContent`,props:{as:{type:String,default:`span`}},render(){return(0,t.h)(this.as,{style:{whiteSpace:`inherit`},"data-mark-view-content":``})}}),$T=class extends Fg{constructor(e,n,r){super(e,n,r);let i={...n,updateAttributes:this.updateAttributes.bind(this)};this.renderer=new XT((0,t.defineComponent)({extends:{...e},props:Object.keys(i),template:this.component.template,setup:t=>e.setup?.call(e,t,{expose:()=>void 0}),__scopeId:e.__scopeId,__cssModules:e.__cssModules,__name:e.__name,__file:e.__file}),{editor:this.editor,props:i})}get dom(){return this.renderer.element}get contentDOM(){return this.dom.querySelector(`[data-mark-view-content]`)}updateAttributes(e){let n=(0,t.toRaw)(this.mark);super.updateAttributes(e,n)}destroy(){this.renderer.destroy()}};function eE(e,t={}){return n=>n.editor.contentComponent?new $T(e,n,t):{}}var tE={editor:{type:Object,required:!0},node:{type:Object,required:!0},decorations:{type:Object,required:!0},selected:{type:Boolean,required:!0},extension:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0},view:{type:Object,required:!0},innerDecorations:{type:Object,required:!0},HTMLAttributes:{type:Object,required:!0}},nE=class extends Ig{mount(){let 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:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode()},n=this.onDragStart.bind(this);this.decorationClasses=(0,t.ref)(this.getDecorationClasses());let r=(0,t.defineComponent)({extends:{...this.component},props:Object.keys(e),template:this.component.template,setup:e=>{var r;return(0,t.provide)(`onDragStart`,n),(0,t.provide)(`decorationClasses`,this.decorationClasses),(r=this.component).setup?.call(r,e,{expose:()=>void 0})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on(`selectionUpdate`,this.handleSelectionUpdate),this.renderer=new XT(r,{editor:this.editor,props:e})}get dom(){if(!this.renderer.element||!this.renderer.element.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.dom.querySelector(`[data-node-view-content]`)}handleSelectionUpdate(){let{from:e,to:t}=this.editor.state.selection,n=this.getPos();if(typeof n==`number`)if(e<=n&&t>=n+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,t,n){let r=e=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(e)};if(typeof this.options.update==`function`){let i=this.node,a=this.decorations,o=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.options.update({oldNode:i,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n})})}return e.type===this.node.type?e===this.node&&this.decorations===t&&this.innerDecorations===n?!0:(this.node=e,this.decorations=t,this.innerDecorations=n,r({node:e,decorations:t,innerDecorations:n}),!0):!1}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element&&this.renderer.element.classList.add(`ProseMirror-selectednode`)}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element&&this.renderer.element.classList.remove(`ProseMirror-selectednode`)}getDecorationClasses(){return this.decorations.flatMap(e=>e.type.attrs.class).join(` `)}destroy(){this.renderer.destroy(),this.editor.off(`selectionUpdate`,this.handleSelectionUpdate)}};function rE(e,t){return n=>n.editor.contentComponent?new nE(typeof e==`function`&&`__vccOpts`in e?e.__vccOpts:e,n,t):{}}function iE(e,t){return t.map(t=>{if(typeof t==`string`)return{type:`image`,attrs:{src:t}};let n=r.utils.attachment.convertToSimple(t);if(!n)return;let{mediaType:i,alt:a,url:o,caption:s}=n;return i?.startsWith(`image/`)?aE(e,{contentType:`image`,url:o,alt:a,caption:s}):i?.startsWith(`video/`)?aE(e,{contentType:`video`,url:o,caption:s}):i?.startsWith(`audio/`)?aE(e,{contentType:`audio`,url:o,caption:s}):{type:`text`,marks:[{type:`link`,attrs:{href:o}}],text:a||o}}).filter(Boolean)}function aE(e,{contentType:t,url:n,alt:r,caption:i}){let a={type:`figure`,attrs:{contentType:t},content:[{type:t,attrs:{src:n,alt:r}}]};if(i){let t=Fm(i,e.extensionManager.extensions);a.content?.push({type:`figureCaption`,content:t.content[0].content})}return a}async function oE(e){try{let t=e.state.selection.content(),{dom:n,text:r}=e.view.serializeForClipboard(t);if(navigator.clipboard&&window.ClipboardItem)try{let e=new Blob([n.innerHTML],{type:`text/html`}),t=new Blob([r],{type:`text/plain`}),i=new ClipboardItem({"text/html":e,"text/plain":t});return await navigator.clipboard.write([i]),!0}catch{return await navigator.clipboard.writeText(r),!0}return await navigator.clipboard.writeText(r),!0}catch(e){return console.error(`Failed to copy to clipboard:`,e),!1}}let sE=e=>t=>{if(e.depth)for(let n=e.depth;n>0;n--)return t.delete(e.before(n),e.after(n)).scrollIntoView(),!0;else{let n=e.parent;if(!n.isTextblock&&n.nodeSize)return t.setSelection(z.create(e.doc,e.pos)).deleteSelection(),!0}let n=e.pos;return n?(t.delete(n,n+e.node().nodeSize),!0):!1},cE=(e,t)=>{let{state:n}=t,r=n.selection.$anchor;if(r.depth){for(let i=r.depth;i>0;i--)if(r.node(i).type.name===e)return t.dispatchTransaction&&t.dispatchTransaction(n.tr.delete(r.before(i),r.after(i)).scrollIntoView()),!0}else{let r=n.selection.node;if(r&&r.type.name===e)return t.chain().deleteSelection().run(),!0}{let i=r.pos;if(i){let r=n.tr.doc.nodeAt(i);if(r&&r.type.name===e)return t.dispatchTransaction&&t.dispatchTransaction(n.tr.delete(i,i+r.nodeSize)),!0}}return!1},lE=e=>{if(!e)return;let t=uE(e),n=new Map;return t.filter(Boolean).forEach(e=>{if(!e.name){console.warn(`Extension name is missing for Extension, type: ${e.type}.`);let t=r.utils.id.uuid();n.set(t,e);return}let t=`${e.type}-${e.name}`;n.has(t)&&console.warn(`Duplicate found for Extension, type: ${e.type}, name: ${e.name}. Keeping the later one.`),n.set(t,e)}),Array.from(n.values())};var uE=e=>e.sort((e,t)=>{let n=U(e,`priority`)||100,r=U(t,`priority`)||100;return n>r?-1:n<r?1:0}),dE=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,fE=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function pE(e){return!e||e.replace(dE,``).match(fE)}let mE=e=>e.extensionManager.extensions.filter(e=>{let t=W(U(e,`group`,{name:e.name,options:e.options,storage:e.storage}));return typeof t==`string`?t.split(` `).includes(`list`):!1}).some(t=>Qm(e.state,t.name)),hE=e=>gE(e)||_E(e),gE=e=>{let t=e.type.createAndFill()?.toJSON(),n=e.toJSON();return JSON.stringify(t)===JSON.stringify(n)},_E=e=>{if(e.isTextblock)return e.textContent.length===0;if(e.childCount===0)return!0;let t=!0;return e.forEach(e=>{hE(e)||(t=!1)}),t},vE=e=>e.type.name===`paragraph`?e.textContent.length===0:!1,yE=e=>e.isTextblock?vE(e):!1;var bE=()=>typeof navigator<`u`&&/Mac/.test(navigator.platform);function xE(e){let t=e.split(`-`),n={key:``,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1};for(let e=0;e<t.length;e++){let r=t[e];if(e===t.length-1){n.key=SE(r);continue}switch(r.toLowerCase()){case`mod`:bE()?n.metaKey=!0:n.ctrlKey=!0;break;case`ctrl`:case`control`:n.ctrlKey=!0;break;case`shift`:n.shiftKey=!0;break;case`alt`:case`option`:n.altKey=!0;break;case`cmd`:case`command`:case`meta`:n.metaKey=!0;break}}return n}function SE(e){let t={space:` `,enter:`Enter`,tab:`Tab`,backspace:`Backspace`,delete:`Delete`,escape:`Escape`,esc:`Escape`,arrowleft:`ArrowLeft`,arrowright:`ArrowRight`,arrowup:`ArrowUp`,arrowdown:`ArrowDown`},n=e.toLowerCase();return t[n]?t[n]:e.length===1?e.toLowerCase():e}function CE(e,t){let n=xE(t),r=e.key.toLowerCase();return e.key===` `&&(r=` `),!(r!==n.key.toLowerCase()||e.ctrlKey!==n.ctrlKey||e.shiftKey!==n.shiftKey||e.altKey!==n.altKey||e.metaKey!==n.metaKey)}function wE(e){let t=xE(e),n=[];bE()?(t.ctrlKey&&n.push(`⌃`),t.altKey&&n.push(`⌥`),t.shiftKey&&n.push(`⇧`),t.metaKey&&n.push(`⌘`)):(t.ctrlKey&&n.push(`Ctrl`),t.altKey&&n.push(`Alt`),t.shiftKey&&n.push(`Shift`),t.metaKey&&n.push(`Meta`));let r=t.key;switch(r){case` `:r=`Space`;break;case`Enter`:r=`↵`;break;case`Delete`:r=`Del`;break}return r.length===1&&(r=r.toUpperCase()),n.push(r),bE()?n.join(``):n.join(`+`)}var TE={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function EE(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,TE,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M14.28 2a2 2 0 0 1 1.897 1.368L16.72 5H20a1 1 0 1 1 0 2l-.003.071l-.867 12.143A3 3 0 0 1 16.138 22H7.862a3 3 0 0 1-2.992-2.786L4.003 7.07L4 7a1 1 0 0 1 0-2h3.28l.543-1.632A2 2 0 0 1 9.721 2zm3.717 5H6.003l.862 12.071a1 1 0 0 0 .997.929h8.276a1 1 0 0 0 .997-.929zM10 10a1 1 0 0 1 .993.883L11 11v5a1 1 0 0 1-1.993.117L9 16v-5a1 1 0 0 1 1-1m4 0a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1m.28-6H9.72l-.333 1h5.226z`})],-1)]])}var DE=(0,t.markRaw)({name:`mingcute-delete-2-line`,render:EE}),OE=(0,t.defineComponent)({__name:`MingcuteDelete2Line`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(DE),{class:`text-red-600`}))}}),kE={class:`size-7 flex-none rounded bg-gray-100 p-1.5 group-hover:bg-white`},AE={class:`flex min-w-0 flex-1 shrink flex-col gap-0.5`},jE=[`title`],ME=[`title`],NE=(0,t.defineComponent)({__name:`ToolboxItem`,props:{editor:{},icon:{},title:{},description:{},action:{type:Function}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{role:`menuitem`,tabindex:`-1`,class:`group my-1.5 flex cursor-pointer flex-row items-center gap-3 rounded px-1.5 py-1 transition-colors first:mt-0 last:mb-0 hover:bg-gray-100`,onClick:r[0]||=t=>e.action?.()},[(0,t.createElementVNode)(`div`,kE,[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon),{class:`size-full`}))]),(0,t.createElementVNode)(`div`,AE,[(0,t.createElementVNode)(`span`,{class:`line-clamp-1 text-sm text-gray-600 group-hover:font-medium group-hover:text-gray-900`,title:e.title},(0,t.toDisplayString)(e.title),9,jE),e.description?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:`line-clamp-2 text-xs text-gray-500`,title:e.description},(0,t.toDisplayString)(e.description),9,ME)):(0,t.createCommentVNode)(``,!0)])]))}});function PE(e,t){if(!Number.isInteger(t)||t<=0)throw Error(`Size must be an integer greater than zero.`);let n=Math.ceil(e.length/t),r=Array(n);for(let i=0;i<n;i++){let n=i*t,a=n+t;r[i]=e.slice(n,a)}return r}function FE(e){return Number.isSafeInteger(e)&&e>=0}function IE(e){return e!=null&&typeof e!=`function`&&FE(e.length)}function LE(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}function RE(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function zE(e){return typeof e==`object`&&!!e&&LE(e)===`[object Arguments]`}function BE(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function VE(e){return RE(e)}function HE(e){if(e==null)return!0;if(IE(e))return typeof e.splice!=`function`&&typeof e!=`string`&&(typeof Buffer>`u`||!Buffer.isBuffer(e))&&!VE(e)&&!zE(e)?!1:e.length===0;if(typeof e==`object`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return BE(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}var UE={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function WE(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,UE,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M22 12c0-5.54-4.46-10-10-10c-1.17 0-2.3.19-3.38.56l.7 1.94c.85-.34 1.74-.53 2.68-.53c4.41 0 8.03 3.62 8.03 8.03s-3.62 8.03-8.03 8.03S3.97 16.41 3.97 12c0-.94.19-1.88.53-2.72l-1.94-.66C2.19 9.7 2 10.83 2 12c0 5.54 4.46 10 10 10s10-4.46 10-10M5.47 3.97c.85 0 1.53.71 1.53 1.5C7 6.32 6.32 7 5.47 7c-.79 0-1.5-.68-1.5-1.53c0-.79.71-1.5 1.5-1.5M18 12c0-3.33-2.67-6-6-6s-6 2.67-6 6s2.67 6 6 6s6-2.67 6-6m-3 0l-5 3V9`},null,-1)]])}var GE=(0,t.markRaw)({name:`mdi-motion-play`,render:WE}),KE={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function qE(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,KE,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`m10 16.5l6-4.5l-6-4.5M22 12c0-5.54-4.46-10-10-10c-1.17 0-2.3.19-3.38.56l.7 1.94c.85-.34 1.74-.53 2.68-.53c4.41 0 8.03 3.62 8.03 8.03s-3.62 8.03-8.03 8.03S3.97 16.41 3.97 12c0-.94.19-1.88.53-2.72l-1.94-.66C2.19 9.7 2 10.83 2 12c0 5.54 4.46 10 10 10s10-4.46 10-10M5.47 3.97c.85 0 1.53.71 1.53 1.5C7 6.32 6.32 7 5.47 7c-.79 0-1.5-.68-1.5-1.53c0-.79.71-1.5 1.5-1.5`},null,-1)]])}var JE=(0,t.markRaw)({name:`mdi-motion-play-outline`,render:qE}),YE={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function XE(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,YE,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M10 16.5v-9l6 4.5M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2`},null,-1)]])}var ZE=(0,t.markRaw)({name:`mdi-play-circle`,render:XE}),QE={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function $E(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,QE,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M12 20c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2m-2 14.5l6-4.5l-6-4.5z`},null,-1)]])}var eD=(0,t.markRaw)({name:`mdi-play-circle-outline`,render:$E}),tD={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function nD(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,tD,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M10.232 10.231a5 5 0 0 1 6.89-.172l.181.172l2.828 2.829a5 5 0 0 1-6.89 7.243l-.18-.172l-2.122-2.122a1 1 0 0 1 1.32-1.497l.094.083l2.122 2.122a3 3 0 0 0 4.377-4.1l-.135-.143l-2.828-2.828a3 3 0 0 0-4.243 0a1 1 0 0 1-1.414-1.415M3.868 3.867a5 5 0 0 1 6.89-.172l.181.172L13.06 5.99a1 1 0 0 1-1.32 1.497l-.094-.083l-2.121-2.121A3 3 0 0 0 5.147 9.38l.135.144l2.829 2.829a3 3 0 0 0 4.242 0a1 1 0 1 1 1.415 1.414a5 5 0 0 1-6.89.172l-.182-.172l-2.828-2.829a5 5 0 0 1 0-7.07Z`})],-1)]])}var rD=(0,t.markRaw)({name:`mingcute-link-line`,render:nD}),iD={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function aD(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,iD,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M18.633 9.177L14 10.72v6.78a4.5 4.5 0 1 1-2-3.742V6.442a3 3 0 0 1 2.051-2.846l3.975-1.325A1.5 1.5 0 0 1 20 3.694v3.585a2 2 0 0 1-1.367 1.898m-3.95-3.684L18 4.387V7.28l-4 1.334V6.442a1 1 0 0 1 .684-.95ZM12 17.5a2.5 2.5 0 1 1-5 0a2.5 2.5 0 0 1 5 0`})],-1)]])}var oD=(0,t.markRaw)({name:`mingcute-music-2-line`,render:aD}),sD={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function cD(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,sD,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M9 3a1 1 0 0 1 .117 1.993L9 5H5v14h14v-9a1 1 0 0 1 1.993-.117L21 10v9a2 2 0 0 1-1.85 1.995L19 21H5a2 2 0 0 1-1.995-1.85L3 19V5a2 2 0 0 1 1.85-1.995L5 3zm10.513 0c.622 0 .984.468 1.075.856c.091.389-.025.971-.585 1.247l-.414.211l-.164.088l-.363.201l-.405.236l-.439.27c-.682.43-1.46.976-2.242 1.637c-1.654 1.399-3.258 3.261-4.027 5.57a1 1 0 0 1-1.898-.632c.928-2.784 2.823-4.933 4.634-6.465c.431-.365.862-.698 1.278-1l.31-.219H14a1 1 0 0 1-.117-1.993L14 3z`})],-1)]])}var lD=(0,t.markRaw)({name:`mingcute-share-3-line`,render:cD});function uD(e){return(0,t.getCurrentScope)()?((0,t.onScopeDispose)(e),!0):!1}function dD(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return uD(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t))),clear:()=>{e.clear()}}}var fD=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var pD=()=>{},mD=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function hD(e,n,r={}){let{immediate:i=!0,immediateCallback:a=!1}=r,o=(0,t.shallowRef)(!1),s=null;function c(){s&&=(clearTimeout(s),null)}function l(){o.value=!1,c()}function u(...r){a&&e(),c(),o.value=!0,s=setTimeout(()=>{o.value=!1,s=null,e(...r)},(0,t.toValue)(n))}return i&&(o.value=!0,fD&&u()),uD(l),{isPending:(0,t.readonly)(o),start:u,stop:l}}function gD(e=1e3,n={}){let{controls:r=!1,callback:i}=n,a=hD(i??pD,e,n),o=(0,t.computed)(()=>!a.isPending.value);return r?{ready:o,...a}:o}var _D=fD?window.document:void 0;fD&&window.navigator,fD&&window.location;var vD={multiple:!0,accept:`*`,reset:!1,directory:!1};function yD(e){if(!e)return null;if(e instanceof FileList)return e;let t=new DataTransfer;for(let n of e)t.items.add(n);return t.files}function bD(e={}){let{document:n=_D}=e,r=(0,t.ref)(yD(e.initialFiles)),{on:i,trigger:a}=dD(),{on:o,trigger:s}=dD(),c;n&&(c=n.createElement(`input`),c.type=`file`,c.onchange=e=>{r.value=e.target.files,a(r.value)},c.oncancel=()=>{s()});let l=()=>{r.value=null,c&&c.value&&(c.value=``,a(null))};return{files:(0,t.readonly)(r),open:t=>{if(!c)return;let n={...vD,...e,...t};c.multiple=n.multiple,c.accept=n.accept,c.webkitdirectory=n.directory,mD(n,`capture`)&&(c.capture=n.capture),n.reset&&l(),c.click()},reset:l,onCancel:o,onChange:i}}var xD={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function SD(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,xD,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 2a8 8 0 1 0 0 16a8 8 0 0 0 0-16m-.01 6c.558 0 1.01.452 1.01 1.01v5.124A1 1 0 0 1 12.5 18h-.49A1.01 1.01 0 0 1 11 16.99V12a1 1 0 1 1 0-2zM12 7a1 1 0 1 1 0 2a1 1 0 0 1 0-2`})],-1)]])}var CD=(0,t.markRaw)({name:`mingcute-information-line`,render:SD}),wD={key:0,class:`absolute -top-2 left-2 inline-block rounded-md bg-white px-1 text-xs text-gray-500 group-focus-within:text-gray-900`},TD=[`type`,`placeholder`],ED={key:2,class:`line-clamp-1 text-xs text-gray-500`},DD=(0,t.defineComponent)({__name:`Input`,props:(0,t.mergeModels)({type:{default:`text`},label:{default:void 0},help:{type:Boolean,default:void 0},placeholder:{default:void 0},tooltip:{default:void 0},autoFocus:{type:Boolean,default:!1}},{modelValue:{default:``},modelModifiers:{}}),emits:(0,t.mergeModels)([`focus`],[`update:modelValue`]),setup(e,{emit:n}){let r=(0,t.useModel)(e,`modelValue`),i=e,a=n,o=(0,t.ref)();return(0,t.watchEffect)(()=>{o.value&&i.autoFocus&&setTimeout(()=>{o.value?.focus()},100)}),(n,i)=>{let s=(0,t.resolveDirective)(`tooltip`);return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`group relative h-11 w-full`,{"mt-2":!!e.label}])},[e.label?((0,t.openBlock)(),(0,t.createElementBlock)(`label`,wD,(0,t.toDisplayString)(e.label),1)):(0,t.createCommentVNode)(``,!0),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{ref_key:`inputRef`,ref:o,"onUpdate:modelValue":i[0]||=e=>r.value=e,type:e.type,class:`block size-full rounded-md bg-white px-3 text-sm text-gray-900 ring-1 ring-gray-100 transition-all placeholder:text-gray-400 focus:!ring-1 focus:!ring-primary`,placeholder:e.placeholder,onFocus:i[1]||=e=>a(`focus`)},null,40,TD),[[t.vModelDynamic,r.value,void 0,{lazy:!0,trim:!0}]]),e.tooltip?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(CD),{key:1,class:`absolute right-2 top-1/2 size-4 -translate-y-1/2 text-gray-500 transition-colors hover:text-primary`},null,512)),[[s,e.tooltip]]):(0,t.createCommentVNode)(``,!0),e.help?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,ED,(0,t.toDisplayString)(e.help),1)):(0,t.createCommentVNode)(``,!0)],2)}}}),OD={class:`flex h-64 w-full items-center justify-center`},kD={key:2,class:`flex size-full cursor-pointer flex-col items-center justify-center border-2 border-dashed border-gray-300 bg-gray-50`},AD={class:`flex flex-col items-center justify-center space-y-7 pb-6 pt-5`},jD={key:0,class:`flex h-14 w-14 items-center justify-center rounded-full bg-primary/20`},MD={class:`w-80`},ND=(0,t.defineComponent)({__name:`EditorLinkObtain`,props:{editor:{},accept:{default:`*`},uploadedFile:{default:void 0},uploadToAttachmentFile:{}},emits:[`setExternalLink`,`onUploadReady`,`onUploadProgress`,`onUploadFinish`,`onUploadError`,`onUploadAbort`],setup(e,{expose:i,emit:a}){let o=e,s=a,c=(0,t.ref)(``),l=()=>{c.value&&s(`setExternalLink`,{url:c.value})},{open:u,reset:d,onChange:f}=bD({accept:o.accept,multiple:!1}),p=(0,t.ref)(),m=(0,t.ref)(),h=(0,t.ref)(`init`),g=(0,t.ref)(void 0),_=e=>{p.value=new AbortController,m.value=e,h.value=`uploading`,g.value=void 0,s(`onUploadReady`,e),kK(e,o.uploadToAttachmentFile,{controller:p.value,onUploadProgress:e=>{g.value=e,s(`onUploadProgress`,e)},onFinish:e=>{e&&s(`setExternalLink`,{url:e.status?.permalink}),b(),s(`onUploadFinish`)},onError:e=>{e.name!==`CanceledError`&&(h.value=`error`),s(`onUploadError`,e)}})},v=()=>{s(`onUploadAbort`),b()},y=()=>{p.value&&(p.value.abort(),m.value&&_(m.value))},b=()=>{h.value=`init`,p.value?.abort(),p.value=void 0,m.value=void 0,g.value=void 0,d()};f(e=>{e&&e.length>0&&_(e[0])}),(0,t.watch)(()=>o.uploadedFile,async e=>{e&&_(e)},{immediate:!0}),(0,t.onUnmounted)(()=>{v()}),i({abort:v,retry:y,reset:b});let x=(0,t.ref)(!1);function S(e){if(!e.length)return;let t=e[0];s(`setExternalLink`,r.utils.attachment.convertToSimple(t)),x.value=!1}return(e,i)=>{let a=(0,t.resolveComponent)(`AttachmentSelectorModal`);return(0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[x.value?((0,t.openBlock)(),(0,t.createBlock)(a,{key:0,accepts:[o.accept],min:1,max:1,onSelect:S,onClose:i[0]||=e=>x.value=!1},null,8,[`accepts`])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,OD,[e.$slots.uploading&&h.value===`uploading`?(0,t.renderSlot)(e.$slots,`uploading`,{key:0,progress:g.value}):e.$slots.error&&h.value===`error`?(0,t.renderSlot)(e.$slots,`error`,{key:1}):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,kD,[(0,t.createElementVNode)(`div`,AD,[e.$slots.icon?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,jD,[(0,t.renderSlot)(e.$slots,`icon`)])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(n.VSpace),null,{default:(0,t.withCtx)(()=>[(0,t.unref)(r.utils).permission.has([`uc:attachments:manage`])?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VButton),{key:0,onClick:i[1]||=e=>(0,t.unref)(u)()},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.common.button.upload`)),1)]),_:1})):(0,t.createCommentVNode)(``,!0),(0,t.unref)(r.utils).permission.has([`system:attachments:view`,`uc:attachments:manage`])?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VButton),{key:1,onClick:i[2]||=e=>x.value=!0},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.upload.attachment.title`)),1)]),_:1})):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(n.VDropdown),null,{popper:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,MD,[(0,t.createVNode)(DD,{modelValue:c.value,"onUpdate:modelValue":i[3]||=e=>c.value=e,"auto-focus":``,placeholder:(0,t.unref)(N).global.t(`editor.extensions.upload.permalink.placeholder`),onKeydown:(0,t.withKeys)(l,[`enter`])},null,8,[`modelValue`,`placeholder`])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.VButton),null,{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.upload.permalink.title`)),1)]),_:1})]),_:1})]),_:1})])]))])],64)}}}),PD={class:`w-80`},FD=(0,t.defineComponent)({__name:`ResourceReplaceButton`,props:{originalLink:{},accept:{},upload:{type:Function}},emits:[`change`],setup(e,{emit:i}){let a=e,o=i,s=(0,t.ref)(!1);function c(e){if(!e.length)return;let t=e[0];o(`change`,r.utils.attachment.convertToSimple(t)),s.value=!1}let{onChange:l,open:u}=bD({accept:a.accept,multiple:!1});l(e=>{let t=e?.[0];t&&a.upload?.(t).then(e=>{o(`change`,r.utils.attachment.convertToSimple(e))}).catch(e=>{n.Toast.error(`${N.global.t(`editor.extensions.upload.error`)} - ${e.message}`)})});function d(e){e&&typeof e==`string`&&o(`change`,r.utils.attachment.convertToSimple(e))}return(i,a)=>{let o=(0,t.resolveComponent)(`AttachmentSelectorModal`);return(0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createVNode)((0,t.unref)(n.VDropdown),{class:`inline-flex`},{popper:(0,t.withCtx)(()=>[(0,t.unref)(r.utils).permission.has([`uc:attachments:manage`])?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VDropdownItem),{key:0,onClick:a[0]||=e=>(0,t.unref)(u)()},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.common.button.upload`)),1)]),_:1})):(0,t.createCommentVNode)(``,!0),(0,t.unref)(r.utils).permission.has([`system:attachments:view`,`uc:attachments:manage`])?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VDropdownItem),{key:1,onClick:a[1]||=e=>s.value=!0},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.upload.attachment.title`)),1)]),_:1})):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(n.VDropdown),null,{popper:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,PD,[(0,t.createVNode)(DD,{"auto-focus":``,"model-value":e.originalLink,placeholder:(0,t.unref)(N).global.t(`editor.extensions.upload.permalink.placeholder`),"onUpdate:modelValue":d},null,8,[`model-value`,`placeholder`])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.VDropdownItem),null,{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.upload.permalink.title`)),1)]),_:1})]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.VButton),{size:`sm`,type:`secondary`},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.upload.operations.replace.button`)),1)]),_:1})]),_:1}),s.value?((0,t.openBlock)(),(0,t.createBlock)(o,{key:0,accepts:[e.accept].filter(Boolean),min:1,max:1,onSelect:c,onClose:a[2]||=e=>s.value=!1},null,8,[`accepts`])):(0,t.createCommentVNode)(``,!0)],64)}}});function ID(e,a){let{globalInfo:o}=r.stores.globalInfo(),{t:s}=qr(),c=(0,t.computed)(()=>e.value?.startsWith(`/`)||!o?.externalUrl?!1:!e.value?.startsWith(o?.externalUrl)),l=(0,t.ref)(!1);async function u(){if(!e.value)return;l.value=!0;let{data:t}=await i.ucApiClient.storage.attachment.uploadAttachmentForUc({url:e.value});a({url:t.status?.permalink||``,alt:t.spec.displayName}),n.Toast.success(s(`editor.common.toast.save_success`)),l.value=!1}return{isExternalAsset:c,transferring:l,handleTransfer:u}}var LD={key:0,class:`group relative`},RD=[`src`,`autoplay`,`loop`],zD={key:0,class:`absolute left-0 top-0 hidden w-full cursor-pointer justify-end gap-2 rounded-md bg-gradient-to-b from-gray-300 to-transparent p-2 ease-in-out group-hover:flex`},BD={class:`relative w-full`},VD={class:`absolute top-0 size-full bg-black bg-opacity-20`},HD={class:`absolute top-[50%] w-full space-y-2 text-white`},UD={class:`px-10`},WD={class:`relative h-4 w-full overflow-hidden rounded-full bg-gray-200`},GD={class:`absolute left-[50%] top-0 -translate-x-[50%] text-xs leading-4 text-white`},KD={class:`absolute top-0 size-full bg-black bg-opacity-20`},qD={class:`absolute top-[50%] w-full space-y-2 text-white`},JD={class:`px-10`},YD={class:`relative h-4 w-full overflow-hidden rounded-full bg-gray-200`},XD={class:`absolute left-[50%] top-0 -translate-x-[50%] text-xs leading-4 text-white`},ZD=(0,t.defineComponent)({__name:`AudioView`,props:{decorations:{},selected:{type:Boolean},updateAttributes:{type:Function},deleteNode:{type:Function},node:{},view:{},getPos:{},innerDecorations:{},editor:{},extension:{},HTMLAttributes:{}},setup(e){let i=e,a=(0,t.computed)({get:()=>i.node?.attrs.src,set:e=>{i.updateAttributes({src:e})}}),o=(0,t.computed)(()=>i.node.attrs.autoplay),s=(0,t.computed)(()=>i.node.attrs.loop),c=(0,t.computed)(()=>!a.value),l=(0,t.computed)(()=>i.node?.attrs.position||`left`),u=(0,t.ref)(),d=e=>{e&&i.updateAttributes({src:e.url})},f=()=>{let{file:e}=i.node.attrs;e&&i.updateAttributes({width:void 0,height:void 0,file:void 0})},p=()=>{u.value?.reset()},m=()=>{u.value?.abort()},{isExternalAsset:h,transferring:g,handleTransfer:_}=ID(a,d),v=(0,t.computed)(()=>i.node?.attrs.width?.includes(`%`));return(i,y)=>{let b=(0,t.resolveDirective)(`tooltip`);return(0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(JT),{as:`div`,class:(0,t.normalizeClass)([`flex w-full`,{"justify-start":l.value===`left`,"justify-center":l.value===`center`,"justify-end":l.value===`right`}])},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`relative inline-block h-full max-w-full overflow-hidden rounded-md text-center transition-all`,{"rounded ring-2":e.selected}]),style:(0,t.normalizeStyle)({width:c.value?`100%`:e.node.attrs.width,height:c.value?`100%`:e.node.attrs.height})},[a.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,LD,[(0,t.createElementVNode)(`audio`,{class:`m-0 rounded-md`,controls:``,src:a.value,autoplay:o.value,loop:s.value,preload:`metadata`,style:(0,t.normalizeStyle)({width:v.value?`100%`:e.node.attrs.width,height:v.value?`100%`:e.node.attrs.height})},null,12,RD),a.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,zD,[(0,t.unref)(r.utils).permission.has([`uc:attachments:manage`,`system:attachments:manage`])&&(0,t.unref)(h)?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VButton),{key:0,loading:(0,t.unref)(g),size:`sm`,ghost:``,onClick:(0,t.unref)(_)},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.upload.operations.transfer.button`)),1)]),_:1},8,[`loading`,`onClick`])),[[b,(0,t.unref)(N).global.t(`editor.extensions.upload.operations.transfer.tooltip`)]]):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(FD),{accept:`audio/*`,"original-link":a.value,upload:e.extension.options.uploadAudio,onChange:d},null,8,[`original-link`,`upload`])])):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),(0,t.withDirectives)((0,t.createElementVNode)(`div`,BD,[(0,t.createVNode)((0,t.unref)(ND),{ref_key:`editorLinkObtain`,ref:u,class:`!h-40 w-full`,accept:`audio/*`,editor:e.editor,"upload-to-attachment-file":e.extension.options.uploadAudio,"uploaded-file":e.node?.attrs.file,onSetExternalLink:d,onOnUploadFinish:f,onOnUploadAbort:f},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(oD),{class:`text-xl text-primary`})]),uploading:(0,t.withCtx)(({progress:e})=>[(0,t.createElementVNode)(`div`,VD,[(0,t.createElementVNode)(`div`,HD,[(0,t.createElementVNode)(`div`,UD,[(0,t.createElementVNode)(`div`,WD,[(0,t.createElementVNode)(`div`,{class:`h-full bg-primary`,style:(0,t.normalizeStyle)({width:`${e||0}%`})},null,4),(0,t.createElementVNode)(`div`,GD,(0,t.toDisplayString)(e?`${e}%`:`${(0,t.unref)(N).global.t(`editor.extensions.upload.loading`)}...`),1)])]),(0,t.createElementVNode)(`div`,{class:`inline-block cursor-pointer text-sm hover:opacity-70`,onClick:m},(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.common.button.cancel`)),1)])])]),error:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,KD,[(0,t.createElementVNode)(`div`,qD,[(0,t.createElementVNode)(`div`,JD,[(0,t.createElementVNode)(`div`,YD,[y[0]||=(0,t.createElementVNode)(`div`,{class:`size-full bg-red-600`},null,-1),(0,t.createElementVNode)(`div`,XD,(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.upload.error`)),1)])]),(0,t.createElementVNode)(`div`,{class:`inline-block cursor-pointer text-sm hover:opacity-70`,onClick:p},(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.upload.click_retry`)),1)])])]),_:1},8,[`editor`,`upload-to-attachment-file`,`uploaded-file`])],512),[[t.vShow,!a.value]])],6)]),_:1},8,[`class`])}}}),QD={class:`w-80`},$D=(0,t.defineComponent)({__name:`BubbleItemAudioLink`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},setup(e){let n=e,r=(0,t.computed)({get:()=>n.editor.getAttributes(xK.name)?.src,set:e=>{n.editor.chain().updateAttributes(xK.name,{src:e}).setNodeSelection(n.editor.state.selection.from).focus().run()}});return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,QD,[(0,t.createVNode)(DD,{modelValue:r.value,"onUpdate:modelValue":n[0]||=e=>r.value=e,"auto-focus":``,placeholder:(0,t.unref)(N).global.t(`editor.common.placeholder.link_input`),label:(0,t.unref)(N).global.t(`editor.extensions.audio.src_input_label`)},null,8,[`modelValue`,`placeholder`,`label`])]))}}),eO=[`title`],tO={key:0},nO=(0,t.defineComponent)({__name:`BubbleButton`,props:{title:{default:void 0},text:{default:void 0},isActive:{type:Boolean,default:!1},showMoreIndicator:{type:Boolean,default:!1}},setup(e){let n=e,r=(0,t.computed)(()=>!n.text&&!n.showMoreIndicator);return(n,i)=>{let a=(0,t.resolveDirective)(`tooltip`);return(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{class:(0,t.normalizeClass)([[{"bg-gray-200 !text-black":e.isActive},{"size-8":r.value},{"h-8 gap-1 px-1":!r.value}],`text inline-flex items-center justify-center rounded-md text-gray-600 hover:bg-gray-100 active:!bg-gray-200 [&>svg]:size-5`]),title:e.title},[(0,t.renderSlot)(n.$slots,`icon`),e.text?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,tO,(0,t.toDisplayString)(e.text),1)):(0,t.createCommentVNode)(``,!0),e.showMoreIndicator?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(ee),{key:1})):(0,t.createCommentVNode)(``,!0)],10,eO)),[[a,{content:e.title,distance:8,delay:{show:0}}]])}}}),rO={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function iO(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,rO,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M17 18a1 1 0 0 1 .117 1.993L17 20H7a1 1 0 0 1-.117-1.993L7 18zm3-5a1 1 0 1 1 0 2H4a1 1 0 1 1 0-2zm-3-5a1 1 0 0 1 .117 1.993L17 10H7a1 1 0 0 1-.117-1.993L7 8zm3-5a1 1 0 0 1 .117 1.993L20 5H4a1 1 0 0 1-.117-1.993L4 3z`})],-1)]])}var aO=(0,t.markRaw)({name:`mingcute-align-center-line`,render:iO}),oO={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function sO(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,oO,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M14 18a1 1 0 0 1 .117 1.993L14 20H4a1 1 0 0 1-.117-1.993L4 18zm6-5a1 1 0 1 1 0 2H4a1 1 0 1 1 0-2zm-6-5a1 1 0 0 1 .117 1.993L14 10H4a1 1 0 0 1-.117-1.993L4 8zm6-5a1 1 0 0 1 .117 1.993L20 5H4a1 1 0 0 1-.117-1.993L4 3z`})],-1)]])}var cO=(0,t.markRaw)({name:`mingcute-align-left-line`,render:sO}),lO={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function uO(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,lO,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M20 18a1 1 0 0 1 .117 1.993L20 20H10a1 1 0 0 1-.117-1.993L10 18zm0-5a1 1 0 1 1 0 2H4a1 1 0 1 1 0-2zm0-5a1 1 0 0 1 .117 1.993L20 10H10a1 1 0 0 1-.117-1.993L10 8zm0-5a1 1 0 0 1 .117 1.993L20 5H4a1 1 0 0 1-.117-1.993L4 3z`})],-1)]])}var dO=(0,t.markRaw)({name:`mingcute-align-right-line`,render:uO}),fO=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]},pO=/^\s*>\s$/,mO=q.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return fO(`blockquote`,{...G(this.options.HTMLAttributes,e),children:fO(`slot`,{})})},parseMarkdown:(e,t)=>t.createNode(`blockquote`,void 0,t.parseChildren(e.tokens||[])),renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach(e=>{let r=t.renderChildren([e]).split(`
127
+ `).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(r.join(`
128
+ `))}),n.join(`
129
+ >
130
+ `)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[gg({find:pO,type:this.type})]}}),hO={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function gO(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,hO,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M11.778 4.371a1 1 0 0 1-.15 1.407c-.559.452-.924.886-1.163 1.276a2 2 0 1 1-2.46 1.792c-.024-.492.02-1.15.293-1.892c.326-.884.956-1.829 2.073-2.732a1 1 0 0 1 1.407.15ZM15 5a1 1 0 1 0 0 2h5a1 1 0 1 0 0-2zm0 4a1 1 0 1 0 0 2h5a1 1 0 1 0 0-2zM4 14a1 1 0 0 1 1-1h15a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1m1 3a1 1 0 1 0 0 2h15a1 1 0 1 0 0-2zM3.006 8.846a2 2 0 1 0 2.459-1.792c.239-.39.604-.824 1.164-1.276A1 1 0 1 0 5.37 4.222c-1.117.903-1.747 1.848-2.073 2.732a4.8 4.8 0 0 0-.292 1.892Z`})],-1)]])}var _O=(0,t.markRaw)({name:`mingcute-blockquote-line`,render:gO});let vO=mO.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:90,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(mO.name),icon:(0,t.markRaw)(_O),title:N.global.t(`editor.common.quote`),action:()=>{e.commands.toggleBlockquote()}}}}}}});var yO=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,bO=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,xO=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,SO=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,CO=Vh.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return fO(`strong`,{...G(this.options.HTMLAttributes,e),children:fO(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[fg({find:yO,type:this.type}),fg({find:xO,type:this.type})]},addPasteRules(){return[Lg({find:bO,type:this.type}),Lg({find:SO,type:this.type})]}}),wO={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function TO(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,wO,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M13 3a5 5 0 0 1 3.436 8.633a5 5 0 0 1-2.219 9.363L14 21H6.1a1.1 1.1 0 0 1-1.094-.98L5 19.9V4.1a1.1 1.1 0 0 1 .98-1.094L6.1 3zm1 10H7v6h7a3 3 0 1 0 0-6m-1-8H7v6h6a3 3 0 1 0 0-6`})],-1)]])}var EO=(0,t.markRaw)({name:`mingcute-bold-line`,render:TO});let DO=CO.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:40,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(CO.name),icon:(0,t.markRaw)(EO),title:N.global.t(`editor.common.bold`),action:()=>{e.chain().focus().toggleBold().run()}}}}}}});var OO=Object.defineProperty,kO=(e,t)=>{for(var n in t)OO(e,n,{get:t[n],enumerable:!0})},AO=`listItem`,jO=`textStyle`,MO=/^\s*([-+*])\s$/,NO=q.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:e}){return[`ul`,G(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
131
+ `):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(AO,this.editor.getAttributes(jO)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=gg({find:MO,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=gg({find:MO,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(jO),editor:this.editor})),[e]}}),PO=q.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,G(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(e=>e.type===`paragraph`))n=t.parseChildren(e.tokens);else{let r=e.tokens[0];if(r&&r.type===`text`&&r.tokens&&r.tokens.length>0){if(n=[{type:`paragraph`,content:t.parseInline(r.tokens)}],e.tokens.length>1){let r=e.tokens.slice(1),i=t.parseChildren(r);n.push(...i)}}else n=t.parseChildren(e.tokens)}return n.length===0&&(n=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:n}},renderMarkdown:(e,t,n)=>Ng(e,t,e=>e.parentType===`bulletList`?`- `:e.parentType===`orderedList`?`${e.index+1}. `:`- `,n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),FO={};kO(FO,{findListItemPos:()=>IO,getNextListDepth:()=>LO,handleBackspace:()=>VO,handleDelete:()=>WO,hasListBefore:()=>RO,hasListItemAfter:()=>GO,hasListItemBefore:()=>zO,listItemHasSubList:()=>BO,nextListIsDeeper:()=>HO,nextListIsHigher:()=>UO});var IO=(e,t)=>{let{$from:n}=t.selection,r=lp(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},LO=(e,t)=>{let n=IO(e,t);if(!n)return!1;let[,r]=qm(t,e,n.$pos.pos+4);return r},RO=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},zO=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},BO=(e,t,n)=>{if(!n)return!1;let r=lp(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},VO=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Jp(e.state,t)&&RO(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!Jp(e.state,t)||!eh(e.state))return!1;let r=IO(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=BO(t,e.state,i);return zO(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},HO=(e,t)=>{let n=LO(e,t),r=IO(e,t);return!r||!n?!1:n>r.depth},UO=(e,t)=>{let n=LO(e,t),r=IO(e,t);return!r||!n?!1:n<r.depth},WO=(e,t)=>{if(!Jp(e.state,t)||!$m(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:HO(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():UO(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},GO=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},KO=K.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&WO(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&WO(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&VO(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&VO(e,n,r)&&(t=!0)}),t}}}}),qO=/^(\s*)(\d+)\.\s+(.*)$/,JO=/^\s/;function YO(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(qO);if(!a)break;let[,o,s,c]=a,l=o.length,u=c,d=n+1,f=[i];for(;d<e.length;){let t=e[d];if(t.match(qO))break;if(t.trim()===``)f.push(t),u+=`
132
+ `,d+=1;else if(t.match(JO))f.push(t),u+=`
133
+ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:u.trim(),raw:f.join(`
134
+ `)}),r=d,n=d}return[t,r]}function XO(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let o=a.content.split(`
135
+ `),s=o[0]?.trim()||``,c=[];s&&c.push({type:`paragraph`,raw:s,tokens:n.inlineTokens(s)});let l=o.slice(1).join(`
136
+ `).trim();if(l){let e=n.blockTokens(l);c.push(...e)}let u=i+1,d=[];for(;u<e.length&&e[u].indent>t;)d.push(e[u]),u+=1;if(d.length>0){let e=XO(d,Math.min(...d.map(e=>e.indent)),n);c.push({type:`list`,ordered:!0,start:d[0].number,items:e,raw:d.map(e=>e.raw).join(`
137
+ `)})}r.push({type:`list_item`,raw:a.raw,tokens:c}),i=u}else i+=1}return r}function ZO(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var QO=`listItem`,$O=`textStyle`,ek=/^(\d+)\.\s$/,tk=q.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:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>e.getAttribute(`type`)}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return t===1?[`ol`,G(this.options.HTMLAttributes,n),0]:[`ol`,G(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.items?ZO(e.items,t):[];return n===1?{type:`orderedList`,content:r}:{type:`orderedList`,attrs:{start:n},content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
138
+ `):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(`
139
+ `),[i,a]=YO(r);if(i.length===0)return;let o=XO(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(`
140
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(QO,this.editor.getAttributes($O)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=gg({find:ek,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=gg({find:ek,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes($O)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),nk=/^\s*(\[([( |x])?\])\s$/,rk=q.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:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,G(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>Ng(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};return l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)}),{dom:i,contentDOM:c,update:e=>e.type===this.type?(i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e),!0):!1}}},addInputRules(){return[gg({find:nk,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),ik=q.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:e}){return[`ul`,G(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
141
+ `):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=Mg(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=Mg(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});K.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(NO.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(PO.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(KO.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(tk.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(rk.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(ik.configure(this.options.taskList)),e}});var ak={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function ok(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,ak,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M4.5 17.5a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3M20 18a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2zM4.5 10.5a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3M20 11a1 1 0 0 1 .117 1.993L20 13H9a1 1 0 0 1-.117-1.993L9 11zM4.5 3.5a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3M20 4a1 1 0 0 1 .117 1.993L20 6H9a1 1 0 0 1-.117-1.993L9 4z`})],-1)]])}var sk=(0,t.markRaw)({name:`mingcute-list-check-line`,render:ok});let ck=NO.extend({addOptions(){return{...this.parent?.(),getCommandMenuItems(){return{priority:130,icon:(0,t.markRaw)(sk),title:`editor.common.bullet_list`,keywords:[`bulletlist`,`wuxuliebiao`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleBulletList().run()}}}}},addExtensions(){return[PO]}});var lk=K.create({name:`characterCount`,addOptions(){return{limit:null,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new B({key:new V(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(i==null||i===0){e=!0;return}let a=this.storage.characters({node:r.doc});if(a>i){let t=a-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}}),uk=K.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[y_(this.options)]}});K.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new B({key:new V(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return H.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(Wd.node(t,t+e.nodeSize,{class:this.options.className}))}),H.create(e,a)}}})]}}),K.create({name:`gapCursor`,addProseMirrorPlugins(){return[T_()]},extendNodeSchema(e){return{allowGapCursor:W(U(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}});var dk=K.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new B({key:new V(`placeholder`),props:{decorations:({doc:e,selection:t})=>{let n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];if(!n)return null;let a=this.editor.isEmpty;return e.descendants((e,t)=>{let n=r>=t&&r<=t+e.nodeSize,o=!e.isLeaf&&rh(e);if((n||!this.options.showOnlyCurrent)&&o){let r=[this.options.emptyNodeClass];a&&r.push(this.options.emptyEditorClass);let o=Wd.node(t,t+e.nodeSize,{class:r.join(` `),"data-placeholder":typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});i.push(o)}return this.options.includeChildren}),H.create(e,i)}}})]}});K.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new B({key:new V(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||ih(n.selection)||e.view.dragging?null:H.create(n.doc,[Wd.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function fk({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}K.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new V(this.name),t=this.editor.schema.topNodeType.contentMatch.defaultType?.name||this.options.node||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new B({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!fk({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!fk({node:r,types:n})}}})]}});var pk=K.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>tv(e,t),redo:()=>({state:e,dispatch:t})=>nv(e,t)}},addProseMirrorPlugins(){return[$_(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()}}}),mk={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function hk(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,mk,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`m15.535 2.808l5.657 5.656a2 2 0 0 1 0 2.829l-3.522 3.523l-.013.012l-.013.013L13.485 19H20a1 1 0 1 1 0 2H8.893a1.5 1.5 0 0 1-1.06-.44l-5.026-5.024a2 2 0 0 1 0-2.829l9.9-9.9a2 2 0 0 1 2.828 0Zm0 11.313L10.657 19H9.1l-4.878-4.879l5.657-5.657zm1.415-1.414L11.293 7.05l2.828-2.828l5.657 5.657z`})],-1)]])}var gk=(0,t.markRaw)({name:`mingcute-eraser-line`,render:hk});let _k=K.create({name:`clearFormat`,addOptions(){return{getToolbarItems({editor:e}){return{priority:23,component:(0,t.markRaw)(E),props:{editor:e,isActive:!1,icon:(0,t.markRaw)(gk),title:N.global.t(`editor.common.clear_format`),action:()=>e.chain().focus().unsetAllMarks().run()}}}}},addKeyboardShortcuts(){return{"Mod-\\":()=>this.editor.chain().focus().unsetAllMarks().run()}}});var vk=/(^|[^`])`([^`]+)`(?!`)$/,yk=/(^|[^`])`([^`]+)`(?!`)/g,bk=Vh.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,G(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[fg({find:vk,type:this.type})]},addPasteRules(){return[Lg({find:yk,type:this.type})]}}),xk={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Sk(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,xk,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`M0 0h24v24H0z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M14.486 3.143a1 1 0 0 1 .692 1.233l-4.43 15.788a1 1 0 0 1-1.926-.54l4.43-15.788a1 1 0 0 1 1.234-.693M7.207 7.05a1 1 0 0 1 0 1.414L3.672 12l3.535 3.535a1 1 0 1 1-1.414 1.415L1.55 12.707a1 1 0 0 1 0-1.414L5.793 7.05a1 1 0 0 1 1.414 0m9.586 1.414a1 1 0 1 1 1.414-1.414l4.243 4.243a1 1 0 0 1 0 1.414l-4.243 4.243a1 1 0 0 1-1.414-1.415L20.328 12z`})],-1)]])}var Ck=(0,t.markRaw)({name:`mingcute-code-line`,render:Sk});let wk=bk.extend({exitable:!0,addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:100,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(bk.name),icon:(0,t.markRaw)(Ck),title:N.global.t(`editor.common.code`),action:()=>e.chain().focus().toggleCode().run()}}}}}});var Tk=4,Ek=/^```([a-z]+)?[\s\n]$/,Dk=/^~~~([a-z]+)?[\s\n]$/,Ok=q.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Tk,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,G(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
142
+ `):`\`\`\`${r}
143
+
144
+ \`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??Tk,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
145
+ `,`
146
+ `).split(`
147
+ `).map(e=>o+e).join(`
148
+ `);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??Tk,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
149
+ `,`
150
+ `).split(`
151
+ `),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(R.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
152
+ `,`
153
+ `).split(`
154
+ `).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
155
+ `);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
156
+
157
+ `);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(L.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[mg({find:Ek,type:this.type,getAttributes:e=>({language:e[1]})}),mg({find:Dk,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new B({key:new V(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
158
+ `));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(R.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),kk={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Ak(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,kk,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M8 3a1 1 0 0 1 .117 1.993L8 5H7a1 1 0 0 0-.993.883L6 6v4c0 .768-.289 1.47-.764 2c.428.478.704 1.093.755 1.772L6 14v4a1 1 0 0 0 .883.993L7 19h1a1 1 0 0 1 .117 1.993L8 21H7a3 3 0 0 1-2.995-2.824L4 18v-4a1 1 0 0 0-.883-.993L3 13a1 1 0 0 1-.117-1.993L3 11a1 1 0 0 0 .993-.883L4 10V6a3 3 0 0 1 2.824-2.995L7 3zm9 0a3 3 0 0 1 2.995 2.824L20 6v4a1 1 0 0 0 .883.993L21 11a1 1 0 0 1 .117 1.993L21 13a1 1 0 0 0-.993.883L20 14v4a3 3 0 0 1-2.824 2.995L17 21h-1a1 1 0 0 1-.117-1.993L16 19h1a1 1 0 0 0 .993-.883L18 18v-4c0-.768.289-1.47.764-2a3 3 0 0 1-.755-1.772L18 10V6a1 1 0 0 0-.883-.993L17 5h-1a1 1 0 0 1-.117-1.993L16 3z`})],-1)]])}var jk=(0,t.markRaw)({name:`mingcute-braces-line`,render:Ak}),Mk={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Nk(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Mk,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M19 2a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2V4a2 2 0 0 1 2-2zm-4 6H5v12h10zm-5 7a1 1 0 1 1 0 2H8a1 1 0 1 1 0-2zm9-11H9v2h6a2 2 0 0 1 2 2v8h2zm-7 7a1 1 0 0 1 .117 1.993L12 13H8a1 1 0 0 1-.117-1.993L8 11z`})],-1)]])}var Pk=(0,t.markRaw)({name:`mingcute-copy-line`,render:Nk}),Fk={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Ik(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Fk,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`M24 0v24H0V0zM12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M14.536 12.707a1 1 0 0 0 0-1.414l-2.829-2.829A1 1 0 0 0 10 9.172v5.656a1 1 0 0 0 1.707.708z`})],-1)]])}var Lk=(0,t.markRaw)({name:`mingcute-right-small-fill`,render:Ik}),Rk={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function zk(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Rk,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M12.707 15.707a1 1 0 0 1-1.414 0L5.636 10.05A1 1 0 1 1 7.05 8.636l4.95 4.95l4.95-4.95a1 1 0 0 1 1.414 1.414z`})],-1)]])}var Bk=(0,t.markRaw)({name:`mingcute-down-line`,render:zk}),Vk={class:`h-8`},Hk={class:`absolute bottom-0 top-0`},Uk=[`placeholder`],Wk={class:`bg-white`},Gk={class:`select max-h-64 cursor-pointer p-1`},Kk=[`index`,`onMousedown`],qk={class:`flex-1 text-ellipsis text-sm`},Jk={key:1,class:`flex h-8 w-full items-center rounded-md px-3 py-1 text-base`},Yk=_((0,t.defineComponent)({__name:`CodeBlockSelect`,props:(0,t.mergeModels)({container:{},containerClass:{},options:{},filterSort:{type:Function}},{modelValue:{default:``},modelModifiers:{}}),emits:(0,t.mergeModels)([`select`],[`update:modelValue`]),setup(e,{emit:r}){let i=e,a=(0,t.useModel)(e,`modelValue`),o=r,s=(0,t.ref)(!1),c=(0,t.ref)(``),l=(0,t.ref)(null),u=(0,t.ref)(null),d=(0,t.computed)(()=>l.value?l.value.label:a.value),f=(0,t.computed)(()=>c.value?i.options.filter(e=>e.value.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())):i.options),p=()=>{s.value=!0,setTimeout(()=>{v()},50)},m=()=>{s.value=!1,c.value&&=(a.value=c.value,``)},h=e=>{l.value=e,a.value=e.value,c.value=``,u.value?.blur(),o(`select`)},g=(0,t.ref)(-1),_=e=>{let t=e.key;if(t===`ArrowUp`)return g.value=(g.value-1+f.value.length)%f.value.length,!0;if(t===`ArrowDown`)return g.value=(g.value+1)%f.value.length,!0;if(t===`Enter`)return g.value===-1||h(f.value[g.value]),!0};(0,t.watch)(a,e=>{e&&(l.value=i.options.find(t=>t.value===e)||null,g.value=i.options.findIndex(t=>t.value===e))},{immediate:!0}),(0,t.watch)(g,()=>{setTimeout(()=>{v()})},{immediate:!0});let v=()=>{if(g.value===-1)return;let e=document.querySelector(`.select > div:nth-child(${g.value+1})`);e&&e.scrollIntoView({behavior:`instant`,block:`nearest`,inline:`nearest`})};return(r,i)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VDropdown),{triggers:[],shown:s.value,"auto-hide":!1,distance:0,"auto-size":``,container:e.container||`body`},{popper:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Wk,[(0,t.createElementVNode)(`div`,Gk,[f.value&&f.value.length>0?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(f.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.value,index:n,class:(0,t.normalizeClass)([`flex h-8 w-full items-center rounded-md px-3 py-1 text-base hover:bg-zinc-100`,{"bg-zinc-200":e.value===a.value,"bg-zinc-100":g.value===n}]),onMousedown:t=>h(e)},[(0,t.createElementVNode)(`span`,qk,(0,t.toDisplayString)(e.label),1)],42,Kk))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Jk,[...i[2]||=[(0,t.createElementVNode)(`span`,{class:`flex-1 text-ellipsis text-sm`},`No options`,-1)]]))])])]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{class:`relative inline-block w-full`,onKeydown:_},[(0,t.createElementVNode)(`div`,Vk,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`select-input box-border grid size-full cursor-pointer items-center rounded-md px-3 text-sm`,{"bg-white":s.value,"border-[1px]":s.value}])},[(0,t.createElementVNode)(`span`,Hk,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{ref_key:`inputRef`,ref:u,"onUpdate:modelValue":i[0]||=e=>c.value=e,class:`m-0 h-full cursor-auto appearance-none border-none bg-transparent p-0 pe-0 ps-0 outline-none`,placeholder:s.value?d.value:``,onFocus:p,onBlur:m},null,40,Uk),[[t.vModelText,c.value]])]),(0,t.withDirectives)((0,t.createElementVNode)(`span`,{class:`text-ellipsis text-sm`},(0,t.toDisplayString)(d.value),513),[[t.vShow,!s.value]]),(0,t.createElementVNode)(`span`,{class:`justify-self-end`,onClick:i[1]||=e=>u.value?.focus()},[(0,t.createVNode)((0,t.unref)(Bk))])],2)])],32)]),_:1},8,[`shown`,`container`]))}}),[[`__scopeId`,`data-v-999722b4`]]),Xk={contenteditable:`false`,class:`flex items-center justify-between border-b-[1px] border-b-gray-100 bg-neutral-100 py-1`},Zk={class:`flex items-center pr-3`},Qk={class:`flex items-center pr-3`},$k=(0,t.defineComponent)({__name:`CodeBlockViewRenderer`,props:{decorations:{},selected:{type:Boolean},updateAttributes:{type:Function},deleteNode:{type:Function},node:{},view:{},getPos:{},innerDecorations:{},editor:{},extension:{},HTMLAttributes:{}},setup(e){let n=e,r=(0,t.computed)(()=>{let e=[],t=n.extension.options.languages;return e=typeof t==`function`?t(n.editor.state):t,e||=[],e.map(e=>e.value).indexOf(`auto`)===-1&&e.unshift({label:`Auto`,value:`auto`}),e}),i=(0,t.computed)({get:()=>n.node?.attrs.language||`auto`,set:e=>{n.updateAttributes({language:e})}}),a=(0,t.computed)(()=>{let e=[],t=n.extension.options.themes;if(e=typeof t==`function`?t(n.editor.state):t,e)return e}),o=(0,t.computed)({get:()=>n.node?.attrs.theme||a.value?.[0].value,set:e=>{n.updateAttributes({theme:e})}}),s=(0,t.computed)({get:()=>n.node.attrs.collapsed||!1,set:e=>{n.updateAttributes({collapsed:e})}}),{ready:c,start:l}=gD(2e3,{controls:!0,immediate:!1}),u=()=>{if(!c.value)return;let e=n.node.textContent;navigator.clipboard.writeText(e).then(()=>{l()})};return(n,l)=>{let d=(0,t.resolveDirective)(`tooltip`);return(0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(JT),{as:`div`,class:`code-node mt-3 overflow-hidden rounded border-[1px]`},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Xk,[(0,t.createElementVNode)(`div`,{class:`flex flex-1 items-center pl-3`,onClick:l[4]||=(0,t.withModifiers)(e=>s.value?s.value=!1:null,[`self`])},[(0,t.createElementVNode)(`div`,Zk,[(0,t.createElementVNode)(`button`,{type:`button`,class:`flex size-8 cursor-pointer items-center justify-center rounded transition-colors hover:bg-gray-200 active:!bg-gray-300`,onClick:l[0]||=(0,t.withModifiers)(e=>s.value=!s.value,[`stop`])},[(0,t.createVNode)((0,t.unref)(Lk),{class:(0,t.normalizeClass)([`size-6 transition-all`,{"rotate-90":!s.value}])},null,8,[`class`])])]),(0,t.createVNode)(Yk,{modelValue:i.value,"onUpdate:modelValue":l[1]||=e=>i.value=e,class:`w-48`,container:e.editor.options.element,options:r.value},null,8,[`modelValue`,`container`,`options`]),a.value&&a.value.length>0?((0,t.openBlock)(),(0,t.createBlock)(Yk,{key:0,modelValue:o.value,"onUpdate:modelValue":l[2]||=e=>o.value=e,container:e.editor.options.element,class:`w-48`,options:a.value,onSelect:l[3]||=t=>e.editor.commands.focus()},null,8,[`modelValue`,`container`,`options`])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`div`,Qk,[(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{type:`button`,class:(0,t.normalizeClass)([`flex size-8 cursor-pointer items-center justify-center rounded`,{"hover:bg-gray-200 active:!bg-gray-300":(0,t.unref)(c)}]),onClick:u},[(0,t.unref)(c)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Pk),{key:1,class:`size-4 text-gray-500`})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(ie),{key:0,class:`size-4 text-green-500`}))],2)),[[d,(0,t.unref)(c)?(0,t.unref)(N).global.t(`editor.common.codeblock.copy_code`):(0,t.unref)(N).global.t(`editor.common.codeblock.copy_code_success`)]])])]),(0,t.withDirectives)((0,t.createElementVNode)(`pre`,null,[(0,t.createVNode)((0,t.unref)(qT),{as:`code`,class:`hljs`})],512),[[t.vShow,!s.value]])]),_:1})}}}),eA=(e,t)=>{let{doc:n,selection:r}=e;if(!n||!r||!(r instanceof R))return e;let{from:i,to:a}=r;return n.nodesBetween(i,a,(r,o)=>{if(i-a==0&&t===`indent`)return e.insertText(` `,i,a),!1;let s=n.textBetween(o+1,i,`
159
+ `).lastIndexOf(`
160
+ `),c=s===-1?o+1:o+s+1,l=n.textBetween(c,a,`
161
+ `);if(t===`indent`){let t=l.replace(/\n/g,`
162
+ `);c===o+1&&(t=` `+t),e.insertText(t,c,a)}else{let t=l.replace(/\n {2}/g,`
163
+ `);c===o+1&&t.indexOf(` `)==0&&(t=t.replace(` `,``)),e.insertText(t,c,a)}return!1}),e};let tA=new V(`codeBlockBubbleMenu`),nA=Ok.extend({allowGapCursor:!0,priority:101,fakeSelection:!0,addAttributes(){return{...this.parent?.(),collapsed:{default:!1,parseHTML:e=>!!e.getAttribute(`collapsed`),renderHTML:e=>e.collapsed?{collapsed:e.collapsed}:{}},theme:{default:this.options.defaultTheme,parseHTML:e=>e.getAttribute(`theme`)||null,renderHTML:e=>e.theme?{theme:e.theme}:{}}}},addCommands(){return{...this.parent?.(),codeIndent:()=>({tr:e,state:t,dispatch:n})=>{let{selection:r}=t;return e=e.setSelection(r),e=eA(e,`indent`),e.docChanged&&n?(n(e),!0):!1},codeOutdent:()=>({tr:e,state:t,dispatch:n})=>{let{selection:r}=t;return e=e.setSelection(r),e=eA(e,`outdent`),e.docChanged&&n?(n(e),!0):!1}}},addKeyboardShortcuts(){return{Backspace:({editor:e})=>{if(!Jp(e.state,this.name))return!1;let{selection:t}=e.state;if(!t.empty)return e.chain().focus().deleteSelection().setTextSelection(t.$from.pos).run(),!0;let{$anchor:n}=t;return n.parentOffset===0||!n.parent.textContent.length},Tab:()=>this.editor.isActive(Ok.name)?this.editor.chain().focus().codeIndent().run():!1,"Shift-Tab":()=>this.editor.isActive(Ok.name)?this.editor.chain().focus().codeOutdent().run():!1,"Mod-a":()=>{if(this.editor.isActive(Ok.name)){let{tr:e,selection:t}=this.editor.state,n=_m(e=>e.type.name===Ok.name)(t);if(!n)return!1;let r=n.start,i=n.start+n.node.nodeSize-1,a=e.doc.resolve(r),o=e.doc.resolve(i);return this.editor.view.dispatch(e.setSelection(new R(a,o))),!0}return!1}}},addNodeView(){return rE($k)},addOptions(){return{...this.parent?.(),languages:[],themes:[],defaultLanguage:null,defaultTheme:null,getToolbarItems({editor:e}){return{priority:160,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(Ok.name),icon:(0,t.markRaw)(jk),title:N.global.t(`editor.common.codeblock.title`),action:()=>e.chain().focus().toggleCodeBlock().run()}}},getCommandMenuItems(){return{priority:80,icon:(0,t.markRaw)(jk),title:`editor.common.codeblock.title`,keywords:[`codeblock`,`daimakuai`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setCodeBlock().run()}}},getToolboxItems({editor:e}){return[{priority:60,component:(0,t.markRaw)(NE),props:{editor:e,icon:(0,t.markRaw)(jk),title:N.global.t(`editor.common.codeblock.title`),action:()=>{e.chain().focus().setCodeBlock().run()}}}]},getBubbleMenu(){return{pluginKey:tA,shouldShow:({state:e})=>Qm(e,Ok.name),options:{placement:`top-start`},getReferencedVirtualElement(){let e=this.editor;if(!e)return null;let t=_m(e=>e.type.name===nA.name)(e.state.selection);if(t){let n=ah(e.view,t.pos,t.pos+t.node.nodeSize);return{getBoundingClientRect:()=>n,getClientRects:()=>[n]}}return null},items:[{priority:10,props:{icon:(0,t.markRaw)(OE),title:N.global.t(`editor.common.button.delete`),action:({editor:e})=>cE(Ok.name,e)}}]}}}},addProseMirrorPlugins(){return[new B({key:new V(`codeBlockVSCodeHandlerFixPaste`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
164
+ `));a.replaceSelectionWith(this.type.create({language:i},s));let{selection:c}=a,l=Math.max(0,c.from-1);for(;l>0&&a.doc.resolve(l).parent.type.name!==this.type.name;)l--;return a.setSelection(R.near(a.doc.resolve(l))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}}),...this.parent?.()||[]]}});var rA=20,iA=(e,t=0)=>{let n=[];return!e.children.length||t>rA||Array.from(e.children).forEach(e=>{e.tagName===`SPAN`?n.push(e):e.children.length&&n.push(...iA(e,t+1))}),n},aA=e=>{if(!e.children.length)return;let t=iA(e);t&&t.forEach(e=>{let t=e.getAttribute(`style`),n=(e.parentElement?.closest(`span`))?.getAttribute(`style`);e.setAttribute(`style`,`${n};${t}`)})},oA=Vh.create({name:`textStyle`,priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:`span`,consuming:!1,getAttrs:e=>e.hasAttribute(`style`)?(this.options.mergeNestedSpanStyles&&aA(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return[`span`,G(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:e=>({commands:t})=>t.toggleMark(this.name,e),removeEmptyTextStyle:()=>({tr:e})=>{let{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(e=>e.type===this.type).some(e=>Object.values(e.attrs).some(e=>!!e))||e.removeMark(n,n+t.nodeSize,this.type)}),!0}}}}),sA=K.create({name:`backgroundColor`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>{let t=e.getAttribute(`style`);if(t){let e=t.split(`;`).map(e=>e.trim()).filter(Boolean);for(let t=e.length-1;t>=0;--t){let n=e[t].split(`:`);if(n.length>=2){let e=n[0].trim().toLowerCase(),t=n.slice(1).join(`:`).trim();if(e===`background-color`)return t.replace(/['"]+/g,``)}}}return e.style.backgroundColor?.replace(/['"]+/g,``)},renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:e=>({chain:t})=>t().setMark(`textStyle`,{backgroundColor:e}).run(),unsetBackgroundColor:()=>({chain:e})=>e().setMark(`textStyle`,{backgroundColor:null}).removeEmptyTextStyle().run()}}}),cA=K.create({name:`color`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{let t=e.getAttribute(`style`);if(t){let e=t.split(`;`).map(e=>e.trim()).filter(Boolean);for(let t=e.length-1;t>=0;--t){let n=e[t].split(`:`);if(n.length>=2){let e=n[0].trim().toLowerCase(),t=n.slice(1).join(`:`).trim();if(e===`color`)return t.replace(/['"]+/g,``)}}}return e.style.color?.replace(/['"]+/g,``)},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark(`textStyle`,{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark(`textStyle`,{color:null}).removeEmptyTextStyle().run()}}}),lA=K.create({name:`fontFamily`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>e.style.fontFamily,renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:e=>({chain:t})=>t().setMark(`textStyle`,{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark(`textStyle`,{fontFamily:null}).removeEmptyTextStyle().run()}}}),uA=K.create({name:`fontSize`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>e.style.fontSize,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:e=>({chain:t})=>t().setMark(`textStyle`,{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark(`textStyle`,{fontSize:null}).removeEmptyTextStyle().run()}}}),dA=K.create({name:`lineHeight`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight,renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:e=>({chain:t})=>t().setMark(`textStyle`,{lineHeight:e}).run(),unsetLineHeight:()=>({chain:e})=>e().setMark(`textStyle`,{lineHeight:null}).removeEmptyTextStyle().run()}}});let fA=K.create({name:`textStyleKit`,addExtensions(){let e=[];return this.options.backgroundColor!==!1&&e.push(sA.configure(this.options.backgroundColor)),this.options.color!==!1&&e.push(cA.configure(this.options.color)),this.options.fontFamily!==!1&&e.push(lA.configure(this.options.fontFamily)),this.options.fontSize!==!1&&e.push(uA.configure(this.options.fontSize)),this.options.lineHeight!==!1&&e.push(dA.configure(this.options.lineHeight)),this.options.textStyle!==!1&&e.push(oA.configure(this.options.textStyle)),e}}).extend({priority:110}).configure({backgroundColor:{types:[`textStyle`]},color:{types:[`textStyle`]},fontFamily:{types:[`textStyle`]},fontSize:{types:[`textStyle`]},lineHeight:{types:[`textStyle`]}});var pA=cA,mA={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function hA(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,mA,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M7.952 17.306a1 1 0 0 1-1.904-.612L10.395 3.17a1.686 1.686 0 0 1 3.21 0l4.347 13.524a1 1 0 1 1-1.904.612L14.664 13H9.336zM9.979 11h4.042L12 4.712zM4 21a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1`})],-1)]])}var gA=(0,t.markRaw)({name:`mingcute-text-color-line`,render:hA});function _A(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>`u`)){var r=document.head||document.getElementsByTagName(`head`)[0],i=document.createElement(`style`);i.type=`text/css`,n===`top`&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var vA=function(e,t){let{componentPrefix:n=``}=t||{};e.component(`${n}${this.name}`,this)},yA={},bA={name:`Checkboard`,props:{size:{type:[Number,String],default:8},white:{type:String,default:`#fff`},grey:{type:String,default:`#e6e6e6`}},computed:{bgStyle(){return{"background-image":`url(${SA(this.white,this.grey,this.size)})`}}}};function xA(e,t,n){if(typeof document>`u`)return null;let r=document.createElement(`canvas`);r.width=r.height=n*2;let i=r.getContext(`2d`);return i?(i.fillStyle=e,i.fillRect(0,0,r.width,r.height),i.fillStyle=t,i.fillRect(0,0,n,n),i.translate(n,n),i.fillRect(0,0,n,n),r.toDataURL()):null}function SA(e,t,n){let r=`${e},${t},${n}`;if(yA[r])return yA[r];let i=xA(e,t,n);return yA[r]=i,i}function CA(e,n,r,i,a,o){return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`vc-checkerboard`,style:(0,t.normalizeStyle)(o.bgStyle)},null,4)}_A(`.vc-checkerboard{background-size:contain;bottom:0;left:0;position:absolute;right:0;top:0}`),bA.render=CA,bA.__file=`src/components/checkboard/checkboard.vue`,bA.install=vA;var wA={name:`Alpha`,components:{Checkboard:bA},props:{value:Object,onChange:Function},computed:{colors(){return this.value},gradientColor(){let{rgba:e}=this.colors,t=[e.r,e.g,e.b].join(`,`);return`linear-gradient(to right, rgba(${t}, 0) 0%, rgba(${t}, 1) 100%)`}},methods:{handleChange(e,t){!t&&e.preventDefault();let{container:n}=this.$refs;if(!n)return;let r=n.clientWidth,i=n.getBoundingClientRect().left+window.pageXOffset,a=(e.pageX||(e.touches?e.touches[0].pageX:0))-i,o;o=a<0?0:a>r?1:Math.round(a*100/r)/100,this.colors.a!==o&&this.$emit(`change`,{h:this.colors.hsl.h,s:this.colors.hsl.s,l:this.colors.hsl.l,a:o,source:`rgba`})},handleMouseDown(e){this.handleChange(e,!0),window.addEventListener(`mousemove`,this.handleChange),window.addEventListener(`mouseup`,this.handleMouseUp)},handleMouseUp(){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener(`mousemove`,this.handleChange),window.removeEventListener(`mouseup`,this.handleMouseUp)}}},TA={class:`vc-alpha`},EA={class:`vc-alpha-checkboard-wrap`},DA=[(0,t.createElementVNode)(`div`,{class:`vc-alpha-picker`},null,-1)];function OA(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`Checkboard`);return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,TA,[(0,t.createElementVNode)(`div`,EA,[(0,t.createVNode)(s)]),(0,t.createElementVNode)(`div`,{class:`vc-alpha-gradient`,style:(0,t.normalizeStyle)({background:o.gradientColor})},null,4),(0,t.createElementVNode)(`div`,{ref:`container`,class:`vc-alpha-container`,onMousedown:n[0]||=(...e)=>o.handleMouseDown&&o.handleMouseDown(...e),onTouchmove:n[1]||=(...e)=>o.handleChange&&o.handleChange(...e),onTouchstart:n[2]||=(...e)=>o.handleChange&&o.handleChange(...e)},[(0,t.createElementVNode)(`div`,{class:`vc-alpha-pointer`,style:(0,t.normalizeStyle)({left:`${o.colors.a*100}%`})},DA,4)],544)])}_A(`.vc-alpha,.vc-alpha-checkboard-wrap{bottom:0;left:0;position:absolute;right:0;top:0}.vc-alpha-checkboard-wrap{overflow:hidden}.vc-alpha-gradient{bottom:0;left:0;position:absolute;right:0;top:0}.vc-alpha-container{cursor:pointer;height:100%;margin:0 3px;position:relative;z-index:2}.vc-alpha-pointer{position:absolute;z-index:2}.vc-alpha-picker{background:#fff;border-radius:1px;box-shadow:0 0 2px rgba(0,0,0,.6);cursor:pointer;height:8px;margin-top:1px;transform:translateX(-2px);width:4px}`),wA.render=OA,wA.__file=`src/components/alpha/alpha.vue`,wA.install=vA;function kA(e,t){jA(e)&&(e=`100%`);var n=MA(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(e=t===360?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t)),e)}function AA(e){return Math.min(1,Math.max(0,e))}function jA(e){return typeof e==`string`&&e.indexOf(`.`)!==-1&&parseFloat(e)===1}function MA(e){return typeof e==`string`&&e.indexOf(`%`)!==-1}function NA(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function PA(e){return e<=1?`${Number(e)*100}%`:e}function FA(e){return e.length===1?`0`+e:String(e)}function IA(e,t,n){return{r:kA(e,255)*255,g:kA(t,255)*255,b:kA(n,255)*255}}function LA(e,t,n){e=kA(e,255),t=kA(t,255),n=kA(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o=0,s=(r+i)/2;if(r===i)o=0,a=0;else{var c=r-i;switch(o=s>.5?c/(2-r-i):c/(r+i),r){case e:a=(t-n)/c+(t<n?6:0);break;case t:a=(n-e)/c+2;break;case n:a=(e-t)/c+4;break;default:break}a/=6}return{h:a,s:o,l:s}}function RA(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function zA(e,t,n){var r,i,a;if(e=kA(e,360),t=kA(t,100),n=kA(n,100),t===0)i=n,a=n,r=n;else{var o=n<.5?n*(1+t):n+t-n*t,s=2*n-o;r=RA(s,o,e+1/3),i=RA(s,o,e),a=RA(s,o,e-1/3)}return{r:r*255,g:i*255,b:a*255}}function BA(e,t,n){e=kA(e,255),t=kA(t,255),n=kA(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o=r,s=r-i,c=r===0?0:s/r;if(r===i)a=0;else{switch(r){case e:a=(t-n)/s+(t<n?6:0);break;case t:a=(n-e)/s+2;break;case n:a=(e-t)/s+4;break;default:break}a/=6}return{h:a,s:c,v:o}}function VA(e,t,n){e=kA(e,360)*6,t=kA(t,100),n=kA(n,100);var r=Math.floor(e),i=e-r,a=n*(1-t),o=n*(1-i*t),s=n*(1-(1-i)*t),c=r%6,l=[n,o,a,a,s,n][c],u=[s,n,n,o,a,a][c],d=[a,a,s,n,n,o][c];return{r:l*255,g:u*255,b:d*255}}function HA(e,t,n,r){var i=[FA(Math.round(e).toString(16)),FA(Math.round(t).toString(16)),FA(Math.round(n).toString(16))];return r&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join(``)}function UA(e,t,n,r,i){var a=[FA(Math.round(e).toString(16)),FA(Math.round(t).toString(16)),FA(Math.round(n).toString(16)),FA(WA(r))];return i&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))&&a[3].startsWith(a[3].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join(``)}function WA(e){return Math.round(parseFloat(e)*255).toString(16)}function GA(e){return KA(e)/255}function KA(e){return parseInt(e,16)}function qA(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var JA={aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,goldenrod:`#daa520`,gold:`#ffd700`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,lavenderblush:`#fff0f5`,lavender:`#e6e6fa`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`};function YA(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,a=null,o=!1,s=!1;return typeof e==`string`&&(e=ej(e)),typeof e==`object`&&(tj(e.r)&&tj(e.g)&&tj(e.b)?(t=IA(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)===`%`?`prgb`:`rgb`):tj(e.h)&&tj(e.s)&&tj(e.v)?(r=PA(e.s),i=PA(e.v),t=VA(e.h,r,i),o=!0,s=`hsv`):tj(e.h)&&tj(e.s)&&tj(e.l)&&(r=PA(e.s),a=PA(e.l),t=zA(e.h,r,a),o=!0,s=`hsl`),Object.prototype.hasOwnProperty.call(e,`a`)&&(n=e.a)),n=NA(n),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var XA=`(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)`,ZA=`[\\s|\\(]+(${XA})[,|\\s]+(${XA})[,|\\s]+(${XA})\\s*\\)?`,QA=`[\\s|\\(]+(${XA})[,|\\s]+(${XA})[,|\\s]+(${XA})[,|\\s]+(${XA})\\s*\\)?`,$A={CSS_UNIT:new RegExp(XA),rgb:RegExp(`rgb`+ZA),rgba:RegExp(`rgba`+QA),hsl:RegExp(`hsl`+ZA),hsla:RegExp(`hsla`+QA),hsv:RegExp(`hsv`+ZA),hsva:RegExp(`hsva`+QA),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function ej(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(JA[e])e=JA[e],t=!0;else if(e===`transparent`)return{r:0,g:0,b:0,a:0,format:`name`};var n=$A.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=$A.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=$A.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=$A.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=$A.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=$A.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=$A.hex8.exec(e),n?{r:KA(n[1]),g:KA(n[2]),b:KA(n[3]),a:GA(n[4]),format:t?`name`:`hex8`}:(n=$A.hex6.exec(e),n?{r:KA(n[1]),g:KA(n[2]),b:KA(n[3]),format:t?`name`:`hex`}:(n=$A.hex4.exec(e),n?{r:KA(n[1]+n[1]),g:KA(n[2]+n[2]),b:KA(n[3]+n[3]),a:GA(n[4]+n[4]),format:t?`name`:`hex8`}:(n=$A.hex3.exec(e),n?{r:KA(n[1]+n[1]),g:KA(n[2]+n[2]),b:KA(n[3]+n[3]),format:t?`name`:`hex`}:!1)))))))))}function tj(e){return!!$A.CSS_UNIT.exec(String(e))}var nj=function(){function e(t,n){if(t===void 0&&(t=``),n===void 0&&(n={}),t instanceof e)return t;typeof t==`number`&&(t=qA(t)),this.originalInput=t;var r=YA(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),t,n,r,i=e.r/255,a=e.g/255,o=e.b/255;return t=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,n=a<=.03928?a/12.92:((a+.055)/1.055)**2.4,r=o<=.03928?o/12.92:((o+.055)/1.055)**2.4,.2126*t+.7152*n+.0722*r},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=NA(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){return this.toHsl().s===0},e.prototype.toHsv=function(){var e=BA(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=BA(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?`hsv(${t}, ${n}%, ${r}%)`:`hsva(${t}, ${n}%, ${r}%, ${this.roundA})`},e.prototype.toHsl=function(){var e=LA(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=LA(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?`hsl(${t}, ${n}%, ${r}%)`:`hsla(${t}, ${n}%, ${r}%, ${this.roundA})`},e.prototype.toHex=function(e){return e===void 0&&(e=!1),HA(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return e===void 0&&(e=!1),`#`+this.toHex(e)},e.prototype.toHex8=function(e){return e===void 0&&(e=!1),UA(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return e===void 0&&(e=!1),`#`+this.toHex8(e)},e.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?`rgb(${e}, ${t}, ${n})`:`rgba(${e}, ${t}, ${n}, ${this.roundA})`},e.prototype.toPercentageRgb=function(){var e=function(e){return`${Math.round(kA(e,255)*100)}%`};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(kA(e,255)*100)};return this.a===1?`rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)`:`rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`},e.prototype.toName=function(){if(this.a===0)return`transparent`;if(this.a<1)return!1;for(var e=`#`+HA(this.r,this.g,this.b,!1),t=0,n=Object.entries(JA);t<n.length;t++){var r=n[t],i=r[0];if(e===r[1])return i}return!1},e.prototype.toString=function(e){var t=!!e;e??=this.format;var n=!1,r=this.a<1&&this.a>=0;return!t&&r&&(e.startsWith(`hex`)||e===`name`)?e===`name`&&this.a===0?this.toName():this.toRgbString():(e===`rgb`&&(n=this.toRgbString()),e===`prgb`&&(n=this.toPercentageRgbString()),(e===`hex`||e===`hex6`)&&(n=this.toHexString()),e===`hex3`&&(n=this.toHexString(!0)),e===`hex4`&&(n=this.toHex8String(!0)),e===`hex8`&&(n=this.toHex8String()),e===`name`&&(n=this.toName()),e===`hsl`&&(n=this.toHslString()),e===`hsv`&&(n=this.toHsvString()),n||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=AA(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=AA(n.l),new e(n)},e.prototype.tint=function(e){return e===void 0&&(e=10),this.mix(`white`,e)},e.prototype.shade=function(e){return e===void 0&&(e=10),this.mix(`black`,e)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=AA(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=AA(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),a=n/100;return new e({r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a})},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,a=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(new e(r));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/t;t--;)o.push(new e({h:r,s:i,v:a})),a=(a+s)%1;return o},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb(),i=n.a+r.a*(1-n.a);return new e({r:(n.r*n.a+r.r*r.a*(1-n.a))/i,g:(n.g*n.a+r.g*r.a*(1-n.a))/i,b:(n.b*n.a+r.b*r.a*(1-n.a))/i,a:i})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],a=360/t,o=1;o<t;o++)i.push(new e({h:(r+o*a)%360,s:n.s,l:n.l}));return i},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function rj(...e){return new nj(...e)}function ij(e,t){let n=e&&e.a,r;r=e&&e.hsl?rj(e.hsl):e&&e.hex&&e.hex.length>0?rj(e.hex):e&&e.hsv?rj(e.hsv):e&&e.rgba?rj(e.rgba):e&&e.rgb?rj(e.rgb):rj(e),r&&(r._a===void 0||r._a===null)&&r.setAlpha(n||r.getAlpha());let i=r.toHsl(),a=r.toHsv();return i.s===0&&(a.h=i.h=e.h||e.hsl&&e.hsl.h||t||0),a.v<.0164&&(a.h=e.h||e.hsv&&e.hsv.h||0,a.s=e.s||e.hsv&&e.hsv.s||0),i.l<.01&&(i.h=e.h||e.hsl&&e.hsl.h||0,i.s=e.s||e.hsl&&e.hsl.s||0),{hsl:i,hex:r.toHexString().toUpperCase(),hex8:r.toHex8String().toUpperCase(),rgba:r.toRgb(),hsv:a,oldHue:e.h||t||i.h,source:e.source,a:r.getAlpha()}}var aj={model:{prop:`modelValue`,event:`update:modelValue`},props:[`modelValue`],data(){return{val:ij(this.modelValue)}},computed:{colors:{get(){return this.val},set(e){this.val=e,this.$emit(`update:modelValue`,e)}}},watch:{modelValue(e){this.val=ij(e)}},methods:{colorChange(e,t){this.oldHue=this.colors.hsl.h,this.colors=ij(e,t||this.oldHue)},isValidHex(e){return rj(e).isValid},simpleCheckForValidColor(e){let t=[`r`,`g`,`b`,`a`,`h`,`s`,`l`,`v`],n=0,r=0;for(let i=0;i<t.length;i++){let a=t[i];e[a]&&(n++,isNaN(e[a])||r++)}if(n===r)return e},paletteUpperCase(e){return e.map(e=>e.toUpperCase())},isTransparent(e){return rj(e).getAlpha()===0}}},oj={name:`EditableInput`,props:{label:String,labelText:String,desc:String,value:[String,Number],max:Number,min:Number,arrowOffset:{type:Number,default:1}},computed:{val:{get(){return this.value},set(e){if(this.max!==void 0&&+e>this.max)this.$refs.input.value=this.max;else return e}},labelId(){return`input__label__${this.label}__${Math.random().toString().slice(2,5)}`},labelSpanText(){return this.labelText||this.label}},methods:{update(e){this.handleChange(e.target.value)},handleChange(e){let t={};t[this.label]=e,(t.hex===void 0&&t[`#`]===void 0||e.length>5)&&this.$emit(`change`,t)},handleKeyDown(e){let{val:t}=this,n=Number(t);if(n){let r=this.arrowOffset||1;e.keyCode===38&&(t=n+r,this.handleChange(t),e.preventDefault()),e.keyCode===40&&(t=n-r,this.handleChange(t),e.preventDefault())}}}},sj={class:`vc-editable-input`},cj=[`aria-labelledby`],lj=[`id`,`for`],uj={class:`vc-input__desc`};function dj(e,n,r,i,a,o){return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,sj,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{ref:`input`,"onUpdate:modelValue":n[0]||=e=>o.val=e,"aria-labelledby":o.labelId,class:`vc-input__input`,onKeydown:n[1]||=(...e)=>o.handleKeyDown&&o.handleKeyDown(...e),onInput:n[2]||=(...e)=>o.update&&o.update(...e)},null,40,cj),[[t.vModelText,o.val]]),(0,t.createElementVNode)(`span`,{id:o.labelId,for:r.label,class:`vc-input__label`},(0,t.toDisplayString)(o.labelSpanText),9,lj),(0,t.createElementVNode)(`span`,uj,(0,t.toDisplayString)(r.desc),1)])}_A(`.vc-editable-input{position:relative}.vc-input__input{border:0;outline:none;padding:0}.vc-input__label{text-transform:capitalize}`),oj.render=dj,oj.__file=`src/components/editable-input/editable-input.vue`,oj.install=vA;function fj(e,t,n){return t<n?e<t?t:e>n?n:e:e<n?n:e>t?t:e}var pj={name:`Saturation`,props:{value:Object},computed:{colors(){return this.value},bgColor(){return`hsl(${this.colors.hsv.h}, 100%, 50%)`},pointerTop(){return`${-(this.colors.hsv.v*100)+1+100}%`},pointerLeft(){return`${this.colors.hsv.s*100}%`}},methods:{handleChange(e,t){!t&&e.preventDefault();let{container:n}=this.$refs;if(!n)return;let r=n.clientWidth,i=n.clientHeight,a=n.getBoundingClientRect().left+window.pageXOffset,o=n.getBoundingClientRect().top+window.pageYOffset,s=e.pageX||(e.touches?e.touches[0].pageX:0),c=e.pageY||(e.touches?e.touches[0].pageY:0),l=fj(s-a,0,r),u=fj(c-o,0,i),d=l/r,f=fj(-(u/i)+1,0,1);this.onChange({h:this.colors.hsv.h,s:d,v:f,a:this.colors.hsv.a,source:`hsva`})},onChange(e){this.$emit(`change`,e)},handleMouseDown(e){window.addEventListener(`mousemove`,this.handleChange),window.addEventListener(`mouseup`,this.handleChange),window.addEventListener(`mouseup`,this.handleMouseUp)},handleMouseUp(e){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener(`mousemove`,this.handleChange),window.removeEventListener(`mouseup`,this.handleChange),window.removeEventListener(`mouseup`,this.handleMouseUp)}}},mj=(0,t.createElementVNode)(`div`,{class:`vc-saturation--white`},null,-1),hj=(0,t.createElementVNode)(`div`,{class:`vc-saturation--black`},null,-1),gj=[(0,t.createElementVNode)(`div`,{class:`vc-saturation-circle`},null,-1)];function _j(e,n,r,i,a,o){return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref:`container`,class:`vc-saturation`,style:(0,t.normalizeStyle)({background:o.bgColor}),onMousedown:n[0]||=(...e)=>o.handleMouseDown&&o.handleMouseDown(...e),onTouchmove:n[1]||=(...e)=>o.handleChange&&o.handleChange(...e),onTouchstart:n[2]||=(...e)=>o.handleChange&&o.handleChange(...e)},[mj,hj,(0,t.createElementVNode)(`div`,{class:`vc-saturation-pointer`,style:(0,t.normalizeStyle)({top:o.pointerTop,left:o.pointerLeft})},gj,4)],36)}_A(`.vc-saturation,.vc-saturation--black,.vc-saturation--white{bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0}.vc-saturation--white{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.vc-saturation--black{background:linear-gradient(0deg,#000,transparent)}.vc-saturation-pointer{cursor:pointer;position:absolute}.vc-saturation-circle{border-radius:50%;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);cursor:head;height:4px;transform:translate(-2px,-2px);width:4px}`),pj.render=_j,pj.__file=`src/components/saturation/saturation.vue`,pj.install=vA;var vj={name:`Hue`,props:{value:Object,direction:{type:String,default:`horizontal`}},data(){return{oldHue:0,pullDirection:``}},computed:{colors(){return this.value},directionClass(){return{"vc-hue--horizontal":this.direction===`horizontal`,"vc-hue--vertical":this.direction===`vertical`}},pointerTop(){return this.direction===`vertical`?this.colors.hsl.h===0&&this.pullDirection===`right`?0:`${-(this.colors.hsl.h*100/360)+100}%`:0},pointerLeft(){return this.direction===`vertical`?0:this.colors.hsl.h===0&&this.pullDirection===`right`?`100%`:`${this.colors.hsl.h*100/360}%`}},watch:{value:{handler(e,t){let{h:n}=e.hsl;n!==0&&n-this.oldHue>0&&(this.pullDirection=`right`),n!==0&&n-this.oldHue<0&&(this.pullDirection=`left`),this.oldHue=n},deep:!0,immediate:!0}},methods:{handleChange(e,t){!t&&e.preventDefault();let{container:n}=this.$refs;if(!n)return;let r=n.clientWidth,i=n.clientHeight,a=n.getBoundingClientRect().left+window.pageXOffset,o=n.getBoundingClientRect().top+window.pageYOffset,s=e.pageX||(e.touches?e.touches[0].pageX:0),c=e.pageY||(e.touches?e.touches[0].pageY:0),l=s-a,u=c-o,d,f;this.direction===`vertical`?(u<0?d=360:u>i?d=0:(f=-(u*100/i)+100,d=360*f/100),this.colors.hsl.h!==d&&this.$emit(`change`,{h:d,s:this.colors.hsl.s,l:this.colors.hsl.l,a:this.colors.hsl.a,source:`hsl`})):(l<0?d=0:l>r?d=360:(f=l*100/r,d=360*f/100),this.colors.hsl.h!==d&&this.$emit(`change`,{h:d,s:this.colors.hsl.s,l:this.colors.hsl.l,a:this.colors.hsl.a,source:`hsl`}))},handleMouseDown(e){this.handleChange(e,!0),window.addEventListener(`mousemove`,this.handleChange),window.addEventListener(`mouseup`,this.handleChange),window.addEventListener(`mouseup`,this.handleMouseUp)},handleMouseUp(e){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener(`mousemove`,this.handleChange),window.removeEventListener(`mouseup`,this.handleChange),window.removeEventListener(`mouseup`,this.handleMouseUp)}}},yj=[`aria-valuenow`],bj=[(0,t.createElementVNode)(`div`,{class:`vc-hue-picker`},null,-1)];function xj(e,n,r,i,a,o){return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`vc-hue`,[o.directionClass]])},[(0,t.createElementVNode)(`div`,{ref:`container`,class:`vc-hue-container`,role:`slider`,"aria-valuenow":o.colors.hsl.h,"aria-valuemin":`0`,"aria-valuemax":`360`,onMousedown:n[0]||=(...e)=>o.handleMouseDown&&o.handleMouseDown(...e),onTouchmove:n[1]||=(...e)=>o.handleChange&&o.handleChange(...e),onTouchstart:n[2]||=(...e)=>o.handleChange&&o.handleChange(...e)},[(0,t.createElementVNode)(`div`,{class:`vc-hue-pointer`,style:(0,t.normalizeStyle)({top:o.pointerTop,left:o.pointerLeft}),role:`presentation`},bj,4)],40,yj)],2)}_A(`.vc-hue{border-radius:2px;bottom:0;left:0;position:absolute;right:0;top:0}.vc-hue--horizontal{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.vc-hue--vertical{background:linear-gradient(0deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.vc-hue-container{cursor:pointer;height:100%;margin:0 2px;position:relative}.vc-hue-pointer{position:absolute;z-index:2}.vc-hue-picker{background:#fff;border-radius:1px;box-shadow:0 0 2px rgba(0,0,0,.6);cursor:pointer;height:8px;margin-top:1px;transform:translateX(-2px);width:4px}`),vj.render=xj,vj.__file=`src/components/hue/hue.vue`,vj.install=vA;var Sj=[`#D0021B`,`#F5A623`,`#F8E71C`,`#8B572A`,`#7ED321`,`#417505`,`#BD10E0`,`#9013FE`,`#4A90E2`,`#50E3C2`,`#B8E986`,`#000000`,`#4A4A4A`,`#9B9B9B`,`#FFFFFF`,`rgba(0,0,0,0)`],Cj={name:`Sketch`,components:{Saturation:pj,Hue:vj,Alpha:wA,EdIn:oj,Checkboard:bA},mixins:[aj],props:{presetColors:{type:Array,default(){return Sj}},disableAlpha:{type:Boolean,default:!1},disableFields:{type:Boolean,default:!1}},computed:{hex(){let e;return e=this.colors.a<1?this.colors.hex8:this.colors.hex,e.replace(`#`,``)},activeColor(){let{rgba:e}=this.colors;return`rgba(${[e.r,e.g,e.b,e.a].join(`,`)})`}},methods:{handlePreset(e){this.colorChange(e)},childChange(e){this.colorChange(e)},inputChange(e){e&&(e.hex?this.isValidHex(e.hex)&&this.colorChange({hex:e.hex,source:`hex`}):(e.r||e.g||e.b||e.a)&&this.colorChange({r:e.r||this.colors.rgba.r,g:e.g||this.colors.rgba.g,b:e.b||this.colors.rgba.b,a:e.a||this.colors.rgba.a,source:`rgba`}))}}},wj={class:`vc-sketch-saturation-wrap`},Tj={class:`vc-sketch-controls`},Ej={class:`vc-sketch-sliders`},Dj={class:`vc-sketch-hue-wrap`},Oj={key:0,class:`vc-sketch-alpha-wrap`},kj={class:`vc-sketch-color-wrap`},Aj=[`aria-label`],jj={key:0,class:`vc-sketch-field`},Mj={class:`vc-sketch-field--double`},Nj={class:`vc-sketch-field--single`},Pj={class:`vc-sketch-field--single`},Fj={class:`vc-sketch-field--single`},Ij={key:0,class:`vc-sketch-field--single`},Lj={class:`vc-sketch-presets`,role:`group`,"aria-label":`A color preset, pick one to set as current color`},Rj=[`aria-label`,`onClick`],zj=[`aria-label`,`onClick`];function Bj(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`Saturation`),c=(0,t.resolveComponent)(`Hue`),l=(0,t.resolveComponent)(`Alpha`),u=(0,t.resolveComponent)(`Checkboard`),d=(0,t.resolveComponent)(`EdIn`);return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,{role:`application`,"aria-label":`Sketch color picker`,class:(0,t.normalizeClass)([`vc-sketch`,[r.disableAlpha?`vc-sketch__disable-alpha`:``]])},[(0,t.createElementVNode)(`div`,wj,[(0,t.createVNode)(s,{value:e.colors,onChange:o.childChange},null,8,[`value`,`onChange`])]),(0,t.createElementVNode)(`div`,Tj,[(0,t.createElementVNode)(`div`,Ej,[(0,t.createElementVNode)(`div`,Dj,[(0,t.createVNode)(c,{value:e.colors,onChange:o.childChange},null,8,[`value`,`onChange`])]),r.disableAlpha?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Oj,[(0,t.createVNode)(l,{value:e.colors,onChange:o.childChange},null,8,[`value`,`onChange`])]))]),(0,t.createElementVNode)(`div`,kj,[(0,t.createElementVNode)(`div`,{"aria-label":`Current color is ${o.activeColor}`,class:`vc-sketch-active-color`,style:(0,t.normalizeStyle)({background:o.activeColor})},null,12,Aj),(0,t.createVNode)(u)])]),r.disableFields?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,jj,[(0,t.createCommentVNode)(` rgba `),(0,t.createElementVNode)(`div`,Mj,[(0,t.createVNode)(d,{label:`hex`,value:o.hex,onChange:o.inputChange},null,8,[`value`,`onChange`])]),(0,t.createElementVNode)(`div`,Nj,[(0,t.createVNode)(d,{label:`r`,value:e.colors.rgba.r,onChange:o.inputChange},null,8,[`value`,`onChange`])]),(0,t.createElementVNode)(`div`,Pj,[(0,t.createVNode)(d,{label:`g`,value:e.colors.rgba.g,onChange:o.inputChange},null,8,[`value`,`onChange`])]),(0,t.createElementVNode)(`div`,Fj,[(0,t.createVNode)(d,{label:`b`,value:e.colors.rgba.b,onChange:o.inputChange},null,8,[`value`,`onChange`])]),r.disableAlpha?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Ij,[(0,t.createVNode)(d,{label:`a`,value:e.colors.a,"arrow-offset":.01,max:1,onChange:o.inputChange},null,8,[`value`,`arrow-offset`,`onChange`])]))])),(0,t.createElementVNode)(`div`,Lj,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.presetColors,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[e.isTransparent(n)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,"aria-label":`Color:${n}`,class:`vc-sketch-presets-color`,onClick:e=>o.handlePreset(n)},[(0,t.createVNode)(u)],8,zj)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:`!${n}`,class:`vc-sketch-presets-color`,"aria-label":`Color:${n}`,style:(0,t.normalizeStyle)({background:n}),onClick:e=>o.handlePreset(n)},null,12,Rj))],64))),256))])],2)}_A(`.vc-sketch{background:#fff;border-radius:4px;box-shadow:0 0 0 1px rgba(0,0,0,.15),0 8px 16px rgba(0,0,0,.15);box-sizing:initial;padding:10px 10px 0;position:relative;width:200px}.vc-sketch-saturation-wrap{overflow:hidden;padding-bottom:75%;position:relative;width:100%}.vc-sketch-controls{display:flex}.vc-sketch-sliders{flex:1;padding:4px 0}.vc-sketch-sliders .vc-alpha-gradient,.vc-sketch-sliders .vc-hue{border-radius:2px}.vc-sketch-alpha-wrap,.vc-sketch-hue-wrap{height:10px;position:relative}.vc-sketch-alpha-wrap{margin-top:4px;overflow:hidden}.vc-sketch-color-wrap{border-radius:3px;height:24px;margin-left:4px;margin-top:4px;position:relative;width:24px}.vc-sketch-active-color{border-radius:2px;bottom:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15),inset 0 0 4px rgba(0,0,0,.25);left:0;position:absolute;right:0;top:0;z-index:2}.vc-sketch-color-wrap .vc-checkerboard{background-size:auto}.vc-sketch-field{display:flex;padding-top:4px}.vc-sketch-field .vc-input__input{border:none;box-shadow:inset 0 0 0 1px #ccc;font-size:10px;padding:4px 0 3px 10%;width:90%}.vc-sketch-field .vc-input__label{color:#222;display:block;font-size:11px;padding-bottom:4px;padding-top:3px;text-align:center;text-transform:capitalize}.vc-sketch-field--single{flex:1;padding-left:6px}.vc-sketch-field--double{flex:2}.vc-sketch-presets{border-top:1px solid #eee;margin-left:-10px;margin-right:-10px;padding-left:10px;padding-top:10px}.vc-sketch-presets-color{cursor:pointer;display:inline-block;height:16px;margin:0 10px 10px 0;overflow:hidden;position:relative;vertical-align:top;width:16px}.vc-sketch-presets-color,.vc-sketch-presets-color .vc-checkerboard{border-radius:3px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}.vc-sketch__disable-alpha .vc-sketch-color-wrap{height:10px}`),Cj.render=Bj,Cj.__file=`src/components/sketch/sketch.vue`,Cj.install=vA;var Vj=d(((e,t)=>{var n=String,r=function(){return{isColorSupported:!1,reset:n,bold:n,dim:n,italic:n,underline:n,inverse:n,hidden:n,strikethrough:n,black:n,red:n,green:n,yellow:n,blue:n,magenta:n,cyan:n,white:n,gray:n,bgBlack:n,bgRed:n,bgGreen:n,bgYellow:n,bgBlue:n,bgMagenta:n,bgCyan:n,bgWhite:n,blackBright:n,redBright:n,greenBright:n,yellowBright:n,blueBright:n,magentaBright:n,cyanBright:n,whiteBright:n,bgBlackBright:n,bgRedBright:n,bgGreenBright:n,bgYellowBright:n,bgBlueBright:n,bgMagentaBright:n,bgCyanBright:n,bgWhiteBright:n}};t.exports=r(),t.exports.createColors=r})),Hj=d((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}t(e,{dim:function(){return o},default:function(){return s}});var n=r(Vj());function r(e){return e&&e.__esModule?e:{default:e}}var i=new Set;function a(e,t,n){typeof process<`u`&&process.env.JEST_WORKER_ID||n&&i.has(n)||(n&&i.add(n),console.warn(``),t.forEach(t=>console.warn(e,`-`,t)))}function o(e){return n.default.dim(e)}var s={info(e,t){a(n.default.bold(n.default.cyan(`info`)),...Array.isArray(e)?[e]:[t,e])},warn(e,t){a(n.default.bold(n.default.yellow(`warn`)),...Array.isArray(e)?[e]:[t,e])},risk(e,t){a(n.default.bold(n.default.magenta(`risk`)),...Array.isArray(e)?[e]:[t,e])}}})),Uj=d((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`default`,{enumerable:!0,get:function(){return i}});var t=n(Hj());function n(e){return e&&e.__esModule?e:{default:e}}function r({version:e,from:n,to:r}){t.default.warn(`${n}-color-renamed`,[`As of Tailwind CSS ${e}, \`${n}\` has been renamed to \`${r}\`.`,`Update your configuration file to silence this warning.`])}var i={inherit:`inherit`,current:`currentColor`,transparent:`transparent`,black:`#000`,white:`#fff`,slate:{50:`#f8fafc`,100:`#f1f5f9`,200:`#e2e8f0`,300:`#cbd5e1`,400:`#94a3b8`,500:`#64748b`,600:`#475569`,700:`#334155`,800:`#1e293b`,900:`#0f172a`,950:`#020617`},gray:{50:`#f9fafb`,100:`#f3f4f6`,200:`#e5e7eb`,300:`#d1d5db`,400:`#9ca3af`,500:`#6b7280`,600:`#4b5563`,700:`#374151`,800:`#1f2937`,900:`#111827`,950:`#030712`},zinc:{50:`#fafafa`,100:`#f4f4f5`,200:`#e4e4e7`,300:`#d4d4d8`,400:`#a1a1aa`,500:`#71717a`,600:`#52525b`,700:`#3f3f46`,800:`#27272a`,900:`#18181b`,950:`#09090b`},neutral:{50:`#fafafa`,100:`#f5f5f5`,200:`#e5e5e5`,300:`#d4d4d4`,400:`#a3a3a3`,500:`#737373`,600:`#525252`,700:`#404040`,800:`#262626`,900:`#171717`,950:`#0a0a0a`},stone:{50:`#fafaf9`,100:`#f5f5f4`,200:`#e7e5e4`,300:`#d6d3d1`,400:`#a8a29e`,500:`#78716c`,600:`#57534e`,700:`#44403c`,800:`#292524`,900:`#1c1917`,950:`#0c0a09`},red:{50:`#fef2f2`,100:`#fee2e2`,200:`#fecaca`,300:`#fca5a5`,400:`#f87171`,500:`#ef4444`,600:`#dc2626`,700:`#b91c1c`,800:`#991b1b`,900:`#7f1d1d`,950:`#450a0a`},orange:{50:`#fff7ed`,100:`#ffedd5`,200:`#fed7aa`,300:`#fdba74`,400:`#fb923c`,500:`#f97316`,600:`#ea580c`,700:`#c2410c`,800:`#9a3412`,900:`#7c2d12`,950:`#431407`},amber:{50:`#fffbeb`,100:`#fef3c7`,200:`#fde68a`,300:`#fcd34d`,400:`#fbbf24`,500:`#f59e0b`,600:`#d97706`,700:`#b45309`,800:`#92400e`,900:`#78350f`,950:`#451a03`},yellow:{50:`#fefce8`,100:`#fef9c3`,200:`#fef08a`,300:`#fde047`,400:`#facc15`,500:`#eab308`,600:`#ca8a04`,700:`#a16207`,800:`#854d0e`,900:`#713f12`,950:`#422006`},lime:{50:`#f7fee7`,100:`#ecfccb`,200:`#d9f99d`,300:`#bef264`,400:`#a3e635`,500:`#84cc16`,600:`#65a30d`,700:`#4d7c0f`,800:`#3f6212`,900:`#365314`,950:`#1a2e05`},green:{50:`#f0fdf4`,100:`#dcfce7`,200:`#bbf7d0`,300:`#86efac`,400:`#4ade80`,500:`#22c55e`,600:`#16a34a`,700:`#15803d`,800:`#166534`,900:`#14532d`,950:`#052e16`},emerald:{50:`#ecfdf5`,100:`#d1fae5`,200:`#a7f3d0`,300:`#6ee7b7`,400:`#34d399`,500:`#10b981`,600:`#059669`,700:`#047857`,800:`#065f46`,900:`#064e3b`,950:`#022c22`},teal:{50:`#f0fdfa`,100:`#ccfbf1`,200:`#99f6e4`,300:`#5eead4`,400:`#2dd4bf`,500:`#14b8a6`,600:`#0d9488`,700:`#0f766e`,800:`#115e59`,900:`#134e4a`,950:`#042f2e`},cyan:{50:`#ecfeff`,100:`#cffafe`,200:`#a5f3fc`,300:`#67e8f9`,400:`#22d3ee`,500:`#06b6d4`,600:`#0891b2`,700:`#0e7490`,800:`#155e75`,900:`#164e63`,950:`#083344`},sky:{50:`#f0f9ff`,100:`#e0f2fe`,200:`#bae6fd`,300:`#7dd3fc`,400:`#38bdf8`,500:`#0ea5e9`,600:`#0284c7`,700:`#0369a1`,800:`#075985`,900:`#0c4a6e`,950:`#082f49`},blue:{50:`#eff6ff`,100:`#dbeafe`,200:`#bfdbfe`,300:`#93c5fd`,400:`#60a5fa`,500:`#3b82f6`,600:`#2563eb`,700:`#1d4ed8`,800:`#1e40af`,900:`#1e3a8a`,950:`#172554`},indigo:{50:`#eef2ff`,100:`#e0e7ff`,200:`#c7d2fe`,300:`#a5b4fc`,400:`#818cf8`,500:`#6366f1`,600:`#4f46e5`,700:`#4338ca`,800:`#3730a3`,900:`#312e81`,950:`#1e1b4b`},violet:{50:`#f5f3ff`,100:`#ede9fe`,200:`#ddd6fe`,300:`#c4b5fd`,400:`#a78bfa`,500:`#8b5cf6`,600:`#7c3aed`,700:`#6d28d9`,800:`#5b21b6`,900:`#4c1d95`,950:`#2e1065`},purple:{50:`#faf5ff`,100:`#f3e8ff`,200:`#e9d5ff`,300:`#d8b4fe`,400:`#c084fc`,500:`#a855f7`,600:`#9333ea`,700:`#7e22ce`,800:`#6b21a8`,900:`#581c87`,950:`#3b0764`},fuchsia:{50:`#fdf4ff`,100:`#fae8ff`,200:`#f5d0fe`,300:`#f0abfc`,400:`#e879f9`,500:`#d946ef`,600:`#c026d3`,700:`#a21caf`,800:`#86198f`,900:`#701a75`,950:`#4a044e`},pink:{50:`#fdf2f8`,100:`#fce7f3`,200:`#fbcfe8`,300:`#f9a8d4`,400:`#f472b6`,500:`#ec4899`,600:`#db2777`,700:`#be185d`,800:`#9d174d`,900:`#831843`,950:`#500724`},rose:{50:`#fff1f2`,100:`#ffe4e6`,200:`#fecdd3`,300:`#fda4af`,400:`#fb7185`,500:`#f43f5e`,600:`#e11d48`,700:`#be123c`,800:`#9f1239`,900:`#881337`,950:`#4c0519`},get lightBlue(){return r({version:`v2.2`,from:`lightBlue`,to:`sky`}),this.sky},get warmGray(){return r({version:`v3.0`,from:`warmGray`,to:`stone`}),this.stone},get trueGray(){return r({version:`v3.0`,from:`trueGray`,to:`neutral`}),this.neutral},get coolGray(){return r({version:`v3.0`,from:`coolGray`,to:`gray`}),this.gray},get blueGray(){return r({version:`v3.0`,from:`blueGray`,to:`slate`}),this.slate}}})),Wj=m(d(((e,t)=>{var n=Uj();t.exports=(n.__esModule?n:{default:n}).default}))(),1),Gj={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Kj(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Gj,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M12 2c5.523 0 10 4.477 10 10q-.002.975-.18 1.9c-.386 2.004-2.397 2.85-4.082 2.57l-1.74-.29a1.29 1.29 0 0 0-1.124.36c-.37.37-.547.879-.298 1.376c.423.846.429 1.812.055 2.603C14.131 21.58 13.11 22 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2m0 2a8 8 0 1 0 0 16l.195-.002c.258-.01.5-.06.628-.332a1 1 0 0 0-.036-.855c-.63-1.262-.302-2.71.673-3.685a3.29 3.29 0 0 1 2.867-.919l1.74.29c.957.16 1.668-.348 1.789-.975A8 8 0 0 0 12 4m-4.5 7a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3m7-4a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3m-5 0a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3`})],-1)]])}var qj=(0,t.markRaw)({name:`mingcute-palette-line`,render:Kj}),Jj={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Yj(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Jj,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M15.707 11.293a1 1 0 0 1 0 1.414l-5.657 5.657a1 1 0 1 1-1.414-1.414l4.95-4.95l-4.95-4.95a1 1 0 0 1 1.414-1.414z`})],-1)]])}var Xj=(0,t.markRaw)({name:`mingcute-right-line`,render:Yj}),Zj={class:`grid grid-cols-9 gap-1.5 p-2 pt-1`},Qj=[`title`,`onClick`],$j={class:`p-1`},eM={class:`flex cursor-pointer items-center justify-between rounded p-1 text-xs text-gray-600 hover:bg-gray-100 hover:text-gray-900`},tM={class:`inline-flex items-center gap-2`},nM=(0,t.defineComponent)({__name:`ColorPickerDropdown`,props:{modelValue:{default:void 0}},emits:[`update:modelValue`],setup(e,{emit:r}){let i=r;function a(){let e=[],t=Object.keys(Wj.default).reduce((e,t)=>([`gray`,`red`,`orange`,`yellow`,`green`,`blue`,`purple`,`pink`].includes(t)&&(e[t]=Wj.default[t]),e),{});for(let n in t){let r=t[n],i=Object.entries(r).filter(([e])=>parseInt(e)>=100&&parseInt(e)<=900).sort((e,t)=>parseInt(t[0])-parseInt(e[0])).map(([e,t])=>({color:t,name:`${n} ${e}`}));e.push(...i)}return e}function o(e){i(`update:modelValue`,e)}function s(e){o(e.hex)}return(e,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VDropdown),{class:`inline-flex items-center`},{popper:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`prefix`),(0,t.createElementVNode)(`div`,Zj,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(a(),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.color,style:(0,t.normalizeStyle)({backgroundColor:e.color}),class:`size-5 cursor-pointer rounded-sm ring-gray-300 ring-offset-1 hover:ring-1`,title:e.name,onClick:t=>o(e.color)},null,12,Qj))),128))]),(0,t.createVNode)((0,t.unref)(n.VDropdown),{"popper-class":`[&_.v-popper\\_\\_inner]:!p-0`,placement:`right`},{popper:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Cj),{"model-value":`#000`,"onUpdate:modelValue":s})]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,$j,[(0,t.createElementVNode)(`div`,eM,[(0,t.createElementVNode)(`div`,tM,[(0,t.createVNode)((0,t.unref)(qj)),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.components.color_picker.more_color`)),1)]),(0,t.createElementVNode)(`div`,null,[(0,t.createVNode)((0,t.unref)(Xj))])])])]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`default`)]),_:3}))}}),rM={class:`p-1`},iM={class:`text-xs text-gray-600`},aM=(0,t.defineComponent)({__name:`ColorToolbarItem`,props:{editor:{},isActive:{type:Boolean},disabled:{type:Boolean},icon:{},title:{},action:{type:Function},children:{}},setup(e){let n=e;function r(e){e&&n.editor?.chain().focus().setColor(e).run()}function i(){n.editor?.chain().focus().unsetColor().run()}return(e,a)=>((0,t.openBlock)(),(0,t.createBlock)(nM,{"onUpdate:modelValue":r},{prefix:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,rM,[(0,t.createElementVNode)(`div`,{class:`flex cursor-pointer items-center gap-2 rounded p-1 hover:bg-gray-100`,onClick:i},[a[0]||=(0,t.createElementVNode)(`div`,{class:`size-5 cursor-pointer rounded-sm bg-black ring-gray-300 ring-offset-1 hover:ring-1`},null,-1),(0,t.createElementVNode)(`span`,iM,(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.common.button.restore_default`)),1)])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(E),(0,t.normalizeProps)((0,t.guardReactiveProps)(n)),null,16)]),_:1}))}});let oM=pA.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:81,component:(0,t.markRaw)(aM),props:{editor:e,isActive:!1,icon:(0,t.markRaw)(gA),title:N.global.t(`editor.common.color`)}}}}},addExtensions(){return[fA]}}),sM=q.create({name:`column`,content:`block+`,isolating:!0,fakeSelection:!0,addOptions(){return{HTMLAttributes:{class:`column`}}},addAttributes(){return{index:{default:0,parseHTML:e=>e.getAttribute(`index`)},style:{default:`min-width: 0;flex: 1 1;box-sizing: border-box;`,parseHTML:e=>e.getAttribute(`style`)}}},parseHTML(){return[{tag:`div[class=column]`}]},renderHTML({HTMLAttributes:e}){return[`div`,G(this.options.HTMLAttributes,e),0]}});var cM={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function lM(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,cM,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M5 3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm6 2H5v14h6zm2 14V5h6v14z`})],-1)]])}var uM=(0,t.markRaw)({name:`mingcute-columns-2-line`,render:lM}),dM={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function fM(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,dM,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M12 3a1 1 0 0 1 1 1v8a5 5 0 1 1 .213 8.152L13 20a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm-1 2H7v14h4zm8 10h-6v2h6z`},null,-1)]])}var pM=(0,t.markRaw)({name:`ri-delete-column`,render:fM}),mM={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function hM(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,mM,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M20 3a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm-1 2h-4v14h4zM6 7a5 5 0 1 1 0 10A5 5 0 0 1 6 7m1 2H5v1.999L3 11v2l2-.001V15h2v-2.001L9 13v-2l-2-.001z`},null,-1)]])}var gM=(0,t.markRaw)({name:`ri-insert-column-left`,render:hM}),_M={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function vM(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,_M,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M10 3a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zM9 5H5v14h4zm9 2a5 5 0 1 1 0 10a5 5 0 0 1 0-10m1 2h-2v1.999L15 11v2l2-.001V15h2v-2.001L21 13v-2l-2-.001z`},null,-1)]])}var yM=(0,t.markRaw)({name:`ri-insert-column-right`,render:vM});let bM=new V(`columnsBubbleMenu`);var xM=(e,t)=>{let n=SM(e),r=[];for(let e=0;e<t;e+=1){let t=n.column.createAndFill({index:e});t&&r.push(t)}return n.columns.createChecked({cols:t},r)},SM=e=>{if(e.cached.columnsNodeTypes)return e.cached.columnsNodeTypes;let t={columns:e.nodes.columns,column:e.nodes.column};return e.cached.columnsNodeTypes=t,t},CM=(e,t,n)=>{let r=_m(e=>e.type.name===TM.name)(t.selection),i=_m(e=>e.type.name===sM.name)(t.selection);if(e&&r&&i){let a=r.node,o=i.node.attrs.index,s=a.toJSON(),c=o;n===`delete`?(c=o-1,s.content.splice(o,1)):(c=n===`addBefore`?o:o+1,s.content.splice(c,0,{type:`column`,attrs:{index:o},content:[{type:`paragraph`}]})),s.attrs.cols=s.content.length,s.content.forEach((e,t)=>{e.attrs.index=t});let l=Fi.fromJSON(t.schema,s),u=r.pos;l.content.forEach((e,t,n)=>{n<c&&(u+=e.nodeSize)});let d=t.tr.setTime(Date.now());d.replaceWith(r.pos,r.pos+r.node.nodeSize,l).setSelection(R.near(d.doc.resolve(u))),e(d)}return!0},wM=(e,t,n)=>{let r=_m(e=>e.type.name===TM.name)(e.selection),i=_m(e=>e.type.name===sM.name)(e.selection);if(t&&r&&i){let a=r.node,o=i.node.attrs.index,s=0;s=n===`before`?(o-1+a.attrs.cols)%a.attrs.cols:(o+1)%a.attrs.cols;let c=r.pos;a.content.forEach((e,t,n)=>{n<s&&(c+=e.nodeSize)});let l=e.tr.setTime(Date.now());return l.setSelection(R.near(l.doc.resolve(c))),t(l),!0}return!1};let TM=q.create({name:`columns`,group:`block`,priority:10,defining:!0,isolating:!0,allowGapCursor:!0,content:`column{1,}`,fakeSelection:!1,addOptions(){return{HTMLAttributes:{class:`columns`},getToolboxItems({editor:e}){return[{priority:70,component:(0,t.markRaw)(NE),props:{editor:e,icon:(0,t.markRaw)(uM),title:N.global.t(`editor.extensions.commands_menu.columns`),action:()=>{e.chain().focus().insertColumns({cols:2}).run()}}}]},getCommandMenuItems(){return{priority:70,icon:(0,t.markRaw)(uM),title:`editor.extensions.commands_menu.columns`,keywords:[`fenlan`,`columns`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).insertColumns({cols:2}).run()}}},getBubbleMenu(){return{pluginKey:bM,shouldShow:({state:e})=>Qm(e,TM.name),options:{placement:`bottom-start`},getReferencedVirtualElement(){let e=this.editor;if(!e)return null;let t=_m(e=>e.type.name===sM.name)(e.state.selection);if(t){let n=ah(e.view,t.pos,t.pos+t.node.nodeSize);return{getBoundingClientRect:()=>n,getClientRects:()=>[n]}}return null},items:[{priority:10,props:{icon:(0,t.markRaw)(gM),title:N.global.t(`editor.extensions.columns.add_column_before`),action:({editor:e})=>{e.chain().focus().addColBefore().run()}}},{priority:20,props:{icon:(0,t.markRaw)(yM),title:N.global.t(`editor.extensions.columns.add_column_after`),action:({editor:e})=>{e.chain().focus().addColAfter().run()}}},{priority:30,props:{icon:(0,t.markRaw)(pM),title:N.global.t(`editor.extensions.columns.delete_column`),action:({editor:e})=>{e.chain().focus().deleteCol().run()}}},{priority:40,component:(0,t.markRaw)(C)},{priority:50,props:{icon:(0,t.markRaw)(OE),title:N.global.t(`editor.common.button.delete`),action:({editor:e})=>{cE(TM.name,e)}}}]}}}},addAttributes(){return{cols:{default:2,parseHTML:e=>e.getAttribute(`cols`)},style:{default:`display: flex;width: 100%;gap: 1em;`,parseHTML:e=>e.getAttribute(`style`)}}},renderHTML({HTMLAttributes:e}){return[`div`,G(this.options.HTMLAttributes,e),0]},addCommands(){return{insertColumns:e=>({tr:t,dispatch:n,editor:r})=>{let i=xM(r.schema,e&&e.cols||3);if(n){let e=t.selection.anchor+1;t.replaceSelectionWith(i).scrollIntoView().setSelection(R.near(t.doc.resolve(e)))}return!0},addColBefore:()=>({dispatch:e,state:t})=>CM(e,t,`addBefore`),addColAfter:()=>({dispatch:e,state:t})=>CM(e,t,`addAfter`),deleteCol:()=>({dispatch:e,state:t})=>CM(e,t,`delete`)}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertColumns(),Tab:()=>wM(this.editor.state,this.editor.view.dispatch,`after`),"Shift-Tab":()=>wM(this.editor.state,this.editor.view.dispatch,`before`)}},addExtensions(){return[sM]}});var EM=[`top`,`right`,`bottom`,`left`],DM=[`start`,`end`],OM=EM.reduce((e,t)=>e.concat(t,t+`-`+DM[0],t+`-`+DM[1]),[]),kM=Math.min,AM=Math.max,jM=Math.round,MM=e=>({x:e,y:e}),NM={left:`right`,right:`left`,bottom:`top`,top:`bottom`},PM={start:`end`,end:`start`};function FM(e,t,n){return AM(e,kM(t,n))}function IM(e,t){return typeof e==`function`?e(t):e}function LM(e){return e.split(`-`)[0]}function RM(e){return e.split(`-`)[1]}function zM(e){return e===`x`?`y`:`x`}function BM(e){return e===`y`?`height`:`width`}var VM=new Set([`top`,`bottom`]);function HM(e){return VM.has(LM(e))?`y`:`x`}function UM(e){return zM(HM(e))}function WM(e,t,n){n===void 0&&(n=!1);let r=RM(e),i=UM(e),a=BM(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=$M(o)),[o,$M(o)]}function GM(e){let t=$M(e);return[KM(e),t,KM(t)]}function KM(e){return e.replace(/start|end/g,e=>PM[e])}var qM=[`left`,`right`],JM=[`right`,`left`],YM=[`top`,`bottom`],XM=[`bottom`,`top`];function ZM(e,t,n){switch(e){case`top`:case`bottom`:return n?t?JM:qM:t?qM:JM;case`left`:case`right`:return t?YM:XM;default:return[]}}function QM(e,t,n,r){let i=RM(e),a=ZM(LM(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(KM)))),a}function $M(e){return e.replace(/left|right|bottom|top/g,e=>NM[e])}function eN(e){return{top:0,right:0,bottom:0,left:0,...e}}function tN(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:eN(e)}function nN(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function rN(e,t,n){let{reference:r,floating:i}=e,a=HM(t),o=UM(t),s=BM(o),c=LM(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(RM(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var iN=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=rN(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=rN(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function aN(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=IM(t,e),p=tN(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=nN(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=nN(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var oN=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=IM(e,t)||{};if(l==null)return{};let d=tN(u),f={x:n,y:r},p=UM(i),m=BM(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=kM(d[_],T),te=kM(d[v],T),E=ee,ne=C-h[m]-te,re=C/2-h[m]/2+w,ie=FM(E,re,ne),ae=!c.arrow&&RM(i)!=null&&re!==ie&&a.reference[m]/2-(re<E?ee:te)-h[m]/2<0,D=ae?re<E?re-E:re-ne:0;return{[p]:f[p]+D,data:{[p]:ie,centerOffset:re-ie-D,...ae&&{alignmentOffset:D}},reset:ae}}});function sN(e,t,n){return(e?[...n.filter(t=>RM(t)===e),...n.filter(t=>RM(t)!==e)]:n.filter(e=>LM(e)===e)).filter(n=>e?RM(n)===e||(t?KM(n)!==n:!1):!0)}var cN=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=OM,autoAlignment:u=!0,...d}=IM(e,t),f=c!==void 0||l===OM?sN(c||null,u,l):l,p=await aN(t,d),m=r.autoPlacement?.index||0,h=f[m];if(h==null)return{};let g=WM(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[LM(h)],p[g[0]],p[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:h,overflows:_}],y=f[m+1];if(y)return{data:{index:m+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=RM(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,RM(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:m+1,overflows:v},reset:{placement:x}}}}},lN=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=IM(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=LM(r),_=HM(o),v=LM(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[$M(o)]:GM(o)),x=p!==`none`;!d&&x&&b.push(...QM(o,m,p,y));let S=[o,...b],C=await aN(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=WM(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==HM(t))||T.every(e=>HM(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=HM(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function uN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function dN(e){return EM.some(t=>e[t]>=0)}var fN=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=IM(e,t);switch(r){case`referenceHidden`:{let e=uN(await aN(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:dN(e)}}}case`escaped`:{let e=uN(await aN(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:dN(e)}}}default:return{}}}}};function pN(e){let t=kM(...e.map(e=>e.left)),n=kM(...e.map(e=>e.top)),r=AM(...e.map(e=>e.right)),i=AM(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function mN(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>nN(pN(e)))}var hN=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=IM(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=mN(u),f=nN(pN(u)),p=tN(s);function m(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(HM(n)===`y`){let e=d[0],t=d[d.length-1],r=LM(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:a,left:o,right:s,width:s-o,height:a-i,x:o,y:i}}let e=LM(n)===`left`,t=AM(...d.map(e=>e.right)),r=kM(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom,s=r,c=t;return{top:a,bottom:o,left:s,right:c,width:c-s,height:o-a,x:s,y:a}}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},gN=new Set([`left`,`top`]);async function _N(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=LM(n),s=RM(n),c=HM(n)===`y`,l=gN.has(o)?-1:1,u=a&&c?-1:1,d=IM(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var vN=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await _N(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},yN=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=IM(e,t),l={x:n,y:r},u=await aN(t,c),d=HM(LM(i)),f=zM(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=FM(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=FM(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},bN=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=IM(e,t),u=await aN(t,l),d=LM(i),f=RM(i),p=HM(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=kM(h-u[g],v),x=kM(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=AM(u.left,0),t=AM(u.right,0),n=AM(u.top,0),r=AM(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:AM(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:AM(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function xN(){return typeof window<`u`}function SN(e){return TN(e)?(e.nodeName||``).toLowerCase():`#document`}function CN(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wN(e){return((TN(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function TN(e){return xN()?e instanceof Node||e instanceof CN(e).Node:!1}function EN(e){return xN()?e instanceof Element||e instanceof CN(e).Element:!1}function DN(e){return xN()?e instanceof HTMLElement||e instanceof CN(e).HTMLElement:!1}function ON(e){return!xN()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof CN(e).ShadowRoot}var kN=new Set([`inline`,`contents`]);function AN(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=UN(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!kN.has(i)}var jN=new Set([`table`,`td`,`th`]);function MN(e){return jN.has(SN(e))}var NN=[`:popover-open`,`:modal`];function PN(e){return NN.some(t=>{try{return e.matches(t)}catch{return!1}})}var FN=[`transform`,`translate`,`scale`,`rotate`,`perspective`],IN=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],LN=[`paint`,`layout`,`strict`,`content`];function RN(e){let t=BN(),n=EN(e)?UN(e):e;return FN.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||IN.some(e=>(n.willChange||``).includes(e))||LN.some(e=>(n.contain||``).includes(e))}function zN(e){let t=GN(e);for(;DN(t)&&!HN(t);){if(RN(t))return t;if(PN(t))return null;t=GN(t)}return null}function BN(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var VN=new Set([`html`,`body`,`#document`]);function HN(e){return VN.has(SN(e))}function UN(e){return CN(e).getComputedStyle(e)}function WN(e){return EN(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function GN(e){if(SN(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ON(e)&&e.host||wN(e);return ON(t)?t.host:t}function KN(e){let t=GN(e);return HN(t)?e.ownerDocument?e.ownerDocument.body:e.body:DN(t)&&AN(t)?t:KN(t)}function qN(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=KN(e),i=r===e.ownerDocument?.body,a=CN(r);if(i){let e=JN(a);return t.concat(a,a.visualViewport||[],AN(r)?r:[],e&&n?qN(e):[])}return t.concat(r,qN(r,[],n))}function JN(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function YN(e){let t=UN(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=DN(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=jM(n)!==a||jM(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function XN(e){return EN(e)?e:e.contextElement}function ZN(e){let t=XN(e);if(!DN(t))return MM(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=YN(t),o=(a?jM(n.width):n.width)/r,s=(a?jM(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var QN=MM(0);function $N(e){let t=CN(e);return!BN()||!t.visualViewport?QN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function eP(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==CN(e)?!1:t}function tP(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=XN(e),o=MM(1);t&&(r?EN(r)&&(o=ZN(r)):o=ZN(e));let s=eP(a,n,r)?$N(a):MM(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=CN(a),t=r&&EN(r)?CN(r):r,n=e,i=JN(n);for(;i&&r&&t!==n;){let e=ZN(i),t=i.getBoundingClientRect(),r=UN(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=CN(i),i=JN(n)}}return nN({width:u,height:d,x:c,y:l})}function nP(e,t){let n=WN(e).scrollLeft;return t?t.left+n:tP(wN(e)).left+n}function rP(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-nP(e,n),y:n.top+t.scrollTop}}function iP(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=wN(r),s=t?PN(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=MM(1),u=MM(0),d=DN(r);if((d||!d&&!a)&&((SN(r)!==`body`||AN(o))&&(c=WN(r)),DN(r))){let e=tP(r);l=ZN(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?rP(o,c):MM(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function aP(e){return Array.from(e.getClientRects())}function oP(e){let t=wN(e),n=WN(e),r=e.ownerDocument.body,i=AM(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=AM(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+nP(e),s=-n.scrollTop;return UN(r).direction===`rtl`&&(o+=AM(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var sP=25;function cP(e,t){let n=CN(e),r=wN(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=BN();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=nP(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=sP&&(a-=o)}else l<=sP&&(a+=l);return{width:a,height:o,x:s,y:c}}var lP=new Set([`absolute`,`fixed`]);function uP(e,t){let n=tP(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=DN(e)?ZN(e):MM(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function dP(e,t,n){let r;if(t===`viewport`)r=cP(e,n);else if(t===`document`)r=oP(wN(e));else if(EN(t))r=uP(t,n);else{let n=$N(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return nN(r)}function fP(e,t){let n=GN(e);return n===t||!EN(n)||HN(n)?!1:UN(n).position===`fixed`||fP(n,t)}function pP(e,t){let n=t.get(e);if(n)return n;let r=qN(e,[],!1).filter(e=>EN(e)&&SN(e)!==`body`),i=null,a=UN(e).position===`fixed`,o=a?GN(e):e;for(;EN(o)&&!HN(o);){let t=UN(o),n=RN(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&lP.has(i.position)||AN(o)&&!n&&fP(e,o))?r=r.filter(e=>e!==o):i=t,o=GN(o)}return t.set(e,r),r}function mP(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?PN(t)?[]:pP(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=dP(t,n,i);return e.top=AM(r.top,e.top),e.right=kM(r.right,e.right),e.bottom=kM(r.bottom,e.bottom),e.left=AM(r.left,e.left),e},dP(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function hP(e){let{width:t,height:n}=YN(e);return{width:t,height:n}}function gP(e,t,n){let r=DN(t),i=wN(t),a=n===`fixed`,o=tP(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=MM(0);function l(){c.x=nP(i)}if(r||!r&&!a)if((SN(t)!==`body`||AN(i))&&(s=WN(t)),r){let e=tP(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?rP(i,s):MM(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function _P(e){return UN(e).position===`static`}function vP(e,t){if(!DN(e)||UN(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return wN(e)===n&&(n=n.ownerDocument.body),n}function yP(e,t){let n=CN(e);if(PN(e))return n;if(!DN(e)){let t=GN(e);for(;t&&!HN(t);){if(EN(t)&&!_P(t))return t;t=GN(t)}return n}let r=vP(e,t);for(;r&&MN(r)&&_P(r);)r=vP(r,t);return r&&HN(r)&&_P(r)&&!RN(r)?n:r||zN(e)||n}var bP=async function(e){let t=this.getOffsetParent||yP,n=this.getDimensions,r=await n(e.floating);return{reference:gP(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xP(e){return UN(e).direction===`rtl`}var SP={convertOffsetParentRelativeRectToViewportRelativeRect:iP,getDocumentElement:wN,getClippingRect:mP,getOffsetParent:yP,getElementRects:bP,getClientRects:aP,getDimensions:hP,getScale:ZN,isElement:EN,isRTL:xP},CP=vN,wP=cN,TP=yN,EP=lN,DP=bN,OP=fN,kP=oN,AP=hN,jP=(e,t,n)=>{let r=new Map,i={platform:SP,...n},a={...i.platform,_c:r};return iN(e,t,{...i,platform:a})};function MP(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=Sg(t),l=RegExp(`\\s${c}$`),u=a?`^`:``,d=r?``:c,f=s?RegExp(`${u}${c}.*?(?=\\s${d}|$)`,`gm`):RegExp(`${u}(?:^)?${c}[^\\s${d}]*`,`gm`),p=o.nodeBefore?.isText&&o.nodeBefore.text;if(!p)return null;let m=o.pos-p.length,h=Array.from(p.matchAll(f)).pop();if(!h||h.input===void 0||h.index===void 0)return null;let g=h.input.slice(Math.max(0,h.index-1),h.index),_=RegExp(`^[${i?.join(``)}\0]?$`).test(g);if(i!==null&&!_)return null;let v=m+h.index,y=v+h[0].length;return s&&l.test(p.slice(y-1,y+1))&&(h[0]+=` `,y+=1),v<o.pos&&y>=o.pos?{range:{from:v,to:y},query:h[0].slice(t.length),text:h[0]}:null}var NP=new V(`suggestion`);function PP({pluginKey:e=NP,editor:t,char:n=`@`,allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[` `],startOfLine:o=!1,decorationTag:s=`span`,decorationClass:c=`suggestion`,decorationContent:l=``,decorationEmptyClass:u=`is-empty`,command:d=()=>null,items:f=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:h=MP}){let g,_=p?.(),v=()=>{let e=t.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:a}=t.view.coordsAtPos(e);try{return new DOMRect(a,n,r-a,i-n)}catch{return null}},y=(n,r)=>r?()=>{let r=e.getState(t.state)?.decorationId;return n.dom.querySelector(`[data-decoration-id="${r}"]`)?.getBoundingClientRect()||null}:v;function b(n,r){var i;try{let r=e.getState(n.state),a=r?.decorationId?n.dom.querySelector(`[data-decoration-id="${r.decorationId}"]`):null,o={editor:t,range:r?.range||{from:0,to:0},query:r?.query||null,text:r?.text||null,items:[],command:e=>d({editor:t,range:r?.range||{from:0,to:0},props:e}),decorationNode:a,clientRect:y(n,a)};(i=_?.onExit)==null||i.call(_,o)}catch{}let a=n.state.tr.setMeta(r,{exit:!0});n.dispatch(a)}let x=new B({key:e,view(){return{update:async(e,n)=>{var r,i,a,o,s;let c=this.key?.getState(n),l=this.key?.getState(e.state),u=c.active&&l.active&&c.range.from!==l.range.from,p=!c.active&&l.active,m=c.active&&!l.active,h=!p&&!m&&c.query!==l.query,v=p||u&&h,b=h||u,x=m||u&&h;if(!v&&!b&&!x)return;let S=x&&!v?c:l,C=e.dom.querySelector(`[data-decoration-id="${S.decorationId}"]`);g={editor:t,range:S.range,query:S.query,text:S.text,items:[],command:e=>d({editor:t,range:S.range,props:e}),decorationNode:C,clientRect:y(e,C)},v&&((r=_?.onBeforeStart)==null||r.call(_,g)),b&&((i=_?.onBeforeUpdate)==null||i.call(_,g)),(b||v)&&(g.items=await f({editor:t,query:S.query})),x&&((a=_?.onExit)==null||a.call(_,g)),b&&((o=_?.onUpdate)==null||o.call(_,g)),v&&((s=_?.onStart)==null||s.call(_,g))},destroy:()=>{var e;g&&((e=_?.onExit)==null||e.call(_,g))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(s,c,l,u){let{isEditable:d}=t,{composing:f}=t.view,{selection:p}=s,{empty:g,from:_}=p,v={...c},y=s.getMeta(e);if(y&&y.exit)return v.active=!1,v.decorationId=null,v.range={from:0,to:0},v.query=null,v.text=null,v;if(v.composing=f,d&&(g||t.view.composing)){(_<c.range.from||_>c.range.to)&&!f&&!c.composing&&(v.active=!1);let e=h({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,$position:p.$from}),s=`id_${Math.floor(Math.random()*4294967295)}`;e&&m({editor:t,state:u,range:e.range,isActive:c.active})?(v.active=!0,v.decorationId=c.decorationId?c.decorationId:s,v.range=e.range,v.query=e.query,v.text=e.text):v.active=!1}else v.active=!1;return v.active||(v.decorationId=null,v.range={from:0,to:0},v.query=null,v.text=null),v}},props:{handleKeyDown(n,r){var i;let{active:a,range:o}=x.getState(n.state);if(!a)return!1;if(r.key===`Escape`||r.key===`Esc`){let a=x.getState(n.state),o=g?.decorationNode??null??(a?.decorationId?n.dom.querySelector(`[data-decoration-id="${a.decorationId}"]`):null);if((_?.onKeyDown)?.call(_,{view:n,event:r,range:a.range}))return!0;let s={editor:t,range:a.range,query:a.query,text:a.text,items:[],command:e=>d({editor:t,range:a.range,props:e}),decorationNode:o,clientRect:o?()=>o.getBoundingClientRect()||null:null};return(i=_?.onExit)==null||i.call(_,s),b(n,e),!0}return(_?.onKeyDown)?.call(_,{view:n,event:r,range:o})||!1},decorations(e){let{active:t,range:n,decorationId:r,query:i}=x.getState(e);if(!t)return null;let a=!i?.length,o=[c];return a&&o.push(u),H.create(e.doc,[Wd.inline(n.from,n.to,{nodeName:s,class:o.join(` `),"data-decoration-id":r,"data-decoration-content":l})])}}});return x}var FP=PP,IP=e=>typeof e==`object`&&!!e&&e.nodeType===1,LP=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,RP=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return LP(n.overflowY,t)||LP(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},zP=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,BP=e=>e.parentElement??(e.getRootNode().host||null),VP=(e,t)=>{if(typeof document>`u`)return[];let{scrollMode:n,block:r,inline:i,boundary:a,skipOverflowHiddenElements:o}=t,s=typeof a==`function`?a:e=>e!==a;if(!IP(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;IP(u)&&s(u);){if(u=BP(u),u===c){l.push(u);break}u!=null&&u===document.body&&RP(u)&&!RP(document.documentElement)||u!=null&&RP(u,o)&&l.push(u)}let d=window.visualViewport?.width??innerWidth,f=window.visualViewport?.height??innerHeight,{scrollX:p,scrollY:m}=window,{height:h,width:g,top:_,right:v,bottom:y,left:b}=e.getBoundingClientRect(),x=r===`start`||r===`nearest`?_:r===`end`?y:_+h/2,S=i===`center`?b+g/2:i===`end`?v:b,C=[];for(let e=0;e<l.length;e++){let t=l[e],{height:a,width:o,top:s,right:u,bottom:w,left:T}=t.getBoundingClientRect();if(n===`if-needed`&&_>=0&&b>=0&&y<=f&&v<=d&&_>=s&&y<=w&&b>=T&&v<=u)return C;let ee=getComputedStyle(t),te=parseInt(ee.borderLeftWidth,10),E=parseInt(ee.borderTopWidth,10),ne=parseInt(ee.borderRightWidth,10),re=parseInt(ee.borderBottomWidth,10),ie=0,ae=0,D=`offsetWidth`in t?t.offsetWidth-t.clientWidth-te-ne:0,oe=`offsetHeight`in t?t.offsetHeight-t.clientHeight-E-re:0,se=`offsetWidth`in t?t.offsetWidth===0?0:o/t.offsetWidth:0,ce=`offsetHeight`in t?t.offsetHeight===0?0:a/t.offsetHeight:0;if(c===t)ie=r===`start`?x:r===`end`?x-f:r===`nearest`?zP(m,m+f,f,E,re,m+x,m+x+h,h):x-f/2,ae=i===`start`?S:i===`center`?S-d/2:i===`end`?S-d:zP(p,p+d,d,te,ne,p+S,p+S+g,g),ie=Math.max(0,ie+m),ae=Math.max(0,ae+p);else{ie=r===`start`?x-s-E:r===`end`?x-w+re+oe:r===`nearest`?zP(s,w,a,E,re+oe,x,x+h,h):x-(s+a/2)+oe/2,ae=i===`start`?S-T-te:i===`center`?S-(T+o/2)+D/2:i===`end`?S-u+ne+D:zP(T,u,o,te,ne+D,S,S+g,g);let{scrollLeft:e,scrollTop:n}=t;ie=Math.max(0,Math.min(n+ie/ce,t.scrollHeight-a/ce+oe)),ae=Math.max(0,Math.min(e+ae/se,t.scrollWidth-o/se+D)),x+=n-ie,S+=e-ae}C.push({el:t,top:ie,left:ae})}return C},HP=e=>!1===e?{block:`end`,inline:`nearest`}:(e=>e===Object(e)&&Object.keys(e).length!==0)(e)?e:{block:`start`,inline:`nearest`};function UP(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let n=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>typeof e==`object`&&typeof e.behavior==`function`)(t))return t.behavior(VP(e,t));let r=typeof t==`boolean`||t==null?void 0:t.behavior;for(let{el:i,top:a,left:o}of VP(e,HP(t))){let e=a-n.top+n.bottom,t=o-n.left+n.right;i.scroll({top:e,left:t,behavior:r})}}var WP={class:`relative flex max-h-72 w-60 flex-col gap-1 overflow-y-auto overflow-x-hidden rounded-lg border bg-white p-1.5 shadow-md`},GP=[`id`,`onClick`],KP={key:1,class:`flex items-center justify-center p-1 text-sm text-gray-600`},qP=(0,t.defineComponent)({__name:`CommandsView`,props:{items:{type:Array,required:!0},command:{type:Function,required:!0}},setup(e,{expose:n}){let r=e,i=(0,t.ref)(0);(0,t.watch)(()=>r.items,()=>{i.value=0});function a({event:e}){return e.key===`ArrowUp`||e.key===`k`&&e.ctrlKey?(o(),!0):e.key===`ArrowDown`||e.key===`j`&&e.ctrlKey?(s(),!0):e.key===`Enter`?(c(),!0):!1}function o(){i.value=(i.value+r.items.length-1)%r.items.length}function s(){i.value=(i.value+1)%r.items.length}function c(){l(i.value)}function l(e){let t=r.items[e];t&&r.command(t)}return(0,t.watch)(()=>i.value,()=>{let e=document.getElementById(`command-item-${i.value}`);e&&UP(e,{behavior:`smooth`,scrollMode:`if-needed`})}),n({onKeyDown:a}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,WP,[e.items.length?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(e.items,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{id:`command-item-${n}`,key:n,type:`button`,class:(0,t.normalizeClass)([{"bg-gray-100":n===i.value},`group flex w-full items-center gap-3 rounded p-1.5 transition-colors hover:bg-gray-100`]),onClick:e=>l(n)},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`size-6 flex-none rounded bg-gray-100 p-1 group-hover:bg-white`,{"!bg-white":n===i.value}])},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon),{class:`size-full`}))],2),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`min-w-0 flex-1 shrink text-left text-sm text-gray-600 group-hover:font-medium group-hover:text-gray-900`,{"font-medium text-gray-900":n===i.value}])},(0,t.toDisplayString)((0,t.unref)(N).global.t(e.title)),3)],10,GP))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,KP,[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.commands_menu.no_results`)),1)]))]))}});let JP=K.create({name:`commands-menu`,addProseMirrorPlugins(){let e=XP(this.editor),t={editor:this.editor,command:({editor:e,range:t,props:n})=>{n.command({editor:e,range:t})},items:({query:t})=>e.filter(e=>[...e.keywords,e.title].some(e=>e.includes(t))),render:()=>{let e=null;return{onStart:t=>{e=new XT(qP,{props:t,editor:t.editor}),t.clientRect&&e.element&&e.element instanceof HTMLElement&&(e.element.style.position=`absolute`,document.body.appendChild(e.element),YP(t.editor,e.element))},onUpdate(t){e&&e.element&&e.element instanceof HTMLElement&&(e.updateProps(t),t.clientRect&&YP(t.editor,e.element))},onKeyDown(t){return e?t.event.key===`Escape`?e.element?(e.destroy(),e.element.remove(),!0):!1:e.ref?.onKeyDown(t):!1},onExit(){e&&e.element&&(e.destroy(),e.element.remove())}}}};return[FP({pluginKey:new V(`commands-menu-english`),char:`/`,...t}),FP({pluginKey:new V(`commands-menu-chinese`),char:`、`,...t})]}});var YP=(e,t)=>{jP({getBoundingClientRect:()=>ah(e.view,e.state.selection.from,e.state.selection.to)},t,{placement:`bottom-start`,strategy:`absolute`,middleware:[TP(),EP()]}).then(({x:e,y:n,strategy:r})=>{t.style.position=r,t.style.left=`${e}px`,t.style.top=`${n}px`,t.style.zIndex=`1000`})},XP=e=>(e?.extensionManager).extensions.reduce((e,t)=>{let{getCommandMenuItems:n}=t.options;if(!n)return e;let r=n();return Array.isArray(r)?[...e,...r]:[...e,r]},[]).sort((e,t)=>e.priority-t.priority),ZP=(e,t)=>t.view.domAtPos(e).node.offsetParent!==null,QP=(e,t,n)=>{for(let r=e.depth;r>0;--r){let i=e.node(r),a=t(i),o=ZP(e.start(r),n);if(a&&o)return{pos:r>0?e.before(r):0,start:e.start(r),depth:r,node:i}}},$P=(e,t)=>{let{state:n,view:r,extensionManager:i}=e,{schema:a,selection:o}=n,{empty:s,$anchor:c}=o,l=!!i.extensions.find(e=>e.name===`gapCursor`);if(!s||c.parent.type!==a.nodes.detailsSummary||!l||t===`right`&&c.parentOffset!==c.parent.nodeSize-2)return!1;let u=_m(e=>e.type===a.nodes.details)(o);if(!u)return!1;let d=mm(u.node,e=>e.type===a.nodes.detailsContent);if(!d.length||ZP(u.start+d[0].pos+1,e))return!1;let f=n.doc.resolve(u.pos+u.node.nodeSize),p=x_.findFrom(f,1,!1);if(!p)return!1;let{tr:m}=n,h=new x_(p);return m.setSelection(h),m.scrollIntoView(),r.dispatch(m),!0},eF=q.create({name:`details`,content:`detailsSummary detailsContent`,group:`block`,defining:!0,isolating:!0,allowGapCursor:!1,addOptions(){return{persist:!1,openClassName:`is-open`,HTMLAttributes:{}}},addAttributes(){return this.options.persist?{open:{default:!1,parseHTML:e=>e.hasAttribute(`open`),renderHTML:({open:e})=>e?{open:``}:{}}}:[]},parseHTML(){return[{tag:`details`}]},renderHTML({HTMLAttributes:e}){return[`details`,G(this.options.HTMLAttributes,e),0]},...Og({nodeName:`details`,content:`block`}),addNodeView(){return({editor:e,getPos:t,node:n,HTMLAttributes:r})=>{let i=document.createElement(`div`),a=G(this.options.HTMLAttributes,r,{"data-type":this.name});Object.entries(a).forEach(([e,t])=>i.setAttribute(e,t));let o=document.createElement(`button`);o.type=`button`,i.append(o);let s=document.createElement(`div`);i.append(s);let c=e=>{if(e!==void 0)if(e){if(i.classList.contains(this.options.openClassName))return;i.classList.add(this.options.openClassName)}else{if(!i.classList.contains(this.options.openClassName))return;i.classList.remove(this.options.openClassName)}else i.classList.toggle(this.options.openClassName);let t=new Event(`toggleDetailsContent`);s.querySelector(`:scope > div[data-type="detailsContent"]`)?.dispatchEvent(t)};return n.attrs.open&&setTimeout(()=>c()),o.addEventListener(`click`,()=>{if(c(),!this.options.persist){e.commands.focus(void 0,{scrollIntoView:!1});return}if(e.isEditable&&typeof t==`function`){let{from:n,to:r}=e.state.selection;e.chain().command(({tr:e})=>{let n=t();if(!n)return!1;let r=e.doc.nodeAt(n);return r?.type===this.type?(e.setNodeMarkup(n,void 0,{open:!r.attrs.open}),!0):!1}).setTextSelection({from:n,to:r}).focus(void 0,{scrollIntoView:!1}).run()}}),{dom:i,contentDOM:s,ignoreMutation(e){return e.type===`selection`?!1:!i.contains(e.target)||i===e.target},update:e=>e.type===this.type?(e.attrs.open!==void 0&&c(e.attrs.open),!0):!1}}},addCommands(){return{setDetails:()=>({state:e,chain:t})=>{let{schema:n,selection:r}=e,{$from:i,$to:a}=r,o=i.blockRange(a);if(!o)return!1;let s=e.doc.slice(o.start,o.end);if(!n.nodes.detailsContent.contentMatch.matchFragment(s.content))return!1;let c=s.toJSON()?.content||[];return t().insertContentAt({from:o.start,to:o.end},{type:this.name,content:[{type:`detailsSummary`},{type:`detailsContent`,content:c}]}).setTextSelection(o.start+2).run()},unsetDetails:()=>({state:e,chain:t})=>{let{selection:n,schema:r}=e,i=_m(e=>e.type===this.type)(n);if(!i)return!1;let a=mm(i.node,e=>e.type===r.nodes.detailsSummary),o=mm(i.node,e=>e.type===r.nodes.detailsContent);if(!a.length||!o.length)return!1;let s=a[0],c=o[0],l=i.pos,u=e.doc.resolve(l),d={from:l,to:l+i.node.nodeSize},f=c.node.content.toJSON()||[],p=[u.parent.type.contentMatch.defaultType?.create(null,s.node.content).toJSON(),...f];return t().insertContentAt(d,p).setTextSelection(l+1).run()}}},addKeyboardShortcuts(){return{Backspace:()=>{let{schema:e,selection:t}=this.editor.state,{empty:n,$anchor:r}=t;return!n||r.parent.type!==e.nodes.detailsSummary?!1:r.parentOffset===0?this.editor.commands.unsetDetails():this.editor.commands.command(({tr:e})=>{let t=r.pos-1,n=r.pos;return e.delete(t,n),!0})},Enter:({editor:e})=>{let{state:t,view:n}=e,{schema:r,selection:i}=t,{$head:a}=i;if(a.parent.type!==r.nodes.detailsSummary)return!1;let o=ZP(a.after()+1,e),s=o?t.doc.nodeAt(a.after()):a.node(-2);if(!s)return!1;let c=o?0:a.indexAfter(-1),l=pm(s.contentMatchAt(c));if(!l||!s.canReplaceWith(c,c,l))return!1;let u=l.createAndFill();if(!u)return!1;let d=o?a.after()+1:a.after(-1),f=t.tr.replaceWith(d,d,u),p=f.doc.resolve(d),m=L.near(p,1);return f.setSelection(m),f.scrollIntoView(),n.dispatch(f),!0},ArrowRight:({editor:e})=>$P(e,`right`),ArrowDown:({editor:e})=>$P(e,`down`)}},addProseMirrorPlugins(){return[new B({key:new V(`detailsSelection`),appendTransaction:(e,t,n)=>{let{editor:r,type:i}=this;if(r.view.composing||!e.some(e=>e.selectionSet)||!t.selection.empty||!n.selection.empty||!Qm(n,i.name))return;let{$from:a}=n.selection;if(ZP(a.pos,r))return;let o=QP(a,e=>e.type===i,r);if(!o)return;let s=mm(o.node,e=>e.type===n.schema.nodes.detailsSummary);if(!s.length)return;let c=s[0],l=(t.selection.from<n.selection.from?`forward`:`backward`)==`forward`?o.start+c.pos:o.pos+c.pos+c.node.nodeSize,u=R.create(n.doc,l);return n.tr.setSelection(u)}})]}}),tF=q.create({name:`detailsContent`,content:`block+`,defining:!0,selectable:!1,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML({HTMLAttributes:e}){return[`div`,G(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`),n=G(this.options.HTMLAttributes,e,{"data-type":this.name,hidden:`hidden`});return Object.entries(n).forEach(([e,n])=>t.setAttribute(e,n)),t.addEventListener(`toggleDetailsContent`,()=>{t.toggleAttribute(`hidden`)}),{dom:t,contentDOM:t,ignoreMutation(e){return e.type===`selection`?!1:!t.contains(e.target)||t===e.target},update:e=>e.type===this.type}}},addKeyboardShortcuts(){return{Enter:({editor:e})=>{let{state:t,view:n}=e,{selection:r}=t,{$from:i,empty:a}=r,o=_m(e=>e.type===this.type)(r);if(!a||!o||!o.node.childCount)return!1;let s=i.index(o.depth),{childCount:c}=o.node;if(c!==s+1)return!1;let l=o.node.type.contentMatch.defaultType?.createAndFill();if(!l)return!1;let u=t.doc.resolve(o.pos+1),d=c-1,f=o.node.child(d),p=u.posAtIndex(d,o.depth);if(!f.eq(l))return!1;let m=i.node(-3);if(!m)return!1;let h=i.indexAfter(-3),g=pm(m.contentMatchAt(h));if(!g||!m.canReplaceWith(h,h,g))return!1;let _=g.createAndFill();if(!_)return!1;let{tr:v}=t,y=i.after(-2);v.replaceWith(y,y,_);let b=v.doc.resolve(y),x=L.near(b,1);v.setSelection(x);let S=p,C=p+f.nodeSize;return v.delete(S,C),v.scrollIntoView(),n.dispatch(v),!0}}},...Og({nodeName:`detailsContent`})}),nF=q.create({name:`detailsSummary`,content:`text*`,defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`summary`}]},renderHTML({HTMLAttributes:e}){return[`summary`,G(this.options.HTMLAttributes,e),0]},...Og({nodeName:`detailsSummary`,content:`inline`})}),rF=eF,iF={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function aF(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,iF,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M4 11a1 1 0 0 0 0 2h1a1 1 0 1 0 0-2zm5 0a1 1 0 0 0 0 2h1a1 1 0 1 0 0-2zm4 1a1 1 0 0 1 1-1h1a1 1 0 0 1 0 2h-1a1 1 0 0 1-1-1m6-1a1 1 0 0 0 0 2h1a1 1 0 1 0 0-2zm-8-4.586L9.879 5.293a1 1 0 0 0-1.414 1.414l2.828 2.829a1 1 0 0 0 1.414 0l2.829-2.829a1 1 0 0 0-1.415-1.414L13 6.414V3a1 1 0 1 0-2 0zM12 22a1 1 0 0 1-1-1v-3.414l-1.121 1.121a1 1 0 0 1-1.414-1.414l2.828-2.828a1 1 0 0 1 1.414 0l2.829 2.828a1 1 0 0 1-1.415 1.414L13 17.586V21a1 1 0 0 1-1 1`})],-1)]])}var oF=(0,t.markRaw)({name:`mingcute-fold-vertical-line`,render:aF});let sF=new V(`detailsBubbleMenu`),cF=rF.extend({addOptions(){return{...this.parent?.(),HTMLAttributes:{class:`details`},getCommandMenuItems(){return{priority:160,icon:(0,t.markRaw)(oF),title:`editor.extensions.details.command_item`,keywords:[`details`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setDetails().updateAttributes(rF.name,{open:!0}).run()}}},getToolbarItems({editor:e}){return{priority:95,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(rF.name),icon:(0,t.markRaw)(oF),title:N.global.t(`editor.extensions.details.command_item`),action:()=>{e.isActive(rF.name)?e.chain().focus().unsetDetails().run():e.chain().focus().setDetails().updateAttributes(rF.name,{open:!0}).run()}}}},getBubbleMenu(){return{pluginKey:sF,shouldShow:({state:e})=>Qm(e,cF.name),options:{placement:`top-start`},getReferencedVirtualElement(){let e=this.editor;if(!e)return null;let t=_m(e=>e.type.name===cF.name)(e.state.selection);if(t){let n=ah(e.view,t.pos,t.pos+t.node.nodeSize);return{getBoundingClientRect:()=>n,getClientRects:()=>[n]}}return null},items:[{priority:10,props:{icon:(0,t.markRaw)(OE),title:N.global.t(`editor.common.button.delete`),action:({editor:e})=>cE(cF.name,e)}}]}}}},addExtensions(){return[nF,tF]}}).configure({persist:!0});var lF=q.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
165
+
166
+ `):``});let uF=uk.configure({width:2,class:`dropcursor`,color:`skyblue`});var dF=q.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,G(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];return n.length===1&&n[0].type===`image`?t.parseChildren([n[0]]):t.createNode(`paragraph`,void 0,t.parseInline(n))},renderMarkdown:(e,t)=>!e||!Array.isArray(e.content)?``:t.renderChildren(e.content),addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),fF={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function pF(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,fF,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`m6.707 3.293l2.121 2.121a1 1 0 0 1-1.414 1.414L7 6.414v11.172l.414-.414a1 1 0 1 1 1.414 1.414l-2.12 2.121a1 1 0 0 1-1.415 0l-2.121-2.121a1 1 0 1 1 1.414-1.414l.414.414V6.414l-.414.414a1 1 0 0 1-1.414-1.414l2.12-2.121a1 1 0 0 1 1.415 0M20 18a1 1 0 0 1 .117 1.993L20 20h-8a1 1 0 0 1-.117-1.993L12 18zm0-7a1 1 0 0 1 .117 1.993L20 13h-8a1 1 0 0 1-.117-1.993L12 11zm0-7a1 1 0 1 1 0 2h-8a1 1 0 1 1 0-2z`})],-1)]])}var mF=(0,t.markRaw)({name:`mingcute-line-height-line`,render:pF});let hF=dF.extend({addAttributes(){return{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight,renderHTML:e=>{let t=e.lineHeight;return t?{style:`line-height: ${t}`}:{}}}}},addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:220,component:(0,t.markRaw)(E),props:{editor:e,isActive:!!e.getAttributes(hF.name)?.lineHeight,icon:(0,t.markRaw)(mF),title:N.global.t(`editor.common.line_height`)},children:[0,1,1.5,2,2.5,3].map(n=>({priority:n,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.getAttributes(hF.name)?.lineHeight===n,title:n?String(n):N.global.t(`editor.common.text.default`),action:()=>e.chain().focus().updateAttributes(hF.name,{lineHeight:n}).run()}}))}}}},addKeyboardShortcuts(){return{Backspace:({editor:e})=>{let{state:t,view:n}=e,{selection:r}=t;if(mE(e)||!Qm(t,hF.name)||!(r instanceof R)||!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0)return!1;let a=i.before(i.depth);return a===0?!0:_F(i,a,t,n.dispatch)}}}});function gF(e,t,n,r){let{tr:i}=n;return sE(e)(i)&&r?(t!==0&&i.setSelection(R.near(i.doc.resolve(t-1),-1)),r(i),!0):!1}function _F(e,t,n,r){let{tr:i}=n;if(!r)return!1;let a=e.doc.resolve(t).nodeBefore;return!a||!a.type.isBlock||a.type.isText||a.type.name===hF.name||!a.type.spec.allowGapCursor?!1:sE(e.doc.resolve(t-1))(i)?(r(i),!0):!1}var vF=class e extends L{constructor(e,t){bF(e,t),super(e,t)}map(t,n){let r=t.resolve(n.map(this.head));return new e(t.resolve(n.map(this.anchor)),r)}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new yF(this.anchor,this.head)}toJSON(){return{type:`range`,anchor:this.anchor,head:this.head}}static valid(e,t,n){let r=xF(e.doc.resolve(t),e.doc.resolve(n));return!(r.length===0||r.reverse()[0].pos<0)}static between(t,n){bF(t,n);let r=t.doc,i=t.pos<n.pos?1:-1,a=i>0?t.pos:n.pos,o=i>0?n.pos:t.pos,s=xF(t,n);if(s.length===0)return null;let c=s[s.length-1];if(c.pos<0)return null;let l=0;s.forEach(({pos:e})=>{e<0&&(l=e)});let u=o-a-c.pos-c.node.nodeSize,d=i>0?a+l:o-(u>0?0:u),f=i>0?o-(u>0?0:u):a+l;return new e(r.resolve(d),r.resolve(f))}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for RangeSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n){return new this(e.resolve(t),e.resolve(n))}static allRange(t){return new e(t.resolve(0),t.resolve(t.content.size))}};L.jsonID(`range`,vF);var yF=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return new vF(e.resolve(this.anchor),e.resolve(this.head))}};function bF(e,t){e.pos===t.pos&&console.warn(`The RangeSelection cannot be empty.`)}function xF(e,t){let n=e.doc,r=e.pos<t.pos?1:-1,i=r>0?e.pos:t.pos,a=r>0?t.pos:e.pos,o=[];return n.nodesBetween(i,a,(e,t,n,r)=>{if(e.isText||e.type.name===`paragraph`)return!0;o.push({node:e,pos:t,parent:n,index:r})},-i),o}var SF=vF,CF={anchor:0,head:0,enable:!1};let wF=K.create({priority:100,name:`rangeSelectionExtension`,addProseMirrorPlugins(){return[new B({key:new V(`rangeSelectionPlugin`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor;if(!n||!r||!(t instanceof SF))return null;let{$from:i,$to:a}=t,o=[];return e.nodesBetween(i.pos,a.pos,(e,t)=>{e.isText||e.type.name===`paragraph`||e.type.spec.fakeSelection&&o.push(Wd.node(t,t+e.nodeSize,{class:`no-selection range-fake-selection`}))}),H.create(e,o)},createSelectionBetween:(e,t,n)=>t.pos===n.pos?null:SF.valid(e.state,t.pos,n.pos)?new SF(t,n):null,handleDOMEvents:{mousedown:(e,t)=>{let n={left:t.clientX,top:t.clientY},r=e.posAtCoords(n);!r||!r.pos||(CF.enable=!0,CF.anchor=r.pos)},mousemove:(e,t)=>{if(!CF.enable)return;let n={left:t.clientX,top:t.clientY},r=e.posAtCoords(n);if(!r||!r.pos||r.pos===CF.anchor||r.pos===CF.head)return;CF.head=r.pos;let i=SF.between(e.state.doc.resolve(CF.anchor),e.state.doc.resolve(CF.head));i&&e.dispatch(e.state.tr.setSelection(i))},mouseup:()=>{CF.enable=!1,CF.anchor=0,CF.head=0},mouseleave:()=>{CF.enable=!1,CF.anchor=0,CF.head=0}}}})]},addKeyboardShortcuts(){return{"Mod-a":({editor:e})=>(e.view.dispatch(e.view.state.tr.setSelection(SF.allRange(e.view.state.doc))),!0)}},extendNodeSchema(e){return{fakeSelection:W(U(e,`fakeSelection`,{name:e.name,options:e.options,storage:e.storage}))??!1}}});var TF=(0,t.defineComponent)({__name:`FigureCaptionView`,props:{decorations:{},selected:{type:Boolean},updateAttributes:{type:Function},deleteNode:{type:Function},node:{},view:{},getPos:{},innerDecorations:{},editor:{},extension:{},HTMLAttributes:{}},setup(e){let n=e,r=(0,t.computed)(()=>n.node?.attrs.width),i=(0,t.computed)(()=>n.node?.attrs[`data-placeholder`]),a=(0,t.ref)(n.node?.textContent.trim().length===0);return(0,t.watch)(()=>n.node?.textContent,e=>{a.value=e?.trim().length===0}),(e,n)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(JT),{as:`figcaption`,"data-empty":a.value?`true`:void 0,"data-placeholder":i.value,style:(0,t.normalizeStyle)({width:r.value||``,maxWidth:r.value?`100%`:``,textAlign:r.value?`center`:``})},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(qT))]),_:1},8,[`data-empty`,`data-placeholder`,`style`]))}});let EF=q.create({name:`figureCaption`,content:`text*`,inline:!1,group:`block`,addAttributes(){return{"data-placeholder":{default:null,parseHTML:e=>e.getAttribute(`data-placeholder`),renderHTML:e=>({"data-placeholder":e.dataPlaceholder||N.global.t(`editor.extensions.figure_caption.empty_placeholder`)})},width:{default:null,parseHTML:e=>{let t=e.getAttribute(`style`);if(t){let e=t.match(/width:\s*([^;]+)/);if(e)return e[1].trim()}return null},renderHTML:e=>e.width?{style:`width: ${e.width}; max-width: 100%; text-align: center;`}:{}}}},addKeyboardShortcuts(){return{"Mod-a":({editor:e})=>{let{state:t}=e,{selection:n}=t,{$from:r}=n;if(Qm(t,this.name)){let t=r.start(r.depth),n=r.end(r.depth);return e.commands.setTextSelection({from:t,to:n}),!0}return!1},Enter:({editor:e})=>{let{state:t}=e,{selection:n}=t,{$from:r}=n,i=!1,a=-1;for(let e=r.depth;e>0;e--)if(r.node(e).type.name===this.name){i=!0,a=e-1;break}if(!i)return!1;let o=r.node(a),s=r.before(a)+o.nodeSize;return e.chain().command(({tr:e})=>{let t=e.doc.type.schema.nodes.paragraph.create();return e.insert(s,t),e.setSelection(R.near(e.doc.resolve(s+1))),!0}).run(),!0}}},addProseMirrorPlugins(){let e=new V(`figureCaptionAutoDelete`);return[new B({key:e,state:{init(){return{previousCaptionPos:null}},apply(e){let{selection:t}=e,{$from:n}=t,r=null;for(let e=n.depth;e>0;e--)if(n.node(e).type.name===EF.name){r=n.before(e);break}return{previousCaptionPos:r}}},appendTransaction(t,n,r){let i=e.getState(n);if(!i)return null;let{previousCaptionPos:a}=i,{selection:o}=r,{$from:s}=o,c=!1;for(let e=s.depth;e>0;e--)if(s.node(e).type.name===EF.name){c=!0;break}if(c)return null;if(a!==null&&t.some(e=>e.docChanged||e.selectionSet)){let e=n.doc.nodeAt(a);if(e&&e.type.name===EF.name&&(e.textContent.trim().length===0||e.childCount===0)){let t=r.tr;return t.delete(a,a+e.nodeSize),t}}return null}})]},parseHTML(){return[{tag:`figcaption`}]},renderHTML({HTMLAttributes:e}){return[`figcaption`,G(this.options.HTMLAttributes,e),0]},addNodeView(){return rE(TF)}}),DF=q.create({name:`figure`,group:`block`,content:`(image|video|audio)? figureCaption?`,isolating:!0,addOptions(){return{HTMLAttributes:{},getToolbarItems(){return[]}}},addAttributes(){return{contentType:{default:null,parseHTML:e=>e.getAttribute(`data-content-type`),renderHTML:e=>({"data-content-type":e.contentType})},position:{default:`left`,parseHTML:e=>e.getAttribute(`data-position`),renderHTML:e=>({"data-position":e.position})}}},parseHTML(){return[{tag:`figure`}]},renderHTML({HTMLAttributes:e}){let t={left:`start`,center:`center`,right:`end`}[e[`data-position`]]||`start`;return[`figure`,G(this.options.HTMLAttributes,e,{style:`display: flex; flex-direction: column; align-items: ${t}`}),0]},addExtensions(){return[EF]},addKeyboardShortcuts(){return{Enter:({editor:e})=>{let{state:t}=e,{selection:n}=t,{$from:r}=n,i=!1,a=-1;for(let e=r.depth;e>0;e--)if(r.node(e).type.name===this.name){i=!0,a=e;break}if(!i)return!1;for(let e=r.depth;e>0;e--)if(r.node(e).type.name===EF.name)return!1;let o=r.node(a),s=r.before(a)+o.nodeSize;return e.chain().command(({tr:e})=>{let t=e.doc.type.schema.nodes.paragraph.create();return e.insert(s,t),e.setSelection(R.near(e.doc.resolve(s+1))),!0}).run(),!0},Backspace:({editor:e})=>{let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parentOffset!==0||i.parent.type.name!==hF.name)return!1;let o=i.before(i.depth);if(o<=0)return!1;let s=r.resolve(o-1),c=s.nodeBefore;if(!c||c.type.name!==EF.name)return!1;let l=s.depth;for(;l>0;){let n=s.node(l);if(n.type.name===this.name){let i=s.before(l),a=SF.create(r,i,i+n.nodeSize),o=t.tr.setSelection(a);return e.view.dispatch(o),!0}l--}return!1}}},addProseMirrorPlugins(){return[new B({key:new V(`figureAutoDelete`),appendTransaction:(e,t,n)=>{if(!e.some(e=>e.docChanged))return null;let r=n.tr,i=[];return n.doc.descendants((e,t)=>{if(e.type.name!==this.name)return;let n=!1;e.forEach(e=>{(e.type.name!==hF.name||e.childCount>0||e.textContent.trim().length>0)&&(n=!0)}),n||i.push({pos:t,size:e.nodeSize})}),i.sort((e,t)=>t.pos-e.pos).forEach(({pos:e,size:t})=>{r.delete(e,e+t)}),i.length>0?r:null}})]},addCommands(){return{setFigure:e=>({commands:t})=>t.wrapIn(this.name,e),unsetFigure:()=>({commands:e})=>e.lift(this.name),updateFigureContainerWidth:e=>({state:t,dispatch:n})=>{let{selection:r}=t,{$from:i}=r,a=-1;for(let e=i.depth;e>0;e--)if(i.node(e).type.name===this.name){a=e;break}if(a===-1)return!1;let o=mm(i.node(a),e=>e.type.name===EF.name);if(o.length===0)return!1;let s=o[0],c=i.start(a)+s.pos,l=t.tr.setNodeMarkup(c,void 0,{width:e});return n?.(l),!0}}}});var OF={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function kF(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,OF,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M21 12a1 1 0 0 1 1 1v6a1 1 0 0 1-1.911.412a4 4 0 1 1 0-6.824A1 1 0 0 1 21 12M8 4c.732 0 1.381.473 1.605 1.17l4.347 13.524a1 1 0 0 1-1.904.612L10.664 15H5.336l-1.384 4.306a1 1 0 0 1-1.904-.612L6.395 5.17A1.69 1.69 0 0 1 8 4m10 10a2 2 0 1 0 0 4a2 2 0 0 0 0-4M8 6.712L5.979 13h4.042z`})],-1)]])}var AF=(0,t.markRaw)({name:`mingcute-font-size-line`,render:kF});let jF=uA.extend({name:`fontSize`,addOptions(){return{...this.parent?.(),types:[`textStyle`],getToolbarItems({editor:e}){return{priority:31,component:(0,t.markRaw)(E),props:{editor:e,isActive:!1,icon:(0,t.markRaw)(AF),title:N.global.t(`editor.extensions.font_size.title`)},children:[{priority:0,component:(0,t.markRaw)(D),props:{editor:e,isActive:!1,title:N.global.t(`editor.common.text.default`),action:()=>e.chain().focus().unsetFontSize().run()}},...[8,10,12,14,16,18,20,24,30,36,48,60,72].map(n=>({priority:n,component:(0,t.markRaw)(D),props:{editor:e,isActive:!1,title:`${n} px`,action:()=>e.chain().focus().setFontSize(`${n}px`).run()}}))]}}}}});var MF={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function NF(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,MF,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M20.894 20.448A1 1 0 0 1 20 21H5.5c-.632 0-.932-.563-1.2-1.045a11 11 0 0 1-.738-1.616c-.5-1.364-.917-3.293-.548-5.503a11.6 11.6 0 0 1 1.428-3.993c.655-1.109 1.931-1.42 2.991-1.137l2.187.586l1.035-3.864a3 3 0 1 1 5.796 1.553l-1.036 3.864l1.358.364c1.654.443 2.51 2.119 2.278 3.655c-.11.73-.154 1.447-.065 1.968c.114.67.531 1.537.985 2.306c.38.644.74 1.142.816 1.244c.227.308.281.719.107 1.066m-7.082-16.21a1 1 0 0 0-1.225.708l-1.294 4.83a1 1 0 0 1-1.225.707l-3.152-.845c-.383-.103-.646.043-.751.221a9 9 0 0 0-.703 1.495l11.51 3.053c.025-.294.061-.578.101-.842c.105-.691-.297-1.285-.818-1.424l-2.323-.623a1 1 0 0 1-.707-1.225l1.294-4.83a1 1 0 0 0-.707-1.224Zm3.272 12.267L4.966 13.291c-.26 1.724.067 3.248.474 4.36c.208.569.434 1.022.605 1.329l.012.02h1.7c-.377-.792-.763-1.866-.77-2.993a1 1 0 1 1 1.999-.014c.005.776.307 1.614.656 2.308c.138.276.277.515.392.7h8.125c-.403-.7-.86-1.61-1.075-2.496`})],-1)]])}var PF=(0,t.markRaw)({name:`mingcute-brush-3-line`,render:NF});let FF=e=>{let t=[],{doc:n,selection:r}=e,{from:i,to:a,empty:o}=r;if(o)return t;let s=!1;return n.nodesBetween(i,a,(e,n)=>{if(!(!e||e?.nodeSize===void 0)&&e.isText&&!s)return s=!0,t.push(...e.marks.map(t=>({from:n,to:n+e.nodeSize,mark:t}))),!1}),t},IF=(e,t,n)=>{let{selection:r}=e,i=n||e.tr,{from:a,to:o}=r;return r instanceof Y?r.ranges.forEach(n=>{LF(i,e,{from:n.$from.pos,to:n.$to.pos},t)}):LF(i,e,{from:a,to:o},t),i},LF=(e,t,n,r)=>{let{from:i,to:a}=n;t.doc.nodesBetween(i,a,(t,n)=>{if(!(!t||t?.nodeSize===void 0)){if(t.isText){let o={from:Math.max(n,i),to:Math.min(n+t.nodeSize,a)};t.marks.forEach(t=>{e.step(new Ja(o.from,o.to,t))}),r.forEach(t=>{e.step(new qa(o.from,o.to,t.mark))})}return!0}})},RF=K.create({name:`formatBrush`,addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){let n=e.view.dom.classList.contains(`format-brush-mode`);return{priority:25,component:(0,t.markRaw)(E),props:{editor:e,isActive:n,icon:(0,t.markRaw)(PF),title:n?N.global.t(`editor.extensions.format_brush.toolbar_item.cancel`):N.global.t(`editor.extensions.format_brush.toolbar_item.title`),action:()=>{n?e.commands.pasteFormatBrush():e.commands.copyFormatBrush()}}}}}},addCommands(){return{copyFormatBrush:()=>({state:e})=>{let t=FF(e);return this.storage.formatBrushMarks=t,this.storage.formatBrush=!0,this.editor.view.dom.classList.add(`format-brush-mode`),!0},pasteFormatBrush:()=>()=>(this.storage.formatBrushMarks=[],this.storage.formatBrush=!1,this.editor.view.dom.classList.remove(`format-brush-mode`),!0)}},addStorage(){return{formatBrush:!1,formatBrushMarks:[]}},addProseMirrorPlugins(){let e=this.storage,t=this.editor;return[new B({key:new V(`formatBrushPlugin`),props:{handleDOMEvents:{mouseup(n){e.formatBrush&&t.chain().command(({tr:t})=>(IF(n.state,e.formatBrushMarks,t),!0)).pasteFormatBrush().run()}}}})]},addKeyboardShortcuts(){return{"Shift-Mod-c":()=>(this.editor.commands.copyFormatBrush(),!0)}}});var zF={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function BF(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,zF,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M18 15v3h-3v2h3v3h2v-3h3v-2h-3v-3zm-4.7 6H5c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h14c1.1 0 2 .9 2 2v8.3c-.6-.2-1.3-.3-2-.3c-1.1 0-2.2.3-3.1.9L14.5 12L11 16.5l-2.5-3L5 18h8.1c-.1.3-.1.7-.1 1c0 .7.1 1.4.3 2`},null,-1)]])}var VF=(0,t.markRaw)({name:`mdi-image-plus`,render:BF}),HF={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function UF(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,HF,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M20 6a2 2 0 0 1 2 2v11.333a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2zm-8.268 7.944L7.136 18.54l-.066.06l-.07.054v.68h13v-.68l-.07-.053l-.066-.06l-2.24-2.24l-.353.354l.055.055a1 1 0 0 1-1.32 1.497l-.094-.083zM17 3a2 2 0 0 1 1.995 1.85L19 5H5a1 1 0 0 0-.993.883L4 6v12a2 2 0 0 1-1.995-1.85L2 16V6a3 3 0 0 1 2.824-2.995L5 3zm3 5H7v7.848L10.848 12a1.25 1.25 0 0 1 1.768 0l3.241 3.24l.884-.883a1.25 1.25 0 0 1 1.768 0L20 15.848zm-3.5 1.5a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3`})],-1)]])}var WF=(0,t.markRaw)({name:`mingcute-photo-album-line`,render:UF});function GF(e){return e.getAttributes(bI.name).images||[]}function KF(e,t,n=!0){let r=e.chain().updateAttributes(bI.name,{images:t}).setNodeSelection(e.state.selection.from);n&&r.focus(),r.run()}function qF(e){let n=(0,t.ref)(),{open:r,onChange:i}=bD({accept:`image/*`,multiple:!0,reset:!0});i(e=>{e&&e.length>0&&a(Array.from(e))});let a=e=>{for(let t of e)s(t)},o=(0,t.computed)(()=>e.extensionManager.extensions.find(e=>e.name===bI.name)?.options.uploadImage),s=t=>{o.value&&(n.value=new AbortController,kK(t,o.value,{controller:n.value,onUploadProgress:()=>{},onFinish:t=>{t&&e.commands.updateAttributes(bI.name,{images:[...GF(e),{src:t.status?.permalink,aspectRatio:0}]})},onError:()=>{}}))};return{openFileDialog:r}}var JF=(0,t.defineComponent)({__name:`BubbleItemAddImage`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},emits:[`close`],setup(e,{emit:i}){let a=e,o=i,s=(0,t.ref)(!1),{openFileDialog:c}=qF(a.editor),l=()=>{s.value=!1,c()},u=(0,t.ref)(!1),d=()=>{s.value=!1,u.value=!0};function f(e){let t=GF(a.editor),n=e.map(e=>{let t=r.utils.attachment.getUrl(e);if(t)return{src:t,aspectRatio:0}}).filter(Boolean);KF(a.editor,[...t,...n]),o(`close`)}return(i,a)=>{let o=(0,t.resolveComponent)(`AttachmentSelectorModal`);return(0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createVNode)((0,t.unref)(n.VDropdown),{shown:s.value,"onUpdate:shown":a[0]||=e=>s.value=e,triggers:[`click`],distance:10},{popper:(0,t.withCtx)(()=>[(0,t.unref)(r.utils).permission.has([`uc:attachments:manage`,`system:attachments:manage`])?((0,t.openBlock)(),(0,t.createBlock)(ae,{key:0,class:`!min-w-36`,onClick:l},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.common.button.upload`)),1)]),_:1})):(0,t.createCommentVNode)(``,!0),(0,t.unref)(r.utils).permission.has([`system:attachments:view`,`uc:attachments:manage`])?((0,t.openBlock)(),(0,t.createBlock)(ae,{key:1,class:`!min-w-36`,onClick:d},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.upload.attachment.title`)),1)]),_:1})):(0,t.createCommentVNode)(``,!0)]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(nO,{title:e.title,"is-active":s.value},{icon:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon),{style:(0,t.normalizeStyle)(e.iconStyle)},null,8,[`style`]))]),_:1},8,[`title`,`is-active`])]),_:1},8,[`shown`]),u.value?((0,t.openBlock)(),(0,t.createBlock)(o,{key:0,accepts:[`image/*`],onSelect:f,onClose:a[1]||=e=>u.value=!1})):(0,t.createCommentVNode)(``,!0)],64)}}}),YF={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function XF(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,YF,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M4 3a1 1 0 0 1 1 1v16a1 1 0 1 1-2 0V4a1 1 0 0 1 1-1m16 0a1 1 0 0 1 .993.883L21 4v16a1 1 0 0 1-1.993.117L19 20V4a1 1 0 0 1 1-1m-6 2a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2zm0 2h-4v10h4z`})],-1)]])}var ZF=(0,t.markRaw)({name:`mingcute-distribute-spacing-horizontal-line`,render:XF}),QF={class:`w-80`},$F=(0,t.defineComponent)({__name:`BubbleItemGap`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},setup(e){let r=e,i=(0,t.computed)(()=>r.editor.getAttributes(bI.name).gap);function a(e){r.editor.chain().updateAttributes(bI.name,{gap:e}).run()}return(r,o)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createVNode)((0,t.unref)(n.VDropdown),{ref:`dropdownRef`,class:`inline-flex`,triggers:[`click`],distance:10},{popper:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,QF,[(0,t.createVNode)(DD,{"auto-focus":``,label:(0,t.unref)(N).global.t(`editor.extensions.gallery.gap`),type:`number`,"model-value":i.value,"onUpdate:modelValue":a},null,8,[`label`,`model-value`])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(nO,{title:(0,t.unref)(N).global.t(`editor.extensions.gallery.gap`),text:`${i.value}px`,"show-more-indicator":``},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(ZF))]),_:1},8,[`title`,`text`])]),_:1},512),(0,t.createVNode)((0,t.unref)(C),{editor:e.editor},null,8,[`editor`])],64))}}),eI={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function tI(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,eI,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M5.5 17a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3m6.5 0a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3m6.5 0a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3m-13-6.5a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3m6.5 0a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3m6.5 0a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3M5.5 4a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3M12 4a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3m6.5 0a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3`})],-1)]])}var nI=(0,t.markRaw)({name:`mingcute-dot-grid-line`,render:tI}),rI=(0,t.defineComponent)({__name:`BubbleItemGroupSize`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},setup(e){let r=e,i=(0,t.ref)(),a=(0,t.computed)(()=>r.editor.getAttributes(bI.name).groupSize||3);function o(e){let t=r.editor.getAttributes(bI.name).images||[];r.editor.chain().updateAttributes(bI.name,{images:t,groupSize:e}).setNodeSelection(r.editor.state.selection.from).focus().run(),i.value?.hide()}return(r,s)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createVNode)((0,t.unref)(n.VDropdown),{ref_key:`dropdownRef`,ref:i,class:`inline-flex`,triggers:[`click`],distance:10},{popper:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(10,e=>(0,t.createVNode)(ae,{key:e,class:`!min-w-36`,"is-active":e===a.value,onClick:t=>o(e)},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(e),1)]),_:2},1032,[`is-active`,`onClick`])),64))]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(nO,{title:(0,t.unref)(N).global.t(`editor.extensions.gallery.group_size`),text:(0,t.unref)(N).global.t(`editor.extensions.gallery.group_size_label`,{count:a.value}),"show-more-indicator":``},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(nI))]),_:1},8,[`title`,`text`])]),_:1},512),(0,t.createVNode)((0,t.unref)(C),{editor:e.editor},null,8,[`editor`])],64))}}),iI={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function aI(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,iI,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zm8 0H5v3h6zm2 0v6h6V5zm0 8v6h6v-6zm-2 6v-3H5v3zm0-5v-4H5v4z`})],-1)]])}var oI=(0,t.markRaw)({name:`mingcute-layout-10-line`,render:aI}),sI={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function cI(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,sI,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zm8 0H5v6h6zm2 0v6h6V5zm-2 8H5v6h6zm2 6v-6h6v6z`})],-1)]])}var lI=(0,t.markRaw)({name:`mingcute-layout-grid-line`,render:cI}),uI=(0,t.defineComponent)({__name:`BubbleItemLayout`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},setup(e){let r=e,i=(0,t.ref)(),a=(0,t.computed)(()=>r.editor.getAttributes(bI.name).layout||`auto`),o=[{label:N.global.t(`editor.extensions.gallery.layout.auto`),value:`auto`,icon:oI},{label:N.global.t(`editor.extensions.gallery.layout.square`),value:`square`,icon:lI}],s=(0,t.computed)(()=>o.find(e=>e.value===a.value)||o[0]);function c(e){r.editor.chain().updateAttributes(bI.name,{layout:e}).run(),i.value?.hide()}return(r,l)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createVNode)((0,t.unref)(n.VDropdown),{ref_key:`dropdownRef`,ref:i,class:`inline-flex`,triggers:[`click`],distance:10},{popper:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o,e=>(0,t.createVNode)(ae,{key:e.value,class:`!min-w-36`,"is-active":e.value===a.value,onClick:t=>c(e.value)},{icon:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon)))]),default:(0,t.withCtx)(()=>[(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.label),1)]),_:2},1032,[`is-active`,`onClick`])),64))]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(nO,{title:(0,t.unref)(N).global.t(`editor.extensions.gallery.layout.title`),text:s.value.label,"show-more-indicator":``},{icon:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(s.value.icon)))]),_:1},8,[`title`,`text`])]),_:1},512),(0,t.createVNode)((0,t.unref)(C),{editor:e.editor},null,8,[`editor`])],64))}}),dI={key:0,class:`relative flex h-full items-center justify-center rounded-md border border-gray-200 bg-gray-50 before:pb-[62.5%]`},fI=[`onDragstart`,`onDragenter`,`onDrop`],pI=[`src`,`alt`,`onLoad`],mI={class:`pointer-events-none invisible absolute inset-0 bg-gradient-to-t from-black/0 via-black/5 to-black/30 p-1 opacity-0 transition-all group-hover/image:visible group-hover/image:opacity-100`},hI={class:`flex flex-row-reverse`},gI=[`onClick`],_I=(0,t.defineComponent)({__name:`GalleryView`,props:{decorations:{},selected:{type:Boolean},updateAttributes:{type:Function},deleteNode:{type:Function},node:{},view:{},getPos:{},innerDecorations:{},editor:{},extension:{},HTMLAttributes:{}},setup(e){let i=e,a=(0,t.computed)({get:()=>i.node?.attrs.images||[],set:e=>{i.updateAttributes({images:e})}}),{openFileDialog:o}=qF(i.editor);function s(){i.editor.commands.setNodeSelection(i.getPos()||0)}function c(e){let t=[...a.value];t.splice(e,1),a.value=t}function l(e,t){let n=e.target;if(n.naturalWidth&&n.naturalHeight){let e=n.naturalWidth/n.naturalHeight,r=[...a.value];r[t]={src:n.src,aspectRatio:e},a.value=[...r]}}let u=(0,t.computed)(()=>i.node?.attrs.groupSize||i.extension.options?.groupSize||3),d=(0,t.computed)(()=>i.node?.attrs.layout||`auto`),f=(0,t.computed)(()=>i.node?.attrs.gap),p=(0,t.computed)(()=>a.value.reduce((e,t,n)=>{let r=Math.floor(n/u.value);return e[r]=e[r]||[],e[r].push(t),e},[])),m=(0,t.ref)(null),h=(0,t.ref)(null);function g(e,t){m.value=e,t.dataTransfer&&(t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/html`,String(e))),t.target.classList.add(`opacity-50`)}function _(e){e.target.classList.remove(`opacity-50`),m.value=null,h.value=null}function v(e){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`)}function y(e,t){t.preventDefault(),h.value=e,t.currentTarget.classList.add(`ring-2`,`ring-blue-500`)}function b(e){e.currentTarget.classList.remove(`ring-2`,`ring-blue-500`)}function x(e,t){if(t.preventDefault(),t.stopPropagation(),t.currentTarget.classList.remove(`ring-2`,`ring-blue-500`),m.value===null||m.value===e)return;let n=[...a.value],[r]=n.splice(m.value,1);n.splice(e,0,r),a.value=n,m.value=null,h.value=null}let S=(0,t.ref)(!1);function C(e){let t=e.map(e=>{let t=r.utils.attachment.getUrl(e);if(t)return{src:t,aspectRatio:0}}).filter(Boolean);a.value=[...a.value,...t]}return(i,m)=>{let h=(0,t.resolveComponent)(`AttachmentSelectorModal`),w=(0,t.resolveDirective)(`tooltip`);return(0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(JT),{as:`div`,class:(0,t.normalizeClass)([`mt-2 p-0.5`,{"rounded ring-2":e.selected}]),onClick:s},{default:(0,t.withCtx)(()=>[a.value.length===0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,dI,[(0,t.createVNode)((0,t.unref)(n.VSpace),null,{default:(0,t.withCtx)(()=>[(0,t.unref)(r.utils).permission.has([`uc:attachments:manage`,`system:attachments:manage`])?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VButton),{key:0,onClick:m[0]||=e=>(0,t.unref)(o)()},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.common.button.upload`)),1)]),_:1})):(0,t.createCommentVNode)(``,!0),(0,t.unref)(r.utils).permission.has([`system:attachments:view`,`uc:attachments:manage`],!0)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VButton),{key:1,onClick:m[1]||=e=>S.value=!0},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.upload.attachment.title`)),1)]),_:1})):(0,t.createCommentVNode)(``,!0)]),_:1})])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`relative grid`,style:(0,t.normalizeStyle)({gap:`${f.value}px`})},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(p.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`flex flex-row justify-center`,style:(0,t.normalizeStyle)({gap:`${f.value}px`})},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e,(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n*u.value+r,draggable:`true`,class:(0,t.normalizeClass)([`group/image relative cursor-grab transition-all active:cursor-grabbing`,{"aspect-1":d.value===`square`}]),style:(0,t.normalizeStyle)({flex:`${d.value===`square`?`1`:e.aspectRatio} 1 0%`}),onDragstart:e=>g(n*u.value+r,e),onDragend:m[2]||=e=>_(e),onDragover:m[3]||=e=>v(e),onDragenter:e=>y(n*u.value+r,e),onDragleave:m[4]||=e=>b(e),onDrop:e=>x(n*u.value+r,e)},[(0,t.createElementVNode)(`img`,{src:e.src,alt:`Gallery image ${n*u.value+r+1}`,class:`pointer-events-none block size-full object-cover`,onLoad:e=>l(e,n*u.value+r)},null,40,pI),(0,t.createElementVNode)(`div`,mI,[(0,t.createElementVNode)(`div`,hI,[(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{"aria-label":`Delete`,class:`text-grey-900 group pointer-events-auto relative flex size-8 cursor-pointer items-center justify-center rounded-md bg-white/90 transition-all hover:bg-white hover:text-black active:!bg-white/80`,type:`button`,onClick:(0,t.withModifiers)(e=>c(n*u.value+r),[`stop`])},[(0,t.createVNode)(OE,{class:`size-4`})],8,gI)),[[w,(0,t.unref)(N).global.t(`editor.extensions.upload.operations.remove.button`)]])])])],46,fI))),128))],4))),128))],4)),S.value?((0,t.openBlock)(),(0,t.createBlock)(h,{key:2,accepts:[`image/*`],onSelect:C,onClose:m[5]||=e=>S.value=!1})):(0,t.createCommentVNode)(``,!0)]),_:1},8,[`class`])}}});let vI=K.create({name:`gallery-bubble`,addOptions(){let{parent:e}=this;return{...e?.(),uploadImage:void 0,getBubbleMenu:()=>({extendsKey:yI,items:[{priority:10,component:(0,t.markRaw)(JF),key:`add-image`,props:{icon:(0,t.markRaw)(VF),title:N.global.t(`editor.extensions.gallery.add_image`)}}]})}}}),yI=new V(`galleryBubbleMenu`),bI=q.create({name:`gallery`,group:`block`,atom:!0,draggable:!0,fakeSelection:!0,allowGapCursor:!0,addAttributes(){return{images:{default:[],parseHTML:e=>Array.from(e.querySelectorAll(`img`)).map(e=>({src:e.getAttribute(`src`)||``,aspectRatio:Number(e.getAttribute(`data-aspect-ratio`))||0}))},groupSize:{default:3,parseHTML:e=>Number(e.getAttribute(`data-group-size`))||3},layout:{default:`auto`,parseHTML:e=>e.getAttribute(`data-layout`)||`auto`},gap:{default:8,parseHTML:e=>{let t=Number(e.getAttribute(`data-gap`));return isNaN(t)||t<0?0:t}},file:{default:null,renderHTML(){return{}},parseHTML(){return null}}}},parseHTML(){return[{tag:`div[data-type="gallery"]`}]},renderHTML({node:e}){let t=e.attrs.images||[],n=e.attrs.groupSize||this.options?.groupSize||3,r=e.attrs.layout||`auto`,i=e.attrs.gap||this.options?.gap||0,a=t.reduce((e,t,r)=>{let i=Math.floor(r/n);return e[i]=e[i]||[],e[i].push(t),e},[]).map(e=>[`div`,{"data-type":`gallery-group`,style:`display: flex; flex-direction: row; justify-content: center; gap: ${i}px;`},...e.map(e=>[`div`,{style:`flex: ${r===`square`?`1`:e.aspectRatio} 1 0%;${r===`square`?`aspect-ratio: 1/1;`:``}`,"data-aspect-ratio":e.aspectRatio.toString()},[`img`,{src:e.src,"data-type":`gallery-image`,style:`width: 100%; height: 100%; margin: 0; object-fit: cover;`}]])]);return[`div`,{"data-type":`gallery`,"data-group-size":n.toString(),"data-layout":r,"data-gap":i?.toString()},[`div`,{style:`display: grid; gap: ${i}px;`},...a]]},addCommands(){return{setGallery:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{images:e?.images||[]}})}},addNodeView(){return rE(_I)},addOptions(){return{...this.parent?.(),allowBase64:!1,HTMLAttributes:{},uploadImage:void 0,getToolboxItems({editor:e}){return{priority:15,component:(0,t.markRaw)(NE),props:{editor:e,icon:(0,t.markRaw)(WF),title:N.global.t(`editor.extensions.gallery.title`),action:()=>{e.chain().focus().setGallery({images:[]}).run()}}}},getCommandMenuItems(){return{priority:96,icon:(0,t.markRaw)(WF),title:`editor.extensions.commands_menu.gallery`,keywords:[`gallery`,`hualang`,`tupian`,`images`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setGallery({images:[]}).run()}}},getBubbleMenu(){return{pluginKey:yI,shouldShow:({state:e})=>Qm(e,bI.name),options:{placement:`top-start`},items:[{priority:10,component:(0,t.markRaw)(JF),key:`add-image`,props:{icon:(0,t.markRaw)(VF),title:N.global.t(`editor.extensions.gallery.add_image`)}},{priority:20,component:(0,t.markRaw)(C)},{priority:30,component:(0,t.markRaw)(rI)},{priority:40,component:(0,t.markRaw)(uI)},{priority:50,component:(0,t.markRaw)($F)},{priority:60,props:{icon:(0,t.markRaw)(OE),title:N.global.t(`editor.common.button.delete`),action:({editor:e})=>{cE(bI.name,e)}}}]}}}},addExtensions(){return[...this.parent?.()||[],vI.configure({uploadImage:this.options.uploadImage})]}});var xI=class e extends L{start=!1;constructor(e){super(e,e),this.start=EI(e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):L.near(r)}content(){return I.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`node-gap-cursor`,pos:this.head}}get isStart(){return this.start}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursorSelection.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new SI(this.anchor)}static valid(e){if(e.depth<1)return!1;let t=e.doc.childBefore(e.pos).node;return!t||e.parent.isTextblock||!CI(e)&&!wI(e)||!t.type.spec.allowGapCursor?!1:!t.type.inlineContent}static findGapCursorFrom(t,n,r=!1){let i=!0;for(;i;){if(!r&&e.valid(t))return t;let a=t.pos,o=null;for(let r=t.depth;r>=0;r--){let i=t.node(r),s=n>0?t.indexAfter(r):t.index(r)-1;if(n>0?s<i.childCount:s>=0){o=i.child(s);break}if(r==0)return null;a+=n;let c=t.doc.resolve(a);if(e.valid(c))return c}for(;o;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!z.isSelectable(o)){t=t.doc.resolve(a+o.nodeSize*n),r=!1;break}i=!1;break}o=s,a+=n;let c=t.doc.resolve(a);if(e.valid(c))return c}o||(i=!1)}return null}};xI.prototype.visible=!1,xI.findFrom=xI.findGapCursorFrom,L.jsonID(`node-gap-cursor`,xI);var SI=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return xI.valid(t)?new xI(t):L.near(t)}};function CI(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n===0){if(r.type.spec.isolating)return!0;continue}if(TI(r.child(n-1),!1))return!0}return!0}function wI(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n===r.childCount){if(r.type.spec.isolating)return!0;continue}if(TI(r.child(n),!0))return!0}return!0}function TI(e,t){for(;e;){if(e.childCount===0&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1;e=t?e.firstChild:e.lastChild}return!1}function EI(e){if(e.depth<1)return null;let t=e.start(1),n=e.end(1);return e.pos<t+(n-t)/2}var DI=xI;let OI=K.create({priority:900,name:`gapCursor`,addProseMirrorPlugins(){return[new B({key:new V(`custom-gap-cursor`),props:{decorations:PI,createSelectionBetween(e,t,n){return t.pos==n.pos&&DI.valid(n)?new DI(n):null},handleClick(e,t,n){if(!e||!e.editable)return!1;let r=e.posAtCoords({left:n.clientX,top:n.clientY});if(r&&r.inside>-1)return!1;let i=e.state.doc.resolve(t);return DI.valid(i)?(e.dispatch(e.state.tr.setSelection(new DI(i))),!0):!1},handleKeyDown:Xf({ArrowLeft:jI(`horiz`,-1),ArrowRight:jI(`horiz`,1),ArrowUp:jI(`vert`,-1),ArrowDown:jI(`vert`,1),Enter:(e,t)=>{let n=NI(e,!1);return n&&t?(t(n),!0):!1},Backspace:(e,t)=>{let{selection:n,tr:r}=e;if(n instanceof R&&Qm(e,`paragraph`)&&hE(n.$from.parent)&&n.empty){let{$from:i}=n;return i.before(i.depth)===0?!0:(sE(i)(r),t&&MI(-1,`left`,e)(r)?(t(r),!0):!1)}if(!(n instanceof DI)||!t)return!1;let{isStart:i,$from:a}=n,o=e.doc.childBefore(a.pos);if(!o||o.index===void 0)return!1;let s=o.index,c=e.doc.resolve(0).posAtIndex(s);return i?kI(c,e,t):o.node&&sE(e.doc.resolve(c))(r)?(t(r),!0):!1},Tab:(e,t)=>{let n=NI(e);return n&&t?(t(n),!0):!1}}),handleTextInput(e){let{state:t,dispatch:n}=e,r=NI(t);return r&&n&&n(r),!1},handleDOMEvents:{beforeinput:(e,t)=>{let{state:n,dispatch:r}=e;if(t.inputType!=`insertCompositionText`||!(n.selection instanceof DI))return!1;let i=NI(n);return i&&r&&r(i),!1}}}})]},extendNodeSchema(e){return{allowGapCursor:W(U(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}});function kI(e,t,n){let{tr:r}=t;if(e==0)return!1;let i=t.doc.resolve(e-1),a=i.parent;return a.inlineContent||a.isTextblock?AI(i,t,n):DI.valid(i)&&n?(n(r.setSelection(new DI(i))),!0):sE(i)(r)&&n?(n(r),!0):!1}function AI(e,t,n){return e.parentOffset==0&&e.pos>1&&n?(n(t.tr.delete(e.pos-1,e.pos)),!0):(n&&n(t.tr.setSelection(R.create(t.doc,e.pos))),!0)}function jI(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return(e,r,i)=>{let{tr:a}=e;return MI(t,n,e,i)(a)&&r?(r(a),!0):!1}}var MI=(e,t,n,r)=>i=>{let a=n.selection,o=e>0?a.$to:a.$from,s=a.empty;if(a instanceof R){if(o.depth==0||r&&!r.endOfTextblock(t))return;if(s=!1,o=n.doc.resolve(e>0?o.after():o.before()),o.depth>0){let e=o.pos,t=o.start(1)+1,n=o.end(1)-1;if(e!=t&&e!=n)return}}if(a instanceof DI)return;let c=DI.findGapCursorFrom(o,e,s);if(c)return i.setSelection(new DI(c)),c};function NI(e,t=!0){let{tr:n}=e;if(!(e.selection instanceof DI))return;let{isStart:r,$from:i}=e.selection;if(e.selection instanceof Zo||i.parent.inlineContent)return;let a=e.doc.resolve(0),o=e.doc.childBefore(i.pos),s=r?o.index:o.index+1,c=a.posAtIndex(s);return n.insert(c,e.schema.nodes.paragraph.create()),(t||!r)&&(n.setSelection(R.create(n.doc,c+1)),n.scrollIntoView()),n}function PI(e){if(!(e.selection instanceof DI))return null;let t=e.selection.$head;if(t.depth<1)return null;let n=t.node(1),r=t.start(1)-1,i=e.selection.isStart;return H.create(e.doc,[Wd.node(r,r+n.nodeSize,{key:`node-gap-cursor`,class:`card-gap-cursor ${i?`start`:`end`}-card-gap-cursor`})])}var FI=q.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,G(this.options.HTMLAttributes,e)]},renderText(){return`
167
+ `},renderMarkdown:()=>`
168
+ `,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),II=q.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(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,G(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>mg({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),LI={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function RI(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,LI,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 12h8m-8 6V6m8 12V6m5 6l3-2v8`},null,-1)]])}var zI=(0,t.markRaw)({name:`lucide-heading-1`,render:RI}),BI={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function VI(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,BI,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 12h8m-8 6V6m8 12V6m9 12h-4c0-4 4-3 4-6c0-1.5-2-2.5-4-1`},null,-1)]])}var HI=(0,t.markRaw)({name:`lucide-heading-2`,render:VI}),UI={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function WI(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,UI,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 12h8m-8 6V6m8 12V6m5.5 4.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2m-2 3.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`},null,-1)]])}var GI=(0,t.markRaw)({name:`lucide-heading-3`,render:WI}),KI={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function qI(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,KI,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 18V6m5 4v3a1 1 0 0 0 1 1h3m0-4v8M4 12h8m-8 6V6`},null,-1)]])}var JI=(0,t.markRaw)({name:`lucide-heading-4`,render:qI}),YI={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function XI(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,YI,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 12h8m-8 6V6m8 12V6m5 7v-3h4m-4 7.7c.4.2.8.3 1.3.3c1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17`},null,-1)]])}var ZI=(0,t.markRaw)({name:`lucide-heading-5`,render:XI}),QI={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function $I(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,QI,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,t.createElementVNode)(`path`,{d:`M4 12h8m-8 6V6m8 12V6`}),(0,t.createElementVNode)(`circle`,{cx:`19`,cy:`16`,r:`2`}),(0,t.createElementVNode)(`path`,{d:`M20 10c-2 2-3 3.5-3 6`})],-1)]])}var eL=(0,t.markRaw)({name:`lucide-heading-6`,render:$I}),tL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function nL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,tL,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M18 3a1 1 0 0 1 .117 1.993L18 5h-1v14h1a1 1 0 0 1 .117 1.993L18 21h-8a1 1 0 0 1-.117-1.993L10 19h1v-5H9.5a5.5 5.5 0 0 1-.221-10.996L9.5 3zm-3 2h-2v14h2zm-4 0H9.5a3.5 3.5 0 0 0-.192 6.995L9.5 12H11z`})],-1)]])}var rL=(0,t.markRaw)({name:`mingcute-paragraph-line`,render:nL});let iL=II.extend({renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,G(this.options.HTMLAttributes,t),0]},addAttributes(){return{...this.parent?.(),id:{default:null}}},addOptions(){return{...this.parent(),getToolbarItems({editor:e}){return{priority:30,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(hF.name)||e.isActive(II.name),icon:(0,t.markRaw)(aL(e)),title:N.global.t(`editor.common.heading.title`)},children:[{priority:10,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive(hF.name),icon:(0,t.markRaw)(rL),title:N.global.t(`editor.common.heading.paragraph`),action:()=>e.chain().focus().setParagraph().run()}},{priority:20,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive(II.name,{level:1}),icon:(0,t.markRaw)(zI),title:N.global.t(`editor.common.heading.heading1`),action:()=>e.chain().focus().toggleHeading({level:1}).run()}},{priority:30,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive(II.name,{level:2}),icon:(0,t.markRaw)(HI),title:N.global.t(`editor.common.heading.heading2`),action:()=>e.chain().focus().toggleHeading({level:2}).run()}},{priority:40,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive(II.name,{level:3}),icon:(0,t.markRaw)(GI),title:N.global.t(`editor.common.heading.heading3`),action:()=>e.chain().focus().toggleHeading({level:3}).run()}},{priority:50,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive(II.name,{level:4}),icon:(0,t.markRaw)(JI),title:N.global.t(`editor.common.heading.heading4`),action:()=>e.chain().focus().toggleHeading({level:4}).run()}},{priority:60,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive(II.name,{level:5}),icon:(0,t.markRaw)(ZI),title:N.global.t(`editor.common.heading.heading5`),action:()=>e.chain().focus().toggleHeading({level:5}).run()}},{priority:70,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive(II.name,{level:6}),icon:(0,t.markRaw)(eL),title:N.global.t(`editor.common.heading.heading6`),action:()=>e.chain().focus().toggleHeading({level:6}).run()}}]}},getCommandMenuItems(){return[{priority:10,icon:(0,t.markRaw)(rL),title:`editor.common.heading.paragraph`,keywords:[`paragraph`,`text`,`putongwenben`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setParagraph().run()}},{priority:20,icon:(0,t.markRaw)(zI),title:`editor.common.heading.heading1`,keywords:[`h1`,`heading1`,`1`,`yijibiaoti`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode(II.name,{level:1}).run()}},{priority:30,icon:(0,t.markRaw)(HI),title:`editor.common.heading.heading2`,keywords:[`h2`,`heading2`,`2`,`erjibiaoti`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode(II.name,{level:2}).run()}},{priority:40,icon:(0,t.markRaw)(GI),title:`editor.common.heading.heading3`,keywords:[`h3`,`heading3`,`3`,`sanjibiaoti`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode(II.name,{level:3}).run()}},{priority:50,icon:(0,t.markRaw)(JI),title:`editor.common.heading.heading4`,keywords:[`h4`,`heading4`,`4`,`sijibiaoti`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode(II.name,{level:4}).run()}},{priority:60,icon:(0,t.markRaw)(ZI),title:`editor.common.heading.heading5`,keywords:[`h5`,`heading5`,`5`,`wujibiaoti`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode(II.name,{level:5}).run()}},{priority:70,icon:(0,t.markRaw)(eL),title:`editor.common.heading.heading6`,keywords:[`h6`,`heading6`,`6`,`liujibiaoti`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode(II.name,{level:6}).run()}}]},getDraggableMenuItems(){return{extendsKey:VK,children:{items:[{priority:10,icon:(0,t.markRaw)(rL),title:N.global.t(`editor.common.heading.paragraph`),action:({editor:e})=>e.chain().focus().setParagraph().run()},{priority:20,icon:(0,t.markRaw)(zI),title:N.global.t(`editor.common.heading.heading1`),action:({editor:e})=>e.chain().focus().setHeading({level:1}).run()},{priority:30,icon:(0,t.markRaw)(HI),title:N.global.t(`editor.common.heading.heading2`),action:({editor:e})=>e.chain().focus().setHeading({level:2}).run()},{priority:40,icon:(0,t.markRaw)(GI),title:N.global.t(`editor.common.heading.heading3`),action:({editor:e})=>e.chain().focus().setHeading({level:3}).run()},{priority:50,icon:(0,t.markRaw)(JI),title:N.global.t(`editor.common.heading.heading4`),action:({editor:e})=>e.chain().focus().setHeading({level:4}).run()},{priority:60,icon:(0,t.markRaw)(ZI),title:N.global.t(`editor.common.heading.heading5`),action:({editor:e})=>e.chain().focus().setHeading({level:5}).run()},{priority:70,icon:(0,t.markRaw)(eL),title:N.global.t(`editor.common.heading.heading6`),action:({editor:e})=>e.chain().focus().setHeading({level:6}).run()}]}}}}},addProseMirrorPlugins(){let e;return[new B({key:new V(`generate-heading-id`),appendTransaction:(t,n,r)=>{if(t.some(t=>{let n=this.editor.view.composing;if(e!==void 0&&!n)return e=void 0,!0;if(t.docChanged){if(t.getMeta(`paste`))return!0;e=n;let{$from:r}=t.selection;return r.parent.type.name===iL.name&&!n}return!1})){let e=r.tr,t=[];return r.doc.descendants((n,r)=>{if(n.type.name===iL.name){let i=ci(n.textContent,t);e.step(new Vo(r,`id`,i)),t.push(i)}}),e}}})]}});function aL(e){return e.isActive(hF.name)?rL:e.isActive(iL.name,{level:1})?zI:e.isActive(iL.name,{level:2})?HI:e.isActive(iL.name,{level:3})?GI:e.isActive(iL.name,{level:4})?JI:e.isActive(iL.name,{level:5})?ZI:e.isActive(iL.name,{level:6})?eL:rL}var oL=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,sL=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,cL=Vh.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,G(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[fg({find:oL,type:this.type})]},addPasteRules(){return[Lg({find:sL,type:this.type})]}}),lL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function uL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,lL,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m2.153 13H9.847l-.743 4.46A8 8 0 0 0 12 20c.894 0 1.753-.147 2.556-.417l.34-.123zM12 4a8 8 0 0 0-4.753 14.436l.627-3.765A2 2 0 0 1 9 13.188v-3.182c0-.382.216-.732.558-.903l3.98-1.99A1.01 1.01 0 0 1 15 8.016v5.172a2 2 0 0 1 1.126 1.483l.627 3.765A8 8 0 0 0 12 4m1 5.618l-2 1V13h2z`})],-1)]])}var dL=(0,t.markRaw)({name:`mingcute-mark-pen-line`,render:uL}),fL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function pL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,fL,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`m12 13.414l5.657 5.657a1 1 0 0 0 1.414-1.414L13.414 12l5.657-5.657a1 1 0 0 0-1.414-1.414L12 10.586L6.343 4.929A1 1 0 0 0 4.93 6.343L10.586 12l-5.657 5.657a1 1 0 1 0 1.414 1.414z`})],-1)]])}var mL=(0,t.markRaw)({name:`mingcute-close-line`,render:pL}),hL={class:`p-1`},gL={class:`inline-flex items-center gap-2`},_L={class:`p-1`},vL={class:`text-xs text-gray-600`},yL=(0,t.defineComponent)({__name:`HighlightToolbarItem`,props:{editor:{},isActive:{type:Boolean},disabled:{type:Boolean},icon:{},title:{},action:{type:Function},children:{}},setup(e){let n=e;function r(e){n.editor?.isActive(bL.name)&&n.editor?.chain().focus().unsetHighlight().run(),n.editor?.chain().focus().setHighlight(e?{color:e}:void 0).run()}function i(){n.editor?.chain().focus().unsetHighlight().run()}return(e,a)=>((0,t.openBlock)(),(0,t.createBlock)(nM,{"onUpdate:modelValue":r},{prefix:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,hL,[(0,t.createElementVNode)(`div`,{class:`flex cursor-pointer items-center gap-2 rounded p-1 text-xs text-gray-600 hover:bg-gray-100 hover:text-gray-900`,onClick:i},[(0,t.createElementVNode)(`div`,gL,[(0,t.createVNode)((0,t.unref)(mL)),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.highlight.unset`)),1)])])]),(0,t.createElementVNode)(`div`,_L,[(0,t.createElementVNode)(`div`,{class:`flex cursor-pointer items-center gap-2 rounded p-1 hover:bg-gray-100`,onClick:a[1]||=e=>r()},[a[2]||=(0,t.createElementVNode)(`div`,{class:`size-5 cursor-pointer rounded-sm ring-gray-300 ring-offset-1 hover:ring-1`,style:{"background-color":`#fff8c5`}},null,-1),(0,t.createElementVNode)(`span`,vL,(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.common.button.restore_default`)),1)])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(E),(0,t.mergeProps)(n,{onClick:a[0]||=e=>r()}),null,16)]),_:1}))}});let bL=cL.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:80,component:(0,t.markRaw)(yL),props:{editor:e,isActive:e.isActive(cL.name),icon:(0,t.markRaw)(dL),title:N.global.t(`editor.common.highlight`)}}}}}}).configure({multicolor:!0});var xL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function SL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,xL,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M10.5 7A6.5 6.5 0 0 0 4 13.5a6.5 6.5 0 0 0 6.5 6.5H14v-2h-3.5C8 18 6 16 6 13.5S8 9 10.5 9h5.67l-3.08 3.09l1.41 1.41L20 8l-5.5-5.5l-1.42 1.41L16.17 7zM18 18h-2v2h2z`},null,-1)]])}var CL=(0,t.markRaw)({name:`mdi-redo-variant`,render:SL}),wL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function TL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,wL,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M13.5 7a6.5 6.5 0 0 1 6.5 6.5a6.5 6.5 0 0 1-6.5 6.5H10v-2h3.5c2.5 0 4.5-2 4.5-4.5S16 9 13.5 9H7.83l3.08 3.09L9.5 13.5L4 8l5.5-5.5l1.42 1.41L7.83 7zM6 18h2v2H6z`},null,-1)]])}var EL=(0,t.markRaw)({name:`mdi-undo-variant`,render:TL});let DL=pk.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return[{priority:10,component:(0,t.markRaw)(E),props:{editor:e,isActive:!1,icon:(0,t.markRaw)(EL),title:N.global.t(`editor.menus.undo`),action:()=>e.chain().undo().focus().run()}},{priority:20,component:(0,t.markRaw)(E),props:{editor:e,isActive:!1,icon:(0,t.markRaw)(CL),title:N.global.t(`editor.menus.redo`),action:()=>e.chain().redo().focus().run()}}]}}}});var OL=q.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,G(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!xg(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return ih(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(R.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(z.create(t.doc,n.pos)):t.setSelection(R.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(R.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[pg({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),kL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function AL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,kL,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M3 21V3h18v18zM5 5v14h14V5z`},null,-1)]])}var jL=(0,t.markRaw)({name:`mdi-border-all-variant`,render:AL}),ML={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function NL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,ML,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M15 5h2V3h-2m0 18h2v-2h-2M11 5h2V3h-2m8 2h2V3h-2m0 6h2V7h-2m0 14h2v-2h-2m0-6h2v-2h-2m0 6h2v-2h-2M3 5h2V3H3m0 6h2V7H3m0 6h2v-2H3m0 6h2v-2H3m0 6h2v-2H3m8 2h2v-2h-2m-4 2h2v-2H7M7 5h2V3H7z`},null,-1)]])}var PL=(0,t.markRaw)({name:`mdi-border-none-variant`,render:NL}),FL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function IL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,FL,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M16.36 14c.08-.66.14-1.32.14-2s-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2m-5.15 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95a8.03 8.03 0 0 1-4.33 3.56M14.34 14H9.66c-.1-.66-.16-1.32-.16-2s.06-1.35.16-2h4.68c.09.65.16 1.32.16 2s-.07 1.34-.16 2M12 19.96c-.83-1.2-1.5-2.53-1.91-3.96h3.82c-.41 1.43-1.08 2.76-1.91 3.96M8 8H5.08A7.92 7.92 0 0 1 9.4 4.44C8.8 5.55 8.35 6.75 8 8m-2.92 8H8c.35 1.25.8 2.45 1.4 3.56A8 8 0 0 1 5.08 16m-.82-2C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2s.06 1.34.14 2M12 4.03c.83 1.2 1.5 2.54 1.91 3.97h-3.82c.41-1.43 1.08-2.77 1.91-3.97M18.92 8h-2.95a15.7 15.7 0 0 0-1.38-3.56c1.84.63 3.37 1.9 4.33 3.56M12 2C6.47 2 2 6.5 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2`},null,-1)]])}var LL=(0,t.markRaw)({name:`mdi-web`,render:IL}),RL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function zL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,RL,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M16.5 11.74c0-.59-.07-1.16-.14-1.74h3.38c.08.33.15.67.19 1c.72.07 1.41.23 2.07.5C21.71 6.21 17.35 2 12 2C6.47 2 2 6.5 2 12s4.5 10 10 10c.87 0 1.71-.12 2.5-.33a6.6 6.6 0 0 1-1.46-3.47c-.31.61-.65 1.2-1.04 1.76c-.83-1.2-1.5-2.53-1.91-3.96h3.09c.17-.72.46-1.39.85-2H9.66c-.1-.66-.16-1.32-.16-2s.06-1.35.16-2h4.68c.09.65.16 1.32.16 2c0 .5-.04 1-.1 1.5a6.4 6.4 0 0 1 2.1-1.76M4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2s.06 1.34.14 2zm.82 2H8c.35 1.25.8 2.45 1.4 3.56A8 8 0 0 1 5.08 16M8 8H5.08A7.92 7.92 0 0 1 9.4 4.44C8.8 5.55 8.35 6.75 8 8m2.09 0c.41-1.43 1.08-2.77 1.91-3.97c.83 1.2 1.5 2.54 1.91 3.97zm8.83 0h-2.95a15.7 15.7 0 0 0-1.38-3.56c1.84.63 3.37 1.9 4.33 3.56M23 17.5c0 .82-.25 1.58-.67 2.21l-1.09-1.09c.17-.34.26-.72.26-1.12A2.5 2.5 0 0 0 19 15v1.5l-2.25-2.25L19 12v1.5c2.21 0 4 1.79 4 4m-4 1l2.25 2.25L19 23v-1.5c-2.21 0-4-1.79-4-4c0-.82.25-1.58.67-2.21l1.09 1.09c-.17.34-.26.72-.26 1.12A2.5 2.5 0 0 0 19 20z`},null,-1)]])}var BL=(0,t.markRaw)({name:`mdi-web-sync`,render:zL}),VL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function HL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,VL,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M4 3a1 1 0 0 0 0 2h16a1 1 0 1 0 0-2zm0 5a1 1 0 0 0 0 2h16a1 1 0 1 0 0-2zm-1 6a1 1 0 0 1 1-1h16a1 1 0 1 1 0 2H4a1 1 0 0 1-1-1m1 4a1 1 0 1 0 0 2h16a1 1 0 1 0 0-2z`})],-1)]])}var UL=(0,t.markRaw)({name:`mingcute-align-justify-line`,render:HL}),WL={class:`relative max-h-72 w-56 overflow-hidden overflow-y-auto`},GL=(0,t.defineComponent)({__name:`BubbleItemIframeAlign`,props:{editor:{},isActive:{},visible:{type:Function,default:()=>!0},icon:{},iconStyle:{},title:{},action:{}},setup(e){let r=e,i=[{text:N.global.t(`editor.common.align_left`),value:`left`,icon:cO},{text:N.global.t(`editor.common.align_center`),value:`center`,icon:aO},{text:N.global.t(`editor.common.align_right`),value:`right`,icon:dO},{text:N.global.t(`editor.common.align_justify`),value:`justify`,icon:UL}],a=(0,t.computed)(()=>{let e=r.editor.getAttributes(hF.name).textAlign;return i.find(t=>t.value===e)||i[0]}),o=e=>{r.editor.chain().focus().setTextAlign(e).run()};return(r,s)=>{let c=(0,t.resolveDirective)(`close-popper`);return e.visible({editor:e.editor})?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VDropdown),{key:0,class:`inline-flex`,"auto-hide":!0,distance:10},{popper:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,WL,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(i,n=>(0,t.withDirectives)((0,t.createVNode)(ae,{key:n.value,"is-active":e.editor.isActive({textAlign:n.value}),onClick:e=>o(n.value)},{icon:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.icon)))]),default:(0,t.withCtx)(()=>[(0,t.createTextVNode)(` `+(0,t.toDisplayString)(n.text),1)]),_:2},1032,[`is-active`,`onClick`]),[[c]])),64))])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(nO,{title:(0,t.unref)(N).global.t(`editor.common.align_method`),"show-more-indicator":``},{icon:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(a.value.icon)))]),_:1},8,[`title`])]),_:1})):(0,t.createCommentVNode)(``,!0)}}}),KL={class:`w-80`},qL=(0,t.defineComponent)({__name:`BubbleItemIframeLink`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},setup(e){let n=e,r=(0,t.computed)({get:()=>n.editor.getAttributes(hR.name).src,set:e=>{!e||!pE(e)||n.editor.chain().updateAttributes(hR.name,{src:e}).run()}});return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,KL,[(0,t.createVNode)(DD,{modelValue:r.value,"onUpdate:modelValue":n[0]||=e=>r.value=e,"auto-focus":``,placeholder:(0,t.unref)(N).global.t(`editor.common.placeholder.link_input`),label:(0,t.unref)(N).global.t(`editor.extensions.iframe.src_input_label`)},null,8,[`modelValue`,`placeholder`,`label`])]))}}),JL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function YL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,JL,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M23 15h-2v2h2zm0-4h-2v2h2zm0 8h-2v2c1 0 2-1 2-2M15 3h-2v2h2zm8 4h-2v2h2zm-2-4v2h2c0-1-1-2-2-2M3 21h8v-6H1v4a2 2 0 0 0 2 2M3 7H1v2h2zm12 12h-2v2h2zm4-16h-2v2h2zm0 16h-2v2h2zM3 3C2 3 1 4 1 5h2zm0 8H1v2h2zm8-8H9v2h2zM7 3H5v2h2z`},null,-1)]])}var XL=(0,t.markRaw)({name:`mdi-image-size-select-small`,render:YL}),ZL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function QL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,ZL,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M17 2a2 2 0 0 1 1.995 1.85L19 4v16a2 2 0 0 1-1.85 1.995L17 22H7a2 2 0 0 1-1.995-1.85L5 20V4a2 2 0 0 1 1.85-1.995L7 2zm0 2H7v16h10zm-4.5 12a.5.5 0 0 1 .492.41l.008.09v1a.5.5 0 0 1-.41.492L12.5 18h-1a.5.5 0 0 1-.492-.41L11 17.5v-1a.5.5 0 0 1 .41-.492L11.5 16z`})],-1)]])}var $L=(0,t.markRaw)({name:`mingcute-cellphone-line`,render:QL}),eR={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function tR(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,eR,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,"fill-rule":`nonzero`,d:`M19 3a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-3.968c.038.545.105.962.18 1.28l.065.247l.066.202l.032.085l.062.141l.055.105l.045.072l.042.056c.446.344.424.86.34 1.116c-.087.262-.382.696-.961.696H9.042c-.579 0-.874-.434-.96-.696c-.085-.256-.107-.772.339-1.116l.043-.056l.045-.072l.054-.105l.062-.14c.128-.321.278-.881.343-1.815H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm-5.971 14H10.97a10 10 0 0 1-.252 1.798l-.052.202h2.666a9 9 0 0 1-.283-1.699zM19 14H5v1h14zm0-9H5v7h14z`})],-1)]])}var nR=(0,t.markRaw)({name:`mingcute-imac-line`,render:tR}),rR={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function iR(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,rR,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M18 2a2 2 0 0 1 1.995 1.85L20 4v16a2 2 0 0 1-1.85 1.995L18 22H6a2 2 0 0 1-1.995-1.85L4 20V4a2 2 0 0 1 1.85-1.995L6 2zm0 2H6v16h12zm-5.5 12a.5.5 0 0 1 .492.41l.008.09v1a.5.5 0 0 1-.41.492L12.5 18h-1a.5.5 0 0 1-.492-.41L11 17.5v-1a.5.5 0 0 1 .41-.492L11.5 16z`})],-1)]])}var aR=(0,t.markRaw)({name:`mingcute-pad-line`,render:iR}),oR={class:`flex w-56 flex-col gap-3`},sR={class:`flex flex-col items-center gap-3`},cR={class:`flex items-center gap-1 rounded-md bg-gray-100 p-1`},lR=[`onClick`],uR=(0,t.defineComponent)({__name:`BubbleItemIframeSize`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},setup(e){let r=e,i=(0,t.computed)({get:()=>r.editor.getAttributes(hR.name).width,set:e=>{o(e,a.value)}}),a=(0,t.computed)({get:()=>r.editor.getAttributes(hR.name).height,set:e=>{o(i.value,e)}}),o=(e,t)=>{r.editor.chain().updateAttributes(hR.name,{width:e,height:t}).focus().setNodeSelection(r.editor.state.selection.from).run()},s=[{width:`390px`,height:`844px`,icon:$L,title:N.global.t(`editor.extensions.iframe.phone_size`)},{width:`834px`,height:`1194px`,icon:aR,title:N.global.t(`editor.extensions.iframe.tablet_vertical_size`)},{width:`1194px`,height:`834px`,icon:aR,iconStyle:`transform: rotate(90deg)`,title:N.global.t(`editor.extensions.iframe.tablet_horizontal_size`)},{width:`100%`,height:`834px`,icon:nR,title:N.global.t(`editor.extensions.iframe.desktop_size`)}];return(e,r)=>{let c=(0,t.resolveDirective)(`tooltip`);return(0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VDropdown),{class:`inline-flex`,"auto-hide":!0,distance:10},{popper:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,oR,[(0,t.createElementVNode)(`div`,sR,[(0,t.createVNode)(DD,{modelValue:i.value,"onUpdate:modelValue":r[0]||=e=>i.value=e,label:(0,t.unref)(N).global.t(`editor.common.width`),tooltip:(0,t.unref)(N).global.t(`editor.common.tooltip.custom_width_input`)},null,8,[`modelValue`,`label`,`tooltip`]),(0,t.createVNode)(DD,{modelValue:a.value,"onUpdate:modelValue":r[1]||=e=>a.value=e,label:(0,t.unref)(N).global.t(`editor.common.height`),tooltip:(0,t.unref)(N).global.t(`editor.common.tooltip.custom_height_input`)},null,8,[`modelValue`,`label`,`tooltip`])]),(0,t.createElementVNode)(`div`,cR,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s,e=>(0,t.withDirectives)((0,t.createElementVNode)(`button`,{key:e.width,class:(0,t.normalizeClass)([`inline-flex flex-1 items-center justify-center rounded px-2 py-1.5 text-gray-600 transition-all hover:text-gray-900`,{"bg-white text-gray-900":e.width===i.value&&e.height===a.value}]),onClick:t=>o(e.width,e.height)},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon),{style:(0,t.normalizeStyle)(e.iconStyle)},null,8,[`style`]))],10,lR),[[c,e.title]])),64))])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(nO,{title:(0,t.unref)(N).global.t(`editor.extensions.iframe.resize`),"show-more-indicator":``},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(XL))]),_:1},8,[`title`])]),_:1})}}}),dR={key:0,class:`p-1.5`},fR=[`src`,`width`,`height`,`frameborder`],pR=(0,t.defineComponent)({__name:`IframeView`,props:{decorations:{},selected:{type:Boolean},updateAttributes:{type:Function},deleteNode:{type:Function},node:{},view:{},getPos:{},innerDecorations:{},editor:{},extension:{},HTMLAttributes:{}},setup(e){let n=e,r=(0,t.computed)({get:()=>n.node?.attrs.src,set:e=>{!e||!pE(e)||n.updateAttributes({src:e})}}),i=(0,t.computed)(()=>n.node.attrs.frameborder);function a(){n.editor.commands.setNodeSelection(n.getPos()||0)}return(n,o)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(JT),{as:`div`,class:`inline-block w-full`},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{class:`relative inline-block h-full max-w-full overflow-hidden text-center transition-all`,style:(0,t.normalizeStyle)({width:e.node.attrs.width})},[r.value?((0,t.openBlock)(),(0,t.createElementBlock)(`iframe`,{key:1,class:(0,t.normalizeClass)([`rounded-md`,{"border-2":i.value===`1`}]),src:e.node.attrs.src,width:e.node.attrs.width,height:e.node.attrs.height,scrolling:`yes`,frameborder:i.value,framespacing:`0`,allowfullscreen:`true`,onMouseenter:a},null,42,fR)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,dR,[(0,t.createVNode)(DD,{ref:`inputRef`,modelValue:r.value,"onUpdate:modelValue":o[0]||=e=>r.value=e,modelModifiers:{lazy:!0},placeholder:(0,t.unref)(N).global.t(`editor.common.placeholder.link_input`),tabindex:`-1`,"auto-focus":``,onFocus:a},null,8,[`modelValue`,`placeholder`])]))],4)]),_:1}))}});let mR=new V(`iframeBubbleMenu`),hR=q.create({name:`iframe`,fakeSelection:!0,inline(){return!0},group(){return`inline`},addAttributes(){return{...this.parent?.(),src:{default:null,parseHTML:e=>e.getAttribute(`src`)},width:{default:`100%`,parseHTML:e=>e.getAttribute(`width`),renderHTML(e){return{width:e.width}}},height:{default:`300px`,parseHTML:e=>e.getAttribute(`height`),renderHTML:e=>({height:e.height})},scrolling:{default:null,parseHTML:e=>e.getAttribute(`scrolling`),renderHTML:e=>({scrolling:e.scrolling})},frameborder:{default:`0`,parseHTML:e=>e.getAttribute(`frameborder`),renderHTML:e=>({frameborder:e.frameborder})},allowfullscreen:{default:!0,parseHTML:e=>e.getAttribute(`allowfullscreen`),renderHTML:e=>({allowfullscreen:e.allowfullscreen})},framespacing:{default:0,parseHTML:e=>{let t=e.getAttribute(`framespacing`);return t?parseInt(t,10):null},renderHTML:e=>({framespacing:e.framespacing})},style:{renderHTML(){return{style:`display: inline-block`}}}}},parseHTML(){return[{tag:`iframe`,getAttrs:e=>{let t=e.getAttribute(`src`);return!t||!pE(t)?!1:{src:t}}}]},renderHTML({HTMLAttributes:e}){return pE(e.src)?[`iframe`,G(e)]:[`iframe`,G({...e,src:``})]},addCommands(){return{setIframe:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[pg({find:/^\$iframe\$$/,type:this.type,getAttributes:()=>({width:`100%`})})]},addPasteRules(){return[Rg({find:/<iframe.*?src="(.*?)".*?<\/iframe>/g,type:this.type,getAttributes:e=>{let t=document.createRange().createContextualFragment(e[0]).querySelector(`iframe`);if(t)return{src:t.src,width:t.width||`100%`,height:t.height||`300px`}}})]},addNodeView(){return rE(pR)},addOptions(){return{getCommandMenuItems(){return{priority:90,icon:(0,t.markRaw)(LL),title:`editor.extensions.commands_menu.iframe`,keywords:[`iframe`,`qianruwangye`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).insertContent([{type:`iframe`,attrs:{src:``}}]).run()}}},getToolboxItems({editor:e}){return[{priority:50,component:(0,t.markRaw)(NE),props:{editor:e,icon:(0,t.markRaw)(LL),title:N.global.t(`editor.extensions.commands_menu.iframe`),action:()=>{e.chain().focus().insertContent([{type:`iframe`,attrs:{src:``}}]).run()}}}]},getBubbleMenu({editor:e}){return{pluginKey:mR,shouldShow:({state:e})=>Qm(e,hR.name),items:[{priority:10,props:{isActive:()=>e.getAttributes(hR.name).frameborder===`1`,icon:(0,t.markRaw)(e.getAttributes(hR.name).frameborder===`1`?jL:PL),action:()=>{e.chain().updateAttributes(hR.name,{frameborder:e.getAttributes(hR.name).frameborder===`1`?`0`:`1`}).focus().setNodeSelection(e.state.selection.from).run()},title:e.getAttributes(hR.name).frameborder===`1`?N.global.t(`editor.extensions.iframe.disable_frameborder`):N.global.t(`editor.extensions.iframe.enable_frameborder`)}},{priority:20,component:(0,t.markRaw)(C)},{priority:30,component:(0,t.markRaw)(uR)},{priority:40,component:(0,t.markRaw)(GL)},{priority:50,component:(0,t.markRaw)(C)},{priority:60,props:{icon:(0,t.markRaw)(BL),action:()=>{e.chain().updateAttributes(hR.name,{src:e.getAttributes(hR.name).src}).run()}}},{priority:70,props:{icon:(0,t.markRaw)(rD),title:N.global.t(`editor.common.button.edit_link`),action:()=>(0,t.markRaw)(qL)}},{priority:80,props:{icon:(0,t.markRaw)(lD),title:N.global.t(`editor.common.tooltip.open_link`),action:()=>{window.open(e.getAttributes(hR.name).src,`_blank`)}}},{priority:90,props:{icon:(0,t.markRaw)(OE),title:N.global.t(`editor.common.button.delete`),action:({editor:e})=>{cE(hR.name,e)}}}]}}}}});var gR=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,_R=q.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},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},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,G(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?`![${n}](${t} "${r}")`:`![${n}](${t})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`||!this.editor.isEditable)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:o})=>{let s=document.createElement(`img`);Object.entries(o).forEach(([e,t])=>{if(t!=null)switch(e){case`width`:case`height`:break;default:s.setAttribute(e,t);break}}),s.src=o.src;let c=new yg({element:s,node:i,getPos:a,onResize:(e,t)=>{s.style.width=`${e}px`,s.style.height=`${t}px`},onCommit:(e,t)=>{let n=a();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),l=c.dom;return l.style.visibility=`hidden`,l.style.pointerEvents=`none`,s.onload=()=>{l.style.visibility=``,l.style.pointerEvents=``},c}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[pg({find:gR,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),vR={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function yR(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,vR,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M5 5a3 3 0 0 1 3-3h8a3 3 0 0 1 3 3v6a1 1 0 1 1-2 0V5a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v14.131l4.168-2.778a1.5 1.5 0 0 1 1.664 0l.723.482a1 1 0 0 1-1.11 1.664L12 18.202l-4.668 3.112C6.335 21.978 5 21.264 5 20.066zm13.677 10.034a2.5 2.5 0 1 1 3.535 3.535l-3.417 3.418a1.5 1.5 0 0 1-.849.424l-2.309.33a1 1 0 0 1-1.132-1.133l.33-2.308a1.5 1.5 0 0 1 .424-.849zm2.121 1.414a.5.5 0 0 0-.707 0l-3.3 3.3l-.118.825l.825-.118l3.3-3.3a.5.5 0 0 0 0-.707`})],-1)]])}var bR=(0,t.markRaw)({name:`mingcute-bookmark-edit-line`,render:yR}),xR={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function SR(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,xR,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M5 2a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h3v-2H5V4h12v4h2V4a2 2 0 0 0-2-2zm3 5a1 1 0 0 0 0 2h4a1 1 0 1 0 0-2zm7.949 3.811a3 3 0 0 1 4.242 4.243l-5.656 5.657a1 1 0 0 1-.707.293h-2.829a1 1 0 0 1-1-1v-2.829a1 1 0 0 1 .293-.707zm2.828 1.414a1 1 0 0 0-1.414 0l1.414 1.415a1 1 0 0 0 0-1.415m-1.414 2.829l-1.414-1.414l-3.95 3.95v1.414h1.414z`})],-1)]])}var CR=(0,t.markRaw)({name:`mingcute-edit-4-line`,render:SR}),wR={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function TR(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,wR,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M16.243 9.878a1 1 0 0 1 1.32-.083l.094.083L19.778 12a5.5 5.5 0 0 1-7.596 7.952L12 19.778l-2.121-2.121a1 1 0 0 1 1.32-1.498l.094.083l2.121 2.122a3.5 3.5 0 0 0 5.091-4.8l-.141-.15l-2.121-2.121a1 1 0 0 1 0-1.415M9.17 9.171a1 1 0 0 1 1.32-.083l.095.083l4.242 4.243a1 1 0 0 1-1.32 1.497l-.094-.083l-4.243-4.242a1 1 0 0 1 0-1.415m-4.95-4.95a5.5 5.5 0 0 1 7.597-.173l.182.174l2.121 2.12A1 1 0 0 1 12.8 7.84l-.094-.083l-2.121-2.121a3.5 3.5 0 0 0-5.091 4.8l.141.15l2.121 2.12a1 1 0 0 1-1.32 1.498l-.094-.083L4.222 12a5.5 5.5 0 0 1 0-7.778Z`})],-1)]])}var ER=(0,t.markRaw)({name:`mingcute-link-2-line`,render:TR}),DR={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function OR(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,DR,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M20 3a2 2 0 0 1 1.995 1.85L22 5v14a2 2 0 0 1-1.85 1.995L20 21H4a2 2 0 0 1-1.995-1.85L2 19V5a2 2 0 0 1 1.85-1.995L4 3zM9.879 12.05l-5.657 5.657a1 1 0 0 1-.222.168V19h16v-1.125a1 1 0 0 1-.222-.168L16.95 14.88l-.707.707l.207.207a1 1 0 0 1-1.415 1.414L9.88 12.05ZM20 5H4v10.1l4.995-4.994a1.25 1.25 0 0 1 1.666-.091l.101.09l4.066 4.067l1.238-1.238a1.25 1.25 0 0 1 1.666-.091l.102.091L20 15.101zm-4.5 2a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3`})],-1)]])}var kR=(0,t.markRaw)({name:`mingcute-pic-line`,render:OR}),AR={key:0,class:`w-56`},jR=(0,t.defineComponent)({__name:`BubbleItemImageAlt`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},setup(e){let n=e,r=(0,t.computed)({get:()=>n.editor.getAttributes(X.name).alt,set:e=>{n.editor.chain().updateAttributes(X.name,{alt:e}).setNodeSelection(n.editor.state.selection.from).focus().run()}});return(i,a)=>e.visible?.({editor:n.editor})?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,AR,[(0,t.createVNode)(DD,{modelValue:r.value,"onUpdate:modelValue":a[0]||=e=>r.value=e,"auto-focus":``,label:(0,t.unref)(N).global.t(`editor.common.alt`),placeholder:(0,t.unref)(N).global.t(`editor.common.placeholder.alt_input`)},null,8,[`modelValue`,`label`,`placeholder`])])):(0,t.createCommentVNode)(``,!0)}}),MR={class:`w-80`},NR={class:`mt-3 inline-flex items-center`},PR={class:`ml-2 text-sm text-gray-500`},FR=(0,t.defineComponent)({__name:`BubbleItemImageHref`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},setup(e){let n=e,r=(0,t.computed)({get:()=>n.editor.getAttributes(bU.name)?.href||n.editor.getAttributes(X.name).href,set:e=>{n.editor.commands.setLink({href:e,target:`_blank`})}}),i=(0,t.computed)({get(){return n.editor.getAttributes(bU.name)?.target===`_blank`},set(e){n.editor.commands.setLink({href:r.value,target:e?`_blank`:`_self`})}});return(a,o)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,MR,[e.visible?.({editor:n.editor})?((0,t.openBlock)(),(0,t.createBlock)(DD,{key:0,modelValue:r.value,"onUpdate:modelValue":o[0]||=e=>r.value=e,"auto-focus":``,placeholder:(0,t.unref)(N).global.t(`editor.common.placeholder.alt_href`),label:(0,t.unref)(N).global.t(`editor.extensions.image.href_input_label`)},null,8,[`modelValue`,`placeholder`,`label`])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`label`,NR,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":o[1]||=e=>i.value=e,type:`checkbox`},null,512),[[t.vModelCheckbox,i.value]]),(0,t.createElementVNode)(`span`,PR,(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.link.open_in_new_window`)),1)])]))}}),IR={key:0,class:`w-80`},LR=(0,t.defineComponent)({__name:`BubbleItemImageLink`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},setup(e){let n=e,r=(0,t.computed)({get:()=>n.editor.getAttributes(X.name).src,set:e=>{n.editor.chain().updateAttributes(X.name,{src:e}).setNodeSelection(n.editor.state.selection.from).focus().run()}});return(i,a)=>e.visible?.({editor:n.editor})?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,IR,[(0,t.createVNode)(DD,{modelValue:r.value,"onUpdate:modelValue":a[0]||=e=>r.value=e,"auto-focus":``,label:(0,t.unref)(N).global.t(`editor.extensions.image.src_input_label`),placeholder:(0,t.unref)(N).global.t(`editor.common.placeholder.link_input`)},null,8,[`modelValue`,`label`,`placeholder`])])):(0,t.createCommentVNode)(``,!0)}}),RR={class:`relative max-h-72 w-56 overflow-hidden overflow-y-auto`},zR=(0,t.defineComponent)({__name:`BubbleItemImagePosition`,props:{editor:{},isActive:{},visible:{type:Function,default:()=>!0},icon:{},iconStyle:{},title:{},action:{}},setup(e){let r=e,i=[{text:N.global.t(`editor.common.align_left`),value:`left`,icon:cO},{text:N.global.t(`editor.common.align_center`),value:`center`,icon:aO},{text:N.global.t(`editor.common.align_right`),value:`right`,icon:dO}],a=(0,t.computed)(()=>{let e=r.editor.getAttributes(X.name).position;return i.find(t=>t.value===e)||i[0]}),o=e=>{r.editor.chain().focus().updateAttributes(X.name,{position:e}).updateAttributes(DF.name,{position:e}).run()};return(r,s)=>{let c=(0,t.resolveDirective)(`close-popper`);return e.visible({editor:e.editor})?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VDropdown),{key:0,class:`inline-flex`,"auto-hide":!0,distance:10},{popper:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,RR,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(i,n=>(0,t.withDirectives)((0,t.createVNode)(ae,{key:n.value,"is-active":e.editor.isActive({position:n.value}),onClick:e=>o(n.value)},{icon:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.icon)))]),default:(0,t.withCtx)(()=>[(0,t.createTextVNode)(` `+(0,t.toDisplayString)(n.text),1)]),_:2},1032,[`is-active`,`onClick`]),[[c]])),64))])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(nO,{title:(0,t.unref)(N).global.t(`editor.common.align_method`),"show-more-indicator":``},{icon:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(a.value.icon)))]),_:1},8,[`title`])]),_:1})):(0,t.createCommentVNode)(``,!0)}}}),BR={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function VR(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,BR,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M12 3a9 9 0 0 0-9 9H0l4 4l4-4H5a7 7 0 0 1 7-7a7 7 0 0 1 7 7a7 7 0 0 1-7 7c-1.5 0-2.91-.5-4.06-1.3L6.5 19.14A9.1 9.1 0 0 0 12 21a9 9 0 0 0 9-9a9 9 0 0 0-9-9m2 9a2 2 0 0 0-2-2a2 2 0 0 0-2 2a2 2 0 0 0 2 2a2 2 0 0 0 2-2`},null,-1)]])}var HR=(0,t.markRaw)({name:`mdi-backup-restore`,render:VR}),UR={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function WR(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,UR,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M21 3H3C2 3 1 4 1 5v14a2 2 0 0 0 2 2h18c1 0 2-1 2-2V5c0-1-1-2-2-2M5 17l3.5-4.5l2.5 3l3.5-4.5l4.5 6z`},null,-1)]])}var GR=(0,t.markRaw)({name:`mdi-image-size-select-actual`,render:WR}),KR={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function qR(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,KR,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M21 15h2v2h-2zm0-4h2v2h-2zm2 8h-2v2c1 0 2-1 2-2M13 3h2v2h-2zm8 4h2v2h-2zm0-4v2h2c0-1-1-2-2-2M1 7h2v2H1zm16-4h2v2h-2zm0 16h2v2h-2zM3 3C2 3 1 4 1 5h2zm6 0h2v2H9zM5 3h2v2H5zm-4 8v8a2 2 0 0 0 2 2h12V11zm2 8l2.5-3.21l1.79 2.15l2.5-3.22L13 19z`},null,-1)]])}var JR=(0,t.markRaw)({name:`mdi-image-size-select-large`,render:qR}),YR={class:`flex w-56 flex-col gap-3`},XR={class:`flex flex-col items-center gap-3`},ZR={class:`flex items-center gap-1 rounded-md bg-gray-100 p-1`},QR=[`onClick`],$R=(0,t.defineComponent)({__name:`BubbleItemImageSize`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},setup(e){let r=e,i=(0,t.computed)({get:()=>r.editor.getAttributes(X.name).width,set:e=>{o({width:e,height:a.value})}}),a=(0,t.computed)({get:()=>r.editor.getAttributes(X.name).height,set:e=>{o({width:i.value,height:e})}});function o(e){let t=e.width;if(!e.width){let{state:e}=r.editor,{selection:n}=e,i=mm(n.$from.node(),e=>e.type.name===X.name);if(i.length===0)return;let a=i[0];if(a&&a.node.type.name===X.name){let e=n.$from.pos+a.pos,i=r.editor.view.nodeDOM(e).querySelector(`img`);i&&i.naturalWidth&&(t=`${i.naturalWidth}px`)}}r.editor.chain().updateAttributes(X.name,e).updateFigureContainerWidth(t).setNodeSelection(r.editor.state.selection.from).focus().run()}let s=[{width:`25%`,height:`auto`,icon:XL,title:N.global.t(`editor.extensions.image.small_size`)},{width:`50%`,height:`auto`,icon:JR,title:N.global.t(`editor.extensions.image.medium_size`)},{width:`100%`,height:`auto`,icon:GR,title:N.global.t(`editor.extensions.image.large_size`)},{width:void 0,height:void 0,icon:HR,title:N.global.t(`editor.extensions.image.restore_size`)}];return(r,c)=>{let l=(0,t.resolveDirective)(`tooltip`);return e.visible?.({editor:e.editor})?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VDropdown),{key:0,class:`inline-flex`,"auto-hide":!0,distance:10},{popper:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,YR,[(0,t.createElementVNode)(`div`,XR,[(0,t.createVNode)(DD,{modelValue:i.value,"onUpdate:modelValue":c[0]||=e=>i.value=e,label:(0,t.unref)(N).global.t(`editor.common.width`),tooltip:(0,t.unref)(N).global.t(`editor.common.tooltip.custom_width_input`)},null,8,[`modelValue`,`label`,`tooltip`]),(0,t.createVNode)(DD,{modelValue:a.value,"onUpdate:modelValue":c[1]||=e=>a.value=e,label:(0,t.unref)(N).global.t(`editor.common.height`),tooltip:(0,t.unref)(N).global.t(`editor.common.tooltip.custom_height_input`)},null,8,[`modelValue`,`label`,`tooltip`])]),(0,t.createElementVNode)(`div`,ZR,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s,e=>(0,t.withDirectives)((0,t.createElementVNode)(`button`,{key:e.width,class:(0,t.normalizeClass)([`inline-flex flex-1 items-center justify-center rounded px-2 py-1.5 text-gray-600 transition-all hover:text-gray-900`,{"bg-white text-gray-900":e.width===i.value&&e.height===a.value}]),onClick:t=>o({width:e.width,height:e.height})},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon)))],10,QR),[[l,e.title]])),64))])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(nO,{title:(0,t.unref)(N).global.t(`editor.extensions.image.resize`),"show-more-indicator":``},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(XL))]),_:1},8,[`title`])]),_:1})):(0,t.createCommentVNode)(``,!0)}}}),ez={key:0,class:`relative`},tz=[`src`,`title`,`alt`,`href`,`width`,`height`],nz={key:1,class:`absolute left-0 top-0 hidden w-full cursor-pointer justify-end gap-2 rounded-md bg-gradient-to-b from-gray-300 to-transparent p-2 ease-in-out group-hover:flex`},rz={key:2,class:`absolute top-0 size-full bg-black bg-opacity-20`},iz={class:`absolute top-[50%] w-full space-y-2 text-white`},az={class:`px-10`},oz={class:`relative h-4 w-full overflow-hidden rounded-full bg-gray-200`},sz={class:`absolute left-[50%] top-0 -translate-x-[50%] text-xs leading-4 text-white`},cz={class:`px-10`},lz={class:`relative h-4 w-full overflow-hidden rounded-full bg-gray-200`},uz={class:`absolute left-[50%] top-0 -translate-x-[50%] text-xs leading-4 text-white`},dz=(0,t.defineComponent)({__name:`ImageView`,props:{decorations:{},selected:{type:Boolean},updateAttributes:{type:Function},deleteNode:{type:Function},node:{},view:{},getPos:{},innerDecorations:{},editor:{},extension:{},HTMLAttributes:{}},setup(e){let i=e,a=(0,t.computed)({get:()=>i.node?.attrs.src,set:e=>{i.updateAttributes({src:e})}}),o=(0,t.computed)({get:()=>i.node?.attrs.alt,set:e=>{i.updateAttributes({alt:e})}}),s=(0,t.computed)({get:()=>i.node?.attrs.href,set:e=>{i.updateAttributes({href:e})}}),c=(0,t.computed)(()=>i.node?.attrs.position||`left`),l=(0,t.ref)(),u=(0,t.ref)(void 0),d=(0,t.ref)(!1),f=(0,t.ref)(),p=()=>{f.value?.abort()},m=(0,t.computed)(()=>!a.value&&!l.value),h=async e=>{l.value=await AK(e),d.value=!1},g=e=>{e&&i.updateAttributes({src:e.url,alt:e.alt})},_=()=>{f.value?.retry()},v=e=>{u.value=e},y=()=>{d.value=!0},b=()=>{l.value=void 0,u.value=void 0;let{file:e}=i.node.attrs;e&&i.updateAttributes({width:void 0,file:void 0})},x=(0,t.ref)(0),S=(0,t.ref)(),C=(0,t.ref)();function w(e){if(!S.value)return;x.value=S.value.clientWidth/S.value.clientHeight;let t=e.target;i.node?.attrs.width||t instanceof HTMLImageElement&&i.editor.chain().updateAttributes(X.name,{width:`${t.naturalWidth}px`}).updateFigureContainerWidth(`${t.naturalWidth}px`).setNodeSelection(i.getPos()||0).focus().run()}let T=null,ee=(0,t.ref)();function te(){if(!ee.value)return;T&&T();let e=ee.value,t,n,r=null;function a(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),t=e.clientX,n=S.value?.clientWidth||1,document.documentElement.addEventListener(`mousemove`,o,!1),document.documentElement.addEventListener(`mouseup`,c,!1),document.documentElement.addEventListener(`contextmenu`,s,!1),document.documentElement.addEventListener(`mouseleave`,c,!1),window.addEventListener(`blur`,c,!1))}function o(e){S.value&&(r!==null&&cancelAnimationFrame(r),r=requestAnimationFrame(()=>{if(!S.value)return;let r=Math.max(1,Math.min(n+e.clientX-t,i.editor.view.dom?.clientWidth||0)).toFixed(0)+`px`;i.editor.chain().updateAttributes(X.name,{width:r}).updateFigureContainerWidth(r).setNodeSelection(i.getPos()||0).focus().run()}))}function s(e){e.preventDefault(),c()}function c(){r!==null&&(cancelAnimationFrame(r),r=null),document.documentElement.removeEventListener(`mousemove`,o,!1),document.documentElement.removeEventListener(`mouseup`,c,!1),document.documentElement.removeEventListener(`contextmenu`,s,!1),document.documentElement.removeEventListener(`mouseleave`,c,!1),window.removeEventListener(`blur`,c,!1)}e.addEventListener(`mousedown`,a),T=()=>{e.removeEventListener(`mousedown`,a),document.documentElement.removeEventListener(`mousemove`,o,!1),document.documentElement.removeEventListener(`mouseup`,c,!1),document.documentElement.removeEventListener(`contextmenu`,s,!1),document.documentElement.removeEventListener(`mouseleave`,c,!1),window.removeEventListener(`blur`,c,!1),r!==null&&cancelAnimationFrame(r),T=null}}(0,t.onMounted)(()=>{if(!a.value){C.value?.focus();return}te()}),(0,t.onUnmounted)(()=>{T&&T()}),(0,t.watch)([a,ee],()=>{a.value&&ee.value&&te()});let{isExternalAsset:E,transferring:ne,handleTransfer:re}=ID(a,g),ie=(0,t.computed)(()=>i.node?.attrs.width?.includes(`%`));return(i,x)=>{let C=(0,t.resolveDirective)(`tooltip`);return(0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(JT),{as:`div`,class:(0,t.normalizeClass)([`flex w-full`,{"justify-start":c.value===`left`,"justify-center":c.value===`center`,"justify-end":c.value===`right`}])},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{ref_key:`resizeRef`,ref:S,class:(0,t.normalizeClass)([`group relative inline-block max-w-full overflow-hidden rounded-md text-center`,{"rounded ring-2":e.selected,"resize-container":!!a.value||!!l.value}]),style:(0,t.normalizeStyle)({width:m.value?`100%`:e.node.attrs.width})},[a.value||l.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ez,[(0,t.createElementVNode)(`img`,{src:a.value||l.value,title:e.node.attrs.title,alt:o.value,href:s.value,width:ie.value?`100%`:e.node.attrs.width,height:e.node.attrs.height,style:(0,t.normalizeStyle)({width:ie.value?`100%`:e.node.attrs.width,height:e.node.attrs.height}),class:`max-w-full rounded-md`,onLoad:w},null,44,tz),e.selected?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`resizeHandleRef`,ref:ee,class:`resizer-handler resizer-br`},null,512)):(0,t.createCommentVNode)(``,!0),a.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,nz,[(0,t.unref)(r.utils).permission.has([`uc:attachments:manage`,`system:attachments:manage`])&&(0,t.unref)(E)?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VButton),{key:0,loading:(0,t.unref)(ne),size:`sm`,ghost:``,onClick:(0,t.unref)(re)},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.upload.operations.transfer.button`)),1)]),_:1},8,[`loading`,`onClick`])),[[C,(0,t.unref)(N).global.t(`editor.extensions.upload.operations.transfer.tooltip`)]]):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(FD),{accept:`image/*`,"original-link":a.value,upload:e.extension.options.uploadImage,onChange:g},null,8,[`original-link`,`upload`])])):(0,t.createCommentVNode)(``,!0),l.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,rz,[(0,t.createElementVNode)(`div`,iz,[d.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`div`,az,[(0,t.createElementVNode)(`div`,oz,[x[0]||=(0,t.createElementVNode)(`div`,{class:`size-full bg-red-600`},null,-1),(0,t.createElementVNode)(`div`,sz,(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.upload.error`)),1)])]),(0,t.createElementVNode)(`div`,{class:`inline-block cursor-pointer text-sm hover:opacity-70`,onClick:_},(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.upload.click_retry`)),1)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`div`,cz,[(0,t.createElementVNode)(`div`,lz,[(0,t.createElementVNode)(`div`,{class:`h-full bg-primary`,style:(0,t.normalizeStyle)({width:`${u.value||0}%`})},null,4),(0,t.createElementVNode)(`div`,uz,(0,t.toDisplayString)(u.value?`${u.value}%`:`${(0,t.unref)(N).global.t(`editor.extensions.upload.loading`)}...`),1)])]),(0,t.createElementVNode)(`div`,{class:`inline-block cursor-pointer text-sm hover:opacity-70`,onClick:p},(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.common.button.cancel`)),1)],64))])])):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),(0,t.withDirectives)((0,t.createElementVNode)(`div`,null,[(0,t.createVNode)((0,t.unref)(ND),{ref_key:`editorLinkObtain`,ref:f,accept:`image/*`,editor:e.editor,"upload-to-attachment-file":e.extension.options.uploadImage,"uploaded-file":e.node?.attrs.file,onSetExternalLink:g,onOnUploadReady:h,onOnUploadProgress:v,onOnUploadFinish:b,onOnUploadError:y,onOnUploadAbort:b},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.IconImageAddLine),{class:`text-xl text-primary`})]),_:1},8,[`editor`,`upload-to-attachment-file`,`uploaded-file`])],512),[[t.vShow,!a.value&&!l.value]])],6)]),_:1},8,[`class`])}}});let fz=new V(`imageBubbleMenu`),X=_R.extend({fakeSelection:!0,inline:!1,group:`block`,defining:!1,addAttributes(){return{...this.parent?.(),src:{default:null,parseHTML:e=>e.getAttribute(`src`)},width:{default:void 0,parseHTML:e=>e.getAttribute(`width`)||e.style.width||null,renderHTML:e=>({width:e.width})},height:{default:void 0,parseHTML:e=>e.getAttribute(`height`)||e.style.height||null,renderHTML:e=>({height:e.height})},href:{default:null,parseHTML:e=>e.getAttribute(`href`)||null,renderHTML:e=>({href:e.href})},position:{default:`left`,parseHTML:e=>e.getAttribute(`data-position`)||e.getAttribute(`text-align`),renderHTML:e=>({"data-position":e.position})},file:{default:null,renderHTML(){return{}},parseHTML(){return null}}}},addNodeView(){return rE(dz)},parseHTML(){return[{tag:this.options.allowBase64?`img`:`img:not([src^="data:"])`}]},addProseMirrorPlugins(){return[new B({key:new V(`imageLegacyFormat`),appendTransaction:(e,t,n)=>{if(!e.some(e=>e.docChanged))return null;let r=n.tr,i=!1;return n.doc.descendants((e,t)=>{if(e.type.name!==X.name)return;let a=n.doc.resolve(t);if(a.parent.type.name===DF.name)return;let o=`left`,s=!1,c=-1,l=0,u=a.nodeBefore;u&&u.type.name===hF.name&&(u.attrs.textAlign&&(o={left:`left`,center:`center`,right:`right`,justify:`center`}[u.attrs.textAlign]||`left`),u.textContent?.trim().length===0&&(s=!0,c=t-u.nodeSize,l=u.nodeSize));let d=n.schema.nodes.figure.create({contentType:`image`,position:o},[e]);s?(r.delete(c,c+l),r.replaceRangeWith(t-l,t-l+e.nodeSize,d)):r.replaceRangeWith(t,t+e.nodeSize,d),i=!0}),i?r:null}})]},addOptions(){return{...this.parent?.(),uploadImage:void 0,getToolboxItems({editor:e}){return[{priority:10,component:(0,t.markRaw)(NE),props:{editor:e,icon:(0,t.markRaw)(kR),title:N.global.t(`editor.common.image`),action:()=>{e.chain().focus().insertContent([{type:`figure`,attrs:{contentType:`image`},content:[{type:`image`}]}]).run()}}}]},getCommandMenuItems(){return{priority:95,icon:(0,t.markRaw)(kR),title:`editor.extensions.commands_menu.image`,keywords:[`image`,`tupian`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).insertContent([{type:`figure`,attrs:{contentType:`image`},content:[{type:`image`}]}]).run()}}},getBubbleMenu({editor:e}){return{pluginKey:fz,shouldShow:({state:e})=>Qm(e,X.name),options:{placement:`top-start`},items:[{priority:10,component:(0,t.markRaw)($R),props:{visible({editor:e}){return!HE(e.getAttributes(X.name).src)}}},{priority:20,component:(0,t.markRaw)(zR),props:{visible({editor:e}){return!HE(e.getAttributes(X.name).src)}}},{priority:30,component:(0,t.markRaw)(C),props:{visible({editor:e}){return!HE(e.getAttributes(X.name).src)}}},{priority:40,props:{icon:(0,t.markRaw)(rD),title:N.global.t(`editor.common.button.edit_link`),action:()=>(0,t.markRaw)(LR)}},{priority:50,props:{visible({editor:e}){return!HE(e.getAttributes(X.name).src)},icon:(0,t.markRaw)(lD),title:N.global.t(`editor.common.tooltip.open_link`),action:()=>{window.open(e.getAttributes(X.name).src,`_blank`)}}},{priority:60,props:{visible({editor:e}){return!HE(e.getAttributes(X.name).src)},icon:(0,t.markRaw)(CR),title:N.global.t(`editor.extensions.image.edit_alt`),action:()=>(0,t.markRaw)(jR)}},{priority:70,props:{visible({editor:e}){return!HE(e.getAttributes(X.name).src)},icon:(0,t.markRaw)(ER),title:N.global.t(`editor.extensions.image.edit_href`),action:()=>(0,t.markRaw)(FR)}},{priority:80,props:{visible({editor:e}){return!HE(e.getAttributes(X.name).src)},icon:(0,t.markRaw)(bR),title:N.global.t(`editor.extensions.image.edit_caption`),action:({editor:e})=>{let t=_m(e=>e.type.name===DF.name)(e.state.selection);if(!t)return;let{node:n,pos:r}=t,i=-1;if(n.forEach((e,t)=>{e.type.name===EF.name&&(i=r+t+1)}),i!==-1){e.chain().focus().setTextSelection(i).run();return}let a=mm(e.state.selection.$from.node(),e=>e.type.name===X.name)[0],o=e.schema.nodes.figureCaption.create({width:a.node.attrs.width});e.chain().focus().command(({tr:e})=>{let t=r+n.nodeSize-1;return e.insert(t,o),e.setSelection(R.near(e.doc.resolve(t+1))),!0}).run()}}},{priority:90,component:(0,t.markRaw)(C)},{priority:100,props:{icon:(0,t.markRaw)(OE),title:N.global.t(`editor.common.button.delete`),action:({editor:e})=>{cE(_m(e=>e.type.name===DF.name)(e.state.selection)?DF.name:X.name,e)}}}]}}}},renderHTML({HTMLAttributes:e}){return e.href?[`a`,{href:e.href},[`img`,G(e)]]:[`img`,G(e)]}}).configure({inline:!0,allowBase64:!1,HTMLAttributes:{loading:`lazy`}});var pz=q.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`),n=t?t.split(`,`).map(e=>parseInt(e,10)):null;if(!n){let t=e.closest(`table`)?.querySelectorAll(`colgroup > col`),n=Array.from(e.parentElement?.children||[]).indexOf(e);if(n&&n>-1&&t&&t[n]){let e=t[n].getAttribute(`width`);return e?[parseInt(e,10)]:null}}return n}}}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,G(this.options.HTMLAttributes,e),0]}}),mz=q.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}}}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,G(this.options.HTMLAttributes,e),0]}}),hz=q.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,G(this.options.HTMLAttributes,e),0]}});function gz(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function _z(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let e=0,n=0;e<u.childCount;e+=1){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e+=1,n+=1){let o=i===n?a:d&&d[e],u=o?`${o}px`:``;if(s+=o||r,o||(c=!1),l){if(l.style.width!==u){let[e,t]=gz(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=gz(r,o);e.style.setProperty(n,i),t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);c&&!d?(n.style.width=`${s}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${s}px`)}var vz=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),_z(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type===this.node.type?(this.node=e,_z(e,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type===`attributes`||e.type===`childList`||e.type===`characterData`))}};function yz(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=gz(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function bz(e,t){return t?e.createChecked(null,t):e.createAndFill()}function xz(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function Sz(e,t,n,r,i){let a=xz(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=bz(a.cell,i);if(e&&s.push(e),r){let e=bz(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function Cz(e){return e instanceof Y}var wz=({editor:e})=>{let{selection:t}=e.state;if(!Cz(t))return!1;let n=0;return gm(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1};function Tz(e){return(e||``).replace(/\s+/g,` `).trim()}function Ez(e,t,n={}){let r=n.cellLineSeparator??``;if(!e||!e.content||e.content.length===0)return``;let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let i=``;i=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(r):e.content?t.renderChildren(e.content):``;let a=Tz(i),o=e.type===`tableHeader`;n.push({text:a,isHeader:o})}),i.push(n)});let a=i.reduce((e,t)=>Math.max(e,t.length),0);if(a===0)return``;let o=Array(a).fill(0);i.forEach(e=>{for(let t=0;t<a;t+=1){let n=(e[t]?.text||``).length;n>o[t]&&(o[t]=n),o[t]<3&&(o[t]=3)}});let s=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),c=i[0],l=c.some(e=>e.isHeader),u=`
169
+ `,d=Array(a).fill(0).map((e,t)=>l&&c[t]&&c[t].text||``);return u+=`| ${d.map((e,t)=>s(e,o[t])).join(` | `)} |
170
+ `,u+=`| ${o.map(e=>`-`.repeat(Math.max(3,e))).join(` | `)} |
171
+ `,(l?i.slice(1):i).forEach(e=>{u+=`| ${Array(a).fill(0).map((t,n)=>s(e[n]&&e[n].text||``,o[n])).join(` | `)} |
172
+ `}),u}var Dz=Ez,Oz=q.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:vz,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=yz(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,G(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[];if(e.header){let r=[];e.header.forEach(e=>{r.push(t.createNode(`tableHeader`,{},[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},r))}return e.rows&&e.rows.forEach(e=>{let r=[];e.forEach(e=>{r.push(t.createNode(`tableCell`,{},[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},r))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>Dz(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=Sz(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(R.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>Pw(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>Fw(e,t),deleteColumn:()=>({state:e,dispatch:t})=>Lw(e,t),addRowBefore:()=>({state:e,dispatch:t})=>Bw(e,t),addRowAfter:()=>({state:e,dispatch:t})=>Vw(e,t),deleteRow:()=>({state:e,dispatch:t})=>Uw(e,t),deleteTable:()=>({state:e,dispatch:t})=>iT(e,t),mergeCells:()=>({state:e,dispatch:t})=>Kw(e,t),splitCell:()=>({state:e,dispatch:t})=>qw(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>Qw(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>Qw(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>tT(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>Kw(e,t)?!0:qw(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>Yw(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>rT(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>rT(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&Aw(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=Y.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}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:wz,"Mod-Backspace":wz,Delete:wz,"Mod-Delete":wz}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[DT({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],VT({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){return{tableRole:W(U(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}});K.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(Oz.configure(this.options.table)),this.options.tableCell!==!1&&e.push(pz.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(mz.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(hz.configure(this.options.tableRow)),e}});var kz={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Az(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,kz,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M3 6.25A3.25 3.25 0 0 1 6.25 3h11.5A3.25 3.25 0 0 1 21 6.25v11.5A3.25 3.25 0 0 1 17.75 21H6.25A3.25 3.25 0 0 1 3 17.75zM6.25 4.5A1.75 1.75 0 0 0 4.5 6.25V8.5h4v-4zM4.5 10v4h4v-4zm5.5 0v4h4v-4zm5.5 0v4h4v-4zm0 9.5h2.25a1.75 1.75 0 0 0 1.75-1.75V15.5h-4zm0-11h4V6.25a1.75 1.75 0 0 0-1.75-1.75H15.5zm-11 7v2.25c0 .966.784 1.75 1.75 1.75H8.5v-4z`},null,-1)]])}var jz=(0,t.markRaw)({name:`fluent-table-column-top-bottom-24-regular`,render:Az}),Mz={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Nz(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Mz,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m0 4v4h6V8zm8 0v4h6V8zm-8 6v4h6v-4zm8 0v4h6v-4z`},null,-1)]])}var Pz=(0,t.markRaw)({name:`mdi-table`,render:Nz}),Fz={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Iz(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Fz,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M11 2a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H2V2zm-7 8v4h7v-4zm0 6v4h7v-4zM4 4v4h7V4zm11 7h3V8h2v3h3v2h-3v3h-2v-3h-3z`},null,-1)]])}var Lz=(0,t.markRaw)({name:`mdi-table-column-plus-after`,render:Iz}),Rz={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function zz(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Rz,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M13 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h9V2zm7 8v4h-7v-4zm0 6v4h-7v-4zm0-12v4h-7V4zM9 11H6V8H4v3H1v2h3v3h2v-3h3z`},null,-1)]])}var Bz=(0,t.markRaw)({name:`mdi-table-column-plus-before`,render:zz}),Vz={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Hz(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Vz,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M4 2h7a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2m0 8v4h7v-4zm0 6v4h7v-4zM4 4v4h7V4zm13.59 8L15 9.41L16.41 8L19 10.59L21.59 8L23 9.41L20.41 12L23 14.59L21.59 16L19 13.41L16.41 16L15 14.59z`},null,-1)]])}var Uz=(0,t.markRaw)({name:`mdi-table-column-remove`,render:Hz}),Wz={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Gz(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Wz,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M1 6v13a2 2 0 0 0 2 2h6V11h12V6a2 2 0 0 0-2-2H3a2 2 0 0 0-2 2m2 0h4v3H3m4 10H3v-3h4m0-2H3v-3h4m2-2V6h4v3m6 0h-4V6h4m-2 10a1 1 0 1 1-1 1a1 1 0 0 1 1-1m0-3a6.45 6.45 0 0 1 6 4a6.5 6.5 0 0 1-12 0a6.45 6.45 0 0 1 6-4m0 1.5a2.5 2.5 0 1 0 2.5 2.5a2.5 2.5 0 0 0-2.5-2.5`},null,-1)]])}var Kz=(0,t.markRaw)({name:`mdi-table-headers-eye`,render:Gz}),qz={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Jz(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,qz,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M5 10H3V4h8v2H5zm14 8h-6v2h8v-6h-2zM5 18v-4H3v6h8v-2zM21 4h-8v2h6v4h2zM8 13v2l3-3l-3-3v2H3v2zm8-2V9l-3 3l3 3v-2h5v-2z`},null,-1)]])}var Yz=(0,t.markRaw)({name:`mdi-table-merge-cells`,render:Jz}),Xz={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Zz(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Xz,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M18 14h2v3h3v2h-3v3h-2v-3h-3v-2h3zM4 3h14a2 2 0 0 1 2 2v7.08a6 6 0 0 0-4.32.92H12v4h1.08c-.11.68-.11 1.35 0 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2m0 4v4h6V7zm8 0v4h6V7zm-8 6v4h6v-4z`},null,-1)]])}var Qz=(0,t.markRaw)({name:`mdi-table-plus`,render:Zz}),$z={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function eB(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,$z,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`m15.46 15.88l1.42-1.42L19 16.59l2.12-2.13l1.42 1.42L20.41 18l2.13 2.12l-1.42 1.42L19 19.41l-2.12 2.13l-1.42-1.42L17.59 18zM4 3h14a2 2 0 0 1 2 2v7.08a6 6 0 0 0-4.32.92H12v4h1.08c-.11.68-.11 1.35 0 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2m0 4v4h6V7zm8 0v4h6V7zm-8 6v4h6v-4z`},null,-1)]])}var tB=(0,t.markRaw)({name:`mdi-table-remove`,render:eB}),nB={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function rB(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,nB,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M22 10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V3h2v2h4V3h2v2h4V3h2v2h4V3h2zM4 10h4V7H4zm6 0h4V7h-4zm10 0V7h-4v3zm-9 4h2v3h3v2h-3v3h-2v-3H8v-2h3z`},null,-1)]])}var iB=(0,t.markRaw)({name:`mdi-table-row-plus-after`,render:rB}),aB={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function oB(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,aB,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M22 14a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7h2v-2h4v2h2v-2h4v2h2v-2h4v2h2zM4 14h4v3H4zm6 0h4v3h-4zm10 0v3h-4v-3zm-9-4h2V7h3V5h-3V2h-2v3H8v2h3z`},null,-1)]])}var sB=(0,t.markRaw)({name:`mdi-table-row-plus-before`,render:oB}),cB={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function lB(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,cB,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M9.41 13L12 15.59L14.59 13L16 14.41L13.41 17L16 19.59L14.59 21L12 18.41L9.41 21L8 19.59L10.59 17L8 14.41zM22 9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2zM4 9h4V6H4zm6 0h4V6h-4zm6 0h4V6h-4z`},null,-1)]])}var uB=(0,t.markRaw)({name:`mdi-table-row-remove`,render:lB}),dB={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function fB(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,dB,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M19 14h2v6H3v-6h2v4h14zM3 4v6h2V6h14v4h2V4zm8 7v2H8v2l-3-3l3-3v2zm5 0V9l3 3l-3 3v-2h-3v-2z`},null,-1)]])}var pB=(0,t.markRaw)({name:`mdi-table-split-cell`,render:fB}),mB={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function hB(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,mB,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z`},null,-1)]])}var gB=(0,t.markRaw)({name:`mdi-plus`,render:hB});let _B=e=>{let t=CB(e.selection);if(t){let{node:n}=t,{map:r}=J.get(n);if(r&&r.length){let n=t.start+r[0],i=t.start+r[r.length-1],a=e.doc.resolve(n),o=e.doc.resolve(i);return e.setSelection(new Y(o,a))}}return e};var vB=e=>t=>n=>{let r=CB(n.selection),i=e===`row`;if(r){let e=J.get(r.node);if(t>=0&&t<(i?e.height:e.width)){let a=i?e.cellsInRect({left:0,right:1,top:0,bottom:e.height}):e.cellsInRect({left:0,right:e.width,top:0,bottom:1}),o=e.findCell(a[t]),s={left:i?e.width-1:o.left,right:i?e.width:o.right,top:i?o.top:e.height-1,bottom:i?o.bottom:e.height},c=e.cellsInRect(s);for(;c.length===0;)i?--s.left:--s.top,c=e.cellsInRect(s);let l=r.start+a[t],u=r.start+c[c.length-1],d=n.doc.resolve(l),f=n.doc.resolve(u);return n.setSelection(new Y(f,d))}}return n};let yB=vB(`column`),bB=vB(`row`),xB=e=>t=>{let n=CB(t);if(n){let t=J.get(n.node);return(Array.isArray(e)?e:Array.from([e])).reduce((e,r)=>{if(r>=0&&r<=t.width-1){let i=t.cellsInRect({left:r,right:r+1,top:0,bottom:t.height});return e.concat(i.map(e=>{let t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t}}))}return e},[])}},SB=e=>t=>{let n=CB(t);if(n){let t=J.get(n.node);return(Array.isArray(e)?e:Array.from([e])).reduce((e,r)=>{if(r>=0&&r<=t.height-1){let i=t.cellsInRect({left:0,right:t.width,top:r,bottom:r+1});return e.concat(i.map(e=>{let t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t}}))}return e},[])}},CB=e=>_m(e=>e.type.spec.tableRole===`table`)(e),wB=e=>t=>{let n=J.get(t.$anchorCell.node(-1)),r=t.$anchorCell.start(-1),i=n.cellsInRect(e),a=n.cellsInRect(n.rectBetween(t.$anchorCell.pos-r,t.$headCell.pos-r));for(let e=0,t=i.length;e<t;e++)if(a.indexOf(i[e])===-1)return!1;return!0},TB=e=>e instanceof Y,EB=e=>t=>{if(TB(t)){let n=J.get(t.$anchorCell.node(-1)),r=n.cellsInRect({left:0,right:n.width,top:0,bottom:1});if(e>=r.length)return!1;let i=n.findCell(r[e]);return wB({left:i.left,right:i.right,top:0,bottom:n.height})(t)}return!1},DB=e=>t=>{if(TB(t)){let n=J.get(t.$anchorCell.node(-1)),r=n.cellsInRect({left:0,right:1,top:0,bottom:n.height});if(e>=r.length)return!1;let i=n.findCell(r[e]);return wB({left:0,right:n.width,top:i.top,bottom:i.bottom})(t)}return!1},OB=e=>{if(TB(e)){let t=J.get(e.$anchorCell.node(-1));return wB({left:0,right:t.width,top:0,bottom:t.height})(e)}return!1},kB=e=>{let{$anchor:t}=e.selection,n=Math.max(0,t.pos-2),r=e.doc.resolve(n).node();return!(!r||r.type.name!==`table`)},AB=e=>MB(1)(e),jB=e=>MB(-1)(e),MB=e=>t=>{let n=Mw(t);if(n.table){let t=n.map,r=t.cellsInRect(n),i=NB(t)(r[r.length-1],e);if(i){let{top:e,left:r}=i,a=t.map[e*t.width+r];return{start:a+n.tableStart+2,node:n.table.nodeAt(a)}}return}},NB=e=>(t,n)=>{function r({top:t,left:n,right:i,bottom:a}){let o={top:t,left:n,right:i,bottom:a};if(i+1>e.width){if(a===e.height)return;o.top++,o.left=0,o.right=1,o.bottom++}else o.left++,o.right++;let s=e.map[o.top*e.width+o.left],c=e.findCell(s);return c.top!=o.top||c.left<o.left?r({...o,right:c.right}):s}function i({top:t,left:n,right:r,bottom:a}){let o={top:t,left:n,right:r,bottom:a};if(n-1<0){if(t===0)return;o.top--,o.left=e.width-1,o.right=e.width,o.bottom--}else o.left--,o.right--;let s=e.map[o.top*e.width+o.left];return e.findCell(s).top==o.top?s:i(o)}function a(t,n){let{top:o,left:s,right:c,bottom:l}=e.findCell(t);if(n==0)return{top:o,left:s,right:c,bottom:l};let u={top:o,left:s,right:c,bottom:l},d;if(n>0?(d=r(u),n--):(d=i(u),n++),d)return a(d,n)}return a(t,n)};var PB=q.create({name:`tableCell`,content:`block+`,tableRole:`cell`,isolating:!0,fakeSelection:!0,addOptions(){return{HTMLAttributes:{}}},addAttributes(){return{...this.parent?.(),colspan:{default:1,parseHTML:e=>{let t=e.getAttribute(`colspan`);return t?parseInt(t,10):1}},rowspan:{default:1,parseHTML:e=>{let t=e.getAttribute(`rowspan`);return t?parseInt(t,10):1}},colwidth:{default:[100],parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}},style:{default:null}}},parseHTML(){return[{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,G(this.options.HTMLAttributes,e),0]},addStorage(){return{gripMap:new Map}},onDestroy(){this.storage.gripMap.clear()},addProseMirrorPlugins(){let e=this.editor,r=this.storage;return[new B({key:new V(`table-cell-control`),props:{decorations(i){let{doc:a,selection:o}=i,s=[],c=xB(0)(o);return c&&c.forEach(({pos:i},a)=>{a===0&&s.push(Wd.widget(i+1,()=>{let t=`table`+a,n=`grip-table`;OB(o)&&(n+=` selected`);let i=r.gripMap.get(t);return i||(i=document.createElement(`a`),i.addEventListener(`mousedown`,t=>{t.preventDefault(),t.stopImmediatePropagation(),e.view.dispatch(_B(e.state.tr))})),i.className=n,r.gripMap.set(t,i),i})),s.push(Wd.widget(i+1,()=>{let i=`row`+a,s=DB(a)(o),l=`grip-row`;s&&(l+=` selected`),a===0&&(l+=` first`),a===c.length-1&&(l+=` last`);let u=r.gripMap.get(i);return u||(u=document.createElement(`a`),(0,t.render)((0,t.h)(n.VTooltipComponent,{triggers:[`hover`]},{default:()=>(0,t.h)(gB,{class:`plus-icon`}),popper:()=>N.global.t(`editor.menus.table.add_row_after`)}),u),u.addEventListener(`mousedown`,t=>{t.preventDefault(),t.stopImmediatePropagation(),e.view.dispatch(bB(a)(e.state.tr)),t.target!==u&&Vw(e.state,e.view.dispatch)},!0)),u.className=l,r.gripMap.set(i,u),u}))}),H.create(a,s)}}})]}}),FB=q.create({name:`tableHeader`,content:`block+`,tableRole:`header_cell`,isolating:!0,fakeSelection:!0,addOptions(){return{HTMLAttributes:{}}},addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:[100],parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}},style:{default:null}}},parseHTML(){return[{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,G(this.options.HTMLAttributes,e),0]},addStorage(){return{gripMap:new Map}},onDestroy(){this.storage.gripMap.clear()},addProseMirrorPlugins(){let e=this.editor,r=this.storage;return[new B({key:new V(`table-header-control`),props:{decorations(i){let{doc:a,selection:o}=i,s=[],c=SB(0)(o);return c&&c.forEach(({pos:i},a)=>{s.push(Wd.widget(i+1,()=>{let i=`column`+a,s=EB(a)(o),l=`grip-column`;s&&(l+=` selected`),a===0?l+=` first`:a===c.length-1&&(l+=` last`);let u=r.gripMap.get(i);return u||(u=document.createElement(`a`),(0,t.render)((0,t.h)(n.VTooltipComponent,{triggers:[`hover`]},{default:()=>(0,t.h)(gB,{class:`plus-icon`}),popper:()=>N.global.t(`editor.menus.table.add_column_after`)}),u),u.addEventListener(`mousedown`,t=>{t.preventDefault(),t.stopImmediatePropagation(),e.view.dispatch(yB(a)(e.state.tr)),t.target!==u&&Fw(e.state,e.view.dispatch)})),u.className=l,r.gripMap.set(i,u),u}))}),H.create(a,s)}}})]}}),IB=hz.extend({allowGapCursor:!1,addAttributes(){return{style:{default:`height: 60px;`,parseHTML:e=>e.getAttribute(`style`)}}}});function LB(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e+=1){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e+=1,n+=1){let l=i===n?a:d&&d[e],u=l?`${l}px`:``;o+=l||r,l||(s=!1),c?(c.style.width!==u&&(c.style.width=u),c=c.nextSibling):t.appendChild(document.createElement(`col`)).style.width=u}}for(;c;){let e=c.nextSibling;c.parentNode?.removeChild(c),c=e}s?(n.style.width=`${o}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${o}px`)}}var RB=void 0,zB=class{node;cellMinWidth;dom;scrollDom;table;colgroup;contentDOM;containerDOM;constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`table-container`,this.containerDOM=this.dom.appendChild(document.createElement(`div`)),this.containerDOM.className=`tableWrapper`,this.containerDOM.addEventListener(`wheel`,e=>this.handleHorizontalWheel(this.containerDOM,e)),this.containerDOM.addEventListener(`scroll`,()=>{if(!RB)return!1;let{view:e}=RB;e.dispatch(e.state.tr)}),this.scrollDom=document.createElement(`div`),this.scrollDom.className=`scrollWrapper`,this.containerDOM.appendChild(this.scrollDom),this.table=this.scrollDom.appendChild(document.createElement(`table`)),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),LB(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`)),setTimeout(()=>{this.updateTableShadow()})}update(e){return e.type===this.node.type?(this.node=e,LB(e,this.colgroup,this.table,this.cellMinWidth),this.updateTableShadow(),!0):!1}updateTableShadow(){let{scrollWidth:e,clientWidth:t,scrollLeft:n}=this.containerDOM;e>t&&n<e-t?this.dom.classList.add(`table-right-shadow`):this.dom.classList.remove(`table-right-shadow`),n>0?this.dom.classList.add(`table-left-shadow`):this.dom.classList.remove(`table-left-shadow`)}ignoreMutation(e){return e.type===`attributes`&&(e.target===this.table||e.target===this.dom||this.colgroup.contains(e.target))}handleHorizontalWheel(e,t){let{scrollWidth:n,clientWidth:r}=e;n>r&&(t.stopPropagation(),t.preventDefault(),e.scrollBy({left:t.deltaY}))}};let BB=new V(`tableBubbleMenu`),VB=Oz.extend({allowGapCursor:!0,addExtensions(){return[PB,IB,FB]},addOptions(){return{...this.parent?.(),HTMLAttributes:{},resizable:!0,handleWidth:5,cellMinWidth:25,View:zB,lastColumnResizable:!0,allowTableNodeSelection:!1,getToolboxItems({editor:e}){return{priority:40,component:(0,t.markRaw)(NE),props:{editor:e,icon:(0,t.markRaw)(Qz),title:N.global.t(`editor.menus.table.add`),action:()=>e.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run()}}},getCommandMenuItems(){return{priority:120,icon:(0,t.markRaw)(Pz),title:`editor.extensions.commands_menu.table`,keywords:[`table`,`biaoge`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).insertTable({rows:3,cols:3,withHeaderRow:!0}).run()}}},getBubbleMenu({editor:e}){return{pluginKey:BB,shouldShow:({state:e})=>Qm(e,VB.name),options:{placement:`bottom-start`},getReferencedVirtualElement(){let e=this.editor;if(!e)return null;let t=_m(e=>e.type.name===VB.name)(e.state.selection);if(t){let n=ah(e.view,t.start,t.start+t.node.nodeSize-2);return{getBoundingClientRect:()=>n,getClientRects:()=>[n]}}return null},items:[{priority:10,props:{icon:(0,t.markRaw)(Bz),title:N.global.t(`editor.menus.table.add_column_before`),action:()=>{e.chain().focus().addColumnBefore().run()}}},{priority:20,props:{icon:(0,t.markRaw)(Lz),title:N.global.t(`editor.menus.table.add_column_after`),action:()=>e.chain().focus().addColumnAfter().run()}},{priority:30,props:{icon:(0,t.markRaw)(Uz),title:N.global.t(`editor.menus.table.delete_column`),action:()=>e.chain().focus().deleteColumn().run()}},{priority:40,component:(0,t.markRaw)(C)},{priority:50,props:{icon:(0,t.markRaw)(sB),title:N.global.t(`editor.menus.table.add_row_before`),action:()=>e.chain().focus().addRowBefore().run()}},{priority:60,props:{icon:(0,t.markRaw)(iB),title:N.global.t(`editor.menus.table.add_row_after`),action:()=>e.chain().focus().addRowAfter().run()}},{priority:70,props:{icon:(0,t.markRaw)(uB),title:N.global.t(`editor.menus.table.delete_row`),action:()=>e.chain().focus().deleteRow().run()}},{priority:80,component:(0,t.markRaw)(C)},{priority:90,props:{icon:(0,t.markRaw)(Kz),title:N.global.t(`editor.menus.table.toggle_header_column`),action:()=>e.chain().focus().toggleHeaderColumn().run()}},{priority:100,props:{icon:(0,t.markRaw)(Kz),title:N.global.t(`editor.menus.table.toggle_header_row`),action:()=>e.chain().focus().toggleHeaderRow().run()}},{priority:101,props:{icon:(0,t.markRaw)(jz),title:N.global.t(`editor.menus.table.toggle_header_cell`),action:()=>e.chain().focus().toggleHeaderCell().run()}},{priority:110,component:(0,t.markRaw)(C)},{priority:120,props:{icon:(0,t.markRaw)(Yz),title:N.global.t(`editor.menus.table.merge_cells`),action:()=>e.chain().focus().mergeCells().run()}},{priority:130,props:{icon:(0,t.markRaw)(pB),title:N.global.t(`editor.menus.table.split_cell`),action:()=>e.chain().focus().splitCell().run()}},{priority:140,component:(0,t.markRaw)(C)},{priority:150,props:{icon:(0,t.markRaw)(tB),title:N.global.t(`editor.menus.table.delete_table`),action:()=>e.chain().focus().deleteTable().run()}}]}},getDraggableMenuItems(){return{extendsKey:VK,visible({editor:e}){return!Qm(e.state,`table`)}}}}},addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(e.commands.undoInputRule())return!0;let{selection:t}=e.state;return!Jp(e.state,VB.name)&&kB(e.state)&&t.empty?(e.commands.selectNodeBackward(),!0):Jp(e.state,VB.name)&&OB(e.state.selection)?(e.commands.deleteTable(),!0):!1};return{Backspace:()=>e(),"Mod-Backspace":()=>e(),"Mod-a":({editor:e})=>{if(!Jp(e.state,VB.name))return!1;let{tr:t,selection:n}=e.state;if(OB(n))return!0;if(TB(n))return _B(t),e.view.dispatch(t),!0;let r=_m(e=>e.type.name===PB.name)(n);return r||=_m(e=>e.type.name===FB.name)(n),r?(e.commands.setNodeSelection(r.pos),!0):!1},Tab:({editor:e})=>{let{state:t}=e;if(!Qm(e.state,VB.name))return!1;let n=e.view,r=e.state.tr,i=AB(t);return i||e.chain().addRowAfter().command(({tr:e,view:t,state:a})=>(n=t,r=e,i=AB(a),!0)),i?(r.setSelection(new R(r.doc.resolve(i.start),r.doc.resolve(i.start+(i.node?.nodeSize||0)-4))),r.scrollIntoView(),n.dispatch(r),!0):!1},"Shift-Tab":({editor:e})=>{let{tr:t}=e.state;if(!Qm(e.state,VB.name))return!1;let n=jB(e.state);return n&&(t.setSelection(new R(t.doc.resolve(n.start),t.doc.resolve(n.start+(n.node?.nodeSize||0)-4))),t.scrollIntoView(),e.view.dispatch(t)),!0}}},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=yz(e,this.options.cellMinWidth??25);return[`div`,{style:`overflow-x: auto; overflow-y: hidden;`},[`table`,G(this.options.HTMLAttributes??{},t??{},{style:r?`width: ${r}`:`minWidth: ${i}`}),n,[`tbody`,0]]]},onTransaction(){RB=this.editor}}).configure({resizable:!0}),HB=K.create({name:`indent`,priority:800,addOptions(){return{names:[`heading`,`paragraph`],indentRange:24,minIndentLevel:0,maxIndentLevel:240,defaultIndentLevel:0,HTMLAttributes:{},firstLineIndent:!0}},addGlobalAttributes(){return[{types:this.options.names,attributes:{indent:{default:this.options.defaultIndentLevel,renderHTML:e=>({style:e.indent==0?``:`margin-left: ${e.indent}px!important;`}),parseHTML:e=>parseInt(e.style.marginLeft,10)||this.options.defaultIndentLevel},lineIndent:{default:!1,renderHTML:e=>({style:e.lineIndent?`text-indent: 2em`:``}),parseHTML:e=>e.style.textIndent===`2em`}}}]},addCommands(){return{indent:()=>({tr:e,state:t,dispatch:n,editor:r})=>{let{selection:i}=t;return e=e.setSelection(i),e=KB(e,this.options,r.extensionManager.extensions,`indent`),e.docChanged&&n&&n(e),!0},outdent:()=>({tr:e,state:t,dispatch:n,editor:r})=>{let{selection:i}=t;return e=e.setSelection(i),e=KB(e,this.options,r.extensionManager.extensions,`outdent`),e.docChanged&&n&&n(e),!0}}},addKeyboardShortcuts(){return{Tab:YB(),"Shift-Tab":XB(!1),"Mod-]":YB(),"Mod-[":XB(!1),Backspace:({editor:e})=>{let{selection:t}=e.state,{$from:n}=t;if(n.parentOffset===0){let t=n.parent;if(t.attrs.lineIndent)return e.chain().focus().updateAttributes(t.type.name,{lineIndent:!1}).run();if(t.attrs.indent&&t.attrs.indent>0)return XB(!1)({editor:e})}return!1}}},onUpdate(){let{editor:e}=this;if(e.isActive(PO.name)){let t=e.state.selection.$head.node();t.attrs.indent&&e.commands.updateAttributes(t.type.name,{indent:0})}}}),UB=(e,t,n)=>e<t?t:e>n?n:e;function WB(e,t,n,r){if(!e.doc)return e;let i=e.doc.nodeAt(t);if(!i)return e;if(r.firstLineIndent&&GB(e)&&i.attrs.lineIndent!==n>0){let r={...i.attrs,lineIndent:n>0};return e.setNodeMarkup(t,i.type,r,i.marks)}let a=r.indentRange*n,o=r.minIndentLevel,s=r.maxIndentLevel,c=UB((i.attrs.indent||0)+a,o,s);if(c===i.attrs.indent)return e;let l={...i.attrs,indent:c};return e.setNodeMarkup(t,i.type,l,i.marks)}var GB=e=>{let{selection:t}=e,{$from:n,from:r,to:i}=t;return r==0?!0:r==i?n.textOffset==0:!1},KB=(e,t,n,r)=>{let{doc:i,selection:a}=e;if(!i||!a||!(a instanceof R))return e;let{from:o,to:s}=a;return i.nodesBetween(o,s,(i,a)=>t.names.includes(i.type.name)?(qB(e,a)&&r===`indent`?e.insertText(` `,o,s):e=WB(e,a,r===`indent`?1:-1,t),!1):!nh(i.type.name,n)),e},qB=(e,t)=>{let{selection:n}=e,{from:r,to:i}=n;return r==0?!1:r-i==0&&t!=r-1},JB=e=>e.isActive(VB.name)||e.isActive(TM.name);let YB=()=>({editor:e})=>{if(JB(e))return!1;if(mE(e)){let t=e.can().sinkListItem(`listItem`)?`listItem`:`taskItem`;return e.chain().focus().sinkListItem(t).run()}return e.chain().focus().indent().run()},XB=e=>({editor:t})=>{if(e&&t.state.selection.$head.parentOffset>0||JB(t))return!1;if(mE(t)){let e=t.can().liftListItem(`listItem`)?`listItem`:`taskItem`;return t.chain().focus().liftListItem(e).run()}return t.chain().focus().outdent().run()};var ZB=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,QB=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,$B=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,eV=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,tV=Vh.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,G(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[fg({find:ZB,type:this.type}),fg({find:$B,type:this.type})]},addPasteRules(){return[Lg({find:QB,type:this.type}),Lg({find:eV,type:this.type})]}}),nV={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function rV(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,nV,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M9 4a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-2.117l-1.75 14H14a1 1 0 1 1 0 2H8a1 1 0 1 1 0-2h2.117l1.75-14H10a1 1 0 0 1-1-1`})],-1)]])}var iV=(0,t.markRaw)({name:`mingcute-italic-line`,render:rV});let aV=tV.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:50,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(tV.name),icon:(0,t.markRaw)(iV),title:N.global.t(`editor.common.italic`),action:()=>e.chain().focus().toggleItalic().run()}}}}}});var oV=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,sV=`ελ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`,cV=`numeric`,lV=`ascii`,uV=`alpha`,dV=`asciinumeric`,fV=`alphanumeric`,pV=`domain`,mV=`emoji`,hV=`scheme`,gV=`slashscheme`,_V=`whitespace`;function vV(e,t){return e in t||(t[e]=[]),t[e]}function yV(e,t,n){for(let r in t[cV]&&(t[dV]=!0,t[fV]=!0),t[lV]&&(t[dV]=!0,t[uV]=!0),t[dV]&&(t[fV]=!0),t[uV]&&(t[fV]=!0),t[fV]&&(t[pV]=!0),t[mV]&&(t[pV]=!0),t){let t=vV(r,n);t.indexOf(e)<0&&t.push(e)}}function bV(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function xV(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}xV.groups={},xV.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=xV.groups;let i;return t&&t.j?i=t:(i=new xV(t),n&&r&&yV(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=xV.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new xV,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new xV,a&&(r&&(o.t&&typeof o.t==`string`?yV(a,Object.assign(bV(o.t,r),n),r):n&&yV(a,n,r)),o.t=a),i.j[e]=o,o}};var Z=(e,t,n,r,i)=>e.ta(t,n,r,i),SV=(e,t,n,r,i)=>e.tr(t,n,r,i),CV=(e,t,n,r,i)=>e.ts(t,n,r,i),Q=(e,t,n,r,i)=>e.tt(t,n,r,i),wV=`WORD`,TV=`UWORD`,EV=`ASCIINUMERICAL`,DV=`ALPHANUMERICAL`,OV=`LOCALHOST`,kV=`TLD`,AV=`UTLD`,jV=`SCHEME`,MV=`SLASH_SCHEME`,NV=`NUM`,PV=`WS`,FV=`NL`,IV=`OPENBRACE`,LV=`CLOSEBRACE`,RV=`OPENBRACKET`,zV=`CLOSEBRACKET`,BV=`OPENPAREN`,VV=`CLOSEPAREN`,HV=`OPENANGLEBRACKET`,UV=`CLOSEANGLEBRACKET`,WV=`FULLWIDTHLEFTPAREN`,GV=`FULLWIDTHRIGHTPAREN`,KV=`LEFTCORNERBRACKET`,qV=`RIGHTCORNERBRACKET`,JV=`LEFTWHITECORNERBRACKET`,YV=`RIGHTWHITECORNERBRACKET`,XV=`FULLWIDTHLESSTHAN`,ZV=`FULLWIDTHGREATERTHAN`,QV=`AMPERSAND`,$V=`APOSTROPHE`,eH=`ASTERISK`,tH=`AT`,nH=`BACKSLASH`,rH=`BACKTICK`,iH=`CARET`,aH=`COLON`,oH=`COMMA`,sH=`DOLLAR`,cH=`DOT`,lH=`EQUALS`,uH=`EXCLAMATION`,dH=`HYPHEN`,fH=`PERCENT`,pH=`PIPE`,mH=`PLUS`,hH=`POUND`,gH=`QUERY`,_H=`QUOTE`,vH=`FULLWIDTHMIDDLEDOT`,yH=`SEMI`,bH=`SLASH`,xH=`TILDE`,SH=`UNDERSCORE`,CH=`EMOJI`,wH=`SYM`,TH=Object.freeze({__proto__:null,ALPHANUMERICAL:DV,AMPERSAND:QV,APOSTROPHE:$V,ASCIINUMERICAL:EV,ASTERISK:eH,AT:tH,BACKSLASH:nH,BACKTICK:rH,CARET:iH,CLOSEANGLEBRACKET:UV,CLOSEBRACE:LV,CLOSEBRACKET:zV,CLOSEPAREN:VV,COLON:aH,COMMA:oH,DOLLAR:sH,DOT:cH,EMOJI:CH,EQUALS:lH,EXCLAMATION:uH,FULLWIDTHGREATERTHAN:ZV,FULLWIDTHLEFTPAREN:WV,FULLWIDTHLESSTHAN:XV,FULLWIDTHMIDDLEDOT:vH,FULLWIDTHRIGHTPAREN:GV,HYPHEN:dH,LEFTCORNERBRACKET:KV,LEFTWHITECORNERBRACKET:JV,LOCALHOST:OV,NL:FV,NUM:NV,OPENANGLEBRACKET:HV,OPENBRACE:IV,OPENBRACKET:RV,OPENPAREN:BV,PERCENT:fH,PIPE:pH,PLUS:mH,POUND:hH,QUERY:gH,QUOTE:_H,RIGHTCORNERBRACKET:qV,RIGHTWHITECORNERBRACKET:YV,SCHEME:jV,SEMI:yH,SLASH:bH,SLASH_SCHEME:MV,SYM:wH,TILDE:xH,TLD:kV,UNDERSCORE:SH,UTLD:AV,UWORD:TV,WORD:wV,WS:PV}),EH=/[a-z]/,DH=/\p{L}/u,OH=/\p{Emoji}/u,kH=/\d/,AH=/\s/,jH=`\r`,MH=`
173
+ `,NH=`️`,PH=`‍`,FH=``,IH=null,LH=null;function RH(e=[]){let t={};xV.groups=t;let n=new xV;IH??=HH(oV),LH??=HH(sV),Q(n,`'`,$V),Q(n,`{`,IV),Q(n,`}`,LV),Q(n,`[`,RV),Q(n,`]`,zV),Q(n,`(`,BV),Q(n,`)`,VV),Q(n,`<`,HV),Q(n,`>`,UV),Q(n,`(`,WV),Q(n,`)`,GV),Q(n,`「`,KV),Q(n,`」`,qV),Q(n,`『`,JV),Q(n,`』`,YV),Q(n,`<`,XV),Q(n,`>`,ZV),Q(n,`&`,QV),Q(n,`*`,eH),Q(n,`@`,tH),Q(n,"`",rH),Q(n,`^`,iH),Q(n,`:`,aH),Q(n,`,`,oH),Q(n,`$`,sH),Q(n,`.`,cH),Q(n,`=`,lH),Q(n,`!`,uH),Q(n,`-`,dH),Q(n,`%`,fH),Q(n,`|`,pH),Q(n,`+`,mH),Q(n,`#`,hH),Q(n,`?`,gH),Q(n,`"`,_H),Q(n,`/`,bH),Q(n,`;`,yH),Q(n,`~`,xH),Q(n,`_`,SH),Q(n,`\\`,nH),Q(n,`・`,vH);let r=SV(n,kH,NV,{[cV]:!0});SV(r,kH,r);let i=SV(r,EH,EV,{[dV]:!0}),a=SV(r,DH,DV,{[fV]:!0}),o=SV(n,EH,wV,{[lV]:!0});SV(o,kH,i),SV(o,EH,o),SV(i,kH,i),SV(i,EH,i);let s=SV(n,DH,TV,{[uV]:!0});SV(s,EH),SV(s,kH,a),SV(s,DH,s),SV(a,kH,a),SV(a,EH),SV(a,DH,a);let c=Q(n,MH,FV,{[_V]:!0}),l=Q(n,jH,PV,{[_V]:!0}),u=SV(n,AH,PV,{[_V]:!0});Q(n,FH,u),Q(l,MH,c),Q(l,FH,u),SV(l,AH,u),Q(u,jH),Q(u,MH),SV(u,AH,u),Q(u,FH,u);let d=SV(n,OH,CH,{[mV]:!0});Q(d,`#`),SV(d,OH,d),Q(d,NH,d);let f=Q(d,PH);Q(f,`#`),SV(f,OH,d);let p=[[EH,o],[kH,i]],m=[[EH,null],[DH,s],[kH,a]];for(let e=0;e<IH.length;e++)VH(n,IH[e],kV,wV,p);for(let e=0;e<LH.length;e++)VH(n,LH[e],AV,TV,m);yV(kV,{tld:!0,ascii:!0},t),yV(AV,{utld:!0,alpha:!0},t),VH(n,`file`,jV,wV,p),VH(n,`mailto`,jV,wV,p),VH(n,`http`,MV,wV,p),VH(n,`https`,MV,wV,p),VH(n,`ftp`,MV,wV,p),VH(n,`ftps`,MV,wV,p),yV(jV,{scheme:!0,ascii:!0},t),yV(MV,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[hV]:!0}:{[gV]:!0};r.indexOf(`-`)>=0?i[pV]=!0:EH.test(r)?kH.test(r)?i[dV]=!0:i[lV]=!0:i[cV]=!0,CV(n,r,r,i)}return CV(n,`localhost`,OV,{ascii:!0}),n.jd=new xV(wH),{start:n,tokens:Object.assign({groups:t},TH)}}function zH(e,t){let n=BH(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function BH(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function VH(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new xV(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new xV(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function HH(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var UH={defaultProtocol:`http`,events:null,format:GH,formatHref:GH,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function WH(e,t=null){let n=Object.assign({},UH);e&&(n=Object.assign(n,e instanceof WH?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}WH.prototype={o:UH,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:UH[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function GH(e){return e}function KH(e,t){this.t=`token`,this.v=e,this.tk=t}KH.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=UH.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function qH(e,t){class n extends KH{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var JH=qH(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),YH=qH(`text`),XH=qH(`nl`),ZH=qH(`url`,{isLink:!0,toHref(e=UH.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==OV&&e[1].t===aH}}),QH=e=>new xV(e);function $H({groups:e}){let t=e.domain.concat([QV,eH,tH,nH,rH,iH,sH,lH,dH,NV,fH,pH,mH,hH,bH,wH,xH,SH]),n=[$V,aH,oH,cH,uH,fH,gH,_H,yH,HV,UV,IV,LV,zV,RV,BV,VV,WV,GV,KV,qV,JV,YV,XV,ZV],r=[QV,$V,eH,nH,rH,iH,sH,lH,dH,IV,LV,fH,pH,mH,hH,gH,bH,wH,xH,SH],i=QH(),a=Q(i,xH);Z(a,r,a),Z(a,e.domain,a);let o=QH(),s=QH(),c=QH();Z(i,e.domain,o),Z(i,e.scheme,s),Z(i,e.slashscheme,c),Z(o,r,a),Z(o,e.domain,o);let l=Q(o,tH);Q(a,tH,l),Q(s,tH,l),Q(c,tH,l);let u=Q(a,cH);Z(u,r,a),Z(u,e.domain,a);let d=QH();Z(l,e.domain,d),Z(d,e.domain,d);let f=Q(d,cH);Z(f,e.domain,d);let p=QH(JH);Z(f,e.tld,p),Z(f,e.utld,p),Q(l,OV,p);let m=Q(d,dH);Q(m,dH,m),Z(m,e.domain,d),Z(p,e.domain,d),Q(p,cH,f),Q(p,dH,m),Z(Q(p,aH),e.numeric,JH);let h=Q(o,dH),g=Q(o,cH);Q(h,dH,h),Z(h,e.domain,o),Z(g,r,a),Z(g,e.domain,o);let _=QH(ZH);Z(g,e.tld,_),Z(g,e.utld,_),Z(_,e.domain,o),Z(_,r,a),Q(_,cH,g),Q(_,dH,h),Q(_,tH,l);let v=Q(_,aH),y=QH(ZH);Z(v,e.numeric,y);let b=QH(ZH),x=QH();Z(b,t,b),Z(b,n,x),Z(x,t,b),Z(x,n,x),Q(_,bH,b),Q(y,bH,b);let S=Q(s,aH),C=Q(Q(Q(c,aH),bH),bH);Z(s,e.domain,o),Q(s,cH,g),Q(s,dH,h),Z(c,e.domain,o),Q(c,cH,g),Q(c,dH,h),Z(S,e.domain,b),Q(S,bH,b),Q(S,gH,b),Z(C,e.domain,b),Z(C,t,b),Q(C,bH,b);let w=[[IV,LV],[RV,zV],[BV,VV],[HV,UV],[WV,GV],[KV,qV],[JV,YV],[XV,ZV]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=Q(b,r);Q(x,r,a),Q(a,i,b);let o=QH(ZH);Z(a,t,o);let s=QH();Z(a,n),Z(o,t,o),Z(o,n,s),Z(s,t,o),Z(s,n,s),Q(o,i,b),Q(s,i,b)}return Q(i,OV,_),Q(i,FV,XH),{start:i,tokens:TH}}function eU(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(tU(YH,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(tU(e,t,r))}}return o.length>0&&a.push(tU(YH,t,o)),a}function tU(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var nU=typeof console<`u`&&console&&console.warn||(()=>{}),rU=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,iU={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function aU(){return xV.groups={},iU.scanner=null,iU.parser=null,iU.tokenQueue=[],iU.pluginQueue=[],iU.customSchemes=[],iU.initialized=!1,iU}function oU(e,t=!1){if(iU.initialized&&nU(`linkifyjs: already initialized - will not register custom scheme "${e}" ${rU}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
174
+ 1. Must only contain digits, lowercase ASCII letters or "-"
175
+ 2. Cannot start or end with "-"
176
+ 3. "-" cannot repeat`);iU.customSchemes.push([e,t])}function sU(){iU.scanner=RH(iU.customSchemes);for(let e=0;e<iU.tokenQueue.length;e++)iU.tokenQueue[e][1]({scanner:iU.scanner});iU.parser=$H(iU.scanner.tokens);for(let e=0;e<iU.pluginQueue.length;e++)iU.pluginQueue[e][1]({scanner:iU.scanner,parser:iU.parser});return iU.initialized=!0,iU}function cU(e){return iU.initialized||sU(),eU(iU.parser.start,e,zH(iU.scanner.start,e))}cU.scan=zH;function lU(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new WH(n),i=cU(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}function uU(e,t=null){let n=cU(e);return n.length===1&&n[0].isLink&&(!t||n[0].t===t)}var dU=`[\0- \xA0 ᠎ -\u2029  ]`,fU=new RegExp(dU),pU=RegExp(`${dU}$`),mU=new RegExp(dU,`g`);function hU(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function gU(e){return new B({key:new V(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(Wm(fm(n.doc,[...t])).forEach(({newRange:t})=>{let n=hm(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!pU.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(fU).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=cU(n).map(t=>t.toObject(e.defaultProtocol));if(!hU(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{Km(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function _U(e){return new B({key:new V(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let e=r.target,t=[];for(;e.nodeName!==`DIV`;)t.push(e),e=e.parentNode;i=t.find(e=>e.nodeName===`A`)}if(!i)return!1;let a=Vm(t.state,e.type.name),o=i?.href??a.href,s=i?.target??a.target;return e.enableClickSelection&&e.editor.commands.extendMarkRange(e.type.name),i&&o?(window.open(o,s),!0):!1}}})}function vU(e){return new B({key:new V(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=lU(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.href)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function yU(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(mU,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,`i`))}let bU=Vh.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(e=>{if(typeof e==`string`){oU(e);return}oU(e.scheme,e.optionalSlashes)})},onDestroy(){aU()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!yU(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}},addAttributes(){return{href:{default:null,parseHTML(e){return e.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:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!yU(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!yU(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,G(this.options.HTMLAttributes,e),0]:[`a`,G(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href||``;return`[${t.renderChildren(e)}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!yU(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!yU(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addPasteRules(){return[Lg({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=lU(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!yU(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(gU({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!yU(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&e.push(_U({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(vU({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}).extend({addOptions(){return{...this.parent?.(),HTMLAttributes:{rel:null}}},renderHTML({HTMLAttributes:e}){return[`a`,e,0]},addPasteRules(){return[]}}).configure({autolink:!1,openOnClick:!1});var xU={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function SU(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,xU,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M7 13a2 2 0 0 1 1.995 1.85L9 15v3a2 2 0 0 1-1.85 1.995L7 20H4a2 2 0 0 1-1.995-1.85L2 18v-3a2 2 0 0 1 1.85-1.995L4 13zm9 4a1 1 0 0 1 .117 1.993L16 19h-4a1 1 0 0 1-.117-1.993L12 17zm-9-2H4v3h3zm13-2a1 1 0 1 1 0 2h-8a1 1 0 1 1 0-2zM7 3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm9 4a1 1 0 0 1 .117 1.993L16 9h-4a1 1 0 0 1-.117-1.993L12 7zM7 5H4v3h3zm13-2a1 1 0 0 1 .117 1.993L20 5h-8a1 1 0 0 1-.117-1.993L12 3z`})],-1)]])}var CU=(0,t.markRaw)({name:`mingcute-list-check-3-line`,render:SU}),wU={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function TU(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,wU,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M5.436 16.72a1.466 1.466 0 0 1 1.22 2.275a1.466 1.466 0 0 1-1.22 2.275c-.65 0-1.163-.278-1.427-.901a.65.65 0 1 1 1.196-.508a.18.18 0 0 0 .165.109c.109 0 .23-.03.23-.167c0-.1-.073-.143-.156-.154l-.051-.004a.65.65 0 0 1-.096-1.293l.096-.007c.102 0 .207-.037.207-.158c0-.137-.12-.167-.23-.167a.18.18 0 0 0-.164.11a.65.65 0 1 1-1.197-.509c.264-.622.777-.9 1.427-.9ZM20 18a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2zM6.08 9.945a1.552 1.552 0 0 1 .43 2.442l-.554.593h.47a.65.65 0 1 1 0 1.3H4.573a.655.655 0 0 1-.655-.654c0-.207.029-.399.177-.557L5.559 11.5c.11-.117.082-.321-.06-.392c-.136-.068-.249.01-.275.142l-.006.059a.65.65 0 0 1-.65.65c-.39 0-.65-.327-.65-.697a1.482 1.482 0 0 1 2.163-1.317ZM20 11a1 1 0 0 1 .117 1.993L20 13H9a1 1 0 0 1-.117-1.993L9 11zM6.15 3.39v3.24a.65.65 0 1 1-1.3 0V4.522a.65.65 0 0 1-.46-1.183l.742-.495a.655.655 0 0 1 1.018.545ZM20 4a1 1 0 0 1 .117 1.993L20 6H9a1 1 0 0 1-.117-1.993L9 4z`})],-1)]])}var EU=(0,t.markRaw)({name:`mingcute-list-ordered-line`,render:TU});let DU=tk.extend({addOptions(){return{...this.parent?.(),getCommandMenuItems(){return{priority:140,icon:(0,t.markRaw)(EU),title:`editor.common.ordered_list`,keywords:[`orderedlist`,`youxuliebiao`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleOrderedList().run()}}}}},addExtensions(){return[PO]}}),OU=ik.extend({addOptions(){return{...this.parent?.(),getCommandMenuItems(){return{priority:150,icon:(0,t.markRaw)(CU),title:`editor.common.task_list`,keywords:[`tasklist`,`renwuliebiao`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleTaskList().run()}}}}},addExtensions(){return[rk]}});var kU=[ck.name,DU.name,OU.name];let AU=K.create({name:`list-extra`,addOptions(){return{getToolbarItems({editor:e}){return e.extensionManager.extensions.some(e=>kU.includes(e.name))?{priority:130,component:(0,t.markRaw)(E),props:{editor:e,isActive:jU(e),icon:(0,t.markRaw)(MU(e)),title:N.global.t(`editor.common.list`)},children:PU(e)}:[]}}}});function jU(e){return e.isActive(ck.name)||e.isActive(DU.name)||e.isActive(OU.name)}function MU(e){return e.isActive(ck.name)?sk:e.isActive(DU.name)?EU:e.isActive(OU.name)?CU:sk}function NU(e,t){return e.extensionManager.extensions.some(e=>e.name===t)}function PU(e){let n=[];return NU(e,ck.name)&&n.push({priority:10,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive(ck.name),icon:(0,t.markRaw)(sk),title:N.global.t(`editor.common.bullet_list`),action:()=>e.chain().focus().toggleBulletList().run()}}),NU(e,DU.name)&&n.push({priority:20,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive(DU.name),icon:(0,t.markRaw)(EU),title:N.global.t(`editor.common.ordered_list`),action:()=>e.chain().focus().toggleOrderedList().run()}}),NU(e,OU.name)&&n.push({priority:30,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive(OU.name),icon:(0,t.markRaw)(CU),title:N.global.t(`editor.common.task_list`),action:()=>e.chain().focus().toggleTaskList().run()}}),n}let FU=KO.extend({addKeyboardShortcuts(){let e=e=>{let t=!1;return e.state.selection.empty?(this.options.listTypes?.forEach(({itemName:n,wrapperNames:r})=>{FO.handleBackspace(e,n,r)&&(t=!0)}),t):!1};return{Backspace:({editor:t})=>e(t),"Mod-Backspace":({editor:t})=>e(t)}}}),IU=K.create({name:`nodeSelected`,addOptions(){return{className:`has-node-selected`}},addProseMirrorPlugins(){return[new B({key:new V(`nodeSelectedByAttr`),props:{decorations:({doc:e})=>{let{isEditable:t,isFocused:n}=this.editor,r=[];return!t||!n?H.create(e,[]):(e.descendants((e,t)=>{if(e.isText||!e.attrs.selected)return!1;r.push(Wd.node(t,t+e.nodeSize,{class:this.options.className}))}),H.create(e,r))}}})]}}),LU=dk.configure({placeholder:N.global.t(`editor.extensions.commands_menu.placeholder`)});var RU={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function zU(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,RU,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M4 4a1 1 0 0 0 0 2h16a1 1 0 1 0 0-2zm-1 8a1 1 0 0 1 1-1h3a1 1 0 1 1 0 2H4a1 1 0 0 1-1-1m0 7a1 1 0 0 1 1-1h4a1 1 0 1 1 0 2H4a1 1 0 0 1-1-1m7-5a5 5 0 1 1 9.172 2.757l1.535 1.536a1 1 0 0 1-1.414 1.414l-1.536-1.535A5 5 0 0 1 10 14m5-3a3 3 0 1 0 0 6a3 3 0 0 0 0-6`})],-1)]])}var BU=(0,t.markRaw)({name:`mingcute-list-search-line`,render:zU}),VU={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function HU(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,VU,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,t.createElementVNode)(`path`,{d:`M14 4a1 1 0 0 1 1-1m0 7a1 1 0 0 1-1-1m7-5a1 1 0 0 0-1-1m1 6a1 1 0 0 1-1 1M3 7l3 3l3-3`}),(0,t.createElementVNode)(`path`,{d:`M6 10V5a2 2 0 0 1 2-2h2`}),(0,t.createElementVNode)(`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`})],-1)]])}var UU=(0,t.markRaw)({name:`lucide-replace`,render:HU}),WU={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function GU(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,WU,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,t.createElementVNode)(`path`,{d:`M14 14a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1m0-17a1 1 0 0 1 1-1m0 7a1 1 0 0 1-1-1m5 5a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1m2-17a1 1 0 0 0-1-1m1 6a1 1 0 0 1-1 1M3 7l3 3l3-3`}),(0,t.createElementVNode)(`path`,{d:`M6 10V5a2 2 0 0 1 2-2h2`}),(0,t.createElementVNode)(`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`})],-1)]])}var KU=(0,t.markRaw)({name:`lucide-replace-all`,render:GU}),qU={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function JU(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,qU,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M20.06 18a4 4 0 0 1-.2-.89c-.67.7-1.48 1.05-2.41 1.05c-.83 0-1.52-.24-2.05-.71c-.53-.45-.8-1.06-.8-1.79c0-.88.33-1.56 1-2.05s1.61-.73 2.83-.73h1.4v-.64q0-.735-.45-1.17c-.3-.29-.75-.43-1.33-.43c-.52 0-.95.12-1.3.36c-.35.25-.52.54-.52.89h-1.46c0-.43.15-.84.45-1.24c.28-.4.71-.71 1.22-.94c.51-.21 1.06-.35 1.69-.35c.98 0 1.74.24 2.29.73s.84 1.16.86 2.02V16c0 .8.1 1.42.3 1.88V18zm-2.4-1.12c.45 0 .88-.11 1.29-.32c.4-.21.7-.49.88-.83v-1.57H18.7c-1.77 0-2.66.47-2.66 1.41c0 .43.15.73.46.96c.3.23.68.35 1.16.35m-12.2-3.17h4.07L7.5 8.29zM6.64 6h1.72l4.71 12h-1.93l-.97-2.57H4.82L3.86 18H1.93z`},null,-1)]])}var YU=(0,t.markRaw)({name:`mdi-format-letter-case`,render:JU}),XU={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function ZU(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,XU,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M11.14 4L6.43 16h1.93l.96-2.57h5.35l.97 2.57h1.93L12.86 4M12 6.29l2.03 5.42H9.96M20 14v4H4v-3H2v5h20v-6Z`},null,-1)]])}var QU=(0,t.markRaw)({name:`mdi-format-letter-matches`,render:ZU}),$U={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function eW(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,$U,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M16 16.92c-.33.05-.66.08-1 .08s-.67-.03-1-.08v-3.51l-2.5 2.48c-.5-.39-1-.89-1.39-1.39l2.48-2.5H9.08c-.05-.33-.08-.66-.08-1s.03-.67.08-1h3.51l-2.48-2.5c.19-.25.39-.5.65-.74c.24-.26.49-.46.74-.65L14 8.59V5.08c.33-.05.66-.08 1-.08s.67.03 1 .08v3.51l2.5-2.48c.5.39 1 .89 1.39 1.39L17.41 10h3.51c.05.33.08.66.08 1s-.03.67-.08 1h-3.51l2.48 2.5c-.19.25-.39.5-.65.74c-.24.26-.49.46-.74.65L16 13.41zM5 19a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2`},null,-1)]])}var tW=(0,t.markRaw)({name:`mdi-regex`,render:eW}),nW={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function rW(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,nW,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`m11 17.243l-3.95-3.95a1 1 0 1 0-1.414 1.414l5.657 5.657a1 1 0 0 0 1.414 0l5.657-5.657a1 1 0 0 0-1.414-1.414L13 17.243V4a1 1 0 1 0-2 0z`})],-1)]])}var iW=(0,t.markRaw)({name:`mingcute-arrow-down-line`,render:rW}),aW={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function oW(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,aW,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M12.707 3.636a1 1 0 0 0-1.414 0L5.636 9.293a1 1 0 1 0 1.414 1.414L11 6.757V20a1 1 0 1 0 2 0V6.757l3.95 3.95a1 1 0 0 0 1.414-1.414z`})],-1)]])}var sW=(0,t.markRaw)({name:`mingcute-arrow-up-line`,render:oW}),cW=[`disabled`],lW=(0,t.defineComponent)({__name:`IconButton`,props:{disabled:{type:Boolean}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{type:`button`,class:(0,t.normalizeClass)([`rounded p-1`,{"text-gray-600 opacity-100 hover:bg-gray-100 hover:text-gray-900 active:bg-gray-200":!e.disabled,"opacity-50":e.disabled}]),disabled:e.disabled},[(0,t.renderSlot)(n.$slots,`default`)],10,cW))}}),uW=(0,t.defineComponent)({__name:`MatchToggleButton`,props:{isActive:{type:Boolean}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{type:`button`,class:(0,t.normalizeClass)([`rounded p-0.5 transition-all`,{"text-gray-600 hover:bg-gray-100 hover:text-gray-900 active:bg-gray-200":!e.isActive,"bg-primary/20 text-gray-900 outline outline-1 outline-primary/50 hover:bg-primary/30":e.isActive}])},[(0,t.renderSlot)(n.$slots,`default`)],2))}}),dW=[`onKeydown`],fW={class:`flex w-full flex-col gap-2`},pW={class:`relative flex items-center`},mW={class:`relative w-full max-w-[55%]`},hW=[`placeholder`,`onKeydown`],gW={class:`absolute inset-y-0 end-0 flex items-center gap-1 pr-1`},_W={class:`mx-2 min-w-[130px] text-sm`},vW={key:1},yW={class:`absolute right-0 flex h-full items-center`},bW={class:`flex items-center`},xW={class:`relative w-full max-w-[55%]`},SW=[`placeholder`,`onKeydown`],CW={class:`mx-2 flex items-center gap-2`},wW=(0,t.defineComponent)({__name:`SearchAndReplace`,props:{editor:{type:Object,required:!0},pluginKey:{type:Object,required:!0},visible:{type:Boolean,default:!1}},setup(e){let r=e,i=(0,t.ref)(``),a=(0,t.ref)(``),o=(0,t.ref)(!1),s=(0,t.ref)(!1),c=(0,t.ref)(!1),l=(0,t.ref)(!1),u=(0,t.computed)(()=>{l.value;let{editor:e,pluginKey:t}=r;if(!e||!t)return{findIndex:0,findCount:0};let n=t.getState(e.state);return{findIndex:n?.findIndex||0,findCount:n?.findCount||0}}),d=()=>{r.editor.commands.findNext()},f=()=>{r.editor.commands.findPrevious()},p=e=>{let{editor:t,pluginKey:n}=r;if(!t||!n)return;let i=t.state.tr;i.setMeta(n,e),t.view.dispatch(i),l.value=!l.value},m=()=>{r.editor.commands.replace(),l.value=!l.value},h=()=>{r.editor.commands.replaceAll(),l.value=!l.value},g=()=>{r.editor.commands.closeSearch()};(0,t.watch)(()=>i.value.trim(),(e,t)=>{e!==t&&p({setSearchTerm:e})}),(0,t.watch)(()=>a.value.trim(),(e,t)=>{e!==t&&p({setReplaceTerm:e})}),(0,t.watch)(()=>o.value,(e,t)=>{e!==t&&p({setRegex:e})}),(0,t.watch)(()=>s.value,(e,t)=>{e!==t&&p({setCaseSensitive:e})}),(0,t.watch)(()=>c.value,(e,t)=>{e!==t&&p({setMatchWord:e})});let _=(0,t.ref)(null);return(0,t.watch)(()=>r.visible,e=>{e&&(0,t.nextTick)(()=>{_.value?.focus()})}),(r,l)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)(t.Transition,{appear:``,name:`slide`},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{class:`absolute right-5 top-0 z-50 float-right flex min-w-[500px] justify-end rounded bg-white p-1 !pt-2 shadow`,onKeydown:(0,t.withKeys)((0,t.withModifiers)(g,[`prevent`]),[`escape`])},[(0,t.createElementVNode)(`section`,fW,[(0,t.createElementVNode)(`div`,pW,[(0,t.createElementVNode)(`div`,mW,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{ref_key:`searchInput`,ref:_,"onUpdate:modelValue":l[0]||=e=>i.value=e,type:`text`,class:`block size-full h-9 rounded-md bg-white px-3 text-sm text-gray-900 ring-1 ring-gray-100 transition-all placeholder:text-gray-400 focus:!ring-1 focus:!ring-primary`,placeholder:(0,t.unref)(N).global.t(`editor.extensions.search_and_replace.search_placeholder`),tabindex:`2`,onKeydown:(0,t.withKeys)((0,t.withModifiers)(d,[`prevent`]),[`enter`])},null,40,hW),[[t.vModelText,i.value]]),(0,t.createElementVNode)(`div`,gW,[(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)(uW,{"is-active":s.value,onClick:l[1]||=e=>s.value=!s.value},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(YU))]),_:1},8,[`is-active`])),[[(0,t.unref)(n.vTooltip),(0,t.unref)(N).global.t(`editor.extensions.search_and_replace.case_sensitive`)]]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)(uW,{"is-active":c.value,onClick:l[2]||=e=>c.value=!c.value},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(QU))]),_:1},8,[`is-active`])),[[(0,t.unref)(n.vTooltip),(0,t.unref)(N).global.t(`editor.extensions.search_and_replace.match_word`)]]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)(uW,{"is-active":o.value,onClick:l[3]||=e=>o.value=!o.value},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(tW))]),_:1},8,[`is-active`])),[[(0,t.unref)(n.vTooltip),(0,t.unref)(N).global.t(`editor.extensions.search_and_replace.use_regex`)]])])]),(0,t.createElementVNode)(`div`,_W,[u.value.findCount===0?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:(0,t.normalizeClass)({"text-red-600":i.value.length>0})},(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.search_and_replace.not_found`)),3)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,vW,(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.search_and_replace.occurrence_found`,{index:u.value.findIndex+1,total:u.value.findCount})),1))]),(0,t.createElementVNode)(`div`,yW,[(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)(lW,{disabled:u.value.findCount===0,onClick:f},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(sW))]),_:1},8,[`disabled`])),[[(0,t.unref)(n.vTooltip),(0,t.unref)(N).global.t(`editor.extensions.search_and_replace.find_previous`)]]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)(lW,{disabled:u.value.findCount===0,onClick:d},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(iW))]),_:1},8,[`disabled`])),[[(0,t.unref)(n.vTooltip),(0,t.unref)(N).global.t(`editor.extensions.search_and_replace.find_next`)]]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)(lW,{onClick:g},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(mL))]),_:1})),[[(0,t.unref)(n.vTooltip),(0,t.unref)(N).global.t(`editor.extensions.search_and_replace.close`)]])])]),(0,t.createElementVNode)(`div`,bW,[(0,t.createElementVNode)(`div`,xW,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":l[4]||=e=>a.value=e,type:`text`,class:`block size-full h-9 rounded-md bg-white px-3 text-sm text-gray-900 ring-1 ring-gray-100 transition-all placeholder:text-gray-400 focus:!ring-1 focus:!ring-primary`,placeholder:(0,t.unref)(N).global.t(`editor.extensions.search_and_replace.replace_placeholder`),tabindex:`2`,onKeydown:(0,t.withKeys)((0,t.withModifiers)(m,[`prevent`]),[`enter`])},null,40,SW),[[t.vModelText,a.value]])]),(0,t.createElementVNode)(`div`,CW,[(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)(lW,{disabled:u.value.findCount===0,onClick:m},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(UU))]),_:1},8,[`disabled`])),[[(0,t.unref)(n.vTooltip),(0,t.unref)(N).global.t(`editor.extensions.search_and_replace.replace`)]]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)(lW,{disabled:u.value.findCount===0,onClick:h},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(KU))]),_:1},8,[`disabled`])),[[(0,t.unref)(n.vTooltip),(0,t.unref)(N).global.t(`editor.extensions.search_and_replace.replace_all`)]])])])])],40,dW)]),_:1},512)),[[t.vShow,e.visible]])}});let TW=new V(`searchAndReplace`);var EW=class{editor;view;containerElement;init;constructor({view:e,editor:t,element:n}){this.editor=t,this.view=e,this.containerElement=n,this.init=!1}update(){let e=this.findEditorEntryElement();return!this.init&&e&&(e.insertAdjacentElement(`afterbegin`,this.containerElement),this.init=!0),!1}destroy(){return!1}findEditorEntryElement(){let e=this.editor.options.element;for(;e;){if(e.classList.contains(`editor-main`))return e;if(!e.parentElement)break;e=e.parentElement}return null}},DW=class{_findIndex;editor;enable;findIndexFlag;findCount;searchTerm;replaceTerm;regex;caseSensitive;wholeWord;results=[];searchResultDecorations=[];findIndexDecoration;constructor({editor:e,enable:t,regex:n,caseSensitive:r,wholeWord:i}){this.editor=e,this.enable=t||!1,this.searchTerm=``,this.replaceTerm=``,this.regex=n||!1,this.caseSensitive=r||!1,this.wholeWord=i||!1,this._findIndex=0,this.findCount=0,this.searchResultDecorations=[],this.findIndexDecoration=void 0,this.results=[],this.findIndexFlag=!0}get findIndex(){return this._findIndex}set findIndex(e){this._findIndex=this.verifySetIndex(e)}apply(e){let t=e.getMeta(TW);if(t&&`setEnable`in t&&(t.setEnable&&!this.enable&&(t.setSearchTerm=this.searchTerm),this.enable=t.setEnable),!this.enable)return this;if(t&&t.refresh&&this.processSearches(e),t&&`setReplaceTerm`in t&&(this.replaceTerm=t.setReplaceTerm),t&&`setFindIndex`in t){let{setFindIndex:e}=t;this.findIndex=e,this.processFindIndexDecoration()}return t&&this.scrollIntoFindIndexView(),t&&`setRegex`in t&&this.regex!==t.setRegex&&(this.regex=t.setRegex,t.setSearchTerm=this.searchTerm),t&&`setWholeWord`in t&&this.wholeWord!==t.setWholeWord&&(this.wholeWord=t.setWholeWord,t.setSearchTerm=this.searchTerm),t&&`setCaseSensitive`in t&&this.caseSensitive!==t.setCaseSensitive&&(this.caseSensitive=t.setCaseSensitive,t.setSearchTerm=this.searchTerm),t&&`setSearchTerm`in t?(this.searchTerm=t.setSearchTerm,this.findIndexFlag=!0,this.processSearches(e),this.scrollIntoFindIndexView(),this):e.docChanged?this.processSearches(e):(e.getMeta(`pointer`)&&(this.getNearestResultBySelection(e.selection),this.processFindIndexDecoration()),this)}scrollIntoFindIndexView(){let{results:e,editor:t,_findIndex:n}=this;if(e.length>n&&n>=0){let r=e[n];if(r){let{pos:e}=r,{view:n}=t,i=n.nodeDOM(e-1);i instanceof HTMLElement||(i=n.domAtPos(e,0).node),i instanceof HTMLElement&&UP(i,{behavior:`smooth`,scrollMode:`if-needed`})}}}verifySetIndex(e){let{results:t}=this;return t.length===0?0:e<=-1?t.length-1:e>t.length-1?0:e}processSearches({doc:e,selection:t}){let n=this.getFullText(e),r=this.getRegex();this.results.length=0;for(let e=0;e<n.length;e+=1){let{text:t,pos:i,index:a}=n[e],o=Array.from(t.matchAll(r)).filter(([e])=>e.trim());for(let e=0;e<o.length;e+=1){let t=o[e];if(t[0]===``)break;t.index!==void 0&&this.results.push({pos:i,index:a,from:i+t.index,to:i+t.index+t[0].length})}}return this.processResultDecorations(),this.findIndexFlag&&=(this.getNearestResultBySelection(t),!1),this.processFindIndexDecoration(),this}processFindIndexDecoration(){let{results:e,findIndex:t}=this,n=e[t];n&&(this.findIndexDecoration=Wd.inline(n.from,n.to,{class:`search-result-current`}))}processResultDecorations(){let{results:e}=this;this.findCount=e.length,this.searchResultDecorations.length=0;for(let t=0;t<e.length;t+=1){let n=e[t];this.searchResultDecorations.push(Wd.inline(n.from,n.to,{class:`search-result`}))}}getNearestResultBySelection(e){let{results:t}=this;for(let n=0;n<t.length;n+=1){let r=t[n];if(e&&e.to<=r.from){this.findIndex=n;break}}}getFullText(e){let t=[];return e.descendants((e,n,r,i)=>{e.isText&&t.push({text:`${e.text}`,pos:n,index:i})}),t}getRegex=()=>{let{searchTerm:e,regex:t,caseSensitive:n,wholeWord:r}=this,i=t?e:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return r&&(i=`\\b${i}\\b`),new RegExp(i,n?`gu`:`gui`)}};let OW=e=>new B({key:TW,view:t=>new EW({view:t,...e}),state:{init:()=>new DW({...e}),apply:(e,t)=>t.apply(e)},props:{decorations:e=>{let t=TW.getState(e);if(t){let{searchResultDecorations:n,findIndexDecoration:r,enable:i}=t;if(!i)return H.empty;let a=[...n];if(r&&a.push(r),a.length>0)return H.create(e.doc,a)}return H.empty}}});var kW=(0,t.h)(wW);function AW(){let e=kW.component;return e?e.props.visible:!1}let jW=K.create({name:`searchAndReplace`,addOptions(){return{getToolbarItems({editor:e}){return[{priority:230,component:(0,t.markRaw)(E),props:{editor:e,isActive:AW(),icon:(0,t.markRaw)(BU),title:N.global.t(`editor.extensions.search_and_replace.title`),action:()=>{let t=kW.component;t&&(t.props.visible?e.commands.closeSearch():e.commands.openSearch())}}}]}}},addCommands(){return{replace:()=>({state:e,dispatch:t})=>{let n=TW.getState(e);if(!n)return!1;let{replaceTerm:r,results:i,findIndex:a}=n,o=i[a];if(!o)return!1;let{from:s,to:c}=o;if(t){let n=e.tr;n.insertText(r,s,c),n.setMeta(TW,{setFindIndex:a,refresh:!0}),t(n)}return!1},replaceAll:()=>({state:e,dispatch:t})=>{let n=TW.getState(e);if(!n)return!1;let{replaceTerm:r,results:i}=n,a=e.tr,o=0;return i.forEach(e=>{let{from:t,to:n}=e;a.insertText(r,o+t,o+n),o=o+r.length-(n-t)}),t&&t(a),!1},findNext:()=>({state:e,dispatch:t})=>{if(t){let n=e.tr,r=TW.getState(e);if(!r)return!1;let{findIndex:i}=r;n.setMeta(TW,{setFindIndex:i+1}),t(n)}return!1},findPrevious:()=>({state:e,dispatch:t})=>{if(t){let n=TW.getState(e);if(!n)return!1;let{findIndex:r}=n,i=e.tr;i.setMeta(TW,{setFindIndex:r-1}),t(i)}return!1},openSearch:()=>({state:e,dispatch:t})=>{if(!TW.getState(e))return!1;let n=kW.component;if(n){n.props.visible=!0;let r=e.tr;r.setMeta(TW,{setEnable:!0}),t&&t(r)}return!1},closeSearch:()=>({state:e,dispatch:t})=>{if(!TW.getState(e))return!1;let n=kW.component;if(n){n.props.visible=!1;let r=e.tr;r.setMeta(TW,{setEnable:!1}),t&&t(r)}return!1}}},addProseMirrorPlugins(){let e=document.createElement(`div`);return e.style.position=`sticky`,e.style.top=`0`,e.style.zIndex=`50`,kW.props={editor:this.editor,pluginKey:TW,visible:!1},(0,t.render)(kW,e),[OW({editor:this.editor,element:e})]},addKeyboardShortcuts(){return{"Mod-f":()=>(this.editor.commands.openSearch(),!0)}}});var MW=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,NW=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,PW=Vh.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,G(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[fg({find:MW,type:this.type})]},addPasteRules(){return[Lg({find:NW,type:this.type})]}}),FW={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function IW(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,FW,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M19 12a1 1 0 0 1 .117 1.993L19 14h-2.11q.327.492.518 1.063c.953 2.859-1.109 5.809-4.083 5.933L13.13 21h-1.702a5.74 5.74 0 0 1-5.02-2.958l-.112-.213l-.182-.365a1 1 0 0 1-.105-.6a1 1 0 0 1 1.817-.427l.042.066l.217.431a3.74 3.74 0 0 0 3.131 2.06l.212.006h1.701a2.51 2.51 0 0 0 1.297-4.66l-.174-.096l-.488-.244H5a1 1 0 0 1-.117-1.993L5 12zm-6.428-9a5.74 5.74 0 0 1 5.132 3.171l.18.363a1.002 1.002 0 0 1-1.405 1.32a1 1 0 0 1-.316-.306l-.035-.058l-.213-.424A3.74 3.74 0 0 0 12.572 5h-1.701a2.51 2.51 0 0 0-1.123 4.756L12.236 11H8.013A4.5 4.5 0 0 1 6.59 8.937C5.618 6.017 7.791 3 10.871 3z`})],-1)]])}var LW=(0,t.markRaw)({name:`mingcute-strikethrough-line`,render:IW});let RW=PW.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:70,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(PW.name),icon:(0,t.markRaw)(LW),title:N.global.t(`editor.common.strike`),action:()=>e.chain().focus().toggleStrike().run()}}}}}});var zW=Vh.create({name:`subscript`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`sub`},{style:`vertical-align`,getAttrs(e){return e===`sub`?null:!1}}]},renderHTML({HTMLAttributes:e}){return[`sub`,G(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),BW={viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`};function VW(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,BW,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M248 208a8 8 0 0 1-8 8h-48a8 8 0 0 1-6.4-12.8l43.17-57.56a16 16 0 1 0-27.86-15a8 8 0 0 1-15.09-5.34a32.2 32.2 0 0 1 4.63-8.59a32 32 0 0 1 51.11 38.52L208 200h32a8 8 0 0 1 8 8M149.24 50a8 8 0 0 0-11.29.81L92 103.78l-45.95-53A8 8 0 0 0 34 61.24L81.41 116L34 170.76a8 8 0 0 0 12.1 10.48l46-53l45.95 53a8 8 0 1 0 12.1-10.48L102.59 116l47.46-54.76a8 8 0 0 0-.81-11.24`},null,-1)]])}var HW=(0,t.markRaw)({name:`ph-text-subscript`,render:VW});let UW=zW.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:120,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(zW.name),icon:(0,t.markRaw)(HW),title:N.global.t(`editor.common.subscript`),action:()=>e.chain().focus().toggleSubscript().run()}}}}}});var WW=Vh.create({name:`superscript`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`sup`},{style:`vertical-align`,getAttrs(e){return e===`super`?null:!1}}]},renderHTML({HTMLAttributes:e}){return[`sup`,G(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),GW={viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`};function KW(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,GW,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M248 144a8 8 0 0 1-8 8h-48a8 8 0 0 1-6.4-12.8l43.17-57.55a16 16 0 1 0-27.86-15a8 8 0 0 1-15.09-5.33a32 32 0 1 1 55.74 29.92L208 136h32a8 8 0 0 1 8 8m-98.76-70a8 8 0 0 0-11.29.8L92 127.79l-45.95-53A8 8 0 0 0 34 85.24L81.41 140L34 194.76a8 8 0 0 0 12.1 10.48l46-53l45.95 53a8 8 0 1 0 12.1-10.48L102.59 140l47.46-54.76a8 8 0 0 0-.81-11.24`},null,-1)]])}var qW=(0,t.markRaw)({name:`ph-text-superscript`,render:KW});let JW=WW.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:110,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(WW.name),icon:(0,t.markRaw)(qW),title:N.global.t(`editor.common.superscript`),action:()=>e.chain().focus().toggleSuperscript().run()}}}}}});var YW={class:`p-1`},XW={class:`text-xs text-gray-600`},ZW=(0,t.defineComponent)({__name:`ColorBubbleItem`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},setup(e){let n=e;function r(e){e&&n.editor?.chain().focus().setColor(e).run()}function i(){n.editor?.chain().focus().unsetColor().run()}return(a,o)=>((0,t.openBlock)(),(0,t.createBlock)(nM,{"onUpdate:modelValue":r},{prefix:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,YW,[(0,t.createElementVNode)(`div`,{class:`flex cursor-pointer items-center gap-2 rounded p-1 hover:bg-gray-100`,onClick:i},[o[0]||=(0,t.createElementVNode)(`div`,{class:`size-5 cursor-pointer rounded-sm bg-black ring-gray-300 ring-offset-1 hover:ring-1`},null,-1),(0,t.createElementVNode)(`span`,XW,(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.common.button.restore_default`)),1)])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Pq),(0,t.mergeProps)(n,{editor:e.editor}),null,16,[`editor`])]),_:1}))}}),QW={class:`p-1`},$W={class:`inline-flex items-center gap-2`},eG={class:`p-1`},tG={class:`text-xs text-gray-600`},nG=(0,t.defineComponent)({__name:`HighlightBubbleItem`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},setup(e){let n=e;function r(e){n.editor.isActive(bL.name)&&n.editor.chain().focus().unsetHighlight().run(),n.editor?.chain().focus().setHighlight(e?{color:e}:void 0).run()}function i(){n.editor?.chain().focus().unsetHighlight().run()}return(e,a)=>((0,t.openBlock)(),(0,t.createBlock)(nM,{"onUpdate:modelValue":r},{prefix:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,QW,[(0,t.createElementVNode)(`div`,{class:`flex cursor-pointer items-center gap-2 rounded p-1 text-xs text-gray-600 hover:bg-gray-100 hover:text-gray-900`,onClick:i},[(0,t.createElementVNode)(`div`,$W,[(0,t.createVNode)((0,t.unref)(mL)),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.highlight.unset`)),1)])])]),(0,t.createElementVNode)(`div`,eG,[(0,t.createElementVNode)(`div`,{class:`flex cursor-pointer items-center gap-2 rounded p-1 hover:bg-gray-100`,onClick:a[1]||=e=>r()},[a[2]||=(0,t.createElementVNode)(`div`,{class:`size-5 cursor-pointer rounded-sm ring-gray-300 ring-offset-1 hover:ring-1`,style:{"background-color":`#fff8c5`}},null,-1),(0,t.createElementVNode)(`span`,tG,(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.common.button.restore_default`)),1)])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Pq),(0,t.mergeProps)(n,{onClick:a[0]||=e=>r()}),null,16)]),_:1}))}}),rG={class:`relative w-96`},iG={class:`mr-2 mt-2 inline-flex items-center`},aG={class:`ml-2 text-sm text-gray-500`},oG={class:`mt-2 inline-flex items-center`},sG={class:`ml-2 text-sm text-gray-500`},cG=(0,t.defineComponent)({__name:`LinkBubbleButton`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},setup(e){let r=e,i=(0,t.computed)({get(){return r.editor.getAttributes(bU.name)?.href},set(e){r.editor.commands.setLink({href:e,target:a.value?`_blank`:`_self`,rel:o.value?`nofollow`:``})}}),a=(0,t.computed)({get(){return r.editor.getAttributes(bU.name)?.target===`_blank`},set(e){r.editor.commands.setLink({href:i.value,target:e?`_blank`:`_self`,rel:o.value?`nofollow`:``})}}),o=(0,t.computed)({get(){return r.editor.getAttributes(bU.name)?.rel===`nofollow`},set(e){r.editor.commands.setLink({href:i.value,target:a.value?`_blank`:`_self`,rel:e?`nofollow`:``})}}),s=()=>{if(r.isActive?.({editor:r.editor}))return;let{state:e}=r.editor,{selection:t}=e,{empty:n}=t;if(t instanceof R){if(n)return!1;let{content:e}=t.content();if(!e||e.childCount!==1)return!1;let i=e.firstChild?.textContent;i&&uU(i,`url`)&&r.editor.commands.setLink({href:i,target:`_self`,rel:``})}};return(r,c)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VDropdown),{class:`inline-flex`,triggers:[`click`],distance:10,onClick:s},{popper:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,rG,[(0,t.createVNode)(DD,{modelValue:i.value,"onUpdate:modelValue":c[0]||=e=>i.value=e,modelModifiers:{lazy:!0},"auto-focus":``,placeholder:(0,t.unref)(N).global.t(`editor.extensions.link.placeholder`)},null,8,[`modelValue`,`placeholder`]),(0,t.createElementVNode)(`label`,iG,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":c[1]||=e=>a.value=e,type:`checkbox`},null,512),[[t.vModelCheckbox,a.value]]),(0,t.createElementVNode)(`span`,aG,(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.link.open_in_new_window`)),1)]),(0,t.createElementVNode)(`label`,oG,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":c[2]||=e=>o.value=e,type:`checkbox`},null,512),[[t.vModelCheckbox,o.value]]),(0,t.createElementVNode)(`span`,sG,(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.link.nofollow`)),1)])])]),default:(0,t.withCtx)(()=>[(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{class:(0,t.normalizeClass)([`inline-flex size-8 items-center justify-center rounded-md text-lg text-gray-600 hover:bg-gray-100 active:!bg-gray-200`,{"bg-gray-200 !text-black":e.isActive?.({editor:e.editor})}])},[(0,t.createVNode)((0,t.unref)(rD))],2)),[[(0,t.unref)(n.vTooltip),e.isActive?.({editor:e.editor})?(0,t.unref)(N).global.t(`editor.extensions.link.edit_link`):(0,t.unref)(N).global.t(`editor.extensions.link.add_link`)]])]),_:1}))}}),lG=q.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),uG={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function dG(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,uG,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M18 19a1 1 0 0 1 .117 1.993L18 21H6a1 1 0 0 1-.117-1.993L6 19zM17 3a1 1 0 0 1 .993.883L18 4v8a6 6 0 0 1-11.996.225L6 12V4a1 1 0 0 1 1.993-.117L8 4v8a4 4 0 0 0 7.995.2L16 12V4a1 1 0 0 1 1-1`})],-1)]])}var fG=(0,t.markRaw)({name:`mingcute-underline-line`,render:dG}),pG={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function mG(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,pG,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M10.232 10.231a5 5 0 0 1 6.89-.172l.181.172l2.828 2.829a5 5 0 0 1-6.89 7.243l-.18-.172l-2.122-2.122a1 1 0 0 1 1.32-1.497l.094.083l2.122 2.122a3 3 0 0 0 4.377-4.1l-.135-.143l-2.828-2.828a3 3 0 0 0-4.243 0a1 1 0 0 1-1.414-1.415M8 17a1 1 0 0 1 .993.883L9 18v2a1 1 0 0 1-1.993.117L7 20v-2a1 1 0 0 1 1-1m-3-2a1 1 0 0 1 .117 1.993L5 17H4a1 1 0 0 1-.117-1.993L4 15zM3.868 3.867a5 5 0 0 1 6.89-.172l.181.172L13.06 5.99a1 1 0 0 1-1.32 1.497l-.094-.083l-2.121-2.121A3 3 0 0 0 5.147 9.38l.135.144l2.829 2.829a3 3 0 0 0 4.242 0a1 1 0 1 1 1.415 1.414a5 5 0 0 1-6.89.172l-.182-.172l-2.828-2.829a5 5 0 0 1 0-7.07ZM20 7a1 1 0 1 1 0 2h-1a1 1 0 1 1 0-2zm-4-4a1 1 0 0 1 .993.883L17 4v2a1 1 0 0 1-1.993.117L15 6V4a1 1 0 0 1 1-1`})],-1)]])}var hG=(0,t.markRaw)({name:`mingcute-unlink-line`,render:mG}),gG=Vh.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,G(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});let _G=gG.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:60,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(gG.name),icon:(0,t.markRaw)(fG),title:N.global.t(`editor.common.underline`),action:()=>e.chain().focus().toggleUnderline().run()}}}}}});var vG={class:`relative max-h-72 w-56 overflow-hidden overflow-y-auto`},yG=(0,t.defineComponent)({__name:`BubbleItemTextType`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},setup(e){let r=e,i=[{text:N.global.t(`editor.common.heading.paragraph`),icon:rL,action:()=>r.editor.chain().focus().setParagraph().run(),isActive:()=>r.editor.isActive(hF.name)},{text:N.global.t(`editor.common.heading.heading1`),icon:zI,action:()=>r.editor.chain().focus().setHeading({level:1}).run(),isActive:()=>r.editor.isActive(iL.name,{level:1})},{text:N.global.t(`editor.common.heading.heading2`),icon:HI,action:()=>r.editor.chain().focus().setHeading({level:2}).run(),isActive:()=>r.editor.isActive(iL.name,{level:2})},{text:N.global.t(`editor.common.heading.heading3`),icon:GI,action:()=>r.editor.chain().focus().setHeading({level:3}).run(),isActive:()=>r.editor.isActive(iL.name,{level:3})},{text:N.global.t(`editor.common.heading.heading4`),icon:JI,action:()=>r.editor.chain().focus().setHeading({level:4}).run(),isActive:()=>r.editor.isActive(iL.name,{level:4})},{text:N.global.t(`editor.common.heading.heading5`),icon:ZI,action:()=>r.editor.chain().focus().setHeading({level:5}).run(),isActive:()=>r.editor.isActive(iL.name,{level:5})},{text:N.global.t(`editor.common.heading.heading6`),icon:eL,action:()=>r.editor.chain().focus().setHeading({level:6}).run(),isActive:()=>r.editor.isActive(iL.name,{level:6})}],a=(0,t.computed)(()=>i.find(e=>e.isActive?.()));return(e,r)=>{let o=(0,t.resolveDirective)(`close-popper`);return(0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VDropdown),{class:`inline-flex`,"auto-hide":!0,distance:10},{popper:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,vG,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(i,e=>(0,t.withDirectives)((0,t.createVNode)(ae,{key:e.text,"is-active":e.isActive?.(),onClick:t=>e.action?.()},{icon:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon)))]),default:(0,t.withCtx)(()=>[(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.text),1)]),_:2},1032,[`is-active`,`onClick`]),[[o]])),64))])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(nO,{title:(0,t.unref)(N).global.t(`editor.common.heading.title`),"show-more-indicator":``},{icon:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(a.value?.icon)))]),_:1},8,[`title`])]),_:1})}}}),bG=[`audio`,`video`,`image`,`iframe`,`codeBlock`];let xG=new V(`textBubbleMenu`),SG=lG.extend({addOptions(){return{...this.parent?.(),getBubbleMenu(){return{pluginKey:xG,shouldShow:({state:e,from:t,to:n})=>{let{doc:r,selection:i}=e,{empty:a}=i;return!(a||bG.some(t=>Qm(e,t))||r.textBetween(t||0,n||0).length===0||!Cp(i)&&!(i instanceof SF))},items:[{priority:10,component:(0,t.markRaw)(yG)},{priority:20,component:(0,t.markRaw)(C)},{priority:30,props:{isActive:({editor:e})=>e.isActive(DO.name),icon:(0,t.markRaw)(EO),title:N.global.t(`editor.common.bold`),action:({editor:e})=>{e.chain().focus().toggleBold().run()}}},{priority:40,props:{isActive:({editor:e})=>e.isActive(aV.name),icon:(0,t.markRaw)(iV),title:N.global.t(`editor.common.italic`),action:({editor:e})=>{e.chain().focus().toggleItalic().run()}}},{priority:50,props:{isActive:({editor:e})=>e.isActive(_G.name),icon:(0,t.markRaw)(fG),title:N.global.t(`editor.common.underline`),action:({editor:e})=>e.chain().focus().toggleUnderline().run()}},{priority:60,props:{isActive:({editor:e})=>e.isActive(RW.name),icon:(0,t.markRaw)(LW),title:N.global.t(`editor.common.strike`),action:({editor:e})=>e.chain().focus().toggleStrike().run()}},{priority:70,component:(0,t.markRaw)(nG),props:{isActive:({editor:e})=>e.isActive(bL.name),icon:(0,t.markRaw)(dL),title:N.global.t(`editor.common.highlight`)}},{priority:80,component:(0,t.markRaw)(ZW),props:{isActive:({editor:e})=>e.isActive(oM.name),icon:(0,t.markRaw)(gA),title:N.global.t(`editor.common.color`)}},{priority:90,props:{isActive:({editor:e})=>e.isActive(wk.name),icon:(0,t.markRaw)(Ck),title:N.global.t(`editor.common.code`),action:({editor:e})=>e.chain().focus().toggleCode().run()}},{priority:100,props:{isActive:({editor:e})=>e.isActive(JW.name),icon:(0,t.markRaw)(qW),title:N.global.t(`editor.common.superscript`),action:({editor:e})=>e.chain().focus().toggleSuperscript().run()}},{priority:110,props:{isActive:({editor:e})=>e.isActive(UW.name),icon:(0,t.markRaw)(HW),title:N.global.t(`editor.common.subscript`),action:({editor:e})=>e.chain().focus().toggleSubscript().run()}},{priority:120,component:(0,t.markRaw)(cG),props:{isActive:({editor:e})=>e.isActive(bU.name)}},{priority:130,props:{isActive:()=>!1,visible:({editor:e})=>e.isActive(bU.name),icon:(0,t.markRaw)(hG),title:N.global.t(`editor.extensions.link.cancel_link`),action:({editor:e})=>e.commands.unsetLink()}},{priority:140,props:{isActive:()=>!1,visible:({editor:e})=>e.isActive(bU.name),icon:(0,t.markRaw)(lD),title:N.global.t(`editor.common.tooltip.open_link`),action:({editor:e})=>{let t=e.getAttributes(bU.name);t?.href&&window.open(t.href,`_blank`)}}}]}}}}});var CG=K.create({name:`textAlign`,addOptions(){return{types:[],alignments:[`left`,`center`,`right`,`justify`],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).some(e=>e):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,`textAlign`)).some(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign(`left`),"Mod-Shift-e":()=>this.editor.commands.setTextAlign(`center`),"Mod-Shift-r":()=>this.editor.commands.setTextAlign(`right`),"Mod-Shift-j":()=>this.editor.commands.setTextAlign(`justify`)}}}),wG={left:cO,center:aO,right:dO,justify:UL},TG=e=>{let t=cO;return Object.entries(wG).forEach(([n,r])=>{if(e.isActive({textAlign:n})){t=r;return}}),t};let EG=CG.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:180,component:(0,t.markRaw)(E),props:{editor:e,isActive:!1,icon:(0,t.markRaw)(TG(e)),title:N.global.t(`editor.common.align_method`)},children:[{priority:0,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive({textAlign:`left`}),icon:(0,t.markRaw)(cO),title:N.global.t(`editor.common.align_left`),action:()=>e.chain().focus().setTextAlign(`left`).run()}},{priority:10,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive({textAlign:`center`}),icon:(0,t.markRaw)(aO),title:N.global.t(`editor.common.align_center`),action:()=>e.chain().focus().setTextAlign(`center`).run()}},{priority:20,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive({textAlign:`right`}),icon:(0,t.markRaw)(dO),title:N.global.t(`editor.common.align_right`),action:()=>e.chain().focus().setTextAlign(`right`).run()}},{priority:30,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive({textAlign:`justify`}),icon:(0,t.markRaw)(UL),title:N.global.t(`editor.common.align_justify`),action:()=>e.chain().focus().setTextAlign(`justify`).run()}}]}}}}}).configure({types:[`heading`,`paragraph`]});function DG({types:e,node:t}){return Array.isArray(e)&&e.includes(t.type)||t.type===e}let OG=K.create({name:`trailingNode`,addOptions(){return{node:`paragraph`,notAfter:[`paragraph`]}},addProseMirrorPlugins(){let e=new V(this.name),t=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>this.options.notAfter.includes(e.name)),n=this.editor.isEditable;return[new B({key:e,appendTransaction:(t,r,i)=>{if(!n)return;let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[this.options.node];if(c)return o.insert(l,u.create())},state:{init:(e,r)=>{if(!n)return!1;let i=r.tr.doc.lastChild;return!DG({node:i,types:t})},apply:(e,r)=>{if(!n||!e.docChanged)return r;let i=e.doc.lastChild;return!DG({node:i,types:t})}}})]}});var kG={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function AG(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,kG,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,t.createElementVNode)(`rect`,{width:`18`,height:`14`,x:`3`,y:`5`,rx:`2`,ry:`2`}),(0,t.createElementVNode)(`path`,{d:`M7 15h4m4 0h2M7 11h2m4 0h4`})],-1)]])}var jG=(0,t.markRaw)({name:`lucide-captions`,render:AG}),MG={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function NG(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,MG,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M13.53 22H10c-.25 0-.46-.18-.5-.42l-.37-2.65c-.63-.25-1.17-.59-1.69-.99l-2.49 1.01c-.22.08-.49 0-.61-.22l-2-3.46a.493.493 0 0 1 .12-.64l2.11-1.66c-.04-.32-.07-.64-.07-.97s.03-.66.07-1L2.46 9.37a.493.493 0 0 1-.12-.64l2-3.46c.12-.22.39-.31.61-.22l2.49 1c.52-.39 1.06-.73 1.69-.98l.37-2.65c.04-.24.25-.42.5-.42h4c.25 0 .46.18.5.42l.37 2.65c.63.25 1.17.59 1.69.98l2.49-1c.22-.09.49 0 .61.22l2 3.46c.12.22.07.49-.12.64L19.43 11c.04.34.07.67.07 1v.19c-.5-.12-1-.19-1.5-.19c-.92 0-1.78.21-2.56.58c.03-.19.06-.38.06-.58c0-1.93-1.57-3.5-3.5-3.5S8.5 10.07 8.5 12s1.57 3.5 3.5 3.5c.2 0 .39-.03.58-.06a5.97 5.97 0 0 0 .95 6.56M16 15v6l5-3z`},null,-1)]])}var PG=(0,t.markRaw)({name:`mdi-cog-play`,render:NG}),FG={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function IG(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,FG,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M13.54 22H10c-.25 0-.46-.18-.5-.42l-.37-2.65c-.63-.25-1.17-.59-1.69-.99l-2.49 1.01c-.22.08-.49 0-.61-.22l-2-3.46a.493.493 0 0 1 .12-.64l2.11-1.66L4.5 12l.07-1l-2.11-1.63a.493.493 0 0 1-.12-.64l2-3.46c.12-.22.39-.31.61-.22l2.49 1c.52-.39 1.06-.73 1.69-.98l.37-2.65c.04-.24.25-.42.5-.42h4c.25 0 .46.18.5.42l.37 2.65c.63.25 1.17.59 1.69.98l2.49-1c.22-.09.49 0 .61.22l2 3.46c.13.22.07.49-.12.64L19.43 11l.07 1v.19c-.5-.12-1-.19-1.5-.19c-.17 0-.34 0-.5.03c0-.62-.1-1.24-.3-1.83l2.11-1.55l-.75-1.3l-2.41 1.04a5.42 5.42 0 0 0-3.03-1.77L12.75 4h-1.5l-.37 2.61c-1.2.25-2.26.89-3.03 1.78L5.44 7.35l-.75 1.3L6.8 10.2a5.55 5.55 0 0 0 0 3.6l-2.12 1.56l.75 1.3l2.43-1.04c.77.88 1.82 1.52 3.01 1.76l.37 2.62h1.11c.26.75.65 1.42 1.19 2m2.42-9.64c.04-.12.04-.24.04-.36c0-2.21-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4c.12 0 .24 0 .36-.04a6.05 6.05 0 0 1 3.6-3.6M12 14c-1.1 0-2-.89-2-2s.9-2 2-2s2 .9 2 2s-.89 2-2 2m4 1v6l5-3z`},null,-1)]])}var LG=(0,t.markRaw)({name:`mdi-cog-play-outline`,render:IG}),RG={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function zG(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,RG,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`,"fill-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M20 3a2 2 0 0 1 1.995 1.85L22 5v14a2 2 0 0 1-1.85 1.995L20 21H4a2 2 0 0 1-1.995-1.85L2 19V5a2 2 0 0 1 1.85-1.995L4 3zm0 2H4v14h16zm-9.66 2.638l.518.23l.338.16l.387.19l.43.218l.47.25l.507.28l.266.152l.518.305l.474.292l.43.273l.38.253l.48.33l.364.263l.095.07a1.234 1.234 0 0 1 0 1.98l-.323.235l-.44.308l-.356.239l-.405.263l-.453.283l-.499.3l-.534.309l-.509.282l-.471.25l-.43.22l-.386.188l-.622.288l-.23.1a1.234 1.234 0 0 1-1.714-.99l-.058-.565l-.032-.374l-.042-.664l-.023-.508l-.015-.555l-.004-.294l-.002-.305q0-.31.006-.6l.015-.555l.023-.507l.027-.457l.03-.401l.075-.744a1.235 1.235 0 0 1 1.715-.992m.611 2.501l-.436-.218l-.029.487l-.022.551l-.013.61l-.002.325l.002.325l.013.609l.01.283l.026.52l.015.235l.434-.218l.487-.256l.535-.294l.284-.162l.551-.326l.494-.306l.436-.28l.196-.13l-.407-.27l-.466-.294a30 30 0 0 0-.803-.48l-.283-.161l-.534-.294z`})],-1)]])}var BG=(0,t.markRaw)({name:`mingcute-video-line`,render:zG}),VG={class:`w-80`},HG=(0,t.defineComponent)({__name:`BubbleItemVideoLink`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},setup(e){let n=e,r=(0,t.computed)({get:()=>n.editor.getAttributes($.name).src,set:e=>{n.editor.chain().updateAttributes($.name,{src:e}).run()}});return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,VG,[(0,t.createVNode)(DD,{modelValue:r.value,"onUpdate:modelValue":n[0]||=e=>r.value=e,"auto-focus":``,placeholder:(0,t.unref)(N).global.t(`editor.common.placeholder.link_input`),label:(0,t.unref)(N).global.t(`editor.extensions.video.src_input_label`)},null,8,[`modelValue`,`placeholder`,`label`])]))}}),UG={class:`relative max-h-72 w-56 overflow-hidden overflow-y-auto`},WG=(0,t.defineComponent)({__name:`BubbleItemVideoPosition`,props:{editor:{},isActive:{},visible:{type:Function,default:()=>!0},icon:{},iconStyle:{},title:{},action:{}},setup(e){let r=e,i=[{text:N.global.t(`editor.common.align_left`),value:`left`,icon:cO},{text:N.global.t(`editor.common.align_center`),value:`center`,icon:aO},{text:N.global.t(`editor.common.align_right`),value:`right`,icon:dO}],a=(0,t.computed)(()=>{let e=r.editor.getAttributes($.name).position;return i.find(t=>t.value===e)||i[0]}),o=e=>r.editor.chain().focus().updateAttributes($.name,{position:e}).updateAttributes(DF.name,{position:e}).run();return(r,s)=>{let c=(0,t.resolveDirective)(`close-popper`);return e.visible({editor:e.editor})?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VDropdown),{key:0,class:`inline-flex`,"auto-hide":!0,distance:10},{popper:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,UG,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(i,n=>(0,t.withDirectives)((0,t.createVNode)(ae,{key:n.value,"is-active":e.editor.isActive({position:n.value}),onClick:e=>o(n.value)},{icon:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.icon)))]),default:(0,t.withCtx)(()=>[(0,t.createTextVNode)(` `+(0,t.toDisplayString)(n.text),1)]),_:2},1032,[`is-active`,`onClick`]),[[c]])),64))])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(nO,{title:(0,t.unref)(N).global.t(`editor.common.align_method`),"show-more-indicator":``},{icon:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(a.value.icon)))]),_:1},8,[`title`])]),_:1})):(0,t.createCommentVNode)(``,!0)}}}),GG={class:`flex w-56 flex-col gap-3`},KG={class:`flex flex-col items-center gap-3`},qG={class:`flex items-center gap-1 rounded-md bg-gray-100 p-1`},JG=[`onClick`],YG=(0,t.defineComponent)({__name:`BubbleItemVideoSize`,props:{editor:{},isActive:{type:Function},visible:{type:Function},icon:{},iconStyle:{},title:{},action:{type:Function}},setup(e){let r=e,i=(0,t.computed)({get:()=>r.editor.getAttributes($.name).width,set:e=>{o({width:e,height:a.value})}}),a=(0,t.computed)({get:()=>r.editor.getAttributes($.name).height,set:e=>{o({width:i.value,height:e})}});function o(e){r.editor.chain().updateAttributes($.name,e).setNodeSelection(r.editor.state.selection.from).focus().run()}let s=[{width:`25%`,height:`auto`,icon:XL,title:N.global.t(`editor.extensions.video.small_size`)},{width:`50%`,height:`auto`,icon:JR,title:N.global.t(`editor.extensions.video.medium_size`)},{width:`100%`,height:`auto`,icon:GR,title:N.global.t(`editor.extensions.video.large_size`)}];return(r,c)=>{let l=(0,t.resolveDirective)(`tooltip`);return e.visible?.({editor:e.editor})?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VDropdown),{key:0,class:`inline-flex`,"auto-hide":!0,distance:10},{popper:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,GG,[(0,t.createElementVNode)(`div`,KG,[(0,t.createVNode)(DD,{modelValue:i.value,"onUpdate:modelValue":c[0]||=e=>i.value=e,label:(0,t.unref)(N).global.t(`editor.common.width`),tooltip:(0,t.unref)(N).global.t(`editor.common.tooltip.custom_width_input`)},null,8,[`modelValue`,`label`,`tooltip`]),(0,t.createVNode)(DD,{modelValue:a.value,"onUpdate:modelValue":c[1]||=e=>a.value=e,label:(0,t.unref)(N).global.t(`editor.common.height`),tooltip:(0,t.unref)(N).global.t(`editor.common.tooltip.custom_height_input`)},null,8,[`modelValue`,`label`,`tooltip`])]),(0,t.createElementVNode)(`div`,qG,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s,e=>(0,t.withDirectives)((0,t.createElementVNode)(`button`,{key:e.width,class:(0,t.normalizeClass)([`inline-flex flex-1 items-center justify-center rounded px-2 py-1.5 text-gray-600 transition-all hover:text-gray-900`,{"bg-white text-gray-900":e.width===i.value&&e.height===a.value}]),onClick:t=>o({width:e.width,height:e.height})},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon)))],10,JG),[[l,e.title]])),64))])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(nO,{title:(0,t.unref)(N).global.t(`editor.extensions.video.resize`),"show-more-indicator":``},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(XL))]),_:1},8,[`title`])]),_:1})):(0,t.createCommentVNode)(``,!0)}}}),XG={key:0,class:`group relative`},ZG=[`src`,`controls`,`autoplay`,`loop`],QG={key:0,class:`absolute left-0 top-0 hidden w-full cursor-pointer justify-end gap-2 bg-gradient-to-b from-gray-300 to-transparent p-2 ease-in-out group-hover:flex`},$G={class:`relative`},eK={class:`absolute top-0 size-full bg-black bg-opacity-20`},tK={class:`absolute top-[50%] w-full space-y-2 text-white`},nK={class:`px-10`},rK={class:`relative h-4 w-full overflow-hidden rounded-full bg-gray-200`},iK={class:`absolute left-[50%] top-0 -translate-x-[50%] text-xs leading-4 text-white`},aK={class:`absolute top-0 size-full bg-black bg-opacity-20`},oK={class:`absolute top-[50%] w-full space-y-2 text-white`},sK={class:`px-10`},cK={class:`relative h-4 w-full overflow-hidden rounded-full bg-gray-200`},lK={class:`absolute left-[50%] top-0 -translate-x-[50%] text-xs leading-4 text-white`},uK=(0,t.defineComponent)({__name:`VideoView`,props:{decorations:{},selected:{type:Boolean},updateAttributes:{type:Function},deleteNode:{type:Function},node:{},view:{},getPos:{},innerDecorations:{},editor:{},extension:{},HTMLAttributes:{}},setup(e){let i=e,a=(0,t.computed)({get:()=>i.node?.attrs.src,set:e=>{i.updateAttributes({src:e})}}),o=(0,t.computed)(()=>i.node.attrs.controls),s=(0,t.computed)(()=>i.node.attrs.autoplay),c=(0,t.computed)(()=>i.node.attrs.loop),l=(0,t.computed)(()=>i.node?.attrs.position||`left`),u=(0,t.computed)(()=>!a.value),d=(0,t.ref)(),f=e=>{e&&i.updateAttributes({src:e.url})},p=()=>{let{file:e}=i.node.attrs;e&&i.updateAttributes({width:void 0,height:void 0,file:void 0})},m=()=>{d.value?.reset()},h=()=>{d.value?.abort()},{isExternalAsset:g,transferring:_,handleTransfer:v}=ID(a,f),y=(0,t.computed)(()=>i.node?.attrs.width?.includes(`%`));return(i,b)=>{let x=(0,t.resolveDirective)(`tooltip`);return(0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(JT),{as:`div`,class:(0,t.normalizeClass)([`flex w-full`,{"justify-start":l.value===`left`,"justify-center":l.value===`center`,"justify-end":l.value===`right`}])},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`relative inline-block h-full max-w-full overflow-hidden rounded-md text-center transition-all`,{"rounded ring-2":e.selected}]),style:(0,t.normalizeStyle)({width:u.value?`100%`:e.node.attrs.width,height:u.value?`100%`:e.node.attrs.height})},[a.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,XG,[(0,t.createElementVNode)(`video`,{src:a.value,controls:o.value,autoplay:s.value,loop:c.value,playsinline:``,preload:`metadata`,class:`m-0 rounded-md`,style:(0,t.normalizeStyle)({width:y.value?`100%`:e.node.attrs.width,height:y.value?`100%`:e.node.attrs.height})},null,12,ZG),a.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,QG,[(0,t.unref)(r.utils).permission.has([`uc:attachments:manage`,`system:attachments:manage`])&&(0,t.unref)(g)?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VButton),{key:0,loading:(0,t.unref)(_),size:`sm`,ghost:``,onClick:(0,t.unref)(v)},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.upload.operations.transfer.button`)),1)]),_:1},8,[`loading`,`onClick`])),[[x,(0,t.unref)(N).global.t(`editor.extensions.upload.operations.transfer.tooltip`)]]):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(FD),{accept:`video/*`,"original-link":a.value,upload:e.extension.options.uploadVideo,onChange:f},null,8,[`original-link`,`upload`])])):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),(0,t.withDirectives)((0,t.createElementVNode)(`div`,$G,[(0,t.createVNode)((0,t.unref)(ND),{ref_key:`editorLinkObtain`,ref:d,accept:`video/*`,editor:e.editor,"upload-to-attachment-file":e.extension.options.uploadVideo,"uploaded-file":e.node?.attrs.file,onSetExternalLink:f,onOnUploadFinish:p,onOnUploadAbort:p},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(BG),{class:`text-xl text-primary`})]),uploading:(0,t.withCtx)(({progress:e})=>[(0,t.createElementVNode)(`div`,eK,[(0,t.createElementVNode)(`div`,tK,[(0,t.createElementVNode)(`div`,nK,[(0,t.createElementVNode)(`div`,rK,[(0,t.createElementVNode)(`div`,{class:`h-full bg-primary`,style:(0,t.normalizeStyle)({width:`${e||0}%`})},null,4),(0,t.createElementVNode)(`div`,iK,(0,t.toDisplayString)(e?`${e}%`:`${(0,t.unref)(N).global.t(`editor.extensions.upload.loading`)}...`),1)])]),(0,t.createElementVNode)(`div`,{class:`inline-block cursor-pointer text-sm hover:opacity-70`,onClick:h},(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.common.button.cancel`)),1)])])]),error:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,aK,[(0,t.createElementVNode)(`div`,oK,[(0,t.createElementVNode)(`div`,sK,[(0,t.createElementVNode)(`div`,cK,[b[0]||=(0,t.createElementVNode)(`div`,{class:`size-full bg-red-600`},null,-1),(0,t.createElementVNode)(`div`,lK,(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.upload.error`)),1)])]),(0,t.createElementVNode)(`div`,{class:`inline-block cursor-pointer text-sm hover:opacity-70`,onClick:m},(0,t.toDisplayString)((0,t.unref)(N).global.t(`editor.extensions.upload.click_retry`)),1)])])]),_:1},8,[`editor`,`upload-to-attachment-file`,`uploaded-file`])],512),[[t.vShow,!a.value]])],6)]),_:1},8,[`class`])}}});let dK=new V(`videoBubbleMenu`),$=q.create({name:`video`,fakeSelection:!0,inline:!1,group:`block`,addAttributes(){return{...this.parent?.(),src:{default:null,parseHTML:e=>e.getAttribute(`src`)},width:{default:`100%`,parseHTML:e=>e.getAttribute(`width`)||e.style.width||null,renderHTML(e){return{width:e.width}}},height:{default:`auto`,parseHTML:e=>e.getAttribute(`height`)||e.style.height||null,renderHTML:e=>({height:e.height})},autoplay:{default:null,parseHTML:e=>e.getAttribute(`autoplay`),renderHTML:e=>({autoplay:e.autoplay})},controls:{default:!0,parseHTML:e=>e.getAttribute(`controls`),renderHTML:e=>({controls:e.controls})},loop:{default:null,parseHTML:e=>e.getAttribute(`loop`),renderHTML:e=>({loop:e.loop})},position:{default:`left`,parseHTML:e=>e.getAttribute(`data-position`)||e.getAttribute(`text-align`),renderHTML:e=>({"data-position":e.position})},file:{default:null,renderHTML(){return{}},parseHTML(){return null}}}},parseHTML(){return[{tag:`video`}]},renderHTML({HTMLAttributes:e}){return[`video`,G(e)]},addCommands(){return{setVideo:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[pg({find:/^\$video\$$/,type:this.type})]},addNodeView(){return rE(uK)},addProseMirrorPlugins(){return[new B({key:new V(`videoLegacyFormat`),appendTransaction:(e,t,n)=>{if(!e.some(e=>e.docChanged))return null;let r=n.tr,i=!1;return n.doc.descendants((e,t)=>{if(e.type.name!==$.name)return;let a=n.doc.resolve(t);if(a.parent.type.name===DF.name)return;let o=`left`,s=!1,c=-1,l=0,u=a.nodeBefore;u&&u.type.name===hF.name&&(u.attrs.textAlign&&(o={left:`left`,center:`center`,right:`right`,justify:`center`}[u.attrs.textAlign]||`left`),u.textContent?.trim().length===0&&(s=!0,c=t-u.nodeSize,l=u.nodeSize));let d=n.schema.nodes.figure.create({contentType:`video`,position:o},[e]);s?(r.delete(c,c+l),r.replaceRangeWith(t-l,t-l+e.nodeSize,d)):r.replaceRangeWith(t,t+e.nodeSize,d),i=!0}),i?r:null}})]},addOptions(){return{...this.parent?.(),uploadVideo:void 0,getCommandMenuItems(){return{priority:100,icon:(0,t.markRaw)(BG),title:`editor.extensions.commands_menu.video`,keywords:[`video`,`shipin`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).insertContent([{type:`figure`,attrs:{contentType:`video`},content:[{type:`video`,attrs:{src:``}}]},{type:`paragraph`,content:``}]).run()}}},getToolboxItems({editor:e}){return[{priority:20,component:(0,t.markRaw)(NE),props:{editor:e,icon:(0,t.markRaw)(BG),title:N.global.t(`editor.extensions.commands_menu.video`),action:()=>{e.chain().focus().insertContent([{type:`figure`,attrs:{contentType:`video`},content:[{type:`video`,attrs:{src:``}}]}]).run()}}}]},getBubbleMenu({editor:e}){return{pluginKey:dK,shouldShow:({state:e})=>Qm(e,$.name),options:{placement:`top-start`},items:[{priority:10,props:{isActive:()=>e.getAttributes($.name).controls,icon:(0,t.markRaw)(e.getAttributes($.name).controls?PG:LG),visible({editor:e}){return!HE(e.getAttributes($.name).src)},action:()=>e.chain().updateAttributes($.name,{controls:e.getAttributes($.name).controls?null:!0}).setNodeSelection(e.state.selection.from).focus().run(),title:e.getAttributes($.name).controls?N.global.t(`editor.extensions.video.disable_controls`):N.global.t(`editor.extensions.video.enable_controls`)}},{priority:20,props:{isActive:()=>e.getAttributes($.name).autoplay,visible({editor:e}){return!HE(e.getAttributes($.name).src)},icon:(0,t.markRaw)(e.getAttributes($.name).autoplay?ZE:eD),action:()=>e.chain().updateAttributes($.name,{autoplay:e.getAttributes($.name).autoplay?null:!0}).setNodeSelection(e.state.selection.from).focus().run(),title:e.getAttributes($.name).autoplay?N.global.t(`editor.extensions.video.disable_autoplay`):N.global.t(`editor.extensions.video.enable_autoplay`)}},{priority:30,props:{isActive:()=>e.getAttributes($.name).loop,visible({editor:e}){return!HE(e.getAttributes($.name).src)},icon:(0,t.markRaw)(e.getAttributes($.name).loop?GE:JE),action:()=>{e.chain().updateAttributes($.name,{loop:e.getAttributes($.name).loop?null:!0}).setNodeSelection(e.state.selection.from).focus().run()},title:e.getAttributes($.name).loop?N.global.t(`editor.extensions.video.disable_loop`):N.global.t(`editor.extensions.video.enable_loop`)}},{priority:40,component:(0,t.markRaw)(C),props:{visible({editor:e}){return!HE(e.getAttributes($.name).src)}}},{priority:50,component:(0,t.markRaw)(YG),props:{visible({editor:e}){return!HE(e.getAttributes($.name).src)}}},{priority:60,component:(0,t.markRaw)(WG),props:{visible({editor:e}){return!HE(e.getAttributes($.name).src)}}},{priority:70,component:(0,t.markRaw)(C),props:{visible({editor:e}){return!HE(e.getAttributes($.name).src)}}},{priority:80,props:{icon:(0,t.markRaw)(rD),title:N.global.t(`editor.common.button.edit_link`),action:()=>(0,t.markRaw)(HG)}},{priority:90,props:{visible({editor:e}){return!HE(e.getAttributes($.name).src)},icon:(0,t.markRaw)(lD),title:N.global.t(`editor.common.tooltip.open_link`),action:()=>{window.open(e.getAttributes($.name).src,`_blank`)}}},{priority:100,props:{visible({editor:e}){return!HE(e.getAttributes($.name).src)},icon:(0,t.markRaw)(jG),title:N.global.t(`editor.extensions.video.edit_caption`),action:({editor:e})=>{let t=_m(e=>e.type.name===DF.name)(e.state.selection);if(!t)return;let{node:n,pos:r}=t,i=-1;if(n.forEach((e,t)=>{e.type.name===EF.name&&(i=r+t+1)}),i!==-1){e.chain().focus().setTextSelection(i).run();return}let a=mm(e.state.selection.$from.node(),e=>e.type.name===$.name)[0],o=e.schema.nodes.figureCaption.create({width:a.node.attrs.width});e.chain().focus().command(({tr:e})=>{let t=r+n.nodeSize-1;return e.insert(t,o),e.setSelection(R.near(e.doc.resolve(t+1))),!0}).run()}}},{priority:110,component:(0,t.markRaw)(C)},{priority:120,props:{icon:(0,t.markRaw)(OE),title:N.global.t(`editor.common.button.delete`),action:({editor:e})=>{cE(_m(e=>e.type.name===`figure`)(e.state.selection)?`figure`:$.name,e)}}}]}}}}}),fK=e=>{let{view:t,state:n}=e,{from:r}=n.selection,i=t.nodeDOM(r);if(!i&&r>0&&n.doc.resolve(r).parent&&(i=t.domAtPos(r).node),i instanceof HTMLElement){let e=i.querySelector(`video`);if(e)return e;if(i.tagName===`VIDEO`)return i;let t=i.parentElement;if(t&&(e=t.querySelector(`video`),e))return e}return null},pK=(e,t,n)=>{let r=n||fK(e);if(!r||r.readyState<1)return;let i=r.videoWidth,a=i/r.videoHeight,o=Math.round(t/100*i);return{width:o,height:Math.round(o/a)}},mK=(e,t)=>{e.chain().updateAttributes($.name,t).setNodeSelection(e.state.selection.from).focus().run()},hK=K.create({name:`upload`,addProseMirrorPlugins(){let{editor:e}=this;return[new B({key:new V(`upload`),props:{handlePaste:(t,r,i)=>{if(t.props.editable&&!t.props.editable(t.state)||!r.clipboardData)return!1;let a=gK(i);a.length>0&&n.Dialog.info({title:N.global.t(`editor.common.text.tip`),description:N.global.t(`editor.extensions.upload.operations.transfer_in_batch.description`),confirmText:N.global.t(`editor.common.button.confirm`),cancelText:N.global.t(`editor.common.button.cancel`),async onConfirm(){await MK(e,a),n.Toast.success(N.global.t(`editor.common.toast.save_success`))}});let o=r.clipboardData.types;if(o.length>1||!jK(o))return!1;let s=Array.from(r.clipboardData.files);return s.length?(r.preventDefault(),s.forEach(t=>{TK({editor:e,file:t})}),!0):!1},handleDrop:(t,n)=>{if(t.props.editable&&!t.props.editable(t.state)||!n.dataTransfer||!(n.dataTransfer.files.length>0))return!1;n.preventDefault();let r=Array.from(n.dataTransfer.files);return r.length?(n.preventDefault(),r.forEach(t=>{TK({editor:e,file:t})}),!0):!1}}})]}});function gK(e){let t=[];return e.content.descendants((e,n,r,i)=>{[xK.name,$.name,X.name].includes(e.type.name)&&PK(e.attrs.src)&&t.push({node:e,pos:n,parent:r,index:i})}),t}let _K=K.create({name:`halo-extensions-kit`,addExtensions(){let e=[];return this.options.audio!==!1&&e.push(xK.configure(this.options.audio)),this.options.blockquote!==!1&&e.push(vO.configure(this.options.blockquote)),this.options.bold!==!1&&e.push(DO.configure(this.options.bold)),this.options.bulletList!==!1&&e.push(ck.configure(this.options.bulletList)),this.options.characterCount!==!1&&e.push(lk.configure(this.options.characterCount)),this.options.clearFormat!==!1&&e.push(_k.configure(this.options.clearFormat)),this.options.code!==!1&&e.push(wk.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(nA.configure(this.options.codeBlock)),this.options.color!==!1&&e.push(oM.configure(this.options.color)),this.options.columns!==!1&&e.push(TM.configure(this.options.columns)),this.options.commandsMenu!==!1&&e.push(JP),this.options.details!==!1&&e.push(cF.configure(this.options.details)),this.options.document!==!1&&e.push(lF),this.options.dropCursor!==!1&&e.push(uF.configure(this.options.dropCursor)),this.options.figure!==!1&&e.push(DF.configure(this.options.figure)),this.options.fontSize!==!1&&e.push(jF.configure(this.options.fontSize)),this.options.formatBrush!==!1&&e.push(RF.configure(this.options.formatBrush)),this.options.gallery!==!1&&e.push(bI.configure(this.options.gallery)),this.options.gapCursor!==!1&&e.push(OI),this.options.hardBreak!==!1&&e.push(FI.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(iL.configure(this.options.heading)),this.options.highlight!==!1&&e.push(bL.configure(this.options.highlight)),this.options.history!==!1&&e.push(DL.configure(this.options.history)),this.options.horizontalRule!==!1&&e.push(OL.configure(this.options.horizontalRule)),this.options.iframe!==!1&&e.push(hR.configure(this.options.iframe)),this.options.image!==!1&&e.push(X.configure(this.options.image)),this.options.indent!==!1&&e.push(HB.configure(this.options.indent)),this.options.italic!==!1&&e.push(aV.configure(this.options.italic)),this.options.link!==!1&&e.push(bU.configure(this.options.link)),this.options.listKeymap!==!1&&e.push(FU.configure(this.options.listKeymap)),this.options.nodeSelected!==!1&&e.push(IU.configure(this.options.nodeSelected)),this.options.orderedList!==!1&&e.push(DU.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(hF.configure(this.options.paragraph)),this.options.placeholder!==!1&&e.push(LU.configure(this.options.placeholder)),this.options.rangeSelection!==!1&&e.push(wF),this.options.searchAndReplace!==!1&&e.push(jW),this.options.strike!==!1&&e.push(RW.configure(this.options.strike)),this.options.subscript!==!1&&e.push(UW.configure(this.options.subscript)),this.options.superscript!==!1&&e.push(JW.configure(this.options.superscript)),this.options.table!==!1&&e.push(VB.configure(this.options.table)),this.options.taskList!==!1&&e.push(OU.configure(this.options.taskList)),this.options.text!==!1&&e.push(SG.configure(this.options.text)),this.options.textAlign!==!1&&e.push(EG.configure(this.options.textAlign)),this.options.textStyle!==!1&&e.push(fA.configure(this.options.textStyle)),this.options.trailingNode!==!1&&e.push(OG),this.options.underline!==!1&&e.push(_G.configure(this.options.underline)),this.options.upload!==!1&&e.push(hK),this.options.video!==!1&&e.push($.configure(this.options.video)),this.options.listExtra!==!1&&e.push(AU.configure(this.options.listExtra)),lE([...e,...this.options.customExtensions||[]])||[]}});var vK={class:`relative max-h-72 w-56 overflow-hidden overflow-y-auto`},yK=(0,t.defineComponent)({__name:`BubbleItemAudioPosition`,props:{editor:{},isActive:{},visible:{type:Function,default:()=>!0},icon:{},iconStyle:{},title:{},action:{}},setup(e){let r=e,i=[{text:N.global.t(`editor.common.align_left`),value:`left`,icon:cO},{text:N.global.t(`editor.common.align_center`),value:`center`,icon:aO},{text:N.global.t(`editor.common.align_right`),value:`right`,icon:dO}],a=(0,t.computed)(()=>{let e=r.editor.getAttributes(xK.name).position;return i.find(t=>t.value===e)||i[0]}),o=e=>r.editor.chain().focus().updateAttributes(xK.name,{position:e}).updateAttributes(DF.name,{position:e}).run();return(r,s)=>{let c=(0,t.resolveDirective)(`close-popper`);return e.visible({editor:e.editor})?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VDropdown),{key:0,class:`inline-flex`,"auto-hide":!0,distance:10},{popper:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,vK,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(i,n=>(0,t.withDirectives)((0,t.createVNode)(ae,{key:n.value,"is-active":e.editor.isActive({position:n.value}),onClick:e=>o(n.value)},{icon:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.icon)))]),default:(0,t.withCtx)(()=>[(0,t.createTextVNode)(` `+(0,t.toDisplayString)(n.text),1)]),_:2},1032,[`is-active`,`onClick`]),[[c]])),64))])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(nO,{title:(0,t.unref)(N).global.t(`editor.common.align_method`),"show-more-indicator":``},{icon:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(a.value.icon)))]),_:1},8,[`title`])]),_:1})):(0,t.createCommentVNode)(``,!0)}}});let bK=new V(`audioBubbleMenu`),xK=q.create({name:`audio`,fakeSelection:!0,inline:!1,group:`block`,addAttributes(){return{...this.parent?.(),src:{default:null,parseHTML:e=>e.getAttribute(`src`)},autoplay:{default:null,parseHTML:e=>e.getAttribute(`autoplay`),renderHTML:e=>({autoplay:e.autoplay})},controls:{default:!0,parseHTML:e=>e.getAttribute(`controls`),renderHTML:e=>({controls:e.controls})},loop:{default:null,parseHTML:e=>e.getAttribute(`loop`),renderHTML:e=>({loop:e.loop})},position:{default:`left`,parseHTML:e=>e.getAttribute(`data-position`)||e.getAttribute(`text-align`),renderHTML:e=>({"data-position":e.position})},file:{default:null,renderHTML(){return{}},parseHTML(){return null}}}},parseHTML(){return[{tag:`audio`}]},renderHTML({HTMLAttributes:e}){return[`audio`,G(e)]},addCommands(){return{setAudio:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[pg({find:/^\$audio\$$/,type:this.type,getAttributes:()=>({width:`100%`})})]},addNodeView(){return rE(ZD)},addOptions(){return{...this.parent?.(),uploadAudio:void 0,getCommandMenuItems(){return{priority:110,icon:(0,t.markRaw)(oD),title:`editor.extensions.commands_menu.audio`,keywords:[`audio`,`yinpin`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).insertContent([{type:`figure`,attrs:{contentType:`audio`},content:[{type:`audio`,attrs:{src:``}}]},{type:`paragraph`,content:``}]).run()}}},getToolboxItems({editor:e}){return{priority:30,component:(0,t.markRaw)(NE),props:{editor:e,icon:(0,t.markRaw)(oD),title:N.global.t(`editor.extensions.commands_menu.audio`),action:()=>{e.chain().focus().insertContent([{type:`figure`,attrs:{contentType:`audio`},content:[{type:`audio`,attrs:{src:``}}]}]).run()}}}},getBubbleMenu({editor:e}){return{pluginKey:bK,shouldShow:({state:e})=>Qm(e,xK.name),items:[{priority:10,props:{visible({editor:e}){return!HE(e.getAttributes(xK.name).src)},isActive:()=>e.getAttributes(xK.name).autoplay,icon:(0,t.markRaw)(e.getAttributes(xK.name).autoplay?ZE:eD),action:()=>{e.chain().updateAttributes(xK.name,{autoplay:e.getAttributes(xK.name).autoplay?null:!0}).setNodeSelection(e.state.selection.from).focus().run()},title:e.getAttributes(xK.name).autoplay?N.global.t(`editor.extensions.audio.disable_autoplay`):N.global.t(`editor.extensions.audio.enable_autoplay`)}},{priority:20,props:{visible({editor:e}){return!HE(e.getAttributes(xK.name).src)},isActive:()=>e.getAttributes(xK.name).loop,icon:(0,t.markRaw)(e.getAttributes(xK.name).loop?GE:JE),action:()=>{e.chain().updateAttributes(xK.name,{loop:e.getAttributes(xK.name).loop?null:!0}).setNodeSelection(e.state.selection.from).focus().run()},title:e.getAttributes(xK.name).loop?N.global.t(`editor.extensions.audio.disable_loop`):N.global.t(`editor.extensions.audio.enable_loop`)}},{priority:30,component:(0,t.markRaw)(C),props:{visible({editor:e}){return!HE(e.getAttributes(xK.name).src)}}},{priority:40,component:(0,t.markRaw)(yK),props:{visible({editor:e}){return!HE(e.getAttributes(xK.name).src)}}},{priority:50,component:(0,t.markRaw)(C),props:{visible({editor:e}){return!HE(e.getAttributes(xK.name).src)}}},{priority:60,props:{icon:(0,t.markRaw)(rD),title:N.global.t(`editor.common.button.edit_link`),action:()=>(0,t.markRaw)($D)}},{priority:70,props:{visible({editor:e}){return!HE(e.getAttributes(xK.name).src)},icon:(0,t.markRaw)(lD),title:N.global.t(`editor.common.tooltip.open_link`),action:()=>{window.open(e.getAttributes(xK.name).src,`_blank`)}}},{priority:80,component:(0,t.markRaw)(C)},{priority:90,props:{icon:(0,t.markRaw)(OE),title:N.global.t(`editor.common.button.delete`),action:({editor:e})=>{cE(_m(e=>e.type.name===`figure`)(e.state.selection)?`figure`:xK.name,e)}}}]}}}}});function SK(e,t,n){return e<t?n===`asc`?-1:1:e>t?n===`asc`?1:-1:0}function CK(e,t,n){return e.slice().sort((e,r)=>{let i=n.length;for(let a=0;a<t.length;a++){let o=i>a?n[a]:n[i-1],s=t[a],c=typeof s==`function`,l=SK(c?s(e):e[s],c?s(r):r[s],o);if(l!==0)return l}return 0})}function wK(e,t){return CK(e,t,[`asc`])}let TK=({file:e,editor:t})=>!e||!r.utils.permission.has([`uc:attachments:manage`,`system:attachments:manage`])?!1:e.type.startsWith(`image/`)?(EK({file:e,editor:t}),!0):e.type.startsWith(`video/`)?(DK({file:e,editor:t}),!0):(e.type.startsWith(`audio/`)&&OK({file:e,editor:t}),!0),EK=({file:e,editor:t})=>{let{view:n}=t,r=n.props.state.schema.nodes[X.name].create({file:e});t.view.dispatch(t.view.state.tr.replaceSelectionWith(r))},DK=({file:e,editor:t})=>{let{view:n}=t,r=n.props.state.schema.nodes[$.name].create({file:e});t.view.dispatch(t.view.state.tr.replaceSelectionWith(r))},OK=({file:e,editor:t})=>{let{view:n}=t,r=n.props.state.schema.nodes[xK.name].create({file:e});t.view.dispatch(t.view.state.tr.replaceSelectionWith(r))},kK=async(e,t,n)=>{let{signal:r}=n.controller;t(e,{signal:r,onUploadProgress(e){let t=Math.round(e.loaded*100/(e.total||0));n.onUploadProgress(t)}}).then(e=>{n.onFinish(e)}).catch(e=>{n.onError(e)})};function AK(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=function(){t(r.result)},r.onerror=function(e){n(e)},r.readAsDataURL(e)})}function jK(e){let t=[`files`,`application/x-moz-file`,`public.file-url`];return e.some(e=>t.includes(e.toLowerCase()))}async function MK(e,t){let n=PE(t,5);for(let t of n)await Promise.all(t.map(t=>NK(e,t)))}async function NK(e,t){let{node:n,pos:r}=t,{src:a}=n.attrs;if(PK(a))try{let{data:t}=await i.ucApiClient.storage.attachment.uploadAttachmentForUc({url:a}),o=t.status?.permalink,s=t.spec.displayName,c=e.view.state.tr;c.setNodeMarkup(r,n.type,{...n.attrs,src:o,name:s}),e.view.dispatch(c)}catch(e){console.error(`Failed to upload external link:`,e)}}function PK(e){if(e?.startsWith(`/`))return!1;let t=window.location.origin;return!e?.startsWith(t)}var FK={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function IK(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,FK,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`m19 3l-6 6l2 2l7-7V3m-10 9.5a.5.5 0 0 1-.5-.5a.5.5 0 0 1 .5-.5a.5.5 0 0 1 .5.5a.5.5 0 0 1-.5.5M6 20a2 2 0 0 1-2-2a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2M6 8a2 2 0 0 1-2-2a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2m3.64-.36c.23-.5.36-1.05.36-1.64a4 4 0 0 0-4-4a4 4 0 0 0-4 4a4 4 0 0 0 4 4c.59 0 1.14-.13 1.64-.36L10 12l-2.36 2.36C7.14 14.13 6.59 14 6 14a4 4 0 0 0-4 4a4 4 0 0 0 4 4a4 4 0 0 0 4-4c0-.59-.13-1.14-.36-1.64L12 14l7 7h3v-1z`},null,-1)]])}var LK=(0,t.markRaw)({name:`mdi-content-cut`,render:IK}),RK={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function zK(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,RK,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M2 12.08c-.006-.862.91-1.356 1.618-.975l.095.058l2.678 1.804c.972.655.377 2.143-.734 2.007l-.117-.02l-1.063-.234a8.002 8.002 0 0 0 14.804.605a1 1 0 0 1 1.82.828c-1.987 4.37-6.896 6.793-11.687 5.509A10 10 0 0 1 2 12.08m.903-4.228C4.89 3.482 9.799 1.06 14.59 2.343a10 10 0 0 1 7.414 9.581c.007.863-.91 1.358-1.617.976l-.096-.058l-2.678-1.804c-.972-.655-.377-2.143.734-2.007l.117.02l1.063.234A8.002 8.002 0 0 0 4.723 8.68a1 1 0 1 1-1.82-.828`})],-1)]])}var BK=(0,t.markRaw)({name:`mingcute-refresh-2-line`,render:zK});let VK=`convert-to`,HK=`delete`,UK=`copy`;var WK=[{priority:10,title:()=>N.global.t(`editor.drag.menu.convert_to`),key:VK,icon:(0,t.markRaw)(BK),children:{items:[]}},{priority:700,component:(0,t.markRaw)(x),visible:({editor:e})=>!Qm(e.state,`table`)},{priority:710,title:()=>N.global.t(`editor.drag.menu.copy`),key:UK,icon:(0,t.markRaw)(Pk),keyboard:`Mod-C`,action:async({editor:e,pos:t,node:n})=>{if(n){let r=n.nodeSize,i=t,a=t+r;e.commands.setTextSelection({from:i,to:a}),await oE(e)}}},{priority:720,title:()=>N.global.t(`editor.drag.menu.cut`),key:`cut`,icon:(0,t.markRaw)(LK),keyboard:`Mod-X`,action:async({editor:e,pos:t,node:n})=>{if(n){let r=n.nodeSize,i=t,a=t+r;e.commands.setTextSelection({from:i,to:a}),await oE(e)&&e.chain().focus().deleteRange({from:i,to:a}).run()}}},{priority:800,component:(0,t.markRaw)(x)},{priority:900,title:()=>N.global.t(`editor.drag.menu.delete`),key:HK,icon:(0,t.markRaw)(OE),keyboard:`Delete`,action:({editor:e,node:t})=>{t&&cE(t?.type.name,e)}}],GK={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function KK(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,GK,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`m14.475 12l-7.35-7.35q-.375-.375-.363-.888t.388-.887t.888-.375t.887.375l7.675 7.7q.3.3.45.675t.15.75t-.15.75t-.45.675l-7.7 7.7q-.375.375-.875.363T7.15 21.1t-.375-.888t.375-.887z`},null,-1)]])}var qK=(0,t.markRaw)({name:`material-symbols-arrow-forward-ios-rounded`,render:KK}),JK={class:`flex min-w-60 flex-col gap-0.5 bg-white`},YK=(0,t.defineComponent)({__name:`EditorDragMenu`,props:{editor:{type:Object,required:!0},node:{type:Object,required:!0},pos:{type:Number,required:!0},items:{type:Array,required:!0}},emits:[`close`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(new Map),o=e=>{for(let t of r.items)if(t.keyboard&&CE(e,t.keyboard)){e.preventDefault(),e.stopPropagation();let n=t.key||``,r=a.value.get(n);r&&r.triggerClick();return}};(0,t.onMounted)(()=>{window.addEventListener(`keydown`,o)}),(0,t.onUnmounted)(()=>{window.removeEventListener(`keydown`,o)});let s=(e,t)=>{t&&typeof t==`object`&&`triggerClick`in t&&a.value.set(e,t),t||a.value.delete(e)};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,JK,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,(n,a)=>((0,t.openBlock)(),(0,t.createBlock)(nq,(0,t.mergeProps)({key:n.key||String(a),ref_for:!0,ref:e=>s(n.key||String(a),e),editor:e.editor,node:e.node,pos:e.pos},{ref_for:!0},n,{onClose:r[0]||=e=>i(`close`)}),null,16,[`editor`,`node`,`pos`]))),128))]))}}),XK=[`title`],ZK={class:`flex items-center gap-2`},QK={class:`flex flex-grow justify-start px-0.5`},$K={key:0,class:`flex items-center gap-2`},eq={key:1,class:`flex items-center justify-center rounded-md border border-gray-200 bg-white p-0.5 px-1 font-sans text-xs font-bold text-gray-500`},tq={class:`relative overflow-hidden overflow-y-auto`},nq=(0,t.defineComponent)({__name:`EditorDragButtonItem`,props:{children:{},extendsKey:{},priority:{},title:{type:[String,Function]},icon:{},key:{},action:{type:Function},iconStyle:{},class:{},visible:{type:Function},isActive:{type:Function},disabled:{type:Function},keyboard:{},component:{},editor:{},node:{},pos:{}},emits:[`close`],setup(e,{expose:r,emit:i}){let a=e,o=i,s=(0,t.ref)(!1),c=(0,t.ref)(),l=async()=>{if((a.visible?.({editor:a.editor,node:a.node,pos:a.pos})??!0)&&!(a.disabled?.({editor:a.editor,node:a.node,pos:a.pos})??!1))if(a.action){let e=a.action?.({editor:a.editor,node:a.node,pos:a.pos,close:u}),t=e instanceof Promise?await e:e;typeof t==`object`&&t&&(c.value=t),(t===void 0||t===!0)&&u()}else s.value=!s.value},u=()=>{s.value=!1,o(`close`)},d=(0,t.computed)(()=>(a.children?.items?.length||0)>0),f=(0,t.computed)(()=>typeof a.title==`function`?a.title({editor:a.editor,node:a.node,pos:a.pos}):a.title);return r({triggerClick:()=>{l()}}),(e,r)=>a.visible?.({editor:a.editor,node:a.node,pos:a.pos})??!0?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VDropdown),{key:0,class:`inline-flex`,triggers:[],placement:`right`,shown:s.value&&d.value,distance:8,onHide:r[1]||=e=>s.value=!1},{popper:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,tq,[c.value?((0,t.openBlock)(),(0,t.createBlock)(t.KeepAlive,{key:0},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(c.value),(0,t.mergeProps)(a,{items:a.children?.items??[],onClose:u}),null,16,[`items`]))],1024)):((0,t.openBlock)(),(0,t.createBlock)(YK,{key:1,class:(0,t.normalizeClass)(`!min-w-full`),editor:a.editor,node:a.node,pos:a.pos,items:a.children?.items??[],onClose:u},null,8,[`editor`,`node`,`pos`,`items`]))])]),default:(0,t.withCtx)(()=>[a.component?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(a.component),(0,t.normalizeProps)((0,t.mergeProps)({key:0},a)),null,16)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:(0,t.normalizeClass)([`flex w-full rounded px-2 py-2 text-sm text-gray-600 transition-colors`,{"bg-gray-200 !text-black":a.isActive?.({editor:a.editor,node:a.node,pos:a.pos})},{"cursor-pointer hover:bg-gray-100 hover:text-gray-900 active:!bg-gray-200":!a.isActive?.({editor:a.editor,node:a.node,pos:a.pos})},a.class]),onClick:r[0]||=e=>l()},[(0,t.createElementVNode)(`button`,{title:f.value,class:`flex-grow`},[(0,t.createElementVNode)(`div`,ZK,[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(a.icon),{style:(0,t.normalizeStyle)(a.iconStyle),class:`size-4`},null,8,[`style`])),(0,t.createElementVNode)(`span`,QK,(0,t.toDisplayString)(f.value),1)])],8,XK),d.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,$K,[(0,t.createVNode)((0,t.unref)(qK),{class:`size-3`})])):a.keyboard?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,eq,(0,t.toDisplayString)((0,t.unref)(wE)(a.keyboard)),1)):(0,t.createCommentVNode)(``,!0)],2))]),_:1},8,[`shown`])):(0,t.createCommentVNode)(``,!0)}});function rq(e){if(!e.length)return H.empty;let t=[],n=e[0].$from.node(0);return e.forEach(e=>{let n=e.$from.pos,r=e.$from.nodeAfter;r&&t.push(Wd.node(n,n+r.nodeSize,{class:`ProseMirror-selectednoderange`}))}),H.create(n,t)}function iq(e,t,n){let r=[],i=e.node(0);typeof n==`number`&&n>=0||(n=e.sameParent(t)?Math.max(0,e.sharedDepth(t.pos)-1):e.sharedDepth(t.pos));let a=new Ni(e,t,n),o=a.depth===0?0:i.resolve(a.start).posAtIndex(0);return a.parent.forEach((e,t)=>{let n=o+t,s=n+e.nodeSize;if(n<a.start||n>=a.end)return;let c=new Ko(i.resolve(n),i.resolve(s));r.push(c)}),r}var aq=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return new oq(e.resolve(this.anchor),e.resolve(this.head))}},oq=class e extends L{constructor(e,t,n,r=1){let{doc:i}=e,a=e===t,o=e.pos===i.content.size&&t.pos===i.content.size,s=a&&!o?i.resolve(t.pos+(r>0?1:-1)):t,c=a&&o?i.resolve(e.pos-(r>0?1:-1)):e,l=iq(c.min(s),c.max(s),n),u=s.pos>=e.pos?l[0].$from:l[l.length-1].$to,d=s.pos>=e.pos?l[l.length-1].$to:l[0].$from;super(u,d,l),this.depth=n}get $to(){return this.ranges[this.ranges.length-1].$to}eq(t){return t instanceof e&&t.$from.pos===this.$from.pos&&t.$to.pos===this.$to.pos}map(t,n){return new e(t.resolve(n.map(this.anchor)),t.resolve(n.map(this.head)))}toJSON(){return{type:`nodeRange`,anchor:this.anchor,head:this.head}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){let{doc:t}=this.$from;if(this.isForwards&&this.ranges.length>1){let t=this.ranges.slice(0,-1),n=t[0].$from,r=t[t.length-1].$to;return new e(n,r,this.depth)}let n=this.ranges[0],r=t.resolve(Math.max(0,n.$from.pos-1));return new e(this.$anchor,r,this.depth)}extendForwards(){let{doc:t}=this.$from;if(this.isBackwards&&this.ranges.length>1){let t=this.ranges.slice(1),n=t[0].$from,r=t[t.length-1].$to;return new e(r,n,this.depth)}let n=this.ranges[this.ranges.length-1],r=t.resolve(Math.min(t.content.size,n.$to.pos+1));return new e(this.$anchor,r,this.depth)}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n,r,i=1){return new this(e.resolve(t),e.resolve(n),r,i)}getBookmark(){return new aq(this.anchor,this.head)}};oq.prototype.visible=!1;function sq(e){return e instanceof oq}K.create({name:`nodeRange`,addOptions(){return{depth:void 0,key:`Mod`}},addKeyboardShortcuts(){return{"Shift-ArrowUp":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,selection:a,tr:o}=r,{anchor:s,head:c}=a;if(!sq(a)){let e=oq.create(i,s,c,t,-1);return o.setSelection(e),n.dispatch(o),!0}let l=a.extendBackwards();return o.setSelection(l),n.dispatch(o),!0},"Shift-ArrowDown":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,selection:a,tr:o}=r,{anchor:s,head:c}=a;if(!sq(a)){let e=oq.create(i,s,c,t);return o.setSelection(e),n.dispatch(o),!0}let l=a.extendForwards();return o.setSelection(l),n.dispatch(o),!0},"Mod-a":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,tr:a}=r,o=oq.create(i,0,i.content.size,t);return a.setSelection(o),n.dispatch(a),!0}}},onSelectionUpdate(){let{selection:e}=this.editor.state;sq(e)&&this.editor.view.dom.classList.add(`ProseMirror-noderangeselection`)},addProseMirrorPlugins(){let e=!1,t=!1;return[new B({key:new V(`nodeRange`),props:{attributes:()=>e?{class:`ProseMirror-noderangeselection`}:{class:``},handleDOMEvents:{mousedown:(e,n)=>{let{key:r}=this.options,i=/Mac/.test(navigator.platform),a=!!n.shiftKey,o=!!n.ctrlKey,s=!!n.altKey,c=!!n.metaKey;return(r==null||r===`Shift`&&a||r===`Control`&&o||r===`Alt`&&s||r===`Meta`&&c||r===`Mod`&&(i?c:o))&&(t=!0),t&&document.addEventListener(`mouseup`,()=>{t=!1;let{state:n}=e,{doc:r,selection:i,tr:a}=n,{$anchor:o,$head:s}=i;if(o.sameParent(s))return;let c=oq.create(r,o.pos,s.pos,this.options.depth);a.setSelection(c),e.dispatch(a)},{once:!0}),!1}},decorations:n=>{let{selection:r}=n,i=sq(r);if(e=!1,!t)return i?(e=!0,rq(r.ranges)):null;let{$from:a,$to:o}=r;if(!i&&a.sameParent(o))return null;let s=iq(a,o,this.options.depth);return s.length?(e=!0,rq(s)):null}}})]}});function cq(e){let t=``,n=getComputedStyle(e);for(let e=0;e<n.length;e+=1)t+=`${n[e]}:${n.getPropertyValue(n[e])};`;return t}function lq(e){let t=e.cloneNode(!0),n=[e,...Array.from(e.getElementsByTagName(`*`))],r=[t,...Array.from(t.getElementsByTagName(`*`))];return n.forEach((e,t)=>{r[t].style.cssText=cq(e)}),t}function uq(e,t){let n=e;for(;n?.parentElement&&n.parentElement!==t.dom;)n=n.parentElement;return n?.parentElement===t.dom?n:void 0}function dq(e,t,n,r=5){let i=e.dom,a=i.firstElementChild,o=i.lastElementChild;if(!a||!o)return{x:t,y:n};let s=a.getBoundingClientRect(),c=o.getBoundingClientRect(),l=Math.min(Math.max(s.top+r,n),c.bottom-r),u=.5,d=Math.abs(s.left-c.left)<u,f=Math.abs(s.right-c.right)<u,p=s;return d&&f&&(p=s),{x:Math.min(Math.max(p.left+r,t),p.right-r),y:l}}var fq=e=>{let{x:t,y:n,editor:r}=e,{view:i,state:a}=r,{x:o,y:s}=dq(i,t,n,5),c=i.root.elementsFromPoint(o,s),l;if(Array.prototype.some.call(c,e=>{if(!i.dom.contains(e))return!1;let t=uq(e,i);return t?(l=t,!0):!1}),!l)return{resultElement:null,resultNode:null,pos:null};let u;try{u=i.posAtDOM(l,0)}catch{return{resultElement:null,resultNode:null,pos:null}}let d=a.doc.nodeAt(u);return{resultElement:l,resultNode:d,pos:u}};function pq(e,t){return window.getComputedStyle(e)[t]}function mq(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function hq(e,t,n){let r=parseInt(pq(e.dom,`paddingLeft`),10),i=parseInt(pq(e.dom,`paddingRight`),10),a=parseInt(pq(e.dom,`borderLeftWidth`),10),o=parseInt(pq(e.dom,`borderLeftWidth`),10),s=e.dom.getBoundingClientRect();return{left:mq(t,s.left+r+a,s.right-i-o),top:n}}function gq(e){var t;(t=e.parentNode)==null||t.removeChild(e)}function _q(e,t){let{doc:n}=t.view.state,r=fq({editor:t,x:e.clientX,y:e.clientY,direction:`right`});if(!r.resultNode||r.pos===null)return[];let i=e.clientX,a=hq(t.view,i,e.clientY),o=t.view.posAtCoords(a);if(!o)return[];let{pos:s}=o;return n.resolve(s).parent?iq(n.resolve(r.pos),n.resolve(r.pos+1),0):[]}function vq(e,t){let{view:n}=t;if(!e.dataTransfer)return;let{empty:r,$from:i,$to:a}=n.state.selection,o=_q(e,t),s=iq(i,a,0),c=s.some(e=>o.find(t=>t.$from===e.$from&&t.$to===e.$to)),l=r||!c?o:s;if(!l.length)return;let{tr:u}=n.state,d=document.createElement(`div`),f=l[0].$from.pos,p=l[l.length-1].$to.pos,m=oq.create(n.state.doc,f,p),h=m.content();l.forEach(e=>{let t=lq(n.nodeDOM(e.$from.pos));d.append(t)}),d.style.position=`absolute`,d.style.top=`-10000px`,document.body.append(d),e.dataTransfer.clearData(),e.dataTransfer.setDragImage(d,0,0),n.dragging={slice:h,move:!0},u.setSelection(m),n.dispatch(u),document.addEventListener(`drop`,()=>gq(d),{once:!0})}var yq=(e,t)=>{let n=e.resolve(t),{depth:r}=n;return r===0?t:n.pos-n.parentOffset-1},bq=(e,t)=>{let n=e.nodeAt(t),r=e.resolve(t),{depth:i}=r,a=n;for(;i>0;){let e=r.node(i);--i,i===0&&(a=e)}return a},xq=(e,t)=>{let n=t;for(;n?.parentNode&&n.parentNode!==e.dom;)n=n.parentNode;return n},Sq=new V(`dragHandle`),Cq=({pluginKey:e=Sq,element:t,editor:n,computePositionConfig:r,getReferencedVirtualElement:i,onNodeChange:a,onElementDragStart:o,onElementDragEnd:s})=>{let c=document.createElement(`div`),l=!1,u=null,d=-1,f=null,p=null;function m(){t&&(t.style.visibility=`hidden`,t.style.pointerEvents=`none`)}function h(){if(t){if(!n.isEditable){m();return}t.style.visibility=``,t.style.pointerEvents=`auto`}}function g(e){jP(i?.()||{getBoundingClientRect:()=>e.getBoundingClientRect()},t,r).then(e=>{Object.assign(t.style,{position:e.strategy,left:`${e.x}px`,top:`${e.y}px`})})}function _(e){o?.(e),vq(e,n),setTimeout(()=>{t&&(t.style.pointerEvents=`none`)},0)}function v(e){s?.(e),m(),t&&(t.style.pointerEvents=`auto`)}return t.addEventListener(`dragstart`,_),t.addEventListener(`dragend`,v),c.appendChild(t),{unbind(){t.removeEventListener(`dragstart`,_),t.removeEventListener(`dragend`,v),f&&(cancelAnimationFrame(f),f=null,p=null)},plugin:new B({key:typeof e==`string`?new V(e):e,state:{init(){return{locked:!1}},apply(e,r,i,o){let s=e.getMeta(`lockDragHandle`),c=e.getMeta(`hideDragHandle`);if(s!==void 0&&(l=s),c)return m(),l=!1,u=null,d=-1,a?.({editor:n,node:null,pos:-1}),r;if(e.docChanged&&d!==-1&&t){let t=e.mapping.map(d);t!==d&&(d=t)}return r}},view:e=>{var r;return t.draggable=!0,t.style.pointerEvents=`auto`,(r=n.view.dom.parentElement)==null||r.appendChild(c),c.style.pointerEvents=`none`,c.style.position=`absolute`,c.style.top=`0`,c.style.left=`0`,{update(r,i){if(!t)return;if(!n.isEditable){m();return}if(l?t.draggable=!1:t.draggable=!0,e.state.doc.eq(i.doc)||d===-1)return;let o=e.nodeDOM(d);if(o=xq(e,o),o===e.dom||o?.nodeType!==1)return;let s=e.posAtDOM(o,0),c=bq(n.state.doc,s),f=yq(n.state.doc,s);u=c,d=f,e.state,a?.({editor:n,node:u,pos:d}),g(o)},destroy(){f&&(cancelAnimationFrame(f),f=null,p=null),t&&gq(c)}}},props:{handleDOMEvents:{keydown(e){return!t||l?!1:e.hasFocus()?(m(),u=null,d=-1,a?.({editor:n,node:null,pos:-1}),!1):!1},mouseleave(e,t){return l||t.target&&!c.contains(t.relatedTarget)&&(m(),u=null,d=-1,a?.({editor:n,node:null,pos:-1})),!1},mousemove(e,r){return!t||l||(p={x:r.clientX,y:r.clientY},f)||(f=requestAnimationFrame(()=>{if(f=null,!p)return;let{x:t,y:r}=p;p=null;let i=fq({x:t,y:r,direction:`right`,editor:n});if(!i.resultElement)return;let o=i.resultElement;if(o=xq(e,o),o===e.dom||o?.nodeType!==1)return;let s=e.posAtDOM(o,0),c=bq(n.state.doc,s);if(c!==u){let t=yq(n.state.doc,s);u=c,d=t,e.state,a?.({editor:n,node:u,pos:d}),g(o),h()}})),!1}}}})}},wq={placement:`left-start`,strategy:`absolute`};K.create({name:`dragHandle`,addOptions(){return{render(){let e=document.createElement(`div`);return e.classList.add(`drag-handle`),e},computePositionConfig:{},locked:!1,onNodeChange:()=>null,onElementDragStart:void 0,onElementDragEnd:void 0}},addCommands(){return{lockDragHandle:()=>({editor:e})=>(this.options.locked=!0,e.commands.setMeta(`lockDragHandle`,this.options.locked)),unlockDragHandle:()=>({editor:e})=>(this.options.locked=!1,e.commands.setMeta(`lockDragHandle`,this.options.locked)),toggleDragHandle:()=>({editor:e})=>(this.options.locked=!this.options.locked,e.commands.setMeta(`lockDragHandle`,this.options.locked))}},addProseMirrorPlugins(){let e=this.options.render();return[Cq({computePositionConfig:{...wq,...this.options.computePositionConfig},getReferencedVirtualElement:this.options.getReferencedVirtualElement,element:e,editor:this.editor,onNodeChange:this.options.onNodeChange,onElementDragStart:this.options.onElementDragStart,onElementDragEnd:this.options.onElementDragEnd}).plugin]}});var Tq=(0,t.defineComponent)({name:`DragHandleVue`,props:{pluginKey:{type:[String,Object],default:Sq},editor:{type:Object,required:!0},computePositionConfig:{type:Object,default:()=>({})},onNodeChange:{type:Function,default:null},onElementDragStart:{type:Function,default:null},onElementDragEnd:{type:Function,default:null},class:{type:String,default:`drag-handle`}},setup(e,{slots:n}){let r=(0,t.ref)(null),i=(0,t.shallowRef)(null);return(0,t.onMounted)(async()=>{await(0,t.nextTick)();let{editor:n,pluginKey:a,onNodeChange:o,onElementDragEnd:s,onElementDragStart:c,computePositionConfig:l}=e;if(!r.value||!e.editor||e.editor.isDestroyed)return;let u=Cq({editor:n,element:r.value,pluginKey:a,computePositionConfig:{...wq,...l},onNodeChange:o,onElementDragStart:c,onElementDragEnd:s});i.value=u,e.editor.registerPlugin(u.plugin)}),(0,t.onBeforeUnmount)(()=>{var t,n;i.value&&=(e.editor&&!e.editor.isDestroyed&&e.editor.unregisterPlugin(e.pluginKey),(n=(t=i.value).unbind)==null||n.call(t),null)}),()=>(0,t.h)(`div`,{ref:r,class:e.class,style:{visibility:`hidden`,position:`absolute`}},n.default?.call(n))}}),Eq={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Dq(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Eq,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M11 13H6q-.425 0-.712-.288T5 12t.288-.712T6 11h5V6q0-.425.288-.712T12 5t.713.288T13 6v5h5q.425 0 .713.288T19 12t-.288.713T18 13h-5v5q0 .425-.288.713T12 19t-.712-.288T11 18z`},null,-1)]])}var Oq=(0,t.markRaw)({name:`material-symbols-add-rounded`,render:Dq}),kq={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Aq(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,kq,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M9 20q-.825 0-1.412-.587T7 18t.588-1.412T9 16t1.413.588T11 18t-.587 1.413T9 20m6 0q-.825 0-1.412-.587T13 18t.588-1.412T15 16t1.413.588T17 18t-.587 1.413T15 20m-6-6q-.825 0-1.412-.587T7 12t.588-1.412T9 10t1.413.588T11 12t-.587 1.413T9 14m6 0q-.825 0-1.412-.587T13 12t.588-1.412T15 10t1.413.588T17 12t-.587 1.413T15 14M9 8q-.825 0-1.412-.587T7 6t.588-1.412T9 4t1.413.588T11 6t-.587 1.413T9 8m6 0q-.825 0-1.412-.587T13 6t.588-1.412T15 4t1.413.588T17 6t-.587 1.413T15 8`},null,-1)]])}var jq=(0,t.markRaw)({name:`material-symbols-drag-indicator`,render:Aq}),Mq={class:`flex items-center justify-center gap-0.5`},Nq=(0,t.defineComponent)({__name:`EditorDragHandle`,props:{editor:{type:Object,required:!0}},setup(e){let r=(0,t.shallowRef)(null),i=(0,t.shallowRef)(0),a=(0,t.ref)(!1),o=(0,t.computed)(()=>r.value?yE(r.value):!1),s=()=>{if(o.value)e.editor.chain().insertContent(`/`).focus().run();else{let t=i.value+(r.value?.nodeSize??0);e.editor.commands.insertContentAt(t,[{type:`paragraph`,content:[{type:`text`,text:`/`}]}],{updateSelection:!0}),e.editor.commands.focus(t+2,{scrollIntoView:!0})}},c=({node:e,pos:t})=>{r.value=e,i.value=t},l=()=>{let{tr:t}=e.editor.state;if(t.setMeta(`lockDragHandle`,!0),i.value!==void 0){let e=t.doc.resolve(i.value);t.setSelection(new z(e))}e.editor.view.dispatch(t)},u=()=>{let{tr:t}=e.editor.state;t.setMeta(`lockDragHandle`,!1);let{selection:n}=e.editor.state;if(!n.empty){let e=t.doc.resolve(n.to);t.setSelection(R.create(t.doc,e.pos))}e.editor.view.dispatch(t)},d=(0,t.computed)(()=>{let t=e.editor?.extensionManager,n=[...WK],r=[];for(let i of t.extensions){let{getDraggableMenuItems:t}=i.options;if(!t)continue;let a=t({editor:e.editor});for(let e of Array.isArray(a)?a:[a]){if(e.extendsKey&&e.extendsKey.trim()!==``){r.push(e);continue}n.push(e)}}return y(f(n,r))}),f=(e,t)=>{let n=[],r=new Map;for(let e of t)if(e.extendsKey){r.has(e.extendsKey)||r.set(e.extendsKey,[]);let t=r.get(e.extendsKey)??[];r.set(e.extendsKey,[...t,e])}for(let t of e){let e=t.key;if(e){let n=r.get(e)??[];for(let e of n)p(t,e)}n.push(t)}return n},p=(e,t)=>(v(e,t),g(e,t),h(e,t),_(e,t),m(e,t),e),m=(e,t)=>{let n=t.children?.items??[];if(n.length===0)return;let r=[...e.children?.items??[],...n].filter((e,t,n)=>e.key?n.findIndex(t=>t.key===e.key)===t:!0),i=f(r.filter(e=>e.extendsKey===void 0),r.filter(e=>e.extendsKey&&e.extendsKey.trim()!==``));e.children={...e.children,items:y(i)}},h=(e,t)=>{let{disabled:n}=t,{disabled:r}=e;e.disabled=({editor:e,node:t,pos:i})=>n&&n({editor:e,node:t,pos:i})===!0?!0:r?r({editor:e,node:t,pos:i}):!1},g=(e,t)=>{let{isActive:n}=t,{isActive:r}=e;e.isActive=({editor:e,node:t,pos:i})=>n&&n({editor:e,node:t,pos:i})===!0?!0:r?r({editor:e,node:t,pos:i}):!1},_=(e,t)=>{let{action:n}=t,{action:r}=e;!n&&!r||(e.action=async({editor:e,node:t,pos:i,close:a})=>{if(n){let r=await n({editor:e,node:t,pos:i,close:a});if(r!==void 0)return r}if(r)return r({editor:e,node:t,pos:i,close:a})})},v=(e,t)=>{let{visible:n}=t,{visible:r}=e;e.visible=({editor:e,node:t,pos:i})=>n&&n({editor:e,node:t,pos:i})===!1?!1:r?r({editor:e,node:t,pos:i}):!0},y=e=>wK(e,[`priority`]);return(o,f)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Tq),{editor:e.editor,"compute-position-config":{middleware:[(0,t.unref)(CP)(5)]},onNodeChange:c},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Mq,[(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{type:`button`,class:`flex size-6 rounded-md p-0.5 hover:bg-gray-100`,onClick:s},[(0,t.createVNode)((0,t.unref)(Oq),{class:`size-5`})])),[[(0,t.unref)(n.vTooltip),{content:(0,t.unref)(N).global.t(`editor.drag.button.insert_block`),distance:8,delay:{show:500}}]]),(0,t.createVNode)((0,t.unref)(n.VDropdown),{triggers:[`click`],shown:a.value,distance:8,placement:`right`,onShow:l,onHide:u},{popper:(0,t.withCtx)(()=>[(0,t.createVNode)(YK,{editor:e.editor,node:r.value,pos:i.value,items:d.value,onClose:f[1]||=e=>a.value=!1},null,8,[`editor`,`node`,`pos`,`items`])]),default:(0,t.withCtx)(()=>[(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{type:`button`,class:`flex rounded-md p-0.5 hover:bg-gray-100`,onClick:f[0]||=e=>a.value=!0},[(0,t.createVNode)((0,t.unref)(jq),{class:`size-5`})])),[[(0,t.unref)(n.vTooltip),{content:(0,t.unref)(N).global.t(`editor.drag.button.drag_handle`),distance:8,delay:{show:500}}]])]),_:1},8,[`shown`])])]),_:1},8,[`editor`,`compute-position-config`]))}}),Pq=(0,t.defineComponent)({__name:`BubbleItem`,props:{editor:{},isActive:{type:Function,default:()=>!1},visible:{type:Function,default:()=>!0},icon:{},iconStyle:{},title:{},action:{}},setup(e){let r=e,i=(0,t.ref)(),a=e=>{if(!r.action)return;let t=r.action?.({editor:e});typeof t==`object`&&(i.value=t)};return(o,s)=>e.visible({editor:e.editor})?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VDropdown),{key:0,class:`inline-flex`,triggers:[],"auto-hide":!0,shown:!!i.value,distance:10,onHide:s[1]||=e=>i.value=void 0},{popper:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)(t.KeepAlive,null,[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(i.value),(0,t.normalizeProps)((0,t.guardReactiveProps)(r)),null,16))],1024))]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(nO,{title:e.title,"is-active":e.isActive({editor:e.editor}),onClick:s[0]||=t=>a(e.editor)},{icon:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon),{style:(0,t.normalizeStyle)(e.iconStyle),class:`size-5`},null,8,[`style`]))]),_:1},8,[`title`,`is-active`])]),_:1},8,[`shown`])):(0,t.createCommentVNode)(``,!0)}});function Fq(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n,s=i,c=n;return new DOMRect(s,c,a,o)}var Iq=class{constructor({editor:e,element:t,view:n,updateDelay:r=250,resizeDelay:i=60,shouldShow:a,appendTo:o,getReferencedVirtualElement:s,options:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:`absolute`,placement:`top`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&Cp(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);!n&&!r||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.transactionHandler=({transaction:e})=>{e.getMeta(`bubbleMenu`)===`updatePosition`&&this.updatePosition()},this.editor=e,this.element=t,this.view=n,this.updateDelay=r,this.resizeDelay=i,this.appendTo=o,this.scrollTarget=c?.scrollTarget??window,this.getReferencedVirtualElement=s,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,a&&(this.shouldShow=a),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.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(EP(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(TP(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(CP(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(kP(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(DP(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(wP(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(OP(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(AP(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){let{selection:e}=this.editor.state,t=this.getReferencedVirtualElement?.call(this);if(t)return t;let n=ah(this.view,e.from,e.to),r={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof z){let t=this.view.nodeDOM(e.from),n=t.dataset.nodeViewWrapper?t:t.querySelector(`[data-node-view-wrapper]`);n&&(t=n),t&&(r={getBoundingClientRect:()=>t.getBoundingClientRect(),getClientRects:()=>[t.getBoundingClientRect()]})}if(e instanceof Y){let{$anchorCell:t,$headCell:n}=e,i=t?t.pos:n.pos,a=n?n.pos:t.pos,o=this.view.nodeDOM(i),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():Fq(o.getBoundingClientRect(),s.getBoundingClientRect());r={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return r}updatePosition(){let e=this.virtualElement;e&&jP(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n})=>{this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener(`dragstart`,this.dragstartHandler),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},Lq=e=>new B({key:typeof e.pluginKey==`string`?new V(e.pluginKey):e.pluginKey,view:t=>new Iq({view:t,...e})}),Rq=(0,t.defineComponent)({name:`BubbleMenu`,inheritAttrs:!1,props:{pluginKey:{type:[String,Object],default:`bubbleMenu`},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},resizeDelay:{type:Number,default:void 0},options:{type:Object,default:()=>({})},appendTo:{type:Object,default:void 0},shouldShow:{type:Function,default:null},getReferencedVirtualElement:{type:Function,default:void 0}},setup(e,{slots:n,attrs:r}){let i=(0,t.ref)(null);return(0,t.onMounted)(()=>{let{editor:n,options:r,pluginKey:a,resizeDelay:o,appendTo:s,shouldShow:c,getReferencedVirtualElement:l,updateDelay:u}=e,d=i.value;d&&(d.style.visibility=`hidden`,d.style.position=`absolute`,d.remove(),(0,t.nextTick)(()=>{n.registerPlugin(Lq({editor:n,element:d,options:r,pluginKey:a,resizeDelay:o,appendTo:s,shouldShow:c,getReferencedVirtualElement:l,updateDelay:u}))}))}),(0,t.onBeforeUnmount)(()=>{let{pluginKey:t,editor:n}=e;n.unregisterPlugin(t)}),()=>(0,t.h)(`div`,{ref:i,...r},n.default?.call(n))}}),zq=class{constructor({editor:e,element:t,view:n,options:r,appendTo:i,shouldShow:a}){this.preventHide=!1,this.isVisible=!1,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!this.editor.isEditable)},this.floatingUIOptions={strategy:`absolute`,placement:`right`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.editor=e,this.element=t,this.view=n,this.appendTo=i,this.floatingUIOptions={...this.floatingUIOptions,...r},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(e){return Lm(e,{textSerializers:Rm(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(EP(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(TP(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(CP(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(kP(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(DP(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(wP(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(OP(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(AP(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}updatePosition(){let{selection:e}=this.editor.state,t=ah(this.view,e.from,e.to);jP({getBoundingClientRect:()=>t,getClientRects:()=>[t]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n})=>{this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},Bq=e=>new B({key:typeof e.pluginKey==`string`?new V(e.pluginKey):e.pluginKey,view:t=>new zq({view:t,...e})});(0,t.defineComponent)({name:`FloatingMenu`,inheritAttrs:!1,props:{pluginKey:{type:null,default:`floatingMenu`},editor:{type:Object,required:!0},options:{type:Object,default:()=>({})},appendTo:{type:Object,default:void 0},shouldShow:{type:Function,default:null}},setup(e,{slots:n,attrs:r}){let i=(0,t.ref)(null);return(0,t.onMounted)(()=>{let{pluginKey:t,editor:n,options:r,appendTo:a,shouldShow:o}=e,s=i.value;s&&(s.style.visibility=`hidden`,s.style.position=`absolute`,s.remove(),n.registerPlugin(Bq({pluginKey:t,editor:n,element:s,options:r,appendTo:a,shouldShow:o})))}),(0,t.onBeforeUnmount)(()=>{let{pluginKey:t,editor:n}=e;n.unregisterPlugin(t)}),()=>(0,t.h)(`div`,{ref:i,...r},n.default?.call(n))}});var Vq={class:`bubble-menu flex items-center space-x-1 rounded-md border bg-white p-1 shadow`},Hq=_((0,t.defineComponent)({__name:`EditorBubbleMenu`,props:{editor:{type:Object,required:!0}},setup(e){let n=e,r=()=>{let e=n.editor?.extensionManager,t=new Map,r=[];for(let i of e.extensions){let{getBubbleMenu:e}=i.options;if(!e)continue;let a=e({editor:n.editor});if(a.extendsKey){t.has(a.extendsKey)||t.set(a.extendsKey,[]),t.get(a.extendsKey)?.push(a);continue}r.push(a)}return r.map(e=>!e.pluginKey||!t.has(e.pluginKey)?(e.items=a(e.items),e):i(e,t.get(e.pluginKey)??[]))},i=(e,t)=>{let n=e.items??[],r=t.map(e=>e.items).filter(e=>e!==void 0).flat()??[],i=new Map,o=[];n.forEach(e=>{e.key?i.set(e.key,e):o.push(e)}),r.forEach(e=>{e.key?i.set(e.key,e):o.push(e)});let s=[...Array.from(i.values()),...o],c=[e.shouldShow,...t.map(e=>e.shouldShow)].filter(e=>e!==void 0),l=c.length>0?e=>c.every(t=>t?t(e):!0):void 0;return{...e,items:a(s),shouldShow:l}},a=e=>e?.sort((e,t)=>e.priority-t.priority),o=(e,t)=>e.editor.isEditable?t.shouldShow?.(e):!1;return(n,i)=>((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r(),(n,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Rq),{key:r,"plugin-key":n?.pluginKey,"should-show":e=>o(e,n)??!1,editor:e.editor,options:{...n.options},"update-delay":0,"get-referenced-virtual-element":n.getReferencedVirtualElement},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Vq,[n.items?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(n.items,(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:r},[n.component?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.component),(0,t.mergeProps)({key:0,ref_for:!0},n.props,{editor:e.editor}),null,16,[`editor`])):((0,t.openBlock)(),(0,t.createBlock)(Pq,(0,t.mergeProps)({key:1,editor:e.editor},{ref_for:!0},n.props),null,16,[`editor`]))],64))),128)):n.component?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n?.component),{key:1,editor:e.editor},null,8,[`editor`])):(0,t.createCommentVNode)(``,!0)])]),_:2},1032,[`plugin-key`,`should-show`,`editor`,`options`,`get-referenced-virtual-element`]))),128))}}),[[`__scopeId`,`data-v-05696a6c`]]),Uq={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Wq(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Uq,[...n[0]||=[(0,t.createElementVNode)(`g`,{fill:`none`},[(0,t.createElementVNode)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 5a1 1 0 0 0-.993.883L11 8v3H8a1 1 0 0 0-.117 1.993L8 13h3v3a1 1 0 0 0 1.993.117L13 16v-3h3a1 1 0 0 0 .117-1.993L16 11h-3V8a1 1 0 0 0-1-1`})],-1)]])}var Gq=(0,t.markRaw)({name:`mingcute-add-circle-fill`,render:Wq}),Kq={class:`editor-header space-x-1 overflow-auto border-b bg-white px-1 py-1 text-center shadow-sm`},qq={class:`inline-flex h-full items-center gap-1`},Jq={class:`relative max-h-96 w-56 overflow-hidden overflow-y-auto`},Yq={class:`relative max-h-96 w-56 overflow-hidden overflow-y-auto`},Xq=(0,t.defineComponent)({__name:`EditorHeader`,props:{editor:{type:GT,required:!0}},setup(e){let r=e;function i(){return(r.editor?.extensionManager).extensions.reduce((e,t)=>{let{getToolbarItems:n}=t.options;if(!n)return e;let i=n({editor:r.editor});return Array.isArray(i)?[...e,...i]:[...e,i]},[]).sort((e,t)=>e.priority-t.priority)}function a(){return(r.editor?.extensionManager).extensions.reduce((e,t)=>{let{getToolboxItems:n}=t.options;if(!n)return e;let i=n({editor:r.editor});return Array.isArray(i)?[...e,...i]:[...e,i]},[]).sort((e,t)=>e.priority-t.priority)}return(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Kq,[(0,t.createElementVNode)(`div`,qq,[(0,t.createVNode)((0,t.unref)(n.VDropdown),{triggers:[`click`],"popper-triggers":[`click`]},{default:(0,t.withCtx)(({shown:e})=>[(0,t.createElementVNode)(`button`,{class:(0,t.normalizeClass)([`inline-flex size-8 items-center justify-center rounded-md p-1 transition-colors hover:bg-gray-100 active:!bg-gray-200`,{"bg-gray-200":e}]),tabindex:`-1`},[(0,t.createVNode)((0,t.unref)(Gq),{class:`text-primary`})],2)]),popper:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Jq,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(a(),(e,n)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.component),(0,t.mergeProps)({ref_for:!0},e.props,{key:n,tabindex:`-1`}),null,16))),128))])]),_:1}),r[0]||=(0,t.createElementVNode)(`div`,{class:`mx-1 h-5 w-[1px] bg-gray-100`},null,-1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(i(),(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:r},[e.children?.length?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VDropdown),{key:1,class:`inline-flex`,tabindex:`-1`,triggers:[`click`],"popper-triggers":[`click`]},{default:(0,t.withCtx)(({shown:n})=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.component),(0,t.mergeProps)({ref_for:!0},e.props,{children:e.children,tabindex:`-1`,class:{"bg-gray-200":n}}),null,16,[`children`,`class`]))]),popper:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Yq,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.children,(e,n)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.component),(0,t.mergeProps)({ref_for:!0},e.props,{key:n,tabindex:`-1`}),null,16))),128))])]),_:2},1024)):((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.component),(0,t.mergeProps)({key:0,ref_for:!0},e.props,{tabindex:`-1`}),null,16))]))),128))])]))}}),Zq={key:0,class:`halo-rich-text-editor`},Qq={class:`editor-entry`},$q={class:`editor-main`},eJ={key:0,class:`editor-main-extra`},tJ={key:0,class:`editor-entry-extra`},nJ=(0,t.defineComponent)({__name:`Editor`,props:{editor:{type:Object,required:!0},contentStyles:{type:Object,required:!1,default:()=>({})},locale:{type:String,required:!1,default:`zh-CN`}},setup(e){let n=e;return(0,t.watch)(()=>n.locale,()=>{N.global.locale.value=n.locale},{immediate:!0}),(n,r)=>e.editor?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Zq,[(0,t.createVNode)(Hq,{editor:e.editor},null,8,[`editor`]),(0,t.createVNode)(Nq,{editor:e.editor},null,8,[`editor`]),(0,t.createVNode)(Xq,{editor:e.editor},null,8,[`editor`]),(0,t.createElementVNode)(`div`,Qq,[(0,t.createElementVNode)(`div`,$q,[n.$slots.content?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,eJ,[(0,t.renderSlot)(n.$slots,`content`)])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(KT),{editor:e.editor,style:(0,t.normalizeStyle)(e.contentStyles),class:`editor-main-content markdown-body`},null,8,[`editor`,`style`])]),n.$slots.extra?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,tJ,[(0,t.renderSlot)(n.$slots,`extra`)])):(0,t.createCommentVNode)(``,!0)])])):(0,t.createCommentVNode)(``,!0)}});return e.AUDIO_BUBBLE_MENU_KEY=bK,e.AddMarkStep=qa,e.AddNodeMarkStep=Ya,e.AllSelection=Zo,e.AttrStep=Vo,e.BlockActionButton=g,e.BlockActionHorizontalSeparator=x,e.BlockActionInput=DD,e.Input=DD,e.BlockActionSeparator=C,e.BubbleButton=nO,e.BubbleItem=Pq,e.CODE_BLOCK_BUBBLE_MENU_KEY=tA,e.COLUMNS_BUBBLE_MENU_KEY=bM,e.CONVERT_TO_KEY=VK,e.COPY_KEY=UK,e.CUT_KEY=`cut`,e.CellBookmark=Cw,e.CellSelection=Y,e.Change=Jg,e.ChangeSet=i_,e.CommandManager=ep,e.ContentMatch=Ri,e.DELETE_KEY=HK,e.DETAILS_BUBBLE_MENU_KEY=sF,e.DOMParser=ua,e.DOMSerializer=wa,e.Decoration=Wd,e.DecorationSet=H,e.DocAttrStep=Ho,e.Dropdown=vC,e.DropdownItem=ae,e.DropdownSubmenu=xC,e.Editor=dg,e.EditorBubbleMenu=Hq,e.EditorContent=KT,e.EditorDragButtonItem=nq,e.EditorDragHandle=Nq,e.EditorDragMenu=YK,e.EditorHeader=Xq,e.EditorLinkObtain=ND,e.EditorState=us,e.EditorView=Of,e.Extendable=Bh,e.Extension=K,e.ExtensionAudio=xK,e.ExtensionBlockquote=vO,e.ExtensionBold=DO,e.ExtensionBulletList=ck,e.ExtensionCharacterCount=lk,e.ExtensionClearFormat=_k,e.ExtensionCode=wk,e.ExtensionCodeBlock=nA,e.ExtensionColor=oM,e.ExtensionColumn=sM,e.ExtensionColumns=TM,e.ExtensionCommandsMenu=JP,e.ExtensionDetails=cF,e.ExtensionDocument=lF,e.ExtensionDropcursor=uF,e.ExtensionFigure=DF,e.ExtensionFontSize=jF,e.ExtensionFormatBrush=RF,e.ExtensionGallery=bI,e.ExtensionGapCursor=OI,e.ExtensionHardBreak=FI,e.ExtensionHeading=iL,e.ExtensionHighlight=bL,e.ExtensionHistory=DL,e.ExtensionHorizontalRule=OL,e.ExtensionIframe=hR,e.ExtensionImage=X,e.ExtensionIndent=HB,e.ExtensionItalic=aV,e.ExtensionLink=bU,e.ExtensionListKeymap=FU,e.ExtensionNodeSelected=IU,e.ExtensionOrderedList=DU,e.ExtensionParagraph=hF,e.ExtensionPlaceholder=LU,e.ExtensionRangeSelection=wF,e.ExtensionSearchAndReplace=jW,e.ExtensionStrike=RW,e.ExtensionSubscript=UW,e.ExtensionSuperscript=JW,e.ExtensionTable=VB,e.ExtensionTaskList=OU,e.ExtensionText=SG,e.ExtensionTextAlign=EG,e.ExtensionTextStyle=fA,e.ExtensionTrailingNode=OG,e.ExtensionUnderline=_G,e.ExtensionUpload=hK,e.ExtensionVideo=$,e.ExtensionsKit=_K,e.Fragment=P,e.GALLERY_BUBBLE_MENU_KEY=yI,e.GapCursor=x_,e.IFRAME_BUBBLE_MENU_KEY=mR,e.IMAGE_BUBBLE_MENU_KEY=fz,e.InputRule=Nh,e.MapResult=Ba,e.Mapping=Ha,e.Mark=Vh,e.MarkType=aa,e.MarkView=Fg,e.MarkViewContent=QT,e.MarkdownParser=YS,e.MarkdownSerializer=$S,e.MarkdownSerializerState=rC,e.MenuItem=pC,e.Node=q,e.NodePos=cg,e.NodeRange=Ni,e.NodeSelection=z,e.NodeType=na,e.NodeView=Ig,e.NodeViewContent=qT,e.NodeViewWrapper=JT,e.PMInputRule=sv,e.PMMark=F,e.PMNode=Fi,e.PasteRule=Uh,e.Plugin=B,e.PluginKey=V,e.RangeSelection=SF,e.RemoveMarkStep=Ja,e.RemoveNodeMarkStep=Xa,e.ReplaceAroundStep=Qa,e.ReplaceError=gi,e.ReplaceStep=Za,e.ResizableNodeView=yg,e.ResizableNodeview=bg,e.ResizeState=OT,e.ResolvedPos=ki,e.ResourceReplaceButton=FD,e.RichTextEditor=nJ,e.Schema=oa,e.Selection=L,e.SelectionRange=Ko,e.Slice=I,e.Span=qg,e.Step=Wa,e.StepMap=Va,e.StepResult=Ga,e.TABLE_BUBBLE_MENU_KEY=BB,e.TEXT_BUBBLE_MENU_KEY=xG,e.TableMap=J,e.TableView=wT,e.TextSelection=R,e.ToolbarItem=E,e.ToolbarSubItem=D,e.ToolboxItem=NE,e.Tracker=Bg,e.Transaction=is,e.Transform=Wo,Object.defineProperty(e,`TransformError`,{enumerable:!0,get:function(){return Uo}}),e.VIDEO_BUBBLE_MENU_KEY=dK,e.VueEditor=GT,e.VueMarkView=$T,e.VueMarkViewRenderer=eE,e.VueNodeViewRenderer=rE,e.VueRenderer=XT,e.__clipCells=lT,e.__endComposition=Df,e.__insertCells=pT,e.__parseFromClipboard=Ef,e.__pastedCells=oT,e.addColSpan=xw,e.addColumn=Nw,e.addColumnAfter=Fw,e.addColumnBefore=Pw,e.addListNodes=ic,e.addRow=zw,e.addRowAfter=Vw,e.addRowBefore=Bw,e.blockTypeItem=jC,e.bulletList=tc,e.callOrReturn=W,e.canInsertNode=xg,e.canJoin=yo,e.canSplit=_o,e.cellAround=lw,e.cellNear=pw,e.clamp=UB,e.closeDoubleQuote=gv,e.closeHistory=X_,e.closeSingleQuote=vv,e.colCount=vw,e.collab=h_,e.columnIsHeader=Sw,e.columnResizing=DT,e.columnResizingPluginKey=ET,e.combineTransactionSteps=fm,e.commands=tp,e.convertToMediaContents=iE,e.createAtomBlockMarkdownSpec=Dg,e.createBlockMarkdownSpec=Og,e.createChainableState=$f,e.createDocument=lm,e.createElement=_g,e.h=_g,e.createInlineMarkdownSpec=jg,e.createNodeFromContent=Np,e.createStyleTag=ug,e.defaultBlockAt=pm,e.defaultDragItems=WK,e.defaultMarkdownParser=ZS,e.defaultMarkdownSerializer=eC,e.deleteCellSelection=aT,e.deleteColumn=Lw,e.deleteCurrentNodeAndSetSelection=gF,e.deleteNode=cE,e.deleteNodeByPos=sE,e.deleteProps=em,e.deleteRow=Uw,e.deleteTable=iT,e.dropCursor=y_,e.dropPoint=To,e.elementFromString=Mp,e.ellipsis=mv,e.emDash=pv,e.escapeForRegEx=Sg,e.extensions=Xh,e.filterDuplicateExtensions=lE,e.findCell=_w,e.findChildren=mm,e.findChildrenInRange=hm,e.findDuplicates=Am,e.findParentNode=_m,e.findParentNodeClosestToPos=gm,e.findWrapping=oo,e.fixTables=Aw,e.fixTablesKey=Ow,e.flattenExtensions=vm,e.fromString=Tm,e.gapCursor=T_,e.generateAnchor=si,e.generateAnchorId=ci,e.generateHTML=Pm,e.generateJSON=Fm,e.generateText=zm,e.getAllExternalNodes=gK,e.getAttributes=Vm,e.getAttributesFromExtensions=Cm,e.getChangedRanges=Wm,e.getDebugJSON=Gm,e.getExtensionField=U,e.getHTMLFromFragment=ym,e.getIndent=YB,e.getMarkAttributes=dm,e.getMarkRange=yp,e.getMarkType=bp,e.getMarksBetween=Km,e.getNodeAtPosition=qm,e.getNodeAttributes=Bm,e.getNodeType=lp,e.getOutdent=XB,e.getRenderedAttributes=wm,e.getSchema=Nm,e.getSchemaByResolvedExtensions=km,e.getSchemaTypeByName=Jm,e.getSchemaTypeNameByName=$p,e.getSplittedAttributes=Ym,e.getText=Lm,e.getTextBetween=Im,e.getTextContentFromNodes=Xm,e.getTextSerializersFromSchema=Rm,e.getVersion=v_,e.getVideoElement=fK,e.getVideoSizePercentage=pK,e.goToNextCell=rT,e.handleDeletePreviousNode=_F,e.handlePaste=yT,e.handleSetSize=mK,e.history=$_,e.icons=wC,e.inSameTable=gw,e.injectExtensionAttributesToParseRule=Em,e.inputRules=uv,e.inputRulesPlugin=Ih,e.insertPoint=wo,e.isActive=Qm,e.isAllowedUri=pE,e.isAndroid=Ep,e.isAtEndOfNode=$m,e.isAtStartOfNode=eh,e.isBlockEmpty=yE,e.isEmpty=hE,e.isEmptyObject=xm,e.isExtensionRulesEnabled=th,e.isFunction=bm,e.isInTable=dw,e.isList=nh,e.isListActive=mE,e.isMacOS=Gp,e.isMarkActive=Zm,e.isNodeActive=Jp,e.isNodeContentEmpty=_E,e.isNodeEmpty=rh,e.isNodeSelection=ih,e.isNumber=Hh,e.isPlainObject=Rh,e.isRegExp=hp,e.isString=Cg,e.isTextSelection=Cp,e.isiOS=Dp,e.joinPoint=So,e.joinUpItem=TC,e.keydownHandler=Xf,e.keymap=Yf,e.liftItem=EC,e.liftListItem=uc,e.liftTarget=io,e.listItem=nc,e.markDownSchema=VS,e.markInputRule=fg,e.markPasteRule=Lg,e.markViewProps=ZT,e.markdown=wg,e.marks=YC,e.menuBar=FC,e.mergeAttributes=G,e.mergeCells=Kw,e.mergeDeep=zh,e.minMax=wp,e.moveCellForward=hw,e.nextCell=yw,e.nodeInputRule=pg,e.nodePasteRule=Rg,e.nodeViewProps=tE,e.nodes=GC,e.objectIncludes=gp,e.openDoubleQuote=hv,e.openSingleQuote=_v,e.orderedList=ec,e.parseAttributes=Tg,e.parseIndentedBlocks=Mg,e.pasteRulesPlugin=Jh,e.pmTextblockTypeInputRule=xv,e.pmWrappingInputRule=bv,e.pointsAtCell=mw,e.posToDOMRect=ah,e.rebaseSteps=d_,e.receiveTransaction=g_,e.redo=nv,e.redoDepth=ov,e.redoItem=kC,e.redoNoScroll=iv,e.removeColSpan=bw,e.removeColumn=Iw,e.removeDuplicates=Hm,e.removeRow=Hw,e.renderGrouped=SC,e.renderNestedMarkdownContent=Ng,e.replaceStep=Eo,e.resolveExtensions=Mm,e.resolveFocusPosition=Tp,e.rewriteUnknownContent=sh,e.rowIsHeader=Rw,e.schema=XC,e.selectParentNodeItem=DC,e.selectedRect=Mw,e.selectionCell=fw,e.selectionToInsertionEnd=Pp,e.sendableSteps=__,e.serializeAttributes=Eg,e.setCellAttr=Yw,e.simplifyChanges=e_,e.sinkListItem=pc,e.smartQuotes=yv,e.sortExtensions=jm,e.splitCell=qw,e.splitCellWithType=Jw,e.splitExtensions=Sm,e.splitListItem=cc,e.splitListItemKeepMarks=lc,e.tableEditing=VT,e.tableEditingKey=cw,e.tableNodeTypes=sw,e.tableNodes=ow,e.textInputRule=hg,e.textPasteRule=zg,e.textblockTypeInputRule=mg,e.toggleHeader=Qw,e.toggleHeaderCell=tT,e.toggleHeaderColumn=eT,e.toggleHeaderRow=$w,e.trailingNode=UT,e.undo=tv,e.undoDepth=av,e.undoInputRule=fv,e.undoItem=OC,e.undoNoScroll=rv,e.updateColumnsOnResize=TT,e.updateMarkViewAttributes=Pg,e.useEditor=YT,e.wrapInList=ac,e.wrapItem=AC,e.wrapRangeInList=oc,e.wrappingInputRule=gg,e})({},Vue,HaloComponents,HaloUiShared,HaloApiClient);