@halo-dev/richtext-editor 2.21.0 → 2.23.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.
- package/README.md +61 -0
- package/dist/components/Editor.vue.d.ts +6 -5
- package/dist/components/EditorHeader.vue.d.ts +4 -4
- package/dist/components/base/DropdownItem.vue.d.ts +29 -0
- package/dist/components/base/Input.vue.d.ts +29 -0
- package/dist/components/base/index.d.ts +2 -0
- package/dist/components/block/BlockActionButton.vue.d.ts +13 -8
- package/dist/{dev/App.vue.d.ts → components/block/BlockActionHorizontalSeparator.vue.d.ts} +1 -1
- package/dist/components/block/BlockActionSeparator.vue.d.ts +2 -1
- package/dist/components/block/index.d.ts +1 -2
- package/dist/components/bubble/BubbleButton.vue.d.ts +28 -0
- package/dist/components/bubble/BubbleItem.vue.d.ts +3 -37
- package/dist/components/{EditorBubbleMenu.vue.d.ts → bubble/EditorBubbleMenu.vue.d.ts} +3 -3
- package/dist/components/bubble/index.d.ts +2 -1
- package/dist/components/common/ColorPickerDropdown.vue.d.ts +7 -7
- package/dist/components/drag/EditorDragButtonItem.vue.d.ts +8 -0
- package/dist/components/drag/EditorDragHandle.vue.d.ts +14 -0
- package/dist/components/drag/EditorDragMenu.vue.d.ts +43 -0
- package/dist/components/drag/default-drag.d.ts +8 -0
- package/dist/components/drag/index.d.ts +4 -0
- package/dist/components/index.d.ts +4 -2
- package/dist/components/toolbar/ToolbarItem.vue.d.ts +2 -24
- package/dist/components/toolbar/ToolbarSubItem.vue.d.ts +2 -20
- package/dist/components/toolbox/ToolboxItem.vue.d.ts +2 -21
- package/dist/components/upload/EditorLinkObtain.vue.d.ts +51 -0
- package/dist/components/upload/ResourceReplaceButton.vue.d.ts +13 -0
- package/dist/components/upload/index.d.ts +2 -0
- package/dist/composables/use-attachment.d.ts +7 -0
- package/dist/extensions/align/index.d.ts +6 -0
- package/dist/extensions/audio/AudioView.vue.d.ts +106 -2
- package/dist/extensions/audio/BubbleItemAudioLink.vue.d.ts +2 -29
- package/dist/extensions/audio/BubbleItemAudioPosition.vue.d.ts +7 -0
- package/dist/extensions/audio/index.d.ts +9 -4
- package/dist/extensions/block-position/index.d.ts +48 -0
- package/dist/extensions/blockquote/index.d.ts +3 -3
- package/dist/extensions/bold/index.d.ts +3 -3
- package/dist/extensions/bullet-list/index.d.ts +3 -3
- package/dist/extensions/character-count/index.d.ts +1 -0
- package/dist/extensions/clear-format/index.d.ts +2 -2
- package/dist/extensions/code/index.d.ts +3 -3
- package/dist/extensions/code-block/CodeBlockSelect.vue.d.ts +7 -5
- package/dist/extensions/code-block/code-block.d.ts +7 -5
- package/dist/extensions/code-block/index.d.ts +0 -1
- package/dist/extensions/color/ColorBubbleItem.vue.d.ts +2 -29
- package/dist/extensions/color/ColorToolbarItem.vue.d.ts +2 -24
- package/dist/extensions/color/index.d.ts +3 -3
- package/dist/extensions/columns/column.d.ts +6 -2
- package/dist/extensions/columns/columns.d.ts +11 -4
- package/dist/extensions/columns/index.d.ts +2 -2
- package/dist/extensions/commands-menu/CommandsView.vue.d.ts +2 -2
- package/dist/extensions/commands-menu/commands.d.ts +2 -3
- package/dist/extensions/commands-menu/index.d.ts +1 -1
- package/dist/extensions/details/index.d.ts +6 -0
- package/dist/extensions/document/index.d.ts +2 -0
- package/dist/extensions/drop-cursor/index.d.ts +1 -0
- package/dist/extensions/extensions-kit.d.ts +96 -0
- package/dist/extensions/figure/FigureCaptionView.vue.d.ts +3 -0
- package/dist/extensions/figure/figure-caption.d.ts +2 -0
- package/dist/extensions/figure/index.d.ts +15 -0
- package/dist/extensions/font-size/index.d.ts +4 -14
- package/dist/extensions/format-brush/index.d.ts +4 -4
- package/dist/extensions/gallery/BubbleItemAddImage.vue.d.ts +7 -0
- package/dist/extensions/gallery/BubbleItemGap.vue.d.ts +493 -0
- package/dist/extensions/gallery/BubbleItemGroupSize.vue.d.ts +493 -0
- package/dist/extensions/gallery/BubbleItemLayout.vue.d.ts +493 -0
- package/dist/extensions/gallery/GalleryView.vue.d.ts +3 -0
- package/dist/extensions/gallery/gallery-bubble.d.ts +8 -0
- package/dist/extensions/gallery/index.d.ts +28 -0
- package/dist/extensions/gallery/useGalleryImages.d.ts +7 -0
- package/dist/extensions/gap-cursor/index.d.ts +1 -17
- package/dist/extensions/hard-break/index.d.ts +1 -0
- package/dist/extensions/heading/index.d.ts +3 -3
- package/dist/extensions/highlight/HighlightBubbleItem.vue.d.ts +2 -29
- package/dist/extensions/highlight/HighlightToolbarItem.vue.d.ts +2 -24
- package/dist/extensions/highlight/index.d.ts +3 -3
- package/dist/extensions/history/index.d.ts +1 -3
- package/dist/extensions/horizontal-rule/index.d.ts +1 -0
- package/dist/extensions/iframe/BubbleItemIframeAlign.vue.d.ts +7 -0
- package/dist/extensions/iframe/BubbleItemIframeLink.vue.d.ts +2 -29
- package/dist/extensions/iframe/BubbleItemIframeSize.vue.d.ts +2 -6
- package/dist/extensions/iframe/IframeView.vue.d.ts +54 -1
- package/dist/extensions/iframe/index.d.ts +4 -4
- package/dist/extensions/image/BubbleItemImageAlt.vue.d.ts +2 -29
- package/dist/extensions/image/BubbleItemImageHref.vue.d.ts +2 -29
- package/dist/extensions/image/BubbleItemImageLink.vue.d.ts +2 -29
- package/dist/extensions/image/BubbleItemImagePosition.vue.d.ts +7 -0
- package/dist/extensions/image/BubbleItemImageSize.vue.d.ts +2 -29
- package/dist/extensions/image/ImageView.vue.d.ts +108 -2
- package/dist/extensions/image/index.d.ts +9 -3
- package/dist/extensions/indent/index.d.ts +5 -5
- package/dist/extensions/index.d.ts +50 -47
- package/dist/extensions/italic/index.d.ts +3 -3
- package/dist/extensions/link/LinkBubbleButton.vue.d.ts +2 -29
- package/dist/extensions/link/index.d.ts +3 -3
- package/dist/extensions/list-extra/index.d.ts +6 -0
- package/dist/extensions/list-keymap/index.d.ts +4 -4
- package/dist/extensions/node-selected/index.d.ts +3 -4
- package/dist/extensions/ordered-list/index.d.ts +3 -3
- package/dist/extensions/paragraph/index.d.ts +3 -3
- package/dist/extensions/placeholder/index.d.ts +1 -0
- package/dist/extensions/range-selection/index.d.ts +2 -2
- package/dist/extensions/search-and-replace/IconButton.vue.d.ts +20 -0
- package/dist/extensions/search-and-replace/MatchToggleButton.vue.d.ts +20 -0
- package/dist/extensions/search-and-replace/SearchAndReplace.vue.d.ts +5 -2
- package/dist/extensions/search-and-replace/SearchAndReplacePlugin.d.ts +3 -2
- package/dist/extensions/search-and-replace/index.d.ts +2 -3
- package/dist/extensions/smart-scroll/index.d.ts +28 -0
- package/dist/extensions/strike/index.d.ts +3 -3
- package/dist/extensions/subscript/index.d.ts +3 -3
- package/dist/extensions/superscript/index.d.ts +3 -3
- package/dist/extensions/table/index.d.ts +5 -3
- package/dist/extensions/table/table-row.d.ts +1 -1
- package/dist/extensions/task-list/index.d.ts +3 -3
- package/dist/extensions/text/BubbleItemTextType.vue.d.ts +3 -0
- package/dist/extensions/text/index.d.ts +4 -2
- package/dist/extensions/text-align/index.d.ts +3 -3
- package/dist/extensions/text-style/index.d.ts +3 -3
- package/dist/extensions/trailing-node/index.d.ts +1 -2
- package/dist/extensions/underline/index.d.ts +3 -3
- package/dist/extensions/upload/index.d.ts +8 -0
- package/dist/extensions/video/BubbleItemVideoLink.vue.d.ts +2 -29
- package/dist/extensions/video/BubbleItemVideoPosition.vue.d.ts +7 -0
- package/dist/extensions/video/BubbleItemVideoSize.vue.d.ts +2 -29
- package/dist/extensions/video/VideoView.vue.d.ts +106 -2
- package/dist/extensions/video/index.d.ts +18 -4
- package/dist/index.d.ts +1 -4
- package/dist/index.es.js +41115 -0
- package/dist/index.iife.js +176 -0
- package/dist/locales/en.json.d.ts +177 -0
- package/dist/locales/es.json.d.ts +177 -0
- package/dist/locales/index.d.ts +1044 -4
- package/dist/locales/zh-CN.json.d.ts +177 -0
- package/dist/style.css +2 -1
- package/dist/tiptap/index.d.ts +3 -3
- package/dist/tiptap/pm/index.d.ts +0 -1
- package/dist/types/index.d.ts +115 -59
- package/dist/utils/attachment.d.ts +3 -0
- package/dist/utils/clipboard.d.ts +9 -0
- package/dist/utils/delete-node.d.ts +1 -1
- package/dist/utils/filter-duplicate-extensions.d.ts +2 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/{isListActive.d.ts → is-list-active.d.ts} +2 -2
- package/dist/utils/is-node-empty.d.ts +6 -0
- package/dist/utils/keyboard.d.ts +37 -0
- package/dist/utils/upload.d.ts +78 -0
- package/package.json +52 -64
- package/dist/components/block/BlockActionInput.vue.d.ts +0 -15
- package/dist/components/block/BlockCard.vue.d.ts +0 -30
- package/dist/components/bubble/BubbleMenu.vue.d.ts +0 -84
- package/dist/components/bubble/BubbleMenuPlugin.d.ts +0 -52
- package/dist/dev/main.d.ts +0 -1
- package/dist/extensions/draggable/index.d.ts +0 -13
- package/dist/rich-text-editor.es.js +0 -41650
- package/dist/rich-text-editor.iife.js +0 -136
- package/dist/utils/isNodeEmpty.d.ts +0 -4
- /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));t=m(t);var 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){this.content=e}oe.prototype={constructor:oe,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 oe(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 oe(n)},addToStart:function(e,t){return new oe([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new oe(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 oe(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=oe.from(e),e.size?new oe(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=oe.from(e),e.size?new oe(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=oe.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}},oe.from=function(e){if(e instanceof oe)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new oe(t)};function se(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=se(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function ce(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=ce(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var O=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 se(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return ce(this,e,t,n)}findIndex(e,t=-1){if(e==0)return ue(0,e);if(e==this.size)return ue(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?ue(n+1,a):ue(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)`:``))}};O.empty=new O([],0);var le={index:0,offset:0};function ue(e,t){return le.index=e,le.offset=t,le}function de(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(!de(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!de(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var k=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&&de(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}};k.none=[];var fe=class extends Error{},A=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=me(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(pe(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(O.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)}};A.empty=new A(O.empty,0,0);function pe(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(pe(a.content,t-i-1,n-i-1)))}function me(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=me(o.content,t-a-1,n);return s&&e.replaceChild(i,o.copy(s))}function he(e,t,n){if(n.openStart>e.depth)throw new fe(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new fe(`Inconsistent open depths`);return ge(e,t,n,0)}function ge(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=ge(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return xe(a,Ce(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return xe(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=we(n,e);return xe(a,Se(e,i,o,t,r))}}function _e(e,t){if(!t.type.compatibleContent(e.type))throw new fe(`Cannot join `+t.type.name+` onto `+e.type.name)}function ve(e,t,n){let r=e.node(n);return _e(r,t.node(n)),r}function ye(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 be(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&&(ye(e.nodeAfter,r),a++));for(let e=a;e<o;e++)ye(i.child(e),r);t&&t.depth==n&&t.textOffset&&ye(t.nodeBefore,r)}function xe(e,t){return e.type.checkContent(t),e.copy(t)}function Se(e,t,n,r,i){let a=e.depth>i&&ve(e,t,i+1),o=r.depth>i&&ve(n,r,i+1),s=[];return be(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(_e(a,o),ye(xe(a,Se(e,t,n,r,i+1)),s)):(a&&ye(xe(a,Ce(e,t,i+1)),s),be(t,n,i,s),o&&ye(xe(o,Ce(n,r,i+1)),s)),be(r,null,i,s),new O(s)}function Ce(e,t,n){let r=[];return be(null,e,n,r),e.depth>n&&ye(xe(ve(e,t,n+1),Ce(e,t,n+1)),r),be(t,null,n,r),new O(r)}function we(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(O.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Te=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 k.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 ke(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=Oe.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 Oe.set(t,r=new Ee);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%De,i}},Ee=class{constructor(){this.elts=[],this.i=0}},De=12,Oe=new WeakMap,ke=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)}},Ae=Object.create(null),je=class e{constructor(e,t,n,r=k.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||O.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&&de(this.attrs,t||e.defaultAttrs||Ae)&&k.sameSet(this.marks,n||k.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 A.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new A(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return he(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 Te.resolveCached(this,e)}resolveNoCache(e){return Te.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()+`)`),Ne(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=O.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=k.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(!k.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=O.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};je.prototype.text=void 0;var Me=class e extends je{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):Ne(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 Ne(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Pe=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Fe(t,n);if(r.next==null)return e.empty;let i=Ie(r);r.next&&r.err(`Unexpected trailing text`);let a=Ke(Ue(i));return qe(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 O.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(`
|
|
2
|
+
`)}};Pe.empty=new Pe(!0);var Fe=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 Ie(e){let t=[];do t.push(Le(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Le(e){let t=[];do t.push(Re(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Re(e){let t=He(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=Be(e,t);else break;return t}function ze(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Be(e,t){let n=ze(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:ze(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Ve(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 He(e){if(e.eat(`(`)){let t=Ie(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=Ve(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 Ue(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 We(e,t){return t-e}function Ge(e,t){let n=[];return r(t),n.sort(We);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 Ke(e){let t=Object.create(null);return n(Ge(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]);Ge(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Pe(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(We);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function qe(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 Je(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 Ye(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 Xe(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 Ze(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new et(e,r,t[r]);return n}var Qe=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=Ze(e,n.attrs),this.defaultAttrs=Je(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==Pe.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:Ye(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new je(this,this.computeAttrs(e),O.from(t),k.setFrom(n))}createChecked(e=null,t,n){return t=O.from(t),this.checkContent(t),new je(this,this.computeAttrs(e),t,k.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=O.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(O.empty,!0);return i?new je(this,e,t.append(i),k.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){Xe(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:k.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 $e(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 et=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?$e(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},tt=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Ze(e,r.attrs),this.excluded=null;let i=Je(this.attrs);this.instance=i?new k(this,i):null}create(e=null){return!e&&this.instance?this.instance:new k(this,Ye(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){Xe(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},nt=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=oe.from(e.nodes),t.marks=oe.from(e.marks||{}),this.nodes=Qe.compile(this.spec.nodes,this),this.marks=tt.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]=Pe.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?rt(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==``?[]:rt(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 Qe))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Me(n,n.defaultAttrs,e,k.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return je.fromJSON(this,e)}markFromJSON(e){return k.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function rt(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 it(e){return e.tag!=null}function at(e){return e.style!=null}var ot=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(it(e))this.tags.push(e);else if(at(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 ht(this,t,!1);return n.addAll(e,k.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new ht(this,t,!0);return n.addAll(e,k.none,t.from,t.to),A.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(_t(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=vt(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=vt(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)))}},st={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},ct={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},lt={ol:!0,ul:!0},ut=1,dt=2,ft=4;function pt(e,t,n){return t==null?e&&e.whitespace==`pre`?ut|dt:n&~ft:(t?ut:0)|(t===`full`?dt:0)}var mt=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=k.none,this.match=i||(a&ft?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(O.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&ut)){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=O.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(O.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&&!st.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},ht=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=pt(null,t.preserveWhitespace,0)|(n?ft:0);i=r?new mt(r.type,r.attrs,k.none,!0,t.topMatch||r.type.contentMatch,a):n?new mt(null,null,k.none,!0,null,a):new mt(e.schema.topNodeType,null,k.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&dt?`full`:this.localPreserveWS||(r.options&ut)>0;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)n=i===`full`?n.replace(/\r\n?/g,`
|
|
3
|
+
`):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;lt.hasOwnProperty(a)&&this.parser.normalizeLists&>(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:ct.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(st.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(`
|
|
4
|
+
`),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=k.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):yt(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=pt(e,i,a.options);a.options&ft&&a.content.length==0&&(o|=ft);let s=k.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):yt(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new mt(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|=ut);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 gt(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&<.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function _t(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function vt(e){let t={};for(let n in e)t[n]=e[n];return t}function yt(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 bt=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=St(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}=Et(St(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&&Et(St(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return Et(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=xt(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return xt(e.marks)}};function xt(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function St(e){return e.document||window.document}var Ct=new WeakMap;function wt(e){let t=Ct.get(e);return t===void 0&&Ct.set(e,t=Tt(e)),t}function Tt(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 Et(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=wt(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)){u=2;for(let e in 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}=Et(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var Dt=65535,Ot=2**16;function kt(e,t){return e+t*Ot}function At(e){return e&Dt}function jt(e){return(e-(e&Dt))/Ot}var Mt=1,Nt=2,Pt=4,Ft=8,It=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Ft)>0}get deletedBefore(){return(this.delInfo&(Mt|Pt))>0}get deletedAfter(){return(this.delInfo&(Nt|Pt))>0}get deletedAcross(){return(this.delInfo&Pt)>0}},Lt=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=At(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+jt(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:kt(o/3,e-s),f=e==s?Nt:e==u?Mt:Pt;return(t<0?e!=s:e!=u)&&(f|=Ft),new It(a,f,d)}r+=l-c}return n?e+r:new It(e+r,0,null)}touches(e,t){let n=0,r=At(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])}};Lt.empty=new Lt([]);var Rt=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 It(e,r,null)}},zt=Object.create(null),Bt=class{getMap(){return Lt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=zt[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in zt)throw RangeError(`Duplicate use of step JSON ID `+e);return zt[e]=t,t.prototype.jsonID=e,t}},Vt=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 fe)return e.fail(t.message);throw t}}};function Ht(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Ht(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return O.fromArray(r)}var Ut=class e extends Bt{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 A(Ht(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 Vt.fromReplace(e,this.from,this.to,i)}invert(){return new Wt(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))}};Bt.jsonID(`addMark`,Ut);var Wt=class e extends Bt{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 A(Ht(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Vt.fromReplace(e,this.from,this.to,n)}invert(){return new Ut(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))}};Bt.jsonID(`removeMark`,Wt);var Gt=class e extends Bt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Vt.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Vt.fromReplace(e,this.pos,this.pos+1,new A(O.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 Kt(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))}};Bt.jsonID(`addNodeMark`,Gt);var Kt=class e extends Bt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Vt.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Vt.fromReplace(e,this.pos,this.pos+1,new A(O.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Gt(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))}};Bt.jsonID(`removeNodeMark`,Kt);var qt=class e extends Bt{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Yt(e,this.from,this.to)?Vt.fail(`Structure replace would overwrite content`):Vt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Lt([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?A.empty:new A(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?A.empty:new A(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,A.fromJSON(t,n.slice),!!n.structure)}};Bt.jsonID(`replace`,qt);var Jt=class e extends Bt{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&&(Yt(e,this.from,this.gapFrom)||Yt(e,this.gapTo,this.to)))return Vt.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Vt.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Vt.fromReplace(e,this.from,this.to,n):Vt.fail(`Content does not fit in gap`)}getMap(){return new Lt([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,A.fromJSON(t,n.slice),n.insert,!!n.structure)}};Bt.jsonID(`replaceAround`,Jt);function Yt(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 Xt(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 Wt(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new Ut(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Zt(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 tt){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 Wt(t.from,t.to,t.style)))}function Qt(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 qt(s,l,A.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Wt(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 A(O.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new qt(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(O.empty,!0);e.replace(s,s,new A(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function $t(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function en(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||!$t(r,i,a))break}return null}function tn(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=O.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=O.from(r.node(e).copy(u)),d++):c--;let f=O.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=O.from(i.node(e).copy(f)),p++):l++;e.step(new Jt(c,l,o,s,new A(u.append(f),d,p),u.size-d,!0))}function nn(e,t,n=null,r=e){let i=an(e,t),a=i&&on(r,t);return a?i.map(rn).concat({type:t,attrs:n}).concat(a.map(rn)):null}function rn(e){return{type:e,attrs:null}}function an(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 on(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 sn(e,t,n){let r=O.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=O.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new Jt(i,a,i,a,new A(r,0,0),n.length,!0))}function cn(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)&&dn(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&&un(e,t,n,a),Qt(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 Jt(c,l,c+1,l-1,new A(O.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&ln(e,t,n,a),!1}})}function ln(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 un(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(`
|
|
5
|
+
`))}})}function dn(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function fn(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 Jt(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new A(O.from(o),0,0),1,!0))}function pn(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 mn(e,t,n=1,r){let i=e.doc.resolve(t),a=O.empty,o=O.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=O.from(i.node(e).copy(a));let t=r&&r[s];o=O.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new qt(t,t,new A(a.append(o),n,n),!0))}function hn(e,t){let n=e.resolve(t),r=n.index();return _n(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function gn(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 _n(e,t){return!!(e&&t&&!e.isLeaf&&gn(e,t))}function vn(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&&_n(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 yn(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);un(e,r.node(),r.before(),s)}o.inlineContent&&Qt(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 qt(l,c.map(t+n,-1),A.empty,!0)),r===!0){let t=e.doc.resolve(l);ln(e,t.node(),t.before(),e.steps.length)}return e}function bn(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 xn(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 Sn(e,t,n=t,r=A.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Cn(i,a,r)?new qt(t,n,r):new wn(i,a,r).fit()}function Cn(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var wn=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=O.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=O.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 A(i,a,o);return e>-1?new Jt(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new qt(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=Dn(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(O.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=Dn(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new A(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=Dn(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new A(Tn(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new A(Tn(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(On(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=En(this.placed,t,O.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?A.empty:new A(Tn(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new A(Tn(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||!kn(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=kn(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=kn(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=En(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=En(this.placed,this.depth,O.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(O.empty,!0);e.childCount&&(this.placed=En(this.placed,this.frontier.length,e))}};function Tn(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Tn(e.firstChild.content,t-1,n)))}function En(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(En(e.lastChild.content,t-1,n)))}function Dn(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function On(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,On(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(O.empty,!0)))),e.copy(r)}function kn(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&&!An(n,a.content,o)?s:null}function An(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function jn(e){return e.spec.defining||e.spec.definingForContent}function Mn(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(Cn(i,a,r))return e.step(new qt(t,n,r));let o=In(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=jn(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 A(Nn(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 Nn(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Nn(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(O.empty,!0))}return e}function Pn(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=bn(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new A(O.from(r),0,0))}function Fn(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),a=In(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 In(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 Ln=class e extends Bt{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 Vt.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 Vt.fromReplace(e,this.pos,this.pos+1,new A(O.from(r),0,t.isLeaf?0:1))}getMap(){return Lt.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)}};Bt.jsonID(`attr`,Ln);var Rn=class e extends Bt{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 Vt.ok(n)}getMap(){return Lt.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)}};Bt.jsonID(`docAttr`,Rn);var zn=class extends Error{};zn=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},zn.prototype=Object.create(Error.prototype),zn.prototype.constructor=zn,zn.prototype.name=`TransformError`;var Bn=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Rt}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new zn(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=A.empty){let r=Sn(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new A(O.from(n),0,0))}delete(e,t){return this.replace(e,t,A.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return Mn(this,e,t,n),this}replaceRangeWith(e,t,n){return Pn(this,e,t,n),this}deleteRange(e,t){return Fn(this,e,t),this}lift(e,t){return tn(this,e,t),this}join(e,t=1){return yn(this,e,t),this}wrap(e,t){return sn(this,e,t),this}setBlockType(e,t=e,n,r=null){return cn(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return fn(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Ln(e,t,n)),this}setDocAttribute(e,t){return this.step(new Rn(e,t)),this}addNodeMark(e,t){return this.step(new Gt(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof k)t.isInSet(n.marks)&&this.step(new Kt(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new Kt(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 mn(this,e,t,n),this}addMark(e,t,n){return Xt(this,e,t,n),this}removeMark(e,t,n){return Zt(this,e,t,n),this}clearIncompatible(e,t,n){return Qt(this,e,t,n),this}},Vn=Object.create(null),j=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Hn(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=A.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?A.empty:t),o==0&&Xn(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),Xn(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new M(e):Yn(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?Yn(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Yn(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 qn(e.node(0))}static atStart(e){return Yn(e,e,0,0,1)||new qn(e)}static atEnd(e){return Yn(e,e,e.content.size,e.childCount,-1)||new qn(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=Vn[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Vn)throw RangeError(`Duplicate use of selection JSON ID `+e);return Vn[e]=t,t.prototype.jsonID=e,t}getBookmark(){return M.between(this.$anchor,this.$head).getBookmark()}};j.prototype.visible=!0;var Hn=class{constructor(e,t){this.$from=e,this.$to=t}},Un=!1;function Wn(e){!Un&&!e.parent.inlineContent&&(Un=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var M=class e extends j{constructor(e,t=e){Wn(e),Wn(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 j.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=A.empty){if(super.replace(e,t),t==A.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 Gn(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=j.findFrom(n,r,!0)||j.findFrom(n,-r,!0);if(e)n=e.$head;else return j.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(j.findFrom(t,-r,!0)||j.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};j.jsonID(`text`,M);var Gn=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 M.between(e.resolve(this.anchor),e.resolve(this.head))}},N=class e extends j{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?j.near(a):new e(a)}content(){return new A(O.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 Kn(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}};N.prototype.visible=!1,j.jsonID(`node`,N);var Kn=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Gn(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&N.isSelectable(n)?new N(t):j.near(t)}},qn=class e extends j{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=A.empty){if(t==A.empty){e.delete(0,e.doc.content.size);let t=j.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 Jn}};j.jsonID(`all`,qn);var Jn={map(){return this},resolve(e){return new qn(e)}};function Yn(e,t,n,r,i,a=!1){if(t.inlineContent)return M.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){let t=Yn(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&N.isSelectable(r))return N.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function Xn(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof qt||i instanceof Jt))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(j.near(e.doc.resolve(o),n))}var Zn=1,Qn=2,$n=4,er=class extends Bn{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|Zn)&~Qn,this.storedMarks=null,this}get selectionSet(){return(this.updated&Zn)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Qn,this}ensureMarks(e){return k.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&Qn)>0}addStep(e,t){super.addStep(e,t),this.updated&=~Qn,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)||k.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(j.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|=$n,this}get scrolledIntoView(){return(this.updated&$n)>0}};function tr(e,t){return!t||!e?e:e.bind(t)}var nr=class{constructor(e,t,n){this.name=e,this.init=tr(t.init,n),this.apply=tr(t.apply,n)}},rr=[new nr(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new nr(`selection`,{init(e,t){return e.selection||j.atStart(t.doc)},apply(e){return e.selection}}),new nr(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new nr(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],ir=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=rr.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 nr(e.key,e.spec.state,e))})}},ar=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 er(this)}static create(t){let n=new ir(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 ir(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 ir(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=je.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=j.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 or(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=or(i,t,{})),n[r]=i}return n}var P=class{constructor(e){this.spec=e,this.props={},e.props&&or(e.props,this,this.props),this.key=e.key?e.key.key:cr(`plugin`)}getState(e){return e[this.key]}},sr=Object.create(null);function cr(e){return e in sr?e+`$`+ ++sr[e]:(sr[e]=0,e+`$`)}var F=class{constructor(e=`key`){this.key=cr(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},lr=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function ur(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var dr=(e,t,n)=>{let r=ur(e,n);if(!r)return!1;let i=_r(r);if(!i){let n=r.blockRange(),i=n&&en(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(Fr(e,i,t,-1))return!0;if(r.parent.content.size==0&&(hr(a,`end`)||N.isSelectable(a)))for(let n=r.depth;;n--){let o=Sn(e.doc,r.before(n),r.after(n),A.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(hr(a,`end`)?j.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):N.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},fr=(e,t,n)=>{let r=ur(e,n);if(!r)return!1;let i=_r(r);return i?mr(e,i,t):!1},pr=(e,t,n)=>{let r=vr(e,n);if(!r)return!1;let i=xr(r);return i?mr(e,i,t):!1};function mr(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=Sn(e.doc,i,o,A.empty);if(!s||s.from!=i||s instanceof qt&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(M.create(t.doc,i)),n(t.scrollIntoView())}return!0}function hr(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 gr=(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=_r(r)}let o=a&&a.nodeBefore;return!o||!N.isSelectable(o)?!1:(t&&t(e.tr.setSelection(N.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function _r(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 vr(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var yr=(e,t,n)=>{let r=vr(e,n);if(!r)return!1;let i=xr(r);if(!i)return!1;let a=i.nodeAfter;if(Fr(e,i,t,1))return!0;if(r.parent.content.size==0&&(hr(a,`start`)||N.isSelectable(a))){let n=Sn(e.doc,r.before(),r.after(),A.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(hr(a,`start`)?j.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):N.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},br=(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=xr(r)}let o=a&&a.nodeAfter;return!o||!N.isSelectable(o)?!1:(t&&t(e.tr.setSelection(N.create(e.doc,a.pos)).scrollIntoView()),!0)};function xr(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 Sr=(e,t)=>{let n=e.selection,r=n instanceof N,i;if(r){if(n.node.isTextblock||!hn(e.doc,n.from))return!1;i=n.from}else if(i=vn(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(N.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},Cr=(e,t)=>{let n=e.selection,r;if(n instanceof N){if(n.node.isTextblock||!hn(e.doc,n.to))return!1;r=n.to}else if(r=vn(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},wr=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&en(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},Tr=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
6
|
+
`).scrollIntoView()),!0)};function Er(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 Dr=(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=Er(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(j.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Or=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof qn||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=Er(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(M.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},kr=(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(pn(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&en(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function Ar(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof N&&t.selection.node.isBlock)return!r.parentOffset||!pn(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=Er(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 M||t.selection instanceof qn)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=pn(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,pn(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 jr=Ar(),Mr=(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(N.create(e.doc,i))),!0)},Nr=(e,t)=>(t&&t(e.tr.setSelection(new qn(e.doc))),!0);function Pr(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||hn(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function Fr(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&Pr(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=O.empty;for(let e=o.length-1;e>=0;e--)s=O.from(o[e].create(null,s));s=O.from(i.copy(s));let c=e.tr.step(new Jt(t.pos-1,r,t.pos,r,new A(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&hn(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:j.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&en(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&hr(a,`start`,!0)&&hr(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=O.empty;for(let e=o.length-1;e>=0;e--)r=O.from(o[e].copy(r));n(e.tr.step(new Jt(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new A(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Ir(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(M.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var Lr=Ir(-1),Rr=Ir(1);function zr(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&nn(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function Br(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 Vr(...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 Hr=Vr(lr,dr,gr),Ur=Vr(lr,yr,br),Wr={Enter:Vr(Tr,Or,kr,jr),"Mod-Enter":Dr,Backspace:Hr,"Mod-Backspace":Hr,"Shift-Backspace":Hr,Delete:Ur,"Mod-Delete":Ur,"Mod-a":Nr},Gr={"Ctrl-h":Wr.Backspace,"Alt-Backspace":Wr[`Mod-Backspace`],"Ctrl-d":Wr.Delete,"Ctrl-Alt-Backspace":Wr[`Mod-Delete`],"Alt-Delete":Wr[`Mod-Delete`],"Alt-d":Wr[`Mod-Delete`],"Ctrl-a":Lr,"Ctrl-e":Rr};for(let e in Wr)Gr[e]=Wr[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();var Kr=[`ol`,0],qr=[`ul`,0],Jr=[`li`,0],Yr={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?Kr:[`ol`,{start:e.attrs.order},0]}},Xr={parseDOM:[{tag:`ul`}],toDOM(){return qr}},Zr={parseDOM:[{tag:`li`}],toDOM(){return Jr},defining:!0};function Qr(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 $r(e,t,n){return e.append({ordered_list:Qr(Yr,{content:`list_item+`,group:n}),bullet_list:Qr(Xr,{content:`list_item+`,group:n}),list_item:Qr(Zr,{content:t})})}function ei(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 ti(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function ti(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 ke(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new ke(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=nn(a,n,r,t);return s?(e&&ni(e,t,s,i,n),!0):!1}function ni(e,t,n,r,i){let a=O.empty;for(let e=n.length-1;e>=0;e--)a=O.from(n[e].type.create(n[e].attrs,a));e.step(new Jt(t.start-(r?2:0),t.end,t.start,t.end,new A(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&&pn(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function ri(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=O.empty,a=i.index(-1)?1:i.index(-2)?2:3;for(let e=i.depth-a;e>=i.depth-3;e--)t=O.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(O.from(e.createAndFill()));let s=i.before(i.depth-(a-1)),c=n.tr.replace(s,i.after(-o),new A(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(j.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 pn(l.doc,i.pos,2,u)?(r&&r(l.split(i.pos,2,u).scrollIntoView()),!0):!1}}function ii(e,t){let n=ri(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 ai(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?oi(t,n,e,a):si(t,n,a):!0:!1}}function oi(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new Jt(a-1,o,a,o,new A(O.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ke(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=en(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return hn(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function si(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?O.empty:O.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new Jt(d-(s?1:0),f+(c?1:0),d+1,f-1,new A((s?O.empty:O.from(i.copy(O.empty))).append(c?O.empty:O.from(i.copy(O.empty))),s?0:1,c?0:1),s?0:1)),t(r.scrollIntoView()),!0}function ci(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=O.from(r?e.create():null),o=new A(O.from(e.create(null,O.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new Jt(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var li=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},ui=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},di=null,fi=function(e,t,n){let r=di||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},pi=function(){di=null},mi=function(e,t,n,r){return n&&(gi(e,t,n,r,-1)||gi(e,t,n,r,1))},hi=/^(img|br|input|textarea|hr)$/i;function gi(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:_i(e))){let n=e.parentNode;if(!n||n.nodeType!=1||xi(e)||hi.test(e.nodeName)||e.contentEditable==`false`)return!1;t=li(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?_i(e):0}else return!1}}function _i(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function vi(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=_i(e)}else if(e.parentNode&&!xi(e))t=li(e),e=e.parentNode;else return null}}function yi(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&&!xi(e))t=li(e)+1,e=e.parentNode;else return null}}function bi(e,t,n){for(let r=t==0,i=t==_i(e);r||i;){if(e==n)return!0;let t=li(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==_i(e)}}function xi(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 Si=function(e){return e.focusNode&&mi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Ci(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function wi(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Ti(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(_i(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(_i(r.startContainer),r.startOffset)}}}var Ei=typeof navigator<`u`?navigator:null,Di=typeof document<`u`?document:null,Oi=Ei&&Ei.userAgent||``,ki=/Edge\/(\d+)/.exec(Oi),Ai=/MSIE \d/.exec(Oi),ji=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Oi),Mi=!!(Ai||ji||ki),Ni=Ai?document.documentMode:ji?+ji[1]:ki?+ki[1]:0,Pi=!Mi&&/gecko\/(\d+)/i.test(Oi);Pi&&+(/Firefox\/(\d+)/.exec(Oi)||[0,0])[1];var Fi=!Mi&&/Chrome\/(\d+)/.exec(Oi),Ii=!!Fi,Li=Fi?+Fi[1]:0,Ri=!Mi&&!!Ei&&/Apple Computer/.test(Ei.vendor),zi=Ri&&(/Mobile\/\w+/.test(Oi)||!!Ei&&Ei.maxTouchPoints>2),Bi=zi||(Ei?/Mac/.test(Ei.platform):!1),Vi=Ei?/Win/.test(Ei.platform):!1,Hi=/Android \d/.test(Oi),Ui=!!Di&&`webkitFontSmoothing`in Di.documentElement.style,Wi=Ui?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Gi(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 Ki(e,t){return typeof e==`number`?e:e[t]}function qi(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 Ji(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=ui(o);continue}let e=o,n=e==a.body,s=n?Gi(a):qi(e),c=0,l=0;if(t.top<s.top+Ki(r,`top`)?l=-(s.top-t.top+Ki(i,`top`)):t.bottom>s.bottom-Ki(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+Ki(i,`top`)-s.top:t.bottom-s.bottom+Ki(i,`bottom`)),t.left<s.left+Ki(r,`left`)?c=-(s.left-t.left+Ki(i,`left`)):t.right>s.right-Ki(r,`right`)&&(c=t.right-s.right+Ki(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:ui(o)}}function Yi(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:Xi(e.dom)}}function Xi(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=ui(r));return t}function Zi({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Qi(n,r==0?0:r-t)}function Qi(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 $i=null;function ea(e){if(e.setActive)return e.setActive();if($i)return e.focus($i);let t=Xi(e);e.focus($i==null?{get preventScroll(){return $i={preventScroll:!0},!0}}:void 0),$i||($i=!1,Qi(t,0))}function ta(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=fi(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?na(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:ta(n,i)}function na(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=ua(r,1);if(n.top!=n.bottom&&ra(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}function ra(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function ia(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function aa(e,t,n){let{node:r,offset:i}=ta(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 oa(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 sa(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(ra(t,i))return sa(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function ca(e,t){let n=e.dom.ownerDocument,r,i=0,a=Ti(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(!ra(t,n)||(o=sa(e.dom,t,n),!o))return null}if(Ri)for(let e=o;r&&e;e=ui(e))e.draggable&&(r=void 0);if(o=ia(o,t),r){if(Pi&&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;Ui&&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=oa(e,r,i,t))}s??=aa(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function la(e){return e.top<e.bottom||e.left<e.right}function ua(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(la(e))return e}return Array.prototype.find.call(n,la)||e.getBoundingClientRect()}var da=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function fa(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=Ui||Pi;if(r.nodeType==3)if(o&&(da.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=ua(fi(r,i,i),n);if(Pi&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=ua(fi(r,i-1,i-1),-1);if(t.top==e.top){let n=ua(fi(r,i,i+1),-1);if(n.top!=e.top)return pa(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++,pa(ua(fi(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==_i(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return ma(e.getBoundingClientRect(),!1)}if(a==null&&i<_i(r)){let e=r.childNodes[i];if(e.nodeType==1)return ma(e.getBoundingClientRect(),!0)}return ma(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==_i(r))){let e=r.childNodes[i-1],t=e.nodeType==3?fi(e,_i(e)-(o?0:1)):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return pa(ua(t,1),!1)}if(a==null&&i<_i(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?fi(e,0,o?0:1):e.nodeType==1?e:null:null;if(t)return pa(ua(t,-1),!0)}return pa(ua(r.nodeType==3?fi(r):r,-n),n>=0)}function pa(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 ma(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 ha(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 ga(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return ha(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=fa(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=fi(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 _a=/[\u0590-\u08ac]/;function va(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?!_a.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:ha(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 ya=null,ba=null,xa=!1;function Sa(e,t,n){return ya==t&&ba==n?xa:(ya=t,ba=n,xa=n==`up`||n==`down`?ga(e,t,n):va(e,t,n))}var Ca=0,wa=1,Ta=2,Ea=3,Da=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=Ca,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>li(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 Pa){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 Oa&&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?li(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?li(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=li(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=li(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((Pi||Ri)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
|
|
7
|
+
`),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:li(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(Pi&&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&&Ri)&&mi(o.node,o.offset,l.anchorNode,l.anchorOffset)&&mi(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?Ta:wa,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Ea:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Ta:Ea}n=a}this.dirty=Ta}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?Ta:wa;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},Oa=class extends Da{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==Ca&&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}},ka=class extends Da{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}},Aa=class e extends Da{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=bt.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&Ea||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ea&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Ca){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=Ca}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=Za(a,n,o,r)),t>0&&(a=Za(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()}},ja=class e extends Da{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=bt.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=Ha(u,r,n),l?c=new Fa(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new Na(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=()=>O.empty)}return e}matchesNode(e,t,n){return this.dirty==Ca&&e.eq(this.node)&&Ua(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 Ga(this,a&&a.node,e);Ja(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?k.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==Ta)&&(a&&this.protectLocalComposition(e,a),Ia(this.contentDOM,this.children,e),zi&&Ya(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof M)||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=Xa(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 ka(this,i,t,r);e.input.compositionNodes.push(a),this.children=Za(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==Ea||!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=Ca}updateOuterDeco(e){if(Ua(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Ba(this.dom,this.nodeDOM,za(this.outerDeco,this.node,t),za(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 Ma(e,t,n,r,i){Ha(r,t,e);let a=new ja(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var Na=class e extends ja{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==Ea||this.dirty!=Ca&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Ca||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=Ca,!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=Ea)}get domAtom(){return!1}isText(e){return this.node.text==e}},Pa=class extends Da{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ca&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},Fa=class extends ja{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==Ea)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 Ia(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=Wa(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof Aa){let t=r?r.previousSibling:e.lastChild;Ia(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Wa(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var La=function(e){e&&(this.nodeName=e)};La.prototype=Object.create(null);var Ra=[new La];function za(e,t,n){if(e.length==0)return Ra;let r=n?Ra[0]:new La,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new La(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new La(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 Ba(e,t,n,r){if(n==Ra&&r==Ra)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=Ra[0],i=t)}Va(i,o||Ra[0],a)}return i}function Va(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 Ha(e,t,n){return Ba(e,e,Ra,za(t,n,e.nodeType!=1))}function Ua(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 Wa(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var Ga=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Ka(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=Ca,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=Aa.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==Ea&&a.dom==a.contentDOM&&(a.dirty=Ta),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 ja){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!=Ea&&Ua(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=Ta,u.updateChildren(r,a+1),u.dirty=Ca),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)||!Ua(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=ja.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=ja.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 Oa(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 Aa;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Na)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Ri||Ii)&&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 Pa(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 Ka(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 Aa)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 qa(e,t){return e.type.side-t.type.side}function Ja(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(qa);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 Ya(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 Xa(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 Za(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 Qa(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(Si(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&N.isSelectable(e)&&i.parent&&!(e.isInline&&bi(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new N(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=lo(e,u,s,n)}return l}function $a(e){return e.editable?e.hasFocus():fo(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function eo(e,t=!1){let n=e.state.selection;if(so(e,n),$a(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Ii){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&mi(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)oo(e);else{let{anchor:r,head:i}=n,a,o;to&&!(n instanceof M)&&(n.$from.parent.inlineContent||(a=no(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=no(e,n.to))),e.docView.setSelection(r,i,e,t),to&&(a&&io(a),o&&io(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&ao(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var to=Ri||Ii&&Li<63;function no(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(Ri&&i&&i.contentEditable==`false`)return ro(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return ro(i);if(a)return ro(a)}}function ro(e){return e.contentEditable=`true`,Ri&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function io(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function ao(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(()=>{(!$a(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function oo(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,li(r)+1):n.setStart(r,0),n.collapse(!0),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&Mi&&Ni<=11&&(r.disabled=!0,r.disabled=!1)}function so(e,t){if(t instanceof N){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(co(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else co(e)}function co(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function lo(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||M.between(t,n,r)}function uo(e){return e.editable&&!e.hasFocus()?!1:fo(e)}function fo(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 po(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return mi(t.node,t.offset,n.anchorNode,n.anchorOffset)}function mo(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&&j.findFrom(a,t)}function ho(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function go(e,t,n){let r=e.state.selection;if(r instanceof M){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 ho(e,new M(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=mo(e.state,t);return n&&n instanceof N?ho(e,n):!1}else if(!(Bi&&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?N.isSelectable(i)?ho(e,new N(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):Ui?ho(e,new M(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof N&&r.node.isInline)return ho(e,new M(t>0?r.$to:r.$from));else{let n=mo(e.state,t);return n?ho(e,n):!1}}function _o(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function vo(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function yo(e,t){return t<0?bo(e):xo(e)}function bo(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(Pi&&n.nodeType==1&&r<_o(n)&&vo(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(vo(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(So(n))break;else{let t=n.previousSibling;for(;t&&vo(t,-1);)i=n.parentNode,a=li(t),t=t.previousSibling;if(t)n=t,r=_o(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?To(e,n,r):i&&To(e,i,a)}function xo(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=_o(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(vo(e,1))a=n,o=++r;else break}else if(So(n))break;else{let t=n.nextSibling;for(;t&&vo(t,1);)a=t.parentNode,o=li(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=_o(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&To(e,a,o)}function So(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Co(e,t){for(;e&&t==e.childNodes.length&&!xi(e);)t=li(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 wo(e,t){for(;e&&!t&&!xi(e);)t=li(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 To(e,t,n){if(t.nodeType!=3){let e,r;(r=Co(t,n))?(t=r,n=0):(e=wo(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Si(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&&eo(e)},50)}function Eo(e,t){let n=e.state.doc.resolve(t);if(!(Ii||Vi)&&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 Do(e,t,n){let r=e.state.selection;if(r instanceof M&&!r.empty||n.indexOf(`s`)>-1||Bi&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=mo(e.state,t);if(n&&n instanceof N)return ho(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof qn?j.near(n,t):j.findFrom(n,t);return o?ho(e,o):!1}return!1}function Oo(e,t){if(!(e.state.selection instanceof M))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 ko(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Ao(e){if(!Ri||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;ko(e,n,`true`),setTimeout(()=>ko(e,n,`false`),20)}return!1}function jo(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function Mo(e,t){let n=t.keyCode,r=jo(t);if(n==8||Bi&&n==72&&r==`c`)return Oo(e,-1)||yo(e,-1);if(n==46&&!t.shiftKey||Bi&&n==68&&r==`c`)return Oo(e,1)||yo(e,1);if(n==13||n==27)return!0;if(n==37||Bi&&n==66&&r==`c`){let t=n==37?Eo(e,e.state.selection.from)==`ltr`?-1:1:-1;return go(e,t,r)||yo(e,t)}else if(n==39||Bi&&n==70&&r==`c`){let t=n==39?Eo(e,e.state.selection.from)==`ltr`?1:-1:1;return go(e,t,r)||yo(e,t)}else if(n==38||Bi&&n==80&&r==`c`)return Do(e,-1,r)||yo(e,-1);else if(n==40||Bi&&n==78&&r==`c`)return Ao(e)||Do(e,1,r)||yo(e,1);else if(r==(Bi?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function No(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`)||bt.fromSchema(e.state.schema),s=Wo(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=Ho[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,`
|
|
8
|
+
|
|
9
|
+
`),slice:t}}function Po(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 A(O.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
10
|
+
`))),0,0):A.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=bt.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=qo(n),Ui&&Jo(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`)||ot.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!Fo.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=Yo(Vo(s,+u[1],+u[2]),u[4]);else if(s=A.maxOpen(Io(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=Vo(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e)}),s}var Fo=/^(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 Io(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&&Ro(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=zo(a[a.length-1],i.length));let n=Lo(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return O.from(a)}return e}function Lo(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,O.from(e));return e}function Ro(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=Ro(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(O.from(Lo(n,e,i+1))))}}function zo(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,zo(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(O.empty,!0);return e.copy(n.append(r))}function Bo(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=Bo(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(O.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function Vo(e,t,n){return t<e.openStart&&(e=new A(Bo(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new A(Bo(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Ho={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},Uo=null;function Wo(){return Uo||=document.implementation.createHTMLDocument(`title`)}var Go=null;function Ko(e){let t=window.trustedTypes;return t?(Go||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),Go.createHTML(e)):e}function qo(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Wo().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&Ho[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=Ko(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function Jo(e){let t=e.querySelectorAll(Ii?`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 Yo(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=O.from(t.create(r[e+1],i)),a++,o++}return new A(i,a,o)}var Xo={},Zo={},Qo={touchstart:!0,touchmove:!0},$o=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 es(e){for(let t in Xo){let n=Xo[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{as(e,t)&&!is(e,t)&&(e.editable||!(t.type in Zo))&&n(e,t)},Qo[t]?{passive:!0}:void 0)}Ri&&e.dom.addEventListener(`input`,()=>null),rs(e)}function ts(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function ns(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function rs(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>is(e,t))})}function is(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function as(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 ss(e,t){!is(e,t)&&Xo[t.type]&&(e.editable||!(t.type in Zo))&&Xo[t.type](e,t)}Zo.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!xs(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Hi&&Ii&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),zi&&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,Ci(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||Mo(e,n)?n.preventDefault():ts(e,`key`)},Zo.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},Zo.keypress=(e,t)=>{let n=t;if(xs(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Bi&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof M)||!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 cs(e){return{left:e.clientX,top:e.clientY}}function ls(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function us(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 ds(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 fs(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&N.isSelectable(r)?(ds(e,new N(n),`pointer`),!0):!1}function ps(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof N&&(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(N.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:(ds(e,N.create(e.state.doc,i),`pointer`),!0)}function ms(e,t,n,r,i){return us(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?ps(e,n):fs(e,n))}function hs(e,t,n,r){return us(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function gs(e,t,n,r){return us(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||_s(e,n,r)}function _s(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(ds(e,M.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)ds(e,M.create(r,a+1,a+1+n.content.size),`pointer`);else if(N.isSelectable(n))ds(e,N.create(r,a),`pointer`);else continue;return!0}}function vs(e){return Ds(e)}var ys=Bi?`metaKey`:`ctrlKey`;Xo.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=vs(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&ls(n,e.input.lastClick)&&!n[ys]&&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(cs(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new bs(e,o,n,!!r)):(a==`doubleClick`?hs:gs)(e,o.pos,o.inside,n)?n.preventDefault():ts(e,`pointer`))};var bs=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[ys],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 N&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Pi&&!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)),ts(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(()=>eo(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(cs(e))),this.updateAllowDefault(e),this.allowDefault||!t?ts(this.view,`pointer`):ms(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ri&&this.mightDrag&&!this.mightDrag.node.isAtom||Ii&&!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)?(ds(this.view,j.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):ts(this.view,`pointer`)}move(e){this.updateAllowDefault(e),ts(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)}};Xo.touchstart=e=>{e.input.lastTouch=Date.now(),vs(e),ts(e,`pointer`)},Xo.touchmove=e=>{e.input.lastTouch=Date.now(),ts(e,`pointer`)},Xo.contextmenu=e=>vs(e);function xs(e,t){return e.composing?!0:Ri&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var Ss=Hi?5e3:-1;Zo.compositionstart=Zo.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof M&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),Ds(e,!0),e.markCursor=null;else if(Ds(e,!t.selection.empty),Pi&&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}Cs(e,Ss)},Zo.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++,Cs(e,20))};function Cs(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Ds(e),t))}function ws(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Es());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Ts(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=vi(t.focusNode,t.focusOffset),r=yi(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 Es(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function Ds(e,t=!1){if(!(Hi&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),ws(e),t||e.docView&&e.docView.dirty){let n=Qa(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 Os(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 ks=Mi&&Ni<15||zi&&Wi<604;Xo.copy=Zo.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=ks?null:n.clipboardData,{dom:o,text:s}=No(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):Os(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function As(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function js(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?Ms(e,r.value,null,i,t):Ms(e,r.textContent,r.innerHTML,i,t)},50)}function Ms(e,t,n,r,i){let a=Po(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||A.empty)))return!0;if(!a)return!1;let o=As(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 Ns(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,` `):``}Zo.paste=(e,t)=>{let n=t;if(e.composing&&!Hi)return;let r=ks?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Ms(e,Ns(r),r.getData(`text/html`),i,n)?n.preventDefault():js(e,n)};var Ps=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},Fs=Bi?`altKey`:`ctrlKey`;function Is(e,t){return e.someProp(`dragCopies`,e=>!e(t))??!t[Fs]}Xo.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(cs(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof N?i.to-1:i.to))){if(r&&r.mightDrag)o=N.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=N.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=No(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!Ii||Li>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ks?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,ks||n.dataTransfer.setData(`text/plain`,c),e.dragging=new Ps(l,Is(e,n),o)},Xo.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Zo.dragover=Zo.dragenter=(e,t)=>t.preventDefault(),Zo.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(cs(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=Po(e,Ns(n.dataTransfer),ks?null:n.dataTransfer.getData(`text/html`),!1,a);let s=!!(r&&Is(e,n));if(e.someProp(`handleDrop`,t=>t(e,n,o||A.empty,s))){n.preventDefault();return}if(!o)return;n.preventDefault();let c=o?xn(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&&N.isSelectable(o.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(o.content.firstChild))l.setSelection(new N(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(lo(e,p,l.doc.resolve(t)))}e.focus(),e.dispatch(l.setMeta(`uiEvent`,`drop`))},Xo.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())&&eo(e)},20))},Xo.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)},Xo.beforeinput=(e,t)=>{if(Ii&&Hi&&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,Ci(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in Zo)Xo[e]=Zo[e];function Ls(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 Rs=class e{constructor(e,t){this.toDOM=e,this.spec=t||Us,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 Vs(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&&Ls(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},zs=class e{constructor(e,t){this.attrs=e,this.spec=t||Us}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 Vs(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&Ls(this.attrs,t.attrs)&&Ls(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},Bs=class e{constructor(e,t){this.attrs=e,this.spec=t||Us}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 Vs(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&&Ls(this.attrs,t.attrs)&&Ls(this.spec,t.spec)}destroy(){}},Vs=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 Rs(n,r))}static inline(t,n,r,i){return new e(t,n,new zs(r,i))}static node(t,n,r,i){return new e(t,n,new Bs(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof zs}get widget(){return this.type instanceof Rs}},Hs=[],Us={},I=class e{constructor(e,t){this.local=e.length?e:Hs,this.children=t.length?t:Hs}static create(e,t){return t.length?Zs(t,e,0,Us):Ws}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==Ws||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Us)}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?Ks(this.children,o||[],t,n,r,i,a):o?new e(o.sort(Qs),Hs):Ws}add(t,n){return n.length?this==Ws?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=Ys(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,Zs(s,e,o+1,Us)),a+=3}});let o=qs(a?Xs(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(Qs):this.local,i||this.children)}remove(e){return e.length==0||this==Ws?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==Ws?(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):Ws}forChild(t,n){if(this==Ws)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 zs){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(Qs),Hs);return r?new Gs([t,r]):t}return r||Ws}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 $s(this.localsInner(e))}localsInner(e){if(this==Ws)return Hs;if(e.inlineContent||!this.local.some(zs.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof zs||t.push(this.local[e]);return t}forEachSet(e){e(this)}};I.empty=new I([],[]),I.removeOverlap=$s;var Ws=I.empty,Gs=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,Us));return e.from(r)}forChild(t,n){if(n.isLeaf)return I.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=Ws&&(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?$s(n?t:t.sort(Qs)):Hs}static from(t){switch(t.length){case 0:return Ws;case 1:return t[0];default:return new e(t.every(e=>e instanceof I)?t:t.reduce((e,t)=>e.concat(t instanceof I?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function Ks(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==Ws?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=Zs(Js(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 I(t.sort(Qs),s)}function qs(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 Vs(i.from+t,i.to+t,i.type))}return n}function Js(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 Ys(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 Xs(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Zs(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=Ys(e,t,o+n);if(s){a=!0;let e=Zs(s,t,n+o+1,r);e!=Ws&&i.push(o,o+t.nodeSize,e)}});let o=qs(a?Xs(e):e,-n).sort(Qs);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 I(o,i):Ws}function Qs(e,t){return e.from-t.from||e.to-t.to}function $s(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),ec(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),ec(t,i,r.copy(a.from,r.to)));break}}}return t}function ec(e,t,n){for(;t<e.length&&Qs(n,e[t])>0;)t++;e.splice(t,0,n)}function tc(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=Ws&&t.push(r)}),e.cursorWrapper&&t.push(I.create(e.state.doc,[e.cursorWrapper.deco])),Gs.from(t)}var nc={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},rc=Mi&&Ni<=11,ic=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}},ac=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ic,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]);Mi&&Ni<=11&&e.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),rc&&(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,nc)),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(uo(this.view)){if(this.suppressingSelectionUpdates)return eo(this.view);if(Mi&&Ni<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&mi(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=ui(n))t.add(n);for(let r=e.anchorNode;r;r=ui(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)&&uo(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(Pi&&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||dc(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&&Si(n)&&(c=Qa(e))&&c.eq(j.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,eo(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),cc(e)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||eo(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(Mi&&Ni<=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?li(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?li(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}}},oc=new WeakMap,sc=!1;function cc(e){if(!oc.has(e)&&(oc.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Pi,sc)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.`),sc=!0}}function lc(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return mi(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function uc(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return lc(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?lc(e,n):null}function dc(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 fc(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}],Si(c)||l.push({node:c.focusNode,offset:c.focusOffset})),Ii&&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`)||ot.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:pc,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 pc(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(Ri&&/^(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||Ri&&/^(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 mc=/^(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 hc(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=Qa(e,t);if(n&&!e.state.selection.eq(n)){if(Ii&&Hi&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,Ci(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=fc(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=bc(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(zi&&e.input.lastIOSEnter>Date.now()-225||Hi)&&i.some(e=>e.nodeType==1&&!mc.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,Ci(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof M&&!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=gc(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 M&&(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)),Mi&&Ni<=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((zi&&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=j.findFrom(l.doc.resolve(h.pos+1),1,!0))&&y.head>h.pos)&&e.someProp(`handleKeyDown`,t=>t(e,Ci(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&vc(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,Ci(8,`Backspace`)))){Hi&&Ii&&e.domObserver.suppressSelectionUpdates();return}Ii&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),Hi&&!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,Ci(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=gc(e,n.doc,l.sel);t&&!(Ii&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==b||t.head==n.mapping.map(x)-1)||Mi&&t.empty&&t.head==b)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},C;if(v){if(h.pos==g.pos){Mi&&Ni<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>eo(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=_c(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 gc(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:lo(e,t.resolve(n.anchor),t.resolve(n.head))}function _c(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(O.from(l).eq(e))return{mark:s,type:o}}function vc(e,t,n,r,i){if(n-t<=i.pos-r.pos||yc(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(yc(a,!0,!0));return!o.parent.isTextblock||o.pos>n||yc(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function yc(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 bc(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&&xc(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&&xc(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function xc(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 Sc=Po,Cc=Ds,wc=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 $o,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(jc),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=Dc(this),Ec(this),this.nodeViews=kc(this),this.docView=Ma(this.state.doc,Tc(this),tc(this),this.dom,this),this.domObserver=new ac(this,(e,t,n,r)=>hc(this,e,t,n,r)),this.domObserver.start(),es(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&rs(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(jc),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(ws(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=kc(this);Ac(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&rs(this),this.editable=Dc(this),Ec(this);let o=tc(this),s=Tc(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&&Yi(this);if(i){this.domObserver.stop();let t=l&&(Mi||Ii)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&Oc(n.selection,e.selection);if(l){let n=Ii?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Ts(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=Ma(e.doc,s,o,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&po(this))?eo(this,t):(so(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&&Zi(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 N){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Ji(this,t.getBoundingClientRect(),e)}else Ji(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 Ps(e.slice,e.move,r<0?void 0:N.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(Mi){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&&ea(this.dom),eo(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 ca(this,e)}coordsAtPos(e,t=1){return fa(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 Sa(this,t||this.state,e)}pasteHTML(e,t){return Ms(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return Ms(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return No(this,e)}destroy(){this.docView&&(ns(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],tc(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,pi())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return ss(this,e)}domSelectionRange(){let e=this.domSelection();return e?Ri&&this.root.nodeType===11&&wi(this.dom.ownerDocument)==this.dom&&uc(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};wc.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function Tc(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`,[Vs.node(0,e.state.doc.content.size,t)]}function Ec(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:Vs.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Dc(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function Oc(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 kc(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 Ac(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 jc(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 Mc={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:`'`},Nc={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},Pc=typeof navigator<`u`&&/Chrome\/(\d+)/.exec(navigator.userAgent);typeof navigator<`u`&&/Gecko\/\d+/.test(navigator.userAgent);for(var Fc=typeof navigator<`u`&&/Mac/.test(navigator.platform),Ic=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Lc=Fc||Pc&&+Pc[1]<57,Rc=0;Rc<10;Rc++)Mc[48+Rc]=Mc[96+Rc]=String(Rc);for(var Rc=1;Rc<=24;Rc++)Mc[Rc+111]=`F`+Rc;for(var Rc=65;Rc<=90;Rc++)Mc[Rc]=String.fromCharCode(Rc+32),Nc[Rc]=String.fromCharCode(Rc);for(var zc in Mc)Nc.hasOwnProperty(zc)||(Nc[zc]=Mc[zc]);function Bc(e){var t=!(Lc&&(e.ctrlKey||e.altKey||e.metaKey)||Ic&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?Nc:Mc)[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 Vc=typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Hc(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))Vc?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 Uc(e){let t=Object.create(null);for(let n in e)t[Hc(n)]=e[n];return t}function Wc(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 Gc(e){return new P({props:{handleKeyDown:Kc(e)}})}function Kc(e){let t=Uc(e);return function(e,n){let r=Bc(n),i,a=t[Wc(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[Wc(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=Mc[n.keyCode])&&i!=r){let r=t[Wc(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var qc=Object.defineProperty,Jc=(e,t)=>{for(var n in t)qc(e,n,{get:t[n],enumerable:!0})};function Yc(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 Xc=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:Yc({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}},Zc={};Jc(Zc,{blur:()=>Qc,clearContent:()=>$c,clearNodes:()=>el,command:()=>tl,createParagraphNear:()=>nl,cut:()=>rl,deleteCurrentNode:()=>il,deleteNode:()=>ol,deleteRange:()=>sl,deleteSelection:()=>cl,enter:()=>ll,exitCode:()=>ul,extendMarkRange:()=>_l,first:()=>vl,focus:()=>Tl,forEach:()=>El,insertContent:()=>Dl,insertContentAt:()=>Nl,joinBackward:()=>Il,joinDown:()=>Fl,joinForward:()=>Ll,joinItemBackward:()=>Rl,joinItemForward:()=>zl,joinTextblockBackward:()=>Bl,joinTextblockForward:()=>Vl,joinUp:()=>Pl,keyboardShortcut:()=>Wl,lift:()=>Kl,liftEmptyBlock:()=>ql,liftListItem:()=>Jl,newlineInCode:()=>Yl,resetAttributes:()=>Ql,scrollIntoView:()=>$l,selectAll:()=>eu,selectNodeBackward:()=>tu,selectNodeForward:()=>nu,selectParentNode:()=>ru,selectTextblockEnd:()=>iu,selectTextblockStart:()=>au,setContent:()=>su,setMark:()=>ld,setMeta:()=>ud,setNode:()=>dd,setNodeSelection:()=>fd,setTextDirection:()=>pd,setTextSelection:()=>md,sinkListItem:()=>hd,splitBlock:()=>_d,splitListItem:()=>vd,toggleList:()=>xd,toggleMark:()=>Sd,toggleNode:()=>Cd,toggleWrap:()=>wd,undoInputRule:()=>Td,unsetAllMarks:()=>Ed,unsetMark:()=>Dd,unsetTextDirection:()=>Od,updateAttributes:()=>kd,wrapIn:()=>Ad,wrapInList:()=>jd});var Qc=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),$c=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),el=()=>({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=en(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},tl=e=>t=>e(t),nl=()=>({state:e,dispatch:t})=>Or(e,t),rl=(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 M(r.doc.resolve(Math.max(o-1,0)))),!0},il=()=>({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 al(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 ol=e=>({tr:t,state:n,dispatch:r})=>{let i=al(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},sl=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},cl=()=>({state:e,dispatch:t})=>lr(e,t),ll=()=>({commands:e})=>e.keyboardShortcut(`Enter`),ul=()=>({state:e,dispatch:t})=>Dr(e,t);function dl(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function fl(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:dl(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function pl(e,t,n={}){return e.find(e=>e.type===t&&fl(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function ml(e,t,n={}){return!!pl(e,t,n)}function hl(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,!pl([...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&&ml([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&ml([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function gl(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 _l=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=gl(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=hl(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=M.create(o,e.from,e.to);n.setSelection(t)}}return!0},vl=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 yl(e){return e instanceof M}function bl(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function xl(e,t=null){if(!t)return null;let n=j.atStart(e),r=j.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?M.create(e,bl(0,i,a),bl(e.content.size,i,a)):M.create(e,bl(t,i,a),bl(t,i,a))}function Sl(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function Cl(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function wl(){return typeof navigator<`u`?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var Tl=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(Cl()||Sl())&&r.dom.focus(),wl()&&!Cl()&&!Sl()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(a&&e===null&&!yl(n.state.selection))return o(),!0;let s=xl(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},El=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),Dl=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Ol=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&&Ol(r)}return e};function kl(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 Ol(n)}function Al(e,t,n){if(e instanceof je||e instanceof O)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 O.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),Al(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new nt({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?ot.fromSchema(a).parseSlice(kl(e),n.parseOptions):ot.fromSchema(a).parse(kl(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=ot.fromSchema(t);return n.slice?r.parseSlice(kl(e),n.parseOptions).content:r.parse(kl(e),n.parseOptions)}return Al(``,t,n)}function jl(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof qt||i instanceof Jt))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(j.near(e.doc.resolve(o),n))}var Ml=e=>!(`type`in e),Nl=(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{Al(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=Al(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((Ml(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 O){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&&jl(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},Pl=()=>({state:e,dispatch:t})=>Sr(e,t),Fl=()=>({state:e,dispatch:t})=>Cr(e,t),Il=()=>({state:e,dispatch:t})=>dr(e,t),Ll=()=>({state:e,dispatch:t})=>yr(e,t),Rl=()=>({state:e,dispatch:t,tr:n})=>{try{let r=vn(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},zl=()=>({state:e,dispatch:t,tr:n})=>{try{let r=vn(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Bl=()=>({state:e,dispatch:t})=>fr(e,t),Vl=()=>({state:e,dispatch:t})=>pr(e,t);function Hl(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function Ul(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))Cl()||Hl()?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 Wl=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=Ul(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 Gl(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?al(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=>fl(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var Kl=(e,t={})=>({state:n,dispatch:r})=>Gl(n,al(e,n.schema),t)?wr(n,r):!1,ql=()=>({state:e,dispatch:t})=>kr(e,t),Jl=e=>({state:t,dispatch:n})=>ai(al(e,t.schema))(t,n),Yl=()=>({state:e,dispatch:t})=>Tr(e,t);function Xl(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function Zl(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 Ql=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Xl(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=al(e,r.schema)),s===`mark`&&(o=gl(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,Zl(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(Zl(a.attrs,t))))})})}),c},$l=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),eu=()=>({tr:e,dispatch:t})=>{if(t){let t=new qn(e.doc);e.setSelection(t)}return!0},tu=()=>({state:e,dispatch:t})=>gr(e,t),nu=()=>({state:e,dispatch:t})=>br(e,t),ru=()=>({state:e,dispatch:t})=>Mr(e,t),iu=()=>({state:e,dispatch:t})=>Rr(e,t),au=()=>({state:e,dispatch:t})=>Lr(e,t);function ou(e,t,n={},r={}){return Al(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var su=(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=ou(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 cu(e,t){let n=gl(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 lu(e,t){let n=new Bn(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function uu(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 du(e,t){let n=[];return e.descendants((e,r)=>{t(e)&&n.push({node:e,pos:r})}),n}function fu(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function pu(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 mu(e){return t=>pu(t.$from,e)}function L(e,t,n){return e.config[t]===void 0&&e.parent?L(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?L(e.parent,t,n):null}):e.config[t]}function hu(e){return e.map(e=>{let t=L(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...hu(t())]:e}).flat(10)}function gu(e,t){let n=bt.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function _u(e){return typeof e==`function`}function R(e,t=void 0,...n){return _u(e)?t?e.bind(t)(...n):e(...n):e}function vu(e={}){return Object.keys(e).length===0&&e.constructor===Object}function yu(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function bu(e){let t=[],{nodeExtensions:n,markExtensions:r}=yu(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=L(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=L(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 z(...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 xu(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)=>z(e,t),{})}function Su(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function Cu(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):Su(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function wu(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&vu(t)?!1:t!=null))}function Tu(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 Eu(e,t){let n=bu(e),{nodeExtensions:r,markExtensions:i}=yu(e);return new nt({topNode:r.find(e=>L(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=wu({...e.reduce((e,t)=>{let n=L(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:R(L(r,`content`,a)),marks:R(L(r,`marks`,a)),group:R(L(r,`group`,a)),inline:R(L(r,`inline`,a)),atom:R(L(r,`atom`,a)),selectable:R(L(r,`selectable`,a)),draggable:R(L(r,`draggable`,a)),code:R(L(r,`code`,a)),whitespace:R(L(r,`whitespace`,a)),linebreakReplacement:R(L(r,`linebreakReplacement`,a)),defining:R(L(r,`defining`,a)),isolating:R(L(r,`isolating`,a)),attrs:Object.fromEntries(i.map(Tu))}),s=R(L(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Cu(e,i)));let c=L(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:xu(e,i)}));let l=L(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=wu({...e.reduce((e,t)=>{let n=L(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:R(L(r,`inclusive`,a)),excludes:R(L(r,`excludes`,a)),group:R(L(r,`group`,a)),spanning:R(L(r,`spanning`,a)),code:R(L(r,`code`,a)),attrs:Object.fromEntries(i.map(Tu))}),s=R(L(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Cu(e,i)));let c=L(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:xu(e,i)})),[r.name,o]}))})}function Du(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function Ou(e){return e.sort((e,t)=>{let n=L(e,`priority`)||100,r=L(t,`priority`)||100;return n>r?-1:n<r?1:0})}function ku(e){let t=Ou(hu(e)),n=Du(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 Au(e,t){return Eu(ku(e),t)}function ju(e,t){let n=Au(t);return gu(je.fromJSON(n,e).content,n)}function Mu(e,t){let n=Au(t),r=kl(e);return ot.fromSchema(n).parse(r).toJSON()}function Nu(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
|
|
11
|
+
|
|
12
|
+
`,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 Pu(e,t){return Nu(e,{from:0,to:e.content.size},t)}function Fu(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Iu(e,t,n){let{blockSeparator:r=`
|
|
13
|
+
|
|
14
|
+
`,textSerializers:i={}}=n||{},a=Au(t);return Pu(je.fromJSON(a,e),{blockSeparator:r,textSerializers:{...Fu(a),...i}})}function Lu(e,t){let n=al(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 Ru(e,t){let n=Xl(typeof t==`string`?t:t.name,e.schema);return n===`node`?Lu(e,t):n===`mark`?cu(e,t):{}}function zu(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 Bu(e){let t=zu(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 Vu(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}})})}),Bu(r)}function Hu(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(Hu(e,t+r+n))})),e.text&&(s.text=e.text),s}function Uu(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=hl(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 Wu=(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 Gu(e,t){return t.nodes[e]||t.marks[e]||null}function Ku(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 qu=(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 Ju(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?gl(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>fl(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=>fl(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 Yu(e,t,n={}){if(!t)return Gl(e,null,n)||Ju(e,null,n);let r=Xl(t,e.schema);return r===`node`?Gl(e,t,n):r===`mark`?Ju(e,t,n):!1}var Xu=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=mu(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)},Zu=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function Qu(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function $u(e,t){let{nodeExtensions:n}=yu(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=R(L(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function ed(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&&(ed(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function td(e){return e instanceof N}var nd=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function rd(e,t){let n=t.mapping.mapResult(e.position);return{position:new nd(n.pos),mapResult:n}}function id(e){return new nd(e)}function ad(e,t,n){let r=e.state.doc.content.size,i=bl(t,0,r),a=bl(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 od({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=>od({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 sd(e,t,n){return od({json:e,validNodes:new Set(Object.keys(t.nodes)),validMarks:new Set(Object.keys(t.marks)),options:n})}function cd(e,t,n){let{selection:r}=t,i=null;if(yl(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 ld=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=gl(e,r.schema);if(i)if(o){let e=cu(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 cd(r,n,c)},ud=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),dd=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=al(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>Br(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>Br(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},fd=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=bl(e,0,n.content.size),i=N.create(n,r);t.setSelection(i)}return!0},pd=(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},md=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=M.atStart(n).from,o=M.atEnd(n).to,s=bl(r,a,o),c=bl(i,a,o),l=M.create(n,s,c);t.setSelection(l)}return!0},hd=e=>({state:t,dispatch:n})=>ci(al(e,t.schema))(t,n);function gd(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 _d=({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=Ku(l,s.node().type.name,s.node().attrs);if(a instanceof N&&a.node.isBlock)return!s.parentOffset||!pn(o,s.pos)?!1:(r&&(e&&gd(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:uu(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=pn(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&pn(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 M&&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&&gd(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},vd=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=al(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=O.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=O.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={...Ku(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(O.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new A(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(M.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...Ku(d,u.type.name,u.attrs),...t},m={...Ku(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(!pn(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},yd=(e,t)=>{let n=mu(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&&hn(e.doc,n.pos)&&e.join(n.pos),!0},bd=(e,t)=>{let n=mu(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&&hn(e.doc,r)&&e.join(r),!0},xd=(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=al(e,o.schema),m=al(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=mu(e=>$u(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($u(x.node.type.name,d)&&p.validContent(x.node.content)&&s)return c().command(()=>(a.setNodeMarkup(x.pos,p),!0)).command(()=>yd(a,p)).command(()=>bd(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>yd(a,p)).command(()=>bd(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(()=>yd(a,p)).command(()=>bd(a,p)).run()},Sd=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=gl(e,r.schema);return Ju(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},Cd=(e,t,n={})=>({state:r,commands:i})=>{let a=al(e,r.schema),o=al(t,r.schema),s=Gl(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})},wd=(e,t={})=>({state:n,commands:r})=>{let i=al(e,n.schema);return Gl(n,i,t)?r.lift(i):r.wrapIn(i,t)},Td=()=>({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},Ed=()=>({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},Dd=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=gl(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=hl(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},Od=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},kd=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Xl(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=al(e,r.schema)),s===`mark`&&(o=gl(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},Ad=(e,t={})=>({state:n,dispatch:r})=>zr(al(e,n.schema),t)(n,r),jd=(e,t={})=>({state:n,dispatch:r})=>ei(al(e,n.schema),t)(n,r),Md=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={}}},Nd=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},Pd=(e,t)=>{if(dl(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 Fd(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=qu(c)+i;return a.forEach(e=>{if(l)return;let a=Pd(u,e.find);if(!a)return;let c=s.state.tr,d=Yc({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new Xc({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 Id(e){let{editor:t,rules:n}=e,r=new P({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:gu(O.from(e),a.schema);let{from:i}=s;Fd({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 Fd({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&Fd({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?Fd({editor:t,from:a.pos,to:a.pos,text:`
|
|
15
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Ld(e){return Object.prototype.toString.call(e).slice(8,-1)}function Rd(e){return Ld(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}function zd(e,t){let n={...e};return Rd(e)&&Rd(t)&&Object.keys(t).forEach(r=>{Rd(t[r])&&Rd(e[r])?n[r]=zd(e[r],t[r]):n[r]=t[r]}),n}var Bd=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{...R(L(this,`addOptions`,{name:this.name}))||{}}}get storage(){return{...R(L(this,`addStorage`,{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>zd(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}},Vd=class e extends Bd{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 Hd(e){return typeof e==`number`}var Ud=class{constructor(e){this.find=e.find,this.handler=e.handler}},Wd=(e,t,n)=>{if(dl(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 Gd(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new Xc({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||Wd(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 Kd=null,qd=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function Jd(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(!(!Gd({editor:t,state:Yc({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 P({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(Kd=t)},i=()=>{Kd&&=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=Kd;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:gu(O.from(t),r.schema);let{from:n}=d,i=n+t.length,a=qd(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(!(!Hd(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var Yd=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=ku(e),this.schema=Eu(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=L(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Gu(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return Ou([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Gu(t.name,this.schema)},r=[],i=L(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&L(t,`exitable`,n)&&(a.ArrowRight=()=>Vd.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=Gc(a);r.push(o);let s=L(t,`addInputRules`,n);if(Qu(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=Id({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=L(t,`addPasteRules`,n);if(Qu(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=Jd({editor:e,rules:t});r.push(...n)}}let l=L(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return bu(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=yu(this.extensions);return Object.fromEntries(t.filter(e=>!!L(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=L(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:al(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:xu(r,n)})]:[]}))}dispatchTransaction(e){let{editor:t}=this;return Ou([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Gu(n.name,this.schema)},i=L(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}get markViews(){let{editor:e}=this,{markExtensions:t}=yu(this.extensions);return Object.fromEntries(t.filter(e=>!!L(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=L(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:gl(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=xu(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{If(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:Gu(e.name,this.schema)};e.type===`mark`&&(R(L(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name);let n=L(e,`onBeforeCreate`,t),r=L(e,`onCreate`,t),i=L(e,`onUpdate`,t),a=L(e,`onSelectionUpdate`,t),o=L(e,`onTransaction`,t),s=L(e,`onFocus`,t),c=L(e,`onBlur`,t),l=L(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)})}};Yd.resolve=ku,Yd.sort=Ou,Yd.flatten=hu;var Xd={};Jc(Xd,{ClipboardTextSerializer:()=>Zd,Commands:()=>Qd,Delete:()=>$d,Drop:()=>ef,Editable:()=>tf,FocusEvents:()=>rf,Keymap:()=>af,Paste:()=>of,Tabindex:()=>sf,TextDirection:()=>cf,focusEventsPluginKey:()=>nf});var B=class e extends Bd{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)}},Zd=B.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new P({key:new F(`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=Fu(n);return Nu(r,{from:o,to:s},{...this.options.blockSeparator===void 0?{}:{blockSeparator:this.options.blockSeparator},textSerializers:c})}}})]}}),Qd=B.create({name:`commands`,addCommands(){return{...Zc}}}),$d=B.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=lu(e.before,[e,...t]);Vu(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 Wt){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()}}),ef=B.create({name:`drop`,addProseMirrorPlugins(){return[new P({key:new F(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),tf=B.create({name:`editable`,addProseMirrorPlugins(){return[new P({key:new F(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),nf=new F(`focusEvents`),rf=B.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new P({key:nf,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}}}})]}}),af=B.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:j.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 Cl()||Hl()?i:r},addProseMirrorPlugins(){return[new P({key:new F(`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=j.atStart(t.doc).from,l=j.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!ed(n.doc))return;let u=n.tr,d=Yc({state:n,transaction:u}),{commands:f}=new Xc({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),of=B.create({name:`paste`,addProseMirrorPlugins(){return[new P({key:new F(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),sf=B.create({name:`tabindex`,addProseMirrorPlugins(){return[new P({key:new F(`tabindex`),props:{attributes:()=>this.editor.isEditable?{tabindex:`0`}:{}}})]}}),cf=B.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=yu(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 P({key:new F(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),lf=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=n.isInline,s=this.pos+r+(a?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),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)}},uf=`.ProseMirror {
|
|
16
|
+
position: relative;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.ProseMirror {
|
|
20
|
+
word-wrap: break-word;
|
|
21
|
+
white-space: pre-wrap;
|
|
22
|
+
white-space: break-spaces;
|
|
23
|
+
-webkit-font-variant-ligatures: none;
|
|
24
|
+
font-variant-ligatures: none;
|
|
25
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.ProseMirror [contenteditable="false"] {
|
|
29
|
+
white-space: normal;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
33
|
+
white-space: pre-wrap;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ProseMirror pre {
|
|
37
|
+
white-space: pre-wrap;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
img.ProseMirror-separator {
|
|
41
|
+
display: inline !important;
|
|
42
|
+
border: none !important;
|
|
43
|
+
margin: 0 !important;
|
|
44
|
+
width: 0 !important;
|
|
45
|
+
height: 0 !important;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.ProseMirror-gapcursor {
|
|
49
|
+
display: none;
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
position: absolute;
|
|
52
|
+
margin: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ProseMirror-gapcursor:after {
|
|
56
|
+
content: "";
|
|
57
|
+
display: block;
|
|
58
|
+
position: absolute;
|
|
59
|
+
top: -2px;
|
|
60
|
+
width: 20px;
|
|
61
|
+
border-top: 1px solid black;
|
|
62
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@keyframes ProseMirror-cursor-blink {
|
|
66
|
+
to {
|
|
67
|
+
visibility: hidden;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ProseMirror-hideselection *::selection {
|
|
72
|
+
background: transparent;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
76
|
+
background: transparent;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ProseMirror-hideselection * {
|
|
80
|
+
caret-color: transparent;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
84
|
+
display: block;
|
|
85
|
+
}`;function df(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 ff=class extends Md{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,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:rd,createMappablePosition:id},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=xl(t,this.options.autofocus);this.editorState=ar.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=df(uf,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=_u(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 Yd([...this.options.enableCoreExtensions?[tf,Zd.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),Qd,rf,af,sf,ef,of,$d,cf.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 Xc({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=ou(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=ou(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r;this.editorView=new wc(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();let o=this.view.dom;o.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 Ru(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return Yu(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return gu(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
|
|
86
|
+
|
|
87
|
+
`,textSerializers:n={}}=e||{};return Pu(this.state.doc,{blockSeparator:t,textSerializers:{...Fu(this.schema),...n}})}get isEmpty(){return ed(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 lf(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}};function pf(e){return new Nd({find:e.find,handler:({state:t,range:n,match:r})=>{let i=R(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(Uu(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 mf(e){return new Nd({find:e.find,handler:({state:t,range:n,match:r})=>{let i=R(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 hf(e){return new Nd({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=R(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 gf(e){return new Nd({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 _f(e){return new Nd({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=R(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&nn(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&&hn(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var vf=(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]},yf=e=>`touches`in e,bf=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.lastEditableState=void 0,this.handleMap=new Map,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.editor=e.editor,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||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}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.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=`flex`,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;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}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,yf(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}}},xf=bf;function Sf(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof N){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 Cf(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)}function wf(){return typeof navigator<`u`?/Firefox/.test(navigator.userAgent):!1}function Tf(e){return typeof e==`string`}var Ef={};Jc(Ef,{createAtomBlockMarkdownSpec:()=>kf,createBlockMarkdownSpec:()=>Af,createInlineMarkdownSpec:()=>Nf,parseAttributes:()=>Df,parseIndentedBlocks:()=>Pf,renderNestedMarkdownContent:()=>Ff,serializeAttributes:()=>Of});function Df(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 Of(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 kf(e){let{nodeName:t,name:n,parseAttributes:r=Df,serializeAttributes:i=Of,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 Af(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=Df,serializeAttributes:a=Of,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}}`:``}
|
|
88
|
+
|
|
89
|
+
${t.renderChildren(e.content||[],`
|
|
90
|
+
|
|
91
|
+
`)}
|
|
92
|
+
|
|
93
|
+
:::`}}}function jf(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 Mf(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function Nf(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=jf,serializeAttributes:a=Mf,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=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 Pf(e,t,n){let r=e.split(`
|
|
94
|
+
`),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}
|
|
95
|
+
`;continue}else return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}
|
|
96
|
+
`;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}
|
|
97
|
+
`,o+=1;continue}else break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}
|
|
98
|
+
`,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`
|
|
99
|
+
`);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 Ff(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(`
|
|
100
|
+
`).map(e=>e?t.indent(e):``).join(`
|
|
101
|
+
`);s.push(e)}}),s.join(`
|
|
102
|
+
`)}function If(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 Lf=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){If(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`&&(Cl()||Sl())&&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)}},V=class e extends Bd{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)}},Rf=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=N.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=N.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`&&(Cl()||Sl())&&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 zf(e){return new Ud({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=R(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(Uu(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 Bf(e){return new Ud({find:e.find,handler({match:t,chain:n,range:r,pasteEvent:i}){let a=R(e.getAttributes,void 0,t,i),o=R(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 Vf(e){return new Ud({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 Hf=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}}},Uf={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Wf(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Uf,[...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 Gf=(0,t.markRaw)({name:`mdi-content-cut`,render:Wf}),Kf={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function qf(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Kf,[...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 Jf=(0,t.markRaw)({name:`mingcute-copy-line`,render:qf}),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:`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 Zf=(0,t.markRaw)({name:`mingcute-refresh-2-line`,render:Xf});function Qf(e,t){typeof console<`u`&&(console.warn(`[intlify] `+e),t&&console.warn(t.stack))}var $f=typeof window<`u`,ep=(e,t=!1)=>t?Symbol.for(e):Symbol(e),tp=(e,t,n)=>np({l:e,k:t,s:n}),np=e=>JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`).replace(/\u0027/g,`\\u0027`),rp=e=>typeof e==`number`&&isFinite(e),ip=e=>xp(e)===`[object Date]`,ap=e=>xp(e)===`[object RegExp]`,op=e=>G(e)&&Object.keys(e).length===0,sp=Object.assign,cp=Object.create,H=(e=null)=>cp(e),lp,up=()=>lp||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:H();function dp(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/\//g,`/`).replace(/=/g,`=`)}function fp(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`)}function pp(e){return e=e.replace(/(\w+)\s*=\s*"([^"]*)"/g,(e,t,n)=>`${t}="${fp(n)}"`),e=e.replace(/(\w+)\s*=\s*'([^']*)'/g,(e,t,n)=>`${t}='${fp(n)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,`$1on$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:`)}),e}var mp=Object.prototype.hasOwnProperty;function hp(e,t){return mp.call(e,t)}var gp=Array.isArray,_p=e=>typeof e==`function`,U=e=>typeof e==`string`,vp=e=>typeof e==`boolean`,W=e=>typeof e==`object`&&!!e,yp=e=>W(e)&&_p(e.then)&&_p(e.catch),bp=Object.prototype.toString,xp=e=>bp.call(e),G=e=>xp(e)===`[object Object]`,Sp=e=>e==null?``:gp(e)||G(e)&&e.toString===bp?JSON.stringify(e,null,2):String(e);function Cp(e,t=``){return e.reduce((e,n,r)=>r===0?e+n:e+t+n,``)}var wp=e=>!W(e)||gp(e);function Tp(e,t){if(wp(e)||wp(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__`&&(W(e[r])&&!W(t[r])&&(t[r]=Array.isArray(e[r])?[]:H()),wp(t[r])||wp(e[r])?t[r]=e[r]:n.push({src:e[r],des:t[r]}))})}}function Ep(e,t,n){return{line:e,column:t,offset:n}}function Dp(e,t,n){let r={start:e,end:t};return n!=null&&(r.source=n),r}var K={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};K.EXPECTED_TOKEN,K.INVALID_TOKEN_IN_PLACEHOLDER,K.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,K.UNKNOWN_ESCAPE_SEQUENCE,K.INVALID_UNICODE_ESCAPE_SEQUENCE,K.UNBALANCED_CLOSING_BRACE,K.UNTERMINATED_CLOSING_BRACE,K.EMPTY_PLACEHOLDER,K.NOT_ALLOW_NEST_PLACEHOLDER,K.INVALID_LINKED_FORMAT,K.MUST_HAVE_MESSAGES_IN_PLURAL,K.UNEXPECTED_EMPTY_LINKED_MODIFIER,K.UNEXPECTED_EMPTY_LINKED_KEY,K.UNEXPECTED_LEXICAL_ANALYSIS,K.UNHANDLED_CODEGEN_NODE_TYPE,K.UNHANDLED_MINIFIER_NODE_TYPE;function Op(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 kp(e){throw e}var Ap=` `,jp=`\r`,Mp=`
|
|
103
|
+
`,Np=`\u2028`,Pp=`\u2029`;function Fp(e){let t=e,n=0,r=1,i=1,a=0,o=e=>t[e]===jp&&t[e+1]===Mp,s=e=>t[e]===Mp,c=e=>t[e]===Pp,l=e=>t[e]===Np,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)?Mp: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 Ip=void 0,Lp=`'`,Rp=`tokenizer`;function zp(e,t={}){let n=t.location!==!1,r=Fp(e),i=()=>r.index(),a=()=>Ep(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(Op(e,n?Dp(a.startLoc,t):null,{domain:Rp,args:i}))}function f(e,t,r){e.endLoc=a(),e.currentType=t;let i={type:t};return n&&(i.loc=Dp(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(K.EXPECTED_TOKEN,a(),0,t),``)}function h(e){let t=``;for(;e.currentPeek()===Ap||e.currentPeek()===Mp;)t+=e.currentPeek(),e.peek();return t}function g(e){let t=h(e);return e.skipToPeek(),t}function _(e){if(e===Ip)return!1;let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t===95}function v(e){if(e===Ip)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()===Lp;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===Ap||!t?!1:t===Mp?(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===Ap||r===Mp):i===Ap?(e.peek(),n(!0,Ap)):i===Mp?(e.peek(),n(!0,Mp)):!0},r=n();return t&&e.resetPeek(),r}function E(e,t){let n=e.currentChar();return n===Ip?Ip: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 O(e){let t=``,n=``;for(;t=oe(e);)n+=t;return n}function le(e){let t=``;for(;;){let n=e.currentChar();if(n===`{`||n===`}`||n===`@`||n===`|`||!n)break;if(n===Ap||n===Mp)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 ue(e){g(e);let t=``,n=``;for(;t=ae(e);)n+=t;let r=e.currentChar();if(r&&r!==`}`&&r!==Ip&&r!==Ap&&r!==Mp&&r!==` `){let t=he(e);return d(K.INVALID_TOKEN_IN_PLACEHOLDER,a(),0,n+t),n+t}return e.currentChar()===Ip&&d(K.UNTERMINATED_CLOSING_BRACE,a(),0),n}function de(e){g(e);let t=``;return e.currentChar()===`-`?(e.next(),t+=`-${O(e)}`):t+=O(e),e.currentChar()===Ip&&d(K.UNTERMINATED_CLOSING_BRACE,a(),0),t}function k(e){return e!==Lp&&e!==Mp}function fe(e){g(e),m(e,`'`);let t=``,n=``;for(;t=E(e,k);)t===`\\`?n+=A(e):n+=t;let r=e.currentChar();return r===Mp||r===Ip?(d(K.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,a(),0),r===Mp&&(e.next(),m(e,`'`)),n):(m(e,`'`),n)}function A(e){let t=e.currentChar();switch(t){case`\\`:case`'`:return e.next(),`\\${t}`;case`u`:return pe(e,t,4);case`U`:return pe(e,t,6);default:return d(K.UNKNOWN_ESCAPE_SEQUENCE,a(),0,t),``}}function pe(e,t,n){m(e,t);let r=``;for(let i=0;i<n;i++){let n=ce(e);if(!n){d(K.INVALID_UNICODE_ESCAPE_SEQUENCE,a(),0,`\\${t}${r}${e.currentChar()}`);break}r+=n}return`\\${t}${r}`}function me(e){return e!==`{`&&e!==`}`&&e!==Ap&&e!==Mp}function he(e){g(e);let t=``,n=``;for(;t=E(e,me);)n+=t;return n}function ge(e){let t=``,n=``;for(;t=re(e);)n+=t;return n}function _e(e){let t=n=>{let r=e.currentChar();return r===`{`||r===`@`||r===`|`||r===`(`||r===`)`||!r||r===Ap?n:(n+=r,e.next(),t(n))};return t(``)}function ve(e){g(e);let t=m(e,`|`);return g(e),t}function ye(e,t){let n=null;switch(e.currentChar()){case`{`:return t.braceNest>=1&&d(K.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(K.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(K.UNTERMINATED_CLOSING_BRACE,a(),0),n=be(e,t)||p(t),t.braceNest=0,n;default:{let r=!0,i=!0,o=!0;if(ee(e))return t.braceNest>0&&d(K.UNTERMINATED_CLOSING_BRACE,a(),0),n=f(t,1,ve(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(t.currentType===4||t.currentType===5||t.currentType===6))return d(K.UNTERMINATED_CLOSING_BRACE,a(),0),t.braceNest=0,xe(e,t);if(r=y(e,t))return n=f(t,4,ue(e)),g(e),n;if(i=b(e,t))return n=f(t,5,de(e)),g(e),n;if(o=x(e,t))return n=f(t,6,fe(e)),g(e),n;if(!r&&!i&&!o)return n=f(t,12,he(e)),d(K.INVALID_TOKEN_IN_PLACEHOLDER,a(),0,n.value),g(e),n;break}}return n}function be(e,t){let{currentType:n}=t,r=null,i=e.currentChar();switch((n===7||n===8||n===11||n===9)&&(i===Mp||i===Ap)&&d(K.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,ve(e)),t.braceNest=0,t.inLinked=!1,r):S(e,t)||w(e,t)?(g(e),be(e,t)):C(e,t)?(g(e),f(t,11,ge(e))):T(e,t)?(g(e),i===`{`?ye(e,t)||r:f(t,10,_e(e))):(n===7&&d(K.INVALID_LINKED_FORMAT,a(),0),t.braceNest=0,t.inLinked=!1,xe(e,t))}}function xe(e,t){let n={type:13};if(t.braceNest>0)return ye(e,t)||p(t);if(t.inLinked)return be(e,t)||p(t);switch(e.currentChar()){case`{`:return ye(e,t)||p(t);case`}`:return d(K.UNBALANCED_CLOSING_BRACE,a(),0),e.next(),f(t,3,`}`);case`@`:return be(e,t)||p(t);default:if(ee(e))return n=f(t,1,ve(e)),t.braceNest=0,t.inLinked=!1,n;if(te(e))return f(t,0,le(e));break}return n}function Se(){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()===Ip?f(c,13):xe(r,c)}return{nextToken:Se,currentOffset:i,currentPosition:a,context:l}}var Bp=`parser`,Vp=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function Hp(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 Up(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(Op(r,t?Dp(i,s):null,{domain:Bp,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(Vp,Hp),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,K.UNEXPECTED_LEXICAL_ANALYSIS,n.lastStartLoc,0,Wp(t)),c.value=t.value||``,a(c,e.currentOffset(),e.currentPosition()),{node:c}):(r(e,K.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,K.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Wp(o)),o=e.nextToken(),o.type===2&&(o=e.nextToken()),o.type){case 10:o.value??r(e,K.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Wp(o)),n.key=d(e,o.value||``);break;case 4:o.value??r(e,K.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Wp(o)),n.key=c(e,o.value||``);break;case 5:o.value??r(e,K.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Wp(o)),n.key=s(e,o.value||``);break;case 6:o.value??r(e,K.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Wp(o)),n.key=l(e,o.value||``);break;default:{r(e,K.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,K.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Wp(i)),n.items.push(o(e,i.value||``));break;case 5:i.value??r(e,K.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Wp(i)),n.items.push(s(e,i.value||``));break;case 4:i.value??r(e,K.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Wp(i)),n.items.push(c(e,i.value||``));break;case 6:i.value??r(e,K.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,Wp(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,K.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=zp(n,sp({},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,K.UNEXPECTED_LEXICAL_ANALYSIS,s.lastStartLoc,0,n[s.offset]||``),a(c,o.currentOffset(),o.currentPosition()),c}return{parse:g}}function Wp(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 Gp(e,t={}){let n={ast:e,helpers:new Set};return{context:()=>n,helper:e=>(n.helpers.add(e),e)}}function Kp(e,t){for(let n=0;n<e.length;n++)qp(e[n],t)}function qp(e,t){switch(e.type){case 1:Kp(e.cases,t),t.helper(`plural`);break;case 2:Kp(e.items,t);break;case 6:qp(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 Jp(e,t={}){let n=Gp(e);n.helper(`normalize`),e.body&&qp(e.body,n);let r=n.context();e.helpers=Array.from(r.helpers)}function Yp(e){let t=e.body;return t.type===2?Xp(t):t.cases.forEach(e=>Xp(e)),e}function Xp(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=Cp(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 Zp(e){switch(e.t=e.type,e.type){case 0:{let t=e;Zp(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++)Zp(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++)Zp(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;Zp(t.key),t.k=t.key,delete t.key,t.modifier&&(Zp(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 Qp(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 $p(e,t){let{helper:n}=e;e.push(`${n(`linked`)}(`),rm(e,t.key),t.modifier?(e.push(`, `),rm(e,t.modifier),e.push(`, _type`)):e.push(`, undefined, _type`),e.push(`)`)}function em(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&&(rm(e,t.items[n]),n!==i-1);n++)e.push(`, `);e.deindent(r()),e.push(`])`)}function tm(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&&(rm(e,t.cases[n]),n!==i-1);n++)e.push(`, `);e.deindent(r()),e.push(`])`)}}function nm(e,t){t.body?rm(e,t.body):e.push(`null`)}function rm(e,t){let{helper:n}=e;switch(t.type){case 0:nm(e,t);break;case 1:tm(e,t);break;case 2:em(e,t);break;case 6:$p(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 im=(e,t={})=>{let n=U(t.mode)?t.mode:`normal`,r=U(t.filename)?t.filename:`message.intl`,i=!!t.sourceMap,a=t.breakLineCode==null?n===`arrow`?`;`:`
|
|
104
|
+
`:t.breakLineCode,o=t.needIndent?t.needIndent:n!==`arrow`,s=e.helpers||[],c=Qp(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 { ${Cp(s.map(e=>`${e}: _${e}`),`, `)} } = ctx`),c.newline()),c.push(`return `),rm(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 am(e,t={}){let n=sp({},t),r=!!n.jit,i=!!n.minify,a=n.optimize==null?!0:n.optimize,o=Up(n).parse(e);return r?(a&&Yp(o),i&&Zp(o),{ast:o,code:``}):(Jp(o,n),im(o,n))}function om(){typeof __INTLIFY_PROD_DEVTOOLS__!=`boolean`&&(up().__INTLIFY_PROD_DEVTOOLS__=!1)}function sm(e){return W(e)&&_m(e)===0&&(hp(e,`b`)||hp(e,`body`))}var cm=[`b`,`body`];function lm(e){return wm(e,cm)}var um=[`c`,`cases`];function dm(e){return wm(e,um,[])}var fm=[`s`,`static`];function pm(e){return wm(e,fm)}var mm=[`i`,`items`];function hm(e){return wm(e,mm,[])}var gm=[`t`,`type`];function _m(e){return wm(e,gm)}var vm=[`v`,`value`];function ym(e,t){let n=wm(e,vm);if(n!=null)return n;throw Em(t)}var bm=[`m`,`modifier`];function xm(e){return wm(e,bm)}var Sm=[`k`,`key`];function Cm(e){let t=wm(e,Sm);if(t)return t;throw Em(6)}function wm(e,t,n){for(let n=0;n<t.length;n++){let r=t[n];if(hp(e,r)&&e[r]!=null)return e[r]}return n}var Tm=[...cm,...um,...fm,...mm,...Sm,...bm,...vm,...gm];function Em(e){return Error(`unhandled node type: ${e}`)}function Dm(e){return t=>Om(t,e)}function Om(e,t){let n=lm(t);if(n==null)throw Em(0);if(_m(n)===1){let t=dm(n);return e.plural(t.reduce((t,n)=>[...t,km(e,n)],[]))}else return km(e,n)}function km(e,t){let n=pm(t);if(n!=null)return e.type===`text`?n:e.normalize([n]);{let n=hm(t).reduce((t,n)=>[...t,Am(e,n)],[]);return e.normalize(n)}}function Am(e,t){let n=_m(t);switch(n){case 3:return ym(t,n);case 9:return ym(t,n);case 4:{let r=t;if(hp(r,`k`)&&r.k)return e.interpolate(e.named(r.k));if(hp(r,`key`)&&r.key)return e.interpolate(e.named(r.key));throw Em(n)}case 5:{let r=t;if(hp(r,`i`)&&rp(r.i))return e.interpolate(e.list(r.i));if(hp(r,`index`)&&rp(r.index))return e.interpolate(e.list(r.index));throw Em(n)}case 6:{let n=t,r=xm(n),i=Cm(n);return e.linked(Am(e,i),r?Am(e,r):void 0,e.type)}case 7:return ym(t,n);case 8:return ym(t,n);default:throw Error(`unhandled node on format message part: ${n}`)}}var jm=e=>e,Mm=H();function Nm(e,t={}){let n=!1,r=t.onError||kp;return t.onError=e=>{n=!0,r(e)},{...am(e,t),detectError:n}}function Pm(e,t){if(U(e)){vp(t.warnHtmlMessage)&&t.warnHtmlMessage;let n=(t.onCacheKey||jm)(e),r=Mm[n];if(r)return r;let{ast:i,detectError:a}=Nm(e,{...t,location:!1,jit:!0}),o=Dm(i);return a?o:Mm[n]=o}else{let t=e.cacheKey;return t?Mm[t]||(Mm[t]=Dm(e)):Dm(e)}}var Fm=null;function Im(e){Fm=e}function Lm(e,t,n){Fm&&Fm.emit(`i18n:init`,{timestamp:Date.now(),i18n:e,version:t,meta:n})}var Rm=zm(`function:translate`);function zm(e){return t=>Fm&&Fm.emit(e,t)}var Bm={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 Vm(e){return Op(e,null,void 0)}Bm.INVALID_ARGUMENT,Bm.INVALID_DATE_ARGUMENT,Bm.INVALID_ISO_DATE_ARGUMENT,Bm.NOT_SUPPORT_NON_STRING_MESSAGE,Bm.NOT_SUPPORT_LOCALE_PROMISE_VALUE,Bm.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION,Bm.NOT_SUPPORT_LOCALE_TYPE;function Hm(e,t){return t.locale==null?Wm(e.locale):Wm(t.locale)}var Um;function Wm(e){if(U(e))return e;if(_p(e)){if(e.resolvedOnce&&Um!=null)return Um;if(e.constructor.name===`Function`){let t=e();if(yp(t))throw Vm(Bm.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Um=t}else throw Vm(Bm.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Vm(Bm.NOT_SUPPORT_LOCALE_TYPE)}function Gm(e,t,n){return[...new Set([n,...gp(t)?t:W(t)?Object.keys(t):U(t)?[t]:[n]])]}function Km(e,t,n){let r=U(n)?n:ch,i=e;i.__localeChainCache||=new Map;let a=i.__localeChainCache.get(r);if(!a){a=[];let e=[n];for(;gp(e);)e=qm(a,e,t);let o=gp(t)||!G(t)?t:t.default?t.default:null;e=U(o)?[o]:o,gp(e)&&qm(a,e,!1),i.__localeChainCache.set(r,a)}return a}function qm(e,t,n){let r=!0;for(let i=0;i<t.length&&vp(r);i++){let a=t[i];U(a)&&(r=Jm(e,t[i],n))}return r}function Jm(e,t,n){let r,i=t.split(`-`);do r=Ym(e,i.join(`-`),n),i.splice(-1,1);while(i.length&&r===!0);return r}function Ym(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),(gp(n)||G(n))&&n[i]&&(r=n[i])}return r}var Xm=[];Xm[0]={w:[0],i:[3,0],"[":[4],o:[7]},Xm[1]={w:[1],".":[2],"[":[4],o:[7]},Xm[2]={w:[2],i:[3,0],0:[3,0]},Xm[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},Xm[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},Xm[5]={"'":[4,0],o:8,l:[5,0]},Xm[6]={'"':[4,0],o:8,l:[6,0]};var Zm=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Qm(e){return Zm.test(e)}function $m(e){let t=e.charCodeAt(0);return t===e.charCodeAt(e.length-1)&&(t===34||t===39)?e.slice(1,-1):e}function eh(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 th(e){let t=e.trim();return e.charAt(0)===`0`&&isNaN(parseInt(e))?!1:Qm(t)?$m(t):`*`+t}function nh(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=th(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=eh(a),d=Xm[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 rh=new Map;function ih(e,t){return W(e)?e[t]:null}function ah(e,t){if(!W(e))return null;let n=rh.get(t);if(n||(n=nh(t),n&&rh.set(t,n)),!n)return null;let r=n.length,i=e,a=0;for(;a<r;){let e=n[a];if(Tm.includes(e)&&sm(i))return null;let t=i[e];if(t===void 0||_p(i))return null;i=t,a++}return i}var oh={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};oh.NOT_FOUND_KEY,oh.FALLBACK_TO_TRANSLATE,oh.CANNOT_FORMAT_NUMBER,oh.FALLBACK_TO_NUMBER_FORMAT,oh.CANNOT_FORMAT_DATE,oh.FALLBACK_TO_DATE_FORMAT,oh.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER;var sh=`11.2.8`,ch=`en-US`,lh=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function uh(){return{upper:(e,t)=>t===`text`&&U(e)?e.toUpperCase():t===`vnode`&&W(e)&&`__v_isVNode`in e?e.children.toUpperCase():e,lower:(e,t)=>t===`text`&&U(e)?e.toLowerCase():t===`vnode`&&W(e)&&`__v_isVNode`in e?e.children.toLowerCase():e,capitalize:(e,t)=>t===`text`&&U(e)?lh(e):t===`vnode`&&W(e)&&`__v_isVNode`in e?lh(e.children):e}}var dh;function fh(e){dh=e}var ph;function mh(e){ph=e}var hh;function gh(e){hh=e}var _h=null,vh=e=>{_h=e},yh=()=>_h,bh=null,xh=e=>{bh=e},Sh=()=>bh,Ch=0;function wh(e={}){let t=_p(e.onWarn)?e.onWarn:Qf,n=U(e.version)?e.version:sh,r=U(e.locale)||_p(e.locale)?e.locale:ch,i=_p(r)?ch:r,a=gp(e.fallbackLocale)||G(e.fallbackLocale)||U(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:i,o=G(e.messages)?e.messages:Th(i),s=G(e.datetimeFormats)?e.datetimeFormats:Th(i),c=G(e.numberFormats)?e.numberFormats:Th(i),l=sp(H(),e.modifiers,uh()),u=e.pluralRules||H(),d=_p(e.missing)?e.missing:null,f=vp(e.missingWarn)||ap(e.missingWarn)?e.missingWarn:!0,p=vp(e.fallbackWarn)||ap(e.fallbackWarn)?e.fallbackWarn:!0,m=!!e.fallbackFormat,h=!!e.unresolving,g=_p(e.postTranslation)?e.postTranslation:null,_=G(e.processor)?e.processor:null,v=vp(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter,b=_p(e.messageCompiler)?e.messageCompiler:dh,x=_p(e.messageResolver)?e.messageResolver:ph||ih,S=_p(e.localeFallbacker)?e.localeFallbacker:hh||Gm,C=W(e.fallbackContext)?e.fallbackContext:void 0,w=e,T=W(w.__datetimeFormatters)?w.__datetimeFormatters:new Map,ee=W(w.__numberFormatters)?w.__numberFormatters:new Map,te=W(w.__meta)?w.__meta:{};Ch++;let E={version:n,cid:Ch,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__&&Lm(E,n,te),E}var Th=e=>({[e]:H()});function Eh(e,t,n,r,i){let{missing:a,onWarn:o}=e;if(a!==null){let r=a(e,n,t,i);return U(r)?r:t}else return t}function Dh(e,t,n){let r=e;r.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function Oh(e,t){return e===t?!1:e.split(`-`)[0]===t.split(`-`)[0]}function kh(e,t){let n=t.indexOf(e);if(n===-1)return!1;for(let r=n+1;r<t.length;r++)if(Oh(e,t[r]))return!0;return!1}var Ah=typeof Intl<`u`;Ah&&Intl.DateTimeFormat,Ah&&Intl.NumberFormat;function jh(e,...t){let{datetimeFormats:n,unresolving:r,fallbackLocale:i,onWarn:a,localeFallbacker:o}=e,{__datetimeFormatters:s}=e,[c,l,u,d]=Nh(...t),f=vp(u.missingWarn)?u.missingWarn:e.missingWarn;vp(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;let p=!!u.part,m=Hm(e,u),h=o(e,i,m);if(!U(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],!G(v));t++)Eh(e,c,_,f,`datetime format`);if(!G(v)||!U(_))return r?-1:c;let y=`${_}__${c}`;op(d)||(y=`${y}__${JSON.stringify(d)}`);let b=s.get(y);return b||(b=new Intl.DateTimeFormat(_,sp({},v,d)),s.set(y,b)),p?b.formatToParts(l):b.format(l)}var Mh=[`localeMatcher`,`weekday`,`era`,`year`,`month`,`day`,`hour`,`minute`,`second`,`timeZoneName`,`formatMatcher`,`hour12`,`timeZone`,`dateStyle`,`timeStyle`,`calendar`,`dayPeriod`,`numberingSystem`,`hourCycle`,`fractionalSecondDigits`];function Nh(...e){let[t,n,r,i]=e,a=H(),o=H(),s;if(U(t)){let e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Vm(Bm.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 Vm(Bm.INVALID_ISO_DATE_ARGUMENT)}}else if(ip(t)){if(isNaN(t.getTime()))throw Vm(Bm.INVALID_DATE_ARGUMENT);s=t}else if(rp(t))s=t;else throw Vm(Bm.INVALID_ARGUMENT);return U(n)?a.key=n:G(n)&&Object.keys(n).forEach(e=>{Mh.includes(e)?o[e]=n[e]:a[e]=n[e]}),U(r)?a.locale=r:G(r)&&(o=r),G(i)&&(o=i),[a.key||``,s,a,o]}function Ph(e,t,n){let r=e;for(let e in n){let n=`${t}__${e}`;r.__datetimeFormatters.has(n)&&r.__datetimeFormatters.delete(n)}}function Fh(e,...t){let{numberFormats:n,unresolving:r,fallbackLocale:i,onWarn:a,localeFallbacker:o}=e,{__numberFormatters:s}=e,[c,l,u,d]=Lh(...t),f=vp(u.missingWarn)?u.missingWarn:e.missingWarn;vp(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;let p=!!u.part,m=Hm(e,u),h=o(e,i,m);if(!U(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],!G(v));t++)Eh(e,c,_,f,`number format`);if(!G(v)||!U(_))return r?-1:c;let y=`${_}__${c}`;op(d)||(y=`${y}__${JSON.stringify(d)}`);let b=s.get(y);return b||(b=new Intl.NumberFormat(_,sp({},v,d)),s.set(y,b)),p?b.formatToParts(l):b.format(l)}var Ih=[`localeMatcher`,`style`,`currency`,`currencyDisplay`,`currencySign`,`useGrouping`,`minimumIntegerDigits`,`minimumFractionDigits`,`maximumFractionDigits`,`minimumSignificantDigits`,`maximumSignificantDigits`,`compactDisplay`,`notation`,`signDisplay`,`unit`,`unitDisplay`,`roundingMode`,`roundingPriority`,`roundingIncrement`,`trailingZeroDisplay`];function Lh(...e){let[t,n,r,i]=e,a=H(),o=H();if(!rp(t))throw Vm(Bm.INVALID_ARGUMENT);let s=t;return U(n)?a.key=n:G(n)&&Object.keys(n).forEach(e=>{Ih.includes(e)?o[e]=n[e]:a[e]=n[e]}),U(r)?a.locale=r:G(r)&&(o=r),G(i)&&(o=i),[a.key||``,s,a,o]}function Rh(e,t,n){let r=e;for(let e in n){let n=`${t}__${e}`;r.__numberFormatters.has(n)&&r.__numberFormatters.delete(n)}}var zh=e=>e,Bh=e=>``,Vh=`text`,Hh=e=>e.length===0?``:Cp(e),Uh=Sp;function Wh(e,t){return e=Math.abs(e),t===2?e?e>1?1:0:1:e?Math.min(e,2):0}function Gh(e){let t=rp(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(rp(e.named.count)||rp(e.named.n))?rp(e.named.count)?e.named.count:rp(e.named.n)?e.named.n:t:t}function Kh(e,t){t.count||=e,t.n||=e}function qh(e={}){let t=e.locale,n=Gh(e),r=W(e.pluralRules)&&U(t)&&_p(e.pluralRules[t])?e.pluralRules[t]:Wh,i=W(e.pluralRules)&&U(t)&&_p(e.pluralRules[t])?Wh:void 0,a=e=>e[r(n,e.length,i)],o=e.list||[],s=e=>o[e],c=e.named||H();rp(e.pluralIndex)&&Kh(n,c);let l=e=>c[e];function u(t,n){return(_p(e.messages)?e.messages(t,!!n):W(e.messages)?e.messages[t]:!1)||(e.parent?e.parent.message(t):Bh)}let d=t=>e.modifiers?e.modifiers[t]:zh,f=G(e.processor)&&_p(e.processor.normalize)?e.processor.normalize:Hh,p=G(e.processor)&&_p(e.processor.interpolate)?e.processor.interpolate:Uh,m={list:s,named:l,plural:a,linked:(e,...t)=>{let[n,r]=t,i=`text`,a=``;t.length===1?W(n)?(a=n.modifier||a,i=n.type||i):U(n)&&(a=n||a):t.length===2&&(U(n)&&(a=n||a),U(r)&&(i=r||i));let o=u(e,!0)(m),s=i===`vnode`&&gp(o)&&a?o[0]:o;return a?d(a)(s,i):s},message:u,type:G(e.processor)&&U(e.processor.type)?e.processor.type:Vh,interpolate:p,normalize:f,values:sp(H(),o,c)};return m}var Jh=()=>``,Yh=e=>_p(e);function Xh(e,...t){let{fallbackFormat:n,postTranslation:r,unresolving:i,messageCompiler:a,fallbackLocale:o,messages:s}=e,[c,l]=tg(...t),u=vp(l.missingWarn)?l.missingWarn:e.missingWarn,d=vp(l.fallbackWarn)?l.fallbackWarn:e.fallbackWarn,f=vp(l.escapeParameter)?l.escapeParameter:e.escapeParameter,p=!!l.resolvedMessage,m=U(l.default)||vp(l.default)?vp(l.default)?a?c:()=>c:l.default:n?a?c:()=>c:null,h=n||m!=null&&(U(m)||_p(m)),g=Hm(e,l);f&&Zh(l);let[_,v,y]=p?[c,g,s[g]||H()]:Qh(e,c,g,o,d,u),b=_,x=c;if(!p&&!(U(b)||sm(b)||Yh(b))&&h&&(b=m,x=b),!p&&(!(U(b)||sm(b)||Yh(b))||!U(v)))return i?-1:c;let S=!1,C=Yh(b)?b:$h(e,c,v,b,x,()=>{S=!0});if(S)return b;let w=eg(e,C,qh(rg(e,v,y,l))),T=r?r(w,c):w;if(f&&U(T)&&(T=pp(T)),__INTLIFY_PROD_DEVTOOLS__){let t={timestamp:Date.now(),key:U(c)?c:Yh(b)?b.key:``,locale:v||(Yh(b)?b.locale:``),format:U(b)?b:Yh(b)?b.source:``,message:T};t.meta=sp({},e.__meta,yh()||{}),Rm(t)}return T}function Zh(e){gp(e.list)?e.list=e.list.map(e=>U(e)?dp(e):e):W(e.named)&&Object.keys(e.named).forEach(t=>{U(e.named[t])&&(e.named[t]=dp(e.named[t]))})}function Qh(e,t,n,r,i,a){let{messages:o,onWarn:s,messageResolver:c,localeFallbacker:l}=e,u=l(e,r,n),d=H(),f,p=null;for(let n=0;n<u.length&&(f=u[n],d=o[f]||H(),(p=c(d,t))===null&&(p=d[t]),!(U(p)||sm(p)||Yh(p)));n++)if(!kh(f,u)){let n=Eh(e,t,f,a,`translate`);n!==t&&(p=n)}return[p,f,d]}function $h(e,t,n,r,i,a){let{messageCompiler:o,warnHtmlMessage:s}=e;if(Yh(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,ng(e,n,i,r,s,a));return c.locale=n,c.key=t,c.source=r,c}function eg(e,t,n){return t(n)}function tg(...e){let[t,n,r]=e,i=H();if(!U(t)&&!rp(t)&&!Yh(t)&&!sm(t))throw Vm(Bm.INVALID_ARGUMENT);let a=rp(t)?String(t):(Yh(t),t);return rp(n)?i.plural=n:U(n)?i.default=n:G(n)&&!op(n)?i.named=n:gp(n)&&(i.list=n),rp(r)?i.plural=r:U(r)?i.default=r:G(r)&&sp(i,r),[a,i]}function ng(e,t,n,r,i,a){return{locale:t,key:n,warnHtmlMessage:i,onError:e=>{throw a&&a(e),e},onCacheKey:e=>tp(t,n,e)}}function rg(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]=Qh(u||e,r,t,s,c,l);a=o(n,r)}if(U(a)||sm(a)){let n=!1,i=$h(e,r,t,a,r,()=>{n=!0});return n?Jh:i}else if(Yh(a))return a;else return Jh}};return e.processor&&(d.processor=e.processor),r.list&&(d.list=r.list),r.named&&(d.named=r.named),rp(r.plural)&&(d.pluralIndex=r.plural),d}om();var ig=`11.2.8`;function ag(){typeof __INTLIFY_PROD_DEVTOOLS__!=`boolean`&&(up().__INTLIFY_PROD_DEVTOOLS__=!1)}var og={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 sg(e,...t){return Op(e,null,void 0)}og.UNEXPECTED_RETURN_TYPE,og.INVALID_ARGUMENT,og.MUST_BE_CALL_SETUP_TOP,og.NOT_INSTALLED,og.UNEXPECTED_ERROR,og.REQUIRED_VALUE,og.INVALID_VALUE,og.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN,og.NOT_INSTALLED_WITH_PROVIDE,og.NOT_COMPATIBLE_LEGACY_VUE_I18N,og.NOT_AVAILABLE_COMPOSITION_IN_LEGACY;var cg=ep(`__translateVNode`),lg=ep(`__datetimeParts`),ug=ep(`__numberParts`),dg=ep(`__setPluralRules`);ep(`__intlifyMeta`);var fg=ep(`__injectWithOption`),pg=ep(`__dispose`),mg={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};mg.FALLBACK_TO_ROOT,mg.NOT_FOUND_PARENT_SCOPE,mg.IGNORE_OBJ_FLATTEN,mg.DEPRECATE_LEGACY_MODE,mg.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE,mg.DUPLICATE_USE_I18N_CALLING;function hg(e){if(!W(e)||sm(e))return e;for(let t in e)if(hp(e,t))if(!t.includes(`.`))W(e[t])&&hg(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]]=H()),!W(i[n[e]])){a=!0;break}i=i[n[e]]}if(a||(sm(i)?Tm.includes(n[r])||delete e[t]:(i[n[r]]=e[t],delete e[t])),!sm(i)){let e=i[n[r]];W(e)&&hg(e)}}return e}function gg(e,t){let{messages:n,__i18n:r,messageResolver:i,flatJson:a}=t,o=G(n)?n:gp(r)?H():{[e]:H()};if(gp(r)&&r.forEach(e=>{if(`locale`in e&&`resource`in e){let{locale:t,resource:n}=e;t?(o[t]=o[t]||H(),Tp(n,o[t])):Tp(n,o)}else U(e)&&Tp(JSON.parse(e),o)}),i==null&&a)for(let e in o)hp(o,e)&&hg(o[e]);return o}function _g(e){return e.type}function vg(e,t,n){let r=W(t.messages)?t.messages:H();`__i18nGlobal`in n&&(r=gg(e.locale.value,{messages:r,__i18n:n.__i18nGlobal}));let i=Object.keys(r);if(i.length&&i.forEach(t=>{e.mergeLocaleMessage(t,r[t])}),W(t.datetimeFormats)){let n=Object.keys(t.datetimeFormats);n.length&&n.forEach(n=>{e.mergeDateTimeFormat(n,t.datetimeFormats[n])})}if(W(t.numberFormats)){let n=Object.keys(t.numberFormats);n.length&&n.forEach(n=>{e.mergeNumberFormat(n,t.numberFormats[n])})}}function yg(e){return(0,t.createVNode)(t.Text,null,e,0)}function bg(){let e=`currentInstance`;return e in t?t[e]:t.getCurrentInstance()}var xg=`__INTLIFY_META__`,Sg=()=>[],Cg=()=>!1,wg=0;function Tg(e){return((t,n,r,i)=>e(n,r,bg()||void 0,i))}var Eg=()=>{let e=bg(),t=null;return e&&(t=_g(e)[xg])?{[xg]:t}:null};function Dg(e={}){let{__root:n,__injectWithOption:r}=e,i=n===void 0,a=e.flatJson,o=$f?t.ref:t.shallowRef,s=vp(e.inheritLocale)?e.inheritLocale:!0,c=o(n&&s?n.locale.value:U(e.locale)?e.locale:ch),l=o(n&&s?n.fallbackLocale.value:U(e.fallbackLocale)||gp(e.fallbackLocale)||G(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:c.value),u=o(gg(c.value,e)),d=o(G(e.datetimeFormats)?e.datetimeFormats:{[c.value]:{}}),f=o(G(e.numberFormats)?e.numberFormats:{[c.value]:{}}),p=n?n.missingWarn:vp(e.missingWarn)||ap(e.missingWarn)?e.missingWarn:!0,m=n?n.fallbackWarn:vp(e.fallbackWarn)||ap(e.fallbackWarn)?e.fallbackWarn:!0,h=n?n.fallbackRoot:vp(e.fallbackRoot)?e.fallbackRoot:!0,g=!!e.fallbackFormat,_=_p(e.missing)?e.missing:null,v=_p(e.missing)?Tg(e.missing):null,y=_p(e.postTranslation)?e.postTranslation:null,b=n?n.warnHtmlMessage:vp(e.warnHtmlMessage)?e.warnHtmlMessage:!0,x=!!e.escapeParameter,S=n?n.modifiers:G(e.modifiers)?e.modifiers:{},C=e.pluralRules||n&&n.pluralRules,w;w=(()=>{i&&xh(null);let t={version:ig,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=G(w)?w.__datetimeFormatters:void 0,t.__numberFormatters=G(w)?w.__numberFormatters:void 0;let n=wh(t);return i&&xh(n),n})(),Dh(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,Dh(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 _p(y)?y:null}function ae(e){y=e,w.postTranslation=e}function D(){return _}function oe(e){e!==null&&(v=Tg(e)),_=e,w.missing=v}let se=(e,t,r,a,o,s)=>{T();let c;try{__INTLIFY_PROD_DEVTOOLS__&&vh(Eg()),i||(w.fallbackContext=n?Sh():void 0),c=e(w)}finally{__INTLIFY_PROD_DEVTOOLS__&&vh(null),i||(w.fallbackContext=void 0)}if(r!==`translate exists`&&rp(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 sg(og.UNEXPECTED_RETURN_TYPE)};function ce(...e){return se(t=>Reflect.apply(Xh,null,[t,...e]),()=>tg(...e),`translate`,t=>Reflect.apply(t.t,t,[...e]),e=>e,e=>U(e))}function O(...e){let[t,n,r]=e;if(r&&!W(r))throw sg(og.INVALID_ARGUMENT);return ce(t,n,sp({resolvedMessage:!0},r||{}))}function le(...e){return se(t=>Reflect.apply(jh,null,[t,...e]),()=>Nh(...e),`datetime format`,t=>Reflect.apply(t.d,t,[...e]),()=>``,e=>U(e)||gp(e))}function ue(...e){return se(t=>Reflect.apply(Fh,null,[t,...e]),()=>Lh(...e),`number format`,t=>Reflect.apply(t.n,t,[...e]),()=>``,e=>U(e)||gp(e))}function de(e){return e.map(e=>U(e)||rp(e)||vp(e)?yg(String(e)):e)}let k={normalize:de,interpolate:e=>e,type:`vnode`};function fe(...e){return se(t=>{let n,r=t;try{r.processor=k,n=Reflect.apply(Xh,null,[r,...e])}finally{r.processor=null}return n},()=>tg(...e),`translate`,t=>t[cg](...e),e=>[yg(e)],e=>gp(e))}function A(...e){return se(t=>Reflect.apply(Fh,null,[t,...e]),()=>Lh(...e),`number format`,t=>t[ug](...e),Sg,e=>U(e)||gp(e))}function pe(...e){return se(t=>Reflect.apply(jh,null,[t,...e]),()=>Nh(...e),`datetime format`,t=>t[lg](...e),Sg,e=>U(e)||gp(e))}function me(e){C=e,w.pluralRules=C}function he(e,t){return se(()=>{if(!e)return!1;let n=ve(U(t)?t:c.value),r=w.messageResolver(n,e);return sm(r)||Yh(r)||U(r)},()=>[e],`translate exists`,n=>Reflect.apply(n.te,n,[e,t]),Cg,e=>vp(e))}function ge(e){let t=null,n=Km(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 _e(e){return ge(e)??(n&&n.tm(e)||{})}function ve(e){return u.value[e]||{}}function ye(e,t){if(a){let n={[e]:t};for(let e in n)hp(n,e)&&hg(n[e]);t=n[e]}u.value[e]=t,w.messages=u.value}function be(e,t){u.value[e]=u.value[e]||{};let n={[e]:t};if(a)for(let e in n)hp(n,e)&&hg(n[e]);t=n[e],Tp(t,u.value[e]),w.messages=u.value}function xe(e){return d.value[e]||{}}function Se(e,t){d.value[e]=t,w.datetimeFormats=d.value,Ph(w,e,t)}function Ce(e,t){d.value[e]=sp(d.value[e]||{},t),w.datetimeFormats=d.value,Ph(w,e,t)}function we(e){return f.value[e]||{}}function Te(e,t){f.value[e]=t,w.numberFormats=f.value,Rh(w,e,t)}function Ee(e,t){f.value[e]=sp(f.value[e]||{},t),w.numberFormats=f.value,Rh(w,e,t)}wg++,n&&$f&&((0,t.watch)(n.locale,e=>{s&&(c.value=e,w.locale=e,Dh(w,c.value,l.value))}),(0,t.watch)(n.fallbackLocale,e=>{s&&(l.value=e,w.fallbackLocale=e,Dh(w,c.value,l.value))}));let De={id:wg,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,Dh(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:ce,getLocaleMessage:ve,setLocaleMessage:ye,mergeLocaleMessage:be,getPostTranslationHandler:ie,setPostTranslationHandler:ae,getMissingHandler:D,setMissingHandler:oe,[dg]:me};return De.datetimeFormats=ne,De.numberFormats=re,De.rt=O,De.te=he,De.tm=_e,De.d=le,De.n=ue,De.getDateTimeFormat=xe,De.setDateTimeFormat=Se,De.mergeDateTimeFormat=Ce,De.getNumberFormat=we,De.setNumberFormat=Te,De.mergeNumberFormat=Ee,De[fg]=r,De[cg]=fe,De[lg]=pe,De[ug]=A,De}var Og={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e===`parent`||e===`global`,default:`parent`},i18n:{type:Object}};function kg({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},H())}function Ag(){return t.Fragment}var jg=(0,t.defineComponent)({name:`i18n-t`,props:sp({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>rp(e)||!isNaN(e)}},Og),setup(e,n){let{slots:r,attrs:i}=n,a=e.i18n||Hg({useScope:e.scope,__useComponent:!0});return()=>{let o=Object.keys(r).filter(e=>e[0]!==`_`),s=H();e.locale&&(s.locale=e.locale),e.plural!==void 0&&(s.plural=U(e.plural)?+e.plural:e.plural);let c=kg(n,o),l=a[cg](e.keypath,c,s),u=sp(H(),i);return(0,t.h)(U(e.tag)||W(e.tag)?e.tag:Ag(),u,l)}}});function Mg(e){return gp(e)&&!U(e[0])}function Ng(e,n,r,i){let{slots:a,attrs:o}=n;return()=>{let n={part:!0},s=H();e.locale&&(n.locale=e.locale),U(e.format)?n.key=e.format:W(e.format)&&(U(e.format.key)&&(n.key=e.format.key),s=Object.keys(e.format).reduce((t,n)=>r.includes(n)?sp(H(),t,{[n]:e.format[n]}):t,H()));let c=i(e.value,n,s),l=[n.key];gp(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 Mg(r)&&(r[0].key=`${e.type}-${t}`),r}):U(c)&&(l=[c]);let u=sp(H(),o);return(0,t.h)(U(e.tag)||W(e.tag)?e.tag:Ag(),u,l)}}var Pg=(0,t.defineComponent)({name:`i18n-n`,props:sp({value:{type:Number,required:!0},format:{type:[String,Object]}},Og),setup(e,t){let n=e.i18n||Hg({useScope:e.scope,__useComponent:!0});return Ng(e,t,Ih,(...e)=>n[ug](...e))}});function Fg(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 Ig(e){let n=t=>{let{instance:n,value:r}=t;if(!n||!n.$)throw sg(og.UNEXPECTED_ERROR);let i=Fg(e,n.$),a=Lg(r);return[Reflect.apply(i.t,i,[...Rg(a)]),i]};return{created:(r,i)=>{let[a,o]=n(i);$f&&e.global===o&&(r.__i18nWatcher=(0,t.watch)(o.locale,()=>{i.instance&&i.instance.$forceUpdate()})),r.__composer=o,r.textContent=a},unmounted:e=>{$f&&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=Lg(t);e.textContent=Reflect.apply(n.t,n,[...Rg(r)])}},getSSRProps:e=>{let[t]=n(e);return{textContent:t}}}}function Lg(e){if(U(e))return{path:e};if(G(e)){if(!(`path`in e))throw sg(og.REQUIRED_VALUE,`path`);return e}else throw sg(og.INVALID_VALUE)}function Rg(e){let{path:t,locale:n,args:r,choice:i,plural:a}=e,o={},s=r||{};return U(n)&&(o.locale=n),rp(i)&&(o.plural=i),rp(a)&&(o.plural=a),[t,s,o]}function zg(e,t,...n){let r=G(n[0])?n[0]:{};(!vp(r.globalInstall)||r.globalInstall)&&([jg.name,`I18nT`].forEach(t=>e.component(t,jg)),[Pg.name,`I18nN`].forEach(t=>e.component(t,Pg)),[$g.name,`I18nD`].forEach(t=>e.component(t,$g))),e.directive(`t`,Ig(t))}var Bg=ep(`global-vue-i18n`);function Vg(e={}){let t=vp(e.globalInjection)?e.globalInjection:!0,n=new Map,[r,i]=Ug(e,!1),a=ep(``);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),G(n[0])){let e=n[0];l.__composerExtend=e.__composerExtend,l.__vueI18nExtend=e.__vueI18nExtend}let r=null;t&&(r=Qg(e,l.global)),zg(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 Hg(e={}){let t=bg();if(t==null)throw sg(og.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw sg(og.NOT_INSTALLED);let n=Wg(t),r=Kg(n),i=_g(t),a=Gg(e,i);if(a===`global`)return vg(r,e,i),r;if(a===`parent`){let i=qg(n,t,e.__useComponent);return i??=r,i}let o=n,s=o.__getInstance(t);if(s==null){let n=sp({},e);`__i18n`in i&&(n.__i18n=i.__i18n),r&&(n.__root=r),s=Dg(n),o.__composerExtend&&(s[pg]=o.__composerExtend(s)),Yg(o,t,s),o.__setInstance(t,s)}return s}function Ug(e,n){let r=(0,t.effectScope)(),i=r.run(()=>Dg(e));if(i==null)throw sg(og.UNEXPECTED_ERROR);return[r,i]}function Wg(e){let n=(0,t.inject)(e.isCE?Bg:e.appContext.app.__VUE_I18N_SYMBOL__);if(!n)throw sg(e.isCE?og.NOT_INSTALLED_WITH_PROVIDE:og.UNEXPECTED_ERROR);return n}function Gg(e,t){return op(e)?`__i18n`in t?`local`:`global`:e.useScope?e.useScope:`local`}function Kg(e){return e.mode===`composition`?e.global:e.global.__composer}function qg(e,t,n=!1){let r=null,i=t.root,a=Jg(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 Jg(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function Yg(e,n,r){(0,t.onMounted)(()=>{},n),(0,t.onUnmounted)(()=>{let t=r;e.__deleteInstance(n);let i=t[pg];i&&(i(),delete t[pg])},n)}var Xg=[`locale`,`fallbackLocale`,`availableLocales`],Zg=[`t`,`rt`,`d`,`n`,`tm`,`te`];function Qg(e,n){let r=Object.create(null);return Xg.forEach(e=>{let i=Object.getOwnPropertyDescriptor(n,e);if(!i)throw sg(og.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,Zg.forEach(t=>{let r=Object.getOwnPropertyDescriptor(n,t);if(!r||!r.value)throw sg(og.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${t}`,r)}),()=>{delete e.config.globalProperties.$i18n,Zg.forEach(t=>{delete e.config.globalProperties[`$${t}`]})}}var $g=(0,t.defineComponent)({name:`i18n-d`,props:sp({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Og),setup(e,t){let n=e.i18n||Hg({useScope:e.scope,__useComponent:!0});return Ng(e,t,Mh,(...e)=>n[lg](...e))}});if(ag(),fh(Pm),mh(ah),gh(Km),__INTLIFY_PROD_DEVTOOLS__){let e=up();e.__INTLIFY__=!0,Im(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}var e_={"editor.drag.button.insert_block":{t:0,b:{t:2,i:[{t:3}],s:`Insert block`}},"editor.drag.button.drag_handle":{t:0,b:{t:2,i:[{t:3}],s:`Drag handle`}},"editor.drag.menu.convert_to":{t:0,b:{t:2,i:[{t:3}],s:`Convert to`}},"editor.drag.menu.copy":{t:0,b:{t:2,i:[{t:3}],s:`Copy`}},"editor.drag.menu.cut":{t:0,b:{t:2,i:[{t:3}],s:`Cut`}},"editor.drag.menu.delete":{t:0,b:{t:2,i:[{t:3}],s:`Delete`}},"editor.menus.undo":{t:0,b:{t:2,i:[{t:3}],s:`Undo`}},"editor.menus.redo":{t:0,b:{t:2,i:[{t:3}],s:`Redo`}},"editor.menus.table.title":{t:0,b:{t:2,i:[{t:3}],s:`Table`}},"editor.menus.table.add":{t:0,b:{t:2,i:[{t:3}],s:`Add table`}},"editor.menus.table.add_column_before":{t:0,b:{t:2,i:[{t:3}],s:`Add column before`}},"editor.menus.table.add_column_after":{t:0,b:{t:2,i:[{t:3}],s:`Add column after`}},"editor.menus.table.delete_column":{t:0,b:{t:2,i:[{t:3}],s:`Delete column`}},"editor.menus.table.add_row_before":{t:0,b:{t:2,i:[{t:3}],s:`Add row before`}},"editor.menus.table.add_row_after":{t:0,b:{t:2,i:[{t:3}],s:`Add row after`}},"editor.menus.table.toggle_header_column":{t:0,b:{t:2,i:[{t:3}],s:`Set/Unset First Column Header`}},"editor.menus.table.toggle_header_row":{t:0,b:{t:2,i:[{t:3}],s:`Set/Unset First Row Header`}},"editor.menus.table.toggle_header_cell":{t:0,b:{t:2,i:[{t:3}],s:`Set/Unset Current Cell as Header`}},"editor.menus.table.delete_row":{t:0,b:{t:2,i:[{t:3}],s:`Delete row`}},"editor.menus.table.merge_cells":{t:0,b:{t:2,i:[{t:3}],s:`Merge cells`}},"editor.menus.table.split_cell":{t:0,b:{t:2,i:[{t:3}],s:`Split cell`}},"editor.menus.table.delete_table":{t:0,b:{t:2,i:[{t:3}],s:`Delete table`}},"editor.extensions.commands_menu.columns":{t:0,b:{t:2,i:[{t:3}],s:`Column Card`}},"editor.extensions.commands_menu.iframe":{t:0,b:{t:2,i:[{t:3}],s:`Iframe`}},"editor.extensions.commands_menu.image":{t:0,b:{t:2,i:[{t:3}],s:`Image`}},"editor.extensions.commands_menu.video":{t:0,b:{t:2,i:[{t:3}],s:`Video`}},"editor.extensions.commands_menu.audio":{t:0,b:{t:2,i:[{t:3}],s:`Audio`}},"editor.extensions.commands_menu.table":{t:0,b:{t:2,i:[{t:3}],s:`Table`}},"editor.extensions.commands_menu.gallery":{t:0,b:{t:2,i:[{t:3}],s:`Gallery`}},"editor.extensions.commands_menu.no_results":{t:0,b:{t:2,i:[{t:3}],s:`No results`}},"editor.extensions.commands_menu.placeholder":{t:0,b:{t:2,i:[{t:3}],s:`Enter / to select input type`}},"editor.extensions.figure_caption.empty_placeholder":{t:0,b:{t:2,i:[{t:3}],s:`Add description`}},"editor.extensions.link.add_link":{t:0,b:{t:2,i:[{t:3}],s:`Add link`}},"editor.extensions.link.edit_link":{t:0,b:{t:2,i:[{t:3}],s:`Edit link`}},"editor.extensions.link.placeholder":{t:0,b:{t:2,i:[{t:3}],s:`Link address`}},"editor.extensions.link.open_in_new_window":{t:0,b:{t:2,i:[{t:3}],s:`Open in new window`}},"editor.extensions.link.cancel_link":{t:0,b:{t:2,i:[{t:3}],s:`Cancel link`}},"editor.extensions.link.nofollow":{t:0,b:{t:2,i:[{t:3}],s:`Nofollow`}},"editor.extensions.audio.src_input_label":{t:0,b:{t:2,i:[{t:3}],s:`Audio link`}},"editor.extensions.audio.disable_autoplay":{t:0,b:{t:2,i:[{t:3}],s:`Disable auto play`}},"editor.extensions.audio.enable_autoplay":{t:0,b:{t:2,i:[{t:3}],s:`Enable auto play`}},"editor.extensions.audio.disable_loop":{t:0,b:{t:2,i:[{t:3}],s:`Disable loop`}},"editor.extensions.audio.enable_loop":{t:0,b:{t:2,i:[{t:3}],s:`Enable loop`}},"editor.extensions.iframe.src_input_label":{t:0,b:{t:2,i:[{t:3}],s:`Web link`}},"editor.extensions.iframe.resize":{t:0,b:{t:2,i:[{t:3}],s:`Resize`}},"editor.extensions.iframe.disable_frameborder":{t:0,b:{t:2,i:[{t:3}],s:`Hide frameborder`}},"editor.extensions.iframe.enable_frameborder":{t:0,b:{t:2,i:[{t:3}],s:`Show frameborder`}},"editor.extensions.iframe.phone_size":{t:0,b:{t:2,i:[{t:3}],s:`Mobile phone size`}},"editor.extensions.iframe.tablet_vertical_size":{t:0,b:{t:2,i:[{t:3}],s:`Tablet portrait size`}},"editor.extensions.iframe.tablet_horizontal_size":{t:0,b:{t:2,i:[{t:3}],s:`Tablet landscape size`}},"editor.extensions.iframe.desktop_size":{t:0,b:{t:2,i:[{t:3}],s:`Desktop size`}},"editor.extensions.image.src_input_label":{t:0,b:{t:2,i:[{t:3}],s:`Image link`}},"editor.extensions.image.href_input_label":{t:0,b:{t:2,i:[{t:3}],s:`Image hyperlink`}},"editor.extensions.image.resize":{t:0,b:{t:2,i:[{t:3}],s:`Resize`}},"editor.extensions.image.small_size":{t:0,b:{t:2,i:[{t:3}],s:`Small size`}},"editor.extensions.image.medium_size":{t:0,b:{t:2,i:[{t:3}],s:`Medium size`}},"editor.extensions.image.large_size":{t:0,b:{t:2,i:[{t:3}],s:`Large size`}},"editor.extensions.image.restore_size":{t:0,b:{t:2,i:[{t:3}],s:`Restore original size`}},"editor.extensions.image.edit_link":{t:0,b:{t:2,i:[{t:3}],s:`Edit link`}},"editor.extensions.image.copy_width":{t:0,b:{t:2,i:[{t:3}],s:`Apply width to all text`}},"editor.extensions.image.edit_alt":{t:0,b:{t:2,i:[{t:3}],s:`Edit alt`}},"editor.extensions.image.edit_href":{t:0,b:{t:2,i:[{t:3}],s:`Edit the image hyperlink`}},"editor.extensions.image.edit_caption":{t:0,b:{t:2,i:[{t:3}],s:`Image description`}},"editor.extensions.image.image_load_error":{t:0,b:{t:2,i:[{t:3}],s:`Image load failed`}},"editor.extensions.video.src_input_label":{t:0,b:{t:2,i:[{t:3}],s:`Video link`}},"editor.extensions.video.resize":{t:0,b:{t:2,i:[{t:3}],s:`Resize`}},"editor.extensions.video.disable_controls":{t:0,b:{t:2,i:[{t:3}],s:`Hide controls`}},"editor.extensions.video.enable_controls":{t:0,b:{t:2,i:[{t:3}],s:`Show controls`}},"editor.extensions.video.disable_autoplay":{t:0,b:{t:2,i:[{t:3}],s:`Disable auto play`}},"editor.extensions.video.enable_autoplay":{t:0,b:{t:2,i:[{t:3}],s:`Enable auto play`}},"editor.extensions.video.disable_loop":{t:0,b:{t:2,i:[{t:3}],s:`Disable loop`}},"editor.extensions.video.enable_loop":{t:0,b:{t:2,i:[{t:3}],s:`Enable loop`}},"editor.extensions.video.small_size":{t:0,b:{t:2,i:[{t:3}],s:`Small size`}},"editor.extensions.video.medium_size":{t:0,b:{t:2,i:[{t:3}],s:`Medium size`}},"editor.extensions.video.large_size":{t:0,b:{t:2,i:[{t:3}],s:`Large size`}},"editor.extensions.video.edit_caption":{t:0,b:{t:2,i:[{t:3}],s:`Video description`}},"editor.extensions.highlight.unset":{t:0,b:{t:2,i:[{t:3}],s:`Unset`}},"editor.extensions.columns.add_column_before":{t:0,b:{t:2,i:[{t:3}],s:`Add column before`}},"editor.extensions.columns.add_column_after":{t:0,b:{t:2,i:[{t:3}],s:`Add column after`}},"editor.extensions.columns.delete_column":{t:0,b:{t:2,i:[{t:3}],s:`Delete column`}},"editor.extensions.search_and_replace.title":{t:0,b:{t:2,i:[{t:3}],s:`Search and Replace`}},"editor.extensions.search_and_replace.search_placeholder":{t:0,b:{t:2,i:[{t:3}],s:`Search`}},"editor.extensions.search_and_replace.not_found":{t:0,b:{t:2,i:[{t:3}],s:`Not found`}},"editor.extensions.search_and_replace.occurrence_found":{t:0,b:{t:2,i:[{t:4,k:`index`},{t:3,v:` of `},{t:4,k:`total`},{t:3,v:` occurrences`}]}},"editor.extensions.search_and_replace.find_previous":{t:0,b:{t:2,i:[{t:3}],s:`Find previous`}},"editor.extensions.search_and_replace.find_next":{t:0,b:{t:2,i:[{t:3}],s:`Find next`}},"editor.extensions.search_and_replace.replace_placeholder":{t:0,b:{t:2,i:[{t:3}],s:`Replace`}},"editor.extensions.search_and_replace.replace":{t:0,b:{t:2,i:[{t:3}],s:`Replace`}},"editor.extensions.search_and_replace.replace_all":{t:0,b:{t:2,i:[{t:3}],s:`Replace all`}},"editor.extensions.search_and_replace.case_sensitive":{t:0,b:{t:2,i:[{t:3}],s:`Case sensitive`}},"editor.extensions.search_and_replace.match_word":{t:0,b:{t:2,i:[{t:3}],s:`Match whole word`}},"editor.extensions.search_and_replace.use_regex":{t:0,b:{t:2,i:[{t:3}],s:`Use regular expression`}},"editor.extensions.search_and_replace.close":{t:0,b:{t:2,i:[{t:3}],s:`Close`}},"editor.extensions.format_brush.toolbar_item.title":{t:0,b:{t:2,i:[{t:3}],s:`Format Brush`}},"editor.extensions.format_brush.toolbar_item.cancel":{t:0,b:{t:2,i:[{t:3}],s:`Cancel Format Brush`}},"editor.extensions.details.command_item":{t:0,b:{t:2,i:[{t:3}],s:`Details`}},"editor.extensions.gallery.title":{t:0,b:{t:2,i:[{t:3}],s:`Gallery`}},"editor.extensions.gallery.add_image":{t:0,b:{t:2,i:[{t:3}],s:`Add image`}},"editor.extensions.gallery.empty_prompt":{t:0,b:{t:2,i:[{t:3}],s:`Click to select images or drag images here`}},"editor.extensions.gallery.group_size":{t:0,b:{t:2,i:[{t:3}],s:`Images per row`}},"editor.extensions.gallery.group_size_label":{t:0,b:{t:2,i:[{t:4,k:`count`},{t:3,v:` images per row`}]}},"editor.extensions.gallery.layout.title":{t:0,b:{t:2,i:[{t:3}],s:`Layout`}},"editor.extensions.gallery.layout.auto":{t:0,b:{t:2,i:[{t:3}],s:`Auto`}},"editor.extensions.gallery.layout.square":{t:0,b:{t:2,i:[{t:3}],s:`Square`}},"editor.extensions.gallery.gap":{t:0,b:{t:2,i:[{t:3}],s:`Gap`}},"editor.extensions.upload.error":{t:0,b:{t:2,i:[{t:3}],s:`Upload failed`}},"editor.extensions.upload.click_retry":{t:0,b:{t:2,i:[{t:3}],s:`Click to retry`}},"editor.extensions.upload.loading":{t:0,b:{t:2,i:[{t:3}],s:`Loading`}},"editor.extensions.upload.attachment.title":{t:0,b:{t:2,i:[{t:3}],s:`Attachment Library`}},"editor.extensions.upload.permalink.title":{t:0,b:{t:2,i:[{t:3}],s:`Input link`}},"editor.extensions.upload.permalink.placeholder":{t:0,b:{t:2,i:[{t:3}],s:`Input link and press Enter to confirm`}},"editor.extensions.upload.operations.remove.button":{t:0,b:{t:2,i:[{t:3}],s:`Delete`}},"editor.extensions.upload.operations.replace.button":{t:0,b:{t:2,i:[{t:3}],s:`Replace`}},"editor.extensions.upload.operations.transfer.button":{t:0,b:{t:2,i:[{t:3}],s:`Save locally`}},"editor.extensions.upload.operations.transfer.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.`}},"editor.extensions.upload.operations.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?`}},"editor.extensions.font_size.title":{t:0,b:{t:2,i:[{t:3}],s:`Font size`}},"editor.components.color_picker.more_color":{t:0,b:{t:2,i:[{t:3}],s:`More`}},"editor.common.alt":{t:0,b:{t:2,i:[{t:3}],s:`Alternative text`}},"editor.common.width":{t:0,b:{t:2,i:[{t:3}],s:`Width`}},"editor.common.height":{t:0,b:{t:2,i:[{t:3}],s:`Height`}},"editor.common.align_method":{t:0,b:{t:2,i:[{t:3}],s:`Align method`}},"editor.common.align_left":{t:0,b:{t:2,i:[{t:3}],s:`Align left`}},"editor.common.align_center":{t:0,b:{t:2,i:[{t:3}],s:`Align center`}},"editor.common.align_right":{t:0,b:{t:2,i:[{t:3}],s:`Align right`}},"editor.common.align_justify":{t:0,b:{t:2,i:[{t:3}],s:`Align justify`}},"editor.common.bold":{t:0,b:{t:2,i:[{t:3}],s:`Bold`}},"editor.common.italic":{t:0,b:{t:2,i:[{t:3}],s:`Italic`}},"editor.common.underline":{t:0,b:{t:2,i:[{t:3}],s:`Underline`}},"editor.common.strike":{t:0,b:{t:2,i:[{t:3}],s:`Strike`}},"editor.common.quote":{t:0,b:{t:2,i:[{t:3}],s:`Quote`}},"editor.common.code":{t:0,b:{t:2,i:[{t:3}],s:`Code`}},"editor.common.superscript":{t:0,b:{t:2,i:[{t:3}],s:`Superscript`}},"editor.common.subscript":{t:0,b:{t:2,i:[{t:3}],s:`Subscript`}},"editor.common.codeblock.title":{t:0,b:{t:2,i:[{t:3}],s:`Code block`}},"editor.common.codeblock.copy_code":{t:0,b:{t:2,i:[{t:3}],s:`Copy code`}},"editor.common.codeblock.copy_code_success":{t:0,b:{t:2,i:[{t:3}],s:`Copy success`}},"editor.common.image":{t:0,b:{t:2,i:[{t:3}],s:`Image`}},"editor.common.heading.title":{t:0,b:{t:2,i:[{t:3}],s:`Text type`}},"editor.common.heading.paragraph":{t:0,b:{t:2,i:[{t:3}],s:`Paragraph`}},"editor.common.heading.heading1":{t:0,b:{t:2,i:[{t:3}],s:`Heading 1`}},"editor.common.heading.heading2":{t:0,b:{t:2,i:[{t:3}],s:`Heading 2`}},"editor.common.heading.heading3":{t:0,b:{t:2,i:[{t:3}],s:`Heading 3`}},"editor.common.heading.heading4":{t:0,b:{t:2,i:[{t:3}],s:`Heading 4`}},"editor.common.heading.heading5":{t:0,b:{t:2,i:[{t:3}],s:`Heading 5`}},"editor.common.heading.heading6":{t:0,b:{t:2,i:[{t:3}],s:`Heading 6`}},"editor.common.list":{t:0,b:{t:2,i:[{t:3}],s:`List`}},"editor.common.bullet_list":{t:0,b:{t:2,i:[{t:3}],s:`Bullet list`}},"editor.common.ordered_list":{t:0,b:{t:2,i:[{t:3}],s:`Ordered list`}},"editor.common.task_list":{t:0,b:{t:2,i:[{t:3}],s:`Task list`}},"editor.common.highlight":{t:0,b:{t:2,i:[{t:3}],s:`Highlight`}},"editor.common.color":{t:0,b:{t:2,i:[{t:3}],s:`Color`}},"editor.common.tooltip.custom_width_input":{t:0,b:{t:2,i:[{t:3}],s:`Custom width, press Enter to take effect`}},"editor.common.tooltip.custom_height_input":{t:0,b:{t:2,i:[{t:3}],s:`Customize height, press Enter to take effect`}},"editor.common.tooltip.open_link":{t:0,b:{t:2,i:[{t:3}],s:`Open link`}},"editor.common.placeholder.link_input":{t:0,b:{t:2,i:[{t:3}],s:`Enter the link and press Enter to confirm.`}},"editor.common.placeholder.alt_input":{t:0,b:{t:2,i:[{t:3}],s:`Enter the image alt text and press Enter to confirm.`}},"editor.common.placeholder.alt_href":{t:0,b:{t:2,i:[{t:3}],s:`Enter the image hyperlink and press Enter to confirm.`}},"editor.common.button.new_line":{t:0,b:{t:2,i:[{t:3}],s:`New line`}},"editor.common.button.delete":{t:0,b:{t:2,i:[{t:3}],s:`Delete`}},"editor.common.button.edit_link":{t:0,b:{t:2,i:[{t:3}],s:`Edit link`}},"editor.common.button.refresh":{t:0,b:{t:2,i:[{t:3}],s:`Refresh`}},"editor.common.button.restore_default":{t:0,b:{t:2,i:[{t:3}],s:`Restore default`}},"editor.common.button.add":{t:0,b:{t:2,i:[{t:3}],s:`Add`}},"editor.common.button.cancel":{t:0,b:{t:2,i:[{t:3}],s:`Cancel`}},"editor.common.button.upload":{t:0,b:{t:2,i:[{t:3}],s:`Upload`}},"editor.common.button.confirm":{t:0,b:{t:2,i:[{t:3}],s:`Confirm`}},"editor.common.text.default":{t:0,b:{t:2,i:[{t:3}],s:`Default`}},"editor.common.text.tip":{t:0,b:{t:2,i:[{t:3}],s:`Tip`}},"editor.common.toast.save_success":{t:0,b:{t:2,i:[{t:3}],s:`Saved successfully`}},"editor.common.line_height":{t:0,b:{t:2,i:[{t:3}],s:`Line height`}},"editor.common.clear_format":{t:0,b:{t:2,i:[{t:3}],s:`Clear format`}}},t_={"editor.drag.button.insert_block":{t:0,b:{t:2,i:[{t:3}],s:`Insertar bloque`}},"editor.drag.button.drag_handle":{t:0,b:{t:2,i:[{t:3}],s:`Tirador de arrastre`}},"editor.drag.menu.convert_to":{t:0,b:{t:2,i:[{t:3}],s:`Convertir a`}},"editor.drag.menu.copy":{t:0,b:{t:2,i:[{t:3}],s:`Copiar`}},"editor.drag.menu.cut":{t:0,b:{t:2,i:[{t:3}],s:`Cortar`}},"editor.drag.menu.delete":{t:0,b:{t:2,i:[{t:3}],s:`Eliminar`}},"editor.menus.undo":{t:0,b:{t:2,i:[{t:3}],s:`Deshacer`}},"editor.menus.redo":{t:0,b:{t:2,i:[{t:3}],s:`Rehacer`}},"editor.menus.table.title":{t:0,b:{t:2,i:[{t:3}],s:`Tabla`}},"editor.menus.table.add":{t:0,b:{t:2,i:[{t:3}],s:`Añadir tabla`}},"editor.menus.table.add_column_before":{t:0,b:{t:2,i:[{t:3}],s:`Añadir columna antes`}},"editor.menus.table.add_column_after":{t:0,b:{t:2,i:[{t:3}],s:`Añadir columna después`}},"editor.menus.table.delete_column":{t:0,b:{t:2,i:[{t:3}],s:`Eliminar columna`}},"editor.menus.table.add_row_before":{t:0,b:{t:2,i:[{t:3}],s:`Añadir fila antes`}},"editor.menus.table.add_row_after":{t:0,b:{t:2,i:[{t:3}],s:`Añadir fila después`}},"editor.menus.table.toggle_header_column":{t:0,b:{t:2,i:[{t:3}],s:`Activar/Desactivar encabezado de primera columna`}},"editor.menus.table.toggle_header_row":{t:0,b:{t:2,i:[{t:3}],s:`Activar/Desactivar encabezado de primera fila`}},"editor.menus.table.toggle_header_cell":{t:0,b:{t:2,i:[{t:3}],s:`Activar/Desactivar celda actual como encabezado`}},"editor.menus.table.delete_row":{t:0,b:{t:2,i:[{t:3}],s:`Eliminar fila`}},"editor.menus.table.merge_cells":{t:0,b:{t:2,i:[{t:3}],s:`Combinar celdas`}},"editor.menus.table.split_cell":{t:0,b:{t:2,i:[{t:3}],s:`Dividir celda`}},"editor.menus.table.delete_table":{t:0,b:{t:2,i:[{t:3}],s:`Eliminar tabla`}},"editor.extensions.commands_menu.columns":{t:0,b:{t:2,i:[{t:3}],s:`Tarjeta de columnas`}},"editor.extensions.commands_menu.iframe":{t:0,b:{t:2,i:[{t:3}],s:`Iframe`}},"editor.extensions.commands_menu.image":{t:0,b:{t:2,i:[{t:3}],s:`Imagen`}},"editor.extensions.commands_menu.video":{t:0,b:{t:2,i:[{t:3}],s:`Vídeo`}},"editor.extensions.commands_menu.audio":{t:0,b:{t:2,i:[{t:3}],s:`Audio`}},"editor.extensions.commands_menu.table":{t:0,b:{t:2,i:[{t:3}],s:`Tabla`}},"editor.extensions.commands_menu.gallery":{t:0,b:{t:2,i:[{t:3}],s:`Galería`}},"editor.extensions.commands_menu.no_results":{t:0,b:{t:2,i:[{t:3}],s:`Sin resultados`}},"editor.extensions.commands_menu.placeholder":{t:0,b:{t:2,i:[{t:3}],s:`Introduce / para seleccionar el tipo de entrada`}},"editor.extensions.figure_caption.empty_placeholder":{t:0,b:{t:2,i:[{t:3}],s:`Añadir descripción`}},"editor.extensions.link.add_link":{t:0,b:{t:2,i:[{t:3}],s:`Añadir enlace`}},"editor.extensions.link.edit_link":{t:0,b:{t:2,i:[{t:3}],s:`Editar enlace`}},"editor.extensions.link.placeholder":{t:0,b:{t:2,i:[{t:3}],s:`Dirección del enlace`}},"editor.extensions.link.open_in_new_window":{t:0,b:{t:2,i:[{t:3}],s:`Abrir en una ventana nueva`}},"editor.extensions.link.cancel_link":{t:0,b:{t:2,i:[{t:3}],s:`Cancelar enlace`}},"editor.extensions.link.nofollow":{t:0,b:{t:2,i:[{t:3}],s:`Nofollow`}},"editor.extensions.audio.src_input_label":{t:0,b:{t:2,i:[{t:3}],s:`Enlace de audio`}},"editor.extensions.audio.disable_autoplay":{t:0,b:{t:2,i:[{t:3}],s:`Desactivar reproducción automática`}},"editor.extensions.audio.enable_autoplay":{t:0,b:{t:2,i:[{t:3}],s:`Activar reproducción automática`}},"editor.extensions.audio.disable_loop":{t:0,b:{t:2,i:[{t:3}],s:`Desactivar bucle`}},"editor.extensions.audio.enable_loop":{t:0,b:{t:2,i:[{t:3}],s:`Activar bucle`}},"editor.extensions.iframe.src_input_label":{t:0,b:{t:2,i:[{t:3}],s:`Enlace web`}},"editor.extensions.iframe.resize":{t:0,b:{t:2,i:[{t:3}],s:`Redimensionar`}},"editor.extensions.iframe.disable_frameborder":{t:0,b:{t:2,i:[{t:3}],s:`Ocultar borde de marco`}},"editor.extensions.iframe.enable_frameborder":{t:0,b:{t:2,i:[{t:3}],s:`Mostrar borde de marco`}},"editor.extensions.iframe.phone_size":{t:0,b:{t:2,i:[{t:3}],s:`Tamaño de teléfono móvil`}},"editor.extensions.iframe.tablet_vertical_size":{t:0,b:{t:2,i:[{t:3}],s:`Tamaño de tableta vertical`}},"editor.extensions.iframe.tablet_horizontal_size":{t:0,b:{t:2,i:[{t:3}],s:`Tamaño de tableta horizontal`}},"editor.extensions.iframe.desktop_size":{t:0,b:{t:2,i:[{t:3}],s:`Tamaño de escritorio`}},"editor.extensions.image.src_input_label":{t:0,b:{t:2,i:[{t:3}],s:`Enlace de imagen`}},"editor.extensions.image.href_input_label":{t:0,b:{t:2,i:[{t:3}],s:`Hipervínculo de imagen`}},"editor.extensions.image.resize":{t:0,b:{t:2,i:[{t:3}],s:`Redimensionar`}},"editor.extensions.image.small_size":{t:0,b:{t:2,i:[{t:3}],s:`Tamaño pequeño`}},"editor.extensions.image.medium_size":{t:0,b:{t:2,i:[{t:3}],s:`Tamaño mediano`}},"editor.extensions.image.large_size":{t:0,b:{t:2,i:[{t:3}],s:`Tamaño grande`}},"editor.extensions.image.restore_size":{t:0,b:{t:2,i:[{t:3}],s:`Restaurar tamaño original`}},"editor.extensions.image.edit_link":{t:0,b:{t:2,i:[{t:3}],s:`Editar enlace`}},"editor.extensions.image.copy_width":{t:0,b:{t:2,i:[{t:3}],s:`Aplicar ancho a todo el texto`}},"editor.extensions.image.edit_alt":{t:0,b:{t:2,i:[{t:3}],s:`Editar texto alternativo`}},"editor.extensions.image.edit_href":{t:0,b:{t:2,i:[{t:3}],s:`Editar el hipervínculo de la imagen`}},"editor.extensions.image.edit_caption":{t:0,b:{t:2,i:[{t:3}],s:`Descripción de la imagen`}},"editor.extensions.image.image_load_error":{t:0,b:{t:2,i:[{t:3}],s:`Error al cargar la imagen`}},"editor.extensions.video.src_input_label":{t:0,b:{t:2,i:[{t:3}],s:`Enlace de vídeo`}},"editor.extensions.video.resize":{t:0,b:{t:2,i:[{t:3}],s:`Redimensionar`}},"editor.extensions.video.disable_controls":{t:0,b:{t:2,i:[{t:3}],s:`Ocultar controles`}},"editor.extensions.video.enable_controls":{t:0,b:{t:2,i:[{t:3}],s:`Mostrar controles`}},"editor.extensions.video.disable_autoplay":{t:0,b:{t:2,i:[{t:3}],s:`Desactivar reproducción automática`}},"editor.extensions.video.enable_autoplay":{t:0,b:{t:2,i:[{t:3}],s:`Activar reproducción automática`}},"editor.extensions.video.disable_loop":{t:0,b:{t:2,i:[{t:3}],s:`Desactivar bucle`}},"editor.extensions.video.enable_loop":{t:0,b:{t:2,i:[{t:3}],s:`Activar bucle`}},"editor.extensions.video.small_size":{t:0,b:{t:2,i:[{t:3}],s:`Tamaño pequeño`}},"editor.extensions.video.medium_size":{t:0,b:{t:2,i:[{t:3}],s:`Tamaño mediano`}},"editor.extensions.video.large_size":{t:0,b:{t:2,i:[{t:3}],s:`Tamaño grande`}},"editor.extensions.video.edit_caption":{t:0,b:{t:2,i:[{t:3}],s:`Descripción del vídeo`}},"editor.extensions.highlight.unset":{t:0,b:{t:2,i:[{t:3}],s:`Desactivar`}},"editor.extensions.columns.add_column_before":{t:0,b:{t:2,i:[{t:3}],s:`Añadir columna antes`}},"editor.extensions.columns.add_column_after":{t:0,b:{t:2,i:[{t:3}],s:`Añadir columna después`}},"editor.extensions.columns.delete_column":{t:0,b:{t:2,i:[{t:3}],s:`Eliminar columna`}},"editor.extensions.search_and_replace.title":{t:0,b:{t:2,i:[{t:3}],s:`Buscar y reemplazar`}},"editor.extensions.search_and_replace.search_placeholder":{t:0,b:{t:2,i:[{t:3}],s:`Buscar`}},"editor.extensions.search_and_replace.not_found":{t:0,b:{t:2,i:[{t:3}],s:`No encontrado`}},"editor.extensions.search_and_replace.occurrence_found":{t:0,b:{t:2,i:[{t:4,k:`index`},{t:3,v:` de `},{t:4,k:`total`},{t:3,v:` ocurrencias`}]}},"editor.extensions.search_and_replace.find_previous":{t:0,b:{t:2,i:[{t:3}],s:`Buscar anterior`}},"editor.extensions.search_and_replace.find_next":{t:0,b:{t:2,i:[{t:3}],s:`Buscar siguiente`}},"editor.extensions.search_and_replace.replace_placeholder":{t:0,b:{t:2,i:[{t:3}],s:`Reemplazar`}},"editor.extensions.search_and_replace.replace":{t:0,b:{t:2,i:[{t:3}],s:`Reemplazar`}},"editor.extensions.search_and_replace.replace_all":{t:0,b:{t:2,i:[{t:3}],s:`Reemplazar todo`}},"editor.extensions.search_and_replace.case_sensitive":{t:0,b:{t:2,i:[{t:3}],s:`Coincidir mayúsculas y minúsculas`}},"editor.extensions.search_and_replace.match_word":{t:0,b:{t:2,i:[{t:3}],s:`Palabras completas`}},"editor.extensions.search_and_replace.use_regex":{t:0,b:{t:2,i:[{t:3}],s:`Usar expresión regular`}},"editor.extensions.search_and_replace.close":{t:0,b:{t:2,i:[{t:3}],s:`Cerrar`}},"editor.extensions.format_brush.toolbar_item.title":{t:0,b:{t:2,i:[{t:3}],s:`Pincel de formato`}},"editor.extensions.format_brush.toolbar_item.cancel":{t:0,b:{t:2,i:[{t:3}],s:`Cancelar pincel de formato`}},"editor.extensions.details.command_item":{t:0,b:{t:2,i:[{t:3}],s:`Detalles`}},"editor.extensions.gallery.title":{t:0,b:{t:2,i:[{t:3}],s:`Galería`}},"editor.extensions.gallery.add_image":{t:0,b:{t:2,i:[{t:3}],s:`Añadir imagen`}},"editor.extensions.gallery.empty_prompt":{t:0,b:{t:2,i:[{t:3}],s:`Haz clic para seleccionar imágenes o arrastra imágenes aquí`}},"editor.extensions.gallery.group_size":{t:0,b:{t:2,i:[{t:3}],s:`Imágenes por fila`}},"editor.extensions.gallery.group_size_label":{t:0,b:{t:2,i:[{t:4,k:`count`},{t:3,v:` imágenes por fila`}]}},"editor.extensions.gallery.layout.title":{t:0,b:{t:2,i:[{t:3}],s:`Diseño`}},"editor.extensions.gallery.layout.auto":{t:0,b:{t:2,i:[{t:3}],s:`Automático`}},"editor.extensions.gallery.layout.square":{t:0,b:{t:2,i:[{t:3}],s:`Cuadrado`}},"editor.extensions.gallery.gap":{t:0,b:{t:2,i:[{t:3}],s:`Espaciado`}},"editor.extensions.upload.error":{t:0,b:{t:2,i:[{t:3}],s:`Error al subir`}},"editor.extensions.upload.click_retry":{t:0,b:{t:2,i:[{t:3}],s:`Haz clic para reintentar`}},"editor.extensions.upload.loading":{t:0,b:{t:2,i:[{t:3}],s:`Subiendo`}},"editor.extensions.upload.attachment.title":{t:0,b:{t:2,i:[{t:3}],s:`Biblioteca de adjuntos`}},"editor.extensions.upload.permalink.title":{t:0,b:{t:2,i:[{t:3}],s:`Introducir enlace`}},"editor.extensions.upload.permalink.placeholder":{t:0,b:{t:2,i:[{t:3}],s:`Introduce el enlace y presiona Enter para confirmar`}},"editor.extensions.upload.operations.remove.button":{t:0,b:{t:2,i:[{t:3}],s:`Eliminar`}},"editor.extensions.upload.operations.replace.button":{t:0,b:{t:2,i:[{t:3}],s:`Reemplazar`}},"editor.extensions.upload.operations.transfer.button":{t:0,b:{t:2,i:[{t:3}],s:`Guardar localmente`}},"editor.extensions.upload.operations.transfer.tooltip":{t:0,b:{t:2,i:[{t:3}],s:`Este recurso se detecta como recurso externo. Haz clic en este botón para guardarlo en la biblioteca de adjuntos.`}},"editor.extensions.upload.operations.transfer_in_batch.description":{t:0,b:{t:2,i:[{t:3}],s:`Se detectó un enlace externo. ¿Deseas subirlo automáticamente a la biblioteca de adjuntos?`}},"editor.extensions.font_size.title":{t:0,b:{t:2,i:[{t:3}],s:`Tamaño de fuente`}},"editor.components.color_picker.more_color":{t:0,b:{t:2,i:[{t:3}],s:`Más`}},"editor.common.alt":{t:0,b:{t:2,i:[{t:3}],s:`Texto alternativo`}},"editor.common.width":{t:0,b:{t:2,i:[{t:3}],s:`Ancho`}},"editor.common.height":{t:0,b:{t:2,i:[{t:3}],s:`Alto`}},"editor.common.align_method":{t:0,b:{t:2,i:[{t:3}],s:`Método de alineación`}},"editor.common.align_left":{t:0,b:{t:2,i:[{t:3}],s:`Alinear a la izquierda`}},"editor.common.align_center":{t:0,b:{t:2,i:[{t:3}],s:`Centrar`}},"editor.common.align_right":{t:0,b:{t:2,i:[{t:3}],s:`Alinear a la derecha`}},"editor.common.align_justify":{t:0,b:{t:2,i:[{t:3}],s:`Justificar`}},"editor.common.bold":{t:0,b:{t:2,i:[{t:3}],s:`Negrita`}},"editor.common.italic":{t:0,b:{t:2,i:[{t:3}],s:`Cursiva`}},"editor.common.underline":{t:0,b:{t:2,i:[{t:3}],s:`Subrayado`}},"editor.common.strike":{t:0,b:{t:2,i:[{t:3}],s:`Tachado`}},"editor.common.quote":{t:0,b:{t:2,i:[{t:3}],s:`Cita`}},"editor.common.code":{t:0,b:{t:2,i:[{t:3}],s:`Código`}},"editor.common.superscript":{t:0,b:{t:2,i:[{t:3}],s:`Superíndice`}},"editor.common.subscript":{t:0,b:{t:2,i:[{t:3}],s:`Subíndice`}},"editor.common.codeblock.title":{t:0,b:{t:2,i:[{t:3}],s:`Bloque de código`}},"editor.common.codeblock.copy_code":{t:0,b:{t:2,i:[{t:3}],s:`Copiar código`}},"editor.common.codeblock.copy_code_success":{t:0,b:{t:2,i:[{t:3}],s:`Copiado con éxito`}},"editor.common.image":{t:0,b:{t:2,i:[{t:3}],s:`Imagen`}},"editor.common.heading.title":{t:0,b:{t:2,i:[{t:3}],s:`Tipo de texto`}},"editor.common.heading.paragraph":{t:0,b:{t:2,i:[{t:3}],s:`Párrafo`}},"editor.common.heading.heading1":{t:0,b:{t:2,i:[{t:3}],s:`Título 1`}},"editor.common.heading.heading2":{t:0,b:{t:2,i:[{t:3}],s:`Título 2`}},"editor.common.heading.heading3":{t:0,b:{t:2,i:[{t:3}],s:`Título 3`}},"editor.common.heading.heading4":{t:0,b:{t:2,i:[{t:3}],s:`Título 4`}},"editor.common.heading.heading5":{t:0,b:{t:2,i:[{t:3}],s:`Título 5`}},"editor.common.heading.heading6":{t:0,b:{t:2,i:[{t:3}],s:`Título 6`}},"editor.common.list":{t:0,b:{t:2,i:[{t:3}],s:`Lista`}},"editor.common.bullet_list":{t:0,b:{t:2,i:[{t:3}],s:`Lista con viñetas`}},"editor.common.ordered_list":{t:0,b:{t:2,i:[{t:3}],s:`Lista ordenada`}},"editor.common.task_list":{t:0,b:{t:2,i:[{t:3}],s:`Lista de tareas`}},"editor.common.highlight":{t:0,b:{t:2,i:[{t:3}],s:`Resaltar`}},"editor.common.color":{t:0,b:{t:2,i:[{t:3}],s:`Color`}},"editor.common.tooltip.custom_width_input":{t:0,b:{t:2,i:[{t:3}],s:`Ancho personalizado, presiona Enter para aplicar`}},"editor.common.tooltip.custom_height_input":{t:0,b:{t:2,i:[{t:3}],s:`Alto personalizado, presiona Enter para aplicar`}},"editor.common.tooltip.open_link":{t:0,b:{t:2,i:[{t:3}],s:`Abrir enlace`}},"editor.common.placeholder.link_input":{t:0,b:{t:2,i:[{t:3}],s:`Introduce el enlace y presiona Enter para confirmar.`}},"editor.common.placeholder.alt_input":{t:0,b:{t:2,i:[{t:3}],s:`Introduce el texto alternativo y presiona Enter para confirmar.`}},"editor.common.placeholder.alt_href":{t:0,b:{t:2,i:[{t:3}],s:`Introduce el hipervínculo de la imagen y presiona Enter para confirmar.`}},"editor.common.button.new_line":{t:0,b:{t:2,i:[{t:3}],s:`Nueva línea`}},"editor.common.button.delete":{t:0,b:{t:2,i:[{t:3}],s:`Eliminar`}},"editor.common.button.edit_link":{t:0,b:{t:2,i:[{t:3}],s:`Editar enlace`}},"editor.common.button.refresh":{t:0,b:{t:2,i:[{t:3}],s:`Actualizar`}},"editor.common.button.restore_default":{t:0,b:{t:2,i:[{t:3}],s:`Restaurar predeterminado`}},"editor.common.button.add":{t:0,b:{t:2,i:[{t:3}],s:`Añadir`}},"editor.common.button.cancel":{t:0,b:{t:2,i:[{t:3}],s:`Cancelar`}},"editor.common.button.upload":{t:0,b:{t:2,i:[{t:3}],s:`Cargar`}},"editor.common.button.confirm":{t:0,b:{t:2,i:[{t:3}],s:`Confirmar`}},"editor.common.text.default":{t:0,b:{t:2,i:[{t:3}],s:`Predeterminado`}},"editor.common.text.tip":{t:0,b:{t:2,i:[{t:3}],s:`Consejo`}},"editor.common.toast.save_success":{t:0,b:{t:2,i:[{t:3}],s:`Guardado con éxito`}},"editor.common.line_height":{t:0,b:{t:2,i:[{t:3}],s:`Altura de línea`}},"editor.common.clear_format":{t:0,b:{t:2,i:[{t:3}],s:`Limpiar formato`}}},n_={"editor.drag.button.insert_block":{t:0,b:{t:2,i:[{t:3}],s:`插入块`}},"editor.drag.button.drag_handle":{t:0,b:{t:2,i:[{t:3}],s:`按住拖动`}},"editor.drag.menu.convert_to":{t:0,b:{t:2,i:[{t:3}],s:`转换为`}},"editor.drag.menu.copy":{t:0,b:{t:2,i:[{t:3}],s:`复制`}},"editor.drag.menu.cut":{t:0,b:{t:2,i:[{t:3}],s:`剪切`}},"editor.drag.menu.delete":{t:0,b:{t:2,i:[{t:3}],s:`删除`}},"editor.menus.undo":{t:0,b:{t:2,i:[{t:3}],s:`撤销`}},"editor.menus.redo":{t:0,b:{t:2,i:[{t:3}],s:`恢复`}},"editor.menus.table.title":{t:0,b:{t:2,i:[{t:3}],s:`表格`}},"editor.menus.table.add":{t:0,b:{t:2,i:[{t:3}],s:`插入表格`}},"editor.menus.table.add_column_before":{t:0,b:{t:2,i:[{t:3}],s:`向前插入列`}},"editor.menus.table.add_column_after":{t:0,b:{t:2,i:[{t:3}],s:`向后插入列`}},"editor.menus.table.delete_column":{t:0,b:{t:2,i:[{t:3}],s:`删除当前列`}},"editor.menus.table.add_row_before":{t:0,b:{t:2,i:[{t:3}],s:`向上插入行`}},"editor.menus.table.add_row_after":{t:0,b:{t:2,i:[{t:3}],s:`向下插入行`}},"editor.menus.table.toggle_header_column":{t:0,b:{t:2,i:[{t:3}],s:`设置/取消首列表头`}},"editor.menus.table.toggle_header_row":{t:0,b:{t:2,i:[{t:3}],s:`设置/取消首行表头`}},"editor.menus.table.toggle_header_cell":{t:0,b:{t:2,i:[{t:3}],s:`设置/取消当前单元格为表头`}},"editor.menus.table.delete_row":{t:0,b:{t:2,i:[{t:3}],s:`删除当前行`}},"editor.menus.table.merge_cells":{t:0,b:{t:2,i:[{t:3}],s:`合并单元格`}},"editor.menus.table.split_cell":{t:0,b:{t:2,i:[{t:3}],s:`拆分单元格`}},"editor.menus.table.delete_table":{t:0,b:{t:2,i:[{t:3}],s:`删除表格`}},"editor.extensions.commands_menu.columns":{t:0,b:{t:2,i:[{t:3}],s:`分栏卡片`}},"editor.extensions.commands_menu.iframe":{t:0,b:{t:2,i:[{t:3}],s:`嵌入网页`}},"editor.extensions.commands_menu.image":{t:0,b:{t:2,i:[{t:3}],s:`图片`}},"editor.extensions.commands_menu.video":{t:0,b:{t:2,i:[{t:3}],s:`视频`}},"editor.extensions.commands_menu.audio":{t:0,b:{t:2,i:[{t:3}],s:`音频`}},"editor.extensions.commands_menu.table":{t:0,b:{t:2,i:[{t:3}],s:`表格`}},"editor.extensions.commands_menu.gallery":{t:0,b:{t:2,i:[{t:3}],s:`图片集`}},"editor.extensions.commands_menu.no_results":{t:0,b:{t:2,i:[{t:3}],s:`没有搜索结果`}},"editor.extensions.commands_menu.placeholder":{t:0,b:{t:2,i:[{t:3}],s:`输入 / 以选择输入类型`}},"editor.extensions.figure_caption.empty_placeholder":{t:0,b:{t:2,i:[{t:3}],s:`添加描述`}},"editor.extensions.link.add_link":{t:0,b:{t:2,i:[{t:3}],s:`添加链接`}},"editor.extensions.link.edit_link":{t:0,b:{t:2,i:[{t:3}],s:`修改链接`}},"editor.extensions.link.placeholder":{t:0,b:{t:2,i:[{t:3}],s:`链接地址`}},"editor.extensions.link.open_in_new_window":{t:0,b:{t:2,i:[{t:3}],s:`在新窗口中打开`}},"editor.extensions.link.cancel_link":{t:0,b:{t:2,i:[{t:3}],s:`取消链接`}},"editor.extensions.link.nofollow":{t:0,b:{t:2,i:[{t:3}],s:`搜索引擎忽略链接关系`}},"editor.extensions.audio.src_input_label":{t:0,b:{t:2,i:[{t:3}],s:`音频链接`}},"editor.extensions.audio.disable_autoplay":{t:0,b:{t:2,i:[{t:3}],s:`关闭自动播放`}},"editor.extensions.audio.enable_autoplay":{t:0,b:{t:2,i:[{t:3}],s:`开启自动播放`}},"editor.extensions.audio.disable_loop":{t:0,b:{t:2,i:[{t:3}],s:`关闭循环播放`}},"editor.extensions.audio.enable_loop":{t:0,b:{t:2,i:[{t:3}],s:`开启循环播放`}},"editor.extensions.iframe.src_input_label":{t:0,b:{t:2,i:[{t:3}],s:`网页链接`}},"editor.extensions.iframe.resize":{t:0,b:{t:2,i:[{t:3}],s:`调整尺寸`}},"editor.extensions.iframe.disable_frameborder":{t:0,b:{t:2,i:[{t:3}],s:`取消边框`}},"editor.extensions.iframe.enable_frameborder":{t:0,b:{t:2,i:[{t:3}],s:`设置边框`}},"editor.extensions.iframe.phone_size":{t:0,b:{t:2,i:[{t:3}],s:`手机尺寸`}},"editor.extensions.iframe.tablet_vertical_size":{t:0,b:{t:2,i:[{t:3}],s:`平板电脑纵向尺寸`}},"editor.extensions.iframe.tablet_horizontal_size":{t:0,b:{t:2,i:[{t:3}],s:`平板电脑横向尺寸`}},"editor.extensions.iframe.desktop_size":{t:0,b:{t:2,i:[{t:3}],s:`桌面电脑尺寸`}},"editor.extensions.image.src_input_label":{t:0,b:{t:2,i:[{t:3}],s:`图片链接`}},"editor.extensions.image.href_input_label":{t:0,b:{t:2,i:[{t:3}],s:`图片跳转链接`}},"editor.extensions.image.resize":{t:0,b:{t:2,i:[{t:3}],s:`调整尺寸`}},"editor.extensions.image.small_size":{t:0,b:{t:2,i:[{t:3}],s:`小尺寸`}},"editor.extensions.image.medium_size":{t:0,b:{t:2,i:[{t:3}],s:`中尺寸`}},"editor.extensions.image.large_size":{t:0,b:{t:2,i:[{t:3}],s:`大尺寸`}},"editor.extensions.image.restore_size":{t:0,b:{t:2,i:[{t:3}],s:`恢复原始尺寸`}},"editor.extensions.image.edit_link":{t:0,b:{t:2,i:[{t:3}],s:`修改链接`}},"editor.extensions.image.copy_width":{t:0,b:{t:2,i:[{t:3}],s:`将宽度应用至全文`}},"editor.extensions.image.edit_alt":{t:0,b:{t:2,i:[{t:3}],s:`修改图片的替代文本(alt 属性)`}},"editor.extensions.image.edit_href":{t:0,b:{t:2,i:[{t:3}],s:`修改图片跳转链接`}},"editor.extensions.image.edit_caption":{t:0,b:{t:2,i:[{t:3}],s:`图片描述文本`}},"editor.extensions.image.image_load_error":{t:0,b:{t:2,i:[{t:3}],s:`图片加载失败`}},"editor.extensions.video.src_input_label":{t:0,b:{t:2,i:[{t:3}],s:`视频链接`}},"editor.extensions.video.resize":{t:0,b:{t:2,i:[{t:3}],s:`调整尺寸`}},"editor.extensions.video.disable_controls":{t:0,b:{t:2,i:[{t:3}],s:`隐藏控制面板`}},"editor.extensions.video.enable_controls":{t:0,b:{t:2,i:[{t:3}],s:`显示控制面板`}},"editor.extensions.video.disable_autoplay":{t:0,b:{t:2,i:[{t:3}],s:`关闭自动播放`}},"editor.extensions.video.enable_autoplay":{t:0,b:{t:2,i:[{t:3}],s:`开启自动播放`}},"editor.extensions.video.disable_loop":{t:0,b:{t:2,i:[{t:3}],s:`关闭循环播放`}},"editor.extensions.video.enable_loop":{t:0,b:{t:2,i:[{t:3}],s:`开启循环播放`}},"editor.extensions.video.small_size":{t:0,b:{t:2,i:[{t:3}],s:`小尺寸`}},"editor.extensions.video.medium_size":{t:0,b:{t:2,i:[{t:3}],s:`中尺寸`}},"editor.extensions.video.large_size":{t:0,b:{t:2,i:[{t:3}],s:`大尺寸`}},"editor.extensions.video.edit_caption":{t:0,b:{t:2,i:[{t:3}],s:`视频描述`}},"editor.extensions.highlight.unset":{t:0,b:{t:2,i:[{t:3}],s:`移除高亮颜色`}},"editor.extensions.columns.add_column_before":{t:0,b:{t:2,i:[{t:3}],s:`向前插入列`}},"editor.extensions.columns.add_column_after":{t:0,b:{t:2,i:[{t:3}],s:`向后插入列`}},"editor.extensions.columns.delete_column":{t:0,b:{t:2,i:[{t:3}],s:`删除当前列`}},"editor.extensions.search_and_replace.title":{t:0,b:{t:2,i:[{t:3}],s:`查找替换`}},"editor.extensions.search_and_replace.search_placeholder":{t:0,b:{t:2,i:[{t:3}],s:`查找`}},"editor.extensions.search_and_replace.not_found":{t:0,b:{t:2,i:[{t:3}],s:`无结果`}},"editor.extensions.search_and_replace.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:` 项`}]}},"editor.extensions.search_and_replace.find_previous":{t:0,b:{t:2,i:[{t:3}],s:`上一个匹配项`}},"editor.extensions.search_and_replace.find_next":{t:0,b:{t:2,i:[{t:3}],s:`下一个匹配项`}},"editor.extensions.search_and_replace.replace_placeholder":{t:0,b:{t:2,i:[{t:3}],s:`替换`}},"editor.extensions.search_and_replace.replace":{t:0,b:{t:2,i:[{t:3}],s:`替换`}},"editor.extensions.search_and_replace.replace_all":{t:0,b:{t:2,i:[{t:3}],s:`全部替换`}},"editor.extensions.search_and_replace.case_sensitive":{t:0,b:{t:2,i:[{t:3}],s:`区分大小写`}},"editor.extensions.search_and_replace.match_word":{t:0,b:{t:2,i:[{t:3}],s:`全字匹配`}},"editor.extensions.search_and_replace.use_regex":{t:0,b:{t:2,i:[{t:3}],s:`使用正则表达式`}},"editor.extensions.search_and_replace.close":{t:0,b:{t:2,i:[{t:3}],s:`关闭`}},"editor.extensions.format_brush.toolbar_item.title":{t:0,b:{t:2,i:[{t:3}],s:`格式刷`}},"editor.extensions.format_brush.toolbar_item.cancel":{t:0,b:{t:2,i:[{t:3}],s:`取消格式刷`}},"editor.extensions.details.command_item":{t:0,b:{t:2,i:[{t:3}],s:`折叠内容`}},"editor.extensions.gallery.title":{t:0,b:{t:2,i:[{t:3}],s:`图片集`}},"editor.extensions.gallery.add_image":{t:0,b:{t:2,i:[{t:3}],s:`添加图片`}},"editor.extensions.gallery.empty_prompt":{t:0,b:{t:2,i:[{t:3}],s:`点击选择图片或拖拽图片到这里`}},"editor.extensions.gallery.group_size":{t:0,b:{t:2,i:[{t:3}],s:`每行图片数`}},"editor.extensions.gallery.group_size_label":{t:0,b:{t:2,i:[{t:3,v:`每行 `},{t:4,k:`count`},{t:3,v:` 张图片`}]}},"editor.extensions.gallery.layout.title":{t:0,b:{t:2,i:[{t:3}],s:`布局`}},"editor.extensions.gallery.layout.auto":{t:0,b:{t:2,i:[{t:3}],s:`自适应`}},"editor.extensions.gallery.layout.square":{t:0,b:{t:2,i:[{t:3}],s:`等比矩形`}},"editor.extensions.gallery.gap":{t:0,b:{t:2,i:[{t:3}],s:`间距`}},"editor.extensions.upload.error":{t:0,b:{t:2,i:[{t:3}],s:`上传失败`}},"editor.extensions.upload.click_retry":{t:0,b:{t:2,i:[{t:3}],s:`点击重试`}},"editor.extensions.upload.loading":{t:0,b:{t:2,i:[{t:3}],s:`上传中`}},"editor.extensions.upload.attachment.title":{t:0,b:{t:2,i:[{t:3}],s:`附件库`}},"editor.extensions.upload.permalink.title":{t:0,b:{t:2,i:[{t:3}],s:`输入链接`}},"editor.extensions.upload.permalink.placeholder":{t:0,b:{t:2,i:[{t:3}],s:`输入链接,按回车确定`}},"editor.extensions.upload.operations.remove.button":{t:0,b:{t:2,i:[{t:3}],s:`删除`}},"editor.extensions.upload.operations.replace.button":{t:0,b:{t:2,i:[{t:3}],s:`替换`}},"editor.extensions.upload.operations.transfer.button":{t:0,b:{t:2,i:[{t:3}],s:`转存`}},"editor.extensions.upload.operations.transfer.tooltip":{t:0,b:{t:2,i:[{t:3}],s:`检测到此资源为外部资源,点击此按钮以转存到附件库`}},"editor.extensions.upload.operations.transfer_in_batch.description":{t:0,b:{t:2,i:[{t:3}],s:`检测到外部链接,是否需要自动上传到附件库?`}},"editor.extensions.font_size.title":{t:0,b:{t:2,i:[{t:3}],s:`字体大小`}},"editor.components.color_picker.more_color":{t:0,b:{t:2,i:[{t:3}],s:`更多颜色`}},"editor.common.alt":{t:0,b:{t:2,i:[{t:3}],s:`替代文本`}},"editor.common.width":{t:0,b:{t:2,i:[{t:3}],s:`宽度`}},"editor.common.height":{t:0,b:{t:2,i:[{t:3}],s:`高度`}},"editor.common.align_method":{t:0,b:{t:2,i:[{t:3}],s:`对齐方式`}},"editor.common.align_left":{t:0,b:{t:2,i:[{t:3}],s:`左对齐`}},"editor.common.align_center":{t:0,b:{t:2,i:[{t:3}],s:`居中`}},"editor.common.align_right":{t:0,b:{t:2,i:[{t:3}],s:`右对齐`}},"editor.common.align_justify":{t:0,b:{t:2,i:[{t:3}],s:`两端对齐`}},"editor.common.bold":{t:0,b:{t:2,i:[{t:3}],s:`粗体`}},"editor.common.italic":{t:0,b:{t:2,i:[{t:3}],s:`斜体`}},"editor.common.underline":{t:0,b:{t:2,i:[{t:3}],s:`下划线`}},"editor.common.strike":{t:0,b:{t:2,i:[{t:3}],s:`删除线`}},"editor.common.quote":{t:0,b:{t:2,i:[{t:3}],s:`引用`}},"editor.common.code":{t:0,b:{t:2,i:[{t:3}],s:`行内代码`}},"editor.common.superscript":{t:0,b:{t:2,i:[{t:3}],s:`上角标`}},"editor.common.subscript":{t:0,b:{t:2,i:[{t:3}],s:`下角标`}},"editor.common.codeblock.title":{t:0,b:{t:2,i:[{t:3}],s:`代码块`}},"editor.common.codeblock.copy_code":{t:0,b:{t:2,i:[{t:3}],s:`复制代码`}},"editor.common.codeblock.copy_code_success":{t:0,b:{t:2,i:[{t:3}],s:`复制成功`}},"editor.common.image":{t:0,b:{t:2,i:[{t:3}],s:`图片`}},"editor.common.heading.title":{t:0,b:{t:2,i:[{t:3}],s:`文本类型`}},"editor.common.heading.paragraph":{t:0,b:{t:2,i:[{t:3}],s:`普通文本`}},"editor.common.heading.heading1":{t:0,b:{t:2,i:[{t:3}],s:`一级标题`}},"editor.common.heading.heading2":{t:0,b:{t:2,i:[{t:3}],s:`二级标题`}},"editor.common.heading.heading3":{t:0,b:{t:2,i:[{t:3}],s:`三级标题`}},"editor.common.heading.heading4":{t:0,b:{t:2,i:[{t:3}],s:`四级标题`}},"editor.common.heading.heading5":{t:0,b:{t:2,i:[{t:3}],s:`五级标题`}},"editor.common.heading.heading6":{t:0,b:{t:2,i:[{t:3}],s:`六级标题`}},"editor.common.list":{t:0,b:{t:2,i:[{t:3}],s:`列表`}},"editor.common.bullet_list":{t:0,b:{t:2,i:[{t:3}],s:`无序列表`}},"editor.common.ordered_list":{t:0,b:{t:2,i:[{t:3}],s:`有序列表`}},"editor.common.task_list":{t:0,b:{t:2,i:[{t:3}],s:`任务列表`}},"editor.common.highlight":{t:0,b:{t:2,i:[{t:3}],s:`高亮`}},"editor.common.color":{t:0,b:{t:2,i:[{t:3}],s:`字体颜色`}},"editor.common.tooltip.custom_width_input":{t:0,b:{t:2,i:[{t:3}],s:`自定义宽度,按回车键生效`}},"editor.common.tooltip.custom_height_input":{t:0,b:{t:2,i:[{t:3}],s:`自定义高度,按回车键生效`}},"editor.common.tooltip.open_link":{t:0,b:{t:2,i:[{t:3}],s:`打开链接`}},"editor.common.placeholder.link_input":{t:0,b:{t:2,i:[{t:3}],s:`输入链接,按回车确定`}},"editor.common.placeholder.alt_input":{t:0,b:{t:2,i:[{t:3}],s:`输入图片 alt 属性值,按回车确认`}},"editor.common.placeholder.alt_href":{t:0,b:{t:2,i:[{t:3}],s:`输入图片跳转链接,按回车确认`}},"editor.common.button.new_line":{t:0,b:{t:2,i:[{t:3}],s:`换行`}},"editor.common.button.delete":{t:0,b:{t:2,i:[{t:3}],s:`删除`}},"editor.common.button.edit_link":{t:0,b:{t:2,i:[{t:3}],s:`修改链接`}},"editor.common.button.refresh":{t:0,b:{t:2,i:[{t:3}],s:`刷新`}},"editor.common.button.restore_default":{t:0,b:{t:2,i:[{t:3}],s:`恢复为默认`}},"editor.common.button.add":{t:0,b:{t:2,i:[{t:3}],s:`添加`}},"editor.common.button.cancel":{t:0,b:{t:2,i:[{t:3}],s:`取消`}},"editor.common.button.upload":{t:0,b:{t:2,i:[{t:3}],s:`上传`}},"editor.common.button.confirm":{t:0,b:{t:2,i:[{t:3}],s:`确定`}},"editor.common.text.default":{t:0,b:{t:2,i:[{t:3}],s:`默认`}},"editor.common.text.tip":{t:0,b:{t:2,i:[{t:3}],s:`提示`}},"editor.common.toast.save_success":{t:0,b:{t:2,i:[{t:3}],s:`保存成功`}},"editor.common.line_height":{t:0,b:{t:2,i:[{t:3}],s:`行高`}},"editor.common.clear_format":{t:0,b:{t:2,i:[{t:3}],s:`清除格式`}}},q=Vg({legacy:!1,locale:`en`,fallbackLocale:`en`,messages:{en:e_,zh:n_,es:t_,"en-US":e_,"zh-CN":n_,"es-ES":t_}});function r_(e){return encodeURIComponent(String(e).trim().toLowerCase().replace(/\s+/g,`-`))}var i_=(e,t)=>{let n=r_(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 a_(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 o_={encodeCharacter:e=>e,encodeNodeStart:e=>e.type.name,encodeNodeEnd:e=>-a_(e.type),compareTokens:(e,t)=>e===t};function s_(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)),s_(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 c_=5e3;function l_(e,t){return Math.min(15,Math.max(2,Math.floor(Math.max(e,t)/10)))}function u_(e,t,n,r=o_){let i=s_(e,r,n.fromA,n.toA,[]),a=s_(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(c_,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=l_(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 d_=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}};d_.none=[];var f_=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,d_.slice(this.deleted,t,n),d_.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=d_.none,h=d_.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=d_.join(m,s.deleted,r),d+=s.lenA,g=!0),f&&!v&&(h=d_.join(h,d_.slice(s.inserted,l-s.fromB,u-s.fromB),r),p+=u-l),v&&l==c.fromA&&!_&&(h=d_.join(h,c.inserted,r),p+=c.lenB,_=!0),v&&!f&&(m=d_.join(m,d_.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))}}},p_;try{p_=RegExp(`[\\p{Alphabetic}_]`,`u`)}catch{}var m_=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function h_(e){if(e<128)return e>=48&&e<=57||e>=65&&e<=90||e>=79&&e<=122;let t=String.fromCharCode(e);return p_?p_.test(t):t.toUpperCase()!=t.toLowerCase()||m_.test(t)}function g_(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 __=30;function v_(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+__;)i=e[++r].toB;y_(e,a,r+1,t,n)}return n}function y_(e,t,n,r,i){let a=Math.max(0,e[t].fromB-__),o=Math.min(r.content.size,e[n-1].toB+__),s=g_(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:h_(s.charCodeAt(c.toB-1-a));for(let r=c.toB;!i&&r<n.fromB;r++){let n=r==o?!1:h_(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&&h_(s.charCodeAt(n-a)))for(;n>a&&h_(s.charCodeAt(n-1-a));)n--;if(c>a&&h_(s.charCodeAt(c-1-a)))for(;c<o&&h_(s.charCodeAt(c-a));)c++;let l=x_(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 f_(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 b_(e,t){return e===t?e:null}function x_(e,t,n){let r=e[0].fromA-(e[0].fromB-t),i=e[e.length-1],a=i.toA+(n-i.toB),o=d_.none,s=d_.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=d_.join(o,[new d_(r-i,c)],b_)),f>u&&(s=d_.join(s,[new d_(f-u,l)],b_)),!t)break;o=d_.join(o,t.deleted,b_),s=d_.join(s,t.inserted,b_),o.length&&(c=o[o.length-1].data),s.length&&(l=s[s.length-1].data),i=t.toA,u=t.toB}return new f_(r,a,t,n,o,s)}var S_=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 f_(e+a,n+a,r,o,e==n?d_.none:[new d_(n-e,t)],r==o?d_.none:[new d_(o-r,t)])),a=o-r-(n-e)})}if(i.length==0)return this;let a=C_(i,this.config.combine),o=f_.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=u_(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 d_(e.length,n)};return new e(this.config,this.changes.map(e=>new f_(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&&T_(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&&E_(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=o_){return new e({combine:n,doc:t,encoder:r},[])}};S_.computeDiff=u_;function C_(e,t,n=0,r=e.length){if(r==n+1)return[e[n]];let i=n+r>>1;return f_.merge(C_(e,t,n,i),C_(e,t,i,r),t)}function w_(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 T_(e){let t=w_(e);if(!t)return null;let n=w_(e.map(e=>e.invert()).reverse());return{fromA:n.from,toA:n.to,fromB:t.from,toB:t.to}}function E_(e,t,n){return n(e.fromB)==t.fromB&&n(e.toB)==t.toB&&D_(e.deleted,t.deleted)&&D_(e.inserted,t.inserted)}function D_(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 O_=class{constructor(e,t,n){this.step=e,this.inverted=t,this.origin=n}};function k_(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 O_(a,a.invert(n.docs[n.docs.length-1]),e[t].origin)))}return r}var A_=class{constructor(e,t){this.version=e,this.unconfirmed=t}};function j_(e){let t=[];for(let n=0;n<e.steps.length;n++)t.push(new O_(e.steps[n],e.steps[n].invert(e.docs[n]),e));return t}var M_=new F(`collab`);function N_(e={}){let t={version:e.version||0,clientID:e.clientID==null?Math.floor(Math.random()*4294967295):e.clientID};return new P({key:M_,state:{init:()=>new A_(t.version,[]),apply(e,t){return e.getMeta(M_)||(e.docChanged?new A_(t.version,t.unconfirmed.concat(j_(e))):t)}},config:t,historyPreserveItems:!0})}function P_(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 A_(a,c));let l=c.length,u=e.tr;if(l)c=k_(c,t,u);else{for(let e=0;e<t.length;e++)u.step(t[e]);c=[]}let d=new A_(a,c);return r&&r.mapSelectionBackward&&e.selection instanceof M&&(u.setSelection(M.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 F_(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 I_(e){return M_.getState(e).version}function L_(e={}){return new P({view(t){return new R_(t,e)}})}var R_=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=xn(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)}},z_=class e extends j{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):j.near(r)}content(){return A.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 B_(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!V_(e)||!H_(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&&!N.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}}};z_.prototype.visible=!1,z_.findFrom=z_.findGapCursorFrom,j.jsonID(`gapcursor`,z_);var B_=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 z_.valid(t)?new z_(t):j.near(t)}};function V_(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 H_(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 U_(){return new P({props:{decorations:J_,createSelectionBetween(e,t,n){return t.pos==n.pos&&z_.valid(n)?new z_(n):null},handleClick:K_,handleKeyDown:W_,handleDOMEvents:{beforeinput:q_}}})}var W_=Kc({ArrowLeft:G_(`horiz`,-1),ArrowRight:G_(`horiz`,1),ArrowUp:G_(`vert`,-1),ArrowDown:G_(`vert`,1)});function G_(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 M){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=z_.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new z_(c))),!0):!1}}function K_(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!z_.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&N.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new z_(r))),!0)}function q_(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof z_))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=O.empty;for(let e=r.length-1;e>=0;e--)i=O.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new A(i,0,0));return a.setSelection(M.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function J_(e){if(!(e.selection instanceof z_))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,I.create(e.doc,[Vs.widget(e.selection.head,t,{key:`gapcursor`})])}var Y_=200,X_=function(){};X_.prototype.append=function(e){return e.length?(e=X_.from(e),!this.length&&e||e.length<Y_&&this.leafAppend(e)||this.length<Y_&&e.leafPrepend(this)||this.appendInner(e)):this},X_.prototype.prepend=function(e){return e.length?X_.from(e).append(this):this},X_.prototype.appendInner=function(e){return new Q_(this,e)},X_.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?X_.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},X_.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},X_.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)},X_.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},X_.from=function(e){return e instanceof X_?e:e&&e.length?new Z_(e):X_.empty};var Z_=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<=Y_)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Y_)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}(X_);X_.empty=new Z_([]);var Q_=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}(X_),$_=X_,ev=500,tv=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 rv(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 rv(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 rv(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>av&&(s=nv(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Rt;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 rv(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 rv(i,o,l))}else r.push(new rv(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new rv(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>ev&&(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 rv(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($_.from(i.reverse()),a)}};tv.empty=new tv($_.empty,0);function nv(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var rv=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)}}},iv=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},av=20;function ov(e,t,n,r){let i=n.getMeta(hv),a;if(i)return i.historyState;n.getMeta(gv)&&(e=new iv(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(hv))return o.getMeta(hv).redo?new iv(e.done.addTransform(n,void 0,r,pv(t)),e.undone,cv(n.mapping.maps),e.prevTime,e.prevComposition):new iv(e.done,e.undone.addTransform(n,void 0,r,pv(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||!sv(n,e.prevRanges)),s=o?lv(e.prevRanges,n.mapping):cv(n.mapping.maps);return new iv(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,pv(t)),tv.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new iv(e.done.rebased(n,a),e.undone.rebased(n,a),lv(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new iv(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),lv(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function sv(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 cv(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 lv(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 uv(e,t,n){let r=pv(t),i=hv.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 iv(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(hv,{redo:n,historyState:c})}var dv=!1,fv=null;function pv(e){let t=e.plugins;if(fv!=t){dv=!1,fv=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){dv=!0;break}}return dv}function mv(e){return e.setMeta(gv,!0)}var hv=new F(`history`),gv=new F(`closeHistory`);function _v(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new P({key:hv,state:{init(){return new iv(tv.empty,tv.empty,null,0,-1)},apply(t,n,r){return ov(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?yv:n==`historyRedo`?bv:null;return r?(t.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function vv(e,t){return(n,r)=>{let i=hv.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=uv(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var yv=vv(!1,!0),bv=vv(!0,!0),xv=vv(!1,!1),Sv=vv(!0,!1);function Cv(e){let t=hv.getState(e);return t?t.done.eventCount:0}function wv(e){let t=hv.getState(e);return t?t.undone.eventCount:0}var Tv=class{constructor(e,t,n={}){this.match=e,this.match=e,this.handler=typeof t==`string`?Ev(t):t,this.undoable=n.undoable!==!1,this.inCode=n.inCode||!1}};function Ev(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 Dv=500;function Ov({rules:e}){let t=new P({state:{init(){return null},apply(e,t){return e.getMeta(this)||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput(n,r,i,a){return kv(n,r,i,a,e,t)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&kv(n,r.pos,r.pos,``,e,t)})}}},isInputRules:!0});return t}function kv(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-Dv),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 Av=(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},jv=new Tv(/--$/,`—`),Mv=new Tv(/\.\.\.$/,`…`),Nv=new Tv(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,`“`),Pv=new Tv(/"$/,`”`),Fv=new Tv(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,`‘`),Iv=new Tv(/'$/,`’`),Lv=[Nv,Pv,Fv,Iv];function Rv(e,t,n=null,r){return new Tv(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&&nn(l,t,s);if(!u)return null;c.wrap(l,u);let d=c.doc.resolve(a-1).nodeBefore;return d&&d.type==t&&hn(c.doc,a-1)&&(!r||r(i,d))&&c.join(a-1),c})}function zv(e,t,n=null){return new Tv(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 Bv={};function Vv(e){let t=Bv[e];if(t)return t;t=Bv[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 Hv(e,t){typeof t!=`string`&&(t=Hv.defaultChars);let n=Vv(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})}Hv.defaultChars=`;/?:@&=+$,#`,Hv.componentChars=``;var Uv={};function Wv(e){let t=Uv[e];if(t)return t;t=Uv[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 Gv(e,t,n){typeof t!=`string`&&(n=t,t=Gv.defaultChars),n===void 0&&(n=!0);let r=Wv(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}Gv.defaultChars=`;/?:@&=+$,-_.!~*'()#`,Gv.componentChars=`-_.!~*'()`;function Kv(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 qv(){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 Jv=/^([a-z0-9.+-]+:)/i,Yv=/:[0-9]*$/,Xv=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Zv=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
|
|
105
|
+
`,` `],Qv=[`/`,`?`,`#`],$v=255,ey=/^[+a-z0-9A-Z_-]{0,63}$/,ty=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ny={javascript:!0,"javascript:":!0},ry={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function iy(e,t){if(e&&e instanceof qv)return e;let n=new qv;return n.parse(e,t),n}qv.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=Xv.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=Jv.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&&ny[o])&&(a=a.substr(2),this.slashes=!0)),!ny[o]&&(i||o&&!ry[o])){let e=-1;for(let t=0;t<Qv.length;t++)r=a.indexOf(Qv[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<Zv.length;t++)r=a.indexOf(Zv[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(ey)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(ey)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(ty);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>$v&&(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),ry[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},qv.prototype.parseHost=function(e){let t=Yv.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 ay=f({decode:()=>Hv,encode:()=>Gv,format:()=>Kv,parse:()=>iy}),oy=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,sy=/[\0-\x1F\x7F-\x9F]/,cy=/[\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]/,ly=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,uy=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,dy=f({Any:()=>oy,Cc:()=>sy,Cf:()=>cy,P:()=>ly,Z:()=>uy}),fy=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\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;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),py=new Uint16Array(`Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢`.split(``).map(e=>e.charCodeAt(0))),my=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]]),hy=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 gy(e){return e>=55296&&e<=57343||e>1114111?65533:my.get(e)??e}var _y;(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`})(_y||={});var vy=32,yy;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(yy||={});function by(e){return e>=_y.ZERO&&e<=_y.NINE}function xy(e){return e>=_y.UPPER_A&&e<=_y.UPPER_F||e>=_y.LOWER_A&&e<=_y.LOWER_F}function Sy(e){return e>=_y.UPPER_A&&e<=_y.UPPER_Z||e>=_y.LOWER_A&&e<=_y.LOWER_Z||by(e)}function Cy(e){return e===_y.EQUALS||Sy(e)}var wy;(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`})(wy||={});var Ty;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(Ty||={});var Ey=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=wy.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ty.Strict}startEntity(e){this.decodeMode=e,this.state=wy.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case wy.EntityStart:return e.charCodeAt(t)===_y.NUM?(this.state=wy.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=wy.NamedEntity,this.stateNamedEntity(e,t));case wy.NumericStart:return this.stateNumericStart(e,t);case wy.NumericDecimal:return this.stateNumericDecimal(e,t);case wy.NumericHex:return this.stateNumericHex(e,t);case wy.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|vy)===_y.LOWER_X?(this.state=wy.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=wy.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(by(r)||xy(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(by(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===_y.SEMI)this.consumed+=1;else if(this.decodeMode===Ty.Strict)return 0;return this.emitCodePoint(gy(this.result),this.consumed),this.errors&&(e!==_y.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&yy.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=Oy(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===Ty.Attribute&&(i===0||Cy(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&yy.VALUE_LENGTH)>>14,i!==0){if(a===_y.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Ty.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]&yy.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]&~yy.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case wy.NamedEntity:return this.result!==0&&(this.decodeMode!==Ty.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case wy.NumericDecimal:return this.emitNumericEntity(0,2);case wy.NumericHex:return this.emitNumericEntity(0,3);case wy.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case wy.EntityStart:return 0}}};function Dy(e){let t=``,n=new Ey(e,e=>t+=hy(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 Oy(e,t,n,r){let i=(t&yy.BRANCH_LENGTH)>>7,a=t&yy.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 ky=Dy(fy);Dy(py);function Ay(e,t=Ty.Legacy){return ky(e,t)}var jy=f({arrayReplaceAt:()=>Ly,assign:()=>Iy,escapeHtml:()=>Xy,escapeRE:()=>Qy,fromCodePoint:()=>zy,has:()=>Fy,isMdAsciiPunct:()=>nb,isPunctChar:()=>tb,isSpace:()=>$y,isString:()=>Ny,isValidEntityCode:()=>Ry,isWhiteSpace:()=>eb,lib:()=>ib,normalizeReference:()=>rb,unescapeAll:()=>Gy,unescapeMd:()=>Wy});function My(e){return Object.prototype.toString.call(e)}function Ny(e){return My(e)===`[object String]`}var Py=Object.prototype.hasOwnProperty;function Fy(e,t){return Py.call(e,t)}function Iy(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 Ly(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Ry(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 zy(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 By=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Vy=RegExp(By.source+`|&([a-z#][a-z0-9]{1,31});`,`gi`),Hy=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Uy(e,t){if(t.charCodeAt(0)===35&&Hy.test(t)){let n=t[1].toLowerCase()===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Ry(n)?zy(n):e}let n=Ay(e);return n===e?e:n}function Wy(e){return e.indexOf(`\\`)<0?e:e.replace(By,`$1`)}function Gy(e){return e.indexOf(`\\`)<0&&e.indexOf(`&`)<0?e:e.replace(Vy,function(e,t,n){return t||Uy(e,n)})}var Ky=/[&<>"]/,qy=/[&<>"]/g,Jy={"&":`&`,"<":`<`,">":`>`,'"':`"`};function Yy(e){return Jy[e]}function Xy(e){return Ky.test(e)?e.replace(qy,Yy):e}var Zy=/[.?*+^$[\]\\(){}|-]/g;function Qy(e){return e.replace(Zy,`\\$&`)}function $y(e){switch(e){case 9:case 32:return!0}return!1}function eb(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 tb(e){return ly.test(e)}function nb(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 rb(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}var ib={mdurl:ay,ucmicro:dy};function ab(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 ob(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=Gy(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=Gy(e.slice(t,i)),a.pos=i,a.ok=!0,a)}function sb(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=Gy(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 cb=f({parseLinkDestination:()=>ob,parseLinkLabel:()=>ab,parseLinkTitle:()=>sb}),lb={};lb.code_inline=function(e,t,n,r,i){let a=e[t];return`<code`+i.renderAttrs(a)+`>`+Xy(a.content)+`</code>`},lb.code_block=function(e,t,n,r,i){let a=e[t];return`<pre`+i.renderAttrs(a)+`><code>`+Xy(e[t].content)+`</code></pre>
|
|
106
|
+
`},lb.fence=function(e,t,n,r,i){let a=e[t],o=a.info?Gy(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)||Xy(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`},lb.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)},lb.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|
|
108
|
+
`:`<br>
|
|
109
|
+
`},lb.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
110
|
+
`:`<br>
|
|
111
|
+
`:`
|
|
112
|
+
`},lb.text=function(e,t){return Xy(e[t].content)},lb.html_block=function(e,t){return e[t].content},lb.html_inline=function(e,t){return e[t].content};function ub(){this.rules=Iy({},lb)}ub.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return``;for(r=``,t=0,n=e.attrs.length;t<n;t++)r+=` `+Xy(e.attrs[t][0])+`="`+Xy(e.attrs[t][1])+`"`;return r},ub.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},ub.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},ub.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},ub.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};function db(){this.__rules__=[],this.__cache__=null}db.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},db.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))})})},db.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},db.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},db.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},db.prototype.push=function(e,t,n){let r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},db.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},db.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},db.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},db.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function fb(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}fb.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},fb.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},fb.prototype.attrSet=function(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},fb.prototype.attrGet=function(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n},fb.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};function pb(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}pb.prototype.Token=fb;var mb=/\r\n?|\n/g,hb=/\0/g;function gb(e){let t;t=e.src.replace(mb,`
|
|
116
|
+
`),t=t.replace(hb,`�`),e.src=t}function _b(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 vb(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 yb(e){return/^<a[>\s]/i.test(e)}function bb(e){return/^<\/a\s*>/i.test(e)}function xb(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`&&(yb(o.content)&&i>0&&i--,bb(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=Ly(r,a,c)}}}}var Sb=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Cb=/\((c|tm|r)\)/i,wb=/\((c|tm|r)\)/gi,Tb={c:`©`,r:`®`,tm:`™`};function Eb(e,t){return Tb[t.toLowerCase()]}function Db(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(wb,Eb)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function Ob(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&Sb.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 kb(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(Cb.test(e.tokens[t].content)&&Db(e.tokens[t].children),Sb.test(e.tokens[t].content)&&Ob(e.tokens[t].children))}var Ab=/['"]/,jb=/['"]/g,Mb=`’`;function Nb(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function Pb(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;){jb.lastIndex=c;let u=jb.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=nb(m)||tb(String.fromCharCode(m)),_=nb(h)||tb(String.fromCharCode(h)),v=eb(m),y=eb(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=Nb(a.content,u.index,Mb));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=Nb(a.content,u.index,f),e[d.token].content=Nb(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=Nb(a.content,u.index,Mb))}}}function Fb(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!==`inline`||!Ab.test(e.tokens[t].content)||Pb(e.tokens[t].children,e)}function Ib(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 Lb=[[`normalize`,gb],[`block`,_b],[`inline`,vb],[`linkify`,xb],[`replacements`,kb],[`smartquotes`,Fb],[`text_join`,Ib]];function Rb(){this.ruler=new db;for(let e=0;e<Lb.length;e++)this.ruler.push(Lb[e][0],Lb[e][1])}Rb.prototype.process=function(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)},Rb.prototype.State=pb;function zb(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($y(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}zb.prototype.push=function(e,t,n){let r=new fb(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},zb.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},zb.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},zb.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t&&$y(this.src.charCodeAt(e));e++);return e},zb.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!$y(this.src.charCodeAt(--e)))return e+1;return e},zb.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},zb.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},zb.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($y(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(``)},zb.prototype.Token=fb;function Bb(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function Vb(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 Hb(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&&!$y(s)||o===45&&$y(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!$y(t))return!1;a++}let c=Bb(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=Bb(e,t).trim(),c.indexOf(`|`)===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=Vb(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=Bb(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4)break;if(l=Vb(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 Ub(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 Wb(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 Gb(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($y(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 Kb(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&&!$y(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 qb(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&&!$y(e.src.charCodeAt(r))?-1:r}function Jb(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),!$y(a))?-1:i}function Yb(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 Xb(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=Jb(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=qb(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=Jb(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=qb(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&&Yb(e,h),!0}function Zb(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(!$y(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(!$y(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&&$y(d.charCodeAt(a));)a++;if(a<o&&d.charCodeAt(a)!==10&&y)for(y=``,a=h,i=g;a<o&&$y(d.charCodeAt(a));)a++;if(a<o&&d.charCodeAt(a)!==10)return!1;let b=rb(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 Qb=`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(`.`),$b=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,ex=RegExp(`^(?:`+$b+`|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>|<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->|<[?][\\s\\S]*?[?]>|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),tx=RegExp(`^(?:`+$b+`|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>)`),nx=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(`+Qb.join(`|`)+`)(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(tx.source+`\\s*$`),/^$/,!1]];function rx(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<nx.length&&!nx[s][0].test(o);s++);if(s===nx.length)return!1;if(r)return nx[s][2];let c=t+1;if(!nx[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),nx[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 ix(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&&!$y(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&$y(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 ax(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 ox(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 sx=[[`table`,Hb,[`paragraph`,`reference`]],[`code`,Ub],[`fence`,Wb,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,Gb,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,Kb,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,Xb,[`paragraph`,`reference`,`blockquote`]],[`reference`,Zb],[`html_block`,rx,[`paragraph`,`reference`,`blockquote`]],[`heading`,ix,[`paragraph`,`reference`,`blockquote`]],[`lheading`,ax],[`paragraph`,ox]];function cx(){this.ruler=new db;for(let e=0;e<sx.length;e++)this.ruler.push(sx[e][0],sx[e][1],{alt:(sx[e][2]||[]).slice()})}cx.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)}},cx.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)},cx.prototype.State=zb;function lx(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}lx.prototype.pushPending=function(){let e=new fb(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e},lx.prototype.push=function(e,t,n){this.pending&&this.pushPending();let r=new fb(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},lx.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=nb(c)||tb(String.fromCharCode(c)),p=nb(d)||tb(String.fromCharCode(d)),m=eb(c),h=eb(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}},lx.prototype.Token=fb;function ux(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 dx(e,t){let n=e.pos;for(;n<e.posMax&&!ux(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var fx=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function px(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(fx);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 mx(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&&$y(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var hx=[];for(let e=0;e<256;e++)hx.push(0);`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``).forEach(function(e){hx[e.charCodeAt(0)]=1});function gx(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),$y(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&&hx[i]!==0?t.content=a:t.content=o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function _x(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 vx(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 yx(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 bx(e){let t=e.tokens_meta,n=e.tokens_meta.length;yx(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&yx(e,t[r].delimiters)}var xx={tokenize:vx,postProcess:bx};function Sx(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 Cx(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 wx(e){let t=e.tokens_meta,n=e.tokens_meta.length;Cx(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&Cx(e,t[r].delimiters)}var Tx={tokenize:Sx,postProcess:wx};function Ex(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),!(!$y(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),!(!$y(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),!(!$y(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[rb(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 Dx(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),!(!$y(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),!(!$y(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),!(!$y(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[rb(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 Ox=/^([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])?)*)$/,kx=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Ax(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(kx.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(Ox.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 jx(e){return/^<a[>\s]/i.test(e)}function Mx(e){return/^<\/a\s*>/i.test(e)}function Nx(e){let t=e|32;return t>=97&&t<=122}function Px(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&&!Nx(i))return!1;let a=e.src.slice(r).match(ex);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],jx(t.content)&&e.linkLevel++,Mx(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}var Fx=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Ix=/^&([a-z][a-z0-9]{1,31});/i;function Lx(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(Fx);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=Ry(t)?zy(t):zy(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(Ix);if(r){let n=Ay(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 Rx(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 zx(e){let t=e.tokens_meta,n=e.tokens_meta.length;Rx(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&Rx(t[e].delimiters)}function Bx(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 Vx=[[`text`,dx],[`linkify`,px],[`newline`,mx],[`escape`,gx],[`backticks`,_x],[`strikethrough`,xx.tokenize],[`emphasis`,Tx.tokenize],[`link`,Ex],[`image`,Dx],[`autolink`,Ax],[`html_inline`,Px],[`entity`,Lx]],Hx=[[`balance_pairs`,zx],[`strikethrough`,xx.postProcess],[`emphasis`,Tx.postProcess],[`fragments_join`,Bx]];function Ux(){this.ruler=new db;for(let e=0;e<Vx.length;e++)this.ruler.push(Vx[e][0],Vx[e][1]);this.ruler2=new db;for(let e=0;e<Hx.length;e++)this.ruler2.push(Hx[e][0],Hx[e][1])}Ux.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},Ux.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()},Ux.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)},Ux.prototype.State=lx;function Wx(e){let t={};e||={},t.src_Any=oy.source,t.src_Cc=sy.source,t.src_Z=uy.source,t.src_P=ly.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 Gx(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Kx(e){return Object.prototype.toString.call(e)}function qx(e){return Kx(e)===`[object String]`}function Jx(e){return Kx(e)===`[object Object]`}function Yx(e){return Kx(e)===`[object RegExp]`}function Xx(e){return Kx(e)===`[object Function]`}function Zx(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var Qx={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function $x(e){return Object.keys(e||{}).reduce(function(e,t){return e||Qx.hasOwnProperty(t)},!1)}var eS={"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}}},tS=`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]`,nS=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function rS(e){e.__index__=-1,e.__text_cache__=``}function iS(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function aS(){return function(e,t){t.normalize(e)}}function oS(e){let t=e.re=Wx(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(tS),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,Jx(n)){Yx(n.validate)?r.validate=iS(n.validate):Xx(n.validate)?r.validate=n.validate:a(t,n),Xx(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=aS();return}if(qx(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:aS()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(Zx).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`),rS(e)}function sS(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 cS(e,t){let n=new sS(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function lS(e,t){if(!(this instanceof lS))return new lS(e,t);t||$x(e)&&(t=e,e={}),this.__opts__=Gx({},Qx,t),this.__index__=-1,this.__last_index__=-1,this.__schema__=``,this.__text_cache__=``,this.__schemas__=Gx({},eS,e),this.__compiled__={},this.__tlds__=nS,this.__tlds_replaced__=!1,this.re={},oS(this)}lS.prototype.add=function(e,t){return this.__schemas__[e]=t,oS(this),this},lS.prototype.set=function(e){return this.__opts__=Gx(this.__opts__,e),this},lS.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},lS.prototype.pretest=function(e){return this.re.pretest.test(e)},lS.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},lS.prototype.match=function(e){let t=[],n=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(cS(this,n)),n=this.__last_index__);let r=n?e.slice(n):e;for(;this.test(r);)t.push(cS(this,n)),r=r.slice(this.__last_index__),n+=this.__last_index__;return t.length?t:null},lS.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,cS(this,0)):null},lS.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(),oS(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,oS(this),this)},lS.prototype.normalize=function(e){e.schema||(e.url=`http://`+e.url),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:`+e.url)},lS.prototype.onCompile=function(){};var uS=2147483647,dS=36,fS=1,pS=26,mS=38,hS=700,gS=72,_S=128,vS=`-`,yS=/^xn--/,bS=/[^\0-\x7F]/,xS=/[\x2E\u3002\uFF0E\uFF61]/g,SS={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},CS=dS-fS,wS=Math.floor,TS=String.fromCharCode;function ES(e){throw RangeError(SS[e])}function DS(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function OS(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(xS,`.`);let i=DS(e.split(`.`),t).join(`.`);return r+i}function kS(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 AS=e=>String.fromCodePoint(...e),jS=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:dS},MS=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},NS=function(e,t,n){let r=0;for(e=n?wS(e/hS):e>>1,e+=wS(e/t);e>CS*pS>>1;r+=dS)e=wS(e/CS);return wS(r+(CS+1)*e/(e+mS))},PS=function(e){let t=[],n=e.length,r=0,i=_S,a=gS,o=e.lastIndexOf(vS);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&ES(`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=dS;;i+=dS){s>=n&&ES(`invalid-input`);let o=jS(e.charCodeAt(s++));o>=dS&&ES(`invalid-input`),o>wS((uS-r)/t)&&ES(`overflow`),r+=o*t;let c=i<=a?fS:i>=a+pS?pS:i-a;if(o<c)break;let l=dS-c;t>wS(uS/l)&&ES(`overflow`),t*=l}let c=t.length+1;a=NS(r-o,c,o==0),wS(r/c)>uS-i&&ES(`overflow`),i+=wS(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},FS=function(e){let t=[];e=kS(e);let n=e.length,r=_S,i=0,a=gS;for(let n of e)n<128&&t.push(TS(n));let o=t.length,s=o;for(o&&t.push(vS);s<n;){let n=uS;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>wS((uS-i)/c)&&ES(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>uS&&ES(`overflow`),n===r){let e=i;for(let n=dS;;n+=dS){let r=n<=a?fS:n>=a+pS?pS:n-a;if(e<r)break;let i=e-r,o=dS-r;t.push(TS(MS(r+i%o,0))),e=wS(i/o)}t.push(TS(MS(e,0))),a=NS(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},IS={version:`2.3.1`,ucs2:{decode:kS,encode:AS},decode:PS,encode:FS,toASCII:function(e){return OS(e,function(e){return bS.test(e)?`xn--`+FS(e):e})},toUnicode:function(e){return OS(e,function(e){return yS.test(e)?PS(e.slice(4).toLowerCase()):e})}},LS={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`]}}}},RS=/^(vbscript|javascript|file|data):/,zS=/^data:image\/(gif|png|jpeg|webp);/;function BS(e){let t=e.trim().toLowerCase();return RS.test(t)?zS.test(t):!0}var VS=[`http:`,`https:`,`mailto:`];function HS(e){let t=iy(e,!0);if(t.hostname&&(!t.protocol||VS.indexOf(t.protocol)>=0))try{t.hostname=IS.toASCII(t.hostname)}catch{}return Gv(Kv(t))}function US(e){let t=iy(e,!0);if(t.hostname&&(!t.protocol||VS.indexOf(t.protocol)>=0))try{t.hostname=IS.toUnicode(t.hostname)}catch{}return Hv(Kv(t),Hv.defaultChars+`%`)}function WS(e,t){if(!(this instanceof WS))return new WS(e,t);t||Ny(e)||(t=e||{},e=`default`),this.inline=new Ux,this.block=new cx,this.core=new Rb,this.renderer=new ub,this.linkify=new lS,this.validateLink=BS,this.normalizeLink=HS,this.normalizeLinkText=US,this.utils=jy,this.helpers=Iy({},cb),this.options={},this.configure(e),t&&this.set(t)}WS.prototype.set=function(e){return Iy(this.options,e),this},WS.prototype.configure=function(e){let t=this;if(Ny(e)){let t=e;if(e=LS[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},WS.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},WS.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},WS.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},WS.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},WS.prototype.render=function(e,t){return t||={},this.renderer.render(this.parse(e,t),this.options,t)},WS.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},WS.prototype.renderInline=function(e,t){return t||={},this.renderer.render(this.parseInline(e,t),this.options,t)};var GS=new nt({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 KS(e,t){if(e.isText&&t.isText&&k.sameSet(e.marks,t.marks))return e.withText(e.text+t.text)}var qS=class{constructor(e,t){this.schema=e,this.tokenHandlers=t,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:k.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=KS(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:k.none})}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content)}};function JS(e,t,n,r){return e.getAttrs?e.getAttrs(t,n,r):e.attrs instanceof Function?e.attrs(t):e.attrs}function YS(e,t){return e.noCloseToken||t==`code_inline`||t==`code_block`||t==`fence`}function XS(e){return e[e.length-1]==`
|
|
118
|
+
`?e.slice(0,e.length-1):e}function ZS(){}function QS(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);YS(i,r)?n[r]=(e,n,r,a)=>{e.openNode(t,JS(i,n,r,a)),e.addText(XS(n.content)),e.closeNode()}:(n[r+`_open`]=(e,n,r,a)=>e.openNode(t,JS(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,JS(i,n,r,a))}else if(i.mark){let t=e.marks[i.mark];YS(i,r)?n[r]=(e,n,r,a)=>{e.openMark(t.create(JS(i,n,r,a))),e.addText(XS(n.content)),e.closeMark(t)}:(n[r+`_open`]=(e,n,r,a)=>e.openMark(t.create(JS(i,n,r,a))),n[r+`_close`]=e=>e.closeMark(t))}else if(i.ignore)YS(i,r)?n[r]=ZS:(n[r+`_open`]=ZS,n[r+`_close`]=ZS);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 $S=class{constructor(e,t,n){this.schema=e,this.tokenizer=t,this.tokens=n,this.tokenHandlers=QS(e,n)}parse(e,t={}){let n=new qS(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 eC(e,t){for(;++t<e.length;)if(e[t].type!=`list_item_open`)return e[t].hidden;return!1}var tC=new $S(GS,WS(`commonmark`,{html:!1}),{blockquote:{block:`blockquote`},paragraph:{block:`paragraph`},list_item:{block:`list_item`},bullet_list:{block:`bullet_list`,getAttrs:(e,t,n)=>({tight:eC(t,n)})},ordered_list:{block:`ordered_list`,getAttrs:(e,t,n)=>({order:+e.attrGet(`start`)||1,tight:eC(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}}),nC={open:``,close:``,mixable:!0},rC=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 sC(this.nodes,this.marks,t);return n.renderContent(e),n.out}},iC=new rC({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(`]/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=oC(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 aC(n.child(r),-1)},close(e,t,n,r){return aC(n.child(r-1),1)},escape:!1}});function aC(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 oC(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 sC=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=nC}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 cC(){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++)lC(e,arguments[t]);return e}function lC(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++)lC(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}var uC=`http://www.w3.org/2000/svg`,dC=`http://www.w3.org/1999/xlink`,fC=`ProseMirror-icon`;function pC(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t}function mC(e,t){let n=(e.nodeType==9?e:e.ownerDocument)||document,r=n.createElement(`div`);if(r.className=fC,t.path){let{path:i,width:a,height:o}=t,s=`pm-icon-`+pC(i).toString(16);n.getElementById(s)||hC(e,s,t);let c=r.appendChild(n.createElementNS(uC,`svg`));c.style.width=a/o+`em`,c.appendChild(n.createElementNS(uC,`use`)).setAttributeNS(dC,`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 hC(e,t,n){let[r,i]=e.nodeType==9?[e,e.body]:[e.ownerDocument||document,e],a=r.getElementById(fC+`-collection`);a||(a=r.createElementNS(uC,`svg`),a.id=fC+`-collection`,a.style.display=`none`,i.insertBefore(a,i.firstChild));let o=r.createElementNS(uC,`symbol`);o.id=t,o.setAttribute(`viewBox`,`0 0 `+n.width+` `+n.height),o.appendChild(r.createElementNS(uC,`path`)).setAttribute(`d`,n.path),a.appendChild(o)}var gC=`ProseMirror-menu`,_C=class{constructor(e){this.spec=e}render(e){let t=this.spec,n=t.render?t.render(e):t.icon?mC(e.root,t.icon):t.label?cC(`div`,null,vC(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`,vC(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(gC+`-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,IC(n,gC+`-disabled`,!r)),t.active){let i=r&&t.active(e)||!1;IC(n,gC+`-active`,i)}return!0}return{dom:n,update:r}}};function vC(e,t){return e._props.translate?e._props.translate(t):t}var yC={time:0,node:null};function bC(e){yC.time=Date.now(),yC.node=e.target}function xC(e){return Date.now()-100<yC.time&&yC.node&&e.contains(yC.node)}var SC=class{constructor(e,t={}){this.options=t,this.options=t||{},this.content=Array.isArray(e)?e:[e]}render(e){let t=CC(this.content,e),n=e.dom.ownerDocument.defaultView||window,r=cC(`div`,{class:gC+`-dropdown `+(this.options.class||``),style:this.options.css},vC(e,this.options.label||``));this.options.title&&r.setAttribute(`title`,vC(e,this.options.title));let i=cC(`div`,{class:gC+`-dropdown-wrap`},r),a=null,o=null,s=()=>{a&&a.close()&&(a=null,n.removeEventListener(`mousedown`,o))};r.addEventListener(`mousedown`,e=>{e.preventDefault(),bC(e),a?s():(a=this.expand(i,t.dom),n.addEventListener(`mousedown`,o=()=>{xC(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=cC(`div`,{class:gC+`-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 CC(e,t){let n=[],r=[];for(let i=0;i<e.length;i++){let{dom:a,update:o}=e[i].render(t);n.push(cC(`div`,{class:gC+`-dropdown-item`},a)),r.push(o)}return{dom:n,update:wC(r,n)}}function wC(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 TC=class{constructor(e,t={}){this.options=t,this.content=Array.isArray(e)?e:[e]}render(e){let t=CC(this.content,e),n=e.dom.ownerDocument.defaultView||window,r=cC(`div`,{class:gC+`-submenu-label`},vC(e,this.options.label||``)),i=cC(`div`,{class:gC+`-submenu-wrap`},r,cC(`div`,{class:gC+`-submenu`},t.dom)),a=null;r.addEventListener(`mousedown`,e=>{e.preventDefault(),bC(e),IC(i,gC+`-submenu-wrap-active`,!1),a||n.addEventListener(`mousedown`,a=()=>{xC(i)||(i.classList.remove(gC+`-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 EC(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=cC(`span`,{class:gC+`item`},r);n.appendChild(a),c.push(a),s.push(i)}s.length&&(r.push(wC(s,c)),a<t.length-1&&i.push(n.appendChild(DC())))}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 DC(){return cC(`span`,{class:gC+`separator`})}var OC={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`}},kC=new _C({title:`Join with above block`,run:Sr,select:e=>Sr(e),icon:OC.join}),AC=new _C({title:`Lift out of enclosing block`,run:wr,select:e=>wr(e),icon:OC.lift}),jC=new _C({title:`Select parent node`,run:Mr,select:e=>Mr(e),icon:OC.selectParentNode}),MC=new _C({title:`Undo last change`,run:yv,enable:e=>yv(e),icon:OC.undo}),NC=new _C({title:`Redo last undone change`,run:bv,enable:e=>bv(e),icon:OC.redo});function PC(e,t){let n={run(n,r){return zr(e,t.attrs)(n,r)},select(n){return zr(e,t.attrs)(n)}};for(let e in t)n[e]=t[e];return new _C(n)}function FC(e,t){let n=Br(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 _C(r)}function IC(e,t,n){n?e.classList.add(t):e.classList.remove(t)}var LC=`ProseMirror-menubar`;function RC(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent;return!/Edge\/\d/.test(e)&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e)}function zC(e){return new P({view(t){return new BC(t,e)}})}var BC=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=cC(`div`,{class:LC+`-wrapper`}),this.menu=this.wrapper.appendChild(cC(`div`,{class:LC})),this.menu.className=LC,e.dom.parentNode&&e.dom.parentNode.replaceChild(this.wrapper,e.dom),this.wrapper.appendChild(e.dom);let{dom:n,update:r}=EC(this.editorView,this.options.content);if(this.contentUpdate=r,this.menu.appendChild(n),this.update(),t.floating&&!RC()){this.updateFloat();let e=UC(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[VC(e)?0:t.length-1];if(!n)return;let r=this.menu.getBoundingClientRect();if(n.top<r.bottom&&n.bottom>r.top){let e=HC(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=cC(`div`,{class:LC+`-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 VC(e){return e.anchorNode==e.focusNode?e.anchorOffset>e.focusOffset:e.anchorNode.compareDocumentPosition(e.focusNode)==Node.DOCUMENT_POSITION_FOLLOWING}function HC(e){for(let t=e.parentNode;t;t=t.parentNode)if(t.scrollHeight>t.clientHeight)return t}function UC(e){let t=[e.ownerDocument.defaultView||window];for(let n=e.parentNode;n;n=n.parentNode)t.push(n);return t}var WC=[`p`,0],GC=[`blockquote`,0],KC=[`hr`],qC=[`pre`,[`code`,0]],JC=[`br`],YC={doc:{content:`block+`},paragraph:{content:`inline*`,group:`block`,parseDOM:[{tag:`p`}],toDOM(){return WC}},blockquote:{content:`block+`,group:`block`,defining:!0,parseDOM:[{tag:`blockquote`}],toDOM(){return GC}},horizontal_rule:{group:`block`,parseDOM:[{tag:`hr`}],toDOM(){return KC}},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 qC}},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 JC}}},XC=[`em`,0],ZC=[`strong`,0],QC=[`code`,0],$C={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 XC}},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 ZC}},code:{parseDOM:[{tag:`code`}],toDOM(){return QC}}},ew=new nt({nodes:YC,marks:$C}),tw,nw;if(typeof WeakMap<`u`){let e=new WeakMap;tw=t=>e.get(t),nw=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;tw=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},nw=(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 tw(e)||nw(e,rw(e))}};function rw(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=iw(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&&aw(s,o,e),s}function iw(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 aw(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||=ow(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function ow(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function sw(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 cw(e,t){let n={};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(`,`));for(let r in t){let i=t[r].setDOMAttr;i&&i(e.attrs[r],n)}return n}function lw(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 uw(e){let t=e.cellAttributes||{},n={colspan:{default:1,validate:`number`},rowspan:{default:1,validate:`number`},colwidth:{default:null,validate:lw}};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=>sw(e,t)}],toDOM(e){return[`td`,cw(e,t),0]}},table_header:{content:e.cellContent,attrs:n,tableRole:`header_cell`,isolating:!0,parseDOM:[{tag:`th`,getAttrs:e=>sw(e,t)}],toDOM(e){return[`th`,cw(e,t),0]}}}}function dw(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var fw=new F(`selectingCells`);function pw(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 mw(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 hw(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 gw(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=pw(t.$head)||_w(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function _w(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 vw(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function yw(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function bw(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function xw(e){return J.get(e.node(-1)).findCell(e.pos-e.start(-1))}function Sw(e){return J.get(e.node(-1)).colCount(e.pos-e.start(-1))}function Cw(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 ww(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 Tw(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 Ew(e,t,n){let r=dw(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 j{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 Hn(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(vw(r)&&vw(i)&&bw(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 M.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=ww(e,0,l)),u>0&&(e=ww(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(O.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new A(O.from(o),1,1)}replace(e,t=A.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?A.empty:t)}let i=j.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new A(O.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 Dw(this.$anchorCell.pos,this.$headCell.pos)}};Y.prototype.visible=!1,j.jsonID(`cell`,Y);var Dw=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&&bw(t,n)?new Y(t,n):j.near(n,1)}};function Ow(e){if(!(e.selection instanceof Y))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(Vs.node(n,n+e.nodeSize,{class:`selectedCell`}))}),I.create(e.doc,t)}function kw({$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 Aw({$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 jw(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof N&&(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 M&&kw(r)?a=M.create(i,r.from):r instanceof M&&Aw(r)&&(a=M.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var Mw=new F(`fix-tables`);function Nw(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)?Nw(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function Pw(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=Fw(e,t,r,n))};return t?t.doc!=e.doc&&Nw(t.doc,e.doc,0,r):e.doc.descendants(r),n}function Fw(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,ww(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=dw(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(Mw,{fixTables:!0})}function Iw(e){let t=e.selection,n=gw(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 Lw(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;Ew(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,Tw(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?dw(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 Rw(e,t){if(!hw(e))return!1;if(t){let n=Iw(e);t(Lw(e.tr,n,n.left))}return!0}function zw(e,t){if(!hw(e))return!1;if(t){let n=Iw(e);t(Lw(e.tr,n,n.right))}return!0}function Bw(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,ww(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 Vw(e,t){if(!hw(e))return!1;if(t){let n=Iw(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;Bw(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 Hw(e,t,n){let r=dw(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 Uw(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;Hw(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?dw(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,dw(r.type.schema).row.create(null,o)),e}function Ww(e,t){if(!hw(e))return!1;if(t){let n=Iw(e);t(Uw(e.tr,n,n.top))}return!0}function Gw(e,t){if(!hw(e))return!1;if(t){let n=Iw(e);t(Uw(e.tr,n,n.bottom))}return!0}function Kw(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 qw(e,t){if(!hw(e))return!1;if(t){let n=Iw(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;Kw(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 Jw(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Yw({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 Xw(e,t){let n=e.selection;if(!(n instanceof Y)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=Iw(e),{map:i}=r;if(Yw(i,r))return!1;if(t){let n=e.tr,a={},o=O.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{Jw(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,{...Tw(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=Jw(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 Zw(e,t){let n=dw(e.schema);return Qw(({node:e})=>n[e.type.spec.tableRole])(e,t)}function Qw(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=mw(r.$from),!i)return!1;a=pw(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=Iw(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 $w(e,t){return function(n,r){if(!hw(n))return!1;let i=gw(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 eT(e){return function(t,n){if(!hw(t))return!1;if(n){let r=dw(t.schema),i=Iw(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 tT(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 nT(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?eT(e):function(t,n){if(!hw(t))return!1;if(n){let r=dw(t.schema),i=Iw(t),a=t.tr,o=tT(`row`,i,r),s=tT(`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 rT=nT(`row`,{useDeprecatedLogic:!0}),iT=nT(`column`,{useDeprecatedLogic:!0}),aT=nT(`cell`,{useDeprecatedLogic:!0});function oT(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 sT(e){return function(t,n){if(!hw(t))return!1;let r=oT(gw(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(M.between(e,yw(e))).scrollIntoView())}return!0}}function cT(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 lT(e,t){let n=e.selection;if(!(n instanceof Y))return!1;if(t){let r=e.tr,i=dw(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 A(i,0,0))}),r.docChanged&&t(r)}return!0}function uT(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=fT(dw(o).row,new A(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?fT(dw(o).row,new A(t,n,r)).content:t);else return null;return dT(o,s)}function dT(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(O.empty),n[i]<r){let a=dw(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(O.from(o))}return{height:t.length,width:r,rows:t}}function fT(e,t){let n=e.createAndFill();return new Bn(n).replace(0,n.content.size,t).doc}function pT({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(ww(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(O.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(O.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function mT(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=dw(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,O.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 hT(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 gT(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,ww(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(ww(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function _T(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}mT(d,o,a,n,l,u,f)&&p(),hT(d,o,a,n,c,l,s,f)&&p(),hT(d,o,a,n,c,l,u,f)&&p(),gT(d,o,a,n,s,u,c,f)&&p(),gT(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 A(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 vT=Kc({ArrowLeft:bT(`horiz`,-1),ArrowRight:bT(`horiz`,1),ArrowUp:bT(`vert`,-1),ArrowDown:bT(`vert`,1),"Shift-ArrowLeft":xT(`horiz`,-1),"Shift-ArrowRight":xT(`horiz`,1),"Shift-ArrowUp":xT(`vert`,-1),"Shift-ArrowDown":xT(`vert`,1),Backspace:lT,"Mod-Backspace":lT,Delete:lT,"Mod-Delete":lT});function yT(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function bT(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof Y)return yT(n,r,j.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=TT(i,e,t);if(o==null)return!1;if(e==`horiz`)return yT(n,r,j.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=Cw(i,e,t),s;return s=a?j.near(a,1):t<0?j.near(n.doc.resolve(i.before(-1)),-1):j.near(n.doc.resolve(i.after(-1)),1),yT(n,r,s)}}}function xT(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof Y)o=a;else{let r=TT(i,e,t);if(r==null)return!1;o=new Y(n.doc.resolve(r))}let s=Cw(o.$headCell,e,t);return s?yT(n,r,new Y(o.$anchorCell,s)):!1}}function ST(e,t){let n=e.state.doc,r=pw(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new Y(r))),!0):!1}function CT(e,t,n){if(!hw(e.state))return!1;let r=uT(n),i=e.state.selection;if(i instanceof Y){r||={width:1,height:1,rows:[O.from(fT(dw(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=pT(r,o.right-o.left,o.bottom-o.top),_T(e.state,e.dispatch,a,o,r),!0}else if(r){let t=gw(e.state),n=t.start(-1);return _T(e.state,e.dispatch,n,J.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function wT(e,t){if(t.ctrlKey||t.metaKey)return;let n=ET(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=pw(e.state.selection.$anchor))!=null&&DT(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=DT(e,n),i=fw.getState(e.state)==null;if(!r||!bw(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(fw,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),fw.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(fw,-1))}function o(r){let o=r,s=fw.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(ET(e,o.target)!=n&&(c=DT(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 TT(e,t,n){if(!(e.state.selection instanceof M))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 ET(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function DT(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?pw(e.state.doc.resolve(n.pos)):null}var OT=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`)),kT(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,kT(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 kT(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 AT=new F(`tableColumnResizing`);function jT({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=OT,lastColumnResizable:i=!0}={}){let a=new P({key:AT,state:{init(e,t){let i=a.spec?.props?.nodeViews,o=dw(t.schema).table.name;return r&&i&&(i[o]=(e,t)=>new r(e,n,t)),new MT(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=AT.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{NT(t,n,e,i)},mouseleave:e=>{PT(e)},mousedown:(e,r)=>{FT(e,r,t,n)}},decorations:e=>{let t=AT.getState(e);if(t&&t.activeHandle>-1)return WT(e,t.activeHandle)},nodeViews:{}}});return a}var MT=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(AT);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 vw(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function NT(e,t,n,r){if(!e.editable)return;let i=AT.getState(e.state);if(i&&!i.dragging){let a=LT(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=RT(e,t,`left`,n):i-t.clientX<=n&&(o=RT(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}BT(e,o)}}}function PT(e){if(!e.editable)return;let t=AT.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&BT(e,-1)}function FT(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=AT.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=IT(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(AT,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=AT.getState(e.state);r?.dragging&&(VT(e,r.activeHandle,zT(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(AT,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=AT.getState(e.state);if(i&&i.dragging){let a=zT(i.dragging,t,n);HT(e,i.activeHandle,a,r)}}return HT(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function IT(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 LT(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function RT(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=pw(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 zT(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function BT(e,t){e.dispatch(e.state.tr.setMeta(AT,{setHandle:t}))}function VT(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():UT(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function HT(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&&kT(a,c.firstChild,c,r,s,n)}function UT(e){return Array(e).fill(0)}function WT(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return I.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`,AT.getState(e)?.dragging&&n.push(Vs.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(Vs.widget(s,c))}}return I.create(e.doc,n)}function GT({allowTableNodeSelection:e=!1}={}){return new P({key:fw,state:{init(){return null},apply(e,t){let n=e.getMeta(fw);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:Ow,handleDOMEvents:{mousedown:wT},createSelectionBetween(e){return fw.getState(e.state)==null?null:e.state.selection},handleTripleClick:ST,handleKeyDown:vT,handlePaste:CT},appendTransaction(t,n,r){return jw(r,Pw(r,n),e)}})}var KT=new F(`trailingNode`);function qT(e){let{ignoredNodes:t=[],nodeName:n=`paragraph`}=e??{},r=new Set([...t,n]),i,a;return new P({key:KT,appendTransaction(e,t,n){let{doc:r,tr:a}=n,o=KT.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 JT(e){return(0,t.customRef)((t,n)=>({get(){return t(),e},set(t){e=t,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var YT=class extends ff{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=JT(this.view.state),this.reactiveExtensionStorage=JT(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}},XT=(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?.parentNode)return;let e=(0,t.unref)(n.value);n.value.append(...i.view.dom.parentNode.childNodes),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}})}}),ZT=(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":``})}}),QT=(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))}}),$T=(e={})=>{let n=(0,t.shallowRef)();return(0,t.onMounted)(()=>{n.value=new YT(e)}),(0,t.onBeforeUnmount)(()=>{var e,t;let r=n.value?.view.dom?.parentNode,i=r?.cloneNode(!0);(e=r?.parentNode)==null||e.replaceChild(i,r),(t=n.value)==null||t.destroy()}),n},eE=class{constructor(e,{props:n={},editor:r}){this.destroyed=!1,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(){if(this.destroyed)return this.renderedComponent;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={}){this.destroyed||(Object.entries(e).forEach(([e,t])=>{this.props[e]=t}),this.renderComponent())}destroy(){this.destroyed||(this.destroyed=!0,this.renderedComponent.destroy())}},tE={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}},nE=(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":``})}}),rE=class extends Lf{constructor(e,n,r){super(e,n,r);let i={...n,updateAttributes:this.updateAttributes.bind(this)};this.renderer=new eE((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 iE(e,t={}){return n=>n.editor.contentComponent?new rE(e,n,t):{}}var aE={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}},oE=class extends Rf{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 eE(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 sE(e,t){return n=>n.editor.contentComponent?new oE(typeof e==`function`&&`__vccOpts`in e?e.__vccOpts:e,n,t):{}}function cE(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/`)?lE(e,{contentType:`image`,url:o,alt:a,caption:s}):i?.startsWith(`video/`)?lE(e,{contentType:`video`,url:o,caption:s}):i?.startsWith(`audio/`)?lE(e,{contentType:`audio`,url:o,caption:s}):{type:`text`,marks:[{type:`link`,attrs:{href:o}}],text:a||o}}).filter(Boolean)}function lE(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=Mu(i,e.extensionManager.extensions);a.content?.push({type:`figureCaption`,content:t.content[0].content})}return a}async function uE(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}}var dE=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(N.create(e.doc,e.pos)).deleteSelection(),!0}let n=e.pos;return n?(t.delete(n,n+e.node().nodeSize),!0):!1},fE=(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},pE=e=>{if(!e)return;let t=mE(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())},mE=e=>e.sort((e,t)=>{let n=L(e,`priority`)||100,r=L(t,`priority`)||100;return n>r?-1:n<r?1:0}),hE=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,gE=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function _E(e){return!e||e.replace(hE,``).match(gE)}var vE=e=>e.extensionManager.extensions.filter(e=>{let t=R(L(e,`group`,{name:e.name,options:e.options,storage:e.storage}));return typeof t==`string`?t.split(` `).includes(`list`):!1}).some(t=>Yu(e.state,t.name)),yE=e=>bE(e)||xE(e),bE=e=>{let t=e.type.createAndFill()?.toJSON(),n=e.toJSON();return JSON.stringify(t)===JSON.stringify(n)},xE=e=>{if(e.isTextblock)return e.textContent.length===0;if(e.childCount===0)return!0;let t=!0;return e.forEach(e=>{yE(e)||(t=!1)}),t},SE=e=>e.type.name===`paragraph`?e.textContent.length===0:!1,CE=e=>e.isTextblock?SE(e):!1,wE=()=>typeof navigator<`u`&&/Mac/.test(navigator.platform);function TE(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=EE(r);continue}switch(r.toLowerCase()){case`mod`:wE()?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 EE(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 DE(e,t){let n=TE(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 OE(e){let t=TE(e),n=[];wE()?(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),wE()?n.join(``):n.join(`+`)}function kE(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 AE(e,t,n){return e<t?n===`asc`?-1:1:e>t?n===`asc`?1:-1:0}function jE(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=AE(c?s(e):e[s],c?s(r):r[s],o);if(l!==0)return l}return 0})}function ME(e,t){return jE(e,t,[`asc`])}function NE(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function PE(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}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 typeof e==`object`&&!!e&&PE(e)===`[object Arguments]`}function RE(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function zE(e){return NE(e)}function BE(e){if(e==null)return!0;if(IE(e))return typeof e.splice!=`function`&&typeof e!=`string`&&(typeof Buffer>`u`||!Buffer.isBuffer(e))&&!zE(e)&&!LE(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 RE(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}var VE={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function HE(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,VE,[...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 UE=(0,t.markRaw)({name:`mdi-motion-play`,render:HE}),WE={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function GE(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,WE,[...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 KE=(0,t.markRaw)({name:`mdi-motion-play-outline`,render:GE}),qE={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function JE(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,qE,[...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 YE=(0,t.markRaw)({name:`mdi-play-circle`,render:JE}),XE={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function ZE(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,XE,[...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 QE=(0,t.markRaw)({name:`mdi-play-circle-outline`,render:ZE}),$E={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function eD(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,$E,[...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 tD=(0,t.markRaw)({name:`mingcute-link-line`,render:eD}),nD={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function rD(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,nD,[...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 iD=(0,t.markRaw)({name:`mingcute-music-2-line`,render:rD}),aD={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function oD(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,aD,[...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 sD=(0,t.markRaw)({name:`mingcute-share-3-line`,render:oD}),cD={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function lD(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,cD,[...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 uD=(0,t.markRaw)({name:`mingcute-delete-2-line`,render:lD}),dD=(0,t.defineComponent)({__name:`MingcuteDelete2Line`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(uD),{class:`text-red-600`}))}}),fD={class:`size-7 flex-none rounded bg-gray-100 p-1.5 group-hover:bg-white`},pD={class:`flex min-w-0 flex-1 shrink flex-col gap-0.5`},mD=[`title`],hD=[`title`],gD=(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`,fD,[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon),{class:`size-full`}))]),(0,t.createElementVNode)(`div`,pD,[(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,mD),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,hD)):(0,t.createCommentVNode)(``,!0)])]))}});function _D(e){return(0,t.getCurrentScope)()?((0,t.onScopeDispose)(e),!0):!1}function vD(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return _D(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t))),clear:()=>{e.clear()}}}var yD=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var bD=()=>{},xD=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function SD(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,yD&&u()),_D(l),{isPending:(0,t.readonly)(o),start:u,stop:l}}function CD(e=1e3,n={}){let{controls:r=!1,callback:i}=n,a=SD(i??bD,e,n),o=(0,t.computed)(()=>!a.isPending.value);return r?{ready:o,...a}:o}var wD=yD?window.document:void 0;yD&&window.navigator,yD&&window.location;var TD={multiple:!0,accept:`*`,reset:!1,directory:!1};function ED(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 DD(e={}){let{document:n=wD}=e,r=(0,t.ref)(ED(e.initialFiles)),{on:i,trigger:a}=vD(),{on:o,trigger:s}=vD(),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={...TD,...e,...t};c.multiple=n.multiple,c.accept=n.accept,c.webkitdirectory=n.directory,xD(n,`capture`)&&(c.capture=n.capture),n.reset&&l(),c.click()},reset:l,onCancel:o,onChange:i}}var OD={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function kD(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,OD,[...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 AD=(0,t.markRaw)({name:`mingcute-information-line`,render:kD}),jD={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`},MD=[`type`,`placeholder`],ND={key:2,class:`line-clamp-1 text-xs text-gray-500`},PD=(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`,jD,(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,MD),[[t.vModelDynamic,r.value,void 0,{lazy:!0,trim:!0}]]),e.tooltip?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(AD),{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`,ND,(0,t.toDisplayString)(e.help),1)):(0,t.createCommentVNode)(``,!0)],2)}}}),FD={class:`flex h-64 w-full items-center justify-center`},ID={key:2,class:`flex size-full cursor-pointer flex-col items-center justify-center border-2 border-dashed border-gray-300 bg-gray-50`},LD={class:`flex flex-col items-center justify-center space-y-7 pb-6 pt-5`},RD={key:0,class:`flex h-14 w-14 items-center justify-center rounded-full bg-primary/20`},zD={class:`w-80`},BD=(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}=DD({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),VK(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`,FD,[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`,ID,[(0,t.createElementVNode)(`div`,LD,[e.$slots.icon?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,RD,[(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)(q).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)(q).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`,zD,[(0,t.createVNode)(PD,{modelValue:c.value,"onUpdate:modelValue":i[3]||=e=>c.value=e,"auto-focus":``,placeholder:(0,t.unref)(q).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)(q).global.t(`editor.extensions.upload.permalink.title`)),1)]),_:1})]),_:1})]),_:1})])]))])],64)}}}),VD={class:`w-80`},HD=(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}=DD({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(`${q.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)(q).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)(q).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`,VD,[(0,t.createVNode)(PD,{"auto-focus":``,"model-value":e.originalLink,placeholder:(0,t.unref)(q).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)(q).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)(q).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 UD(e,a){let{globalInfo:o}=r.stores.globalInfo(),s=(0,t.computed)(()=>e.value?.startsWith(`/`)||!o?.externalUrl?!1:!e.value?.startsWith(o?.externalUrl)),c=(0,t.ref)(!1);async function l(){if(!e.value)return;c.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(q.global.t(`editor.common.toast.save_success`)),c.value=!1}return{isExternalAsset:s,transferring:c,handleTransfer:l}}var WD=` `,GD=`\xA0`,KD=V.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,z(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return r.length===1&&r[0].type===`text`&&(r[0].text===WD||r[0].text===GD)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t)=>{if(!e)return``;let n=Array.isArray(e.content)?e.content:[];return n.length===0?WD:t.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),qD={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function JD(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,qD,[...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 YD=(0,t.markRaw)({name:`mingcute-line-height-line`,render:JD}),XD=KD.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(XD.name)?.lineHeight,icon:(0,t.markRaw)(YD),title:q.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(XD.name)?.lineHeight===n,title:n?String(n):q.global.t(`editor.common.text.default`),action:()=>e.chain().focus().updateAttributes(XD.name,{lineHeight:n}).run()}}))}}}},addKeyboardShortcuts(){return{Backspace:({editor:e})=>{let{state:t,view:n}=e,{selection:r}=t;if(vE(e)||!Yu(t,XD.name)||!(r instanceof M)||!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0)return!1;let a=i.before(i.depth);return a===0?!0:QD(i,a,t,n.dispatch)}}}});function ZD(e,t,n,r){let{tr:i}=n;return dE(e)(i)&&r?(t!==0&&i.setSelection(M.near(i.doc.resolve(t-1),-1)),r(i),!0):!1}function QD(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===XD.name||!a.type.spec.allowGapCursor?!1:dE(e.doc.resolve(t-1))(i)?(r(i),!0):!1}var $D=class e extends j{constructor(e,t){tO(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 eO(this.anchor,this.head)}toJSON(){return{type:`range`,anchor:this.anchor,head:this.head}}static valid(e,t,n){let r=nO(e.doc.resolve(t),e.doc.resolve(n));return!(r.length===0||r.reverse()[0].pos<0)}static between(t,n){tO(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=nO(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))}};j.jsonID(`range`,$D);var eO=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 $D(e.resolve(this.anchor),e.resolve(this.head))}};function tO(e,t){e.pos===t.pos&&console.warn(`The RangeSelection cannot be empty.`)}function nO(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 rO={anchor:0,head:0,enable:!1},iO=B.create({priority:100,name:`rangeSelectionExtension`,addProseMirrorPlugins(){return[new P({key:new F(`rangeSelectionPlugin`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor;if(!n||!r||!(t instanceof $D))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(Vs.node(t,t+e.nodeSize,{class:`no-selection range-fake-selection`}))}),I.create(e,o)},createSelectionBetween:(e,t,n)=>t.pos===n.pos?null:$D.valid(e.state,t.pos,n.pos)?new $D(t,n):null,handleDOMEvents:{mousedown:(e,t)=>{let n={left:t.clientX,top:t.clientY},r=e.posAtCoords(n);!r||!r.pos||(rO.enable=!0,rO.anchor=r.pos)},mousemove:(e,t)=>{if(!rO.enable)return;let n={left:t.clientX,top:t.clientY},r=e.posAtCoords(n);if(!r||!r.pos||r.pos===rO.anchor||r.pos===rO.head)return;rO.head=r.pos;let i=$D.between(e.state.doc.resolve(rO.anchor),e.state.doc.resolve(rO.head));i&&e.dispatch(e.state.tr.setSelection(i))},mouseup:()=>{rO.enable=!1,rO.anchor=0,rO.head=0},mouseleave:()=>{rO.enable=!1,rO.anchor=0,rO.head=0}}}})]},addKeyboardShortcuts(){return{"Mod-a":({editor:e})=>(e.view.dispatch(e.view.state.tr.setSelection($D.allRange(e.view.state.doc))),!0)}},extendNodeSchema(e){return{fakeSelection:R(L(e,`fakeSelection`,{name:e.name,options:e.options,storage:e.storage}))??!1}}}),aO=(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)(QT),{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)(ZT))]),_:1},8,[`data-empty`,`data-placeholder`,`style`]))}}),oO=V.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||q.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(Yu(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(M.near(e.doc.resolve(s+1))),!0}).run(),!0}}},addProseMirrorPlugins(){let e=new F(`figureCaptionAutoDelete`);return[new P({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===oO.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===oO.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===oO.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`,z(this.options.HTMLAttributes,e),0]},addNodeView(){return sE(aO)}}),sO=V.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})}}},parseHTML(){return[{tag:`figure`}]},renderHTML({HTMLAttributes:e}){return[`figure`,z(this.options.HTMLAttributes,e,{style:`display: flex; flex-direction: column;`}),0]},addExtensions(){return[oO]},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===oO.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(M.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!==XD.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!==oO.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=$D.create(r,i,i+n.nodeSize),o=t.tr.setSelection(a);return e.view.dispatch(o),!0}l--}return!1}}},addProseMirrorPlugins(){return[new P({key:new F(`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!==XD.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=du(i.node(a),e=>e.type.name===oO.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}}}}),cO={key:0,class:`group relative`},lO=[`src`,`autoplay`,`loop`],uO={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`},dO={class:`relative w-full`},fO={class:`absolute top-0 size-full bg-black bg-opacity-20`},pO={class:`absolute top-[50%] w-full space-y-2 text-white`},mO={class:`px-10`},hO={class:`relative h-4 w-full overflow-hidden rounded-full bg-gray-200`},gO={class:`absolute left-[50%] top-0 -translate-x-[50%] text-xs leading-4 text-white`},_O={class:`absolute top-0 size-full bg-black bg-opacity-20`},vO={class:`absolute top-[50%] w-full space-y-2 text-white`},yO={class:`px-10`},bO={class:`relative h-4 w-full overflow-hidden rounded-full bg-gray-200`},xO={class:`absolute left-[50%] top-0 -translate-x-[50%] text-xs leading-4 text-white`},SO=(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)(()=>{let e=i.getPos();if(!e)return`start`;let t=pu(i.editor.state.doc.resolve(e),e=>e.type.name===sO.name);return t?t.node.attrs.alignItems:`start`}),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:_}=UD(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)(QT),{as:`div`,class:(0,t.normalizeClass)([`flex w-full`,{[`justify-${l.value}`]:!0}])},{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`,cO,[(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,lO),a.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,uO,[(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)(q).global.t(`editor.extensions.upload.operations.transfer.button`)),1)]),_:1},8,[`loading`,`onClick`])),[[b,(0,t.unref)(q).global.t(`editor.extensions.upload.operations.transfer.tooltip`)]]):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(HD),{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`,dO,[(0,t.createVNode)((0,t.unref)(BD),{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)(iD),{class:`text-xl text-primary`})]),uploading:(0,t.withCtx)(({progress:e})=>[(0,t.createElementVNode)(`div`,fO,[(0,t.createElementVNode)(`div`,pO,[(0,t.createElementVNode)(`div`,mO,[(0,t.createElementVNode)(`div`,hO,[(0,t.createElementVNode)(`div`,{class:`h-full bg-primary`,style:(0,t.normalizeStyle)({width:`${e||0}%`})},null,4),(0,t.createElementVNode)(`div`,gO,(0,t.toDisplayString)(e?`${e}%`:`${(0,t.unref)(q).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)(q).global.t(`editor.common.button.cancel`)),1)])])]),error:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,_O,[(0,t.createElementVNode)(`div`,vO,[(0,t.createElementVNode)(`div`,yO,[(0,t.createElementVNode)(`div`,bO,[y[0]||=(0,t.createElementVNode)(`div`,{class:`size-full bg-red-600`},null,-1),(0,t.createElementVNode)(`div`,xO,(0,t.toDisplayString)((0,t.unref)(q).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)(q).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`])}}}),CO={class:`w-80`},wO=(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(FK.name)?.src,set:e=>{n.editor.chain().updateAttributes(FK.name,{src:e}).setNodeSelection(n.editor.state.selection.from).focus().run()}});return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,CO,[(0,t.createVNode)(PD,{modelValue:r.value,"onUpdate:modelValue":n[0]||=e=>r.value=e,"auto-focus":``,placeholder:(0,t.unref)(q).global.t(`editor.common.placeholder.link_input`),label:(0,t.unref)(q).global.t(`editor.extensions.audio.src_input_label`)},null,8,[`modelValue`,`placeholder`,`label`])]))}}),TO={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function EO(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,TO,[...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 DO=(0,t.markRaw)({name:`mingcute-align-center-line`,render:EO}),OO={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function kO(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 AO=(0,t.markRaw)({name:`mingcute-align-left-line`,render:kO}),jO={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function MO(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,jO,[...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 NO=(0,t.markRaw)({name:`mingcute-align-right-line`,render:MO}),PO=[`title`],FO={key:0},IO=(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`,FO,(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,PO)),[[a,{content:e.title,distance:8,delay:{show:0}}]])}}}),LO={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function RO(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.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 zO=(0,t.markRaw)({name:`mingcute-align-justify-line`,render:RO}),BO={left:AO,center:DO,right:NO,justify:zO},VO={start:AO,center:DO,end:NO},HO=e=>{let t=AO;return Object.entries(BO).forEach(([n,r])=>{if(e.isActive({textAlign:n})){t=r;return}}),Object.entries(VO).forEach(([n,r])=>{if(e.isActive({alignItems:n})){t=r;return}}),t},UO=B.create({name:`align`,addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:180,component:(0,t.markRaw)(E),props:{editor:e,isActive:!1,icon:(0,t.markRaw)(HO(e)),title:q.global.t(`editor.common.align_method`)},children:[{priority:0,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive({textAlign:`left`})||e.isActive({alignItems:`start`}),icon:(0,t.markRaw)(AO),title:q.global.t(`editor.common.align_left`),action:()=>(console.log(e.isActive({textAlign:`left`}),e.isActive({alignItems:`start`})),e.chain().focus().setTextAlign(`left`).setBlockPosition(`start`).run())}},{priority:10,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive({textAlign:`center`})||e.isActive({alignItems:`center`}),icon:(0,t.markRaw)(DO),title:q.global.t(`editor.common.align_center`),action:()=>e.chain().focus().setTextAlign(`center`).setBlockPosition(`center`).run()}},{priority:20,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive({textAlign:`right`})||e.isActive({alignItems:`end`}),icon:(0,t.markRaw)(NO),title:q.global.t(`editor.common.align_right`),action:()=>e.chain().focus().setTextAlign(`right`).setBlockPosition(`end`).run()}},{priority:30,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive({textAlign:`justify`}),icon:(0,t.markRaw)(zO),title:q.global.t(`editor.common.align_justify`),action:()=>e.chain().focus().setTextAlign(`justify`).run()}}]}}}}}),WO=B.create({name:`blockPosition`,addOptions(){return{types:[],positions:[`start`,`center`,`end`],defaultPosition:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{alignItems:{default:this.options.defaultPosition,parseHTML:e=>{let t=e.style.alignItems;return this.options.positions.includes(t)?t:this.options.defaultPosition},renderHTML:e=>e.alignItems?{style:`align-items: ${e.alignItems}`}:{}}}}]},addCommands(){return{setBlockPosition:e=>({commands:t})=>this.options.positions.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{alignItems:e})).some(e=>e):!1,unsetBlockPosition:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,`alignItems`)).some(e=>e),toggleBlockPosition:e=>({editor:t,commands:n})=>this.options.positions.includes(e)?t.isActive({alignItems:e})?n.unsetBlockPosition():n.setBlockPosition(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setBlockPosition(`left`),"Mod-Shift-e":()=>this.editor.commands.setBlockPosition(`center`),"Mod-Shift-r":()=>this.editor.commands.setBlockPosition(`right`)}}}).configure({types:[`figure`],positions:[`start`,`center`,`end`]}),GO=(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]},KO=/^\s*>\s$/,qO=V.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return GO(`blockquote`,{...z(this.options.HTMLAttributes,e),children:GO(`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[_f({find:KO,type:this.type})]}}),JO={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function YO(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,JO,[...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 XO=(0,t.markRaw)({name:`mingcute-blockquote-line`,render:YO}),ZO=qO.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:90,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(qO.name),icon:(0,t.markRaw)(XO),title:q.global.t(`editor.common.quote`),action:()=>{e.commands.toggleBlockquote()}}}}}}}),QO=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,$O=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,ek=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,tk=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,nk=Vd.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 GO(`strong`,{...z(this.options.HTMLAttributes,e),children:GO(`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[pf({find:QO,type:this.type}),pf({find:ek,type:this.type})]},addPasteRules(){return[zf({find:$O,type:this.type}),zf({find:tk,type:this.type})]}}),rk={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function ik(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:`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 ak=(0,t.markRaw)({name:`mingcute-bold-line`,render:ik}),ok=nk.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:40,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(nk.name),icon:(0,t.markRaw)(ak),title:q.global.t(`editor.common.bold`),action:()=>{e.chain().focus().toggleBold().run()}}}}}}}),sk=Object.defineProperty,ck=(e,t)=>{for(var n in t)sk(e,n,{get:t[n],enumerable:!0})},lk=`listItem`,uk=`textStyle`,dk=/^\s*([-+*])\s$/,fk=V.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`,z(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(lk,this.editor.getAttributes(uk)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=_f({find:dk,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=_f({find:dk,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(uk),editor:this.editor})),[e]}}),pk=V.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,z(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)=>Ff(e,t,e=>e.parentType===`bulletList`?`- `:e.parentType===`orderedList`?`${(e.meta?.parentAttrs?.start||1)+e.index}. `:`- `,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)}}}),mk={};ck(mk,{findListItemPos:()=>hk,getNextListDepth:()=>gk,handleBackspace:()=>bk,handleDelete:()=>Ck,hasListBefore:()=>_k,hasListItemAfter:()=>wk,hasListItemBefore:()=>vk,listItemHasSubList:()=>yk,nextListIsDeeper:()=>xk,nextListIsHigher:()=>Sk});var hk=(e,t)=>{let{$from:n}=t.selection,r=al(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}},gk=(e,t)=>{let n=hk(e,t);if(!n)return!1;let[,r]=Wu(t,e,n.$pos.pos+4);return r},_k=(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))},vk=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},yk=(e,t,n)=>{if(!n)return!1;let r=al(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},bk=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Gl(e.state,t)&&_k(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(!Gl(e.state,t)||!Zu(e.state))return!1;let r=hk(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=yk(t,e.state,i);return vk(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},xk=(e,t)=>{let n=gk(e,t),r=hk(e,t);return!r||!n?!1:n>r.depth},Sk=(e,t)=>{let n=gk(e,t),r=hk(e,t);return!r||!n?!1:n<r.depth},Ck=(e,t)=>{if(!Gl(e.state,t)||!Xu(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:xk(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Sk(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},wk=(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)},Tk=B.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&&Ck(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&&Ck(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&&bk(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&&bk(e,n,r)&&(t=!0)}),t}}}}),Ek=/^(\s*)(\d+)\.\s+(.*)$/,Dk=/^\s/;function Ok(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(Ek);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(Ek))break;if(t.trim()===``)f.push(t),u+=`
|
|
132
|
+
`,d+=1;else if(t.match(Dk))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 kk(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=kk(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 Ak(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 jk=`listItem`,Mk=`textStyle`,Nk=/^(\d+)\.\s$/,Pk=V.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`,z(this.options.HTMLAttributes,n),0]:[`ol`,z(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?Ak(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]=Ok(r);if(i.length===0)return;let o=kk(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(jk,this.editor.getAttributes(Mk)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=_f({find:Nk,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=_f({find:Nk,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Mk)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),Fk=/^\s*(\[([( |x])?\])\s$/,Ik=V.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`,z(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)=>Ff(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`}`};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)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=xu(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[_f({find:Fk,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),Lk=V.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`,z(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=Pf(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=Pf(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()}}});B.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(fk.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(pk.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Tk.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(Pk.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(Ik.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(Lk.configure(this.options.taskList)),e}});var 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:`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 Bk=(0,t.markRaw)({name:`mingcute-list-check-line`,render:zk}),Vk=fk.extend({addOptions(){return{...this.parent?.(),getCommandMenuItems(){return{priority:130,icon:(0,t.markRaw)(Bk),title:`editor.common.bullet_list`,keywords:[`bulletlist`,`wuxuliebiao`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleBulletList().run()}}}}},addExtensions(){return[pk]}}),Hk=B.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 P({key:new F(`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=B.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[L_(this.options)]}});B.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new P({key:new F(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return I.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(Vs.node(t,t+e.nodeSize,{class:this.options.className}))}),I.create(e,a)}}})]}}),B.create({name:`gapCursor`,addProseMirrorPlugins(){return[U_()]},extendNodeSchema(e){return{allowGapCursor:R(L(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}});var Wk=B.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new P({key:new F(`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&&ed(e);if((n||!this.options.showOnlyCurrent)&&o){let r=[this.options.emptyNodeClass];a&&r.push(this.options.emptyEditorClass);let o=Vs.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}),I.create(e,i)}}})]}});B.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new P({key:new F(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||td(n.selection)||e.view.dragging?null:I.create(n.doc,[Vs.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function Gk({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}B.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new F(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new P({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!Gk({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!Gk({node:r,types:n})}}})]}});var Kk=B.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>yv(e,t),redo:()=>({state:e,dispatch:t})=>bv(e,t)}},addProseMirrorPlugins(){return[_v(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()}}}),qk={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Jk(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,qk,[...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 Yk=(0,t.markRaw)({name:`mingcute-eraser-line`,render:Jk}),Xk=B.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)(Yk),title:q.global.t(`editor.common.clear_format`),action:()=>e.chain().focus().unsetAllMarks().run()}}}}},addKeyboardShortcuts(){return{"Mod-\\":()=>this.editor.chain().focus().unsetAllMarks().run()}}}),Zk=/(^|[^`])`([^`]+)`(?!`)$/,Qk=/(^|[^`])`([^`]+)`(?!`)/g,$k=Vd.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,z(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[pf({find:Zk,type:this.type})]},addPasteRules(){return[zf({find:Qk,type:this.type})]}}),eA={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function tA(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,eA,[...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 nA=(0,t.markRaw)({name:`mingcute-code-line`,render:tA}),rA=$k.extend({exitable:!0,addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:100,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive($k.name),icon:(0,t.markRaw)(nA),title:q.global.t(`editor.common.code`),action:()=>e.chain().focus().toggleCode().run()}}}}}}),iA=4,aA=/^```([a-z]+)?[\s\n]$/,oA=/^~~~([a-z]+)?[\s\n]$/,sA=V.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:iA,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`,z(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??iA,{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??iA,{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(M.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(j.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[hf({find:aA,type:this.type,getAttributes:e=>({language:e[1]})}),hf({find:oA,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new P({key:new F(`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(M.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),cA={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function lA(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,cA,[...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 uA=(0,t.markRaw)({name:`mingcute-braces-line`,render:lA}),dA={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function fA(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,dA,[...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 pA=(0,t.markRaw)({name:`mingcute-right-small-fill`,render:fA}),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:`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 gA=(0,t.markRaw)({name:`mingcute-down-line`,render:hA}),_A={class:`h-8`},vA={class:`absolute bottom-0 top-0`},yA=[`placeholder`],bA={class:`bg-white`},xA={class:`select max-h-64 cursor-pointer p-1`},SA=[`index`,`onMousedown`],CA={class:`flex-1 text-ellipsis text-sm`},wA={key:1,class:`flex h-8 w-full items-center rounded-md px-3 py-1 text-base`},TA=_((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`,bA,[(0,t.createElementVNode)(`div`,xA,[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`,CA,(0,t.toDisplayString)(e.label),1)],42,SA))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,wA,[...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`,_A,[(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`,vA,[(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,yA),[[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)(gA))])],2)])],32)]),_:1},8,[`shown`,`container`]))}}),[[`__scopeId`,`data-v-999722b4`]]),EA={contenteditable:`false`,class:`flex items-center justify-between border-b-[1px] border-b-gray-100 bg-neutral-100 py-1`},DA={class:`flex items-center pr-3`},OA={class:`flex items-center pr-3`},kA=(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}=CD(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)(QT),{as:`div`,class:`code-node mt-3 overflow-hidden rounded border-[1px]`},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,EA,[(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`,DA,[(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)(pA),{class:(0,t.normalizeClass)([`size-6 transition-all`,{"rotate-90":!s.value}])},null,8,[`class`])])]),(0,t.createVNode)(TA,{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)(TA,{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`,OA,[(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)(Jf),{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)(q).global.t(`editor.common.codeblock.copy_code`):(0,t.unref)(q).global.t(`editor.common.codeblock.copy_code_success`)]])])]),(0,t.withDirectives)((0,t.createElementVNode)(`pre`,null,[(0,t.createVNode)((0,t.unref)(ZT),{as:`code`,class:`hljs`})],512),[[t.vShow,!s.value]])]),_:1})}}}),AA=(e,t)=>{let{doc:n,selection:r}=e;if(!n||!r||!(r instanceof M))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},jA=new F(`codeBlockBubbleMenu`),MA=sA.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=AA(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=AA(e,`outdent`),e.docChanged&&n?(n(e),!0):!1}}},addKeyboardShortcuts(){return{Backspace:({editor:e})=>{if(!Gl(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(sA.name)?this.editor.chain().focus().codeIndent().run():!1,"Shift-Tab":()=>this.editor.isActive(sA.name)?this.editor.chain().focus().codeOutdent().run():!1,"Mod-a":()=>{if(this.editor.isActive(sA.name)){let{tr:e,selection:t}=this.editor.state,n=mu(e=>e.type.name===sA.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 M(a,o))),!0}return!1}}},addNodeView(){return sE(kA)},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(sA.name),icon:(0,t.markRaw)(uA),title:q.global.t(`editor.common.codeblock.title`),action:()=>e.chain().focus().toggleCodeBlock().run()}}},getCommandMenuItems(){return{priority:80,icon:(0,t.markRaw)(uA),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)(gD),props:{editor:e,icon:(0,t.markRaw)(uA),title:q.global.t(`editor.common.codeblock.title`),action:()=>{e.chain().focus().setCodeBlock().run()}}}]},getBubbleMenu(){return{pluginKey:jA,shouldShow:({state:e})=>Yu(e,sA.name),options:{placement:`top-start`},getReferencedVirtualElement(){let e=this.editor;if(!e)return null;let t=mu(e=>e.type.name===MA.name)(e.state.selection);if(t){let n=ad(e.view,t.pos,t.pos+t.node.nodeSize);return{getBoundingClientRect:()=>n,getClientRects:()=>[n]}}return null},items:[{priority:10,props:{icon:(0,t.markRaw)(dD),title:q.global.t(`editor.common.button.delete`),action:({editor:e})=>fE(sA.name,e)}}]}}}},addProseMirrorPlugins(){return[new P({key:new F(`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(M.near(a.doc.resolve(l))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}}),...this.parent?.()||[]]}}),NA=20,PA=(e,t=0)=>{let n=[];return!e.children.length||t>NA||Array.from(e.children).forEach(e=>{e.tagName===`SPAN`?n.push(e):e.children.length&&n.push(...PA(e,t+1))}),n},FA=e=>{if(!e.children.length)return;let t=PA(e);t&&t.forEach(e=>{let t=e.getAttribute(`style`),n=(e.parentElement?.closest(`span`))?.getAttribute(`style`);e.setAttribute(`style`,`${n};${t}`)})},IA=Vd.create({name:`textStyle`,priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:`span`,consuming:!1,getAttrs:e=>e.hasAttribute(`style`)?(this.options.mergeNestedSpanStyles&&FA(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return[`span`,z(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}}}}),LA=B.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()}}}),RA=B.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()}}}),zA=B.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()}}}),BA=B.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()}}}),VA=B.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()}}}),HA=B.create({name:`textStyleKit`,addExtensions(){let e=[];return this.options.backgroundColor!==!1&&e.push(LA.configure(this.options.backgroundColor)),this.options.color!==!1&&e.push(RA.configure(this.options.color)),this.options.fontFamily!==!1&&e.push(zA.configure(this.options.fontFamily)),this.options.fontSize!==!1&&e.push(BA.configure(this.options.fontSize)),this.options.lineHeight!==!1&&e.push(VA.configure(this.options.lineHeight)),this.options.textStyle!==!1&&e.push(IA.configure(this.options.textStyle)),e}}),UA=RA,WA={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function GA(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,WA,[...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 KA=(0,t.markRaw)({name:`mingcute-text-color-line`,render:GA}),qA=HA.extend({priority:110}).configure({backgroundColor:{types:[`textStyle`]},color:{types:[`textStyle`]},fontFamily:{types:[`textStyle`]},fontSize:{types:[`textStyle`]},lineHeight:{types:[`textStyle`]}});function JA(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 YA=function(e,t){let{componentPrefix:n=``}=t||{};e.component(`${n}${this.name}`,this)},XA={},ZA={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(${$A(this.white,this.grey,this.size)})`}}}};function QA(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 $A(e,t,n){let r=`${e},${t},${n}`;if(XA[r])return XA[r];let i=QA(e,t,n);return XA[r]=i,i}function ej(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)}JA(`.vc-checkerboard{background-size:contain;bottom:0;left:0;position:absolute;right:0;top:0}`),ZA.render=ej,ZA.__file=`src/components/checkboard/checkboard.vue`,ZA.install=YA;var tj={name:`Alpha`,components:{Checkboard:ZA},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)}}},nj={class:`vc-alpha`},rj={class:`vc-alpha-checkboard-wrap`},ij=[(0,t.createElementVNode)(`div`,{class:`vc-alpha-picker`},null,-1)];function aj(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`Checkboard`);return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,nj,[(0,t.createElementVNode)(`div`,rj,[(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}%`})},ij,4)],544)])}JA(`.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}`),tj.render=aj,tj.__file=`src/components/alpha/alpha.vue`,tj.install=YA;function oj(e,t){cj(e)&&(e=`100%`);var n=lj(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 sj(e){return Math.min(1,Math.max(0,e))}function cj(e){return typeof e==`string`&&e.indexOf(`.`)!==-1&&parseFloat(e)===1}function lj(e){return typeof e==`string`&&e.indexOf(`%`)!==-1}function uj(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function dj(e){return e<=1?`${Number(e)*100}%`:e}function fj(e){return e.length===1?`0`+e:String(e)}function pj(e,t,n){return{r:oj(e,255)*255,g:oj(t,255)*255,b:oj(n,255)*255}}function mj(e,t,n){e=oj(e,255),t=oj(t,255),n=oj(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 hj(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 gj(e,t,n){var r,i,a;if(e=oj(e,360),t=oj(t,100),n=oj(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=hj(s,o,e+1/3),i=hj(s,o,e),a=hj(s,o,e-1/3)}return{r:r*255,g:i*255,b:a*255}}function _j(e,t,n){e=oj(e,255),t=oj(t,255),n=oj(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 vj(e,t,n){e=oj(e,360)*6,t=oj(t,100),n=oj(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 yj(e,t,n,r){var i=[fj(Math.round(e).toString(16)),fj(Math.round(t).toString(16)),fj(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 bj(e,t,n,r,i){var a=[fj(Math.round(e).toString(16)),fj(Math.round(t).toString(16)),fj(Math.round(n).toString(16)),fj(xj(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 xj(e){return Math.round(parseFloat(e)*255).toString(16)}function Sj(e){return Cj(e)/255}function Cj(e){return parseInt(e,16)}function wj(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var Tj={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 Ej(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=jj(e)),typeof e==`object`&&(Mj(e.r)&&Mj(e.g)&&Mj(e.b)?(t=pj(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)===`%`?`prgb`:`rgb`):Mj(e.h)&&Mj(e.s)&&Mj(e.v)?(r=dj(e.s),i=dj(e.v),t=vj(e.h,r,i),o=!0,s=`hsv`):Mj(e.h)&&Mj(e.s)&&Mj(e.l)&&(r=dj(e.s),a=dj(e.l),t=gj(e.h,r,a),o=!0,s=`hsl`),Object.prototype.hasOwnProperty.call(e,`a`)&&(n=e.a)),n=uj(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 Dj=`(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)`,Oj=`[\\s|\\(]+(${Dj})[,|\\s]+(${Dj})[,|\\s]+(${Dj})\\s*\\)?`,kj=`[\\s|\\(]+(${Dj})[,|\\s]+(${Dj})[,|\\s]+(${Dj})[,|\\s]+(${Dj})\\s*\\)?`,Aj={CSS_UNIT:new RegExp(Dj),rgb:RegExp(`rgb`+Oj),rgba:RegExp(`rgba`+kj),hsl:RegExp(`hsl`+Oj),hsla:RegExp(`hsla`+kj),hsv:RegExp(`hsv`+Oj),hsva:RegExp(`hsva`+kj),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 jj(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(Tj[e])e=Tj[e],t=!0;else if(e===`transparent`)return{r:0,g:0,b:0,a:0,format:`name`};var n=Aj.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Aj.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Aj.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Aj.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Aj.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Aj.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Aj.hex8.exec(e),n?{r:Cj(n[1]),g:Cj(n[2]),b:Cj(n[3]),a:Sj(n[4]),format:t?`name`:`hex8`}:(n=Aj.hex6.exec(e),n?{r:Cj(n[1]),g:Cj(n[2]),b:Cj(n[3]),format:t?`name`:`hex`}:(n=Aj.hex4.exec(e),n?{r:Cj(n[1]+n[1]),g:Cj(n[2]+n[2]),b:Cj(n[3]+n[3]),a:Sj(n[4]+n[4]),format:t?`name`:`hex8`}:(n=Aj.hex3.exec(e),n?{r:Cj(n[1]+n[1]),g:Cj(n[2]+n[2]),b:Cj(n[3]+n[3]),format:t?`name`:`hex`}:!1)))))))))}function Mj(e){return!!Aj.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=wj(t)),this.originalInput=t;var r=Ej(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=uj(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=_j(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=_j(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=mj(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=mj(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),yj(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),bj(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(oj(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(oj(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=`#`+yj(this.r,this.g,this.b,!1),t=0,n=Object.entries(Tj);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=sj(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=sj(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=sj(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=sj(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 Pj(...e){return new Nj(...e)}function Fj(e,t){let n=e&&e.a,r;r=e&&e.hsl?Pj(e.hsl):e&&e.hex&&e.hex.length>0?Pj(e.hex):e&&e.hsv?Pj(e.hsv):e&&e.rgba?Pj(e.rgba):e&&e.rgb?Pj(e.rgb):Pj(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 Ij={model:{prop:`modelValue`,event:`update:modelValue`},props:[`modelValue`],data(){return{val:Fj(this.modelValue)}},computed:{colors:{get(){return this.val},set(e){this.val=e,this.$emit(`update:modelValue`,e)}}},watch:{modelValue(e){this.val=Fj(e)}},methods:{colorChange(e,t){this.oldHue=this.colors.hsl.h,this.colors=Fj(e,t||this.oldHue)},isValidHex(e){return Pj(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 Pj(e).getAlpha()===0}}},Lj={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())}}}},Rj={class:`vc-editable-input`},zj=[`aria-labelledby`],Bj=[`id`,`for`],Vj={class:`vc-input__desc`};function Hj(e,n,r,i,a,o){return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,Rj,[(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,zj),[[t.vModelText,o.val]]),(0,t.createElementVNode)(`span`,{id:o.labelId,for:r.label,class:`vc-input__label`},(0,t.toDisplayString)(o.labelSpanText),9,Bj),(0,t.createElementVNode)(`span`,Vj,(0,t.toDisplayString)(r.desc),1)])}JA(`.vc-editable-input{position:relative}.vc-input__input{border:0;outline:none;padding:0}.vc-input__label{text-transform:capitalize}`),Lj.render=Hj,Lj.__file=`src/components/editable-input/editable-input.vue`,Lj.install=YA;function Uj(e,t,n){return t<n?e<t?t:e>n?n:e:e<n?n:e>t?t:e}var Wj={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=Uj(s-a,0,r),u=Uj(c-o,0,i),d=l/r,f=Uj(-(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)}}},Gj=(0,t.createElementVNode)(`div`,{class:`vc-saturation--white`},null,-1),Kj=(0,t.createElementVNode)(`div`,{class:`vc-saturation--black`},null,-1),qj=[(0,t.createElementVNode)(`div`,{class:`vc-saturation-circle`},null,-1)];function Jj(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)},[Gj,Kj,(0,t.createElementVNode)(`div`,{class:`vc-saturation-pointer`,style:(0,t.normalizeStyle)({top:o.pointerTop,left:o.pointerLeft})},qj,4)],36)}JA(`.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}`),Wj.render=Jj,Wj.__file=`src/components/saturation/saturation.vue`,Wj.install=YA;var Yj={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)}}},Xj=[`aria-valuenow`],Zj=[(0,t.createElementVNode)(`div`,{class:`vc-hue-picker`},null,-1)];function Qj(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`},Zj,4)],40,Xj)],2)}JA(`.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}`),Yj.render=Qj,Yj.__file=`src/components/hue/hue.vue`,Yj.install=YA;var $j=[`#D0021B`,`#F5A623`,`#F8E71C`,`#8B572A`,`#7ED321`,`#417505`,`#BD10E0`,`#9013FE`,`#4A90E2`,`#50E3C2`,`#B8E986`,`#000000`,`#4A4A4A`,`#9B9B9B`,`#FFFFFF`,`rgba(0,0,0,0)`],eM={name:`Sketch`,components:{Saturation:Wj,Hue:Yj,Alpha:tj,EdIn:Lj,Checkboard:ZA},mixins:[Ij],props:{presetColors:{type:Array,default(){return $j}},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`}))}}},tM={class:`vc-sketch-saturation-wrap`},nM={class:`vc-sketch-controls`},rM={class:`vc-sketch-sliders`},iM={class:`vc-sketch-hue-wrap`},aM={key:0,class:`vc-sketch-alpha-wrap`},oM={class:`vc-sketch-color-wrap`},sM=[`aria-label`],cM={key:0,class:`vc-sketch-field`},lM={class:`vc-sketch-field--double`},uM={class:`vc-sketch-field--single`},dM={class:`vc-sketch-field--single`},fM={class:`vc-sketch-field--single`},pM={key:0,class:`vc-sketch-field--single`},mM={class:`vc-sketch-presets`,role:`group`,"aria-label":`A color preset, pick one to set as current color`},hM=[`aria-label`,`onClick`],gM=[`aria-label`,`onClick`];function _M(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`,tM,[(0,t.createVNode)(s,{value:e.colors,onChange:o.childChange},null,8,[`value`,`onChange`])]),(0,t.createElementVNode)(`div`,nM,[(0,t.createElementVNode)(`div`,rM,[(0,t.createElementVNode)(`div`,iM,[(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`,aM,[(0,t.createVNode)(l,{value:e.colors,onChange:o.childChange},null,8,[`value`,`onChange`])]))]),(0,t.createElementVNode)(`div`,oM,[(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,sM),(0,t.createVNode)(u)])]),r.disableFields?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,cM,[(0,t.createCommentVNode)(` rgba `),(0,t.createElementVNode)(`div`,lM,[(0,t.createVNode)(d,{label:`hex`,value:o.hex,onChange:o.inputChange},null,8,[`value`,`onChange`])]),(0,t.createElementVNode)(`div`,uM,[(0,t.createVNode)(d,{label:`r`,value:e.colors.rgba.r,onChange:o.inputChange},null,8,[`value`,`onChange`])]),(0,t.createElementVNode)(`div`,dM,[(0,t.createVNode)(d,{label:`g`,value:e.colors.rgba.g,onChange:o.inputChange},null,8,[`value`,`onChange`])]),(0,t.createElementVNode)(`div`,fM,[(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`,pM,[(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`,mM,[((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,gM)):((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,hM))],64))),256))])],2)}JA(`.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}`),eM.render=_M,eM.__file=`src/components/sketch/sketch.vue`,eM.install=YA;var vM=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})),yM=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(vM());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])}}})),bM=d((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`default`,{enumerable:!0,get:function(){return i}});var t=n(yM());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}}})),xM=m(d(((e,t)=>{var n=bM();t.exports=(n.__esModule?n:{default:n}).default}))(),1),SM={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function CM(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,SM,[...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 wM=(0,t.markRaw)({name:`mingcute-palette-line`,render:CM}),TM={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function EM(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,TM,[...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 DM=(0,t.markRaw)({name:`mingcute-right-line`,render:EM}),OM={class:`grid grid-cols-9 gap-1.5 p-2 pt-1`},kM=[`title`,`onClick`],AM={class:`p-1`},jM={class:`flex cursor-pointer items-center justify-between rounded p-1 text-xs text-gray-600 hover:bg-gray-100 hover:text-gray-900`},MM={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(xM.default).reduce((e,t)=>([`gray`,`red`,`orange`,`yellow`,`green`,`blue`,`purple`,`pink`].includes(t)&&(e[t]=xM.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`,OM,[((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,kM))),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)(eM),{"model-value":`#000`,"onUpdate:modelValue":s})]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,AM,[(0,t.createElementVNode)(`div`,jM,[(0,t.createElementVNode)(`div`,MM,[(0,t.createVNode)((0,t.unref)(wM)),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(q).global.t(`editor.components.color_picker.more_color`)),1)]),(0,t.createElementVNode)(`div`,null,[(0,t.createVNode)((0,t.unref)(DM))])])])]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`default`)]),_:3}))}}),PM={class:`p-1`},FM={class:`text-xs text-gray-600`},IM=(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`,PM,[(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`,FM,(0,t.toDisplayString)((0,t.unref)(q).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}))}}),LM=UA.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:81,component:(0,t.markRaw)(IM),props:{editor:e,isActive:!1,icon:(0,t.markRaw)(KA),title:q.global.t(`editor.common.color`)}}}}},addExtensions(){return[qA]}}),RM=V.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`,z(this.options.HTMLAttributes,e),0]}}),zM={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function BM(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,zM,[...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 VM=(0,t.markRaw)({name:`mingcute-columns-2-line`,render:BM}),HM={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function UM(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,HM,[...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 WM=(0,t.markRaw)({name:`ri-delete-column`,render:UM}),GM={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function KM(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,GM,[...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 qM=(0,t.markRaw)({name:`ri-insert-column-left`,render:KM}),JM={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function YM(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,JM,[...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 XM=(0,t.markRaw)({name:`ri-insert-column-right`,render:YM}),ZM=new F(`columnsBubbleMenu`),QM=(e,t)=>{let n=$M(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)},$M=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},eN=(e,t,n)=>{let r=mu(e=>e.type.name===nN.name)(t.selection),i=mu(e=>e.type.name===RM.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=je.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(M.near(d.doc.resolve(u))),e(d)}return!0},tN=(e,t,n)=>{let r=mu(e=>e.type.name===nN.name)(e.selection),i=mu(e=>e.type.name===RM.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(M.near(l.doc.resolve(c))),t(l),!0}return!1},nN=V.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)(gD),props:{editor:e,icon:(0,t.markRaw)(VM),title:q.global.t(`editor.extensions.commands_menu.columns`),action:()=>{e.chain().focus().insertColumns({cols:2}).run()}}}]},getCommandMenuItems(){return{priority:70,icon:(0,t.markRaw)(VM),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:ZM,shouldShow:({state:e})=>Yu(e,nN.name),options:{placement:`bottom-start`},getReferencedVirtualElement(){let e=this.editor;if(!e)return null;let t=mu(e=>e.type.name===RM.name)(e.state.selection);if(t){let n=ad(e.view,t.pos,t.pos+t.node.nodeSize);return{getBoundingClientRect:()=>n,getClientRects:()=>[n]}}return null},items:[{priority:10,props:{icon:(0,t.markRaw)(qM),title:q.global.t(`editor.extensions.columns.add_column_before`),action:({editor:e})=>{e.chain().focus().addColBefore().run()}}},{priority:20,props:{icon:(0,t.markRaw)(XM),title:q.global.t(`editor.extensions.columns.add_column_after`),action:({editor:e})=>{e.chain().focus().addColAfter().run()}}},{priority:30,props:{icon:(0,t.markRaw)(WM),title:q.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)(dD),title:q.global.t(`editor.common.button.delete`),action:({editor:e})=>{fE(nN.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`,z(this.options.HTMLAttributes,e),0]},addCommands(){return{insertColumns:e=>({tr:t,dispatch:n,editor:r})=>{let i=QM(r.schema,e&&e.cols||3);if(n){let e=t.selection.anchor+1;t.replaceSelectionWith(i).scrollIntoView().setSelection(M.near(t.doc.resolve(e)))}return!0},addColBefore:()=>({dispatch:e,state:t})=>eN(e,t,`addBefore`),addColAfter:()=>({dispatch:e,state:t})=>eN(e,t,`addAfter`),deleteCol:()=>({dispatch:e,state:t})=>eN(e,t,`delete`)}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertColumns(),Tab:()=>tN(this.editor.state,this.editor.view.dispatch,`after`),"Shift-Tab":()=>tN(this.editor.state,this.editor.view.dispatch,`before`)}},addExtensions(){return[RM]}}),rN=[`top`,`right`,`bottom`,`left`],iN=[`start`,`end`],aN=rN.reduce((e,t)=>e.concat(t,t+`-`+iN[0],t+`-`+iN[1]),[]),oN=Math.min,sN=Math.max,cN=Math.round,lN=e=>({x:e,y:e}),uN={left:`right`,right:`left`,bottom:`top`,top:`bottom`},dN={start:`end`,end:`start`};function fN(e,t,n){return sN(e,oN(t,n))}function pN(e,t){return typeof e==`function`?e(t):e}function mN(e){return e.split(`-`)[0]}function hN(e){return e.split(`-`)[1]}function gN(e){return e===`x`?`y`:`x`}function _N(e){return e===`y`?`height`:`width`}var vN=new Set([`top`,`bottom`]);function yN(e){return vN.has(mN(e))?`y`:`x`}function bN(e){return gN(yN(e))}function xN(e,t,n){n===void 0&&(n=!1);let r=hN(e),i=bN(e),a=_N(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=AN(o)),[o,AN(o)]}function SN(e){let t=AN(e);return[CN(e),t,CN(t)]}function CN(e){return e.replace(/start|end/g,e=>dN[e])}var wN=[`left`,`right`],TN=[`right`,`left`],EN=[`top`,`bottom`],DN=[`bottom`,`top`];function ON(e,t,n){switch(e){case`top`:case`bottom`:return n?t?TN:wN:t?wN:TN;case`left`:case`right`:return t?EN:DN;default:return[]}}function kN(e,t,n,r){let i=hN(e),a=ON(mN(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(CN)))),a}function AN(e){return e.replace(/left|right|bottom|top/g,e=>uN[e])}function jN(e){return{top:0,right:0,bottom:0,left:0,...e}}function MN(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:jN(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 PN(e,t,n){let{reference:r,floating:i}=e,a=yN(t),o=bN(t),s=_N(o),c=mN(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(hN(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var FN=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}=PN(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}=PN(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function IN(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}=pN(t,e),p=MN(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 LN=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}=pN(e,t)||{};if(l==null)return{};let d=MN(u),f={x:n,y:r},p=bN(i),m=_N(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=oN(d[_],T),te=oN(d[v],T),E=ee,ne=C-h[m]-te,re=C/2-h[m]/2+w,ie=fN(E,re,ne),ae=!c.arrow&&hN(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 RN(e,t,n){return(e?[...n.filter(t=>hN(t)===e),...n.filter(t=>hN(t)!==e)]:n.filter(e=>mN(e)===e)).filter(n=>e?hN(n)===e||(t?CN(n)!==n:!1):!0)}var zN=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=aN,autoAlignment:u=!0,...d}=pN(e,t),f=c!==void 0||l===aN?RN(c||null,u,l):l,p=await IN(t,d),m=r.autoPlacement?.index||0,h=f[m];if(h==null)return{};let g=xN(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[mN(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=hN(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,hN(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}}}}},BN=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}=pN(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=mN(r),_=yN(o),v=mN(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[AN(o)]:SN(o)),x=p!==`none`;!d&&x&&b.push(...kN(o,m,p,y));let S=[o,...b],C=await IN(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=xN(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`&&_!==yN(t))||T.every(e=>yN(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=yN(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 VN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function HN(e){return rN.some(t=>e[t]>=0)}var UN=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=pN(e,t);switch(r){case`referenceHidden`:{let e=VN(await IN(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:HN(e)}}}case`escaped`:{let e=VN(await IN(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:HN(e)}}}default:return{}}}}};function WN(e){let t=oN(...e.map(e=>e.left)),n=oN(...e.map(e=>e.top)),r=sN(...e.map(e=>e.right)),i=sN(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function GN(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(WN(e)))}var KN=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}=pN(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=GN(u),f=NN(WN(u)),p=MN(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(yN(n)===`y`){let e=d[0],t=d[d.length-1],r=mN(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=mN(n)===`left`,t=sN(...d.map(e=>e.right)),r=oN(...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}}:{}}}},qN=new Set([`left`,`top`]);async function JN(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=mN(n),s=hN(n),c=yN(n)===`y`,l=qN.has(o)?-1:1,u=a&&c?-1:1,d=pN(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 YN=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 JN(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}}}}},XN=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}=pN(e,t),l={x:n,y:r},u=await IN(t,c),d=yN(mN(i)),f=gN(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=fN(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=fN(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}}}}}},ZN=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}=pN(e,t),u=await IN(t,l),d=mN(i),f=hN(i),p=yN(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=oN(h-u[g],v),x=oN(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=sN(u.left,0),t=sN(u.right,0),n=sN(u.top,0),r=sN(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:sN(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:sN(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 QN(){return typeof window<`u`}function $N(e){return nP(e)?(e.nodeName||``).toLowerCase():`#document`}function eP(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function tP(e){return((nP(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function nP(e){return QN()?e instanceof Node||e instanceof eP(e).Node:!1}function rP(e){return QN()?e instanceof Element||e instanceof eP(e).Element:!1}function iP(e){return QN()?e instanceof HTMLElement||e instanceof eP(e).HTMLElement:!1}function aP(e){return!QN()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof eP(e).ShadowRoot}var oP=new Set([`inline`,`contents`]);function sP(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=bP(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!oP.has(i)}var cP=new Set([`table`,`td`,`th`]);function lP(e){return cP.has($N(e))}var uP=[`:popover-open`,`:modal`];function dP(e){return uP.some(t=>{try{return e.matches(t)}catch{return!1}})}var fP=[`transform`,`translate`,`scale`,`rotate`,`perspective`],pP=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],mP=[`paint`,`layout`,`strict`,`content`];function hP(e){let t=_P(),n=rP(e)?bP(e):e;return fP.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)||pP.some(e=>(n.willChange||``).includes(e))||mP.some(e=>(n.contain||``).includes(e))}function gP(e){let t=SP(e);for(;iP(t)&&!yP(t);){if(hP(t))return t;if(dP(t))return null;t=SP(t)}return null}function _P(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var vP=new Set([`html`,`body`,`#document`]);function yP(e){return vP.has($N(e))}function bP(e){return eP(e).getComputedStyle(e)}function xP(e){return rP(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function SP(e){if($N(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||aP(e)&&e.host||tP(e);return aP(t)?t.host:t}function CP(e){let t=SP(e);return yP(t)?e.ownerDocument?e.ownerDocument.body:e.body:iP(t)&&sP(t)?t:CP(t)}function wP(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=CP(e),i=r===e.ownerDocument?.body,a=eP(r);if(i){let e=TP(a);return t.concat(a,a.visualViewport||[],sP(r)?r:[],e&&n?wP(e):[])}return t.concat(r,wP(r,[],n))}function TP(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function EP(e){let t=bP(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=iP(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=cN(n)!==a||cN(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function DP(e){return rP(e)?e:e.contextElement}function OP(e){let t=DP(e);if(!iP(t))return lN(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=EP(t),o=(a?cN(n.width):n.width)/r,s=(a?cN(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var kP=lN(0);function AP(e){let t=eP(e);return!_P()||!t.visualViewport?kP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jP(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==eP(e)?!1:t}function MP(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=DP(e),o=lN(1);t&&(r?rP(r)&&(o=OP(r)):o=OP(e));let s=jP(a,n,r)?AP(a):lN(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=eP(a),t=r&&rP(r)?eP(r):r,n=e,i=TP(n);for(;i&&r&&t!==n;){let e=OP(i),t=i.getBoundingClientRect(),r=bP(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=eP(i),i=TP(n)}}return NN({width:u,height:d,x:c,y:l})}function NP(e,t){let n=xP(e).scrollLeft;return t?t.left+n:MP(tP(e)).left+n}function PP(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-NP(e,n),y:n.top+t.scrollTop}}function FP(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=tP(r),s=t?dP(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=lN(1),u=lN(0),d=iP(r);if((d||!d&&!a)&&(($N(r)!==`body`||sP(o))&&(c=xP(r)),iP(r))){let e=MP(r);l=OP(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?PP(o,c):lN(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 IP(e){return Array.from(e.getClientRects())}function LP(e){let t=tP(e),n=xP(e),r=e.ownerDocument.body,i=sN(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=sN(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+NP(e),s=-n.scrollTop;return bP(r).direction===`rtl`&&(o+=sN(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var RP=25;function zP(e,t){let n=eP(e),r=tP(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=_P();(!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<=RP&&(a-=o)}else l<=RP&&(a+=l);return{width:a,height:o,x:s,y:c}}var BP=new Set([`absolute`,`fixed`]);function VP(e,t){let n=MP(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=iP(e)?OP(e):lN(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function HP(e,t,n){let r;if(t===`viewport`)r=zP(e,n);else if(t===`document`)r=LP(tP(e));else if(rP(t))r=VP(t,n);else{let n=AP(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return NN(r)}function UP(e,t){let n=SP(e);return n===t||!rP(n)||yP(n)?!1:bP(n).position===`fixed`||UP(n,t)}function WP(e,t){let n=t.get(e);if(n)return n;let r=wP(e,[],!1).filter(e=>rP(e)&&$N(e)!==`body`),i=null,a=bP(e).position===`fixed`,o=a?SP(e):e;for(;rP(o)&&!yP(o);){let t=bP(o),n=hP(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&BP.has(i.position)||sP(o)&&!n&&UP(e,o))?r=r.filter(e=>e!==o):i=t,o=SP(o)}return t.set(e,r),r}function GP(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?dP(t)?[]:WP(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=HP(t,n,i);return e.top=sN(r.top,e.top),e.right=oN(r.right,e.right),e.bottom=oN(r.bottom,e.bottom),e.left=sN(r.left,e.left),e},HP(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function KP(e){let{width:t,height:n}=EP(e);return{width:t,height:n}}function qP(e,t,n){let r=iP(t),i=tP(t),a=n===`fixed`,o=MP(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=lN(0);function l(){c.x=NP(i)}if(r||!r&&!a)if(($N(t)!==`body`||sP(i))&&(s=xP(t)),r){let e=MP(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?PP(i,s):lN(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 JP(e){return bP(e).position===`static`}function YP(e,t){if(!iP(e)||bP(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return tP(e)===n&&(n=n.ownerDocument.body),n}function XP(e,t){let n=eP(e);if(dP(e))return n;if(!iP(e)){let t=SP(e);for(;t&&!yP(t);){if(rP(t)&&!JP(t))return t;t=SP(t)}return n}let r=YP(e,t);for(;r&&lP(r)&&JP(r);)r=YP(r,t);return r&&yP(r)&&JP(r)&&!hP(r)?n:r||gP(e)||n}var ZP=async function(e){let t=this.getOffsetParent||XP,n=this.getDimensions,r=await n(e.floating);return{reference:qP(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function QP(e){return bP(e).direction===`rtl`}var $P={convertOffsetParentRelativeRectToViewportRelativeRect:FP,getDocumentElement:tP,getClippingRect:GP,getOffsetParent:XP,getElementRects:ZP,getClientRects:IP,getDimensions:KP,getScale:OP,isElement:rP,isRTL:QP},eF=YN,tF=zN,nF=XN,rF=BN,iF=ZN,aF=UN,oF=LN,sF=KN,cF=(e,t,n)=>{let r=new Map,i={platform:$P,...n},a={...i.platform,_c:r};return FN(e,t,{...i,platform:a})};function lF(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=Cf(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 uF=new F(`suggestion`);function dF({pluginKey:e=uF,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=lF,shouldShow:g}){let _,v=p?.(),y=()=>{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}},b=(n,r)=>r?()=>{let r=e.getState(t.state)?.decorationId;return n.dom.querySelector(`[data-decoration-id="${r}"]`)?.getBoundingClientRect()||null}:y;function x(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:b(n,a)};(i=v?.onExit)==null||i.call(v,o)}catch{}let a=n.state.tr.setMeta(r,{exit:!0});n.dispatch(a)}let S=new P({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,g=p||u&&h,y=h||u,x=m||u&&h;if(!g&&!y&&!x)return;let S=x&&!g?c:l,C=e.dom.querySelector(`[data-decoration-id="${S.decorationId}"]`);_={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:b(e,C)},g&&((r=v?.onBeforeStart)==null||r.call(v,_)),y&&((i=v?.onBeforeUpdate)==null||i.call(v,_)),(y||g)&&(_.items=await f({editor:t,query:S.query})),x&&((a=v?.onExit)==null||a.call(v,_)),y&&((o=v?.onUpdate)==null||o.call(v,_)),g&&((s=v?.onStart)==null||s.call(v,_))},destroy:()=>{var e;_&&((e=v?.onExit)==null||e.call(v,_))}}},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:_,from:v}=p,y={...c},b=s.getMeta(e);if(b&&b.exit)return y.active=!1,y.decorationId=null,y.range={from:0,to:0},y.query=null,y.text=null,y;if(y.composing=f,d&&(_||t.view.composing)){(v<c.range.from||v>c.range.to)&&!f&&!c.composing&&(y.active=!1);let e=h({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,$position:p.$from}),l=`id_${Math.floor(Math.random()*4294967295)}`;e&&m({editor:t,state:u,range:e.range,isActive:c.active})&&(!g||g({editor:t,range:e.range,query:e.query,text:e.text,transaction:s}))?(y.active=!0,y.decorationId=c.decorationId?c.decorationId:l,y.range=e.range,y.query=e.query,y.text=e.text):y.active=!1}else y.active=!1;return y.active||(y.decorationId=null,y.range={from:0,to:0},y.query=null,y.text=null),y}},props:{handleKeyDown(n,r){var i;let{active:a,range:o}=S.getState(n.state);if(!a)return!1;if(r.key===`Escape`||r.key===`Esc`){let a=S.getState(n.state),o=_?.decorationNode??null??(a?.decorationId?n.dom.querySelector(`[data-decoration-id="${a.decorationId}"]`):null);if((v?.onKeyDown)?.call(v,{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=v?.onExit)==null||i.call(v,s),x(n,e),!0}return(v?.onKeyDown)?.call(v,{view:n,event:r,range:o})||!1},decorations(e){let{active:t,range:n,decorationId:r,query:i}=S.getState(e);if(!t)return null;let a=!i?.length,o=[c];return a&&o.push(u),I.create(e.doc,[Vs.inline(n.from,n.to,{nodeName:s,class:o.join(` `),"data-decoration-id":r,"data-decoration-content":l})])}}});return S}var fF=dF,pF=e=>typeof e==`object`&&!!e&&e.nodeType===1,mF=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,hF=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return mF(n.overflowY,t)||mF(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},gF=(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,_F=e=>e.parentElement??(e.getRootNode().host||null),vF=(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(!pF(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;pF(u)&&s(u);){if(u=_F(u),u===c){l.push(u);break}u!=null&&u===document.body&&hF(u)&&!hF(document.documentElement)||u!=null&&hF(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`?gF(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:gF(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`?gF(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:gF(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},yF=e=>!1===e?{block:`end`,inline:`nearest`}:(e=>e===Object(e)&&Object.keys(e).length!==0)(e)?e:{block:`start`,inline:`nearest`};function bF(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(vF(e,t));let r=typeof t==`boolean`||t==null?void 0:t.behavior;for(let{el:i,top:a,left:o}of vF(e,yF(t))){let e=a-n.top+n.bottom,t=o-n.left+n.right;i.scroll({top:e,left:t,behavior:r})}}var xF={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`},SF=[`id`,`onClick`],CF={key:1,class:`flex items-center justify-center p-1 text-sm text-gray-600`},wF=(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&&bF(e,{behavior:`smooth`,scrollMode:`if-needed`})}),n({onKeyDown:a}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,xF,[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)(q).global.t(e.title)),3)],10,SF))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,CF,[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(q).global.t(`editor.extensions.commands_menu.no_results`)),1)]))]))}}),TF=B.create({name:`commands-menu`,addProseMirrorPlugins(){let e=DF(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 eE(wF,{props:t,editor:t.editor}),t.clientRect&&e.element&&e.element instanceof HTMLElement&&(e.element.style.position=`absolute`,document.body.appendChild(e.element),EF(t.editor,e.element))},onUpdate(t){e&&e.element&&e.element instanceof HTMLElement&&(e.updateProps(t),t.clientRect&&EF(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[fF({pluginKey:new F(`commands-menu-english`),char:`/`,...t}),fF({pluginKey:new F(`commands-menu-chinese`),char:`、`,...t})]}}),EF=(e,t)=>{cF({getBoundingClientRect:()=>ad(e.view,e.state.selection.from,e.state.selection.to)},t,{placement:`bottom-start`,strategy:`absolute`,middleware:[nF(),rF()]}).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`})},DF=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),OF=(e,t)=>t.view.domAtPos(e).node.offsetParent!==null,kF=(e,t,n)=>{for(let r=e.depth;r>0;--r){let i=e.node(r),a=t(i),o=OF(e.start(r),n);if(a&&o)return{pos:r>0?e.before(r):0,start:e.start(r),depth:r,node:i}}},AF=(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=mu(e=>e.type===a.nodes.details)(o);if(!u)return!1;let d=du(u.node,e=>e.type===a.nodes.detailsContent);if(!d.length||OF(u.start+d[0].pos+1,e))return!1;let f=n.doc.resolve(u.pos+u.node.nodeSize),p=z_.findFrom(f,1,!1);if(!p)return!1;let{tr:m}=n,h=new z_(p);return m.setSelection(h),m.scrollIntoView(),r.dispatch(m),!0},jF=V.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`,z(this.options.HTMLAttributes,e),0]},...Af({nodeName:`details`,content:`block`}),addNodeView(){return({editor:e,getPos:t,node:n,HTMLAttributes:r})=>{let i=document.createElement(`div`),a=z(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=mu(e=>e.type===this.type)(n);if(!i)return!1;let a=du(i.node,e=>e.type===r.nodes.detailsSummary),o=du(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=OF(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=uu(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=j.near(p,1);return f.setSelection(m),f.scrollIntoView(),n.dispatch(f),!0},ArrowRight:({editor:e})=>AF(e,`right`),ArrowDown:({editor:e})=>AF(e,`down`)}},addProseMirrorPlugins(){return[new P({key:new F(`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||!Yu(n,i.name))return;let{$from:a}=n.selection;if(OF(a.pos,r))return;let o=kF(a,e=>e.type===i,r);if(!o)return;let s=du(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=M.create(n.doc,l);return n.tr.setSelection(u)}})]}}),MF=V.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`,z(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`),n=z(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=mu(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=uu(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=j.near(b,1);v.setSelection(x);let S=p,C=p+f.nodeSize;return v.delete(S,C),v.scrollIntoView(),n.dispatch(v),!0}}},...Af({nodeName:`detailsContent`})}),NF=V.create({name:`detailsSummary`,content:`text*`,defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`summary`}]},renderHTML({HTMLAttributes:e}){return[`summary`,z(this.options.HTMLAttributes,e),0]},...Af({nodeName:`detailsSummary`,content:`inline`})}),PF=jF,FF={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function IF(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.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 LF=(0,t.markRaw)({name:`mingcute-fold-vertical-line`,render:IF}),RF=new F(`detailsBubbleMenu`),zF=PF.extend({addOptions(){return{...this.parent?.(),HTMLAttributes:{class:`details`},getCommandMenuItems(){return{priority:160,icon:(0,t.markRaw)(LF),title:`editor.extensions.details.command_item`,keywords:[`details`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setDetails().updateAttributes(PF.name,{open:!0}).run()}}},getToolbarItems({editor:e}){return{priority:95,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(PF.name),icon:(0,t.markRaw)(LF),title:q.global.t(`editor.extensions.details.command_item`),action:()=>{e.isActive(PF.name)?e.chain().focus().unsetDetails().run():e.chain().focus().setDetails().updateAttributes(PF.name,{open:!0}).run()}}}},getBubbleMenu(){return{pluginKey:RF,shouldShow:({state:e})=>Yu(e,zF.name),options:{placement:`top-start`},getReferencedVirtualElement(){let e=this.editor;if(!e)return null;let t=mu(e=>e.type.name===zF.name)(e.state.selection);if(t){let n=ad(e.view,t.pos,t.pos+t.node.nodeSize);return{getBoundingClientRect:()=>n,getClientRects:()=>[n]}}return null},items:[{priority:10,props:{icon:(0,t.markRaw)(dD),title:q.global.t(`editor.common.button.delete`),action:({editor:e})=>fE(zF.name,e)}}]}}}},addExtensions(){return[NF,MF]}}).configure({persist:!0}),BF=V.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
165
|
+
|
|
166
|
+
`):``}),VF=Uk.configure({width:2,class:`dropcursor`,color:`skyblue`}),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`,"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 WF=(0,t.markRaw)({name:`mingcute-font-size-line`,render:UF}),GF=BA.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)(WF),title:q.global.t(`editor.extensions.font_size.title`)},children:[{priority:0,component:(0,t.markRaw)(D),props:{editor:e,isActive:!1,title:q.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()}}))]}}}}}),KF={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function qF(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,KF,[...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 JF=(0,t.markRaw)({name:`mingcute-brush-3-line`,render:qF}),YF=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},XF=(e,t,n)=>{let{selection:r}=e,i=n||e.tr,{from:a,to:o}=r;return r instanceof Y?r.ranges.forEach(n=>{ZF(i,e,{from:n.$from.pos,to:n.$to.pos},t)}):ZF(i,e,{from:a,to:o},t),i},ZF=(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 Wt(o.from,o.to,t))}),r.forEach(t=>{e.step(new Ut(o.from,o.to,t.mark))})}return!0}})},QF=B.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)(JF),title:n?q.global.t(`editor.extensions.format_brush.toolbar_item.cancel`):q.global.t(`editor.extensions.format_brush.toolbar_item.title`),action:()=>{n?e.commands.pasteFormatBrush():e.commands.copyFormatBrush()}}}}}},addCommands(){return{copyFormatBrush:()=>({state:e})=>{let t=YF(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 P({key:new F(`formatBrushPlugin`),props:{handleDOMEvents:{mouseup(n){e.formatBrush&&t.chain().command(({tr:t})=>(XF(n.state,e.formatBrushMarks,t),!0)).pasteFormatBrush().run()}}}})]},addKeyboardShortcuts(){return{"Shift-Mod-c":()=>(this.editor.commands.copyFormatBrush(),!0)}}}),$F={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function eI(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,$F,[...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 tI=(0,t.markRaw)({name:`mdi-image-plus`,render:eI}),nI={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function rI(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,nI,[...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 iI=(0,t.markRaw)({name:`mingcute-photo-album-line`,render:rI});function aI(e){return e.getAttributes(PI.name).images||[]}function oI(e,t,n=!0){let r=e.chain().updateAttributes(PI.name,{images:t}).setNodeSelection(e.state.selection.from);n&&r.focus(),r.run()}function sI(e){let n=(0,t.ref)(),{open:r,onChange:i}=DD({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===PI.name)?.options.uploadImage),s=t=>{o.value&&(n.value=new AbortController,VK(t,o.value,{controller:n.value,onUploadProgress:()=>{},onFinish:t=>{t&&e.commands.updateAttributes(PI.name,{images:[...aI(e),{src:t.status?.permalink,aspectRatio:0}]})},onError:()=>{}}))};return{openFileDialog:r}}var cI=(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}=sI(a.editor),l=()=>{s.value=!1,c()},u=(0,t.ref)(!1),d=()=>{s.value=!1,u.value=!0};function f(e){let t=aI(a.editor),n=e.map(e=>{let t=r.utils.attachment.getUrl(e);if(t)return{src:t,aspectRatio:0}}).filter(Boolean);oI(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)(q).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)(q).global.t(`editor.extensions.upload.attachment.title`)),1)]),_:1})):(0,t.createCommentVNode)(``,!0)]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(IO,{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)}}}),lI={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function uI(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,lI,[...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 dI=(0,t.markRaw)({name:`mingcute-distribute-spacing-horizontal-line`,render:uI}),fI={class:`w-80`},pI=(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(PI.name).gap);function a(e){r.editor.chain().updateAttributes(PI.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`,fI,[(0,t.createVNode)(PD,{"auto-focus":``,label:(0,t.unref)(q).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)(IO,{title:(0,t.unref)(q).global.t(`editor.extensions.gallery.gap`),text:`${i.value}px`,"show-more-indicator":``},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(dI))]),_:1},8,[`title`,`text`])]),_:1},512),(0,t.createVNode)((0,t.unref)(C),{editor:e.editor},null,8,[`editor`])],64))}}),mI={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function hI(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,mI,[...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 gI=(0,t.markRaw)({name:`mingcute-dot-grid-line`,render:hI}),_I=(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(PI.name).groupSize||3);function o(e){let t=r.editor.getAttributes(PI.name).images||[];r.editor.chain().updateAttributes(PI.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)(IO,{title:(0,t.unref)(q).global.t(`editor.extensions.gallery.group_size`),text:(0,t.unref)(q).global.t(`editor.extensions.gallery.group_size_label`,{count:a.value}),"show-more-indicator":``},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(gI))]),_:1},8,[`title`,`text`])]),_:1},512),(0,t.createVNode)((0,t.unref)(C),{editor:e.editor},null,8,[`editor`])],64))}}),vI={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function yI(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,vI,[...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 bI=(0,t.markRaw)({name:`mingcute-layout-10-line`,render:yI}),xI={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function SI(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,xI,[...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 CI=(0,t.markRaw)({name:`mingcute-layout-grid-line`,render:SI}),wI=(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(PI.name).layout||`auto`),o=[{label:q.global.t(`editor.extensions.gallery.layout.auto`),value:`auto`,icon:bI},{label:q.global.t(`editor.extensions.gallery.layout.square`),value:`square`,icon:CI}],s=(0,t.computed)(()=>o.find(e=>e.value===a.value)||o[0]);function c(e){r.editor.chain().updateAttributes(PI.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)(IO,{title:(0,t.unref)(q).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))}}),TI=B.create({name:`gallery-bubble`,addOptions(){let{parent:e}=this;return{...e?.(),uploadImage:void 0,getBubbleMenu:()=>({extendsKey:NI,items:[{priority:10,component:(0,t.markRaw)(cI),key:`add-image`,props:{icon:(0,t.markRaw)(tI),title:q.global.t(`editor.extensions.gallery.add_image`)}}]})}}}),EI={key:0,class:`relative flex h-full items-center justify-center rounded-md border border-gray-200 bg-gray-50 before:pb-[62.5%]`},DI=[`onDragstart`,`onDragenter`,`onDrop`],OI=[`src`,`alt`,`onLoad`],kI={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`},AI={class:`flex flex-row-reverse`},jI=[`onClick`],MI=(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}=sI(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)(QT),{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`,EI,[(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)(q).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)(q).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,OI),(0,t.createElementVNode)(`div`,kI,[(0,t.createElementVNode)(`div`,AI,[(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)(dD,{class:`size-4`})],8,jI)),[[w,(0,t.unref)(q).global.t(`editor.extensions.upload.operations.remove.button`)]])])])],46,DI))),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`])}}}),NI=new F(`galleryBubbleMenu`),PI=V.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 sE(MI)},addOptions(){return{...this.parent?.(),allowBase64:!1,HTMLAttributes:{},uploadImage:void 0,getToolboxItems({editor:e}){return{priority:15,component:(0,t.markRaw)(gD),props:{editor:e,icon:(0,t.markRaw)(iI),title:q.global.t(`editor.extensions.gallery.title`),action:()=>{e.chain().focus().setGallery({images:[]}).run()}}}},getCommandMenuItems(){return{priority:96,icon:(0,t.markRaw)(iI),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:NI,shouldShow:({state:e})=>Yu(e,PI.name),options:{placement:`top-start`},items:[{priority:10,component:(0,t.markRaw)(cI),key:`add-image`,props:{icon:(0,t.markRaw)(tI),title:q.global.t(`editor.extensions.gallery.add_image`)}},{priority:20,component:(0,t.markRaw)(C)},{priority:30,component:(0,t.markRaw)(_I)},{priority:40,component:(0,t.markRaw)(wI)},{priority:50,component:(0,t.markRaw)(pI)},{priority:60,props:{icon:(0,t.markRaw)(dD),title:q.global.t(`editor.common.button.delete`),action:({editor:e})=>{fE(PI.name,e)}}}]}}}},addExtensions(){return[...this.parent?.()||[],TI.configure({uploadImage:this.options.uploadImage})]}}),FI=class e extends j{start=!1;constructor(e){super(e,e),this.start=BI(e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):j.near(r)}content(){return A.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 II(this.anchor)}static valid(e){if(e.depth<1)return!1;let t=e.doc.childBefore(e.pos).node;return!t||e.parent.isTextblock||!LI(e)&&!RI(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&&!N.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}};FI.prototype.visible=!1,FI.findFrom=FI.findGapCursorFrom,j.jsonID(`node-gap-cursor`,FI);var II=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 FI.valid(t)?new FI(t):j.near(t)}};function LI(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(zI(r.child(n-1),!1))return!0}return!0}function RI(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(zI(r.child(n),!0))return!0}return!0}function zI(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 BI(e){if(e.depth<1)return null;let t=e.start(1),n=e.end(1);return e.pos<t+(n-t)/2}var VI=B.create({priority:900,name:`gapCursor`,addProseMirrorPlugins(){return[new P({key:new F(`custom-gap-cursor`),props:{decorations:qI,createSelectionBetween(e,t,n){return t.pos==n.pos&&FI.valid(n)?new FI(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 FI.valid(i)?(e.dispatch(e.state.tr.setSelection(new FI(i))),!0):!1},handleKeyDown:Kc({ArrowLeft:WI(`horiz`,-1),ArrowRight:WI(`horiz`,1),ArrowUp:WI(`vert`,-1),ArrowDown:WI(`vert`,1),Enter:(e,t)=>{let n=KI(e,!1);return n&&t?(t(n),!0):!1},Backspace:(e,t)=>{let{selection:n,tr:r}=e;if(n instanceof M&&Yu(e,`paragraph`)&&yE(n.$from.parent)&&n.empty){let{$from:i}=n;return i.before(i.depth)===0?!0:(dE(i)(r),t&&GI(-1,`left`,e)(r)?(t(r),!0):!1)}if(!(n instanceof FI)||!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?HI(c,e,t):o.node&&dE(e.doc.resolve(c))(r)?(t(r),!0):!1},Tab:(e,t)=>{let n=KI(e);return n&&t?(t(n),!0):!1}}),handleTextInput(e){let{state:t,dispatch:n}=e,r=KI(t);return r&&n&&n(r),!1},handleDOMEvents:{beforeinput:(e,t)=>{let{state:n,dispatch:r}=e;if(t.inputType!=`insertCompositionText`||!(n.selection instanceof FI))return!1;let i=KI(n);return i&&r&&r(i),!1}}}})]},extendNodeSchema(e){return{allowGapCursor:R(L(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}});function HI(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?UI(i,t,n):FI.valid(i)&&n?(n(r.setSelection(new FI(i))),!0):dE(i)(r)&&n?(n(r),!0):!1}function UI(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(M.create(t.doc,e.pos))),!0)}function WI(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return(e,r,i)=>{let{tr:a}=e;return GI(t,n,e,i)(a)&&r?(r(a),!0):!1}}var GI=(e,t,n,r)=>i=>{let a=n.selection,o=e>0?a.$to:a.$from,s=a.empty;if(a instanceof M){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 FI)return;let c=FI.findGapCursorFrom(o,e,s);if(c)return i.setSelection(new FI(c)),c};function KI(e,t=!0){let{tr:n}=e;if(!(e.selection instanceof FI))return;let{isStart:r,$from:i}=e.selection;if(e.selection instanceof qn||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(M.create(n.doc,c+1)),n.scrollIntoView()),n}function qI(e){if(!(e.selection instanceof FI))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 I.create(e.doc,[Vs.node(r,r+n.nodeSize,{key:`node-gap-cursor`,class:`card-gap-cursor ${i?`start`:`end`}-card-gap-cursor`})])}var JI=V.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`,z(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()}}}),YI=V.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]}`,z(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=>hf({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),XI={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function ZI(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,XI,[...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 QI=(0,t.markRaw)({name:`lucide-heading-1`,render:ZI}),$I={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function eL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,$I,[...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 tL=(0,t.markRaw)({name:`lucide-heading-2`,render:eL}),nL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function rL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,nL,[...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 iL=(0,t.markRaw)({name:`lucide-heading-3`,render:rL}),aL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function oL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,aL,[...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 sL=(0,t.markRaw)({name:`lucide-heading-4`,render:oL}),cL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function lL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,cL,[...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 uL=(0,t.markRaw)({name:`lucide-heading-5`,render:lL}),dL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function fL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,dL,[...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 pL=(0,t.markRaw)({name:`lucide-heading-6`,render:fL}),mL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function hL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,mL,[...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 gL=(0,t.markRaw)({name:`mingcute-paragraph-line`,render:hL}),_L=YI.extend({renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,z(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(XD.name)||e.isActive(YI.name),icon:(0,t.markRaw)(vL(e)),title:q.global.t(`editor.common.heading.title`)},children:[{priority:10,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive(XD.name),icon:(0,t.markRaw)(gL),title:q.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(YI.name,{level:1}),icon:(0,t.markRaw)(QI),title:q.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(YI.name,{level:2}),icon:(0,t.markRaw)(tL),title:q.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(YI.name,{level:3}),icon:(0,t.markRaw)(iL),title:q.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(YI.name,{level:4}),icon:(0,t.markRaw)(sL),title:q.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(YI.name,{level:5}),icon:(0,t.markRaw)(uL),title:q.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(YI.name,{level:6}),icon:(0,t.markRaw)(pL),title:q.global.t(`editor.common.heading.heading6`),action:()=>e.chain().focus().toggleHeading({level:6}).run()}}]}},getCommandMenuItems(){return[{priority:10,icon:(0,t.markRaw)(gL),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)(QI),title:`editor.common.heading.heading1`,keywords:[`h1`,`heading1`,`1`,`yijibiaoti`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode(YI.name,{level:1}).run()}},{priority:30,icon:(0,t.markRaw)(tL),title:`editor.common.heading.heading2`,keywords:[`h2`,`heading2`,`2`,`erjibiaoti`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode(YI.name,{level:2}).run()}},{priority:40,icon:(0,t.markRaw)(iL),title:`editor.common.heading.heading3`,keywords:[`h3`,`heading3`,`3`,`sanjibiaoti`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode(YI.name,{level:3}).run()}},{priority:50,icon:(0,t.markRaw)(sL),title:`editor.common.heading.heading4`,keywords:[`h4`,`heading4`,`4`,`sijibiaoti`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode(YI.name,{level:4}).run()}},{priority:60,icon:(0,t.markRaw)(uL),title:`editor.common.heading.heading5`,keywords:[`h5`,`heading5`,`5`,`wujibiaoti`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode(YI.name,{level:5}).run()}},{priority:70,icon:(0,t.markRaw)(pL),title:`editor.common.heading.heading6`,keywords:[`h6`,`heading6`,`6`,`liujibiaoti`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setNode(YI.name,{level:6}).run()}}]},getDraggableMenuItems(){return{extendsKey:qK,children:{items:[{priority:10,icon:(0,t.markRaw)(gL),title:q.global.t(`editor.common.heading.paragraph`),action:({editor:e})=>e.chain().focus().setParagraph().run()},{priority:20,icon:(0,t.markRaw)(QI),title:q.global.t(`editor.common.heading.heading1`),action:({editor:e})=>e.chain().focus().setHeading({level:1}).run()},{priority:30,icon:(0,t.markRaw)(tL),title:q.global.t(`editor.common.heading.heading2`),action:({editor:e})=>e.chain().focus().setHeading({level:2}).run()},{priority:40,icon:(0,t.markRaw)(iL),title:q.global.t(`editor.common.heading.heading3`),action:({editor:e})=>e.chain().focus().setHeading({level:3}).run()},{priority:50,icon:(0,t.markRaw)(sL),title:q.global.t(`editor.common.heading.heading4`),action:({editor:e})=>e.chain().focus().setHeading({level:4}).run()},{priority:60,icon:(0,t.markRaw)(uL),title:q.global.t(`editor.common.heading.heading5`),action:({editor:e})=>e.chain().focus().setHeading({level:5}).run()},{priority:70,icon:(0,t.markRaw)(pL),title:q.global.t(`editor.common.heading.heading6`),action:({editor:e})=>e.chain().focus().setHeading({level:6}).run()}]}}}}},addProseMirrorPlugins(){let e;return[new P({key:new F(`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===_L.name&&!n}return!1})){let e=r.tr,t=[];return r.doc.descendants((n,r)=>{if(n.type.name===_L.name){let i=i_(n.textContent,t);e.step(new Ln(r,`id`,i)),t.push(i)}}),e}}})]}});function vL(e){return e.isActive(XD.name)?gL:e.isActive(_L.name,{level:1})?QI:e.isActive(_L.name,{level:2})?tL:e.isActive(_L.name,{level:3})?iL:e.isActive(_L.name,{level:4})?sL:e.isActive(_L.name,{level:5})?uL:e.isActive(_L.name,{level:6})?pL:gL}var yL=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,bL=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,xL=Vd.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`,z(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[pf({find:yL,type:this.type})]},addPasteRules(){return[zf({find:bL,type:this.type})]}}),SL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function CL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,SL,[...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 wL=(0,t.markRaw)({name:`mingcute-mark-pen-line`,render:CL}),TL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function EL(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:`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 DL=(0,t.markRaw)({name:`mingcute-close-line`,render:EL}),OL={class:`p-1`},kL={class:`inline-flex items-center gap-2`},AL={class:`p-1`},jL={class:`text-xs text-gray-600`},ML=(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(NL.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`,OL,[(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`,kL,[(0,t.createVNode)((0,t.unref)(DL)),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(q).global.t(`editor.extensions.highlight.unset`)),1)])])]),(0,t.createElementVNode)(`div`,AL,[(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`,jL,(0,t.toDisplayString)((0,t.unref)(q).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}))}}),NL=xL.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:80,component:(0,t.markRaw)(ML),props:{editor:e,isActive:e.isActive(xL.name),icon:(0,t.markRaw)(wL),title:q.global.t(`editor.common.highlight`)}}}}}}).configure({multicolor:!0}),PL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function FL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,PL,[...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 IL=(0,t.markRaw)({name:`mdi-redo-variant`,render:FL}),LL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function RL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,LL,[...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 zL=(0,t.markRaw)({name:`mdi-undo-variant`,render:RL}),BL=Kk.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)(zL),title:q.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)(IL),title:q.global.t(`editor.menus.redo`),action:()=>e.chain().redo().focus().run()}}]}}}}),VL=V.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,z(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!Sf(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return td(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(M.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(N.create(t.doc,n.pos)):t.setSelection(M.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(M.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[mf({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),HL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function UL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,HL,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M3 21V3h18v18zM5 5v14h14V5z`},null,-1)]])}var WL=(0,t.markRaw)({name:`mdi-border-all-variant`,render:UL}),GL={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function KL(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,GL,[...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 qL=(0,t.markRaw)({name:`mdi-border-none-variant`,render:KL}),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:`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 XL=(0,t.markRaw)({name:`mdi-web`,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)(`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 $L=(0,t.markRaw)({name:`mdi-web-sync`,render:QL}),eR={class:`relative max-h-72 w-56 overflow-hidden overflow-y-auto`},tR=(0,t.defineComponent)({__name:`BubbleItemIframeAlign`,props:{editor:{},isActive:{},visible:{type:Function,default:()=>!0},icon:{},iconStyle:{},title:{},action:{}},setup(e){let r=e,i=[{text:q.global.t(`editor.common.align_left`),value:`left`,icon:AO},{text:q.global.t(`editor.common.align_center`),value:`center`,icon:DO},{text:q.global.t(`editor.common.align_right`),value:`right`,icon:NO},{text:q.global.t(`editor.common.align_justify`),value:`justify`,icon:zO}],a=(0,t.computed)(()=>{let e=r.editor.getAttributes(XD.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`,eR,[((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)(IO,{title:(0,t.unref)(q).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)}}}),nR={class:`w-80`},rR=(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(TR.name).src,set:e=>{!e||!_E(e)||n.editor.chain().updateAttributes(TR.name,{src:e}).run()}});return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,nR,[(0,t.createVNode)(PD,{modelValue:r.value,"onUpdate:modelValue":n[0]||=e=>r.value=e,"auto-focus":``,placeholder:(0,t.unref)(q).global.t(`editor.common.placeholder.link_input`),label:(0,t.unref)(q).global.t(`editor.extensions.iframe.src_input_label`)},null,8,[`modelValue`,`placeholder`,`label`])]))}}),iR={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function aR(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,iR,[...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 oR=(0,t.markRaw)({name:`mdi-image-size-select-small`,render:aR}),sR={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function cR(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,sR,[...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 lR=(0,t.markRaw)({name:`mingcute-cellphone-line`,render:cR}),uR={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function dR(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,uR,[...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 fR=(0,t.markRaw)({name:`mingcute-imac-line`,render:dR}),pR={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function mR(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,pR,[...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 hR=(0,t.markRaw)({name:`mingcute-pad-line`,render:mR}),gR={class:`flex w-56 flex-col gap-3`},_R={class:`flex flex-col items-center gap-3`},vR={class:`flex items-center gap-1 rounded-md bg-gray-100 p-1`},yR=[`onClick`],bR=(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(TR.name).width,set:e=>{o(e,a.value)}}),a=(0,t.computed)({get:()=>r.editor.getAttributes(TR.name).height,set:e=>{o(i.value,e)}}),o=(e,t)=>{r.editor.chain().updateAttributes(TR.name,{width:e,height:t}).focus().setNodeSelection(r.editor.state.selection.from).run()},s=[{width:`390px`,height:`844px`,icon:lR,title:q.global.t(`editor.extensions.iframe.phone_size`)},{width:`834px`,height:`1194px`,icon:hR,title:q.global.t(`editor.extensions.iframe.tablet_vertical_size`)},{width:`1194px`,height:`834px`,icon:hR,iconStyle:`transform: rotate(90deg)`,title:q.global.t(`editor.extensions.iframe.tablet_horizontal_size`)},{width:`100%`,height:`834px`,icon:fR,title:q.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`,gR,[(0,t.createElementVNode)(`div`,_R,[(0,t.createVNode)(PD,{modelValue:i.value,"onUpdate:modelValue":r[0]||=e=>i.value=e,label:(0,t.unref)(q).global.t(`editor.common.width`),tooltip:(0,t.unref)(q).global.t(`editor.common.tooltip.custom_width_input`)},null,8,[`modelValue`,`label`,`tooltip`]),(0,t.createVNode)(PD,{modelValue:a.value,"onUpdate:modelValue":r[1]||=e=>a.value=e,label:(0,t.unref)(q).global.t(`editor.common.height`),tooltip:(0,t.unref)(q).global.t(`editor.common.tooltip.custom_height_input`)},null,8,[`modelValue`,`label`,`tooltip`])]),(0,t.createElementVNode)(`div`,vR,[((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,yR),[[c,e.title]])),64))])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(IO,{title:(0,t.unref)(q).global.t(`editor.extensions.iframe.resize`),"show-more-indicator":``},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(oR))]),_:1},8,[`title`])]),_:1})}}}),xR={key:0,class:`p-1.5`},SR=[`src`,`width`,`height`,`frameborder`],CR=(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||!_E(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)(QT),{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,SR)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,xR,[(0,t.createVNode)(PD,{ref:`inputRef`,modelValue:r.value,"onUpdate:modelValue":o[0]||=e=>r.value=e,modelModifiers:{lazy:!0},placeholder:(0,t.unref)(q).global.t(`editor.common.placeholder.link_input`),tabindex:`-1`,"auto-focus":``,onFocus:a},null,8,[`modelValue`,`placeholder`])]))],4)]),_:1}))}}),wR=new F(`iframeBubbleMenu`),TR=V.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||!_E(t)?!1:{src:t}}}]},renderHTML({HTMLAttributes:e}){return _E(e.src)?[`iframe`,z(e)]:[`iframe`,z({...e,src:``})]},addCommands(){return{setIframe:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[mf({find:/^\$iframe\$$/,type:this.type,getAttributes:()=>({width:`100%`})})]},addPasteRules(){return[Bf({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 sE(CR)},addOptions(){return{getCommandMenuItems(){return{priority:90,icon:(0,t.markRaw)(XL),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)(gD),props:{editor:e,icon:(0,t.markRaw)(XL),title:q.global.t(`editor.extensions.commands_menu.iframe`),action:()=>{e.chain().focus().insertContent([{type:`iframe`,attrs:{src:``}}]).run()}}}]},getBubbleMenu({editor:e}){return{pluginKey:wR,shouldShow:({state:e})=>Yu(e,TR.name),items:[{priority:10,props:{isActive:()=>e.getAttributes(TR.name).frameborder===`1`,icon:(0,t.markRaw)(e.getAttributes(TR.name).frameborder===`1`?WL:qL),action:()=>{e.chain().updateAttributes(TR.name,{frameborder:e.getAttributes(TR.name).frameborder===`1`?`0`:`1`}).focus().setNodeSelection(e.state.selection.from).run()},title:e.getAttributes(TR.name).frameborder===`1`?q.global.t(`editor.extensions.iframe.disable_frameborder`):q.global.t(`editor.extensions.iframe.enable_frameborder`)}},{priority:20,component:(0,t.markRaw)(C)},{priority:30,component:(0,t.markRaw)(bR)},{priority:40,component:(0,t.markRaw)(tR)},{priority:50,component:(0,t.markRaw)(C)},{priority:60,props:{icon:(0,t.markRaw)($L),action:()=>{e.chain().updateAttributes(TR.name,{src:e.getAttributes(TR.name).src}).run()}}},{priority:70,props:{icon:(0,t.markRaw)(tD),title:q.global.t(`editor.common.button.edit_link`),action:()=>(0,t.markRaw)(rR)}},{priority:80,props:{icon:(0,t.markRaw)(sD),title:q.global.t(`editor.common.tooltip.open_link`),action:()=>{window.open(e.getAttributes(TR.name).src,`_blank`)}}},{priority:90,props:{icon:(0,t.markRaw)(dD),title:q.global.t(`editor.common.button.delete`),action:({editor:e})=>{fE(TR.name,e)}}}]}}}}}),ER=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,DR=V.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`,z(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?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{let c=document.createElement(`img`);Object.entries(o).forEach(([e,t])=>{if(t!=null)switch(e){case`width`:case`height`:break;default:c.setAttribute(e,t);break}}),c.src=o.src;let l=new bf({element:c,editor:s,node:i,getPos:a,onResize:(e,t)=>{c.style.width=`${e}px`,c.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}}),u=l.dom;return u.style.visibility=`hidden`,u.style.pointerEvents=`none`,c.onload=()=>{u.style.visibility=``,u.style.pointerEvents=``},l}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[mf({find:ER,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),OR={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function kR(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,OR,[...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 AR=(0,t.markRaw)({name:`mingcute-bookmark-edit-line`,render:kR}),jR={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function MR(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,jR,[...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:`M9 2a2 2 0 0 0-2 2v1a1 1 0 0 0 2 0V4h1a1 1 0 1 0 0-2zm5 0a1 1 0 1 0 0 2h1a1 1 0 1 0 0-2zm5 0a1 1 0 1 0 0 2h1v1a1 1 0 1 0 2 0V4a2 2 0 0 0-2-2zm3 7a1 1 0 1 0-2 0v1a1 1 0 1 0 2 0zm0 5a1 1 0 1 0-2 0v1h-1a1 1 0 1 0 0 2h1a2 2 0 0 0 2-2zM4 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z`})],-1)]])}var NR=(0,t.markRaw)({name:`mingcute-copy-3-fill`,render:MR}),PR={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function FR(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,PR,[...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 IR=(0,t.markRaw)({name:`mingcute-edit-4-line`,render:FR}),LR={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function RR(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,LR,[...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 zR=(0,t.markRaw)({name:`mingcute-link-2-line`,render:RR}),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)(`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 HR=(0,t.markRaw)({name:`mingcute-pic-line`,render:VR}),UR={key:0,class:`w-56`},WR=(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`,UR,[(0,t.createVNode)(PD,{modelValue:r.value,"onUpdate:modelValue":a[0]||=e=>r.value=e,"auto-focus":``,label:(0,t.unref)(q).global.t(`editor.common.alt`),placeholder:(0,t.unref)(q).global.t(`editor.common.placeholder.alt_input`)},null,8,[`modelValue`,`label`,`placeholder`])])):(0,t.createCommentVNode)(``,!0)}}),GR={class:`w-80`},KR={class:`mt-3 inline-flex items-center`},qR={class:`ml-2 text-sm text-gray-500`},JR=(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(NU.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(NU.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`,GR,[e.visible?.({editor:n.editor})?((0,t.openBlock)(),(0,t.createBlock)(PD,{key:0,modelValue:r.value,"onUpdate:modelValue":o[0]||=e=>r.value=e,"auto-focus":``,placeholder:(0,t.unref)(q).global.t(`editor.common.placeholder.alt_href`),label:(0,t.unref)(q).global.t(`editor.extensions.image.href_input_label`)},null,8,[`modelValue`,`placeholder`,`label`])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`label`,KR,[(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`,qR,(0,t.toDisplayString)((0,t.unref)(q).global.t(`editor.extensions.link.open_in_new_window`)),1)])]))}}),YR={key:0,class:`w-80`},XR=(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`,YR,[(0,t.createVNode)(PD,{modelValue:r.value,"onUpdate:modelValue":a[0]||=e=>r.value=e,"auto-focus":``,label:(0,t.unref)(q).global.t(`editor.extensions.image.src_input_label`),placeholder:(0,t.unref)(q).global.t(`editor.common.placeholder.link_input`)},null,8,[`modelValue`,`label`,`placeholder`])])):(0,t.createCommentVNode)(``,!0)}}),ZR={class:`relative max-h-72 w-56 overflow-hidden overflow-y-auto`},QR=(0,t.defineComponent)({__name:`BubbleItemImagePosition`,props:{editor:{},isActive:{},visible:{type:Function,default:()=>!0},icon:{},iconStyle:{},title:{},action:{}},setup(e){let r=e,i=[{text:q.global.t(`editor.common.align_left`),value:`start`,icon:AO},{text:q.global.t(`editor.common.align_center`),value:`center`,icon:DO},{text:q.global.t(`editor.common.align_right`),value:`end`,icon:NO}],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().setBlockPosition(e).run()};return(s,c)=>{let l=(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`,ZR,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(i,e=>(0,t.withDirectives)((0,t.createVNode)(ae,{key:e.value,"is-active":(0,t.unref)(Yu)(r.editor.state,(0,t.unref)(sO).name,{alignItems:e.value}),onClick:t=>o(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.text),1)]),_:2},1032,[`is-active`,`onClick`]),[[l]])),64))])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(IO,{title:(0,t.unref)(q).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)}}}),$R={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function ez(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,$R,[...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 tz=(0,t.markRaw)({name:`mdi-backup-restore`,render:ez}),nz={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function rz(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,nz,[...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 iz=(0,t.markRaw)({name:`mdi-image-size-select-actual`,render:rz}),az={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function oz(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,az,[...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 sz=(0,t.markRaw)({name:`mdi-image-size-select-large`,render:oz}),cz={class:`flex w-56 flex-col gap-3`},lz={class:`flex flex-col items-center gap-3`},uz={class:`flex items-center gap-1 rounded-md bg-gray-100 p-1`},dz=[`onClick`],fz=(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=du(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:oR,title:q.global.t(`editor.extensions.image.small_size`)},{width:`50%`,height:`auto`,icon:sz,title:q.global.t(`editor.extensions.image.medium_size`)},{width:`100%`,height:`auto`,icon:iz,title:q.global.t(`editor.extensions.image.large_size`)},{width:void 0,height:void 0,icon:tz,title:q.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`,cz,[(0,t.createElementVNode)(`div`,lz,[(0,t.createVNode)(PD,{modelValue:i.value,"onUpdate:modelValue":c[0]||=e=>i.value=e,label:(0,t.unref)(q).global.t(`editor.common.width`),tooltip:(0,t.unref)(q).global.t(`editor.common.tooltip.custom_width_input`)},null,8,[`modelValue`,`label`,`tooltip`]),(0,t.createVNode)(PD,{modelValue:a.value,"onUpdate:modelValue":c[1]||=e=>a.value=e,label:(0,t.unref)(q).global.t(`editor.common.height`),tooltip:(0,t.unref)(q).global.t(`editor.common.tooltip.custom_height_input`)},null,8,[`modelValue`,`label`,`tooltip`])]),(0,t.createElementVNode)(`div`,uz,[((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,dz),[[l,e.title]])),64))])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(IO,{title:(0,t.unref)(q).global.t(`editor.extensions.image.resize`),"show-more-indicator":``},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(oR))]),_:1},8,[`title`])]),_:1})):(0,t.createCommentVNode)(``,!0)}}}),pz={key:0,class:`relative`},mz=[`src`,`title`,`alt`,`href`,`width`,`height`],hz={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`},gz={key:2,class:`absolute top-0 size-full bg-black bg-opacity-20`},_z={class:`absolute top-[50%] w-full space-y-2 text-white`},vz={class:`px-10`},yz={class:`relative h-4 w-full overflow-hidden rounded-full bg-gray-200`},bz={class:`absolute left-[50%] top-0 -translate-x-[50%] text-xs leading-4 text-white`},xz={class:`px-10`},Sz={class:`relative h-4 w-full overflow-hidden rounded-full bg-gray-200`},Cz={class:`absolute left-[50%] top-0 -translate-x-[50%] text-xs leading-4 text-white`},wz=(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)(()=>{let e=i.getPos();if(!e)return`start`;let t=pu(i.editor.state.doc.resolve(e),e=>e.type.name===sO.name);return t?t.node.attrs.alignItems:`start`}),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 HK(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}=UD(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)(QT),{as:`div`,class:(0,t.normalizeClass)([`flex w-full`,{[`justify-${c.value}`]:!0}])},{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`,pz,[(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,mz),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`,hz,[(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)(q).global.t(`editor.extensions.upload.operations.transfer.button`)),1)]),_:1},8,[`loading`,`onClick`])),[[C,(0,t.unref)(q).global.t(`editor.extensions.upload.operations.transfer.tooltip`)]]):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(HD),{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`,gz,[(0,t.createElementVNode)(`div`,_z,[d.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`div`,vz,[(0,t.createElementVNode)(`div`,yz,[x[0]||=(0,t.createElementVNode)(`div`,{class:`size-full bg-red-600`},null,-1),(0,t.createElementVNode)(`div`,bz,(0,t.toDisplayString)((0,t.unref)(q).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)(q).global.t(`editor.extensions.upload.click_retry`)),1)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`div`,xz,[(0,t.createElementVNode)(`div`,Sz,[(0,t.createElementVNode)(`div`,{class:`h-full bg-primary`,style:(0,t.normalizeStyle)({width:`${u.value||0}%`})},null,4),(0,t.createElementVNode)(`div`,Cz,(0,t.toDisplayString)(u.value?`${u.value}%`:`${(0,t.unref)(q).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)(q).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)(BD),{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`])}}}),Tz=new F(`imageBubbleMenu`),X=DR.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})},file:{default:null,renderHTML(){return{}},parseHTML(){return null}}}},addNodeView(){return sE(wz)},parseHTML(){return[{tag:this.options.allowBase64?`img`:`img:not([src^="data:"])`}]},addProseMirrorPlugins(){return[new P({key:new F(`imageLegacyFormat`),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!==X.name)return;let r=n.doc.resolve(t);if(r.parent.type.name===sO.name)return;let a=`start`,o=!1,s=-1,c=0,l=r.nodeBefore;l&&l.type.name===XD.name&&(l.attrs.textAlign&&(a={left:`start`,center:`center`,right:`end`,justify:`center`}[l.attrs.textAlign]??`start`),l.textContent?.trim().length===0&&(o=!0,s=t-l.nodeSize,c=l.nodeSize));let u=n.schema.nodes.figure.create({contentType:`image`,alignItems:a},[e]);i.push({pos:t,node:e,figureNode:u,deletePreviousNode:o,previousNodePos:s,previousNodeSize:c})}),i.reverse().forEach(e=>{e.deletePreviousNode?(r.delete(e.previousNodePos,e.previousNodePos+e.previousNodeSize),r.replaceRangeWith(e.pos-e.previousNodeSize,e.pos-e.previousNodeSize+e.node.nodeSize,e.figureNode)):r.replaceRangeWith(e.pos,e.pos+e.node.nodeSize,e.figureNode)}),i.length>0?r:null}})]},addOptions(){return{...this.parent?.(),uploadImage:void 0,getToolboxItems({editor:e}){return[{priority:10,component:(0,t.markRaw)(gD),props:{editor:e,icon:(0,t.markRaw)(HR),title:q.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)(HR),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:Tz,shouldShow:({state:e})=>Yu(e,X.name),options:{placement:`top-start`},items:[{priority:10,component:(0,t.markRaw)(fz),props:{visible({editor:e}){return!BE(e.getAttributes(X.name).src)}}},{priority:20,component:(0,t.markRaw)(QR),props:{visible({editor:e}){return!BE(e.getAttributes(X.name).src)}}},{priority:25,props:{icon:(0,t.markRaw)(NR),title:q.global.t(`editor.extensions.image.copy_width`),action:()=>{let t=e.getAttributes(X.name).width,n=e.state.tr;e.state.doc.descendants((r,i,a)=>{if(r.type.name===X.name&&(n.setNodeAttribute(i,`width`,t),a?.type.name===sO.name)){let r=e.state.doc.resolve(i),a=pu(r,e=>e.type.name===sO.name);if(a){let i=du(a.node,e=>e.type.name===oO.name)[0];if(i){let o=e.view.nodeDOM(r.pos).querySelector(`img`),s=t||(o?.naturalWidth?`${o.naturalWidth}px`:void 0);n.setNodeAttribute(a.pos+i.pos+1,`width`,s)}}}}),e.view.dispatch(n)}}},{priority:30,component:(0,t.markRaw)(C),props:{visible({editor:e}){return!BE(e.getAttributes(X.name).src)}}},{priority:40,props:{icon:(0,t.markRaw)(tD),title:q.global.t(`editor.common.button.edit_link`),action:()=>(0,t.markRaw)(XR)}},{priority:50,props:{visible({editor:e}){return!BE(e.getAttributes(X.name).src)},icon:(0,t.markRaw)(sD),title:q.global.t(`editor.common.tooltip.open_link`),action:()=>{window.open(e.getAttributes(X.name).src,`_blank`)}}},{priority:60,props:{visible({editor:e}){return!BE(e.getAttributes(X.name).src)},icon:(0,t.markRaw)(IR),title:q.global.t(`editor.extensions.image.edit_alt`),action:()=>(0,t.markRaw)(WR)}},{priority:70,props:{visible({editor:e}){return!BE(e.getAttributes(X.name).src)},icon:(0,t.markRaw)(zR),title:q.global.t(`editor.extensions.image.edit_href`),action:()=>(0,t.markRaw)(JR)}},{priority:80,props:{visible({editor:e}){return!BE(e.getAttributes(X.name).src)},icon:(0,t.markRaw)(AR),title:q.global.t(`editor.extensions.image.edit_caption`),action:({editor:e})=>{let t=mu(e=>e.type.name===sO.name)(e.state.selection);if(!t)return;let{node:n,pos:r}=t,i=-1;if(n.forEach((e,t)=>{e.type.name===oO.name&&(i=r+t+1)}),i!==-1){e.chain().focus().setTextSelection(i).run();return}let a=du(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(M.near(e.doc.resolve(t+1))),!0}).run()}}},{priority:90,component:(0,t.markRaw)(C)},{priority:100,props:{icon:(0,t.markRaw)(dD),title:q.global.t(`editor.common.button.delete`),action:({editor:e})=>{fE(mu(e=>e.type.name===sO.name)(e.state.selection)?sO.name:X.name,e)}}}]}}}},renderHTML({HTMLAttributes:e}){return e.href?[`a`,{href:e.href},[`img`,z(e)]]:[`img`,z(e)]}}).configure({inline:!0,allowBase64:!1,HTMLAttributes:{loading:`lazy`}}),Ez=V.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`,z(this.options.HTMLAttributes,e),0]}}),Dz=V.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`,z(this.options.HTMLAttributes,e),0]}}),Oz=V.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,z(this.options.HTMLAttributes,e),0]}});function kz(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function Az(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]=kz(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=kz(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 jz=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`)),Az(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,Az(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 Mz(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]=kz(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 Nz(e,t){return t?e.createChecked(null,t):e.createAndFill()}function Pz(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 Fz(e,t,n,r,i){let a=Pz(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=Nz(a.cell,i);if(e&&s.push(e),r){let e=Nz(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 Iz(e){return e instanceof Y}var Lz=({editor:e})=>{let{selection:t}=e.state;if(!Iz(t))return!1;let n=0;return pu(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 Rz(e){return(e||``).replace(/\s+/g,` `).trim()}function zz(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=Rz(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 Bz=zz,Vz=V.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:jz,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=Mz(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,z(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)=>Bz(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=Fz(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(M.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>Rw(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>zw(e,t),deleteColumn:()=>({state:e,dispatch:t})=>Vw(e,t),addRowBefore:()=>({state:e,dispatch:t})=>Ww(e,t),addRowAfter:()=>({state:e,dispatch:t})=>Gw(e,t),deleteRow:()=>({state:e,dispatch:t})=>qw(e,t),deleteTable:()=>({state:e,dispatch:t})=>cT(e,t),mergeCells:()=>({state:e,dispatch:t})=>Xw(e,t),splitCell:()=>({state:e,dispatch:t})=>Zw(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>nT(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>nT(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>aT(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>Xw(e,t)?!0:Zw(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>$w(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>sT(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>sT(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&Pw(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:Lz,"Mod-Backspace":Lz,Delete:Lz,"Mod-Delete":Lz}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[jT({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],GT({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){return{tableRole:R(L(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}});B.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(Vz.configure(this.options.table)),this.options.tableCell!==!1&&e.push(Ez.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(Dz.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(Oz.configure(this.options.tableRow)),e}});var Hz={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Uz(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Hz,[...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 Wz=(0,t.markRaw)({name:`fluent-table-column-top-bottom-24-regular`,render:Uz}),Gz={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Kz(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Gz,[...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 qz=(0,t.markRaw)({name:`mdi-table`,render:Kz}),Jz={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Yz(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Jz,[...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 Xz=(0,t.markRaw)({name:`mdi-table-column-plus-after`,render:Yz}),Zz={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Qz(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Zz,[...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 $z=(0,t.markRaw)({name:`mdi-table-column-plus-before`,render:Qz}),eB={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function tB(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,eB,[...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 nB=(0,t.markRaw)({name:`mdi-table-column-remove`,render:tB}),rB={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function iB(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,rB,[...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 aB=(0,t.markRaw)({name:`mdi-table-headers-eye`,render:iB}),oB={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function sB(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,oB,[...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 cB=(0,t.markRaw)({name:`mdi-table-merge-cells`,render:sB}),lB={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function uB(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,lB,[...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 dB=(0,t.markRaw)({name:`mdi-table-plus`,render:uB}),fB={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function pB(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,fB,[...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 mB=(0,t.markRaw)({name:`mdi-table-remove`,render:pB}),hB={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function gB(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,hB,[...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 _B=(0,t.markRaw)({name:`mdi-table-row-plus-after`,render:gB}),vB={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function yB(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,vB,[...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 bB=(0,t.markRaw)({name:`mdi-table-row-plus-before`,render:yB}),xB={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function SB(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,xB,[...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 CB=(0,t.markRaw)({name:`mdi-table-row-remove`,render:SB}),wB={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function TB(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,wB,[...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 EB=(0,t.markRaw)({name:`mdi-table-split-cell`,render:TB}),DB={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function OB(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,DB,[...n[0]||=[(0,t.createElementVNode)(`path`,{fill:`currentColor`,d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z`},null,-1)]])}var kB=(0,t.markRaw)({name:`mdi-plus`,render:OB}),AB=e=>{let t=IB(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},jB=e=>t=>n=>{let r=IB(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},MB=jB(`column`),NB=jB(`row`),PB=e=>t=>{let n=IB(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},[])}},FB=e=>t=>{let n=IB(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},[])}},IB=e=>mu(e=>e.type.spec.tableRole===`table`)(e),LB=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},RB=e=>e instanceof Y,zB=e=>t=>{if(RB(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 LB({left:i.left,right:i.right,top:0,bottom:n.height})(t)}return!1},BB=e=>t=>{if(RB(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 LB({left:0,right:n.width,top:i.top,bottom:i.bottom})(t)}return!1},VB=e=>{if(RB(e)){let t=J.get(e.$anchorCell.node(-1));return LB({left:0,right:t.width,top:0,bottom:t.height})(e)}return!1},HB=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`)},UB=e=>GB(1)(e),WB=e=>GB(-1)(e),GB=e=>t=>{let n=Iw(t);if(n.table){let t=n.map,r=t.cellsInRect(n),i=KB(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}},KB=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)},qB=V.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`,z(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 P({key:new F(`table-cell-control`),props:{decorations(i){let{doc:a,selection:o}=i,s=[],c=PB(0)(o);return c&&c.forEach(({pos:i},a)=>{a===0&&s.push(Vs.widget(i+1,()=>{let t=`table`+a,n=`grip-table`;VB(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(AB(e.state.tr))})),i.className=n,r.gripMap.set(t,i),i})),s.push(Vs.widget(i+1,()=>{let i=`row`+a,s=BB(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)(kB,{class:`plus-icon`}),popper:()=>q.global.t(`editor.menus.table.add_row_after`)}),u),u.addEventListener(`mousedown`,t=>{t.preventDefault(),t.stopImmediatePropagation(),e.view.dispatch(NB(a)(e.state.tr)),t.target!==u&&Gw(e.state,e.view.dispatch)},!0)),u.className=l,r.gripMap.set(i,u),u}))}),I.create(a,s)}}})]}}),JB=V.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`,z(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 P({key:new F(`table-header-control`),props:{decorations(i){let{doc:a,selection:o}=i,s=[],c=FB(0)(o);return c&&c.forEach(({pos:i},a)=>{s.push(Vs.widget(i+1,()=>{let i=`column`+a,s=zB(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)(kB,{class:`plus-icon`}),popper:()=>q.global.t(`editor.menus.table.add_column_after`)}),u),u.addEventListener(`mousedown`,t=>{t.preventDefault(),t.stopImmediatePropagation(),e.view.dispatch(MB(a)(e.state.tr)),t.target!==u&&zw(e.state,e.view.dispatch)})),u.className=l,r.gripMap.set(i,u),u}))}),I.create(a,s)}}})]}}),YB=Oz.extend({allowGapCursor:!1,addAttributes(){return{style:{default:`height: 60px;`,parseHTML:e=>e.getAttribute(`style`)}}}});function XB(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 ZB=void 0,QB=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(!ZB)return!1;let{view:e}=ZB;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`)),XB(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,XB(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}))}},$B=new F(`tableBubbleMenu`),eV=Vz.extend({allowGapCursor:!0,addExtensions(){return[qB,YB,JB]},addOptions(){return{...this.parent?.(),HTMLAttributes:{},resizable:!0,handleWidth:5,cellMinWidth:25,View:QB,lastColumnResizable:!0,allowTableNodeSelection:!1,getToolboxItems({editor:e}){return{priority:40,component:(0,t.markRaw)(gD),props:{editor:e,icon:(0,t.markRaw)(dB),title:q.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)(qz),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:$B,shouldShow:({state:e})=>Yu(e,eV.name),options:{placement:`bottom-start`},getReferencedVirtualElement(){let e=this.editor;if(!e)return null;let t=mu(e=>e.type.name===eV.name)(e.state.selection);if(t){let n=ad(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)($z),title:q.global.t(`editor.menus.table.add_column_before`),action:()=>{e.chain().focus().addColumnBefore().run()}}},{priority:20,props:{icon:(0,t.markRaw)(Xz),title:q.global.t(`editor.menus.table.add_column_after`),action:()=>e.chain().focus().addColumnAfter().run()}},{priority:30,props:{icon:(0,t.markRaw)(nB),title:q.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)(bB),title:q.global.t(`editor.menus.table.add_row_before`),action:()=>e.chain().focus().addRowBefore().run()}},{priority:60,props:{icon:(0,t.markRaw)(_B),title:q.global.t(`editor.menus.table.add_row_after`),action:()=>e.chain().focus().addRowAfter().run()}},{priority:70,props:{icon:(0,t.markRaw)(CB),title:q.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)(aB),title:q.global.t(`editor.menus.table.toggle_header_column`),action:()=>e.chain().focus().toggleHeaderColumn().run()}},{priority:100,props:{icon:(0,t.markRaw)(aB),title:q.global.t(`editor.menus.table.toggle_header_row`),action:()=>e.chain().focus().toggleHeaderRow().run()}},{priority:101,props:{icon:(0,t.markRaw)(Wz),title:q.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)(cB),title:q.global.t(`editor.menus.table.merge_cells`),action:()=>e.chain().focus().mergeCells().run()}},{priority:130,props:{icon:(0,t.markRaw)(EB),title:q.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)(mB),title:q.global.t(`editor.menus.table.delete_table`),action:()=>e.chain().focus().deleteTable().run()}}]}},getDraggableMenuItems(){return{extendsKey:qK,visible({editor:e}){return!Yu(e.state,`table`)}}}}},addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(e.commands.undoInputRule())return!0;let{selection:t}=e.state;return!Gl(e.state,eV.name)&&HB(e.state)&&t.empty?(e.commands.selectNodeBackward(),!0):Gl(e.state,eV.name)&&VB(e.state.selection)?(e.commands.deleteTable(),!0):!1};return{Backspace:()=>e(),"Mod-Backspace":()=>e(),"Mod-a":({editor:e})=>{if(!Gl(e.state,eV.name))return!1;let{tr:t,selection:n}=e.state;if(VB(n))return!0;if(RB(n))return AB(t),e.view.dispatch(t),!0;let r=mu(e=>e.type.name===qB.name)(n);return r||=mu(e=>e.type.name===JB.name)(n),r?(e.commands.setNodeSelection(r.pos),!0):!1},Tab:({editor:e})=>{let{state:t}=e;if(!Yu(e.state,eV.name))return!1;let n=e.view,r=e.state.tr,i=UB(t);return i||e.chain().addRowAfter().command(({tr:e,view:t,state:a})=>(n=t,r=e,i=UB(a),!0)),i?(r.setSelection(new M(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(!Yu(e.state,eV.name))return!1;let n=WB(e.state);return n&&(t.setSelection(new M(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}=Mz(e,this.options.cellMinWidth??25);return[`div`,{style:`overflow-x: auto; overflow-y: hidden;`},[`table`,z(this.options.HTMLAttributes??{},t??{},{style:r?`width: ${r}`:`minWidth: ${i}`}),n,[`tbody`,0]]]},onTransaction(){ZB=this.editor}}).configure({resizable:!0}),tV=B.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=aV(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=aV(e,this.options,r.extensionManager.extensions,`outdent`),e.docChanged&&n&&n(e),!0}}},addKeyboardShortcuts(){return{Tab:cV(),"Shift-Tab":lV(!1),"Mod-]":cV(),"Mod-[":lV(!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 lV(!1)({editor:e})}return!1}}},onUpdate(){let{editor:e}=this;if(e.isActive(pk.name)){let t=e.state.selection.$head.node();t.attrs.indent&&e.commands.updateAttributes(t.type.name,{indent:0})}}}),nV=(e,t,n)=>e<t?t:e>n?n:e;function rV(e,t,n,r){if(!e.doc)return e;let i=e.doc.nodeAt(t);if(!i)return e;if(r.firstLineIndent&&iV(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=nV((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 iV=e=>{let{selection:t}=e,{$from:n,from:r,to:i}=t;return r==0?!0:r==i?n.textOffset==0:!1},aV=(e,t,n,r)=>{let{doc:i,selection:a}=e;if(!i||!a||!(a instanceof M))return e;let{from:o,to:s}=a;return i.nodesBetween(o,s,(i,a)=>t.names.includes(i.type.name)?(oV(e,a)&&r===`indent`?e.insertText(` `,o,s):e=rV(e,a,r===`indent`?1:-1,t),!1):!$u(i.type.name,n)),e},oV=(e,t)=>{let{selection:n}=e,{from:r,to:i}=n;return r==0?!1:r-i==0&&t!=r-1},sV=e=>e.isActive(eV.name)||e.isActive(nN.name),cV=()=>({editor:e})=>{if(sV(e))return!1;if(vE(e)){let t=e.can().sinkListItem(`listItem`)?`listItem`:`taskItem`;return e.chain().focus().sinkListItem(t).run()}return e.chain().focus().indent().run()},lV=e=>({editor:t})=>{if(e&&t.state.selection.$head.parentOffset>0||sV(t))return!1;if(vE(t)){let e=t.can().liftListItem(`listItem`)?`listItem`:`taskItem`;return t.chain().focus().liftListItem(e).run()}return t.chain().focus().outdent().run()},uV=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,dV=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,fV=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,pV=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,mV=Vd.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`,z(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[pf({find:uV,type:this.type}),pf({find:fV,type:this.type})]},addPasteRules(){return[zf({find:dV,type:this.type}),zf({find:pV,type:this.type})]}}),hV={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function gV(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,hV,[...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 _V=(0,t.markRaw)({name:`mingcute-italic-line`,render:gV}),vV=mV.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:50,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(mV.name),icon:(0,t.markRaw)(_V),title:q.global.t(`editor.common.italic`),action:()=>e.chain().focus().toggleItalic().run()}}}}}}),yV=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,bV=`ελ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`,xV=`numeric`,SV=`ascii`,CV=`alpha`,wV=`asciinumeric`,TV=`alphanumeric`,EV=`domain`,DV=`emoji`,OV=`scheme`,kV=`slashscheme`,AV=`whitespace`;function jV(e,t){return e in t||(t[e]=[]),t[e]}function MV(e,t,n){t[xV]&&(t[wV]=!0,t[TV]=!0),t[SV]&&(t[wV]=!0,t[CV]=!0),t[wV]&&(t[TV]=!0),t[CV]&&(t[TV]=!0),t[TV]&&(t[EV]=!0),t[DV]&&(t[EV]=!0);for(let r in t){let t=jV(r,n);t.indexOf(e)<0&&t.push(e)}}function NV(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function PV(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}PV.groups={},PV.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||=PV.groups;let i;return t&&t.j?i=t:(i=new PV(t),n&&r&&MV(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||=PV.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 PV,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new PV,a&&(r&&(o.t&&typeof o.t==`string`?MV(a,Object.assign(NV(o.t,r),n),r):n&&MV(a,n,r)),o.t=a),i.j[e]=o,o}};var Z=(e,t,n,r,i)=>e.ta(t,n,r,i),FV=(e,t,n,r,i)=>e.tr(t,n,r,i),IV=(e,t,n,r,i)=>e.ts(t,n,r,i),Q=(e,t,n,r,i)=>e.tt(t,n,r,i),LV=`WORD`,RV=`UWORD`,zV=`ASCIINUMERICAL`,BV=`ALPHANUMERICAL`,VV=`LOCALHOST`,HV=`TLD`,UV=`UTLD`,WV=`SCHEME`,GV=`SLASH_SCHEME`,KV=`NUM`,qV=`WS`,JV=`NL`,YV=`OPENBRACE`,XV=`CLOSEBRACE`,ZV=`OPENBRACKET`,QV=`CLOSEBRACKET`,$V=`OPENPAREN`,eH=`CLOSEPAREN`,tH=`OPENANGLEBRACKET`,nH=`CLOSEANGLEBRACKET`,rH=`FULLWIDTHLEFTPAREN`,iH=`FULLWIDTHRIGHTPAREN`,aH=`LEFTCORNERBRACKET`,oH=`RIGHTCORNERBRACKET`,sH=`LEFTWHITECORNERBRACKET`,cH=`RIGHTWHITECORNERBRACKET`,lH=`FULLWIDTHLESSTHAN`,uH=`FULLWIDTHGREATERTHAN`,dH=`AMPERSAND`,fH=`APOSTROPHE`,pH=`ASTERISK`,mH=`AT`,hH=`BACKSLASH`,gH=`BACKTICK`,_H=`CARET`,vH=`COLON`,yH=`COMMA`,bH=`DOLLAR`,xH=`DOT`,SH=`EQUALS`,CH=`EXCLAMATION`,wH=`HYPHEN`,TH=`PERCENT`,EH=`PIPE`,DH=`PLUS`,OH=`POUND`,kH=`QUERY`,AH=`QUOTE`,jH=`FULLWIDTHMIDDLEDOT`,MH=`SEMI`,NH=`SLASH`,PH=`TILDE`,FH=`UNDERSCORE`,IH=`EMOJI`,LH=`SYM`,RH=Object.freeze({__proto__:null,ALPHANUMERICAL:BV,AMPERSAND:dH,APOSTROPHE:fH,ASCIINUMERICAL:zV,ASTERISK:pH,AT:mH,BACKSLASH:hH,BACKTICK:gH,CARET:_H,CLOSEANGLEBRACKET:nH,CLOSEBRACE:XV,CLOSEBRACKET:QV,CLOSEPAREN:eH,COLON:vH,COMMA:yH,DOLLAR:bH,DOT:xH,EMOJI:IH,EQUALS:SH,EXCLAMATION:CH,FULLWIDTHGREATERTHAN:uH,FULLWIDTHLEFTPAREN:rH,FULLWIDTHLESSTHAN:lH,FULLWIDTHMIDDLEDOT:jH,FULLWIDTHRIGHTPAREN:iH,HYPHEN:wH,LEFTCORNERBRACKET:aH,LEFTWHITECORNERBRACKET:sH,LOCALHOST:VV,NL:JV,NUM:KV,OPENANGLEBRACKET:tH,OPENBRACE:YV,OPENBRACKET:ZV,OPENPAREN:$V,PERCENT:TH,PIPE:EH,PLUS:DH,POUND:OH,QUERY:kH,QUOTE:AH,RIGHTCORNERBRACKET:oH,RIGHTWHITECORNERBRACKET:cH,SCHEME:WV,SEMI:MH,SLASH:NH,SLASH_SCHEME:GV,SYM:LH,TILDE:PH,TLD:HV,UNDERSCORE:FH,UTLD:UV,UWORD:RV,WORD:LV,WS:qV}),zH=/[a-z]/,BH=/\p{L}/u,VH=/\p{Emoji}/u,HH=/\d/,UH=/\s/,WH=`\r`,GH=`
|
|
173
|
+
`,KH=`️`,qH=``,JH=``,YH=null,XH=null;function ZH(e=[]){let t={};PV.groups=t;let n=new PV;YH??=tU(yV),XH??=tU(bV),Q(n,`'`,fH),Q(n,`{`,YV),Q(n,`}`,XV),Q(n,`[`,ZV),Q(n,`]`,QV),Q(n,`(`,$V),Q(n,`)`,eH),Q(n,`<`,tH),Q(n,`>`,nH),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,`*`,pH),Q(n,`@`,mH),Q(n,"`",gH),Q(n,`^`,_H),Q(n,`:`,vH),Q(n,`,`,yH),Q(n,`$`,bH),Q(n,`.`,xH),Q(n,`=`,SH),Q(n,`!`,CH),Q(n,`-`,wH),Q(n,`%`,TH),Q(n,`|`,EH),Q(n,`+`,DH),Q(n,`#`,OH),Q(n,`?`,kH),Q(n,`"`,AH),Q(n,`/`,NH),Q(n,`;`,MH),Q(n,`~`,PH),Q(n,`_`,FH),Q(n,`\\`,hH),Q(n,`・`,jH);let r=FV(n,HH,KV,{[xV]:!0});FV(r,HH,r);let i=FV(r,zH,zV,{[wV]:!0}),a=FV(r,BH,BV,{[TV]:!0}),o=FV(n,zH,LV,{[SV]:!0});FV(o,HH,i),FV(o,zH,o),FV(i,HH,i),FV(i,zH,i);let s=FV(n,BH,RV,{[CV]:!0});FV(s,zH),FV(s,HH,a),FV(s,BH,s),FV(a,HH,a),FV(a,zH),FV(a,BH,a);let c=Q(n,GH,JV,{[AV]:!0}),l=Q(n,WH,qV,{[AV]:!0}),u=FV(n,UH,qV,{[AV]:!0});Q(n,JH,u),Q(l,GH,c),Q(l,JH,u),FV(l,UH,u),Q(u,WH),Q(u,GH),FV(u,UH,u),Q(u,JH,u);let d=FV(n,VH,IH,{[DV]:!0});Q(d,`#`),FV(d,VH,d),Q(d,KH,d);let f=Q(d,qH);Q(f,`#`),FV(f,VH,d);let p=[[zH,o],[HH,i]],m=[[zH,null],[BH,s],[HH,a]];for(let e=0;e<YH.length;e++)eU(n,YH[e],HV,LV,p);for(let e=0;e<XH.length;e++)eU(n,XH[e],UV,RV,m);MV(HV,{tld:!0,ascii:!0},t),MV(UV,{utld:!0,alpha:!0},t),eU(n,`file`,WV,LV,p),eU(n,`mailto`,WV,LV,p),eU(n,`http`,GV,LV,p),eU(n,`https`,GV,LV,p),eU(n,`ftp`,GV,LV,p),eU(n,`ftps`,GV,LV,p),MV(WV,{scheme:!0,ascii:!0},t),MV(GV,{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]?{[OV]:!0}:{[kV]:!0};r.indexOf(`-`)>=0?i[EV]=!0:zH.test(r)?HH.test(r)?i[wV]=!0:i[SV]=!0:i[xV]=!0,IV(n,r,r,i)}return IV(n,`localhost`,VV,{ascii:!0}),n.jd=new PV(LH),{start:n,tokens:Object.assign({groups:t},RH)}}function QH(e,t){let n=$H(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 $H(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 eU(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 PV(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new PV(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function tU(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 nU={defaultProtocol:`http`,events:null,format:iU,formatHref:iU,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function rU(e,t=null){let n=Object.assign({},nU);e&&(n=Object.assign(n,e instanceof rU?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}rU.prototype={o:nU,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]:nU[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 iU(e){return e}function aU(e,t){this.t=`token`,this.v=e,this.tk=t}aU.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=nU.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 oU(e,t){class n extends aU{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 sU=oU(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),cU=oU(`text`),lU=oU(`nl`),uU=oU(`url`,{isLink:!0,toHref(e=nU.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==VV&&e[1].t===vH}}),dU=e=>new PV(e);function fU({groups:e}){let t=e.domain.concat([dH,pH,mH,hH,gH,_H,bH,SH,wH,KV,TH,EH,DH,OH,NH,LH,PH,FH]),n=[fH,vH,yH,xH,CH,TH,kH,AH,MH,tH,nH,YV,XV,QV,ZV,$V,eH,rH,iH,aH,oH,sH,cH,lH,uH],r=[dH,fH,pH,hH,gH,_H,bH,SH,wH,YV,XV,TH,EH,DH,OH,kH,NH,LH,PH,FH],i=dU(),a=Q(i,PH);Z(a,r,a),Z(a,e.domain,a);let o=dU(),s=dU(),c=dU();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,mH);Q(a,mH,l),Q(s,mH,l),Q(c,mH,l);let u=Q(a,xH);Z(u,r,a),Z(u,e.domain,a);let d=dU();Z(l,e.domain,d),Z(d,e.domain,d);let f=Q(d,xH);Z(f,e.domain,d);let p=dU(sU);Z(f,e.tld,p),Z(f,e.utld,p),Q(l,VV,p);let m=Q(d,wH);Q(m,wH,m),Z(m,e.domain,d),Z(p,e.domain,d),Q(p,xH,f),Q(p,wH,m),Z(Q(p,vH),e.numeric,sU);let h=Q(o,wH),g=Q(o,xH);Q(h,wH,h),Z(h,e.domain,o),Z(g,r,a),Z(g,e.domain,o);let _=dU(uU);Z(g,e.tld,_),Z(g,e.utld,_),Z(_,e.domain,o),Z(_,r,a),Q(_,xH,g),Q(_,wH,h),Q(_,mH,l);let v=Q(_,vH),y=dU(uU);Z(v,e.numeric,y);let b=dU(uU),x=dU();Z(b,t,b),Z(b,n,x),Z(x,t,b),Z(x,n,x),Q(_,NH,b),Q(y,NH,b);let S=Q(s,vH),C=Q(Q(Q(c,vH),NH),NH);Z(s,e.domain,o),Q(s,xH,g),Q(s,wH,h),Z(c,e.domain,o),Q(c,xH,g),Q(c,wH,h),Z(S,e.domain,b),Q(S,NH,b),Q(S,kH,b),Z(C,e.domain,b),Z(C,t,b),Q(C,NH,b);let w=[[YV,XV],[ZV,QV],[$V,eH],[tH,nH],[rH,iH],[aH,oH],[sH,cH],[lH,uH]];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=dU(uU);Z(a,t,o);let s=dU();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,VV,_),Q(i,JV,lU),{start:i,tokens:RH}}function pU(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(mU(cU,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(mU(e,t,r))}}return o.length>0&&a.push(mU(cU,t,o)),a}function mU(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var hU=typeof console<`u`&&console&&console.warn||(()=>{}),gU=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,_U={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function vU(){return PV.groups={},_U.scanner=null,_U.parser=null,_U.tokenQueue=[],_U.pluginQueue=[],_U.customSchemes=[],_U.initialized=!1,_U}function yU(e,t=!1){if(_U.initialized&&hU(`linkifyjs: already initialized - will not register custom scheme "${e}" ${gU}`),!/^[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`);_U.customSchemes.push([e,t])}function bU(){_U.scanner=ZH(_U.customSchemes);for(let e=0;e<_U.tokenQueue.length;e++)_U.tokenQueue[e][1]({scanner:_U.scanner});_U.parser=fU(_U.scanner.tokens);for(let e=0;e<_U.pluginQueue.length;e++)_U.pluginQueue[e][1]({scanner:_U.scanner,parser:_U.parser});return _U.initialized=!0,_U}function xU(e){return _U.initialized||bU(),pU(_U.parser.start,e,QH(_U.scanner.start,e))}xU.scan=QH;function SU(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 rU(n),i=xU(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 CU(e,t=null){let n=xU(e);return n.length===1&&n[0].isLink&&(!t||n[0].t===t)}var wU=`[\0- \xA0 -\u2029 ]`,TU=new RegExp(wU),EU=RegExp(`${wU}$`),DU=new RegExp(wU,`g`);function OU(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function kU(e){return new P({key:new F(`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(Vu(lu(n.doc,[...t])).forEach(({newRange:t})=>{let n=fu(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(!EU.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(TU).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=xU(n).map(t=>t.toObject(e.defaultProtocol));if(!OU(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=>{Uu(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 AU(e){return new P({key:new F(`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 t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=Ru(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function jU(e){return new P({key:new F(`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=SU(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function MU(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(DU,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,`i`))}var NU=Vd.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`){yU(e);return}yU(e.scheme,e.optionalSlashes)})},onDestroy(){vU()},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)=>!!MU(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},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=>!!MU(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=>!!MU(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,z(this.options.HTMLAttributes,e),0]:[`a`,z(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=>!!MU(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=>!!MU(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[zf({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=SU(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!MU(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(kU({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!MU(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(AU({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(jU({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}),PU={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function FU(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,PU,[...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 IU=(0,t.markRaw)({name:`mingcute-list-check-3-line`,render:FU}),LU={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function RU(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,LU,[...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 zU=(0,t.markRaw)({name:`mingcute-list-ordered-line`,render:RU}),BU=Pk.extend({addOptions(){return{...this.parent?.(),getCommandMenuItems(){return{priority:140,icon:(0,t.markRaw)(zU),title:`editor.common.ordered_list`,keywords:[`orderedlist`,`youxuliebiao`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleOrderedList().run()}}}}},addExtensions(){return[pk]}}),VU=Lk.extend({addOptions(){return{...this.parent?.(),getCommandMenuItems(){return{priority:150,icon:(0,t.markRaw)(IU),title:`editor.common.task_list`,keywords:[`tasklist`,`renwuliebiao`],command:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleTaskList().run()}}}}},addExtensions(){return[Ik]}}),HU=[Vk.name,BU.name,VU.name],UU=B.create({name:`list-extra`,addOptions(){return{getToolbarItems({editor:e}){return e.extensionManager.extensions.some(e=>HU.includes(e.name))?{priority:130,component:(0,t.markRaw)(E),props:{editor:e,isActive:WU(e),icon:(0,t.markRaw)(GU(e)),title:q.global.t(`editor.common.list`)},children:qU(e)}:[]}}}});function WU(e){return e.isActive(Vk.name)||e.isActive(BU.name)||e.isActive(VU.name)}function GU(e){return e.isActive(Vk.name)?Bk:e.isActive(BU.name)?zU:e.isActive(VU.name)?IU:Bk}function KU(e,t){return e.extensionManager.extensions.some(e=>e.name===t)}function qU(e){let n=[];return KU(e,Vk.name)&&n.push({priority:10,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive(Vk.name),icon:(0,t.markRaw)(Bk),title:q.global.t(`editor.common.bullet_list`),action:()=>e.chain().focus().toggleBulletList().run()}}),KU(e,BU.name)&&n.push({priority:20,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive(BU.name),icon:(0,t.markRaw)(zU),title:q.global.t(`editor.common.ordered_list`),action:()=>e.chain().focus().toggleOrderedList().run()}}),KU(e,VU.name)&&n.push({priority:30,component:(0,t.markRaw)(D),props:{editor:e,isActive:e.isActive(VU.name),icon:(0,t.markRaw)(IU),title:q.global.t(`editor.common.task_list`),action:()=>e.chain().focus().toggleTaskList().run()}}),n}var JU=Tk.extend({addKeyboardShortcuts(){let e=e=>{let t=!1;return e.state.selection.empty?(this.options.listTypes?.forEach(({itemName:n,wrapperNames:r})=>{mk.handleBackspace(e,n,r)&&(t=!0)}),t):!1};return{Backspace:({editor:t})=>e(t),"Mod-Backspace":({editor:t})=>e(t)}}}),YU=B.create({name:`nodeSelected`,addOptions(){return{className:`has-node-selected`}},addProseMirrorPlugins(){return[new P({key:new F(`nodeSelectedByAttr`),props:{decorations:({doc:e})=>{let{isEditable:t,isFocused:n}=this.editor,r=[];return!t||!n?I.create(e,[]):(e.descendants((e,t)=>{if(e.isText||!e.attrs.selected)return!1;r.push(Vs.node(t,t+e.nodeSize,{class:this.options.className}))}),I.create(e,r))}}})]}}),XU=Wk.configure({placeholder:q.global.t(`editor.extensions.commands_menu.placeholder`)}),ZU={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function QU(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,ZU,[...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 $U=(0,t.markRaw)({name:`mingcute-list-search-line`,render:QU}),eW={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function tW(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,eW,[...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 nW=(0,t.markRaw)({name:`lucide-replace`,render:tW}),rW={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function iW(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,rW,[...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 aW=(0,t.markRaw)({name:`lucide-replace-all`,render:iW}),oW={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function sW(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,oW,[...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 cW=(0,t.markRaw)({name:`mdi-format-letter-case`,render:sW}),lW={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function uW(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,lW,[...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 dW=(0,t.markRaw)({name:`mdi-format-letter-matches`,render:uW}),fW={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function pW(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,fW,[...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 mW=(0,t.markRaw)({name:`mdi-regex`,render:pW}),hW={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function gW(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,hW,[...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 _W=(0,t.markRaw)({name:`mingcute-arrow-down-line`,render:gW}),vW={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function yW(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,vW,[...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 bW=(0,t.markRaw)({name:`mingcute-arrow-up-line`,render:yW}),xW=[`disabled`],SW=(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,xW))}}),CW=(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))}}),wW=[`onKeydown`],TW={class:`flex w-full flex-col gap-2`},EW={class:`relative flex items-center`},DW={class:`relative w-full max-w-[55%]`},OW=[`placeholder`,`onKeydown`],kW={class:`absolute inset-y-0 end-0 flex items-center gap-1 pr-1`},AW={class:`mx-2 min-w-[130px] text-sm`},jW={key:1},MW={class:`absolute right-0 flex h-full items-center`},NW={class:`flex items-center`},PW={class:`relative w-full max-w-[55%]`},FW=[`placeholder`,`onKeydown`],IW={class:`mx-2 flex items-center gap-2`},LW=(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`,TW,[(0,t.createElementVNode)(`div`,EW,[(0,t.createElementVNode)(`div`,DW,[(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)(q).global.t(`editor.extensions.search_and_replace.search_placeholder`),tabindex:`2`,onKeydown:(0,t.withKeys)((0,t.withModifiers)(d,[`prevent`]),[`enter`])},null,40,OW),[[t.vModelText,i.value]]),(0,t.createElementVNode)(`div`,kW,[(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)(CW,{"is-active":s.value,onClick:l[1]||=e=>s.value=!s.value},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(cW))]),_:1},8,[`is-active`])),[[(0,t.unref)(n.vTooltip),(0,t.unref)(q).global.t(`editor.extensions.search_and_replace.case_sensitive`)]]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)(CW,{"is-active":c.value,onClick:l[2]||=e=>c.value=!c.value},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(dW))]),_:1},8,[`is-active`])),[[(0,t.unref)(n.vTooltip),(0,t.unref)(q).global.t(`editor.extensions.search_and_replace.match_word`)]]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)(CW,{"is-active":o.value,onClick:l[3]||=e=>o.value=!o.value},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(mW))]),_:1},8,[`is-active`])),[[(0,t.unref)(n.vTooltip),(0,t.unref)(q).global.t(`editor.extensions.search_and_replace.use_regex`)]])])]),(0,t.createElementVNode)(`div`,AW,[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)(q).global.t(`editor.extensions.search_and_replace.not_found`)),3)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,jW,(0,t.toDisplayString)((0,t.unref)(q).global.t(`editor.extensions.search_and_replace.occurrence_found`,{index:u.value.findIndex+1,total:u.value.findCount})),1))]),(0,t.createElementVNode)(`div`,MW,[(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)(SW,{disabled:u.value.findCount===0,onClick:f},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(bW))]),_:1},8,[`disabled`])),[[(0,t.unref)(n.vTooltip),(0,t.unref)(q).global.t(`editor.extensions.search_and_replace.find_previous`)]]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)(SW,{disabled:u.value.findCount===0,onClick:d},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(_W))]),_:1},8,[`disabled`])),[[(0,t.unref)(n.vTooltip),(0,t.unref)(q).global.t(`editor.extensions.search_and_replace.find_next`)]]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)(SW,{onClick:g},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(DL))]),_:1})),[[(0,t.unref)(n.vTooltip),(0,t.unref)(q).global.t(`editor.extensions.search_and_replace.close`)]])])]),(0,t.createElementVNode)(`div`,NW,[(0,t.createElementVNode)(`div`,PW,[(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)(q).global.t(`editor.extensions.search_and_replace.replace_placeholder`),tabindex:`2`,onKeydown:(0,t.withKeys)((0,t.withModifiers)(m,[`prevent`]),[`enter`])},null,40,FW),[[t.vModelText,a.value]])]),(0,t.createElementVNode)(`div`,IW,[(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)(SW,{disabled:u.value.findCount===0,onClick:m},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(nW))]),_:1},8,[`disabled`])),[[(0,t.unref)(n.vTooltip),(0,t.unref)(q).global.t(`editor.extensions.search_and_replace.replace`)]]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)(SW,{disabled:u.value.findCount===0,onClick:h},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(aW))]),_:1},8,[`disabled`])),[[(0,t.unref)(n.vTooltip),(0,t.unref)(q).global.t(`editor.extensions.search_and_replace.replace_all`)]])])])])],40,wW)]),_:1},512)),[[t.vShow,e.visible]])}}),RW=new F(`searchAndReplace`),zW=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}},BW=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(RW);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&&bF(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=Vs.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(Vs.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`)}},VW=e=>new P({key:RW,view:t=>new zW({view:t,...e}),state:{init:()=>new BW({...e}),apply:(e,t)=>t.apply(e)},props:{decorations:e=>{let t=RW.getState(e);if(t){let{searchResultDecorations:n,findIndexDecoration:r,enable:i}=t;if(!i)return I.empty;let a=[...n];if(r&&a.push(r),a.length>0)return I.create(e.doc,a)}return I.empty}}}),HW=(0,t.h)(LW);function UW(){let e=HW.component;return e?e.props.visible:!1}var WW=B.create({name:`searchAndReplace`,addOptions(){return{getToolbarItems({editor:e}){return[{priority:230,component:(0,t.markRaw)(E),props:{editor:e,isActive:UW(),icon:(0,t.markRaw)($U),title:q.global.t(`editor.extensions.search_and_replace.title`),action:()=>{let t=HW.component;t&&(t.props.visible?e.commands.closeSearch():e.commands.openSearch())}}}]}}},addCommands(){return{replace:()=>({state:e,dispatch:t})=>{let n=RW.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(RW,{setFindIndex:a,refresh:!0}),t(n)}return!1},replaceAll:()=>({state:e,dispatch:t})=>{let n=RW.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=RW.getState(e);if(!r)return!1;let{findIndex:i}=r;n.setMeta(RW,{setFindIndex:i+1}),t(n)}return!1},findPrevious:()=>({state:e,dispatch:t})=>{if(t){let n=RW.getState(e);if(!n)return!1;let{findIndex:r}=n,i=e.tr;i.setMeta(RW,{setFindIndex:r-1}),t(i)}return!1},openSearch:()=>({state:e,dispatch:t})=>{if(!RW.getState(e))return!1;let n=HW.component;if(n){n.props.visible=!0;let r=e.tr;r.setMeta(RW,{setEnable:!0}),t&&t(r)}return!1},closeSearch:()=>({state:e,dispatch:t})=>{if(!RW.getState(e))return!1;let n=HW.component;if(n){n.props.visible=!1;let r=e.tr;r.setMeta(RW,{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`,HW.props={editor:this.editor,pluginKey:RW,visible:!1},(0,t.render)(HW,e),[VW({editor:this.editor,element:e})]},addKeyboardShortcuts(){return{"Mod-f":()=>(this.editor.commands.openSearch(),!0)}}}),GW=B.create({name:`smartScroll`,addOptions(){return{scrollContainer:void 0,topThreshold:150,bottomThreshold:150,smooth:!1}},addProseMirrorPlugins(){let e=this.options,t=0;return[new P({key:new F(`smartScroll`),view(){return{update(n,r){if(!r)return;let{state:i}=n,{doc:a,selection:o}=i,s=r.doc!==a,c=!r.selection.eq(o),l=Date.now()-t<100;(s||c&&!l)&&requestAnimationFrame(()=>{KW(n,e)})}}},props:{handleDOMEvents:{mousedown:()=>(t=Date.now(),!1)}}})]}}),KW=(e,t)=>{try{let{state:n}=e,{selection:r}=n,i=e.coordsAtPos(r.$head.pos);if(!i)return;let a=null;if(t.scrollContainer)a=typeof t.scrollContainer==`function`?t.scrollContainer(e):typeof t.scrollContainer==`string`?document.querySelector(t.scrollContainer):t.scrollContainer;else{let t=e.dom;a=qW(t)}if(!a)return;let o=a.getBoundingClientRect(),s=o.top,c=o.bottom,l=i.top,u=i.bottom,d=l-s,f=c-u,p=0;if(d<t.topThreshold&&d>0?p=d-t.topThreshold:f<t.bottomThreshold&&f>0?p=t.bottomThreshold-f:d<0?p=d-t.topThreshold:f<0&&(p=t.bottomThreshold-f),p!==0){let e=a.scrollTop+p;a.scrollTo?a.scrollTo({top:e,behavior:t.smooth?`smooth`:`instant`}):a.scrollTop=e}}catch(e){console.debug(`Smart scroll error:`,e)}},qW=e=>{let t=e;for(;t&&t!==document.body;){let e=window.getComputedStyle(t).overflowY;if((e===`auto`||e===`scroll`)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return document.documentElement},JW=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,YW=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,XW=Vd.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`,z(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[pf({find:JW,type:this.type})]},addPasteRules(){return[zf({find:YW,type:this.type})]}}),ZW={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function QW(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,ZW,[...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 $W=(0,t.markRaw)({name:`mingcute-strikethrough-line`,render:QW}),eG=XW.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:70,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(XW.name),icon:(0,t.markRaw)($W),title:q.global.t(`editor.common.strike`),action:()=>e.chain().focus().toggleStrike().run()}}}}}}),tG=Vd.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`,z(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()}}}),nG={viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`};function rG(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,nG,[...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 iG=(0,t.markRaw)({name:`ph-text-subscript`,render:rG}),aG=tG.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:120,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(tG.name),icon:(0,t.markRaw)(iG),title:q.global.t(`editor.common.subscript`),action:()=>e.chain().focus().toggleSubscript().run()}}}}}}),oG=Vd.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`,z(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()}}}),sG={viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`};function cG(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,sG,[...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 lG=(0,t.markRaw)({name:`ph-text-superscript`,render:cG}),uG=oG.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:110,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(oG.name),icon:(0,t.markRaw)(lG),title:q.global.t(`editor.common.superscript`),action:()=>e.chain().focus().toggleSuperscript().run()}}}}}}),dG=V.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),fG={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function pG(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,fG,[...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 mG=(0,t.markRaw)({name:`mingcute-underline-line`,render:pG}),hG={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function gG(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,hG,[...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 _G=(0,t.markRaw)({name:`mingcute-unlink-line`,render:gG}),vG={class:`p-1`},yG={class:`text-xs text-gray-600`},bG=(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`,vG,[(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`,yG,(0,t.toDisplayString)((0,t.unref)(q).global.t(`editor.common.button.restore_default`)),1)])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Yq),(0,t.mergeProps)(n,{editor:e.editor}),null,16,[`editor`])]),_:1}))}}),xG={class:`p-1`},SG={class:`inline-flex items-center gap-2`},CG={class:`p-1`},wG={class:`text-xs text-gray-600`},TG=(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(NL.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`,xG,[(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`,SG,[(0,t.createVNode)((0,t.unref)(DL)),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(q).global.t(`editor.extensions.highlight.unset`)),1)])])]),(0,t.createElementVNode)(`div`,CG,[(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`,wG,(0,t.toDisplayString)((0,t.unref)(q).global.t(`editor.common.button.restore_default`)),1)])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Yq),(0,t.mergeProps)(n,{onClick:a[0]||=e=>r()}),null,16)]),_:1}))}}),EG={class:`relative w-96`},DG={class:`mr-2 mt-2 inline-flex items-center`},OG={class:`ml-2 text-sm text-gray-500`},kG={class:`mt-2 inline-flex items-center`},AG={class:`ml-2 text-sm text-gray-500`},jG=(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(NU.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(NU.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(NU.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 M){if(n)return!1;let{content:e}=t.content();if(!e||e.childCount!==1)return!1;let i=e.firstChild?.textContent;i&&CU(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`,EG,[(0,t.createVNode)(PD,{modelValue:i.value,"onUpdate:modelValue":c[0]||=e=>i.value=e,modelModifiers:{lazy:!0},"auto-focus":``,placeholder:(0,t.unref)(q).global.t(`editor.extensions.link.placeholder`)},null,8,[`modelValue`,`placeholder`]),(0,t.createElementVNode)(`label`,DG,[(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`,OG,(0,t.toDisplayString)((0,t.unref)(q).global.t(`editor.extensions.link.open_in_new_window`)),1)]),(0,t.createElementVNode)(`label`,kG,[(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`,AG,(0,t.toDisplayString)((0,t.unref)(q).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)(tD))],2)),[[(0,t.unref)(n.vTooltip),e.isActive?.({editor:e.editor})?(0,t.unref)(q).global.t(`editor.extensions.link.edit_link`):(0,t.unref)(q).global.t(`editor.extensions.link.add_link`)]])]),_:1}))}}),MG=Vd.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`,z(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()}}}),NG=MG.extend({addOptions(){return{...this.parent?.(),getToolbarItems({editor:e}){return{priority:60,component:(0,t.markRaw)(E),props:{editor:e,isActive:e.isActive(MG.name),icon:(0,t.markRaw)(mG),title:q.global.t(`editor.common.underline`),action:()=>e.chain().focus().toggleUnderline().run()}}}}}}),PG={class:`relative max-h-72 w-56 overflow-hidden overflow-y-auto`},FG=(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:q.global.t(`editor.common.heading.paragraph`),icon:gL,action:()=>r.editor.chain().focus().setParagraph().run(),isActive:()=>r.editor.isActive(XD.name)},{text:q.global.t(`editor.common.heading.heading1`),icon:QI,action:()=>r.editor.chain().focus().setHeading({level:1}).run(),isActive:()=>r.editor.isActive(_L.name,{level:1})},{text:q.global.t(`editor.common.heading.heading2`),icon:tL,action:()=>r.editor.chain().focus().setHeading({level:2}).run(),isActive:()=>r.editor.isActive(_L.name,{level:2})},{text:q.global.t(`editor.common.heading.heading3`),icon:iL,action:()=>r.editor.chain().focus().setHeading({level:3}).run(),isActive:()=>r.editor.isActive(_L.name,{level:3})},{text:q.global.t(`editor.common.heading.heading4`),icon:sL,action:()=>r.editor.chain().focus().setHeading({level:4}).run(),isActive:()=>r.editor.isActive(_L.name,{level:4})},{text:q.global.t(`editor.common.heading.heading5`),icon:uL,action:()=>r.editor.chain().focus().setHeading({level:5}).run(),isActive:()=>r.editor.isActive(_L.name,{level:5})},{text:q.global.t(`editor.common.heading.heading6`),icon:pL,action:()=>r.editor.chain().focus().setHeading({level:6}).run(),isActive:()=>r.editor.isActive(_L.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`,PG,[((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)(IO,{title:(0,t.unref)(q).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})}}}),IG=[`audio`,`video`,`image`,`iframe`,`codeBlock`],LG=new F(`textBubbleMenu`),RG=dG.extend({addOptions(){return{...this.parent?.(),getBubbleMenu(){return{pluginKey:LG,shouldShow:({state:e,from:t,to:n})=>{let{doc:r,selection:i}=e,{empty:a}=i;return!(a||IG.some(t=>Yu(e,t))||r.textBetween(t||0,n||0).length===0||!yl(i)&&!(i instanceof $D))},items:[{priority:10,component:(0,t.markRaw)(FG)},{priority:20,component:(0,t.markRaw)(C)},{priority:30,props:{isActive:({editor:e})=>e.isActive(ok.name),icon:(0,t.markRaw)(ak),title:q.global.t(`editor.common.bold`),action:({editor:e})=>{e.chain().focus().toggleBold().run()}}},{priority:40,props:{isActive:({editor:e})=>e.isActive(vV.name),icon:(0,t.markRaw)(_V),title:q.global.t(`editor.common.italic`),action:({editor:e})=>{e.chain().focus().toggleItalic().run()}}},{priority:50,props:{isActive:({editor:e})=>e.isActive(NG.name),icon:(0,t.markRaw)(mG),title:q.global.t(`editor.common.underline`),action:({editor:e})=>e.chain().focus().toggleUnderline().run()}},{priority:60,props:{isActive:({editor:e})=>e.isActive(eG.name),icon:(0,t.markRaw)($W),title:q.global.t(`editor.common.strike`),action:({editor:e})=>e.chain().focus().toggleStrike().run()}},{priority:70,component:(0,t.markRaw)(TG),props:{isActive:({editor:e})=>e.isActive(NL.name),icon:(0,t.markRaw)(wL),title:q.global.t(`editor.common.highlight`)}},{priority:80,component:(0,t.markRaw)(bG),props:{isActive:({editor:e})=>e.isActive(LM.name),icon:(0,t.markRaw)(KA),title:q.global.t(`editor.common.color`)}},{priority:90,props:{isActive:({editor:e})=>e.isActive(rA.name),icon:(0,t.markRaw)(nA),title:q.global.t(`editor.common.code`),action:({editor:e})=>e.chain().focus().toggleCode().run()}},{priority:100,props:{isActive:({editor:e})=>e.isActive(uG.name),icon:(0,t.markRaw)(lG),title:q.global.t(`editor.common.superscript`),action:({editor:e})=>e.chain().focus().toggleSuperscript().run()}},{priority:110,props:{isActive:({editor:e})=>e.isActive(aG.name),icon:(0,t.markRaw)(iG),title:q.global.t(`editor.common.subscript`),action:({editor:e})=>e.chain().focus().toggleSubscript().run()}},{priority:120,component:(0,t.markRaw)(jG),props:{isActive:({editor:e})=>e.isActive(NU.name)}},{priority:130,props:{isActive:()=>!1,visible:({editor:e})=>e.isActive(NU.name),icon:(0,t.markRaw)(_G),title:q.global.t(`editor.extensions.link.cancel_link`),action:({editor:e})=>e.commands.unsetLink()}},{priority:140,props:{isActive:()=>!1,visible:({editor:e})=>e.isActive(NU.name),icon:(0,t.markRaw)(sD),title:q.global.t(`editor.common.tooltip.open_link`),action:({editor:e})=>{let t=e.getAttributes(NU.name);t?.href&&window.open(t.href,`_blank`)}}}]}}}}}),zG=B.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`)}}}).extend().configure({types:[`heading`,`paragraph`]});function BG({types:e,node:t}){return Array.isArray(e)&&e.includes(t.type)||t.type===e}var VG=B.create({name:`trailingNode`,addOptions(){return{node:`paragraph`,notAfter:[`paragraph`]}},addProseMirrorPlugins(){let e=new F(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 P({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!BG({node:i,types:t})},apply:(e,r)=>{if(!n||!e.docChanged)return r;let i=e.doc.lastChild;return!BG({node:i,types:t})}}})]}}),HG={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function UG(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,HG,[...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 WG=(0,t.markRaw)({name:`lucide-captions`,render:UG}),GG={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function KG(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,GG,[...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 qG=(0,t.markRaw)({name:`mdi-cog-play`,render:KG}),JG={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function YG(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,JG,[...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 XG=(0,t.markRaw)({name:`mdi-cog-play-outline`,render:YG}),ZG={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function QG(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,ZG,[...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 $G=(0,t.markRaw)({name:`mingcute-video-line`,render:QG}),eK={class:`w-80`},tK=(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`,eK,[(0,t.createVNode)(PD,{modelValue:r.value,"onUpdate:modelValue":n[0]||=e=>r.value=e,"auto-focus":``,placeholder:(0,t.unref)(q).global.t(`editor.common.placeholder.link_input`),label:(0,t.unref)(q).global.t(`editor.extensions.video.src_input_label`)},null,8,[`modelValue`,`placeholder`,`label`])]))}}),nK={class:`relative max-h-72 w-56 overflow-hidden overflow-y-auto`},rK=(0,t.defineComponent)({__name:`BubbleItemVideoPosition`,props:{editor:{},isActive:{},visible:{type:Function,default:()=>!0},icon:{},iconStyle:{},title:{},action:{}},setup(e){let r=e,i=[{text:q.global.t(`editor.common.align_left`),value:`start`,icon:AO},{text:q.global.t(`editor.common.align_center`),value:`center`,icon:DO},{text:q.global.t(`editor.common.align_right`),value:`end`,icon:NO}],a=(0,t.computed)(()=>{let e=r.editor.getAttributes($.name).position;return i.find(t=>t.value===e)||i[0]}),o=e=>{let t=mu(e=>e.type.name===$.name)(r.editor.state.selection);return t?t.node.attrs.alignItems===e:!1},s=e=>r.editor.chain().focus().setBlockPosition(e).run();return(r,c)=>{let l=(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`,nK,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(i,e=>(0,t.withDirectives)((0,t.createVNode)(ae,{key:e.value,"is-active":o(e.value),onClick:t=>s(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.text),1)]),_:2},1032,[`is-active`,`onClick`]),[[l]])),64))])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(IO,{title:(0,t.unref)(q).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)}}}),iK={class:`flex w-56 flex-col gap-3`},aK={class:`flex flex-col items-center gap-3`},oK={class:`flex items-center gap-1 rounded-md bg-gray-100 p-1`},sK=[`onClick`],cK=(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:oR,title:q.global.t(`editor.extensions.video.small_size`)},{width:`50%`,height:`auto`,icon:sz,title:q.global.t(`editor.extensions.video.medium_size`)},{width:`100%`,height:`auto`,icon:iz,title:q.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`,iK,[(0,t.createElementVNode)(`div`,aK,[(0,t.createVNode)(PD,{modelValue:i.value,"onUpdate:modelValue":c[0]||=e=>i.value=e,label:(0,t.unref)(q).global.t(`editor.common.width`),tooltip:(0,t.unref)(q).global.t(`editor.common.tooltip.custom_width_input`)},null,8,[`modelValue`,`label`,`tooltip`]),(0,t.createVNode)(PD,{modelValue:a.value,"onUpdate:modelValue":c[1]||=e=>a.value=e,label:(0,t.unref)(q).global.t(`editor.common.height`),tooltip:(0,t.unref)(q).global.t(`editor.common.tooltip.custom_height_input`)},null,8,[`modelValue`,`label`,`tooltip`])]),(0,t.createElementVNode)(`div`,oK,[((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,sK),[[l,e.title]])),64))])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(IO,{title:(0,t.unref)(q).global.t(`editor.extensions.video.resize`),"show-more-indicator":``},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(oR))]),_:1},8,[`title`])]),_:1})):(0,t.createCommentVNode)(``,!0)}}}),lK={key:0,class:`group relative`},uK=[`src`,`controls`,`autoplay`,`loop`],dK={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`},fK={class:`relative`},pK={class:`absolute top-0 size-full bg-black bg-opacity-20`},mK={class:`absolute top-[50%] w-full space-y-2 text-white`},hK={class:`px-10`},gK={class:`relative h-4 w-full overflow-hidden rounded-full bg-gray-200`},_K={class:`absolute left-[50%] top-0 -translate-x-[50%] text-xs leading-4 text-white`},vK={class:`absolute top-0 size-full bg-black bg-opacity-20`},yK={class:`absolute top-[50%] w-full space-y-2 text-white`},bK={class:`px-10`},xK={class:`relative h-4 w-full overflow-hidden rounded-full bg-gray-200`},SK={class:`absolute left-[50%] top-0 -translate-x-[50%] text-xs leading-4 text-white`},CK=(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)(()=>!a.value),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:_}=UD(a,d),v=(0,t.computed)(()=>i.node?.attrs.width?.includes(`%`)),y=(0,t.computed)(()=>{let e=i.getPos();if(!e)return`start`;let t=pu(i.editor.state.doc.resolve(e),e=>e.type.name===sO.name);return t?t.node.attrs.alignItems:`start`});return(i,b)=>{let x=(0,t.resolveDirective)(`tooltip`);return(0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(QT),{as:`div`,class:(0,t.normalizeClass)([`flex w-full`,{[`justify-${y.value}`]:!0}])},{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:l.value?`100%`:e.node.attrs.width,height:l.value?`100%`:e.node.attrs.height})},[a.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,lK,[(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:v.value?`100%`:e.node.attrs.width,height:v.value?`100%`:e.node.attrs.height})},null,12,uK),a.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,dK,[(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)(q).global.t(`editor.extensions.upload.operations.transfer.button`)),1)]),_:1},8,[`loading`,`onClick`])),[[x,(0,t.unref)(q).global.t(`editor.extensions.upload.operations.transfer.tooltip`)]]):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(HD),{accept:`video/*`,"original-link":a.value,upload:e.extension.options.uploadVideo,onChange:d},null,8,[`original-link`,`upload`])])):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),(0,t.withDirectives)((0,t.createElementVNode)(`div`,fK,[(0,t.createVNode)((0,t.unref)(BD),{ref_key:`editorLinkObtain`,ref:u,accept:`video/*`,editor:e.editor,"upload-to-attachment-file":e.extension.options.uploadVideo,"uploaded-file":e.node?.attrs.file,onSetExternalLink:d,onOnUploadFinish:f,onOnUploadAbort:f},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)($G),{class:`text-xl text-primary`})]),uploading:(0,t.withCtx)(({progress:e})=>[(0,t.createElementVNode)(`div`,pK,[(0,t.createElementVNode)(`div`,mK,[(0,t.createElementVNode)(`div`,hK,[(0,t.createElementVNode)(`div`,gK,[(0,t.createElementVNode)(`div`,{class:`h-full bg-primary`,style:(0,t.normalizeStyle)({width:`${e||0}%`})},null,4),(0,t.createElementVNode)(`div`,_K,(0,t.toDisplayString)(e?`${e}%`:`${(0,t.unref)(q).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)(q).global.t(`editor.common.button.cancel`)),1)])])]),error:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,vK,[(0,t.createElementVNode)(`div`,yK,[(0,t.createElementVNode)(`div`,bK,[(0,t.createElementVNode)(`div`,xK,[b[0]||=(0,t.createElementVNode)(`div`,{class:`size-full bg-red-600`},null,-1),(0,t.createElementVNode)(`div`,SK,(0,t.toDisplayString)((0,t.unref)(q).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)(q).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`])}}}),wK=new F(`videoBubbleMenu`),$=V.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})},file:{default:null,renderHTML(){return{}},parseHTML(){return null}}}},parseHTML(){return[{tag:`video`}]},renderHTML({HTMLAttributes:e}){return[`video`,z(e)]},addCommands(){return{setVideo:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[mf({find:/^\$video\$$/,type:this.type})]},addNodeView(){return sE(CK)},addProseMirrorPlugins(){return[new P({key:new F(`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===sO.name)return;let o=`start`,s=!1,c=-1,l=0,u=a.nodeBefore;u&&u.type.name===XD.name&&(u.attrs.textAlign&&(o={left:`start`,center:`center`,right:`end`,justify:`center`}[u.attrs.textAlign]??`start`),u.textContent?.trim().length===0&&(s=!0,c=t-u.nodeSize,l=u.nodeSize));let d=n.schema.nodes.figure.create({contentType:`video`,alignItems: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)($G),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)(gD),props:{editor:e,icon:(0,t.markRaw)($G),title:q.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:wK,shouldShow:({state:e})=>Yu(e,$.name),options:{placement:`top-start`},items:[{priority:10,props:{isActive:()=>e.getAttributes($.name).controls,icon:(0,t.markRaw)(e.getAttributes($.name).controls?qG:XG),visible({editor:e}){return!BE(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?q.global.t(`editor.extensions.video.disable_controls`):q.global.t(`editor.extensions.video.enable_controls`)}},{priority:20,props:{isActive:()=>e.getAttributes($.name).autoplay,visible({editor:e}){return!BE(e.getAttributes($.name).src)},icon:(0,t.markRaw)(e.getAttributes($.name).autoplay?YE:QE),action:()=>e.chain().updateAttributes($.name,{autoplay:e.getAttributes($.name).autoplay?null:!0}).setNodeSelection(e.state.selection.from).focus().run(),title:e.getAttributes($.name).autoplay?q.global.t(`editor.extensions.video.disable_autoplay`):q.global.t(`editor.extensions.video.enable_autoplay`)}},{priority:30,props:{isActive:()=>e.getAttributes($.name).loop,visible({editor:e}){return!BE(e.getAttributes($.name).src)},icon:(0,t.markRaw)(e.getAttributes($.name).loop?UE:KE),action:()=>{e.chain().updateAttributes($.name,{loop:e.getAttributes($.name).loop?null:!0}).setNodeSelection(e.state.selection.from).focus().run()},title:e.getAttributes($.name).loop?q.global.t(`editor.extensions.video.disable_loop`):q.global.t(`editor.extensions.video.enable_loop`)}},{priority:40,component:(0,t.markRaw)(C),props:{visible({editor:e}){return!BE(e.getAttributes($.name).src)}}},{priority:50,component:(0,t.markRaw)(cK),props:{visible({editor:e}){return!BE(e.getAttributes($.name).src)}}},{priority:60,component:(0,t.markRaw)(rK),props:{visible({editor:e}){return!BE(e.getAttributes($.name).src)}}},{priority:70,component:(0,t.markRaw)(C),props:{visible({editor:e}){return!BE(e.getAttributes($.name).src)}}},{priority:80,props:{icon:(0,t.markRaw)(tD),title:q.global.t(`editor.common.button.edit_link`),action:()=>(0,t.markRaw)(tK)}},{priority:90,props:{visible({editor:e}){return!BE(e.getAttributes($.name).src)},icon:(0,t.markRaw)(sD),title:q.global.t(`editor.common.tooltip.open_link`),action:()=>{window.open(e.getAttributes($.name).src,`_blank`)}}},{priority:100,props:{visible({editor:e}){return!BE(e.getAttributes($.name).src)},icon:(0,t.markRaw)(WG),title:q.global.t(`editor.extensions.video.edit_caption`),action:({editor:e})=>{let t=mu(e=>e.type.name===sO.name)(e.state.selection);if(!t)return;let{node:n,pos:r}=t,i=-1;if(n.forEach((e,t)=>{e.type.name===oO.name&&(i=r+t+1)}),i!==-1){e.chain().focus().setTextSelection(i).run();return}let a=du(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(M.near(e.doc.resolve(t+1))),!0}).run()}}},{priority:110,component:(0,t.markRaw)(C)},{priority:120,props:{icon:(0,t.markRaw)(dD),title:q.global.t(`editor.common.button.delete`),action:({editor:e})=>{fE(mu(e=>e.type.name===`figure`)(e.state.selection)?`figure`:$.name,e)}}}]}}}}}),TK=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},EK=(e,t,n)=>{let r=n||TK(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)}},DK=(e,t)=>{e.chain().updateAttributes($.name,t).setNodeSelection(e.state.selection.from).focus().run()},OK=B.create({name:`upload`,addProseMirrorPlugins(){let{editor:e}=this;return[new P({key:new F(`upload`),props:{handlePaste:(t,r,i)=>{if(t.props.editable&&!t.props.editable(t.state)||!r.clipboardData)return!1;let a=AK(i);a.length>0&&n.Dialog.info({title:q.global.t(`editor.common.text.tip`),description:q.global.t(`editor.extensions.upload.operations.transfer_in_batch.description`),confirmText:q.global.t(`editor.common.button.confirm`),cancelText:q.global.t(`editor.common.button.cancel`),async onConfirm(){await WK(e,a),n.Toast.success(q.global.t(`editor.common.toast.save_success`))}});let o=r.clipboardData.types;if(!UK(o)||kK(r.clipboardData))return!1;let s=Array.from(r.clipboardData.files);return s.length?(r.preventDefault(),LK(e,s),!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(),LK(e,r),!0):!1}}})]}});function kK(e){if(!e)return!1;let t=e.types;if(t.includes(`application/vnd.ms-excel`)||t.includes(`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`))return!0;if(t.includes(`text/html`))try{let t=e.getData(`text/html`);if(t.includes(`ProgId="Excel.Sheet"`)||t.includes(`xmlns:x="urn:schemas-microsoft-com:office:excel"`)||t.includes(`urn:schemas-microsoft-com:office:spreadsheet`)||t.includes(`<x:ExcelWorkbook>`))return!0}catch(e){console.warn(`Failed to read clipboard HTML data:`,e)}return!1}function AK(e){let t=[];return e.content.descendants((e,n,r,i)=>{[FK.name,$.name,X.name].includes(e.type.name)&&KK(e.attrs.src)&&t.push({node:e,pos:n,parent:r,index:i})}),t}var jK=B.create({name:`halo-extensions-kit`,addExtensions(){let e=[];return this.options.audio!==!1&&e.push(FK.configure(this.options.audio)),this.options.blockquote!==!1&&e.push(ZO.configure(this.options.blockquote)),this.options.bold!==!1&&e.push(ok.configure(this.options.bold)),this.options.bulletList!==!1&&e.push(Vk.configure(this.options.bulletList)),this.options.characterCount!==!1&&e.push(Hk.configure(this.options.characterCount)),this.options.clearFormat!==!1&&e.push(Xk.configure(this.options.clearFormat)),this.options.code!==!1&&e.push(rA.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(MA.configure(this.options.codeBlock)),this.options.color!==!1&&e.push(LM.configure(this.options.color)),this.options.columns!==!1&&e.push(nN.configure(this.options.columns)),this.options.commandsMenu!==!1&&e.push(TF),this.options.details!==!1&&e.push(zF.configure(this.options.details)),this.options.document!==!1&&e.push(BF),this.options.dropCursor!==!1&&e.push(VF.configure(this.options.dropCursor)),this.options.figure!==!1&&e.push(sO.configure(this.options.figure)),this.options.fontSize!==!1&&e.push(GF.configure(this.options.fontSize)),this.options.formatBrush!==!1&&e.push(QF.configure(this.options.formatBrush)),this.options.gallery!==!1&&e.push(PI.configure(this.options.gallery)),this.options.gapCursor!==!1&&e.push(VI),this.options.hardBreak!==!1&&e.push(JI.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(_L.configure(this.options.heading)),this.options.highlight!==!1&&e.push(NL.configure(this.options.highlight)),this.options.history!==!1&&e.push(BL.configure(this.options.history)),this.options.horizontalRule!==!1&&e.push(VL.configure(this.options.horizontalRule)),this.options.iframe!==!1&&e.push(TR.configure(this.options.iframe)),this.options.image!==!1&&e.push(X.configure(this.options.image)),this.options.indent!==!1&&e.push(tV.configure(this.options.indent)),this.options.italic!==!1&&e.push(vV.configure(this.options.italic)),this.options.link!==!1&&e.push(NU.configure(this.options.link)),this.options.listKeymap!==!1&&e.push(JU.configure(this.options.listKeymap)),this.options.nodeSelected!==!1&&e.push(YU.configure(this.options.nodeSelected)),this.options.orderedList!==!1&&e.push(BU.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(XD.configure(this.options.paragraph)),this.options.placeholder!==!1&&e.push(XU.configure(this.options.placeholder)),this.options.rangeSelection!==!1&&e.push(iO),this.options.searchAndReplace!==!1&&e.push(WW),this.options.smartScroll!==!1&&e.push(GW.configure(this.options.smartScroll)),this.options.strike!==!1&&e.push(eG.configure(this.options.strike)),this.options.subscript!==!1&&e.push(aG.configure(this.options.subscript)),this.options.superscript!==!1&&e.push(uG.configure(this.options.superscript)),this.options.table!==!1&&e.push(eV.configure(this.options.table)),this.options.taskList!==!1&&e.push(VU.configure(this.options.taskList)),this.options.text!==!1&&e.push(RG.configure(this.options.text)),this.options.textAlign!==!1&&e.push(zG.configure(this.options.textAlign)),this.options.textStyle!==!1&&e.push(qA.configure(this.options.textStyle)),this.options.trailingNode!==!1&&e.push(VG),this.options.underline!==!1&&e.push(NG.configure(this.options.underline)),this.options.upload!==!1&&e.push(OK),this.options.video!==!1&&e.push($.configure(this.options.video)),this.options.listExtra!==!1&&e.push(UU.configure(this.options.listExtra)),this.options.blockPosition!==!1&&e.push(WO.configure(this.options.blockPosition)),this.options.align!==!1&&e.push(UO),pE([...e,...this.options.customExtensions||[]])||[]}}),MK={class:`relative max-h-72 w-56 overflow-hidden overflow-y-auto`},NK=(0,t.defineComponent)({__name:`BubbleItemAudioPosition`,props:{editor:{},isActive:{},visible:{type:Function,default:()=>!0},icon:{},iconStyle:{},title:{},action:{}},setup(e){let r=e,i=[{text:q.global.t(`editor.common.align_left`),value:`start`,icon:AO},{text:q.global.t(`editor.common.align_center`),value:`center`,icon:DO},{text:q.global.t(`editor.common.align_right`),value:`end`,icon:NO}],a=(0,t.computed)(()=>{let e=r.editor.getAttributes(FK.name).position;return i.find(t=>t.value===e)||i[0]}),o=e=>{let t=mu(e=>e.type.name===FK.name)(r.editor.state.selection);return t?t.node.attrs.alignItems===e:!1},s=e=>r.editor.chain().focus().setBlockPosition(e).run();return(r,c)=>{let l=(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`,MK,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(i,e=>(0,t.withDirectives)((0,t.createVNode)(ae,{key:e.value,"is-active":o(e.value),onClick:t=>s(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.text),1)]),_:2},1032,[`is-active`,`onClick`]),[[l]])),64))])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(IO,{title:(0,t.unref)(q).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)}}}),PK=new F(`audioBubbleMenu`),FK=V.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})},file:{default:null,renderHTML(){return{}},parseHTML(){return null}}}},parseHTML(){return[{tag:`audio`}]},renderHTML({HTMLAttributes:e}){return[`audio`,z(e)]},addCommands(){return{setAudio:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[mf({find:/^\$audio\$$/,type:this.type,getAttributes:()=>({width:`100%`})})]},addNodeView(){return sE(SO)},addOptions(){return{...this.parent?.(),uploadAudio:void 0,getCommandMenuItems(){return{priority:110,icon:(0,t.markRaw)(iD),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)(gD),props:{editor:e,icon:(0,t.markRaw)(iD),title:q.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:PK,shouldShow:({state:e})=>Yu(e,FK.name),items:[{priority:10,props:{visible({editor:e}){return!BE(e.getAttributes(FK.name).src)},isActive:()=>e.getAttributes(FK.name).autoplay,icon:(0,t.markRaw)(e.getAttributes(FK.name).autoplay?YE:QE),action:()=>{e.chain().updateAttributes(FK.name,{autoplay:e.getAttributes(FK.name).autoplay?null:!0}).setNodeSelection(e.state.selection.from).focus().run()},title:e.getAttributes(FK.name).autoplay?q.global.t(`editor.extensions.audio.disable_autoplay`):q.global.t(`editor.extensions.audio.enable_autoplay`)}},{priority:20,props:{visible({editor:e}){return!BE(e.getAttributes(FK.name).src)},isActive:()=>e.getAttributes(FK.name).loop,icon:(0,t.markRaw)(e.getAttributes(FK.name).loop?UE:KE),action:()=>{e.chain().updateAttributes(FK.name,{loop:e.getAttributes(FK.name).loop?null:!0}).setNodeSelection(e.state.selection.from).focus().run()},title:e.getAttributes(FK.name).loop?q.global.t(`editor.extensions.audio.disable_loop`):q.global.t(`editor.extensions.audio.enable_loop`)}},{priority:30,component:(0,t.markRaw)(C),props:{visible({editor:e}){return!BE(e.getAttributes(FK.name).src)}}},{priority:40,component:(0,t.markRaw)(NK),props:{visible({editor:e}){return!BE(e.getAttributes(FK.name).src)}}},{priority:50,component:(0,t.markRaw)(C),props:{visible({editor:e}){return!BE(e.getAttributes(FK.name).src)}}},{priority:60,props:{icon:(0,t.markRaw)(tD),title:q.global.t(`editor.common.button.edit_link`),action:()=>(0,t.markRaw)(wO)}},{priority:70,props:{visible({editor:e}){return!BE(e.getAttributes(FK.name).src)},icon:(0,t.markRaw)(sD),title:q.global.t(`editor.common.tooltip.open_link`),action:()=>{window.open(e.getAttributes(FK.name).src,`_blank`)}}},{priority:80,component:(0,t.markRaw)(C)},{priority:90,props:{icon:(0,t.markRaw)(dD),title:q.global.t(`editor.common.button.delete`),action:({editor:e})=>{fE(mu(e=>e.type.name===`figure`)(e.state.selection)?`figure`:FK.name,e)}}}]}}}}}),IK=(e,t)=>{if(t.type.startsWith(`image/`))return RK(e,t);if(t.type.startsWith(`video/`))return zK(e,t);if(t.type.startsWith(`audio/`))return BK(e,t)},LK=(e,t)=>{if(!t.length||!r.utils.permission.has([`uc:attachments:manage`,`system:attachments:manage`]))return!1;let n=t.map(t=>IK(e,t)).filter(e=>e!==void 0);if(n.length){let t=e.view.state.tr;t.insert(e.view.state.selection.from,n),e.view.dispatch(t)}},RK=(e,t)=>{let{state:n}=e;return n.schema.nodes[X.name].create({file:t})},zK=(e,t)=>{let{state:n}=e;return n.schema.nodes[$.name].create({file:t})},BK=(e,t)=>{let{state:n}=e;return n.schema.nodes[FK.name].create({file:t})},VK=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 HK(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 UK(e){let t=[`files`,`application/x-moz-file`,`public.file-url`];return e.some(e=>t.includes(e.toLowerCase()))}async function WK(e,t){let n=kE(t,5);for(let t of n)await Promise.all(t.map(t=>GK(e,t)))}async function GK(e,t){let{node:n,pos:r}=t,{src:a}=n.attrs;if(KK(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 KK(e){if(!e||e.startsWith(`/`)||[`data:`,`blob:`,`file:`].some(t=>e.startsWith(t)))return!1;let t=window.location.origin;return e.startsWith(t)?!1:e.startsWith(`http://`)||e.startsWith(`https://`)}var qK=`convert-to`,JK=`delete`,YK=`copy`,XK=`cut`,ZK=[{priority:10,title:()=>q.global.t(`editor.drag.menu.convert_to`),key:qK,icon:(0,t.markRaw)(Zf),children:{items:[]}},{priority:700,component:(0,t.markRaw)(x),visible:({editor:e})=>!Yu(e.state,`table`)},{priority:710,title:()=>q.global.t(`editor.drag.menu.copy`),key:YK,icon:(0,t.markRaw)(Jf),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 uE(e)}}},{priority:720,title:()=>q.global.t(`editor.drag.menu.cut`),key:`cut`,icon:(0,t.markRaw)(Gf),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 uE(e)&&e.chain().focus().deleteRange({from:i,to:a}).run()}}},{priority:800,component:(0,t.markRaw)(x)},{priority:900,title:()=>q.global.t(`editor.drag.menu.delete`),key:JK,icon:(0,t.markRaw)(dD),keyboard:`Delete`,action:({editor:e,node:t})=>{t&&fE(t?.type.name,e)}}],QK={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function $K(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,QK,[...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 eq=(0,t.markRaw)({name:`material-symbols-arrow-forward-ios-rounded`,render:$K}),tq={class:`flex min-w-60 flex-col gap-0.5 bg-white`},nq=(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&&DE(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`,tq,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,(n,a)=>((0,t.openBlock)(),(0,t.createBlock)(lq,(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))]))}}),rq=[`title`],iq={class:`flex items-center gap-2`},aq={class:`flex flex-grow justify-start px-0.5`},oq={key:0,class:`flex items-center gap-2`},sq={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`},cq={class:`relative overflow-hidden overflow-y-auto`},lq=(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`,cq,[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)(nq,{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`,iq,[((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`,aq,(0,t.toDisplayString)(f.value),1)])],8,rq),d.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,oq,[(0,t.createVNode)((0,t.unref)(eq),{class:`size-3`})])):a.keyboard?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,sq,(0,t.toDisplayString)((0,t.unref)(OE)(a.keyboard)),1)):(0,t.createCommentVNode)(``,!0)],2))]),_:1},8,[`shown`])):(0,t.createCommentVNode)(``,!0)}});function uq(e){if(!e.length)return I.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(Vs.node(n,n+r.nodeSize,{class:`ProseMirror-selectednoderange`}))}),I.create(n,t)}function dq(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 ke(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 Hn(i.resolve(n),i.resolve(s));r.push(c)}),r}var fq=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 pq(e.resolve(this.anchor),e.resolve(this.head))}},pq=class e extends j{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=dq(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 fq(this.anchor,this.head)}};pq.prototype.visible=!1;function mq(e){return e instanceof pq}B.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(!mq(a)){let e=pq.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(!mq(a)){let e=pq.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=pq.create(i,0,i.content.size,t);return a.setSelection(o),n.dispatch(a),!0}}},onSelectionUpdate(){let{selection:e}=this.editor.state;mq(e)&&this.editor.view.dom.classList.add(`ProseMirror-noderangeselection`)},addProseMirrorPlugins(){let e=!1,t=!1;return[new P({key:new F(`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=pq.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=mq(r);if(e=!1,!t)return i?(e=!0,uq(r.ranges)):null;let{$from:a,$to:o}=r;if(!i&&a.sameParent(o))return null;let s=dq(a,o,this.options.depth);return s.length?(e=!0,uq(s)):null}}})]}});function hq(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 gq(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=hq(e)}),t}var _q=[{id:`listItemFirstChild`,evaluate:({parent:e,isFirst:t})=>t&&e&&[`listItem`,`taskItem`].includes(e.type.name)?1e3:0},{id:`listWrapperDeprioritize`,evaluate:({node:e})=>{let t=[`listItem`,`taskItem`],n=e.firstChild;return n&&t.includes(n.type.name)?1e3:0}},{id:`inlineContent`,evaluate:({node:e})=>e.isInline||e.isText?1e3:0}],vq={edges:[`left`,`top`],threshold:12,strength:500};function yq(e){return e===void 0||e===`left`?{...vq}:e===`right`?{edges:[`right`,`top`],threshold:12,strength:500}:e===`both`?{edges:[`left`,`right`,`top`],threshold:12,strength:500}:e===`none`?{edges:[],threshold:0,strength:0}:{...vq,...e}}function bq(e,t,n){if(n.edges.length===0)return!1;let r=t.getBoundingClientRect(),{threshold:i,edges:a}=n;return a.some(t=>t===`left`?e.x-r.left<i:t===`right`?r.right-e.x<i:t===`top`?e.y-r.top<i:t===`bottom`?r.bottom-e.y<i:!1)}function xq(e,t,n,r){return!t||n.edges.length===0?0:bq(e,t,n)?n.strength*r:0}var Sq=1e3;function Cq(e,t,n,r){let i=Sq,a=!1;if(t.every(t=>{let n=t.evaluate(e);return i-=n,i<=0?(a=!0,!1):!0}),a)return-1;let o=e.view.nodeDOM(e.pos);return i-=xq(r,o,n,e.depth),i<=0?-1:i}function wq(e,t,n){return Array.from({length:t},(e,n)=>t-1-n).some(t=>n.includes(e.node(t).type.name))}function Tq(e,t,n){if(!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let r=e.posAtCoords({left:t.x,top:t.y});if(!r)return null;let{doc:i}=e.state,a=i.resolve(r.pos),o=[];n.defaultRules&&o.push(..._q),o.push(...n.rules);let s=Array.from({length:a.depth},(e,t)=>a.depth-t).map(r=>{let i=a.node(r),s=a.before(r);if(n.allowedContainers&&r>0&&!wq(a,r,n.allowedContainers))return null;let c=r>0?a.node(r-1):null,l=r>0?a.index(r-1):0,u=c?c.childCount:1,d=Cq({node:i,pos:s,depth:r,parent:c,index:l,isFirst:l===0,isLast:l===u-1,$pos:a,view:e},o,n.edgeDetection,t);return d<0?null:{node:i,pos:s,depth:r,score:d,dom:e.nodeDOM(s)}}).filter(e=>e!==null);if(s.length===0)return null;s.sort((e,t)=>t.score===e.score?t.depth-e.depth:t.score-e.score);let c=s[0];return c.dom?{node:c.node,pos:c.pos,dom:c.dom}:null}function Eq(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){return Number.isFinite(e.top)&&Number.isFinite(e.bottom)&&Number.isFinite(e.left)&&Number.isFinite(e.right)&&e.width>0&&e.height>0}function Oq(e,t,n,r=5){if(!Number.isFinite(t)||!Number.isFinite(n))return null;let i=e.dom,a=i.firstElementChild,o=i.lastElementChild;if(!a||!o)return null;let s=a.getBoundingClientRect(),c=o.getBoundingClientRect();if(!Dq(s)||!Dq(c))return null;let 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;d&&f&&(p=s);let m=Math.min(Math.max(p.left+r,t),p.right-r);return!Number.isFinite(m)||!Number.isFinite(l)?null:{x:m,y:l}}var kq=e=>{let{x:t,y:n,editor:r,nestedOptions:i}=e,{view:a,state:o}=r,s=Oq(a,t,n,5);if(!s)return{resultElement:null,resultNode:null,pos:null};let{x:c,y:l}=s;if(i?.enabled){let e=Tq(a,{x:c,y:l},i);return e?{resultElement:e.dom,resultNode:e.node,pos:e.pos}:{resultElement:null,resultNode:null,pos:null}}let u=a.root.elementsFromPoint(c,l),d;if(Array.prototype.some.call(u,e=>{if(!a.dom.contains(e))return!1;let t=Eq(e,a);return t?(d=t,!0):!1}),!d)return{resultElement:null,resultNode:null,pos:null};let f;try{f=a.posAtDOM(d,0)}catch{return{resultElement:null,resultNode:null,pos:null}}let p=o.doc.nodeAt(f);if(!p){let e=o.doc.resolve(f),t=e.parent;return{resultElement:d,resultNode:t,pos:e.start()}}return{resultElement:d,resultNode:p,pos:f}};function Aq(e){var t;(t=e.parentNode)==null||t.removeChild(e)}function jq(e,t,n,r){let{doc:i}=t.view.state;if(n?.enabled&&r?.node&&r.pos>=0){let e=r.pos,t=r.pos+r.node.nodeSize;return[{$from:i.resolve(e),$to:i.resolve(t)}]}let a=kq({editor:t,x:e.clientX,y:e.clientY,direction:`right`,nestedOptions:n});return!a.resultNode||a.pos===null?[]:dq(i.resolve(a.pos),i.resolve(a.pos+a.resultNode.nodeSize),0)}function Mq(e,t,n,r){let{view:i}=t;if(!e.dataTransfer)return;let{empty:a,$from:o,$to:s}=i.state.selection,c=jq(e,t,n,r),l=dq(o,s,0),u=l.some(e=>c.find(t=>t.$from===e.$from&&t.$to===e.$to)),d=a||!u?c:l;if(!d.length)return;let{tr:f}=i.state,p=document.createElement(`div`),m=d[0].$from.pos,h=d[d.length-1].$to.pos,g=n?.enabled&&r?.node,_,v;g?(_=i.state.doc.slice(m,h),v=N.create(i.state.doc,m)):(v=pq.create(i.state.doc,m,h),_=v.content()),d.forEach(e=>{let t=gq(i.nodeDOM(e.$from.pos));p.append(t)}),p.style.position=`absolute`,p.style.top=`-10000px`,document.body.append(p),e.dataTransfer.clearData(),e.dataTransfer.setDragImage(p,0,0),i.dragging={slice:_,move:!0},f.setSelection(v),i.dispatch(f),document.addEventListener(`drop`,()=>Aq(p),{once:!0})}var Nq=(e,t)=>{let n=e.resolve(t),{depth:r}=n;return r===0?t:n.pos-n.parentOffset-1},Pq=(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},Fq=(e,t)=>{let n=t;for(;n?.parentNode&&n.parentNode!==e.dom;)n=n.parentNode;return n},Iq=new F(`dragHandle`),Lq=({pluginKey:e=Iq,element:t,editor:n,computePositionConfig:r,getReferencedVirtualElement:i,onNodeChange:a,onElementDragStart:o,onElementDragEnd:s,nestedOptions:c})=>{let l=document.createElement(`div`),u=!1,d=null,f=-1,p=null,m=null;function h(){t&&(t.style.visibility=`hidden`,t.style.pointerEvents=`none`)}function g(){if(t){if(!n.isEditable){h();return}t.style.visibility=``,t.style.pointerEvents=`auto`}}function _(e){cF(i?.()||{getBoundingClientRect:()=>e.getBoundingClientRect()},t,r).then(e=>{Object.assign(t.style,{position:e.strategy,left:`${e.x}px`,top:`${e.y}px`})})}function v(e){o?.(e),Mq(e,n,c,{node:d,pos:f}),t&&(t.dataset.dragging=`true`),setTimeout(()=>{t&&(t.style.pointerEvents=`none`)},0)}function y(e){s?.(e),h(),t&&(t.style.pointerEvents=`auto`,t.dataset.dragging=`false`)}function b(){if(wf()){let e=n.view.dom;requestAnimationFrame(()=>{e.isContentEditable&&(e.contentEditable=`false`,e.contentEditable=`true`)})}}return t.addEventListener(`dragstart`,v),t.addEventListener(`dragend`,y),document.addEventListener(`drop`,b),l.appendChild(t),{unbind(){t.removeEventListener(`dragstart`,v),t.removeEventListener(`dragend`,y),document.removeEventListener(`drop`,b),p&&(cancelAnimationFrame(p),p=null,m=null)},plugin:new P({key:typeof e==`string`?new F(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&&(u=s),c)return h(),u=!1,d=null,f=-1,a?.({editor:n,node:null,pos:-1}),r;if(e.docChanged&&f!==-1&&t){let t=e.mapping.map(f);t!==f&&(f=t)}return r}},view:e=>{var r;return t.draggable=!0,t.style.pointerEvents=`auto`,t.dataset.dragging=`false`,(r=n.view.dom.parentElement)==null||r.appendChild(l),l.style.pointerEvents=`none`,l.style.position=`absolute`,l.style.top=`0`,l.style.left=`0`,{update(r,i){if(!t)return;if(!n.isEditable){h();return}if(u?t.draggable=!1:t.draggable=!0,e.state.doc.eq(i.doc)||f===-1)return;let o=e.nodeDOM(f);if(o=Fq(e,o),o===e.dom||o?.nodeType!==1)return;let s=e.posAtDOM(o,0),c=Pq(n.state.doc,s),l=Nq(n.state.doc,s);d=c,f=l,e.state,a?.({editor:n,node:d,pos:f}),_(o)},destroy(){t.removeEventListener(`dragstart`,v),t.removeEventListener(`dragend`,y),document.removeEventListener(`drop`,b),p&&(cancelAnimationFrame(p),p=null,m=null),t&&Aq(l)}}},props:{handleDOMEvents:{keydown(e){return!t||u?!1:e.hasFocus()?(h(),d=null,f=-1,a?.({editor:n,node:null,pos:-1}),!1):!1},mouseleave(e,t){return u||t.target&&!l.contains(t.relatedTarget)&&(h(),d=null,f=-1,a?.({editor:n,node:null,pos:-1})),!1},mousemove(e,r){return!t||u||(m={x:r.clientX,y:r.clientY},p)||(p=requestAnimationFrame(()=>{if(p=null,!m)return;let{x:t,y:r}=m;m=null;let i=kq({x:t,y:r,direction:`right`,editor:n,nestedOptions:c});if(!i.resultElement)return;let o=i.resultElement,s=i.resultNode,l=i.pos;if(!c?.enabled){if(o=Fq(e,o),o===e.dom||o?.nodeType!==1)return;let t=e.posAtDOM(o,0);s=Pq(n.state.doc,t),l=Nq(n.state.doc,t)}s!==d&&(d=s,f=l??-1,e.state,a?.({editor:n,node:d,pos:f}),_(o),g())})),!1}}}})}};function Rq(e){return e===!1||e===void 0?{enabled:!1,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:yq(`none`)}:e===!0?{enabled:!0,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:yq(`left`)}:{enabled:!0,rules:e.rules??[],defaultRules:e.defaultRules??!0,allowedContainers:e.allowedContainers,edgeDetection:yq(e.edgeDetection)}}var zq={placement:`left-start`,strategy:`absolute`};B.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,nested:!1}},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(),t=Rq(this.options.nested);return[Lq({computePositionConfig:{...zq,...this.options.computePositionConfig},getReferencedVirtualElement:this.options.getReferencedVirtualElement,element:e,editor:this.editor,onNodeChange:this.options.onNodeChange,onElementDragStart:this.options.onElementDragStart,onElementDragEnd:this.options.onElementDragEnd,nestedOptions:t}).plugin]}});var Bq=(0,t.defineComponent)({name:`DragHandleVue`,props:{pluginKey:{type:[String,Object],default:Iq},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`},nested:{type:[Boolean,Object],default:!1}},setup(e,{slots:n}){let r=(0,t.ref)(null),i=(0,t.shallowRef)(null),a=()=>{let{editor:t,pluginKey:n,onNodeChange:a,onElementDragEnd:o,onElementDragStart:s,computePositionConfig:c,nested:l}=e;if(!r.value||!e.editor||e.editor.isDestroyed)return;let u=Rq(l),d=Lq({editor:t,element:r.value,pluginKey:n,computePositionConfig:{...zq,...c},onNodeChange:a,onElementDragStart:s,onElementDragEnd:o,nestedOptions:u});i.value=d,e.editor.registerPlugin(d.plugin)},o=()=>{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)};return(0,t.onMounted)(async()=>{await(0,t.nextTick)(),a()}),(0,t.watch)(()=>e.nested,()=>{o(),a()},{deep:!0}),(0,t.onBeforeUnmount)(()=>{o()}),()=>(0,t.h)(`div`,{ref:r,class:e.class,style:{visibility:`hidden`,position:`absolute`},"data-dragging":`false`},n.default?.call(n))}}),Vq={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Hq(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Vq,[...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 Uq=(0,t.markRaw)({name:`material-symbols-add-rounded`,render:Hq}),Wq={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Gq(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Wq,[...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 Kq=(0,t.markRaw)({name:`material-symbols-drag-indicator`,render:Gq}),qq={class:`flex items-center justify-center gap-0.5`},Jq=(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?CE(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 N(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(M.create(t.doc,e.pos))}e.editor.view.dispatch(t)},d=(0,t.computed)(()=>{let t=e.editor?.extensionManager,n=[...ZK],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=>ME(e,[`priority`]);return(o,f)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Bq),{editor:e.editor,"compute-position-config":{middleware:[(0,t.unref)(eF)(5)]},onNodeChange:c},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,qq,[(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)(Uq),{class:`size-5`})])),[[(0,t.unref)(n.vTooltip),{content:(0,t.unref)(q).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)(nq,{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)(Kq),{class:`size-5`})])),[[(0,t.unref)(n.vTooltip),{content:(0,t.unref)(q).global.t(`editor.drag.button.drag_handle`),distance:8,delay:{show:500}}]])]),_:1},8,[`shown`])])]),_:1},8,[`editor`,`compute-position-config`]))}}),Yq=(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)(IO,{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 Xq(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 Zq=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&&yl(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(rF(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(nF(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(eF(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(oF(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(iF(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(tF(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(aF(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(sF(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;if(!this.view?.dom?.parentNode)return;let n=ad(this.view,e.from,e.to),r={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof N){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():Xq(o.getBoundingClientRect(),s.getBoundingClientRect());r={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return r}updatePosition(){let e=this.virtualElement;e&&cF(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,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()}},Qq=e=>new P({key:typeof e.pluginKey==`string`?new F(e.pluginKey):e.pluginKey,view:t=>new Zq({view:t,...e})}),$q=(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,Function],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(Qq({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))}}),eJ=class{constructor({editor:e,element:t,view:n,updateDelay:r=250,resizeDelay:i=60,options:a,appendTo:o,shouldShow:s}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,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.transactionHandler=({transaction:e})=>{e.getMeta(`floatingMenu`)===`updatePosition`&&this.updatePosition()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.updateDelay=r,this.resizeDelay=i,this.appendTo=o,this.scrollTarget=a?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...a},this.element.tabIndex=0,s&&(this.shouldShow=s),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),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())}getTextContent(e){return Pu(e,{textSerializers:Fu(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(rF(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(nF(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(eF(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(oF(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(iF(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(tF(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(aF(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(sF(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=ad(this.view,e.from,e.to);cF({getBoundingClientRect:()=>t,getClientRects:()=>[t]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,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}),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()}},tJ=e=>new P({key:typeof e.pluginKey==`string`?new F(e.pluginKey):e.pluginKey,view:t=>new eJ({view:t,...e})});(0,t.defineComponent)({name:`FloatingMenu`,inheritAttrs:!1,props:{pluginKey:{type:null,default:`floatingMenu`},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},resizeDelay:{type:Number,default:void 0},options:{type:Object,default:()=>({})},appendTo:{type:[Object,Function],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,updateDelay:r,resizeDelay:a,options:o,appendTo:s,shouldShow:c}=e,l=i.value;l&&(l.style.visibility=`hidden`,l.style.position=`absolute`,l.remove(),n.registerPlugin(tJ({pluginKey:t,editor:n,element:l,updateDelay:r,resizeDelay:a,options:o,appendTo:s,shouldShow:c})))}),(0,t.onBeforeUnmount)(()=>{let{pluginKey:t,editor:n}=e;n.unregisterPlugin(t)}),()=>(0,t.h)(`div`,{ref:i,...r},n.default?.call(n))}});var nJ={class:`bubble-menu flex items-center space-x-1 rounded-md border bg-white p-1 shadow`},rJ=_((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)($q),{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`,nJ,[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)(Yq,(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-2496b4d7`]]),iJ={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function aJ(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,iJ,[...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 oJ=(0,t.markRaw)({name:`mingcute-add-circle-fill`,render:aJ}),sJ={class:`editor-header space-x-1 overflow-auto border-b bg-white px-1 py-1 text-center shadow-sm`},cJ={class:`inline-flex h-full items-center gap-1`},lJ={class:`relative max-h-96 w-56 overflow-hidden overflow-y-auto`},uJ={class:`relative max-h-96 w-56 overflow-hidden overflow-y-auto`},dJ=(0,t.defineComponent)({__name:`EditorHeader`,props:{editor:{type:YT,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`,sJ,[(0,t.createElementVNode)(`div`,cJ,[(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)(oJ),{class:`text-primary`})],2)]),popper:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,lJ,[((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`,uJ,[((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))])]))}}),fJ={key:0,class:`halo-rich-text-editor`},pJ={class:`editor-entry`},mJ={class:`editor-main`},hJ={key:0,class:`editor-main-extra`},gJ={key:0,class:`editor-entry-extra`},_J=(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,()=>{q.global.locale.value=n.locale},{immediate:!0}),(n,r)=>e.editor?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,fJ,[(0,t.createVNode)(rJ,{editor:e.editor},null,8,[`editor`]),(0,t.createVNode)(Jq,{editor:e.editor},null,8,[`editor`]),(0,t.createVNode)(dJ,{editor:e.editor},null,8,[`editor`]),(0,t.createElementVNode)(`div`,pJ,[(0,t.createElementVNode)(`div`,mJ,[n.$slots.content?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,hJ,[(0,t.renderSlot)(n.$slots,`content`)])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(XT),{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`,gJ,[(0,t.renderSlot)(n.$slots,`extra`)])):(0,t.createCommentVNode)(``,!0)])])):(0,t.createCommentVNode)(``,!0)}});return e.AUDIO_BUBBLE_MENU_KEY=PK,e.AddMarkStep=Ut,e.AddNodeMarkStep=Gt,e.AllSelection=qn,e.AttrStep=Ln,e.BlockActionButton=g,e.BlockActionHorizontalSeparator=x,e.BlockActionInput=PD,e.Input=PD,e.BlockActionSeparator=C,e.BubbleButton=IO,e.BubbleItem=Yq,e.CODE_BLOCK_BUBBLE_MENU_KEY=jA,e.COLUMNS_BUBBLE_MENU_KEY=ZM,e.CONVERT_TO_KEY=qK,e.COPY_KEY=YK,e.CUT_KEY=XK,e.CellBookmark=Dw,e.CellSelection=Y,e.Change=f_,e.ChangeSet=S_,e.CommandManager=Xc,e.ContentMatch=Pe,e.DELETE_KEY=JK,e.DETAILS_BUBBLE_MENU_KEY=RF,e.DOMParser=ot,e.DOMSerializer=bt,e.Decoration=Vs,e.DecorationSet=I,e.DocAttrStep=Rn,e.Dropdown=SC,e.DropdownItem=ae,e.DropdownSubmenu=TC,e.Editor=ff,e.EditorBubbleMenu=rJ,e.EditorContent=XT,e.EditorDragButtonItem=lq,e.EditorDragHandle=Jq,e.EditorDragMenu=nq,e.EditorHeader=dJ,e.EditorLinkObtain=BD,e.EditorState=ar,e.EditorView=wc,e.Extendable=Bd,e.Extension=B,e.ExtensionAudio=FK,e.ExtensionBlockquote=ZO,e.ExtensionBold=ok,e.ExtensionBulletList=Vk,e.ExtensionCharacterCount=Hk,e.ExtensionClearFormat=Xk,e.ExtensionCode=rA,e.ExtensionCodeBlock=MA,e.ExtensionColor=LM,e.ExtensionColumn=RM,e.ExtensionColumns=nN,e.ExtensionCommandsMenu=TF,e.ExtensionDetails=zF,e.ExtensionDocument=BF,e.ExtensionDropcursor=VF,e.ExtensionFigure=sO,e.ExtensionFontSize=GF,e.ExtensionFormatBrush=QF,e.ExtensionGallery=PI,e.ExtensionGapCursor=VI,e.ExtensionHardBreak=JI,e.ExtensionHeading=_L,e.ExtensionHighlight=NL,e.ExtensionHistory=BL,e.ExtensionHorizontalRule=VL,e.ExtensionIframe=TR,e.ExtensionImage=X,e.ExtensionIndent=tV,e.ExtensionItalic=vV,e.ExtensionLink=NU,e.ExtensionListKeymap=JU,e.ExtensionNodeSelected=YU,e.ExtensionOrderedList=BU,e.ExtensionParagraph=XD,e.ExtensionPlaceholder=XU,e.ExtensionRangeSelection=iO,e.ExtensionSearchAndReplace=WW,e.ExtensionSmartScroll=GW,e.ExtensionStrike=eG,e.ExtensionSubscript=aG,e.ExtensionSuperscript=uG,e.ExtensionTable=eV,e.ExtensionTaskList=VU,e.ExtensionText=RG,e.ExtensionTextAlign=zG,e.ExtensionTextStyle=qA,e.ExtensionTrailingNode=VG,e.ExtensionUnderline=NG,e.ExtensionUpload=OK,e.ExtensionVideo=$,e.ExtensionsKit=jK,e.Fragment=O,e.GALLERY_BUBBLE_MENU_KEY=NI,e.GapCursor=z_,e.IFRAME_BUBBLE_MENU_KEY=wR,e.IMAGE_BUBBLE_MENU_KEY=Tz,e.InputRule=Nd,e.MapResult=It,e.MappablePosition=nd,e.Mapping=Rt,e.Mark=Vd,e.MarkType=tt,e.MarkView=Lf,e.MarkViewContent=nE,e.MarkdownParser=$S,e.MarkdownSerializer=rC,e.MarkdownSerializerState=sC,e.MenuItem=_C,e.Node=V,e.NodePos=lf,e.NodeRange=ke,e.NodeSelection=N,e.NodeType=Qe,e.NodeView=Rf,e.NodeViewContent=ZT,e.NodeViewWrapper=QT,e.PMInputRule=Tv,e.PMMark=k,e.PMNode=je,e.PasteRule=Ud,e.Plugin=P,e.PluginKey=F,e.RangeSelection=$D,e.RemoveMarkStep=Wt,e.RemoveNodeMarkStep=Kt,e.ReplaceAroundStep=Jt,e.ReplaceError=fe,e.ReplaceStep=qt,e.ResizableNodeView=bf,e.ResizableNodeview=xf,e.ResizeState=MT,e.ResolvedPos=Te,e.ResourceReplaceButton=HD,e.RichTextEditor=_J,e.Schema=nt,e.Selection=j,e.SelectionRange=Hn,e.Slice=A,e.Span=d_,e.Step=Bt,e.StepMap=Lt,e.StepResult=Vt,e.TABLE_BUBBLE_MENU_KEY=$B,e.TEXT_BUBBLE_MENU_KEY=LG,e.TableMap=J,e.TableView=OT,e.TextSelection=M,e.ToolbarItem=E,e.ToolbarSubItem=D,e.ToolboxItem=gD,e.Tracker=Hf,e.Transaction=er,e.Transform=Bn,Object.defineProperty(e,`TransformError`,{enumerable:!0,get:function(){return zn}}),e.VIDEO_BUBBLE_MENU_KEY=wK,e.VueEditor=YT,e.VueMarkView=rE,e.VueMarkViewRenderer=iE,e.VueNodeViewRenderer=sE,e.VueRenderer=eE,e.__clipCells=pT,e.__endComposition=Cc,e.__insertCells=_T,e.__parseFromClipboard=Sc,e.__pastedCells=uT,e.addColSpan=Tw,e.addColumn=Lw,e.addColumnAfter=zw,e.addColumnBefore=Rw,e.addListNodes=$r,e.addRow=Uw,e.addRowAfter=Gw,e.addRowBefore=Ww,e.blockTypeItem=FC,e.bulletList=Xr,e.callOrReturn=R,e.canInsertNode=Sf,e.canJoin=hn,e.canSplit=pn,e.cellAround=pw,e.cellNear=_w,e.clamp=nV,e.closeDoubleQuote=Pv,e.closeHistory=mv,e.closeSingleQuote=Iv,e.colCount=Sw,e.collab=N_,e.columnIsHeader=Ew,e.columnResizing=jT,e.columnResizingPluginKey=AT,e.combineTransactionSteps=lu,e.commands=Zc,e.convertToMediaContents=cE,e.createAtomBlockMarkdownSpec=kf,e.createBlockMarkdownSpec=Af,e.createChainableState=Yc,e.createDocument=ou,e.createElement=vf,e.h=vf,e.createInlineMarkdownSpec=Nf,e.createMappablePosition=id,e.createNodeFromContent=Al,e.createStyleTag=df,e.defaultBlockAt=uu,e.defaultDragItems=ZK,e.defaultMarkdownParser=tC,e.defaultMarkdownSerializer=iC,e.deleteCellSelection=lT,e.deleteColumn=Vw,e.deleteCurrentNodeAndSetSelection=ZD,e.deleteNode=fE,e.deleteNodeByPos=dE,e.deleteProps=Zl,e.deleteRow=qw,e.deleteTable=cT,e.dropCursor=L_,e.dropPoint=xn,e.elementFromString=kl,e.ellipsis=Mv,e.emDash=jv,e.escapeForRegEx=Cf,e.extensions=Xd,e.filterDuplicateExtensions=pE,e.findCell=xw,e.findChildren=du,e.findChildrenInRange=fu,e.findDuplicates=Du,e.findParentNode=mu,e.findParentNodeClosestToPos=pu,e.findWrapping=nn,e.fixTables=Pw,e.fixTablesKey=Mw,e.flattenExtensions=hu,e.fromString=Su,e.gapCursor=U_,e.generateAnchor=r_,e.generateAnchorId=i_,e.generateHTML=ju,e.generateJSON=Mu,e.generateText=Iu,e.getAllExternalNodes=AK,e.getAttributes=Ru,e.getAttributesFromExtensions=bu,e.getChangedRanges=Vu,e.getDebugJSON=Hu,e.getExtensionField=L,e.getHTMLFromFragment=gu,e.getIndent=cV,e.getMarkAttributes=cu,e.getMarkRange=hl,e.getMarkType=gl,e.getMarksBetween=Uu,e.getNodeAtPosition=Wu,e.getNodeAttributes=Lu,e.getNodeType=al,e.getOutdent=lV,e.getRenderedAttributes=xu,e.getSchema=Au,e.getSchemaByResolvedExtensions=Eu,e.getSchemaTypeByName=Gu,e.getSchemaTypeNameByName=Xl,e.getSplittedAttributes=Ku,e.getText=Pu,e.getTextBetween=Nu,e.getTextContentFromNodes=qu,e.getTextSerializersFromSchema=Fu,e.getUpdatedPosition=rd,e.getVersion=I_,e.getVideoElement=TK,e.getVideoSizePercentage=EK,e.goToNextCell=sT,e.handleDeletePreviousNode=QD,e.handlePaste=CT,e.handleSetSize=DK,e.history=_v,e.icons=OC,e.inSameTable=bw,e.injectExtensionAttributesToParseRule=Cu,e.inputRules=Ov,e.inputRulesPlugin=Id,e.insertPoint=bn,e.isActive=Yu,e.isAllowedUri=_E,e.isAndroid=Sl,e.isAtEndOfNode=Xu,e.isAtStartOfNode=Zu,e.isBlockEmpty=CE,e.isEmpty=yE,e.isEmptyObject=vu,e.isExtensionRulesEnabled=Qu,e.isFirefox=wf,e.isFunction=_u,e.isInTable=hw,e.isList=$u,e.isListActive=vE,e.isMacOS=Hl,e.isMarkActive=Ju,e.isNodeActive=Gl,e.isNodeContentEmpty=xE,e.isNodeEmpty=ed,e.isNodeSelection=td,e.isNumber=Hd,e.isPlainObject=Rd,e.isRegExp=dl,e.isSafari=wl,e.isString=Tf,e.isTextSelection=yl,e.isiOS=Cl,e.joinPoint=vn,e.joinUpItem=kC,e.keydownHandler=Kc,e.keymap=Gc,e.liftItem=AC,e.liftListItem=ai,e.liftTarget=en,e.listItem=Zr,e.markDownSchema=GS,e.markInputRule=pf,e.markPasteRule=zf,e.markViewProps=tE,e.markdown=Ef,e.marks=$C,e.menuBar=zC,e.mergeAttributes=z,e.mergeCells=Xw,e.mergeDeep=zd,e.minMax=bl,e.moveCellForward=yw,e.nextCell=Cw,e.nodeInputRule=mf,e.nodePasteRule=Bf,e.nodeViewProps=aE,e.nodes=YC,e.objectIncludes=fl,e.openDoubleQuote=Nv,e.openSingleQuote=Fv,e.orderedList=Yr,e.parseAttributes=Df,e.parseIndentedBlocks=Pf,e.pasteRulesPlugin=Jd,e.pmTextblockTypeInputRule=zv,e.pmWrappingInputRule=Rv,e.pointsAtCell=vw,e.posToDOMRect=ad,e.rebaseSteps=k_,e.receiveTransaction=P_,e.redo=bv,e.redoDepth=wv,e.redoItem=NC,e.redoNoScroll=Sv,e.removeColSpan=ww,e.removeColumn=Bw,e.removeDuplicates=zu,e.removeRow=Kw,e.renderGrouped=EC,e.renderNestedMarkdownContent=Ff,e.replaceStep=Sn,e.resolveExtensions=ku,e.resolveFocusPosition=xl,e.rewriteUnknownContent=sd,e.rowIsHeader=Hw,e.schema=ew,e.selectParentNodeItem=jC,e.selectedRect=Iw,e.selectionCell=gw,e.selectionToInsertionEnd=jl,e.sendableSteps=F_,e.serializeAttributes=Of,e.setCellAttr=$w,e.simplifyChanges=v_,e.sinkListItem=ci,e.smartQuotes=Lv,e.sortExtensions=Ou,e.splitCell=Zw,e.splitCellWithType=Qw,e.splitExtensions=yu,e.splitListItem=ri,e.splitListItemKeepMarks=ii,e.tableEditing=GT,e.tableEditingKey=fw,e.tableNodeTypes=dw,e.tableNodes=uw,e.textInputRule=gf,e.textPasteRule=Vf,e.textblockTypeInputRule=hf,e.toggleHeader=nT,e.toggleHeaderCell=aT,e.toggleHeaderColumn=iT,e.toggleHeaderRow=rT,e.trailingNode=qT,e.undo=yv,e.undoDepth=Cv,e.undoInputRule=Av,e.undoItem=MC,e.undoNoScroll=xv,e.updateColumnsOnResize=kT,e.updateMarkViewAttributes=If,e.useEditor=$T,e.wrapInList=ei,e.wrapItem=PC,e.wrapRangeInList=ti,e.wrappingInputRule=_f,e})({},Vue,HaloComponents,HaloUiShared,HaloApiClient);
|