@bigbinary/neeto-editor 0.2.15 → 0.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/build/index.js +1 -1
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -48,4 +48,4 @@ function Ed(e,t){if(!e)throw new Error(t)}const yd=Object(s.createContext)(null)
48
48
  * LICENSE.md file in the root directory of this source tree.
49
49
  *
50
50
  * @license MIT
51
- */;function Md(){return(Md=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Id(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}const kd=["onClick","reloadDocument","replace","state","target","to"],Ld=["aria-current","caseSensitive","className","end","style","to"];const Pd=Object(s.forwardRef)((function(e,t){let{onClick:n,reloadDocument:r,replace:i=!1,state:o,target:a,to:l}=e,c=Id(e,kd),u=Od(l),d=function(e,t){let{target:n,replace:r,state:i}=void 0===t?{}:t,o=Nd(),a=Cd(),l=wd(e);return Object(s.useCallback)(t=>{if(!(0!==t.button||n&&"_self"!==n||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(t))){t.preventDefault();let n=!!r||_d(a)===_d(l);o(e,{replace:n,state:i})}},[a,o,l,r,i,n,e])}(l,{replace:i,state:o,target:a});return Object(s.createElement)("a",Md({},c,{href:u,onClick:function(e){n&&n(e),e.defaultPrevented||r||d(e)},ref:t,target:a}))}));const Fd=Object(s.forwardRef)((function(e,t){let{"aria-current":n="page",caseSensitive:r=!1,className:i="",end:o=!1,style:a,to:l}=e,c=Id(e,Ld),u=Cd(),d=wd(l),p=u.pathname,m=d.pathname;r||(p=p.toLowerCase(),m=m.toLowerCase());let f,g=p===m||!o&&p.startsWith(m)&&"/"===p.charAt(m.length),h=g?n:void 0;f="function"==typeof i?i({isActive:g}):[i,g?"active":null].filter(Boolean).join(" ");let _="function"==typeof a?a({isActive:g}):a;return Object(s.createElement)(Pd,Md({},c,{"aria-current":h,className:f,ref:t,style:_,to:l}))}));var jd=["icon","iconPosition","iconSize","label","loading","onClick","to","type","style","fullWidth","className","disabled","size","href","tooltipProps"];function Ud(){return(Ud=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Bd(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var zd=function(){},Gd="primary",Yd="secondary",Hd="danger",Wd="text",Vd="link",qd="large",$d="left",Qd=l.a.forwardRef((function(e,t){var n,r,i=e.icon,o=void 0===i?null:i,a=e.iconPosition,s=void 0===a?"right":a,c=e.iconSize,d=void 0===c?16:c,p=e.label,m=void 0===p?"":p,f=e.loading,g=void 0!==f&&f,h=e.onClick,_=void 0===h?zd:h,b=e.to,E=void 0===b?null:b,y=e.type,v=void 0===y?"button":y,S=e.style,O=void 0===S?"primary":S,T=e.fullWidth,C=void 0!==T&&T,N=e.className,w=void 0===N?"":N,A=e.disabled,D=void 0!==A&&A,R=e.size,x=void 0===R?null:R,M=e.href,I=void 0===M?null:M,k=e.tooltipProps,L=void 0===k?null:k,P=Bd(e,jd);E?(n=Pd,r={to:E}):I?(n="a",r={href:I}):(n="button",r={type:v});var F="string"==typeof o?function(){return l.a.createElement("i",{className:u()("neeto-ui-btn__icon",[o])})}:o||l.a.Fragment;return l.a.createElement(od,Ud({},L,{disabled:!L}),l.a.createElement(n,Ud({ref:t,onClick:function(e){g||D||_(e)},className:u()("neeto-ui-btn",[w],{"neeto-ui-btn--style-primary":O===Gd,"neeto-ui-btn--style-secondary":O===Yd,"neeto-ui-btn--style-danger":O===Hd,"neeto-ui-btn--style-text":O===Wd,"neeto-ui-btn--style-link":O===Vd,"neeto-ui-btn--size-large":x===qd,"neeto-ui-btn--width-full":C,"neeto-ui-btn--icon-left":s==$d,"neeto-ui-btn--icon-only":!m,disabled:D}),disabled:D},r,P),m&&l.a.createElement("span",null,m),o?l.a.createElement(F,{key:"2",size:d,className:"neeto-ui-btn__icon"}):null))})),Kd=/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/;function Zd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Jd=function(e){var t=e.editor,n=Object(s.useRef)(),r=Zd(Object(s.useState)(""),2),i=r[0],o=r[1],a=Zd(Object(s.useState)(""),2),c=a[0],u=a[1],d=t.isActive("link"),p=function(){u(t.getAttributes("link").href||"")};return l.a.createElement(Lu,{ref:n,customTarget:function(){return l.a.createElement("button",{className:"h-full p-3 transition-colors editor-fixed-menu--item",onClick:p},l.a.createElement(Rc.Link,{size:24,color:d?"#2F3941":"#87929D"}))},className:"fontsize-dropdown",position:"bottom",closeOnSelect:!1},l.a.createElement("div",{className:"flex py-1 space-x-3 add-link-form"},l.a.createElement("div",{className:"flex-row w-full"},l.a.createElement(fd,{name:"url",value:c,placeholder:"Paste URL",onFocus:function(){return o("")},error:i,onChange:function(e){var t=e.target.value;return u(t)}})),l.a.createElement(Qd,{label:"Link",onClick:function(e){var r;(e.preventDefault(),Kd.test(c))?(t.chain().focus().setLink({href:c}).run(),null===(r=n.current)||void 0===r||r.close()):o("Please enter a valid url")},className:"self-start"}),d?l.a.createElement(Qd,{label:"Unlink",onClick:function(){var e;t.chain().focus().unsetLink().run(),null===(e=n.current)||void 0===e||e.close()},className:"self-start"}):null))},ep=["Icon","command","active","optionName","disabled"];function tp(){return(tp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function np(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var rp=function(e){var t=e.editor,n=e.variables,r=e.setImageUploadVisible;if(!t)return null;var i=[{Icon:Rc.TextBold,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:Rc.TextItalic,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:Rc.Underline,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline",size:27},{Icon:Rc.TextCross,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:Rc.Highlight,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}],o=[{Icon:Rc.Quote,command:function(){return t.chain().focus().toggleBlockquote().run()},active:t.isActive("blockquote"),optionName:"block-quote"},{Icon:Rc.Code,command:function(){return t.chain().focus().toggleCodeBlock().run()},active:t.isActive("codeBlock"),optionName:"codeBlock"},{Icon:Rc.Image,command:function(){return r(!0)},optionName:"image-upload"}],a=[{Icon:Rc.ListDot,command:function(){return t.chain().focus().toggleBulletList().run()},active:t.isActive("bulletList"),optionName:"bullet-list"},{Icon:Rc.ListNumber,command:function(){return t.chain().focus().toggleOrderedList().run()},active:t.isActive("orderedList"),optionName:"ordered-list"}],s=[{Icon:Rc.Undo,command:function(){return t.chain().focus().undo().run()},optionName:"undo",disabled:!t.can().undo(),active:t.can().undo()},{Icon:Rc.Redo,command:function(){return t.chain().focus().redo().run()},optionName:"redo",disabled:!t.can().redo(),active:t.can().redo()}],c=function(e){var t=e.Icon,n=e.command,r=e.active,i=e.optionName,o=e.disabled,a=np(e,ep);return l.a.createElement("button",{disabled:o,onClick:n,key:i,className:"p-3 transition-colors cursor-pointer editor-fixed-menu--item"},l.a.createElement(t,tp({color:r?"#2F3941":"#87929D"},a)))};return l.a.createElement("div",{className:"flex space-x-6 border-t border-l border-r editor-fixed-menu--root"},l.a.createElement("div",{className:"flex"},l.a.createElement(Vc,{color:t.getAttributes("textStyle").color,onChange:function(e){return t.chain().focus().setColor(e).run()}}),l.a.createElement(Pu,{editor:t}),i.map(c)),l.a.createElement("div",{className:"flex"},l.a.createElement(Jd,{editor:t}),o.map(c)),[a,s].map((function(e,t){return l.a.createElement("div",{className:"flex",key:t},e.map(c))})),l.a.createElement("div",{className:"flex justify-end flex-1"},l.a.createElement(Gu,{editor:t,variables:n})))},ip=n(5),op=n.n(ip),ap=n(50),sp=n.n(ap),lp=function(e){var t=e.children,n=e.className,r=void 0===n?"root-portal":n,i=e.el,o=void 0===i?"div":i,a=document.getElementsByClassName(r)[0];return a||(a=document.createElement(o)).classList.add(r),l.a.useEffect((function(){document.body.appendChild(a)}),[]),hc.a.createPortal(t,a)},cp=["children","className"];function up(){return(up=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function dp(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var pp=function(e){var t,n,r,i=e.children,o=e.className,a=dp(e,cp);return l.a.createElement("div",up({className:u()("transition-opacity bg-gray-500 bg-opacity-50",(t={},n=o,r=o,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t))},a),i)},mp=["size","isOpen","onClose","loading","children","className","closeOnEsc","closeButton","backdropClassName","closeOnOutsideClick"];function fp(){return(fp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function gp(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var hp=function(){},_p="xs",bp="sm",Ep="md",yp=function(e){var t,n,r,i=e.size,o=void 0===i?"sm":i,a=e.isOpen,c=void 0!==a&&a,d=e.onClose,p=void 0===d?hp:d,m=e.loading,f=void 0!==m&&m,g=e.children,h=e.className,_=void 0===h?"":h,b=e.closeOnEsc,E=void 0===b||b,y=e.closeButton,v=void 0===y||y,S=e.backdropClassName,O=void 0===S?"":S,T=e.closeOnOutsideClick,C=void 0===T||T,N=gp(e,mp),w=Object(s.useRef)();return C&&Cu(w,p),E&&Ou("esc",p),l.a.createElement(lp,{className:"neeto-ui-portal"},c&&l.a.createElement(pp,{key:"modal-backdrop",className:u()("neeto-ui-modal__backdrop",O)},l.a.createElement("div",fp({ref:w,key:"modal-wrapper",className:u()("neeto-ui-modal__wrapper",(t={"neeto-ui-modal__wrapper--xs":o===_p,"neeto-ui-modal__wrapper--sm":o===bp,"neeto-ui-modal__wrapper--md":o===Ep},n=_,r=_,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t))},N),v&&l.a.createElement(Qd,{style:"text",icon:Rc.Close,className:"neeto-ui-modal__close",onClick:p}),f?l.a.createElement(l.a.Fragment,null):g)))},vp=["children","size","noUnderline","className"],Sp=["active","className","children","icon","onClick","activeClassName"];function Op(){return(Op=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Tp(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Cp=function(){},Np="large",wp=function(e){var t=e.children,n=e.size,r=e.noUnderline,i=e.className,o=void 0===i?"":i,a=Tp(e,vp);return l.a.createElement("div",Op({className:u()({"neeto-ui-tab__wrapper flex":!0},{"neeto-ui-tab__wrapper--size-large":n===Np},{"neeto-ui-tab__wrapper--underline-none":r},[o]),"data-cy":"tab-container"},a),t)};wp.Item=function(e){var t=e.active,n=e.className,r=void 0===n?"":n,i=e.children,o=e.icon,a=void 0===o?null:o,s=e.onClick,c=void 0===s?Cp:s,d=e.activeClassName,p=void 0===d?"":d,m=Tp(e,Sp),f="button",g="string"==typeof a?function(){return l.a.createElement("i",{className:a,"data-cy":"tab-item-icon"})}:a||l.a.Fragment;return p&&(f=Fd),l.a.createElement(f,Op({className:u()(["neeto-ui-tab flex items-center justify-center select-none",r],{active:t}),onClick:c,"data-cy":"tab-item"},m),a&&l.a.createElement(g,{className:"neeto-ui-tab__icon"}),i)};var Ap=wp;function Dp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Rp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xp=function(e){var t,n,r,i=e.buttonLabel,o=void 0===i?"Submit":i,a=e.placeholder,c=e.onSubmit,d=e.className,p=Dp(Object(s.useState)(""),2),m=p[0],f=p[1],g=Dp(Object(s.useState)(""),2),h=g[0],_=g[1];return l.a.createElement("div",{className:u()("flex flex-col items-center justify-center flex-1 mx-10 flex-wrap",(t={},n=d,r=d,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t))},l.a.createElement("div",{className:"flex-row w-full my-4"},l.a.createElement(fd,{name:"url",value:m,placeholder:a,onFocus:function(){return _("")},error:h,onChange:function(e){var t=e.target.value;return f(t)}})),l.a.createElement(Qd,{label:o,onClick:function(e){e.preventDefault(),Kd.test(m)?c(m):_("Please enter a valid url")}}))};function Mp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ip(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ip(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ip(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var kp=function(e){var t,n=Mp(Object(s.useState)(null===(t=e[0])||void 0===t?void 0:t.key),2),r=n[0],i=n[1];return[r,function(e){return i(e.key)}]},Lp=(n(32),n(43),n(44)),Pp=n.n(Lp),Fp=(n(45),n(46),n(47),n(48),function(e){var t=e.uppy;return l.a.createElement(Pp.a,{note:"Max. File Size: 5MB",uppy:t,locale:{strings:{dropHereOr:"Drop your file(s) here or %{browse}",browse:"Browse"}},className:"local-upload__root"})});function jp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Up(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Up(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Up(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Bp=function(e){var t=e.uppy,n=jp(Object(s.useState)(0),2),r=n[0],i=n[1];Object(s.useEffect)((function(){t.on("progress",i)}),[t]);var o="".concat(r,"%");return l.a.createElement("div",{className:"progress-bar__root"},l.a.createElement("div",{className:"flex items-center justify-between"},l.a.createElement("span",{className:"progress-bar__percent-text"},o),l.a.createElement("button",{onClick:t.cancelAll},l.a.createElement(Rc.Close,{size:16}))),l.a.createElement("div",{className:"progress-bar__indicator"},l.a.createElement("div",{className:"flex h-full"},l.a.createElement("div",{style:{width:o},className:"flex flex-col justify-center text-center text-white shadow-none whitespace-nowrap progress-bar__indicator-inner"}))))},zp=[{title:"Upload",key:"local"},{title:"Link",key:"link"}];function Gp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Hp=function(e){var t,n=e.editor,r=e.imageUploadUrl,i=e.isVisible,o=e.setIsVisible,a=Gp(Object(s.useState)(!1),2),c=a[0],u=a[1],d=Gp(kp(zp),2),p=d[0],m=d[1],f=Object(s.useMemo)((function(){return new op.a({allowMultipleUploads:!1,autoProceed:!0,debug:!0}).use(sp.a,{endpoint:r||"/api/v1/direct_uploads",formData:!0,fieldName:"blob"}).on("upload",(function(){return u(!0)})).on("upload-success",(function(e,t){var r=t.body.imageURL;n.chain().focus().setImage({src:r}).run(),o(!1)})).on("cancel-all",(function(){return u(!1)})).on("complete",(function(){return u(!1)}))}),[n]);return l.a.createElement(yp,{isOpen:i,onClose:function(){return o(!1)},className:"image-uploader__modal",closeButton:!1},l.a.createElement("div",{className:"image-uploader__root"},l.a.createElement(Ap,null,zp.map((function(e){return l.a.createElement(Ap.Item,{key:e.key,active:p===e.key,onClick:function(){return m(e)}},e.title)}))),l.a.createElement("div",{className:"image-uploader__content"},c?l.a.createElement("div",{className:"flex flex-col items-center justify-center flex-1 text-center"},l.a.createElement("span",{className:"label--primary"},"Uploading..."),l.a.createElement("span",{className:"label--secondary"},null===(t=f.getFiles()[0])||void 0===t?void 0:t.name),l.a.createElement(Bp,{uppy:f})):"local"===p?l.a.createElement(Fp,{uppy:f}):"link"===p?l.a.createElement(xp,{onSubmit:function(e){n.chain().focus().setImage({src:e}).run(),o(!1)},buttonLabel:"Upload Image",placeholder:"Paste the image link"}):null)))};const Wp=/^\s*>\s$/,Vp=ns.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block*",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setBlockquote:()=>({commands:e})=>e.wrapIn("blockquote"),toggleBlockquote:()=>({commands:e})=>e.toggleWrap("blockquote"),unsetBlockquote:()=>({commands:e})=>e.lift("blockquote")}),addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[us({find:Wp,type:this.type})]}}),qp=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,$p=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Qp=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Kp=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Zp=rs.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setBold:()=>({commands:e})=>e.setMark("bold"),toggleBold:()=>({commands:e})=>e.toggleMark("bold"),unsetBold:()=>({commands:e})=>e.unsetMark("bold")}),addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ss({find:qp,type:this.type}),ss({find:Qp,type:this.type})]},addPasteRules(){return[ds({find:$p,type:this.type}),ds({find:Kp,type:this.type})]}}),Xp=/^\s*([-+*])\s$/,Jp=ns.create({name:"bulletList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleBulletList:()=>({commands:e})=>e.toggleList("bulletList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[us({find:Xp,type:this.type})]}}),em=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,tm=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,nm=rs.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setCode:()=>({commands:e})=>e.setMark("code"),toggleCode:()=>({commands:e})=>e.toggleMark("code"),unsetCode:()=>({commands:e})=>e.unsetMark("code")}),addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[ss({find:em,type:this.type})]},addPasteRules(){return[ds({find:tm,type:this.type})]}}),rm=/^```(?<language>[a-z]*)?[\s\n]$/,im=/^~~~(?<language>[a-z]*)?[\s\n]$/,om=ns.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,r=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return r||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:e}){return["pre",this.options.HTMLAttributes,["code",e,0]]},addCommands:()=>({setCodeBlock:e=>({commands:t})=>t.setNode("codeBlock",e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode("codeBlock","paragraph",e)}),addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())}}},addInputRules(){return[ls({find:rm,type:this.type,getAttributes:({groups:e})=>e}),ls({find:im,type:this.type,getAttributes:({groups:e})=>e})]},addProseMirrorPlugins(){return[new Tt({key:new wt("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;const{tr:a}=e.state;return a.replaceSelectionWith(this.type.create({language:o})),a.setSelection(lt.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.insertText(n.replace(/\r\n?/g,"\n")),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}});var am=ns.create({name:"doc",topNode:!0,content:"block+"});var sm=function(e,t){var n=this;this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var r=function(e){return n[t](e)};return e.dom.addEventListener(t,r),{name:t,handler:r}}))};sm.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var n=t.name,r=t.handler;return e.editorView.dom.removeEventListener(n,r)}))},sm.prototype.update=function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())},sm.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},sm.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,r=t.nodeAfter;if(n||r){var i=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),o=n?i.bottom:i.top;n&&r&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:i.left,right:i.right,top:o-this.width/2,bottom:o+this.width/2}}}if(!e){var a=this.editorView.coordsAtPos(this.cursorPos);e={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}var s,l,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!c||c==document.body&&"static"==getComputedStyle(c).position)s=-pageXOffset,l=-pageYOffset;else{var u=c.getBoundingClientRect();s=u.left-c.scrollLeft,l=u.top-c.scrollTop}this.element.style.left=e.left-s+"px",this.element.style.top=e.top-l+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"},sm.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},sm.prototype.dragover=function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY});if(t){var n=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(n=He(this.editorView.state.doc,n,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(n),this.scheduleRemoval(5e3)}}},sm.prototype.dragend=function(){this.scheduleRemoval(20)},sm.prototype.drop=function(){this.scheduleRemoval(20)},sm.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};const lm=lo.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:null}),addProseMirrorPlugins(){return[(e=this.options,void 0===e&&(e={}),new Tt({view:function(t){return new sm(t,e)}}))];var e}});var cm=function(e){function t(t){e.call(this,t,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,r){var i=n.resolve(r.map(this.head));return t.valid(i)?new t(i):e.near(i)},t.prototype.content=function(){return y.empty},t.prototype.eq=function(e){return e instanceof t&&e.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))},t.prototype.getBookmark=function(){return new um(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var n=e.index(t);if(0!=n)for(var r=e.node(t).child(n-1);;r=r.lastChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(var i=r.child(n);;i=i.firstChild){if(0==i.childCount&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}(e))return!1;var n=t.type.spec.allowGapCursor;if(null!=n)return n;var r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock},t.findFrom=function(e,n,r){e:for(;;){if(!r&&t.valid(e))return e;for(var i=e.pos,o=null,a=e.depth;;a--){var s=e.node(a);if(n>0?e.indexAfter(a)<s.childCount:e.index(a)>0){o=s.child(n>0?e.indexAfter(a):e.index(a)-1);break}if(0==a)return null;i+=n;var l=e.doc.resolve(i);if(t.valid(l))return l}for(;;){var c=n>0?o.firstChild:o.lastChild;if(!c){if(o.isAtom&&!o.isText&&!ut.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=c,i+=n;var u=e.doc.resolve(i);if(t.valid(u))return u}return null}},t}(ot);cm.prototype.visible=!1,ot.jsonID("gapcursor",cm);var um=function(e){this.pos=e};um.prototype.map=function(e){return new um(e.map(this.pos))},um.prototype.resolve=function(e){var t=e.resolve(this.pos);return cm.valid(t)?new cm(t):ot.near(t)};var dm=no({ArrowLeft:pm("horiz",-1),ArrowRight:pm("horiz",1),ArrowUp:pm("vert",-1),ArrowDown:pm("vert",1)});function pm(e,t){var n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){var o=e.selection,a=t>0?o.$to:o.$from,s=o.empty;if(o instanceof lt){if(!i.endOfTextblock(n)||0==a.depth)return!1;s=!1,a=e.doc.resolve(t>0?a.after():a.before())}var l=cm.findFrom(a,t,s);return!!l&&(r&&r(e.tr.setSelection(new cm(l))),!0)}}function mm(e,t,n){if(!e.editable)return!1;var r=e.state.doc.resolve(t);if(!cm.valid(r))return!1;var i=e.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(i>-1&&ut.isSelectable(e.state.doc.nodeAt(i)))&&(e.dispatch(e.state.tr.setSelection(new cm(r))),!0)}function fm(e){if(!(e.selection instanceof cm))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",Ci.create(e.doc,[vi.widget(e.selection.head,t,{key:"gapcursor"})])}const gm=lo.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Tt({props:{decorations:fm,createSelectionBetween:function(e,t,n){if(t.pos==n.pos&&cm.valid(n))return new cm(n)},handleClick:mm,handleKeyDown:dm}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=ao(so(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),hm=ns.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",Qa(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{keepMarks:e}=this.options,{splittableMarks:i}=r.extensionManager,o=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();return t().insertContent({type:this.name}).command(({tr:t,dispatch:n})=>{if(n&&o&&e){const e=o.filter(e=>i.includes(e.type.name));t.ensureMarks(e)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),_m=ns.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:"h"+e,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return["h"+(this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]),Qa(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode("heading",e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode("heading","paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,["Mod-Alt-"+t]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>ls({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var bm=function(){};bm.prototype.append=function(e){return e.length?(e=bm.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},bm.prototype.prepend=function(e){return e.length?bm.from(e).append(this):this},bm.prototype.appendInner=function(e){return new ym(this,e)},bm.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?bm.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},bm.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},bm.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},bm.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},bm.from=function(e){return e instanceof bm?e:e&&e.length?new Em(e):bm.empty};var Em=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)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}(bm);bm.empty=new Em([]);var ym=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;return!(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r))&&(!(n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&(!(n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(bm),vm=bm,Sm=function(e,t){this.items=e,this.eventCount=t};Sm.prototype.popEvent=function(e,t){var n=this;if(0==this.eventCount)return null;for(var r,i,o=this.items.length;;o--){if(this.items.get(o-1).selection){--o;break}}t&&(r=this.remapping(o,this.items.length),i=r.maps.length);var a,s,l=e.tr,c=[],u=[];return this.items.forEach((function(e,t){if(!e.step)return r||(r=n.remapping(o,t+1),i=r.maps.length),i--,void u.push(e);if(r){u.push(new Om(e.map));var d,p=e.step.map(r.slice(i));p&&l.maybeStep(p).doc&&(d=l.mapping.maps[l.mapping.maps.length-1],c.push(new Om(d,null,null,c.length+u.length))),i--,d&&r.appendMap(d,i)}else l.maybeStep(e.step);return e.selection?(a=r?e.selection.map(r.slice(i)):e.selection,s=new Sm(n.items.slice(0,o).append(u.reverse().concat(c)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:a}},Sm.prototype.addTransform=function(e,t,n,r){for(var i=[],o=this.eventCount,a=this.items,s=!r&&a.length?a.get(a.length-1):null,l=0;l<e.steps.length;l++){var c,u=e.steps[l].invert(e.docs[l]),d=new Om(e.mapping.maps[l],u,t);(c=s&&s.merge(d))&&(d=c,l?i.pop():a=a.slice(0,a.length-1)),i.push(d),t&&(o++,t=null),r||(s=d)}var p,m,f,g=o-n.depth;return g>Cm&&(m=g,(p=a).forEach((function(e,t){if(e.selection&&0==m--)return f=t,!1})),a=p.slice(f),o-=g),new Sm(a.append(i),o)},Sm.prototype.remapping=function(e,t){var n=new Ne;return this.items.forEach((function(t,r){var i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:null;n.appendMap(t.map,i)}),e,t),n},Sm.prototype.addMaps=function(e){return 0==this.eventCount?this:new Sm(this.items.append(e.map((function(e){return new Om(e)}))),this.eventCount)},Sm.prototype.rebased=function(e,t){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach((function(e){e.selection&&a--}),r);var s=t;this.items.forEach((function(t){var r=i.getMirror(--s);if(null!=r){o=Math.min(o,r);var l=i.maps[r];if(t.step){var c=e.steps[r].invert(e.docs[r]),u=t.selection&&t.selection.map(i.slice(s+1,r));u&&a++,n.push(new Om(l,c,u))}else n.push(new Om(l))}}),r);for(var l=[],c=t;c<o;c++)l.push(new Om(i.maps[c]));var u=this.items.slice(0,r).append(l).append(n),d=new Sm(u,a);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d},Sm.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},Sm.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach((function(o,a){if(a>=e)r.push(o),o.selection&&i++;else if(o.step){var s=o.step.map(t.slice(n)),l=s&&s.getMap();if(n--,l&&t.appendMap(l,n),s){var c=o.selection&&o.selection.map(t.slice(n));c&&i++;var u,d=new Om(l.invert(),s,c),p=r.length-1;(u=r.length&&r[p].merge(d))?r[p]=u:r.push(d)}}else o.map&&n--}),this.items.length,0),new Sm(vm.from(r.reverse()),i)},Sm.empty=new Sm(vm.empty,0);var Om=function(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r};Om.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new Om(t.getMap().invert(),t,this.selection)}};var Tm=function(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r},Cm=20;function Nm(e){var t=[];return e.forEach((function(e,n,r,i){return t.push(r,i)})),t}function wm(e,t){if(!e)return null;for(var n=[],r=0;r<e.length;r+=2){var i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function Am(e,t,n,r){var i=xm(t),o=Mm.get(t).spec.config,a=(r?e.undone:e.done).popEvent(t,i);if(a){var s=a.selection.resolve(a.transform.doc),l=(r?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),o,i),c=new Tm(r?l:a.remaining,r?a.remaining:l,null,0);n(a.transform.setSelection(s).setMeta(Mm,{redo:r,historyState:c}).scrollIntoView())}}var Dm=!1,Rm=null;function xm(e){var t=e.plugins;if(Rm!=t){Dm=!1,Rm=t;for(var n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){Dm=!0;break}}return Dm}var Mm=new wt("history"),Im=new wt("closeHistory");function km(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new Tt({key:Mm,state:{init:function(){return new Tm(Sm.empty,Sm.empty,null,0)},apply:function(t,n,r){return function(e,t,n,r){var i,o=n.getMeta(Mm);if(o)return o.historyState;n.getMeta(Im)&&(e=new Tm(e.done,e.undone,null,0));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(a&&a.getMeta(Mm))return a.getMeta(Mm).redo?new Tm(e.done.addTransform(n,null,r,xm(t)),e.undone,Nm(n.mapping.maps[n.steps.length-1]),e.prevTime):new Tm(e.done,e.undone.addTransform(n,null,r,xm(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new Tm(e.done.rebased(n,i),e.undone.rebased(n,i),wm(e.prevRanges,n.mapping),e.prevTime):new Tm(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),wm(e.prevRanges,n.mapping),e.prevTime);var s=0==e.prevTime||!a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;return e.mapping.maps[0].forEach((function(e,r){for(var i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)})),n}(n,e.prevRanges)),l=a?wm(e.prevRanges,n.mapping):Nm(n.mapping.maps[n.steps.length-1]);return new Tm(e.done.addTransform(n,s?t.selection.getBookmark():null,r,xm(t)),Sm.empty,l,n.time)}(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var n="historyUndo"==t.inputType?Lm(e.state,e.dispatch):"historyRedo"==t.inputType&&Pm(e.state,e.dispatch);return n&&t.preventDefault(),n}}}})}function Lm(e,t){var n=Mm.getState(e);return!(!n||0==n.done.eventCount)&&(t&&Am(n,e,t,!1),!0)}function Pm(e,t){var n=Mm.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&Am(n,e,t,!0),!0)}const Fm=lo.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Lm(e,t),redo:()=>({state:e,dispatch:t})=>Pm(e,t)}),addProseMirrorPlugins(){return[km(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),jm=ns.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",Qa(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().command(({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,$anchor:i}=n,o=i.parent.isTextblock&&!i.parent.type.spec.code&&!i.parent.textContent;if(!r||!o||!t)return!0;const a=i.before(),s=i.start();return e.deleteRange(a,s),e.setSelection(lt.create(e.doc,a)),!0}).insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{var n;if(t){const{parent:t,pos:r}=e.selection.$from,i=r+1;if(!e.doc.nodeAt(i)){const r=null===(n=t.type.contentMatch.defaultType)||void 0===n?void 0:n.create();r&&(e.insert(i,r),e.setSelection(lt.create(e.doc,i)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[is({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Um=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,Bm=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,zm=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,Gm=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,Ym=rs.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setItalic:()=>({commands:e})=>e.setMark("italic"),toggleItalic:()=>({commands:e})=>e.toggleMark("italic"),unsetItalic:()=>({commands:e})=>e.unsetMark("italic")}),addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ss({find:Um,type:this.type}),ss({find:zm,type:this.type})]},addPasteRules(){return[ds({find:Bm,type:this.type}),ds({find:Gm,type:this.type})]}}),Hm=ns.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Qa(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem("listItem"),Tab:()=>this.editor.commands.sinkListItem("listItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("listItem")}}}),Wm=/^(\d+)\.\s$/,Vm=ns.create({name:"orderedList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",Qa(this.options.HTMLAttributes,n),0]:["ol",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleOrderedList:()=>({commands:e})=>e.toggleList("orderedList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[us({find:Wm,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),qm=ns.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setParagraph:()=>({commands:e})=>e.setNode("paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),$m=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,Qm=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,Km=rs.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setStrike:()=>({commands:e})=>e.setMark("strike"),toggleStrike:()=>({commands:e})=>e.toggleMark("strike"),unsetStrike:()=>({commands:e})=>e.unsetMark("strike")}),addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ss({find:$m,type:this.type})]},addPasteRules(){return[ds({find:Qm,type:this.type})]}});var Zm=ns.create({name:"text",group:"inline"});const Xm=lo.create({name:"starterKit",addExtensions(){var e,t,n,r,i,o,a,s,l,c,u,d,p,m,f,g,h,_;const b=[];return!1!==this.options.blockquote&&b.push(Vp.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&b.push(Zp.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&b.push(Jp.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&b.push(nm.configure(null===(r=this.options)||void 0===r?void 0:r.code)),!1!==this.options.codeBlock&&b.push(om.configure(null===(i=this.options)||void 0===i?void 0:i.codeBlock)),!1!==this.options.document&&b.push(am.configure(null===(o=this.options)||void 0===o?void 0:o.document)),!1!==this.options.dropcursor&&b.push(lm.configure(null===(a=this.options)||void 0===a?void 0:a.dropcursor)),!1!==this.options.gapcursor&&b.push(gm.configure(null===(s=this.options)||void 0===s?void 0:s.gapcursor)),!1!==this.options.hardBreak&&b.push(hm.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&b.push(_m.configure(null===(c=this.options)||void 0===c?void 0:c.heading)),!1!==this.options.history&&b.push(Fm.configure(null===(u=this.options)||void 0===u?void 0:u.history)),!1!==this.options.horizontalRule&&b.push(jm.configure(null===(d=this.options)||void 0===d?void 0:d.horizontalRule)),!1!==this.options.italic&&b.push(Ym.configure(null===(p=this.options)||void 0===p?void 0:p.italic)),!1!==this.options.listItem&&b.push(Hm.configure(null===(m=this.options)||void 0===m?void 0:m.listItem)),!1!==this.options.orderedList&&b.push(Vm.configure(null===(f=this.options)||void 0===f?void 0:f.orderedList)),!1!==this.options.paragraph&&b.push(qm.configure(null===(g=this.options)||void 0===g?void 0:g.paragraph)),!1!==this.options.strike&&b.push(Km.configure(null===(h=this.options)||void 0===h?void 0:h.strike)),!1!==this.options.text&&b.push(Zm.configure(null===(_=this.options)||void 0===_?void 0:_.text)),b}}),Jm=cs({find:/--$/,replace:"—"}),ef=cs({find:/\.\.\.$/,replace:"…"}),tf=cs({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:"“"}),nf=cs({find:/"$/,replace:"”"}),rf=cs({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:"‘"}),of=cs({find:/'$/,replace:"’"}),af=cs({find:/<-$/,replace:"←"}),sf=cs({find:/->$/,replace:"→"}),lf=cs({find:/\(c\)$/,replace:"©"}),cf=cs({find:/\(tm\)$/,replace:"™"}),uf=cs({find:/\(r\)$/,replace:"®"}),df=cs({find:/1\/2$/,replace:"½"}),pf=cs({find:/\+\/-$/,replace:"±"}),mf=cs({find:/!=$/,replace:"≠"}),ff=cs({find:/<<$/,replace:"«"}),gf=cs({find:/>>$/,replace:"»"}),hf=cs({find:/\d+\s?([*x])\s?\d+$/,replace:"×"}),_f=cs({find:/\^2$/,replace:"²"}),bf=cs({find:/\^3$/,replace:"³"}),Ef=cs({find:/1\/4$/,replace:"¼"}),yf=cs({find:/3\/4$/,replace:"¾"}),vf=lo.create({name:"typography",addInputRules:()=>[Jm,ef,tf,nf,rf,of,af,sf,lf,cf,uf,df,pf,mf,ff,gf,hf,_f,bf,Ef,yf]}),Sf=/(?:^|\s)((?:==)((?:[^~]+))(?:==))$/,Of=/(?:^|\s)((?:==)((?:[^~]+))(?:==))/g,Tf=rs.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:"background-color: "+e.color}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setHighlight:e=>({commands:t})=>t.setMark("highlight",e),toggleHighlight:e=>({commands:t})=>t.toggleMark("highlight",e),unsetHighlight:()=>({commands:e})=>e.unsetMark("highlight")}),addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[ss({find:Sf,type:this.type})]},addPasteRules(){return[ds({find:Of,type:this.type})]}});var Cf=n(25);const Nf=rs.create({name:"link",priority:1e3,inclusive:!1,addOptions:()=>({openOnClick:!0,linkOnPaste:!0,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"}}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target}}},parseHTML:()=>[{tag:"a[href]"}],renderHTML({HTMLAttributes:e}){return["a",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setLink:e=>({commands:t})=>t.setMark("link",e),toggleLink:e=>({commands:t})=>t.toggleMark("link",e,{extendEmptyMarkRange:!0}),unsetLink:()=>({commands:e})=>e.unsetMark("link",{extendEmptyMarkRange:!0})}),addPasteRules(){return[ds({find:e=>Object(Cf.find)(e).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[];return this.options.openOnClick&&e.push(new Tt({key:new wt("handleClickLink"),props:{handleClick:(e,t,n)=>{var r;const i=this.editor.getAttributes("link");return!(!(null===(r=n.target)||void 0===r?void 0:r.closest("a"))||!i.href)&&(window.open(i.href,i.target),!0)}}})),this.options.linkOnPaste&&e.push(new Tt({key:new wt("handlePasteLink"),props:{handlePaste:(e,t,n)=>{const{state:r}=e,{selection:i}=r,{empty:o}=i;if(o)return!1;let a="";n.content.forEach(e=>{a+=e.textContent});const s=Object(Cf.find)(a).find(e=>e.isLink&&e.value===a);return!(!a||!s)&&(this.editor.commands.setMark(this.type,{href:s.href}),!0)}}})),e}}),wf=rs.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",Qa(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=sa(e,this.type);return!!Object.entries(n).some(([,e])=>!!e)||t.unsetMark("textStyle")}}}}),Af=lo.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>e.style.color.replace(/['"]+/g,""),renderHTML:e=>e.color?{style:"color: "+e.color}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})});var Df=n(12),Rf=n.n(Df);var xf=ns.create({name:"doc",topNode:!0,content:"block+"}).extend({content:"root",addProseMirrorPlugins:function(){var e=this.editor;return[new Tt({key:new wt("eventHandler"),props:{handleClick:function(t,n){var r=t.state,i=r.doc.lastChild,o=r.doc.resolve(n).nodeBefore;if(i&&o){var a=i.eq(o),s=i.isInline,l=["paragraph","text"].includes(i.type.name);!a||s||l||e.commands.insertContentAt(n,{type:"paragraph",content:""})}}}})]}});const Mf=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/,If=ns.create({name:"image",addOptions:()=>({inline:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML:()=>[{tag:"img[src]"}],renderHTML({HTMLAttributes:e}){return["img",Qa(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[is({find:Mf,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}});function kf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Lf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kf(Object(n),!0).forEach((function(t){Pf(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Pf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ff=If.extend({name:"image",addAttributes:function(){return Lf(Lf({},If.config.addAttributes()),{},{size:{default:"small",rendered:!1},float:{default:"none",rendered:!1}})},addCommands:function(){var e=this;return{setImage:function(t){return function(n){var r,i,o,a=n.tr,s=n.commands;return"image"==(null===(r=a.selection)||void 0===r||null===(i=r.node)||void 0===i||null===(o=i.type)||void 0===o?void 0:o.name)?s.updateAttributes("image",t):s.insertContent({type:e.name,attrs:t})}}}},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes;return n.class=" image-"+t.attrs.size,n.class+=" image-float-"+t.attrs.float,["img",Qa(this.options.HTMLAttributes,n)]}});const jf=rs.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setUnderline:()=>({commands:e})=>e.setMark("underline"),toggleUnderline:()=>({commands:e})=>e.toggleMark("underline"),unsetUnderline:()=>({commands:e})=>e.unsetMark("underline")}),addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline()}}});function Uf(e){return(Uf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Bf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function zf(e,t){return(zf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Gf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Wf(e);if(t){var i=Wf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Yf(this,n)}}function Yf(e,t){if(t&&("object"===Uf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Hf(e)}function Hf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wf(e){return(Wf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Vf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zf(e,t)}(o,e);var t,n,r,i=Gf(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),Vf(Hf(t=i.call(this,e)),"onKeyDown",(function(e){var n=e.event;return"ArrowUp"===n.key?(t.upHandler(),!0):"ArrowDown"===n.key?(t.downHandler(),!0):"Enter"===n.key&&(t.enterHandler(),!0)})),Vf(Hf(t),"upHandler",(function(){t.setState({selectedIndex:(t.state.selectedIndex+t.props.items.length-1)%t.props.items.length})})),Vf(Hf(t),"downHandler",(function(){t.setState({selectedIndex:(t.state.selectedIndex+1)%t.props.items.length})})),Vf(Hf(t),"enterHandler",(function(){t.selectItem(t.state.selectedIndex)})),Vf(Hf(t),"selectItem",(function(e){var n=t.props.items[e];if(n){var r=t.props,i=r.editor,o=r.range;n.command({editor:i,range:o})}})),t.state={selectedIndex:0},t}return t=o,(n=[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0})}},{key:"render",value:function(){var e=this;return l.a.createElement("div",{className:"relative p-3 -mr-1 space-y-2 overflow-x-hidden overflow-y-scroll rounded shadow max-h-80 w-80 editor-command-list--root"},this.props.items.map((function(t,n){return l.a.createElement($f,{key:t.title,item:t,index:n,selectedIndex:e.state.selectedIndex,selectItem:function(){return e.selectItem(n)}})})))}}])&&Bf(t.prototype,n),r&&Bf(t,r),o}(l.a.Component),$f=function(e){var t=e.item,n=e.selectedIndex,r=e.index,i=e.selectItem,o=t.Icon;return l.a.createElement("div",{className:u()("flex items-center w-full px-4 py-2 space-x-4 transition-all duration-100 ease-in-out editor-command-list--item cursor-pointer rounded",{selected_item:r===n}),onClick:function(){return i(r)}},o&&l.a.createElement("div",{className:"p-1 text-gray-100 rounded-sm"},l.a.createElement(o,{size:18})),l.a.createElement("div",{className:"flex flex-col text-gray-100"},l.a.createElement("span",{className:"text-sm font-semibold"},t.title),l.a.createElement("span",{className:"text-xs text-gray-300"},t.description)))},Qf=qf;const Kf=new wt("suggestion");function Zf({pluginKey:e=Kf,editor:t,char:n="@",allowSpaces:r=!1,prefixSpace:i=!0,startOfLine:o=!1,decorationTag:a="span",decorationClass:s="suggestion",command:l=(()=>null),items:c=(()=>[]),render:u=(()=>({})),allow:d=(()=>!0)}){const p=null==u?void 0:u();return new Tt({key:e,view(){return{update:async(e,n)=>{var r,i,o,a,s;const u=null===(r=this.key)||void 0===r?void 0:r.getState(n),d=null===(i=this.key)||void 0===i?void 0:i.getState(e.state),m=u.active&&d.active&&u.range.from!==d.range.from,f=!u.active&&d.active,g=u.active&&!d.active,h=f||m,_=!f&&!g&&u.query!==d.query&&!m,b=g||m;if(!h&&!_&&!b)return;const E=b&&!h?u:d,y=document.querySelector(`[data-decoration-id="${E.decorationId}"]`),v={editor:t,range:E.range,query:E.query,text:E.text,items:_||h?await c({editor:t,query:E.query}):[],command:e=>{l({editor:t,range:E.range,props:e})},decorationNode:y,clientRect:y?()=>{var e;const{decorationId:n}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${n}"]`).getBoundingClientRect()}:null};b&&(null===(o=null==p?void 0:p.onExit)||void 0===o||o.call(p,v)),_&&(null===(a=null==p?void 0:p.onUpdate)||void 0===a||a.call(p,v)),h&&(null===(s=null==p?void 0:p.onStart)||void 0===s||s.call(p,v))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,a){const{composing:s}=t.view,{selection:l}=e,{empty:c,from:u}=l,p={...a};if(p.composing=s,c||t.view.composing){!(u<a.range.from||u>a.range.to)||s||a.composing||(p.active=!1);const e=function(e){const{char:t,allowSpaces:n,prefixSpace:r,startOfLine:i,$position:o}=e,a=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${a}$`),l=i?"^":"",c=n?new RegExp(`${l}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${l}(?:^)?${a}[^\\s${a}]*`,"gm"),u=o.depth<=0?0:o.before(),d=o.pos,p=o.doc.textBetween(u,d,"\0","\0"),m=Array.from(p.matchAll(c)).pop();if(!m||void 0===m.input||void 0===m.index)return null;const f=m.input.slice(Math.max(0,m.index-1),m.index),g=/^[\s\0]?$/.test(f);if(r&&!g)return null;const h=m.index+o.start();let _=h+m[0].length;return n&&s.test(p.slice(_-1,_+1))&&(m[0]+=" ",_+=1),h<o.pos&&_>=o.pos?{range:{from:h,to:_},query:m[0].slice(t.length),text:m[0]}:null}({char:n,allowSpaces:r,prefixSpace:i,startOfLine:o,$position:l.$from}),c="id_"+Math.floor(4294967295*Math.random());e&&d({editor:t,range:e.range})?(p.active=!0,p.decorationId=a.decorationId?a.decorationId:c,p.range=e.range,p.query=e.query,p.text=e.text):p.active=!1}else p.active=!1;return p.active||(p.decorationId=null,p.range={},p.query=null,p.text=null),p}},props:{handleKeyDown(e,t){var n;const{active:r,range:i}=this.getState(e.state);return r&&(null===(n=null==p?void 0:p.onKeyDown)||void 0===n?void 0:n.call(p,{view:e,event:t,range:i}))||!1},decorations(e){const{active:t,range:n,decorationId:r}=this.getState(e);return t?Ci.create(e.doc,[vi.inline(n.from,n.to,{nodeName:a,class:s,"data-decoration-id":r})]):null}}})}function Xf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Jf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xf(Object(n),!0).forEach((function(t){eg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function eg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tg=new wt("commands"),ng=function(e){var t=e.setImageUploadVisible;return lo.create({addOptions:function(){return{HTMLAttributes:{class:"commands"},suggestion:{char:"/",startOfLine:!1,pluginKey:tg,command:function(e){var t=e.editor,n=e.range;e.props.command({editor:t,range:n})},items:function(e){var n=e.query,r=[{title:"Paragraph",description:"Add a plain text block",Icon:Rc.Paragraph,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).setNode("paragraph").run()}},{title:"H1",description:"Add a big heading",Icon:Rc.TextH1,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).setNode("heading",{level:1}).run()}},{title:"H2",description:"Add a sub-heading",Icon:Rc.TextH2,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).setNode("heading",{level:2}).run()}},{title:"Numbered list",description:"Add a list with numbering",Icon:Rc.ListNumber,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleOrderedList().run()}},{title:"Bulleted list",description:"Add an list bullets",Icon:Rc.ListDot,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleBulletList().run()}},{title:"Blockquote",description:"Add a quote",Icon:Rc.Blockquote,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleBlockquote().run()}},{title:"Image",description:"Add an image",Icon:Rc.Image,command:function(e){var n=e.editor,r=e.range;t(!0),n.chain().focus().deleteRange(r).run()}},{title:"Youtube/Vimeo",description:"Embed a video from major services",Icon:Rc.Video,command:function(e){var t=e.editor,n=e.range,r=prompt("Please enter Youtube/Vimeo embed URL");t.chain().focus().deleteRange(n).setExternalVideo({src:r}).run()}},{title:"Code block",description:"Add a code block with syntax highlighting",Icon:Rc.Code,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleCodeBlock().run()}}],i=r.filter((function(e){return e.title.toLowerCase().includes(n.toLowerCase())}));return Rf()(i)?[{title:"No results",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).run()}}]:i},render:function(){var e,t;return{onStart:function(n){e=new yc(Qf,{props:n,editor:n.editor}),t=uc("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown:function(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addProseMirrorPlugins:function(){return[Zf(Jf({editor:this.editor},this.options.suggestion))]}})},rg={};function ig(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var n=e[t];"object"!=typeof n||Object.isFrozen(n)||ig(n)})),e}var og=ig,ag=ig;og.default=ag;class sg{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function lg(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function cg(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}const ug=e=>!!e.kind;class dg{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=lg(e)}openNode(e){if(!ug(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){ug(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class pg{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{pg._collapse(e)}))}}class mg extends pg{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){return new dg(this,this.options).value()}finalize(){return!0}}function fg(e){return e?"string"==typeof e?e:e.source:null}const gg=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const hg="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",_g={begin:"\\\\[\\s\\S]",relevance:0},bg={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[_g]},Eg={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[_g]},yg={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},vg=function(e,t,n={}){const r=cg({className:"comment",begin:e,end:t,contains:[]},n);return r.contains.push(yg),r.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),r},Sg=vg("//","$"),Og=vg("/\\*","\\*/"),Tg=vg("#","$"),Cg={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},Ng={className:"number",begin:hg,relevance:0},wg={className:"number",begin:"\\b(0b[01]+)",relevance:0},Ag={className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},Dg={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[_g,{begin:/\[/,end:/\]/,relevance:0,contains:[_g]}]}]},Rg={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},xg={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},Mg={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var Ig=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:hg,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>fg(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),cg({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:_g,APOS_STRING_MODE:bg,QUOTE_STRING_MODE:Eg,PHRASAL_WORDS_MODE:yg,COMMENT:vg,C_LINE_COMMENT_MODE:Sg,C_BLOCK_COMMENT_MODE:Og,HASH_COMMENT_MODE:Tg,NUMBER_MODE:Cg,C_NUMBER_MODE:Ng,BINARY_NUMBER_MODE:wg,CSS_NUMBER_MODE:Ag,REGEXP_MODE:Dg,TITLE_MODE:Rg,UNDERSCORE_TITLE_MODE:xg,METHOD_GUARD:Mg,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function kg(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function Lg(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=kg,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function Pg(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map(e=>fg(e)).join("|")+")"}(...e.illegal))}function Fg(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function jg(e,t){void 0===e.relevance&&(e.relevance=1)}const Ug=["of","and","for","in","not","or","if","then","parent","list","value"];function Bg(e,t){return t?Number(t):function(e){return Ug.includes(e.toLowerCase())}(e)?0:1}function zg(e,{plugins:t}){function n(t,n){return new RegExp(fg(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=n(function(e,t="|"){let n=0;return e.map(e=>{n+=1;const t=n;let r=fg(e),i="";for(;r.length>0;){const e=gg.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i}).map(e=>`(${e})`).join(t)}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex((e,t)=>t>0&&void 0!==e),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new r;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=cg(e.classNameAliases||{}),function t(r,o){const a=r;if(r.isCompiled)return a;[Fg].forEach(e=>e(r,o)),e.compilerExtensions.forEach(e=>e(r,o)),r.__beforeBegin=null,[Lg,Pg,jg].forEach(e=>e(r,o)),r.isCompiled=!0;let s=null;if("object"==typeof r.keywords&&(s=r.keywords.$pattern,delete r.keywords.$pattern),r.keywords&&(r.keywords=function e(t,n,r="keyword"){const i={};return"string"==typeof t?o(r,t.split(" ")):Array.isArray(t)?o(r,t):Object.keys(t).forEach((function(r){Object.assign(i,e(t[r],n,r))})),i;function o(e,t){n&&(t=t.map(e=>e.toLowerCase())),t.forEach((function(t){const n=t.split("|");i[n[0]]=[e,Bg(n[0],n[1])]}))}}(r.keywords,e.case_insensitive)),r.lexemes&&s)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return s=s||r.lexemes||/\w+/,a.keywordPatternRe=n(s,!0),o&&(r.begin||(r.begin=/\B|\b/),a.beginRe=n(r.begin),r.endSameAsBegin&&(r.end=r.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),r.end&&(a.endRe=n(r.end)),a.terminatorEnd=fg(r.end)||"",r.endsWithParent&&o.terminatorEnd&&(a.terminatorEnd+=(r.end?"|":"")+o.terminatorEnd)),r.illegal&&(a.illegalRe=n(r.illegal)),r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return cg(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e))return cg(e,{starts:e.starts?cg(e.starts):null});if(Object.isFrozen(e))return cg(e);return e}("self"===e?r:e)}))),r.contains.forEach((function(e){t(e,a)})),r.starts&&t(r.starts,o),a.matcher=function(e){const t=new i;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(a),a}(e)}function Gg(e){const t={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!e.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,lg(this.code);let t={};return this.autoDetect?(t=e.highlightAuto(this.code),this.detectedLanguage=t.language):(t=e.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),t.value},autoDetect(){return!this.language||(e=this.autodetect,Boolean(e||""===e));var e},ignoreIllegals:()=>!0},render(e){return e("pre",{},[e("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:t,VuePlugin:{install(e){e.component("highlightjs",t)}}}}const Yg={"after:highlightElement":({el:e,result:t,text:n})=>{const r=Wg(e);if(!r.length)return;const i=document.createElement("div");i.innerHTML=t.value,t.value=function(e,t,n){let r=0,i="";const o=[];function a(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function s(e){i+="<"+Hg(e)+[].map.call(e.attributes,(function(e){return" "+e.nodeName+'="'+lg(e.value)+'"'})).join("")+">"}function l(e){i+="</"+Hg(e)+">"}function c(e){("start"===e.event?s:l)(e.node)}for(;e.length||t.length;){let t=a();if(i+=lg(n.substring(r,t[0].offset)),r=t[0].offset,t===e){o.reverse().forEach(l);do{c(t.splice(0,1)[0]),t=a()}while(t===e&&t.length&&t[0].offset===r);o.reverse().forEach(s)}else"start"===t[0].event?o.push(t[0].node):o.pop(),c(t.splice(0,1)[0])}return i+lg(n.substr(r))}(r,Wg(i),n)}};function Hg(e){return e.nodeName.toLowerCase()}function Wg(e){const t=[];return function e(n,r){for(let i=n.firstChild;i;i=i.nextSibling)3===i.nodeType?r+=i.nodeValue.length:1===i.nodeType&&(t.push({event:"start",offset:r,node:i}),r=e(i,r),Hg(i).match(/br|hr|img|input/)||t.push({event:"stop",offset:r,node:i}));return r}(e,0),t}const Vg={},qg=e=>{console.error(e)},$g=(e,...t)=>{console.log("WARN: "+e,...t)},Qg=(e,t)=>{Vg[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Vg[`${e}/${t}`]=!0)},Kg=lg,Zg=cg,Xg=Symbol("nomatch");var Jg=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const o=/(^(<[^>]+>|\t|)+|\n)/gm,a="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let l={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:mg};function c(e){return l.noHighlightRe.test(e)}function u(e,t,n,r){let i="",o="";"object"==typeof t?(i=e,n=t.ignoreIllegals,o=t.language,r=void 0):(Qg("10.7.0","highlight(lang, code, ...args) has been deprecated."),Qg("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),o=e,i=t);const a={code:i,language:o};O("before:highlight",a);const s=a.result?a.result:d(a.language,a.code,n,r);return s.code=a.code,O("after:highlight",s),s}function d(e,n,o,s){function c(e,t){const n=E.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,n)&&e.keywords[n]}function u(){null!=O.subLanguage?function(){if(""===N)return;let e=null;if("string"==typeof O.subLanguage){if(!t[O.subLanguage])return void C.addText(N);e=d(O.subLanguage,N,!0,T[O.subLanguage]),T[O.subLanguage]=e.top}else e=p(N,O.subLanguage.length?O.subLanguage:null);O.relevance>0&&(w+=e.relevance),C.addSublanguage(e.emitter,e.language)}():function(){if(!O.keywords)return void C.addText(N);let e=0;O.keywordPatternRe.lastIndex=0;let t=O.keywordPatternRe.exec(N),n="";for(;t;){n+=N.substring(e,t.index);const r=c(O,t);if(r){const[e,i]=r;if(C.addText(n),n="",w+=i,e.startsWith("_"))n+=t[0];else{const n=E.classNameAliases[e]||e;C.addKeyword(t[0],n)}}else n+=t[0];e=O.keywordPatternRe.lastIndex,t=O.keywordPatternRe.exec(N)}n+=N.substr(e),C.addText(n)}(),N=""}function m(e){return e.className&&C.openNode(E.classNameAliases[e.className]||e.className),O=Object.create(e,{parent:{value:O}}),O}function f(e){return 0===O.matcher.regexIndex?(N+=e[0],1):(R=!0,0)}function g(e){const t=e[0],n=e.rule,r=new sg(n),i=[n.__beforeBegin,n["on:begin"]];for(const n of i)if(n&&(n(e,r),r.isMatchIgnored))return f(t);return n&&n.endSameAsBegin&&(n.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),n.skip?N+=t:(n.excludeBegin&&(N+=t),u(),n.returnBegin||n.excludeBegin||(N=t)),m(n),n.returnBegin?0:t.length}function h(e){const t=e[0],r=n.substr(e.index),i=function e(t,n,r){let i=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(t.endRe,r);if(i){if(t["on:end"]){const e=new sg(t);t["on:end"](n,e),e.isMatchIgnored&&(i=!1)}if(i){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,r)}(O,e,r);if(!i)return Xg;const o=O;o.skip?N+=t:(o.returnEnd||o.excludeEnd||(N+=t),u(),o.excludeEnd&&(N=t));do{O.className&&C.closeNode(),O.skip||O.subLanguage||(w+=O.relevance),O=O.parent}while(O!==i.parent);return i.starts&&(i.endSameAsBegin&&(i.starts.endRe=i.endRe),m(i.starts)),o.returnEnd?0:t.length}let _={};function b(t,r){const a=r&&r[0];if(N+=t,null==a)return u(),0;if("begin"===_.type&&"end"===r.type&&_.index===r.index&&""===a){if(N+=n.slice(r.index,r.index+1),!i){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=_.rule,t}return 1}if(_=r,"begin"===r.type)return g(r);if("illegal"===r.type&&!o){const e=new Error('Illegal lexeme "'+a+'" for mode "'+(O.className||"<unnamed>")+'"');throw e.mode=O,e}if("end"===r.type){const e=h(r);if(e!==Xg)return e}if("illegal"===r.type&&""===a)return 1;if(D>1e5&&D>3*r.index){throw new Error("potential infinite loop, way more iterations than matches")}return N+=a,a.length}const E=y(e);if(!E)throw qg(a.replace("{}",e)),new Error('Unknown language: "'+e+'"');const v=zg(E,{plugins:r});let S="",O=s||v;const T={},C=new l.__emitter(l);!function(){const e=[];for(let t=O;t!==E;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>C.openNode(e))}();let N="",w=0,A=0,D=0,R=!1;try{for(O.matcher.considerAll();;){D++,R?R=!1:O.matcher.considerAll(),O.matcher.lastIndex=A;const e=O.matcher.exec(n);if(!e)break;const t=b(n.substring(A,e.index),e);A=e.index+t}return b(n.substr(A)),C.closeAllNodes(),C.finalize(),S=C.toHTML(),{relevance:Math.floor(w),value:S,language:e,illegal:!1,emitter:C,top:O}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:n.slice(A-100,A+100),mode:t.mode},sofar:S,relevance:0,value:Kg(n),emitter:C};if(i)return{illegal:!1,relevance:0,value:Kg(n),emitter:C,language:e,top:O,errorRaised:t};throw t}}function p(e,n){n=n||l.languages||Object.keys(t);const r=function(e){const t={relevance:0,emitter:new l.__emitter(l),value:Kg(e),illegal:!1,top:s};return t.emitter.addText(e),t}(e),i=n.filter(y).filter(S).map(t=>d(t,e,!1));i.unshift(r);const o=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(y(e.language).supersetOf===t.language)return 1;if(y(t.language).supersetOf===e.language)return-1}return 0}),[a,c]=o,u=a;return u.second_best=c,u}const m={"before:highlightElement":({el:e})=>{l.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,"\n"))},"after:highlightElement":({result:e})=>{l.useBR&&(e.value=e.value.replace(/\n/g,"<br>"))}},f=/^(<[^>]+>|\t)+/gm,g={"after:highlightElement":({result:e})=>{l.tabReplace&&(e.value=e.value.replace(f,e=>e.replace(/\t/g,l.tabReplace)))}};function h(e){let t=null;const r=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=l.languageDetectRe.exec(t);if(n){const t=y(n[1]);return t||($g(a.replace("{}",n[1])),$g("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>c(e)||y(e))}(e);if(c(r))return;O("before:highlightElement",{el:e,language:r}),t=e;const i=t.textContent,o=r?u(i,{language:r,ignoreIllegals:!0}):p(i);O("after:highlightElement",{el:e,result:o,text:i}),e.innerHTML=o.value,function(e,t,r){const i=t?n[t]:r;e.classList.add("hljs"),i&&e.classList.add(i)}(e,r,o.language),e.result={language:o.language,re:o.relevance,relavance:o.relevance},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.relevance,relavance:o.second_best.relevance})}const _=()=>{if(_.called)return;_.called=!0,Qg("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(h)};let b=!1;function E(){if("loading"===document.readyState)return void(b=!0);document.querySelectorAll("pre code").forEach(h)}function y(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function v(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function S(e){const t=y(e);return t&&!t.disableAutodetect}function O(e,t){const n=e;r.forEach((function(e){e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){b&&E()}),!1),Object.assign(e,{highlight:u,highlightAuto:p,highlightAll:E,fixMarkup:function(e){return Qg("10.2.0","fixMarkup will be removed entirely in v11.0"),Qg("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),t=e,l.tabReplace||l.useBR?t.replace(o,e=>"\n"===e?l.useBR?"<br>":e:l.tabReplace?e.replace(/\t/g,l.tabReplace):e):t;var t},highlightElement:h,highlightBlock:function(e){return Qg("10.7.0","highlightBlock will be removed entirely in v12.0"),Qg("10.7.0","Please use highlightElement now."),h(e)},configure:function(e){e.useBR&&(Qg("10.3.0","'useBR' will be removed entirely in v11.0"),Qg("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),l=Zg(l,e)},initHighlighting:_,initHighlightingOnLoad:function(){Qg("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),b=!0},registerLanguage:function(n,r){let o=null;try{o=r(e)}catch(e){if(qg("Language definition for '{}' could not be registered.".replace("{}",n)),!i)throw e;qg(e),o=s}o.name||(o.name=n),t[n]=o,o.rawDefinition=r.bind(null,e),o.aliases&&v(o.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:y,registerAliases:v,requireLanguage:function(e){Qg("10.4.0","requireLanguage will be removed entirely in v11."),Qg("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const t=y(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:S,inherit:Zg,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),r.push(e)},vuePlugin:Gg(e).VuePlugin}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString="10.7.3";for(const e in Ig)"object"==typeof Ig[e]&&og(Ig[e]);return Object.assign(e,Ig),e.addPlugin(m),e.addPlugin(Yg),e.addPlugin(g),e}({}),eh={exports:{}};!function(e){!function(){var t;function n(e){for(var t,n,r,i,o=1,a=[].slice.call(arguments),s=0,l=e.length,c="",u=!1,d=!1,p=function(){return a[o++]},m=function(){for(var n="";/\d/.test(e[s]);)n+=e[s++],t=e[s];return n.length>0?parseInt(n):null};s<l;++s)if(t=e[s],u)switch(u=!1,"."==t?(d=!1,t=e[++s]):"0"==t&&"."==e[s+1]?(d=!0,t=e[s+=2]):d=!0,i=m(),t){case"b":c+=parseInt(p(),10).toString(2);break;case"c":c+="string"==typeof(n=p())||n instanceof String?n:String.fromCharCode(parseInt(n,10));break;case"d":c+=parseInt(p(),10);break;case"f":r=String(parseFloat(p()).toFixed(i||6)),c+=d?r:r.replace(/^0/,"");break;case"j":c+=JSON.stringify(p());break;case"o":c+="0"+parseInt(p(),10).toString(8);break;case"s":c+=p();break;case"x":c+="0x"+parseInt(p(),10).toString(16);break;case"X":c+="0x"+parseInt(p(),10).toString(16).toUpperCase();break;default:c+=t}else"%"===t?u=!0:c+=t;return c}(t=e.exports=n).format=n,t.vsprintf=function(e,t){return n.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(n.apply(null,arguments))})}()}(eh);var th=eh.exports,nh=ih(Error),rh=nh;function ih(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=th.apply(null,arguments)),new e(t)}}nh.eval=ih(EvalError),nh.range=ih(RangeError),nh.reference=ih(ReferenceError),nh.syntax=ih(SyntaxError),nh.type=ih(TypeError),nh.uri=ih(URIError),nh.create=ih;var oh=Jg,ah=rh;rg.highlight=sh,rg.highlightAuto=function(e,t){var n=t||{},r=n.subset||oh.listLanguages();n.prefix;var i,o,a,s,l=r.length,c=-1;if("string"!=typeof e)throw ah("Expected `string` for value, got `%s`",e);o={relevance:0,language:null,value:[]},i={relevance:0,language:null,value:[]};for(;++c<l;)s=r[c],oh.getLanguage(s)&&((a=sh(s,e,t)).language=s,a.relevance>o.relevance&&(o=a),a.relevance>i.relevance&&(o=i,i=a));o.language&&(i.secondBest=o);return i},rg.registerLanguage=function(e,t){oh.registerLanguage(e,t)},rg.listLanguages=function(){return oh.listLanguages()},rg.registerAlias=function(e,t){var n,r=e;t&&((r={})[e]=t);for(n in r)oh.registerAliases(r[n],{languageName:n})},lh.prototype.addText=function(e){var t,n,r=this.stack;if(""===e)return;t=r[r.length-1],(n=t.children[t.children.length-1])&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})},lh.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},lh.prototype.addSublanguage=function(e,t){var n=this.stack,r=n[n.length-1],i=e.rootNode.children,o=t?{type:"element",tagName:"span",properties:{className:[t]},children:i}:i;r.children=r.children.concat(o)},lh.prototype.openNode=function(e){var t=this.stack,n=this.options.classPrefix+e,r=t[t.length-1],i={type:"element",tagName:"span",properties:{className:[n]},children:[]};r.children.push(i),t.push(i)},lh.prototype.closeNode=function(){this.stack.pop()},lh.prototype.closeAllNodes=ch,lh.prototype.finalize=ch,lh.prototype.toHTML=function(){return""};function sh(e,t,n){var r,i=oh.configure({}),o=(n||{}).prefix;if("string"!=typeof e)throw ah("Expected `string` for name, got `%s`",e);if(!oh.getLanguage(e))throw ah("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw ah("Expected `string` for value, got `%s`",t);if(null==o&&(o="hljs-"),oh.configure({__emitter:lh,classPrefix:o}),r=oh.highlight(t,{language:e,ignoreIllegals:!0}),oh.configure(i||{}),r.errorRaised)throw r.errorRaised;return{relevance:r.relevance,language:r.language,value:r.emitter.rootNode.children}}function lh(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function ch(){}function uh(e){return e.value||e.children||[]}function dh({doc:e,name:t,lowlight:n}){const r=[];return ps(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1;const{language:i}=e.node.attrs,o=n.listLanguages();(function e(t,n=[]){return t.map(t=>{const r=[...n,...t.properties?t.properties.className:[]];return t.children?e(t.children,r):{text:t.value,classes:r}}).flat()})(i&&o.includes(i)?uh(n.highlight(i,e.node.textContent)):uh(n.highlightAuto(e.node.textContent))).forEach(e=>{const n=t+e.text.length;if(e.classes.length){const i=vi.inline(t,n,{class:e.classes.join(" ")});r.push(i)}t=n})}),Ci.create(e,r)}function ph({name:e,lowlight:t}){return new Tt({key:new wt("lowlight"),state:{init:(n,{doc:r})=>dh({doc:r,name:e,lowlight:t}),apply:(n,r,i,o)=>{const a=i.selection.$head.parent.type.name,s=o.selection.$head.parent.type.name,l=ps(i.doc,t=>t.type.name===e),c=ps(o.doc,t=>t.type.name===e);return n.docChanged&&([a,s].includes(e)||c.length!==l.length||n.steps.some(e=>void 0!==e.from&&void 0!==e.to&&l.some(t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))?dh({doc:n.doc,name:e,lowlight:t}):r.map(n.mapping,n.doc)}},props:{decorations(e){return this.getState(e)}}})}const mh=om.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:rg}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],ph({name:this.name,lowlight:this.options.lowlight})]}});function fh(){return l.a.createElement(Ac,null,l.a.createElement("pre",null,l.a.createElement(Dc,{as:"code"})))}var gh=n(51),hh=n.n(gh),_h=mh.extend({addNodeView:function(){return new Tc(fh)}}).configure({lowlight:hh.a}),bh=function(e){var t=e.items,n=e.command;return l.a.createElement("div",{className:"shadow-md"},l.a.createElement(Bu,{variables:t,onClickVariable:function(e){var t=e.category_key,r=e.key,i=t?"".concat(t,".").concat(r):r;n({label:i,id:i})}}))};function Eh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Eh(Object(n),!0).forEach((function(t){vh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Eh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Sh=new wt("variables"),Oh=ns.create({name:"variable",addOptions:function(){return{HTMLAttributes:{class:"variable__text"},charOpen:"{{",charClose:"}}",renderLabel:function(e){var t=e.options,n=e.node;return"".concat(t.charOpen).concat(n.attrs.label||n.attrs.id).concat(t.charClose)},suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:function(){return{id:{default:null,parseHTML:function(e){return e.getAttribute("data-id")},renderHTML:function(e){return e.id?{"data-id":e.id}:{}}},label:{default:null,parseHTML:function(e){return e.getAttribute("data-label")},renderHTML:function(e){return e.label?{"data-label":e.label}:{}}}}},parseHTML:function(){return[{tag:"span[data-variable]"}]},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes;return["span",Qa({"data-variable":""},this.options.HTMLAttributes,n),this.options.renderLabel({options:this.options,node:t})]},renderText:function(e){var t=e.node;return this.options.renderLabel({options:this.options,node:t})},addCommands:function(){var e=this;return{setVariable:function(t){return function(n){(0,n.chain)().focus().insertContent([{type:e.name,attrs:t},{type:"text",text:" "}]).run()}}}},addKeyboardShortcuts:function(){var e=this;return{Backspace:function(){return e.editor.commands.command((function(t){var n=t.tr,r=t.state,i=!1,o=r.selection,a=o.empty,s=o.anchor;return!!a&&(r.doc.nodesBetween(s-1,s,(function(t,r){if(t.type.name===e.name)return i=!0,n.insertText("",r,r+t.nodeSize),!1})),i)}))}}},addProseMirrorPlugins:function(){return[Zf(yh({editor:this.editor},this.options.suggestion))]}}),Th={char:"{{",startOfLine:!1,pluginKey:Sh,command:function(e){var t=e.editor,n=e.range,r=e.props;t.chain().focus().deleteRange(n).setVariable(r).run()},items:function(){return[]},render:function(){var e,t;return{onStart:function(n){e=new yc(bh,{props:n,editor:n.editor}),t=uc("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onExit:function(){t[0].destroy(),e.destroy()}}}},Ch=function(e){var t=e.suggestion,n=void 0===t?{}:t;return Oh.configure({suggestion:yh(yh({},Th),n)})},Nh=n(52),wh=n.n(Nh);function Ah(e){return(Ah="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Dh=function(e){var t=Ah(e);return"string"===t||"funtion"===t?e:wh()(e)?function(t){var n=t.node.type.name;return e[n]}:""},Rh=lo.create({name:"placeholder",addOptions:function(){return{excludeNodeTypes:["variable","codeBlock"],emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins:function(){var e=this;return[new Tt({props:{decorations:function(t){var n=t.doc,r=t.selection,i=e.editor.isEditable||!e.options.showOnlyWhenEditable,o=r.anchor,a=[];if(i)return n.descendants((function(t,n){var r=o>=n&&o<=n+t.nodeSize,i=!t.isLeaf&&!t.childCount,s=e.options.excludeNodeTypes.includes(t.type.name);if((r||!e.options.showOnlyCurrent)&&!s&&i){var l=[e.options.emptyNodeClass];e.editor.isEmpty&&l.push(e.options.emptyEditorClass);var c=vi.node(n,n+t.nodeSize,{class:l.join(" "),"data-placeholder":"function"==typeof e.options.placeholder?e.options.placeholder({editor:e.editor,node:t,pos:n}):e.options.placeholder});a.push(c)}return e.options.includeChildren})),Ci.create(n,a)}}})]}});const xh=new wt("suggestion");function Mh({pluginKey:e=xh,editor:t,char:n="@",allowSpaces:r=!1,prefixSpace:i=!0,startOfLine:o=!1,decorationTag:a="span",decorationClass:s="suggestion",command:l=(()=>null),items:c=(()=>[]),render:u=(()=>({})),allow:d=(()=>!0)}){const p=null==u?void 0:u();return new Tt({key:e,view(){return{update:async(e,n)=>{var r,i,o,a,s;const u=null===(r=this.key)||void 0===r?void 0:r.getState(n),d=null===(i=this.key)||void 0===i?void 0:i.getState(e.state),m=u.active&&d.active&&u.range.from!==d.range.from,f=!u.active&&d.active,g=u.active&&!d.active,h=f||m,_=!f&&!g&&u.query!==d.query&&!m,b=g||m;if(!h&&!_&&!b)return;const E=b&&!h?u:d,y=document.querySelector(`[data-decoration-id="${E.decorationId}"]`),v={editor:t,range:E.range,query:E.query,text:E.text,items:_||h?await c({editor:t,query:E.query}):[],command:e=>{l({editor:t,range:E.range,props:e})},decorationNode:y,clientRect:y?()=>{var e;const{decorationId:n}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${n}"]`).getBoundingClientRect()}:null};b&&(null===(o=null==p?void 0:p.onExit)||void 0===o||o.call(p,v)),_&&(null===(a=null==p?void 0:p.onUpdate)||void 0===a||a.call(p,v)),h&&(null===(s=null==p?void 0:p.onStart)||void 0===s||s.call(p,v))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,a){const{composing:s}=t.view,{selection:l}=e,{empty:c,from:u}=l,p={...a};if(p.composing=s,c||t.view.composing){!(u<a.range.from||u>a.range.to)||s||a.composing||(p.active=!1);const e=function(e){const{char:t,allowSpaces:n,prefixSpace:r,startOfLine:i,$position:o}=e,a=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${a}$`),l=i?"^":"",c=n?new RegExp(`${l}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${l}(?:^)?${a}[^\\s${a}]*`,"gm"),u=o.depth<=0?0:o.before(),d=o.pos,p=o.doc.textBetween(u,d,"\0","\0"),m=Array.from(p.matchAll(c)).pop();if(!m||void 0===m.input||void 0===m.index)return null;const f=m.input.slice(Math.max(0,m.index-1),m.index),g=/^[\s\0]?$/.test(f);if(r&&!g)return null;const h=m.index+o.start();let _=h+m[0].length;return n&&s.test(p.slice(_-1,_+1))&&(m[0]+=" ",_+=1),h<o.pos&&_>=o.pos?{range:{from:h,to:_},query:m[0].slice(t.length),text:m[0]}:null}({char:n,allowSpaces:r,prefixSpace:i,startOfLine:o,$position:l.$from}),c="id_"+Math.floor(4294967295*Math.random());e&&d({editor:t,range:e.range})?(p.active=!0,p.decorationId=a.decorationId?a.decorationId:c,p.range=e.range,p.query=e.query,p.text=e.text):p.active=!1}else p.active=!1;return p.active||(p.decorationId=null,p.range={},p.query=null,p.text=null),p}},props:{handleKeyDown(e,t){var n;const{active:r,range:i}=this.getState(e.state);return r&&(null===(n=null==p?void 0:p.onKeyDown)||void 0===n?void 0:n.call(p,{view:e,event:t,range:i}))||!1},decorations(e){const{active:t,range:n,decorationId:r}=this.getState(e);return t?Ci.create(e.doc,[vi.inline(n.from,n.to,{nodeName:a,class:s,"data-decoration-id":r})]):null}}})}const Ih=new wt("mention"),kh=ns.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var n;return`${e.suggestion.char}${null!==(n=t.attrs.label)&&void 0!==n?n:t.attrs.id}`},suggestion:{char:"@",pluginKey:Ih,command:({editor:e,range:t,props:n})=>{var r;const i=e.view.state.selection.$to.nodeAfter;(null===(r=null==i?void 0:i.text)||void 0===r?void 0:r.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:n},{type:"text",text:" "}]).run()},allow:({editor:e,range:t})=>{const n=e.state.doc.resolve(t.from),r=e.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML:()=>[{tag:"span[data-mention]"}],renderHTML({node:e,HTMLAttributes:t}){return["span",Qa({"data-mention":""},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})]},renderText({node:e}){return this.options.renderLabel({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let n=!1;const{selection:r}=t,{empty:i,anchor:o}=r;return!!i&&(t.doc.nodesBetween(o-1,o,(t,r)=>{if(t.type.name===this.name)return n=!0,e.insertText(this.options.suggestion.char||"",r,r+t.nodeSize),!1}),n)})}},addProseMirrorPlugins(){return[Mh({editor:this.editor,...this.options.suggestion})]}});var Lh=["size","user","isSquare","status","onClick","className"];function Ph(){return(Ph=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Fh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return jh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Uh(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Bh={small:24,medium:32,large:40,xlarge:64},zh=["#E5E7EB","#FECACA","#FDE68A","#A7F3D0","#BFDBFE","#C7D2FE","#DDD6FE","#FBCFE8"];function Gh(e){var t,n,r=e.size,i=e.user,o=e.isSquare,a=e.status,c=e.onClick,d=e.className,p=Uh(e,Lh),m=Fh(Object(s.useState)(!1),2),f=m[0],g=m[1],h=i.name,_=void 0===h?"":h,b=i.imageUrl,E="medium"===r,y="large"===r,v="xlarge"===r,S=(t=_.trim().split(" ")).reduce((function(e,n,r){return 0!==r&&r!==t.length-1||(e="".concat(e).concat(n.charAt(0).toUpperCase())),e}),""),O={height:Bh[r],width:Bh[r],backgroundColor:(n=(S.charCodeAt(0)||0)+(S.charCodeAt(1)||0),zh[n%65%zh.length]||zh[0])},T=u()("neeto-ui-avatar",{"neeto-ui-avatar--medium":E,"neeto-ui-avatar--large":y,"neeto-ui-avatar--xlarge":v,"neeto-ui-avatar--round":!o,hidden:!f}),C=u()("neeto-ui-avatar__text",{"neeto-ui-avatar__text-medium":E,"neeto-ui-avatar__text-large":y,"neeto-ui-avatar__text-xlarge":v}),N=u()("neeto-ui-avatar__status","".concat(a),{"neeto-ui-avatar__status-medium":E,"neeto-ui-avatar__status-large":y,"neeto-ui-avatar__status-xlarge":v,"neeto-ui-avatar__status-square":o}),w=function(){return null==a?l.a.Fragment:l.a.createElement("span",{className:N})},A=function(){return l.a.createElement("span",{className:C},S)},D=S&&!b&&!f;return l.a.createElement("div",Ph({onClick:c,style:O,className:u()("neeto-ui-avatar--container",{"neeto-ui-avatar--container-round":!o},d)},p),l.a.createElement(w,null),D?l.a.createElement(A,null):l.a.createElement("img",{className:T,onLoad:function(){return g(!0)},onError:function(){return g(!1)},src:b,alt:"avatar-".concat(S)}))}Gh.defaultProps={size:"medium",user:{imageUrl:"",name:""},isSquare:!1,onClick:function(){},status:null},Gh.propTypes={size:Fc.a.oneOf(Object.keys(Bh)),user:Fc.a.shape({imageUrl:Fc.a.string,name:Fc.a.string}),isSquare:Fc.a.bool,onClick:Fc.a.func,status:Fc.a.oneOf(Object.keys({online:"online",idle:"idle",offline:"offline"})),className:Fc.a.string};var Yh=Gh;function Hh(e){return(Hh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qh(e,t){return(qh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Zh(e);if(t){var i=Zh(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Qh(this,n)}}function Qh(e,t){if(t&&("object"===Hh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Kh(e)}function Kh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zh(e){return(Zh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Xh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Jh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qh(e,t)}(o,e);var t,n,r,i=$h(o);function o(){var e;Wh(this,o);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Xh(Kh(e=i.call.apply(i,[this].concat(n))),"state",{selectedIndex:0}),Xh(Kh(e),"selectItem",(function(t){var n=e.props,r=n.items,i=n.command,o=r[t];o&&i({label:o.label,id:o.key})})),Xh(Kh(e),"upHandler",(function(){var t=e.props.items;e.setState((function(e){return{selectedIndex:(e.selectedIndex+t.length-1)%t.length}}))})),Xh(Kh(e),"downHandler",(function(){var t=e.props.items;e.setState((function(e){return{selectedIndex:(e.selectedIndex+1)%t.length}}))})),Xh(Kh(e),"enterHandler",(function(){var t=e.state.selectedIndex;e.selectItem(t)})),Xh(Kh(e),"onKeyDown",(function(t){var n=t.event,r={ArrowUp:e.upHandler,ArrowDown:e.downHandler,Enter:e.enterHandler};return!!r.hasOwnProperty(n.key)&&(r[n.key](),!0)})),e}return t=o,(n=[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0})}},{key:"render",value:function(){var e=this,t=this.state.selectedIndex,n=this.props.items;return l.a.createElement("div",{className:"relative p-2 space-y-1 overflow-hidden rounded shadow editor-command-list--root"},n.map((function(n,r){var i=n.label,o=n.imageUrl,a=n.showImage;return l.a.createElement("button",{className:u()("flex items-center w-full px-4 py-2 transition-all duration-100 ease-in-out cursor-pointer text-xs text-white rounded editor-command-list--item",{selected_item:r===t}),key:i,onClick:function(){return e.selectItem(r)}},a?l.a.createElement(Yh,{user:{name:i,imageUrl:o},className:"mr-2"}):null,l.a.createElement("span",null,i))})))}}])&&Vh(t.prototype,n),r&&Vh(t,r),o}(l.a.Component);function e_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?e_(Object(n),!0).forEach((function(t){n_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function n_(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r_(e){return(r_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?5:n,i=t.showImage,o=void 0!==i&&i,a=e.map((function(e){var t;return"string"==typeof e?t={key:e,label:e}:"object"===r_(e)&&(t=t_({},e)),t.showImage=o,t}));return function(e){var t=e.query;return a.filter((function(e){return e.label.toLowerCase().startsWith(t.toLowerCase())})).slice(0,r)}},o_=["suggestion"];function a_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a_(Object(n),!0).forEach((function(t){l_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l_(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c_(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var u_={render:function(){var e,t;return{onStart:function(n){e=new yc(Jh,{props:n,editor:n.editor}),t=uc("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown:function(n){var r;return"Escape"===n.event.key?(t[0].hide(),!0):null===(r=e.ref)||void 0===r?void 0:r.onKeyDown(n)},onExit:function(){t[0].destroy(),e.destroy()}}}},d_=function(e){var t=e.suggestion,n=void 0===t?{}:t,r=c_(e,o_);return kh.configure(s_(s_({},r),{},{suggestion:s_(s_({},u_),n)}))},p_=ns.create({name:"external-video",addOptions:function(){return{inline:!1,HTMLAttributes:{}}},inline:function(){return this.options.inline},group:function(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:function(){return{src:{default:null},title:{default:null},frameborder:{default:"0"},allow:{default:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"},allowfullscreen:{default:"allowfullscreen"}}},parseHTML:function(){return[{tag:"iframe[src]"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["div",{class:"video-wrapper"},["iframe",Qa(this.options.HTMLAttributes,t)]]},addCommands:function(){var e=this;return{setExternalVideo:function(t){return function(n){return n.commands.insertContent({type:e.name,attrs:t})}}}}});function m_(e){return function(e){if(Array.isArray(e))return f_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return f_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f_(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var g_=["forceTitle","hideSlashCommands","formatterOptions","className","uploadEndpoint","initialValue","onChange","menuType","variables","mentions","showImageInMention","placeholder","extensions","contentClassName"];function h_(){return(h_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function __(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return b_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b_(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E_(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var y_=function(e,t){var n,r,i,o=e.forceTitle,a=void 0!==o&&o,c=e.hideSlashCommands,d=void 0!==c&&c,p=e.formatterOptions,m=void 0===p?["bold","italic","underline","code","highlight","strike","link"]:p,f=e.className,g=e.uploadEndpoint,h=e.initialValue,_=void 0===h?"":h,b=e.onChange,E=void 0===b?function(){}:b,y=e.menuType,v=void 0===y?"fixed":y,S=e.variables,O=e.mentions,T=e.showImageInMention,C=void 0!==T&&T,N=e.placeholder,w=e.extensions,A=e.contentClassName,D=E_(e,g_),R=__(Object(s.useState)(!1),2),x=R[0],M=R[1],I="fixed"===v,k="bubble"===v,L=!d,P=!N&&L,F=function(e){var t,n=e.forceTitle,r=e.placeholder,i=e.extensions,o=e.mentions,a=e.variables,s=e.isSlashCommandsActive,l=e.showImageInMention,c=e.setImageUploadVisible;return i?t=m_(i):(t=[xf.extend({content:n?"heading block*":"block+"}),Xm.configure({document:!1,codeBlock:!1}),jf,vf,wf,Tf,_h,Ff,lm,p_,Nf,Af,Rh.configure({placeholder:Dh(r)})],s&&t.push(ng({setImageUploadVisible:c})),Rf()(o)||t.push(d_({suggestion:{items:i_(o,{showImage:l})}})),Rf()(a)||t.push(Ch({suggestion:{items:function(){return a}}}))),t}({contentClassName:A,forceTitle:a,placeholder:N,extensions:w,mentions:O,variables:S,isSlashCommandsActive:L,showImageInMention:C,setImageUploadVisible:M}),j=Ec({extensions:F,content:_,injectCSS:!1,editorProps:{attributes:{class:f||u()("focus:outline-none whitespace-pre-wrap border p-3",(n={"slash-active":P,"fixed-menu-active":I,"bubble-menu-active":k},r=f,i=f,r in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,n))}},onUpdate:function(e){var t=e.editor;return E(t.getHTML())}});return l.a.useImperativeHandle(t,(function(){return{editor:j}})),l.a.createElement("div",null,I?l.a.createElement(rp,{editor:j,variables:S,setImageUploadVisible:M}):null,k?l.a.createElement(kc,{editor:j,formatterOptions:m}):null,l.a.createElement(Hp,{isVisible:x,setIsVisible:M,editor:j,imageUploadUrl:g}),l.a.createElement(wc,h_({editor:j},D)))},v_=l.a.forwardRef(y_),S_=n(53),O_=n.n(S_);var T_=n(54),C_=n.n(T_),N_=["content","classNames"];function w_(){return(w_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function A_(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var D_=function(e){var t,n,r,i=e.content,o=void 0===i?"":i,a=e.classNames,c=A_(e,N_);return Object(s.useEffect)((function(){document.querySelectorAll("div.".concat("neeto-editor-content"," pre code")).forEach((function(e){O_.a.highlightElement(e)}))}),[o]),l.a.createElement("div",w_({className:(u()("neeto-editor-content"),t={},n=a,r=a,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t),dangerouslySetInnerHTML:{__html:C_.a.sanitize(o)}},c))}}])}));
51
+ */;function Md(){return(Md=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Id(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}const kd=["onClick","reloadDocument","replace","state","target","to"],Ld=["aria-current","caseSensitive","className","end","style","to"];const Pd=Object(s.forwardRef)((function(e,t){let{onClick:n,reloadDocument:r,replace:i=!1,state:o,target:a,to:l}=e,c=Id(e,kd),u=Od(l),d=function(e,t){let{target:n,replace:r,state:i}=void 0===t?{}:t,o=Nd(),a=Cd(),l=wd(e);return Object(s.useCallback)(t=>{if(!(0!==t.button||n&&"_self"!==n||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(t))){t.preventDefault();let n=!!r||_d(a)===_d(l);o(e,{replace:n,state:i})}},[a,o,l,r,i,n,e])}(l,{replace:i,state:o,target:a});return Object(s.createElement)("a",Md({},c,{href:u,onClick:function(e){n&&n(e),e.defaultPrevented||r||d(e)},ref:t,target:a}))}));const Fd=Object(s.forwardRef)((function(e,t){let{"aria-current":n="page",caseSensitive:r=!1,className:i="",end:o=!1,style:a,to:l}=e,c=Id(e,Ld),u=Cd(),d=wd(l),p=u.pathname,m=d.pathname;r||(p=p.toLowerCase(),m=m.toLowerCase());let f,g=p===m||!o&&p.startsWith(m)&&"/"===p.charAt(m.length),h=g?n:void 0;f="function"==typeof i?i({isActive:g}):[i,g?"active":null].filter(Boolean).join(" ");let _="function"==typeof a?a({isActive:g}):a;return Object(s.createElement)(Pd,Md({},c,{"aria-current":h,className:f,ref:t,style:_,to:l}))}));var jd=["icon","iconPosition","iconSize","label","loading","onClick","to","type","style","fullWidth","className","disabled","size","href","tooltipProps"];function Ud(){return(Ud=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Bd(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var zd=function(){},Gd="primary",Yd="secondary",Hd="danger",Wd="text",Vd="link",qd="large",$d="left",Qd=l.a.forwardRef((function(e,t){var n,r,i=e.icon,o=void 0===i?null:i,a=e.iconPosition,s=void 0===a?"right":a,c=e.iconSize,d=void 0===c?16:c,p=e.label,m=void 0===p?"":p,f=e.loading,g=void 0!==f&&f,h=e.onClick,_=void 0===h?zd:h,b=e.to,E=void 0===b?null:b,y=e.type,v=void 0===y?"button":y,S=e.style,O=void 0===S?"primary":S,T=e.fullWidth,C=void 0!==T&&T,N=e.className,w=void 0===N?"":N,A=e.disabled,D=void 0!==A&&A,R=e.size,x=void 0===R?null:R,M=e.href,I=void 0===M?null:M,k=e.tooltipProps,L=void 0===k?null:k,P=Bd(e,jd);E?(n=Pd,r={to:E}):I?(n="a",r={href:I}):(n="button",r={type:v});var F="string"==typeof o?function(){return l.a.createElement("i",{className:u()("neeto-ui-btn__icon",[o])})}:o||l.a.Fragment;return l.a.createElement(od,Ud({},L,{disabled:!L}),l.a.createElement(n,Ud({ref:t,onClick:function(e){g||D||_(e)},className:u()("neeto-ui-btn",[w],{"neeto-ui-btn--style-primary":O===Gd,"neeto-ui-btn--style-secondary":O===Yd,"neeto-ui-btn--style-danger":O===Hd,"neeto-ui-btn--style-text":O===Wd,"neeto-ui-btn--style-link":O===Vd,"neeto-ui-btn--size-large":x===qd,"neeto-ui-btn--width-full":C,"neeto-ui-btn--icon-left":s==$d,"neeto-ui-btn--icon-only":!m,disabled:D}),disabled:D},r,P),m&&l.a.createElement("span",null,m),o?l.a.createElement(F,{key:"2",size:d,className:"neeto-ui-btn__icon"}):null))})),Kd=/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/;function Zd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Jd=function(e){var t=e.editor,n=Object(s.useRef)(),r=Zd(Object(s.useState)(""),2),i=r[0],o=r[1],a=Zd(Object(s.useState)(""),2),c=a[0],u=a[1],d=t.isActive("link"),p=function(){u(t.getAttributes("link").href||"")};return l.a.createElement(Lu,{ref:n,customTarget:function(){return l.a.createElement("button",{className:"h-full p-3 transition-colors editor-fixed-menu--item",onClick:p},l.a.createElement(Rc.Link,{size:24,color:d?"#2F3941":"#87929D"}))},className:"fontsize-dropdown",position:"bottom",closeOnSelect:!1},l.a.createElement("div",{className:"flex py-1 space-x-3 add-link-form"},l.a.createElement("div",{className:"flex-row w-full"},l.a.createElement(fd,{name:"url",value:c,placeholder:"Paste URL",onFocus:function(){return o("")},error:i,onChange:function(e){var t=e.target.value;return u(t)}})),l.a.createElement(Qd,{label:"Link",onClick:function(e){var r;(e.preventDefault(),Kd.test(c))?(t.chain().focus().setLink({href:c}).run(),null===(r=n.current)||void 0===r||r.close()):o("Please enter a valid url")},className:"self-start"}),d?l.a.createElement(Qd,{label:"Unlink",onClick:function(){var e;t.chain().focus().unsetLink().run(),null===(e=n.current)||void 0===e||e.close()},className:"self-start"}):null))},ep=["Icon","command","active","optionName","disabled"];function tp(){return(tp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function np(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var rp=function(e){var t=e.editor,n=e.variables,r=e.setImageUploadVisible;if(!t)return null;var i=[{Icon:Rc.TextBold,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:Rc.TextItalic,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:Rc.Underline,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline",size:27},{Icon:Rc.TextCross,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:Rc.Highlight,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}],o=[{Icon:Rc.Quote,command:function(){return t.chain().focus().toggleBlockquote().run()},active:t.isActive("blockquote"),optionName:"block-quote"},{Icon:Rc.Code,command:function(){return t.chain().focus().toggleCodeBlock().run()},active:t.isActive("codeBlock"),optionName:"codeBlock"},{Icon:Rc.Image,command:function(){return r(!0)},optionName:"image-upload"}],a=[{Icon:Rc.ListDot,command:function(){return t.chain().focus().toggleBulletList().run()},active:t.isActive("bulletList"),optionName:"bullet-list"},{Icon:Rc.ListNumber,command:function(){return t.chain().focus().toggleOrderedList().run()},active:t.isActive("orderedList"),optionName:"ordered-list"}],s=[{Icon:Rc.Undo,command:function(){return t.chain().focus().undo().run()},optionName:"undo",disabled:!t.can().undo(),active:t.can().undo()},{Icon:Rc.Redo,command:function(){return t.chain().focus().redo().run()},optionName:"redo",disabled:!t.can().redo(),active:t.can().redo()}],c=function(e){var t=e.Icon,n=e.command,r=e.active,i=e.optionName,o=e.disabled,a=np(e,ep);return l.a.createElement("button",{disabled:o,onClick:n,key:i,className:"p-3 transition-colors cursor-pointer editor-fixed-menu--item"},l.a.createElement(t,tp({color:r?"#2F3941":"#87929D"},a)))};return l.a.createElement("div",{className:"flex space-x-6 border-t border-l border-r editor-fixed-menu--root"},l.a.createElement("div",{className:"flex"},l.a.createElement(Vc,{color:t.getAttributes("textStyle").color,onChange:function(e){return t.chain().focus().setColor(e).run()}}),l.a.createElement(Pu,{editor:t}),i.map(c)),l.a.createElement("div",{className:"flex"},l.a.createElement(Jd,{editor:t}),o.map(c)),[a,s].map((function(e,t){return l.a.createElement("div",{className:"flex",key:t},e.map(c))})),l.a.createElement("div",{className:"flex justify-end flex-1"},l.a.createElement(Gu,{editor:t,variables:n})))},ip=n(5),op=n.n(ip),ap=n(50),sp=n.n(ap),lp=function(e){var t=e.children,n=e.className,r=void 0===n?"root-portal":n,i=e.el,o=void 0===i?"div":i,a=document.getElementsByClassName(r)[0];return a||(a=document.createElement(o)).classList.add(r),l.a.useEffect((function(){document.body.appendChild(a)}),[]),hc.a.createPortal(t,a)},cp=["children","className"];function up(){return(up=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function dp(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var pp=function(e){var t,n,r,i=e.children,o=e.className,a=dp(e,cp);return l.a.createElement("div",up({className:u()("transition-opacity bg-gray-500 bg-opacity-50",(t={},n=o,r=o,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t))},a),i)},mp=["size","isOpen","onClose","loading","children","className","closeOnEsc","closeButton","backdropClassName","closeOnOutsideClick"];function fp(){return(fp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function gp(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var hp=function(){},_p="xs",bp="sm",Ep="md",yp=function(e){var t,n,r,i=e.size,o=void 0===i?"sm":i,a=e.isOpen,c=void 0!==a&&a,d=e.onClose,p=void 0===d?hp:d,m=e.loading,f=void 0!==m&&m,g=e.children,h=e.className,_=void 0===h?"":h,b=e.closeOnEsc,E=void 0===b||b,y=e.closeButton,v=void 0===y||y,S=e.backdropClassName,O=void 0===S?"":S,T=e.closeOnOutsideClick,C=void 0===T||T,N=gp(e,mp),w=Object(s.useRef)();return C&&Cu(w,p),E&&Ou("esc",p),l.a.createElement(lp,{className:"neeto-ui-portal"},c&&l.a.createElement(pp,{key:"modal-backdrop",className:u()("neeto-ui-modal__backdrop",O)},l.a.createElement("div",fp({ref:w,key:"modal-wrapper",className:u()("neeto-ui-modal__wrapper",(t={"neeto-ui-modal__wrapper--xs":o===_p,"neeto-ui-modal__wrapper--sm":o===bp,"neeto-ui-modal__wrapper--md":o===Ep},n=_,r=_,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t))},N),v&&l.a.createElement(Qd,{style:"text",icon:Rc.Close,className:"neeto-ui-modal__close",onClick:p}),f?l.a.createElement(l.a.Fragment,null):g)))},vp=["children","size","noUnderline","className"],Sp=["active","className","children","icon","onClick","activeClassName"];function Op(){return(Op=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Tp(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Cp=function(){},Np="large",wp=function(e){var t=e.children,n=e.size,r=e.noUnderline,i=e.className,o=void 0===i?"":i,a=Tp(e,vp);return l.a.createElement("div",Op({className:u()({"neeto-ui-tab__wrapper flex":!0},{"neeto-ui-tab__wrapper--size-large":n===Np},{"neeto-ui-tab__wrapper--underline-none":r},[o]),"data-cy":"tab-container"},a),t)};wp.Item=function(e){var t=e.active,n=e.className,r=void 0===n?"":n,i=e.children,o=e.icon,a=void 0===o?null:o,s=e.onClick,c=void 0===s?Cp:s,d=e.activeClassName,p=void 0===d?"":d,m=Tp(e,Sp),f="button",g="string"==typeof a?function(){return l.a.createElement("i",{className:a,"data-cy":"tab-item-icon"})}:a||l.a.Fragment;return p&&(f=Fd),l.a.createElement(f,Op({className:u()(["neeto-ui-tab flex items-center justify-center select-none",r],{active:t}),onClick:c,"data-cy":"tab-item"},m),a&&l.a.createElement(g,{className:"neeto-ui-tab__icon"}),i)};var Ap=wp;function Dp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Rp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xp=function(e){var t,n,r,i=e.buttonLabel,o=void 0===i?"Submit":i,a=e.placeholder,c=e.onSubmit,d=e.className,p=Dp(Object(s.useState)(""),2),m=p[0],f=p[1],g=Dp(Object(s.useState)(""),2),h=g[0],_=g[1];return l.a.createElement("div",{className:u()("flex flex-col items-center justify-center flex-1 mx-10 flex-wrap",(t={},n=d,r=d,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t))},l.a.createElement("div",{className:"flex-row w-full my-4"},l.a.createElement(fd,{name:"url",value:m,placeholder:a,onFocus:function(){return _("")},error:h,onChange:function(e){var t=e.target.value;return f(t)}})),l.a.createElement(Qd,{label:o,onClick:function(e){e.preventDefault(),Kd.test(m)?c(m):_("Please enter a valid url")}}))};function Mp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ip(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ip(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ip(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var kp=function(e){var t,n=Mp(Object(s.useState)(null===(t=e[0])||void 0===t?void 0:t.key),2),r=n[0],i=n[1];return[r,function(e){return i(e.key)}]},Lp=(n(32),n(43),n(44)),Pp=n.n(Lp),Fp=(n(45),n(46),n(47),n(48),function(e){var t=e.uppy;return l.a.createElement(Pp.a,{note:"Max. File Size: 5MB",uppy:t,locale:{strings:{dropHereOr:"Drop your file(s) here or %{browse}",browse:"Browse"}},className:"local-upload__root"})});function jp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Up(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Up(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Up(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Bp=function(e){var t=e.uppy,n=jp(Object(s.useState)(0),2),r=n[0],i=n[1];Object(s.useEffect)((function(){t.on("progress",i)}),[t]);var o="".concat(r,"%");return l.a.createElement("div",{className:"progress-bar__root"},l.a.createElement("div",{className:"flex items-center justify-between"},l.a.createElement("span",{className:"progress-bar__percent-text"},o),l.a.createElement("button",{onClick:t.cancelAll},l.a.createElement(Rc.Close,{size:16}))),l.a.createElement("div",{className:"progress-bar__indicator"},l.a.createElement("div",{className:"flex h-full"},l.a.createElement("div",{style:{width:o},className:"flex flex-col justify-center text-center text-white shadow-none whitespace-nowrap progress-bar__indicator-inner"}))))},zp=[{title:"Upload",key:"local"},{title:"Link",key:"link"}];function Gp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Hp=function(e){var t,n=e.editor,r=e.imageUploadUrl,i=e.isVisible,o=e.setIsVisible,a=Gp(Object(s.useState)(!1),2),c=a[0],u=a[1],d=Gp(kp(zp),2),p=d[0],m=d[1],f=Object(s.useMemo)((function(){return new op.a({allowMultipleUploads:!1,autoProceed:!0,debug:!0}).use(sp.a,{endpoint:r||"/api/v1/direct_uploads",formData:!0,fieldName:"blob"}).on("upload",(function(){return u(!0)})).on("upload-success",(function(e,t){var r=t.body.imageURL;n.chain().focus().setImage({src:r}).run(),o(!1)})).on("cancel-all",(function(){return u(!1)})).on("complete",(function(){return u(!1)}))}),[n]);return l.a.createElement(yp,{isOpen:i,onClose:function(){return o(!1)},className:"image-uploader__modal",closeButton:!1},l.a.createElement("div",{className:"image-uploader__root"},l.a.createElement(Ap,null,zp.map((function(e){return l.a.createElement(Ap.Item,{key:e.key,active:p===e.key,onClick:function(){return m(e)}},e.title)}))),l.a.createElement("div",{className:"image-uploader__content"},c?l.a.createElement("div",{className:"flex flex-col items-center justify-center flex-1 text-center"},l.a.createElement("span",{className:"label--primary"},"Uploading..."),l.a.createElement("span",{className:"label--secondary"},null===(t=f.getFiles()[0])||void 0===t?void 0:t.name),l.a.createElement(Bp,{uppy:f})):"local"===p?l.a.createElement(Fp,{uppy:f}):"link"===p?l.a.createElement(xp,{onSubmit:function(e){n.chain().focus().setImage({src:e}).run(),o(!1)},buttonLabel:"Upload Image",placeholder:"Paste the image link"}):null)))};const Wp=/^\s*>\s$/,Vp=ns.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block*",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setBlockquote:()=>({commands:e})=>e.wrapIn("blockquote"),toggleBlockquote:()=>({commands:e})=>e.toggleWrap("blockquote"),unsetBlockquote:()=>({commands:e})=>e.lift("blockquote")}),addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[us({find:Wp,type:this.type})]}}),qp=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,$p=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Qp=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Kp=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Zp=rs.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setBold:()=>({commands:e})=>e.setMark("bold"),toggleBold:()=>({commands:e})=>e.toggleMark("bold"),unsetBold:()=>({commands:e})=>e.unsetMark("bold")}),addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ss({find:qp,type:this.type}),ss({find:Qp,type:this.type})]},addPasteRules(){return[ds({find:$p,type:this.type}),ds({find:Kp,type:this.type})]}}),Xp=/^\s*([-+*])\s$/,Jp=ns.create({name:"bulletList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleBulletList:()=>({commands:e})=>e.toggleList("bulletList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[us({find:Xp,type:this.type})]}}),em=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,tm=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,nm=rs.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setCode:()=>({commands:e})=>e.setMark("code"),toggleCode:()=>({commands:e})=>e.toggleMark("code"),unsetCode:()=>({commands:e})=>e.unsetMark("code")}),addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[ss({find:em,type:this.type})]},addPasteRules(){return[ds({find:tm,type:this.type})]}}),rm=/^```(?<language>[a-z]*)?[\s\n]$/,im=/^~~~(?<language>[a-z]*)?[\s\n]$/,om=ns.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,r=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return r||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:e}){return["pre",this.options.HTMLAttributes,["code",e,0]]},addCommands:()=>({setCodeBlock:e=>({commands:t})=>t.setNode("codeBlock",e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode("codeBlock","paragraph",e)}),addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())}}},addInputRules(){return[ls({find:rm,type:this.type,getAttributes:({groups:e})=>e}),ls({find:im,type:this.type,getAttributes:({groups:e})=>e})]},addProseMirrorPlugins(){return[new Tt({key:new wt("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;const{tr:a}=e.state;return a.replaceSelectionWith(this.type.create({language:o})),a.setSelection(lt.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.insertText(n.replace(/\r\n?/g,"\n")),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}});var am=ns.create({name:"doc",topNode:!0,content:"block+"});var sm=function(e,t){var n=this;this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var r=function(e){return n[t](e)};return e.dom.addEventListener(t,r),{name:t,handler:r}}))};sm.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var n=t.name,r=t.handler;return e.editorView.dom.removeEventListener(n,r)}))},sm.prototype.update=function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())},sm.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},sm.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,r=t.nodeAfter;if(n||r){var i=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),o=n?i.bottom:i.top;n&&r&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:i.left,right:i.right,top:o-this.width/2,bottom:o+this.width/2}}}if(!e){var a=this.editorView.coordsAtPos(this.cursorPos);e={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}var s,l,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!c||c==document.body&&"static"==getComputedStyle(c).position)s=-pageXOffset,l=-pageYOffset;else{var u=c.getBoundingClientRect();s=u.left-c.scrollLeft,l=u.top-c.scrollTop}this.element.style.left=e.left-s+"px",this.element.style.top=e.top-l+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"},sm.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},sm.prototype.dragover=function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY});if(t){var n=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(n=He(this.editorView.state.doc,n,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(n),this.scheduleRemoval(5e3)}}},sm.prototype.dragend=function(){this.scheduleRemoval(20)},sm.prototype.drop=function(){this.scheduleRemoval(20)},sm.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};const lm=lo.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:null}),addProseMirrorPlugins(){return[(e=this.options,void 0===e&&(e={}),new Tt({view:function(t){return new sm(t,e)}}))];var e}});var cm=function(e){function t(t){e.call(this,t,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,r){var i=n.resolve(r.map(this.head));return t.valid(i)?new t(i):e.near(i)},t.prototype.content=function(){return y.empty},t.prototype.eq=function(e){return e instanceof t&&e.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))},t.prototype.getBookmark=function(){return new um(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var n=e.index(t);if(0!=n)for(var r=e.node(t).child(n-1);;r=r.lastChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(var i=r.child(n);;i=i.firstChild){if(0==i.childCount&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}(e))return!1;var n=t.type.spec.allowGapCursor;if(null!=n)return n;var r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock},t.findFrom=function(e,n,r){e:for(;;){if(!r&&t.valid(e))return e;for(var i=e.pos,o=null,a=e.depth;;a--){var s=e.node(a);if(n>0?e.indexAfter(a)<s.childCount:e.index(a)>0){o=s.child(n>0?e.indexAfter(a):e.index(a)-1);break}if(0==a)return null;i+=n;var l=e.doc.resolve(i);if(t.valid(l))return l}for(;;){var c=n>0?o.firstChild:o.lastChild;if(!c){if(o.isAtom&&!o.isText&&!ut.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=c,i+=n;var u=e.doc.resolve(i);if(t.valid(u))return u}return null}},t}(ot);cm.prototype.visible=!1,ot.jsonID("gapcursor",cm);var um=function(e){this.pos=e};um.prototype.map=function(e){return new um(e.map(this.pos))},um.prototype.resolve=function(e){var t=e.resolve(this.pos);return cm.valid(t)?new cm(t):ot.near(t)};var dm=no({ArrowLeft:pm("horiz",-1),ArrowRight:pm("horiz",1),ArrowUp:pm("vert",-1),ArrowDown:pm("vert",1)});function pm(e,t){var n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){var o=e.selection,a=t>0?o.$to:o.$from,s=o.empty;if(o instanceof lt){if(!i.endOfTextblock(n)||0==a.depth)return!1;s=!1,a=e.doc.resolve(t>0?a.after():a.before())}var l=cm.findFrom(a,t,s);return!!l&&(r&&r(e.tr.setSelection(new cm(l))),!0)}}function mm(e,t,n){if(!e.editable)return!1;var r=e.state.doc.resolve(t);if(!cm.valid(r))return!1;var i=e.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(i>-1&&ut.isSelectable(e.state.doc.nodeAt(i)))&&(e.dispatch(e.state.tr.setSelection(new cm(r))),!0)}function fm(e){if(!(e.selection instanceof cm))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",Ci.create(e.doc,[vi.widget(e.selection.head,t,{key:"gapcursor"})])}const gm=lo.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Tt({props:{decorations:fm,createSelectionBetween:function(e,t,n){if(t.pos==n.pos&&cm.valid(n))return new cm(n)},handleClick:mm,handleKeyDown:dm}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=ao(so(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),hm=ns.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",Qa(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{keepMarks:e}=this.options,{splittableMarks:i}=r.extensionManager,o=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();return t().insertContent({type:this.name}).command(({tr:t,dispatch:n})=>{if(n&&o&&e){const e=o.filter(e=>i.includes(e.type.name));t.ensureMarks(e)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),_m=ns.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:"h"+e,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return["h"+(this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]),Qa(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode("heading",e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode("heading","paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,["Mod-Alt-"+t]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>ls({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var bm=function(){};bm.prototype.append=function(e){return e.length?(e=bm.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},bm.prototype.prepend=function(e){return e.length?bm.from(e).append(this):this},bm.prototype.appendInner=function(e){return new ym(this,e)},bm.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?bm.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},bm.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},bm.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},bm.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},bm.from=function(e){return e instanceof bm?e:e&&e.length?new Em(e):bm.empty};var Em=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)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}(bm);bm.empty=new Em([]);var ym=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;return!(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r))&&(!(n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&(!(n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(bm),vm=bm,Sm=function(e,t){this.items=e,this.eventCount=t};Sm.prototype.popEvent=function(e,t){var n=this;if(0==this.eventCount)return null;for(var r,i,o=this.items.length;;o--){if(this.items.get(o-1).selection){--o;break}}t&&(r=this.remapping(o,this.items.length),i=r.maps.length);var a,s,l=e.tr,c=[],u=[];return this.items.forEach((function(e,t){if(!e.step)return r||(r=n.remapping(o,t+1),i=r.maps.length),i--,void u.push(e);if(r){u.push(new Om(e.map));var d,p=e.step.map(r.slice(i));p&&l.maybeStep(p).doc&&(d=l.mapping.maps[l.mapping.maps.length-1],c.push(new Om(d,null,null,c.length+u.length))),i--,d&&r.appendMap(d,i)}else l.maybeStep(e.step);return e.selection?(a=r?e.selection.map(r.slice(i)):e.selection,s=new Sm(n.items.slice(0,o).append(u.reverse().concat(c)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:a}},Sm.prototype.addTransform=function(e,t,n,r){for(var i=[],o=this.eventCount,a=this.items,s=!r&&a.length?a.get(a.length-1):null,l=0;l<e.steps.length;l++){var c,u=e.steps[l].invert(e.docs[l]),d=new Om(e.mapping.maps[l],u,t);(c=s&&s.merge(d))&&(d=c,l?i.pop():a=a.slice(0,a.length-1)),i.push(d),t&&(o++,t=null),r||(s=d)}var p,m,f,g=o-n.depth;return g>Cm&&(m=g,(p=a).forEach((function(e,t){if(e.selection&&0==m--)return f=t,!1})),a=p.slice(f),o-=g),new Sm(a.append(i),o)},Sm.prototype.remapping=function(e,t){var n=new Ne;return this.items.forEach((function(t,r){var i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:null;n.appendMap(t.map,i)}),e,t),n},Sm.prototype.addMaps=function(e){return 0==this.eventCount?this:new Sm(this.items.append(e.map((function(e){return new Om(e)}))),this.eventCount)},Sm.prototype.rebased=function(e,t){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach((function(e){e.selection&&a--}),r);var s=t;this.items.forEach((function(t){var r=i.getMirror(--s);if(null!=r){o=Math.min(o,r);var l=i.maps[r];if(t.step){var c=e.steps[r].invert(e.docs[r]),u=t.selection&&t.selection.map(i.slice(s+1,r));u&&a++,n.push(new Om(l,c,u))}else n.push(new Om(l))}}),r);for(var l=[],c=t;c<o;c++)l.push(new Om(i.maps[c]));var u=this.items.slice(0,r).append(l).append(n),d=new Sm(u,a);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d},Sm.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},Sm.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach((function(o,a){if(a>=e)r.push(o),o.selection&&i++;else if(o.step){var s=o.step.map(t.slice(n)),l=s&&s.getMap();if(n--,l&&t.appendMap(l,n),s){var c=o.selection&&o.selection.map(t.slice(n));c&&i++;var u,d=new Om(l.invert(),s,c),p=r.length-1;(u=r.length&&r[p].merge(d))?r[p]=u:r.push(d)}}else o.map&&n--}),this.items.length,0),new Sm(vm.from(r.reverse()),i)},Sm.empty=new Sm(vm.empty,0);var Om=function(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r};Om.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new Om(t.getMap().invert(),t,this.selection)}};var Tm=function(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r},Cm=20;function Nm(e){var t=[];return e.forEach((function(e,n,r,i){return t.push(r,i)})),t}function wm(e,t){if(!e)return null;for(var n=[],r=0;r<e.length;r+=2){var i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function Am(e,t,n,r){var i=xm(t),o=Mm.get(t).spec.config,a=(r?e.undone:e.done).popEvent(t,i);if(a){var s=a.selection.resolve(a.transform.doc),l=(r?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),o,i),c=new Tm(r?l:a.remaining,r?a.remaining:l,null,0);n(a.transform.setSelection(s).setMeta(Mm,{redo:r,historyState:c}).scrollIntoView())}}var Dm=!1,Rm=null;function xm(e){var t=e.plugins;if(Rm!=t){Dm=!1,Rm=t;for(var n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){Dm=!0;break}}return Dm}var Mm=new wt("history"),Im=new wt("closeHistory");function km(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new Tt({key:Mm,state:{init:function(){return new Tm(Sm.empty,Sm.empty,null,0)},apply:function(t,n,r){return function(e,t,n,r){var i,o=n.getMeta(Mm);if(o)return o.historyState;n.getMeta(Im)&&(e=new Tm(e.done,e.undone,null,0));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(a&&a.getMeta(Mm))return a.getMeta(Mm).redo?new Tm(e.done.addTransform(n,null,r,xm(t)),e.undone,Nm(n.mapping.maps[n.steps.length-1]),e.prevTime):new Tm(e.done,e.undone.addTransform(n,null,r,xm(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new Tm(e.done.rebased(n,i),e.undone.rebased(n,i),wm(e.prevRanges,n.mapping),e.prevTime):new Tm(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),wm(e.prevRanges,n.mapping),e.prevTime);var s=0==e.prevTime||!a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;return e.mapping.maps[0].forEach((function(e,r){for(var i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)})),n}(n,e.prevRanges)),l=a?wm(e.prevRanges,n.mapping):Nm(n.mapping.maps[n.steps.length-1]);return new Tm(e.done.addTransform(n,s?t.selection.getBookmark():null,r,xm(t)),Sm.empty,l,n.time)}(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var n="historyUndo"==t.inputType?Lm(e.state,e.dispatch):"historyRedo"==t.inputType&&Pm(e.state,e.dispatch);return n&&t.preventDefault(),n}}}})}function Lm(e,t){var n=Mm.getState(e);return!(!n||0==n.done.eventCount)&&(t&&Am(n,e,t,!1),!0)}function Pm(e,t){var n=Mm.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&Am(n,e,t,!0),!0)}const Fm=lo.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Lm(e,t),redo:()=>({state:e,dispatch:t})=>Pm(e,t)}),addProseMirrorPlugins(){return[km(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),jm=ns.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",Qa(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().command(({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,$anchor:i}=n,o=i.parent.isTextblock&&!i.parent.type.spec.code&&!i.parent.textContent;if(!r||!o||!t)return!0;const a=i.before(),s=i.start();return e.deleteRange(a,s),e.setSelection(lt.create(e.doc,a)),!0}).insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{var n;if(t){const{parent:t,pos:r}=e.selection.$from,i=r+1;if(!e.doc.nodeAt(i)){const r=null===(n=t.type.contentMatch.defaultType)||void 0===n?void 0:n.create();r&&(e.insert(i,r),e.setSelection(lt.create(e.doc,i)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[is({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Um=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,Bm=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,zm=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,Gm=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,Ym=rs.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setItalic:()=>({commands:e})=>e.setMark("italic"),toggleItalic:()=>({commands:e})=>e.toggleMark("italic"),unsetItalic:()=>({commands:e})=>e.unsetMark("italic")}),addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ss({find:Um,type:this.type}),ss({find:zm,type:this.type})]},addPasteRules(){return[ds({find:Bm,type:this.type}),ds({find:Gm,type:this.type})]}}),Hm=ns.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Qa(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem("listItem"),Tab:()=>this.editor.commands.sinkListItem("listItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("listItem")}}}),Wm=/^(\d+)\.\s$/,Vm=ns.create({name:"orderedList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",Qa(this.options.HTMLAttributes,n),0]:["ol",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleOrderedList:()=>({commands:e})=>e.toggleList("orderedList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[us({find:Wm,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),qm=ns.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setParagraph:()=>({commands:e})=>e.setNode("paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),$m=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,Qm=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,Km=rs.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setStrike:()=>({commands:e})=>e.setMark("strike"),toggleStrike:()=>({commands:e})=>e.toggleMark("strike"),unsetStrike:()=>({commands:e})=>e.unsetMark("strike")}),addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ss({find:$m,type:this.type})]},addPasteRules(){return[ds({find:Qm,type:this.type})]}});var Zm=ns.create({name:"text",group:"inline"});const Xm=lo.create({name:"starterKit",addExtensions(){var e,t,n,r,i,o,a,s,l,c,u,d,p,m,f,g,h,_;const b=[];return!1!==this.options.blockquote&&b.push(Vp.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&b.push(Zp.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&b.push(Jp.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&b.push(nm.configure(null===(r=this.options)||void 0===r?void 0:r.code)),!1!==this.options.codeBlock&&b.push(om.configure(null===(i=this.options)||void 0===i?void 0:i.codeBlock)),!1!==this.options.document&&b.push(am.configure(null===(o=this.options)||void 0===o?void 0:o.document)),!1!==this.options.dropcursor&&b.push(lm.configure(null===(a=this.options)||void 0===a?void 0:a.dropcursor)),!1!==this.options.gapcursor&&b.push(gm.configure(null===(s=this.options)||void 0===s?void 0:s.gapcursor)),!1!==this.options.hardBreak&&b.push(hm.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&b.push(_m.configure(null===(c=this.options)||void 0===c?void 0:c.heading)),!1!==this.options.history&&b.push(Fm.configure(null===(u=this.options)||void 0===u?void 0:u.history)),!1!==this.options.horizontalRule&&b.push(jm.configure(null===(d=this.options)||void 0===d?void 0:d.horizontalRule)),!1!==this.options.italic&&b.push(Ym.configure(null===(p=this.options)||void 0===p?void 0:p.italic)),!1!==this.options.listItem&&b.push(Hm.configure(null===(m=this.options)||void 0===m?void 0:m.listItem)),!1!==this.options.orderedList&&b.push(Vm.configure(null===(f=this.options)||void 0===f?void 0:f.orderedList)),!1!==this.options.paragraph&&b.push(qm.configure(null===(g=this.options)||void 0===g?void 0:g.paragraph)),!1!==this.options.strike&&b.push(Km.configure(null===(h=this.options)||void 0===h?void 0:h.strike)),!1!==this.options.text&&b.push(Zm.configure(null===(_=this.options)||void 0===_?void 0:_.text)),b}}),Jm=cs({find:/--$/,replace:"—"}),ef=cs({find:/\.\.\.$/,replace:"…"}),tf=cs({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:"“"}),nf=cs({find:/"$/,replace:"”"}),rf=cs({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:"‘"}),of=cs({find:/'$/,replace:"’"}),af=cs({find:/<-$/,replace:"←"}),sf=cs({find:/->$/,replace:"→"}),lf=cs({find:/\(c\)$/,replace:"©"}),cf=cs({find:/\(tm\)$/,replace:"™"}),uf=cs({find:/\(r\)$/,replace:"®"}),df=cs({find:/1\/2$/,replace:"½"}),pf=cs({find:/\+\/-$/,replace:"±"}),mf=cs({find:/!=$/,replace:"≠"}),ff=cs({find:/<<$/,replace:"«"}),gf=cs({find:/>>$/,replace:"»"}),hf=cs({find:/\d+\s?([*x])\s?\d+$/,replace:"×"}),_f=cs({find:/\^2$/,replace:"²"}),bf=cs({find:/\^3$/,replace:"³"}),Ef=cs({find:/1\/4$/,replace:"¼"}),yf=cs({find:/3\/4$/,replace:"¾"}),vf=lo.create({name:"typography",addInputRules:()=>[Jm,ef,tf,nf,rf,of,af,sf,lf,cf,uf,df,pf,mf,ff,gf,hf,_f,bf,Ef,yf]}),Sf=/(?:^|\s)((?:==)((?:[^~]+))(?:==))$/,Of=/(?:^|\s)((?:==)((?:[^~]+))(?:==))/g,Tf=rs.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:"background-color: "+e.color}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setHighlight:e=>({commands:t})=>t.setMark("highlight",e),toggleHighlight:e=>({commands:t})=>t.toggleMark("highlight",e),unsetHighlight:()=>({commands:e})=>e.unsetMark("highlight")}),addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[ss({find:Sf,type:this.type})]},addPasteRules(){return[ds({find:Of,type:this.type})]}});var Cf=n(25);const Nf=rs.create({name:"link",priority:1e3,inclusive:!1,addOptions:()=>({openOnClick:!0,linkOnPaste:!0,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"}}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target}}},parseHTML:()=>[{tag:"a[href]"}],renderHTML({HTMLAttributes:e}){return["a",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setLink:e=>({commands:t})=>t.setMark("link",e),toggleLink:e=>({commands:t})=>t.toggleMark("link",e,{extendEmptyMarkRange:!0}),unsetLink:()=>({commands:e})=>e.unsetMark("link",{extendEmptyMarkRange:!0})}),addPasteRules(){return[ds({find:e=>Object(Cf.find)(e).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[];return this.options.openOnClick&&e.push(new Tt({key:new wt("handleClickLink"),props:{handleClick:(e,t,n)=>{var r;const i=this.editor.getAttributes("link");return!(!(null===(r=n.target)||void 0===r?void 0:r.closest("a"))||!i.href)&&(window.open(i.href,i.target),!0)}}})),this.options.linkOnPaste&&e.push(new Tt({key:new wt("handlePasteLink"),props:{handlePaste:(e,t,n)=>{const{state:r}=e,{selection:i}=r,{empty:o}=i;if(o)return!1;let a="";n.content.forEach(e=>{a+=e.textContent});const s=Object(Cf.find)(a).find(e=>e.isLink&&e.value===a);return!(!a||!s)&&(this.editor.commands.setMark(this.type,{href:s.href}),!0)}}})),e}}),wf=rs.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",Qa(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=sa(e,this.type);return!!Object.entries(n).some(([,e])=>!!e)||t.unsetMark("textStyle")}}}}),Af=lo.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>e.style.color.replace(/['"]+/g,""),renderHTML:e=>e.color?{style:"color: "+e.color}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})});var Df=n(12),Rf=n.n(Df);var xf=ns.create({name:"doc",topNode:!0,content:"block+"}).extend({content:"root",addProseMirrorPlugins:function(){var e=this.editor;return[new Tt({key:new wt("eventHandler"),props:{handleClick:function(t,n){var r=t.state,i=r.doc.lastChild,o=r.doc.resolve(n).nodeBefore;if(i&&o){var a=i.eq(o),s=i.isInline,l=["paragraph","text"].includes(i.type.name);!a||s||l||e.commands.insertContentAt(n,{type:"paragraph",content:""})}}}})]}});const Mf=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/,If=ns.create({name:"image",addOptions:()=>({inline:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML:()=>[{tag:"img[src]"}],renderHTML({HTMLAttributes:e}){return["img",Qa(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[is({find:Mf,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}});function kf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Lf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kf(Object(n),!0).forEach((function(t){Pf(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Pf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ff=If.extend({name:"image",addAttributes:function(){return Lf(Lf({},If.config.addAttributes()),{},{size:{default:"small",rendered:!1},float:{default:"none",rendered:!1}})},addCommands:function(){var e=this;return{setImage:function(t){return function(n){var r,i,o,a=n.tr,s=n.commands;return"image"==(null===(r=a.selection)||void 0===r||null===(i=r.node)||void 0===i||null===(o=i.type)||void 0===o?void 0:o.name)?s.updateAttributes("image",t):s.insertContent({type:e.name,attrs:t})}}}},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes;return n.class=" image-"+t.attrs.size,n.class+=" image-float-"+t.attrs.float,["img",Qa(this.options.HTMLAttributes,n)]}});const jf=rs.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",Qa(this.options.HTMLAttributes,e),0]},addCommands:()=>({setUnderline:()=>({commands:e})=>e.setMark("underline"),toggleUnderline:()=>({commands:e})=>e.toggleMark("underline"),unsetUnderline:()=>({commands:e})=>e.unsetMark("underline")}),addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline()}}});function Uf(e){return(Uf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Bf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function zf(e,t){return(zf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Gf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Wf(e);if(t){var i=Wf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Yf(this,n)}}function Yf(e,t){if(t&&("object"===Uf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Hf(e)}function Hf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wf(e){return(Wf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Vf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zf(e,t)}(o,e);var t,n,r,i=Gf(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),Vf(Hf(t=i.call(this,e)),"onKeyDown",(function(e){var n=e.event;return"ArrowUp"===n.key?(t.upHandler(),!0):"ArrowDown"===n.key?(t.downHandler(),!0):"Enter"===n.key&&(t.enterHandler(),!0)})),Vf(Hf(t),"upHandler",(function(){t.setState({selectedIndex:(t.state.selectedIndex+t.props.items.length-1)%t.props.items.length})})),Vf(Hf(t),"downHandler",(function(){t.setState({selectedIndex:(t.state.selectedIndex+1)%t.props.items.length})})),Vf(Hf(t),"enterHandler",(function(){t.selectItem(t.state.selectedIndex)})),Vf(Hf(t),"selectItem",(function(e){var n=t.props.items[e];if(n){var r=t.props,i=r.editor,o=r.range;n.command({editor:i,range:o})}})),Vf(Hf(t),"scrollHandler",(function(){var e=t.menuRef.current,n=e.children[t.state.selectedIndex],r=n.clientHeight+8,i=e.scrollTop;n.offsetTop+r>i+e.clientHeight?i=n.offsetTop-e.clientHeight+r:i>n.offsetTop&&(i=n.offsetTop-8),t.menuRef.current.scrollTop=i})),t.state={selectedIndex:0},t.menuRef=l.a.createRef(),t}return t=o,(n=[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),this.scrollHandler()}},{key:"render",value:function(){var e=this;return l.a.createElement("div",{ref:this.menuRef,className:"relative p-3 -mr-1 space-y-2 overflow-x-hidden overflow-y-scroll rounded shadow max-h-80 w-80 editor-command-list--root"},this.props.items.map((function(t,n){return l.a.createElement($f,{key:t.title,item:t,index:n,selectedIndex:e.state.selectedIndex,selectItem:function(){return e.selectItem(n)}})})))}}])&&Bf(t.prototype,n),r&&Bf(t,r),o}(l.a.Component),$f=function(e){var t=e.item,n=e.selectedIndex,r=e.index,i=e.selectItem,o=t.Icon;return l.a.createElement("div",{className:u()("flex items-center w-full px-4 py-2 space-x-4 transition-all duration-100 ease-in-out editor-command-list--item cursor-pointer rounded",{selected_item:r===n}),onClick:function(){return i(r)}},o&&l.a.createElement("div",{className:"p-1 text-gray-100 rounded-sm"},l.a.createElement(o,{size:18})),l.a.createElement("div",{className:"flex flex-col text-gray-100"},l.a.createElement("span",{className:"text-sm font-semibold"},t.title),l.a.createElement("span",{className:"text-xs text-gray-300"},t.description)))},Qf=qf;const Kf=new wt("suggestion");function Zf({pluginKey:e=Kf,editor:t,char:n="@",allowSpaces:r=!1,prefixSpace:i=!0,startOfLine:o=!1,decorationTag:a="span",decorationClass:s="suggestion",command:l=(()=>null),items:c=(()=>[]),render:u=(()=>({})),allow:d=(()=>!0)}){const p=null==u?void 0:u();return new Tt({key:e,view(){return{update:async(e,n)=>{var r,i,o,a,s;const u=null===(r=this.key)||void 0===r?void 0:r.getState(n),d=null===(i=this.key)||void 0===i?void 0:i.getState(e.state),m=u.active&&d.active&&u.range.from!==d.range.from,f=!u.active&&d.active,g=u.active&&!d.active,h=f||m,_=!f&&!g&&u.query!==d.query&&!m,b=g||m;if(!h&&!_&&!b)return;const E=b&&!h?u:d,y=document.querySelector(`[data-decoration-id="${E.decorationId}"]`),v={editor:t,range:E.range,query:E.query,text:E.text,items:_||h?await c({editor:t,query:E.query}):[],command:e=>{l({editor:t,range:E.range,props:e})},decorationNode:y,clientRect:y?()=>{var e;const{decorationId:n}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${n}"]`).getBoundingClientRect()}:null};b&&(null===(o=null==p?void 0:p.onExit)||void 0===o||o.call(p,v)),_&&(null===(a=null==p?void 0:p.onUpdate)||void 0===a||a.call(p,v)),h&&(null===(s=null==p?void 0:p.onStart)||void 0===s||s.call(p,v))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,a){const{composing:s}=t.view,{selection:l}=e,{empty:c,from:u}=l,p={...a};if(p.composing=s,c||t.view.composing){!(u<a.range.from||u>a.range.to)||s||a.composing||(p.active=!1);const e=function(e){const{char:t,allowSpaces:n,prefixSpace:r,startOfLine:i,$position:o}=e,a=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${a}$`),l=i?"^":"",c=n?new RegExp(`${l}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${l}(?:^)?${a}[^\\s${a}]*`,"gm"),u=o.depth<=0?0:o.before(),d=o.pos,p=o.doc.textBetween(u,d,"\0","\0"),m=Array.from(p.matchAll(c)).pop();if(!m||void 0===m.input||void 0===m.index)return null;const f=m.input.slice(Math.max(0,m.index-1),m.index),g=/^[\s\0]?$/.test(f);if(r&&!g)return null;const h=m.index+o.start();let _=h+m[0].length;return n&&s.test(p.slice(_-1,_+1))&&(m[0]+=" ",_+=1),h<o.pos&&_>=o.pos?{range:{from:h,to:_},query:m[0].slice(t.length),text:m[0]}:null}({char:n,allowSpaces:r,prefixSpace:i,startOfLine:o,$position:l.$from}),c="id_"+Math.floor(4294967295*Math.random());e&&d({editor:t,range:e.range})?(p.active=!0,p.decorationId=a.decorationId?a.decorationId:c,p.range=e.range,p.query=e.query,p.text=e.text):p.active=!1}else p.active=!1;return p.active||(p.decorationId=null,p.range={},p.query=null,p.text=null),p}},props:{handleKeyDown(e,t){var n;const{active:r,range:i}=this.getState(e.state);return r&&(null===(n=null==p?void 0:p.onKeyDown)||void 0===n?void 0:n.call(p,{view:e,event:t,range:i}))||!1},decorations(e){const{active:t,range:n,decorationId:r}=this.getState(e);return t?Ci.create(e.doc,[vi.inline(n.from,n.to,{nodeName:a,class:s,"data-decoration-id":r})]):null}}})}function Xf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Jf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xf(Object(n),!0).forEach((function(t){eg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function eg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tg=new wt("commands"),ng=function(e){var t=e.setImageUploadVisible;return lo.create({addOptions:function(){return{HTMLAttributes:{class:"commands"},suggestion:{char:"/",startOfLine:!1,pluginKey:tg,command:function(e){var t=e.editor,n=e.range;e.props.command({editor:t,range:n})},items:function(e){var n=e.query,r=[{title:"Paragraph",description:"Add a plain text block",Icon:Rc.Paragraph,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).setNode("paragraph").run()}},{title:"H1",description:"Add a big heading",Icon:Rc.TextH1,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).setNode("heading",{level:1}).run()}},{title:"H2",description:"Add a sub-heading",Icon:Rc.TextH2,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).setNode("heading",{level:2}).run()}},{title:"Numbered list",description:"Add a list with numbering",Icon:Rc.ListNumber,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleOrderedList().run()}},{title:"Bulleted list",description:"Add an list bullets",Icon:Rc.ListDot,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleBulletList().run()}},{title:"Blockquote",description:"Add a quote",Icon:Rc.Blockquote,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleBlockquote().run()}},{title:"Image",description:"Add an image",Icon:Rc.Image,command:function(e){var n=e.editor,r=e.range;t(!0),n.chain().focus().deleteRange(r).run()}},{title:"Youtube/Vimeo",description:"Embed a video from major services",Icon:Rc.Video,command:function(e){var t=e.editor,n=e.range,r=prompt("Please enter Youtube/Vimeo embed URL");t.chain().focus().deleteRange(n).setExternalVideo({src:r}).run()}},{title:"Code block",description:"Add a code block with syntax highlighting",Icon:Rc.Code,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleCodeBlock().run()}}],i=r.filter((function(e){return e.title.toLowerCase().includes(n.toLowerCase())}));return Rf()(i)?[{title:"No results",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).run()}}]:i},render:function(){var e,t;return{onStart:function(n){e=new yc(Qf,{props:n,editor:n.editor}),t=uc("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown:function(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addProseMirrorPlugins:function(){return[Zf(Jf({editor:this.editor},this.options.suggestion))]}})},rg={};function ig(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var n=e[t];"object"!=typeof n||Object.isFrozen(n)||ig(n)})),e}var og=ig,ag=ig;og.default=ag;class sg{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function lg(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function cg(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}const ug=e=>!!e.kind;class dg{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=lg(e)}openNode(e){if(!ug(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){ug(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class pg{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{pg._collapse(e)}))}}class mg extends pg{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){return new dg(this,this.options).value()}finalize(){return!0}}function fg(e){return e?"string"==typeof e?e:e.source:null}const gg=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const hg="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",_g={begin:"\\\\[\\s\\S]",relevance:0},bg={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[_g]},Eg={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[_g]},yg={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},vg=function(e,t,n={}){const r=cg({className:"comment",begin:e,end:t,contains:[]},n);return r.contains.push(yg),r.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),r},Sg=vg("//","$"),Og=vg("/\\*","\\*/"),Tg=vg("#","$"),Cg={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},Ng={className:"number",begin:hg,relevance:0},wg={className:"number",begin:"\\b(0b[01]+)",relevance:0},Ag={className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},Dg={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[_g,{begin:/\[/,end:/\]/,relevance:0,contains:[_g]}]}]},Rg={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},xg={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},Mg={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var Ig=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:hg,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>fg(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),cg({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:_g,APOS_STRING_MODE:bg,QUOTE_STRING_MODE:Eg,PHRASAL_WORDS_MODE:yg,COMMENT:vg,C_LINE_COMMENT_MODE:Sg,C_BLOCK_COMMENT_MODE:Og,HASH_COMMENT_MODE:Tg,NUMBER_MODE:Cg,C_NUMBER_MODE:Ng,BINARY_NUMBER_MODE:wg,CSS_NUMBER_MODE:Ag,REGEXP_MODE:Dg,TITLE_MODE:Rg,UNDERSCORE_TITLE_MODE:xg,METHOD_GUARD:Mg,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function kg(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function Lg(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=kg,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function Pg(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map(e=>fg(e)).join("|")+")"}(...e.illegal))}function Fg(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function jg(e,t){void 0===e.relevance&&(e.relevance=1)}const Ug=["of","and","for","in","not","or","if","then","parent","list","value"];function Bg(e,t){return t?Number(t):function(e){return Ug.includes(e.toLowerCase())}(e)?0:1}function zg(e,{plugins:t}){function n(t,n){return new RegExp(fg(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=n(function(e,t="|"){let n=0;return e.map(e=>{n+=1;const t=n;let r=fg(e),i="";for(;r.length>0;){const e=gg.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i}).map(e=>`(${e})`).join(t)}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex((e,t)=>t>0&&void 0!==e),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new r;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=cg(e.classNameAliases||{}),function t(r,o){const a=r;if(r.isCompiled)return a;[Fg].forEach(e=>e(r,o)),e.compilerExtensions.forEach(e=>e(r,o)),r.__beforeBegin=null,[Lg,Pg,jg].forEach(e=>e(r,o)),r.isCompiled=!0;let s=null;if("object"==typeof r.keywords&&(s=r.keywords.$pattern,delete r.keywords.$pattern),r.keywords&&(r.keywords=function e(t,n,r="keyword"){const i={};return"string"==typeof t?o(r,t.split(" ")):Array.isArray(t)?o(r,t):Object.keys(t).forEach((function(r){Object.assign(i,e(t[r],n,r))})),i;function o(e,t){n&&(t=t.map(e=>e.toLowerCase())),t.forEach((function(t){const n=t.split("|");i[n[0]]=[e,Bg(n[0],n[1])]}))}}(r.keywords,e.case_insensitive)),r.lexemes&&s)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return s=s||r.lexemes||/\w+/,a.keywordPatternRe=n(s,!0),o&&(r.begin||(r.begin=/\B|\b/),a.beginRe=n(r.begin),r.endSameAsBegin&&(r.end=r.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),r.end&&(a.endRe=n(r.end)),a.terminatorEnd=fg(r.end)||"",r.endsWithParent&&o.terminatorEnd&&(a.terminatorEnd+=(r.end?"|":"")+o.terminatorEnd)),r.illegal&&(a.illegalRe=n(r.illegal)),r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return cg(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e))return cg(e,{starts:e.starts?cg(e.starts):null});if(Object.isFrozen(e))return cg(e);return e}("self"===e?r:e)}))),r.contains.forEach((function(e){t(e,a)})),r.starts&&t(r.starts,o),a.matcher=function(e){const t=new i;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(a),a}(e)}function Gg(e){const t={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!e.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,lg(this.code);let t={};return this.autoDetect?(t=e.highlightAuto(this.code),this.detectedLanguage=t.language):(t=e.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),t.value},autoDetect(){return!this.language||(e=this.autodetect,Boolean(e||""===e));var e},ignoreIllegals:()=>!0},render(e){return e("pre",{},[e("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:t,VuePlugin:{install(e){e.component("highlightjs",t)}}}}const Yg={"after:highlightElement":({el:e,result:t,text:n})=>{const r=Wg(e);if(!r.length)return;const i=document.createElement("div");i.innerHTML=t.value,t.value=function(e,t,n){let r=0,i="";const o=[];function a(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function s(e){i+="<"+Hg(e)+[].map.call(e.attributes,(function(e){return" "+e.nodeName+'="'+lg(e.value)+'"'})).join("")+">"}function l(e){i+="</"+Hg(e)+">"}function c(e){("start"===e.event?s:l)(e.node)}for(;e.length||t.length;){let t=a();if(i+=lg(n.substring(r,t[0].offset)),r=t[0].offset,t===e){o.reverse().forEach(l);do{c(t.splice(0,1)[0]),t=a()}while(t===e&&t.length&&t[0].offset===r);o.reverse().forEach(s)}else"start"===t[0].event?o.push(t[0].node):o.pop(),c(t.splice(0,1)[0])}return i+lg(n.substr(r))}(r,Wg(i),n)}};function Hg(e){return e.nodeName.toLowerCase()}function Wg(e){const t=[];return function e(n,r){for(let i=n.firstChild;i;i=i.nextSibling)3===i.nodeType?r+=i.nodeValue.length:1===i.nodeType&&(t.push({event:"start",offset:r,node:i}),r=e(i,r),Hg(i).match(/br|hr|img|input/)||t.push({event:"stop",offset:r,node:i}));return r}(e,0),t}const Vg={},qg=e=>{console.error(e)},$g=(e,...t)=>{console.log("WARN: "+e,...t)},Qg=(e,t)=>{Vg[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Vg[`${e}/${t}`]=!0)},Kg=lg,Zg=cg,Xg=Symbol("nomatch");var Jg=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const o=/(^(<[^>]+>|\t|)+|\n)/gm,a="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let l={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:mg};function c(e){return l.noHighlightRe.test(e)}function u(e,t,n,r){let i="",o="";"object"==typeof t?(i=e,n=t.ignoreIllegals,o=t.language,r=void 0):(Qg("10.7.0","highlight(lang, code, ...args) has been deprecated."),Qg("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),o=e,i=t);const a={code:i,language:o};O("before:highlight",a);const s=a.result?a.result:d(a.language,a.code,n,r);return s.code=a.code,O("after:highlight",s),s}function d(e,n,o,s){function c(e,t){const n=E.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,n)&&e.keywords[n]}function u(){null!=O.subLanguage?function(){if(""===N)return;let e=null;if("string"==typeof O.subLanguage){if(!t[O.subLanguage])return void C.addText(N);e=d(O.subLanguage,N,!0,T[O.subLanguage]),T[O.subLanguage]=e.top}else e=p(N,O.subLanguage.length?O.subLanguage:null);O.relevance>0&&(w+=e.relevance),C.addSublanguage(e.emitter,e.language)}():function(){if(!O.keywords)return void C.addText(N);let e=0;O.keywordPatternRe.lastIndex=0;let t=O.keywordPatternRe.exec(N),n="";for(;t;){n+=N.substring(e,t.index);const r=c(O,t);if(r){const[e,i]=r;if(C.addText(n),n="",w+=i,e.startsWith("_"))n+=t[0];else{const n=E.classNameAliases[e]||e;C.addKeyword(t[0],n)}}else n+=t[0];e=O.keywordPatternRe.lastIndex,t=O.keywordPatternRe.exec(N)}n+=N.substr(e),C.addText(n)}(),N=""}function m(e){return e.className&&C.openNode(E.classNameAliases[e.className]||e.className),O=Object.create(e,{parent:{value:O}}),O}function f(e){return 0===O.matcher.regexIndex?(N+=e[0],1):(R=!0,0)}function g(e){const t=e[0],n=e.rule,r=new sg(n),i=[n.__beforeBegin,n["on:begin"]];for(const n of i)if(n&&(n(e,r),r.isMatchIgnored))return f(t);return n&&n.endSameAsBegin&&(n.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),n.skip?N+=t:(n.excludeBegin&&(N+=t),u(),n.returnBegin||n.excludeBegin||(N=t)),m(n),n.returnBegin?0:t.length}function h(e){const t=e[0],r=n.substr(e.index),i=function e(t,n,r){let i=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(t.endRe,r);if(i){if(t["on:end"]){const e=new sg(t);t["on:end"](n,e),e.isMatchIgnored&&(i=!1)}if(i){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,r)}(O,e,r);if(!i)return Xg;const o=O;o.skip?N+=t:(o.returnEnd||o.excludeEnd||(N+=t),u(),o.excludeEnd&&(N=t));do{O.className&&C.closeNode(),O.skip||O.subLanguage||(w+=O.relevance),O=O.parent}while(O!==i.parent);return i.starts&&(i.endSameAsBegin&&(i.starts.endRe=i.endRe),m(i.starts)),o.returnEnd?0:t.length}let _={};function b(t,r){const a=r&&r[0];if(N+=t,null==a)return u(),0;if("begin"===_.type&&"end"===r.type&&_.index===r.index&&""===a){if(N+=n.slice(r.index,r.index+1),!i){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=_.rule,t}return 1}if(_=r,"begin"===r.type)return g(r);if("illegal"===r.type&&!o){const e=new Error('Illegal lexeme "'+a+'" for mode "'+(O.className||"<unnamed>")+'"');throw e.mode=O,e}if("end"===r.type){const e=h(r);if(e!==Xg)return e}if("illegal"===r.type&&""===a)return 1;if(D>1e5&&D>3*r.index){throw new Error("potential infinite loop, way more iterations than matches")}return N+=a,a.length}const E=y(e);if(!E)throw qg(a.replace("{}",e)),new Error('Unknown language: "'+e+'"');const v=zg(E,{plugins:r});let S="",O=s||v;const T={},C=new l.__emitter(l);!function(){const e=[];for(let t=O;t!==E;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>C.openNode(e))}();let N="",w=0,A=0,D=0,R=!1;try{for(O.matcher.considerAll();;){D++,R?R=!1:O.matcher.considerAll(),O.matcher.lastIndex=A;const e=O.matcher.exec(n);if(!e)break;const t=b(n.substring(A,e.index),e);A=e.index+t}return b(n.substr(A)),C.closeAllNodes(),C.finalize(),S=C.toHTML(),{relevance:Math.floor(w),value:S,language:e,illegal:!1,emitter:C,top:O}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:n.slice(A-100,A+100),mode:t.mode},sofar:S,relevance:0,value:Kg(n),emitter:C};if(i)return{illegal:!1,relevance:0,value:Kg(n),emitter:C,language:e,top:O,errorRaised:t};throw t}}function p(e,n){n=n||l.languages||Object.keys(t);const r=function(e){const t={relevance:0,emitter:new l.__emitter(l),value:Kg(e),illegal:!1,top:s};return t.emitter.addText(e),t}(e),i=n.filter(y).filter(S).map(t=>d(t,e,!1));i.unshift(r);const o=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(y(e.language).supersetOf===t.language)return 1;if(y(t.language).supersetOf===e.language)return-1}return 0}),[a,c]=o,u=a;return u.second_best=c,u}const m={"before:highlightElement":({el:e})=>{l.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,"\n"))},"after:highlightElement":({result:e})=>{l.useBR&&(e.value=e.value.replace(/\n/g,"<br>"))}},f=/^(<[^>]+>|\t)+/gm,g={"after:highlightElement":({result:e})=>{l.tabReplace&&(e.value=e.value.replace(f,e=>e.replace(/\t/g,l.tabReplace)))}};function h(e){let t=null;const r=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=l.languageDetectRe.exec(t);if(n){const t=y(n[1]);return t||($g(a.replace("{}",n[1])),$g("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>c(e)||y(e))}(e);if(c(r))return;O("before:highlightElement",{el:e,language:r}),t=e;const i=t.textContent,o=r?u(i,{language:r,ignoreIllegals:!0}):p(i);O("after:highlightElement",{el:e,result:o,text:i}),e.innerHTML=o.value,function(e,t,r){const i=t?n[t]:r;e.classList.add("hljs"),i&&e.classList.add(i)}(e,r,o.language),e.result={language:o.language,re:o.relevance,relavance:o.relevance},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.relevance,relavance:o.second_best.relevance})}const _=()=>{if(_.called)return;_.called=!0,Qg("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(h)};let b=!1;function E(){if("loading"===document.readyState)return void(b=!0);document.querySelectorAll("pre code").forEach(h)}function y(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function v(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function S(e){const t=y(e);return t&&!t.disableAutodetect}function O(e,t){const n=e;r.forEach((function(e){e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){b&&E()}),!1),Object.assign(e,{highlight:u,highlightAuto:p,highlightAll:E,fixMarkup:function(e){return Qg("10.2.0","fixMarkup will be removed entirely in v11.0"),Qg("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),t=e,l.tabReplace||l.useBR?t.replace(o,e=>"\n"===e?l.useBR?"<br>":e:l.tabReplace?e.replace(/\t/g,l.tabReplace):e):t;var t},highlightElement:h,highlightBlock:function(e){return Qg("10.7.0","highlightBlock will be removed entirely in v12.0"),Qg("10.7.0","Please use highlightElement now."),h(e)},configure:function(e){e.useBR&&(Qg("10.3.0","'useBR' will be removed entirely in v11.0"),Qg("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),l=Zg(l,e)},initHighlighting:_,initHighlightingOnLoad:function(){Qg("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),b=!0},registerLanguage:function(n,r){let o=null;try{o=r(e)}catch(e){if(qg("Language definition for '{}' could not be registered.".replace("{}",n)),!i)throw e;qg(e),o=s}o.name||(o.name=n),t[n]=o,o.rawDefinition=r.bind(null,e),o.aliases&&v(o.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:y,registerAliases:v,requireLanguage:function(e){Qg("10.4.0","requireLanguage will be removed entirely in v11."),Qg("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const t=y(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:S,inherit:Zg,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),r.push(e)},vuePlugin:Gg(e).VuePlugin}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString="10.7.3";for(const e in Ig)"object"==typeof Ig[e]&&og(Ig[e]);return Object.assign(e,Ig),e.addPlugin(m),e.addPlugin(Yg),e.addPlugin(g),e}({}),eh={exports:{}};!function(e){!function(){var t;function n(e){for(var t,n,r,i,o=1,a=[].slice.call(arguments),s=0,l=e.length,c="",u=!1,d=!1,p=function(){return a[o++]},m=function(){for(var n="";/\d/.test(e[s]);)n+=e[s++],t=e[s];return n.length>0?parseInt(n):null};s<l;++s)if(t=e[s],u)switch(u=!1,"."==t?(d=!1,t=e[++s]):"0"==t&&"."==e[s+1]?(d=!0,t=e[s+=2]):d=!0,i=m(),t){case"b":c+=parseInt(p(),10).toString(2);break;case"c":c+="string"==typeof(n=p())||n instanceof String?n:String.fromCharCode(parseInt(n,10));break;case"d":c+=parseInt(p(),10);break;case"f":r=String(parseFloat(p()).toFixed(i||6)),c+=d?r:r.replace(/^0/,"");break;case"j":c+=JSON.stringify(p());break;case"o":c+="0"+parseInt(p(),10).toString(8);break;case"s":c+=p();break;case"x":c+="0x"+parseInt(p(),10).toString(16);break;case"X":c+="0x"+parseInt(p(),10).toString(16).toUpperCase();break;default:c+=t}else"%"===t?u=!0:c+=t;return c}(t=e.exports=n).format=n,t.vsprintf=function(e,t){return n.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(n.apply(null,arguments))})}()}(eh);var th=eh.exports,nh=ih(Error),rh=nh;function ih(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=th.apply(null,arguments)),new e(t)}}nh.eval=ih(EvalError),nh.range=ih(RangeError),nh.reference=ih(ReferenceError),nh.syntax=ih(SyntaxError),nh.type=ih(TypeError),nh.uri=ih(URIError),nh.create=ih;var oh=Jg,ah=rh;rg.highlight=sh,rg.highlightAuto=function(e,t){var n=t||{},r=n.subset||oh.listLanguages();n.prefix;var i,o,a,s,l=r.length,c=-1;if("string"!=typeof e)throw ah("Expected `string` for value, got `%s`",e);o={relevance:0,language:null,value:[]},i={relevance:0,language:null,value:[]};for(;++c<l;)s=r[c],oh.getLanguage(s)&&((a=sh(s,e,t)).language=s,a.relevance>o.relevance&&(o=a),a.relevance>i.relevance&&(o=i,i=a));o.language&&(i.secondBest=o);return i},rg.registerLanguage=function(e,t){oh.registerLanguage(e,t)},rg.listLanguages=function(){return oh.listLanguages()},rg.registerAlias=function(e,t){var n,r=e;t&&((r={})[e]=t);for(n in r)oh.registerAliases(r[n],{languageName:n})},lh.prototype.addText=function(e){var t,n,r=this.stack;if(""===e)return;t=r[r.length-1],(n=t.children[t.children.length-1])&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})},lh.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},lh.prototype.addSublanguage=function(e,t){var n=this.stack,r=n[n.length-1],i=e.rootNode.children,o=t?{type:"element",tagName:"span",properties:{className:[t]},children:i}:i;r.children=r.children.concat(o)},lh.prototype.openNode=function(e){var t=this.stack,n=this.options.classPrefix+e,r=t[t.length-1],i={type:"element",tagName:"span",properties:{className:[n]},children:[]};r.children.push(i),t.push(i)},lh.prototype.closeNode=function(){this.stack.pop()},lh.prototype.closeAllNodes=ch,lh.prototype.finalize=ch,lh.prototype.toHTML=function(){return""};function sh(e,t,n){var r,i=oh.configure({}),o=(n||{}).prefix;if("string"!=typeof e)throw ah("Expected `string` for name, got `%s`",e);if(!oh.getLanguage(e))throw ah("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw ah("Expected `string` for value, got `%s`",t);if(null==o&&(o="hljs-"),oh.configure({__emitter:lh,classPrefix:o}),r=oh.highlight(t,{language:e,ignoreIllegals:!0}),oh.configure(i||{}),r.errorRaised)throw r.errorRaised;return{relevance:r.relevance,language:r.language,value:r.emitter.rootNode.children}}function lh(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function ch(){}function uh(e){return e.value||e.children||[]}function dh({doc:e,name:t,lowlight:n}){const r=[];return ps(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1;const{language:i}=e.node.attrs,o=n.listLanguages();(function e(t,n=[]){return t.map(t=>{const r=[...n,...t.properties?t.properties.className:[]];return t.children?e(t.children,r):{text:t.value,classes:r}}).flat()})(i&&o.includes(i)?uh(n.highlight(i,e.node.textContent)):uh(n.highlightAuto(e.node.textContent))).forEach(e=>{const n=t+e.text.length;if(e.classes.length){const i=vi.inline(t,n,{class:e.classes.join(" ")});r.push(i)}t=n})}),Ci.create(e,r)}function ph({name:e,lowlight:t}){return new Tt({key:new wt("lowlight"),state:{init:(n,{doc:r})=>dh({doc:r,name:e,lowlight:t}),apply:(n,r,i,o)=>{const a=i.selection.$head.parent.type.name,s=o.selection.$head.parent.type.name,l=ps(i.doc,t=>t.type.name===e),c=ps(o.doc,t=>t.type.name===e);return n.docChanged&&([a,s].includes(e)||c.length!==l.length||n.steps.some(e=>void 0!==e.from&&void 0!==e.to&&l.some(t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))?dh({doc:n.doc,name:e,lowlight:t}):r.map(n.mapping,n.doc)}},props:{decorations(e){return this.getState(e)}}})}const mh=om.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:rg}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],ph({name:this.name,lowlight:this.options.lowlight})]}});function fh(){return l.a.createElement(Ac,null,l.a.createElement("pre",null,l.a.createElement(Dc,{as:"code"})))}var gh=n(51),hh=n.n(gh),_h=mh.extend({addNodeView:function(){return new Tc(fh)}}).configure({lowlight:hh.a}),bh=function(e){var t=e.items,n=e.command;return l.a.createElement("div",{className:"shadow-md"},l.a.createElement(Bu,{variables:t,onClickVariable:function(e){var t=e.category_key,r=e.key,i=t?"".concat(t,".").concat(r):r;n({label:i,id:i})}}))};function Eh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Eh(Object(n),!0).forEach((function(t){vh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Eh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Sh=new wt("variables"),Oh=ns.create({name:"variable",addOptions:function(){return{HTMLAttributes:{class:"variable__text"},charOpen:"{{",charClose:"}}",renderLabel:function(e){var t=e.options,n=e.node;return"".concat(t.charOpen).concat(n.attrs.label||n.attrs.id).concat(t.charClose)},suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:function(){return{id:{default:null,parseHTML:function(e){return e.getAttribute("data-id")},renderHTML:function(e){return e.id?{"data-id":e.id}:{}}},label:{default:null,parseHTML:function(e){return e.getAttribute("data-label")},renderHTML:function(e){return e.label?{"data-label":e.label}:{}}}}},parseHTML:function(){return[{tag:"span[data-variable]"}]},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes;return["span",Qa({"data-variable":""},this.options.HTMLAttributes,n),this.options.renderLabel({options:this.options,node:t})]},renderText:function(e){var t=e.node;return this.options.renderLabel({options:this.options,node:t})},addCommands:function(){var e=this;return{setVariable:function(t){return function(n){(0,n.chain)().focus().insertContent([{type:e.name,attrs:t},{type:"text",text:" "}]).run()}}}},addKeyboardShortcuts:function(){var e=this;return{Backspace:function(){return e.editor.commands.command((function(t){var n=t.tr,r=t.state,i=!1,o=r.selection,a=o.empty,s=o.anchor;return!!a&&(r.doc.nodesBetween(s-1,s,(function(t,r){if(t.type.name===e.name)return i=!0,n.insertText("",r,r+t.nodeSize),!1})),i)}))}}},addProseMirrorPlugins:function(){return[Zf(yh({editor:this.editor},this.options.suggestion))]}}),Th={char:"{{",startOfLine:!1,pluginKey:Sh,command:function(e){var t=e.editor,n=e.range,r=e.props;t.chain().focus().deleteRange(n).setVariable(r).run()},items:function(){return[]},render:function(){var e,t;return{onStart:function(n){e=new yc(bh,{props:n,editor:n.editor}),t=uc("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onExit:function(){t[0].destroy(),e.destroy()}}}},Ch=function(e){var t=e.suggestion,n=void 0===t?{}:t;return Oh.configure({suggestion:yh(yh({},Th),n)})},Nh=n(52),wh=n.n(Nh);function Ah(e){return(Ah="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Dh=function(e){var t=Ah(e);return"string"===t||"funtion"===t?e:wh()(e)?function(t){var n=t.node.type.name;return e[n]}:""},Rh=lo.create({name:"placeholder",addOptions:function(){return{excludeNodeTypes:["variable","codeBlock"],emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins:function(){var e=this;return[new Tt({props:{decorations:function(t){var n=t.doc,r=t.selection,i=e.editor.isEditable||!e.options.showOnlyWhenEditable,o=r.anchor,a=[];if(i)return n.descendants((function(t,n){var r=o>=n&&o<=n+t.nodeSize,i=!t.isLeaf&&!t.childCount,s=e.options.excludeNodeTypes.includes(t.type.name);if((r||!e.options.showOnlyCurrent)&&!s&&i){var l=[e.options.emptyNodeClass];e.editor.isEmpty&&l.push(e.options.emptyEditorClass);var c=vi.node(n,n+t.nodeSize,{class:l.join(" "),"data-placeholder":"function"==typeof e.options.placeholder?e.options.placeholder({editor:e.editor,node:t,pos:n}):e.options.placeholder});a.push(c)}return e.options.includeChildren})),Ci.create(n,a)}}})]}});const xh=new wt("suggestion");function Mh({pluginKey:e=xh,editor:t,char:n="@",allowSpaces:r=!1,prefixSpace:i=!0,startOfLine:o=!1,decorationTag:a="span",decorationClass:s="suggestion",command:l=(()=>null),items:c=(()=>[]),render:u=(()=>({})),allow:d=(()=>!0)}){const p=null==u?void 0:u();return new Tt({key:e,view(){return{update:async(e,n)=>{var r,i,o,a,s;const u=null===(r=this.key)||void 0===r?void 0:r.getState(n),d=null===(i=this.key)||void 0===i?void 0:i.getState(e.state),m=u.active&&d.active&&u.range.from!==d.range.from,f=!u.active&&d.active,g=u.active&&!d.active,h=f||m,_=!f&&!g&&u.query!==d.query&&!m,b=g||m;if(!h&&!_&&!b)return;const E=b&&!h?u:d,y=document.querySelector(`[data-decoration-id="${E.decorationId}"]`),v={editor:t,range:E.range,query:E.query,text:E.text,items:_||h?await c({editor:t,query:E.query}):[],command:e=>{l({editor:t,range:E.range,props:e})},decorationNode:y,clientRect:y?()=>{var e;const{decorationId:n}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${n}"]`).getBoundingClientRect()}:null};b&&(null===(o=null==p?void 0:p.onExit)||void 0===o||o.call(p,v)),_&&(null===(a=null==p?void 0:p.onUpdate)||void 0===a||a.call(p,v)),h&&(null===(s=null==p?void 0:p.onStart)||void 0===s||s.call(p,v))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,a){const{composing:s}=t.view,{selection:l}=e,{empty:c,from:u}=l,p={...a};if(p.composing=s,c||t.view.composing){!(u<a.range.from||u>a.range.to)||s||a.composing||(p.active=!1);const e=function(e){const{char:t,allowSpaces:n,prefixSpace:r,startOfLine:i,$position:o}=e,a=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${a}$`),l=i?"^":"",c=n?new RegExp(`${l}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${l}(?:^)?${a}[^\\s${a}]*`,"gm"),u=o.depth<=0?0:o.before(),d=o.pos,p=o.doc.textBetween(u,d,"\0","\0"),m=Array.from(p.matchAll(c)).pop();if(!m||void 0===m.input||void 0===m.index)return null;const f=m.input.slice(Math.max(0,m.index-1),m.index),g=/^[\s\0]?$/.test(f);if(r&&!g)return null;const h=m.index+o.start();let _=h+m[0].length;return n&&s.test(p.slice(_-1,_+1))&&(m[0]+=" ",_+=1),h<o.pos&&_>=o.pos?{range:{from:h,to:_},query:m[0].slice(t.length),text:m[0]}:null}({char:n,allowSpaces:r,prefixSpace:i,startOfLine:o,$position:l.$from}),c="id_"+Math.floor(4294967295*Math.random());e&&d({editor:t,range:e.range})?(p.active=!0,p.decorationId=a.decorationId?a.decorationId:c,p.range=e.range,p.query=e.query,p.text=e.text):p.active=!1}else p.active=!1;return p.active||(p.decorationId=null,p.range={},p.query=null,p.text=null),p}},props:{handleKeyDown(e,t){var n;const{active:r,range:i}=this.getState(e.state);return r&&(null===(n=null==p?void 0:p.onKeyDown)||void 0===n?void 0:n.call(p,{view:e,event:t,range:i}))||!1},decorations(e){const{active:t,range:n,decorationId:r}=this.getState(e);return t?Ci.create(e.doc,[vi.inline(n.from,n.to,{nodeName:a,class:s,"data-decoration-id":r})]):null}}})}const Ih=new wt("mention"),kh=ns.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var n;return`${e.suggestion.char}${null!==(n=t.attrs.label)&&void 0!==n?n:t.attrs.id}`},suggestion:{char:"@",pluginKey:Ih,command:({editor:e,range:t,props:n})=>{var r;const i=e.view.state.selection.$to.nodeAfter;(null===(r=null==i?void 0:i.text)||void 0===r?void 0:r.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:n},{type:"text",text:" "}]).run()},allow:({editor:e,range:t})=>{const n=e.state.doc.resolve(t.from),r=e.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML:()=>[{tag:"span[data-mention]"}],renderHTML({node:e,HTMLAttributes:t}){return["span",Qa({"data-mention":""},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})]},renderText({node:e}){return this.options.renderLabel({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let n=!1;const{selection:r}=t,{empty:i,anchor:o}=r;return!!i&&(t.doc.nodesBetween(o-1,o,(t,r)=>{if(t.type.name===this.name)return n=!0,e.insertText(this.options.suggestion.char||"",r,r+t.nodeSize),!1}),n)})}},addProseMirrorPlugins(){return[Mh({editor:this.editor,...this.options.suggestion})]}});var Lh=["size","user","isSquare","status","onClick","className"];function Ph(){return(Ph=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Fh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return jh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Uh(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Bh={small:24,medium:32,large:40,xlarge:64},zh=["#E5E7EB","#FECACA","#FDE68A","#A7F3D0","#BFDBFE","#C7D2FE","#DDD6FE","#FBCFE8"];function Gh(e){var t,n,r=e.size,i=e.user,o=e.isSquare,a=e.status,c=e.onClick,d=e.className,p=Uh(e,Lh),m=Fh(Object(s.useState)(!1),2),f=m[0],g=m[1],h=i.name,_=void 0===h?"":h,b=i.imageUrl,E="medium"===r,y="large"===r,v="xlarge"===r,S=(t=_.trim().split(" ")).reduce((function(e,n,r){return 0!==r&&r!==t.length-1||(e="".concat(e).concat(n.charAt(0).toUpperCase())),e}),""),O={height:Bh[r],width:Bh[r],backgroundColor:(n=(S.charCodeAt(0)||0)+(S.charCodeAt(1)||0),zh[n%65%zh.length]||zh[0])},T=u()("neeto-ui-avatar",{"neeto-ui-avatar--medium":E,"neeto-ui-avatar--large":y,"neeto-ui-avatar--xlarge":v,"neeto-ui-avatar--round":!o,hidden:!f}),C=u()("neeto-ui-avatar__text",{"neeto-ui-avatar__text-medium":E,"neeto-ui-avatar__text-large":y,"neeto-ui-avatar__text-xlarge":v}),N=u()("neeto-ui-avatar__status","".concat(a),{"neeto-ui-avatar__status-medium":E,"neeto-ui-avatar__status-large":y,"neeto-ui-avatar__status-xlarge":v,"neeto-ui-avatar__status-square":o}),w=function(){return null==a?l.a.Fragment:l.a.createElement("span",{className:N})},A=function(){return l.a.createElement("span",{className:C},S)},D=S&&!b&&!f;return l.a.createElement("div",Ph({onClick:c,style:O,className:u()("neeto-ui-avatar--container",{"neeto-ui-avatar--container-round":!o},d)},p),l.a.createElement(w,null),D?l.a.createElement(A,null):l.a.createElement("img",{className:T,onLoad:function(){return g(!0)},onError:function(){return g(!1)},src:b,alt:"avatar-".concat(S)}))}Gh.defaultProps={size:"medium",user:{imageUrl:"",name:""},isSquare:!1,onClick:function(){},status:null},Gh.propTypes={size:Fc.a.oneOf(Object.keys(Bh)),user:Fc.a.shape({imageUrl:Fc.a.string,name:Fc.a.string}),isSquare:Fc.a.bool,onClick:Fc.a.func,status:Fc.a.oneOf(Object.keys({online:"online",idle:"idle",offline:"offline"})),className:Fc.a.string};var Yh=Gh;function Hh(e){return(Hh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qh(e,t){return(qh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Zh(e);if(t){var i=Zh(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Qh(this,n)}}function Qh(e,t){if(t&&("object"===Hh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Kh(e)}function Kh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zh(e){return(Zh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Xh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Jh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qh(e,t)}(o,e);var t,n,r,i=$h(o);function o(){var e;Wh(this,o);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Xh(Kh(e=i.call.apply(i,[this].concat(n))),"state",{selectedIndex:0}),Xh(Kh(e),"selectItem",(function(t){var n=e.props,r=n.items,i=n.command,o=r[t];o&&i({label:o.label,id:o.key})})),Xh(Kh(e),"upHandler",(function(){var t=e.props.items;e.setState((function(e){return{selectedIndex:(e.selectedIndex+t.length-1)%t.length}}))})),Xh(Kh(e),"downHandler",(function(){var t=e.props.items;e.setState((function(e){return{selectedIndex:(e.selectedIndex+1)%t.length}}))})),Xh(Kh(e),"enterHandler",(function(){var t=e.state.selectedIndex;e.selectItem(t)})),Xh(Kh(e),"onKeyDown",(function(t){var n=t.event,r={ArrowUp:e.upHandler,ArrowDown:e.downHandler,Enter:e.enterHandler};return!!r.hasOwnProperty(n.key)&&(r[n.key](),!0)})),e}return t=o,(n=[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0})}},{key:"render",value:function(){var e=this,t=this.state.selectedIndex,n=this.props.items;return l.a.createElement("div",{className:"relative p-2 space-y-1 overflow-hidden rounded shadow editor-command-list--root"},n.map((function(n,r){var i=n.label,o=n.imageUrl,a=n.showImage;return l.a.createElement("button",{className:u()("flex items-center w-full px-4 py-2 transition-all duration-100 ease-in-out cursor-pointer text-xs text-white rounded editor-command-list--item",{selected_item:r===t}),key:i,onClick:function(){return e.selectItem(r)}},a?l.a.createElement(Yh,{user:{name:i,imageUrl:o},className:"mr-2"}):null,l.a.createElement("span",null,i))})))}}])&&Vh(t.prototype,n),r&&Vh(t,r),o}(l.a.Component);function e_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?e_(Object(n),!0).forEach((function(t){n_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function n_(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r_(e){return(r_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?5:n,i=t.showImage,o=void 0!==i&&i,a=e.map((function(e){var t;return"string"==typeof e?t={key:e,label:e}:"object"===r_(e)&&(t=t_({},e)),t.showImage=o,t}));return function(e){var t=e.query;return a.filter((function(e){return e.label.toLowerCase().startsWith(t.toLowerCase())})).slice(0,r)}},o_=["suggestion"];function a_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a_(Object(n),!0).forEach((function(t){l_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l_(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c_(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var u_={render:function(){var e,t;return{onStart:function(n){e=new yc(Jh,{props:n,editor:n.editor}),t=uc("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown:function(n){var r;return"Escape"===n.event.key?(t[0].hide(),!0):null===(r=e.ref)||void 0===r?void 0:r.onKeyDown(n)},onExit:function(){t[0].destroy(),e.destroy()}}}},d_=function(e){var t=e.suggestion,n=void 0===t?{}:t,r=c_(e,o_);return kh.configure(s_(s_({},r),{},{suggestion:s_(s_({},u_),n)}))},p_=ns.create({name:"external-video",addOptions:function(){return{inline:!1,HTMLAttributes:{}}},inline:function(){return this.options.inline},group:function(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:function(){return{src:{default:null},title:{default:null},frameborder:{default:"0"},allow:{default:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"},allowfullscreen:{default:"allowfullscreen"}}},parseHTML:function(){return[{tag:"iframe[src]"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["div",{class:"video-wrapper"},["iframe",Qa(this.options.HTMLAttributes,t)]]},addCommands:function(){var e=this;return{setExternalVideo:function(t){return function(n){return n.commands.insertContent({type:e.name,attrs:t})}}}}});function m_(e){return function(e){if(Array.isArray(e))return f_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return f_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f_(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var g_=["forceTitle","hideSlashCommands","formatterOptions","className","uploadEndpoint","initialValue","onChange","menuType","variables","mentions","showImageInMention","placeholder","extensions","contentClassName"];function h_(){return(h_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function __(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return b_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b_(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E_(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var y_=function(e,t){var n,r,i,o=e.forceTitle,a=void 0!==o&&o,c=e.hideSlashCommands,d=void 0!==c&&c,p=e.formatterOptions,m=void 0===p?["bold","italic","underline","code","highlight","strike","link"]:p,f=e.className,g=e.uploadEndpoint,h=e.initialValue,_=void 0===h?"":h,b=e.onChange,E=void 0===b?function(){}:b,y=e.menuType,v=void 0===y?"fixed":y,S=e.variables,O=e.mentions,T=e.showImageInMention,C=void 0!==T&&T,N=e.placeholder,w=e.extensions,A=e.contentClassName,D=E_(e,g_),R=__(Object(s.useState)(!1),2),x=R[0],M=R[1],I="fixed"===v,k="bubble"===v,L=!d,P=!N&&L,F=function(e){var t,n=e.forceTitle,r=e.placeholder,i=e.extensions,o=e.mentions,a=e.variables,s=e.isSlashCommandsActive,l=e.showImageInMention,c=e.setImageUploadVisible;return i?t=m_(i):(t=[xf.extend({content:n?"heading block*":"block+"}),Xm.configure({document:!1,codeBlock:!1}),jf,vf,wf,Tf,_h,Ff,lm,p_,Nf,Af,Rh.configure({placeholder:Dh(r)})],s&&t.push(ng({setImageUploadVisible:c})),Rf()(o)||t.push(d_({suggestion:{items:i_(o,{showImage:l})}})),Rf()(a)||t.push(Ch({suggestion:{items:function(){return a}}}))),t}({contentClassName:A,forceTitle:a,placeholder:N,extensions:w,mentions:O,variables:S,isSlashCommandsActive:L,showImageInMention:C,setImageUploadVisible:M}),j=Ec({extensions:F,content:_,injectCSS:!1,editorProps:{attributes:{class:f||u()("focus:outline-none whitespace-pre-wrap border p-3",(n={"slash-active":P,"fixed-menu-active":I,"bubble-menu-active":k},r=f,i=f,r in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,n))}},onUpdate:function(e){var t=e.editor;return E(t.getHTML())}});return l.a.useImperativeHandle(t,(function(){return{editor:j}})),l.a.createElement("div",null,I?l.a.createElement(rp,{editor:j,variables:S,setImageUploadVisible:M}):null,k?l.a.createElement(kc,{editor:j,formatterOptions:m}):null,l.a.createElement(Hp,{isVisible:x,setIsVisible:M,editor:j,imageUploadUrl:g}),l.a.createElement(wc,h_({editor:j},D)))},v_=l.a.forwardRef(y_),S_=n(53),O_=n.n(S_);var T_=n(54),C_=n.n(T_),N_=["content","classNames"];function w_(){return(w_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function A_(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var D_=function(e){var t,n,r,i=e.content,o=void 0===i?"":i,a=e.classNames,c=A_(e,N_);return Object(s.useEffect)((function(){document.querySelectorAll("div.".concat("neeto-editor-content"," pre code")).forEach((function(e){O_.a.highlightElement(e)}))}),[o]),l.a.createElement("div",w_({className:(u()("neeto-editor-content"),t={},n=a,r=a,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t),dangerouslySetInnerHTML:{__html:C_.a.sanitize(o)}},c))}}])}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-editor",
3
- "version": "0.2.15",
3
+ "version": "0.2.16",
4
4
  "main": "./build/index.js",
5
5
  "description": "Neeto Editor is the library that drives the rich text experience in all Neeto products built at BigBinary",
6
6
  "keywords": [