@bigbinary/neeto-editor 0.3.12 → 0.3.13

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
@@ -56,4 +56,4 @@ function cd(e,t){if(!e)throw new Error(t)}const _d=Object(p.createContext)(null)
56
56
  * LICENSE.md file in the root directory of this source tree.
57
57
  *
58
58
  * @license MIT
59
- */;function Dd(){return(Dd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function Cd(e,t){if(null==e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}const wd=["onClick","reloadDocument","replace","state","target","to"],Sd=["aria-current","caseSensitive","className","end","style","to"];const Od=Object(p.forwardRef)((function(e,t){let{onClick:n,reloadDocument:i,replace:r=!1,state:a,target:o,to:s}=e,l=Cd(e,wd),u=hd(s),d=function(e,t){let{target:n,replace:i,state:r}=void 0===t?{}:t,a=Fd(),o=md(),s=bd(e);return Object(p.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=!!i||ud(o)===ud(s);a(e,{replace:n,state:r})}},[o,a,s,i,r,n,e])}(s,{replace:r,state:a,target:o});return Object(p.createElement)("a",Dd({},l,{href:u,onClick:function(e){n&&n(e),e.defaultPrevented||i||d(e)},ref:t,target:o}))}));const xd=Object(p.forwardRef)((function(e,t){let{"aria-current":n="page",caseSensitive:i=!1,className:r="",end:a=!1,style:o,to:s}=e,l=Cd(e,Sd),u=md(),d=bd(s),c=u.pathname,_=d.pathname;i||(c=c.toLowerCase(),_=_.toLowerCase());let f,g=c===_||!a&&c.startsWith(_)&&"/"===c.charAt(_.length),h=g?n:void 0;f="function"==typeof r?r({isActive:g}):[r,g?"active":null].filter(Boolean).join(" ");let m="function"==typeof o?o({isActive:g}):o;return Object(p.createElement)(Od,Dd({},l,{"aria-current":h,className:f,ref:t,style:m,to:s}))}));var Td=["icon","iconPosition","iconSize","label","loading","onClick","to","type","style","fullWidth","className","disabled","size","href","tooltipProps"],Nd=function(){},Ad="primary",Md="secondary",Rd="danger",Id="text",Ld="link",Bd="large",Pd="left",jd=Object(p.forwardRef)((function(e,t){var n,i,r=e.icon,a=void 0===r?null:r,o=e.iconPosition,s=void 0===o?"right":o,l=e.iconSize,d=void 0===l?16:l,c=e.label,_=void 0===c?"":c,f=e.loading,g=void 0!==f&&f,p=e.onClick,F=void 0===p?Nd:p,y=e.to,E=void 0===y?null:y,v=e.type,k=void 0===v?"button":v,D=e.style,C=void 0===D?"primary":D,w=e.fullWidth,S=void 0!==w&&w,O=e.className,x=void 0===O?"":O,T=e.disabled,N=void 0!==T&&T,A=e.size,M=void 0===A?null:A,R=e.href,I=void 0===R?null:R,L=e.tooltipProps,B=void 0===L?null:L,P=h()(e,Td);E?(n=Od,i={to:E}):I?(n="a",i={href:I}):(n="button",i={type:k});var j="string"==typeof a?function(){return m.a.createElement("i",{className:b()("ne-btn__icon",[a])})}:a||m.a.Fragment;return m.a.createElement(rd,u()({},B,{disabled:!B}),m.a.createElement(n,u()({ref:t,onClick:function(e){g||N||F(e)},className:b()("ne-btn",[x],{"ne-btn--style-primary":C===Ad,"ne-btn--style-secondary":C===Md,"ne-btn--style-danger":C===Rd,"ne-btn--style-text":C===Id,"ne-btn--style-link":C===Ld,"ne-btn--size-large":M===Bd,"ne-btn--width-full":S,"ne-btn--icon-left":s==Pd,"ne-btn--icon-only":!_,disabled:N}),disabled:N},i,P),_&&m.a.createElement("span",null,_),a?m.a.createElement(j,{key:"2",size:d,className:"ne-btn__icon"}):null))}));jd.displayName="Button";var qd=jd,Ud=/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/,zd=/^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,Hd=/((?:http|https):\/\/)?(www\.|player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|(?:manage\/)?videos?\/|)(\d+)(?:(?:\/|\?h=)(\w+))?(?:|\/\?)/,Wd=function(e){var t=e.editor,n=e.handleClose,i=e.handleAnimateInvalidLink,r=Object(p.useState)(""),a=f()(r,2),o=a[0],s=a[1];Object(p.useEffect)((function(){s(t.getAttributes("link").href||"")}),[]);var l=function(){Ud.test(o)?(t.chain().focus().setLink({href:o}).run(),n()):od()(o)?(t.chain().focus().unsetLink().run(),n()):(s(""),i())};return m.a.createElement("div",{onKeyDown:function(e){"Escape"===e.key?n():"Enter"===e.key&&l()},className:"neeto-editor-bubble-menu__link"},m.a.createElement("input",{autoFocus:!0,name:"url",value:o,placeholder:"Paste or type a link...",onChange:function(e){var t=e.target.value;return s(t)},className:"neeto-editor-bubble-menu-link__input","data-cy":"neeto-editor-link-input"}),m.a.createElement(qd,{style:"icon",icon:Uu.Close,onClick:function(){o?(s(""),t.chain().focus().unsetLink().run()):n()},"data-cy":"neeto-editor-link-submit-button"}))};function Gd(e){var t=e.editor,n=e.options,i=Object(p.useState)(!1),r=f()(i,2),a=r[0],o=r[1],s=Object(p.useState)(!1),l=f()(s,2),d=l[0],c=l[1];if(!t)return null;var _=[{Icon:Uu.TextBold,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:Uu.TextItalic,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:Uu.Underline,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline"},{Icon:Uu.TextCross,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:Uu.Link,command:function(){o(!0)},active:t.isActive("link"),optionName:"link"},{Icon:Uu.Code,command:function(){return t.chain().focus().toggleCode().run()},active:t.isActive("code"),optionName:"code-block"},{Icon:Uu.Highlight,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}];return m.a.createElement(wu,{editor:t,tippyOptions:{arrow:'<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',placement:"top-start",zIndex:99999,onHide:function(){return o(!1)}},className:b()("neeto-editor-bubble-menu",{"neeto-editor-bubble-menu-animate-shake":d})},a?m.a.createElement(Wd,{editor:t,handleClose:function(){return o(!1)},handleAnimateInvalidLink:function(){c(!0);var e=setTimeout((function(){c(!1),clearTimeout(e)}),1e3)}}):_.filter((function(e){var t=e.optionName;return n.includes(t)})).map((function(e){return m.a.createElement(Yd,u()({},e,{key:e.optionName}))})))}var Yd=function(e){var t=e.Icon,n=e.command,i=e.active,r=e.optionName;return m.a.createElement(rd,{content:ju(r),position:"top",delay:[500]},m.a.createElement("div",{className:b()("neeto-editor-bubble-menu__item",{active:i}),onClick:n,"data-cy":"neeto-editor-bubble-menu-".concat(r,"-option")},m.a.createElement(t,{size:20})))},Vd=n(1),$d=n.n(Vd),Kd=["icon","iconActive","tooltipProps"],Qd=function(e){var t=e.icon,n=e.iconActive,i=void 0===n||n,r=e.tooltipProps,a=h()(e,Kd);return m.a.createElement(rd,r,m.a.createElement("button",u()({className:"neeto-editor-fixed-menu__item",type:"button"},a),m.a.createElement(t,{color:i?"#2F3941":"#87929D",size:20})))};Qd.propTypes={icon:$d.a.oneOfType([$d.a.element,$d.a.func]),iconActive:$d.a.bool,onClick:$d.a.func,tooltipProps:$d.a.object};var Zd=Qd,Xd=["size","color","underlineColor"];function Jd(e){var t=e.size,n=e.color,i=e.underlineColor,r=h()(e,Xd);return m.a.createElement("svg",u()({viewBox:"0 0 24 24",fill:"none",height:t,width:t},r),m.a.createElement("path",{d:"M21 20H3",stroke:i||n,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M17.3125 15L12.1562 4L7 15M8.03125 12.8H16.2812",stroke:n,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}Jd.defaultProps={color:"currentColor",size:24},Jd.propTypes={color:$d.a.string,size:$d.a.oneOfType([$d.a.string,$d.a.number])};var ec=["size","color","bgColor"];function tc(e){var t=e.size,n=e.color,i=e.bgColor,r=h()(e,ec);return m.a.createElement("svg",u()({viewBox:"0 0 24 24",fill:"none",height:t,width:t},r),m.a.createElement("path",{d:"M21 7V17C21 19.209 19.209 21 17 21H7C4.791 21 3 19.209 3 17V7C3 4.791 4.791 3 7 3H17C19.209 3 21 4.791 21 7Z",fill:i,stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M10 8V16",stroke:n,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M14 8V16",stroke:n,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M8 14H16",stroke:n,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M8 10H16",stroke:n,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}))}tc.defaultProps={color:"white",bgColor:"#68737D",size:24},tc.propTypes={color:$d.a.string,bgColor:$d.a.string,size:$d.a.oneOfType([$d.a.string,$d.a.number])};var nc=function(e){var t=e.color,n=void 0===t?"#000":t,i=e.onChange,r=Object(p.useRef)();return m.a.createElement(Zd,{icon:function(e){var t=e.color,a=e.size;return m.a.createElement(m.a.Fragment,null,m.a.createElement(Jd,{size:a,color:t,underlineColor:n}),m.a.createElement("input",{ref:r,type:"color",onChange:function(e){return i&&i(e.target.value)}}))},iconActive:!1,onClick:function(){var e;return null===(e=r.current)||void 0===e?void 0:e.click()},tooltipProps:{content:"Text Color",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-text-color-option"})},ic=n(89),rc=n.n(ic),ac=function(e){return e.reduce((function(e,t){var n=t[0],i=t[1];return e[n]=i,e}),{})},oc="undefined"!=typeof window&&window.document&&window.document.createElement?p.useLayoutEffect:p.useEffect,sc=[],lc="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function uc(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function dc(e,t){for(var n=t.slice(0,t.length-1),i=0;i<n.length;i++)n[i]=e[n[i].toLowerCase()];return n}function cc(e){"string"!=typeof e&&(e="");for(var t=(e=e.replace(/\s/g,"")).split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}for(var _c={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":lc?173:189,"=":lc?61:187,";":lc?59:186,"'":222,"[":219,"]":221,"\\":220},fc={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},gc={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},hc={16:!1,18:!1,17:!1,91:!1},pc={},mc=1;mc<20;mc++)_c["f".concat(mc)]=111+mc;var Fc=[],bc="all",yc=[],Ec=function(e){return _c[e.toLowerCase()]||fc[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function vc(e){bc=e||"all"}function kc(){return bc||"all"}var Dc=function(e){var t=e.key,n=e.scope,i=e.method,r=e.splitKey,a=void 0===r?"+":r;cc(t).forEach((function(e){var t=e.split(a),r=t.length,o=t[r-1],s="*"===o?"*":Ec(o);if(pc[s]){n||(n=kc());var l=r>1?dc(fc,t):[];pc[s]=pc[s].map((function(e){return(!i||e.method===i)&&e.scope===n&&function(e,t){for(var n=e.length>=t.length?e:t,i=e.length>=t.length?t:e,r=!0,a=0;a<n.length;a++)-1===i.indexOf(n[a])&&(r=!1);return r}(e.mods,l)?{}:e}))}}))};function Cc(e,t,n){var i;if(t.scope===n||"all"===t.scope){for(var r in i=t.mods.length>0,hc)Object.prototype.hasOwnProperty.call(hc,r)&&(!hc[r]&&t.mods.indexOf(+r)>-1||hc[r]&&-1===t.mods.indexOf(+r))&&(i=!1);(0!==t.mods.length||hc[16]||hc[18]||hc[17]||hc[91])&&!i&&"*"!==t.shortcut||!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function wc(e){var t=pc["*"],n=e.keyCode||e.which||e.charCode;if(Sc.filter.call(this,e)){if(93!==n&&224!==n||(n=91),-1===Fc.indexOf(n)&&229!==n&&Fc.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var n=gc[t];e[t]&&-1===Fc.indexOf(n)?Fc.push(n):!e[t]&&Fc.indexOf(n)>-1?Fc.splice(Fc.indexOf(n),1):"metaKey"===t&&e[t]&&3===Fc.length&&(e.ctrlKey||e.shiftKey||e.altKey||(Fc=Fc.slice(Fc.indexOf(n))))})),n in hc){for(var i in hc[n]=!0,fc)fc[i]===n&&(Sc[i]=!0);if(!t)return}for(var r in hc)Object.prototype.hasOwnProperty.call(hc,r)&&(hc[r]=e[gc[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===Fc.indexOf(17)&&Fc.push(17),-1===Fc.indexOf(18)&&Fc.push(18),hc[17]=!0,hc[18]=!0);var a=kc();if(t)for(var o=0;o<t.length;o++)t[o].scope===a&&("keydown"===e.type&&t[o].keydown||"keyup"===e.type&&t[o].keyup)&&Cc(e,t[o],a);if(n in pc)for(var s=0;s<pc[n].length;s++)if(("keydown"===e.type&&pc[n][s].keydown||"keyup"===e.type&&pc[n][s].keyup)&&pc[n][s].key){for(var l=pc[n][s],u=l.splitKey,d=l.key.split(u),c=[],_=0;_<d.length;_++)c.push(Ec(d[_]));c.sort().join("")===Fc.sort().join("")&&Cc(e,l,a)}}}function Sc(e,t,n){Fc=[];var i=cc(e),r=[],a="all",o=document,s=0,l=!1,u=!0,d="+";for(void 0===n&&"function"==typeof t&&(n=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(a=t.scope),t.element&&(o=t.element),t.keyup&&(l=t.keyup),void 0!==t.keydown&&(u=t.keydown),"string"==typeof t.splitKey&&(d=t.splitKey)),"string"==typeof t&&(a=t);s<i.length;s++)r=[],(e=i[s].split(d)).length>1&&(r=dc(fc,e)),(e="*"===(e=e[e.length-1])?"*":Ec(e))in pc||(pc[e]=[]),pc[e].push({keyup:l,keydown:u,scope:a,mods:r,shortcut:i[s],method:n,key:i[s],splitKey:d});void 0!==o&&!function(e){return yc.indexOf(e)>-1}(o)&&window&&(yc.push(o),uc(o,"keydown",(function(e){wc(e)})),uc(window,"focus",(function(){Fc=[]})),uc(o,"keyup",(function(e){wc(e),function(e){var t=e.keyCode||e.which||e.charCode,n=Fc.indexOf(t);if(n>=0&&Fc.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&Fc.splice(0,Fc.length),93!==t&&224!==t||(t=91),t in hc)for(var i in hc[t]=!1,fc)fc[i]===t&&(Sc[i]=!1)}(e)})))}var Oc={setScope:vc,getScope:kc,deleteScope:function(e,t){var n,i;for(var r in e||(e=kc()),pc)if(Object.prototype.hasOwnProperty.call(pc,r))for(n=pc[r],i=0;i<n.length;)n[i].scope===e?n.splice(i,1):i++;kc()===e&&vc(t||"all")},getPressedKeyCodes:function(){return Fc.slice(0)},isPressed:function(e){return"string"==typeof e&&(e=Ec(e)),-1!==Fc.indexOf(e)},filter:function(e){var t=e.target||e.srcElement,n=t.tagName,i=!0;return!t.isContentEditable&&("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n||t.readOnly)||(i=!1),i},unbind:function(e){if(e){if(Array.isArray(e))e.forEach((function(e){e.key&&Dc(e)}));else if("object"==typeof e)e.key&&Dc(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r=n[0],a=n[1];"function"==typeof r&&(a=r,r=""),Dc({key:e,scope:r,method:a,splitKey:"+"})}}else Object.keys(pc).forEach((function(e){return delete pc[e]}))}};for(var xc in Oc)Object.prototype.hasOwnProperty.call(Oc,xc)&&(Sc[xc]=Oc[xc]);if("undefined"!=typeof window){var Tc=window.hotkeys;Sc.noConflict=function(e){return e&&window.hotkeys===Sc&&(window.hotkeys=Tc),Sc},window.hotkeys=Sc}var Nc=Sc;Nc.filter=function(){return!0};var Ac=function(e,t){var n=e.target,i=n&&n.tagName;return Boolean(i&&t&&t.includes(i))};function Mc(e,t,n,i){n instanceof Array&&(i=n,n=void 0);var r=n||{},a=r.enableOnTags,o=r.filter,s=r.keyup,l=r.keydown,u=r.filterPreventDefault,d=void 0===u||u,c=r.enabled,_=void 0===c||c,f=r.enableOnContentEditable,g=void 0!==f&&f,h=Object(p.useRef)(null),m=Object(p.useCallback)((function(e,n){var i;return o&&!o(e)?!d:!!(Ac(e,["INPUT","TEXTAREA","SELECT"])&&!Ac(e,a)||null!=(i=e.target)&&i.isContentEditable&&!g)||(null===h.current||document.activeElement===h.current)&&(t(e,n),!0)}),i?[h,a,o].concat(i):[h,a,o]);return Object(p.useEffect)((function(){if(_)return s&&!0!==l&&(n.keydown=!1),Nc(e,n||{},m),function(){return Nc.unbind(e,m)};Nc.unbind(e,m)}),[m,e,_]),h}Nc.isPressed;var Rc=function(e,t){Object(p.useEffect)((function(){var n=function(n){e.current&&!e.current.contains(n.target)&&t(n)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),function(){document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}}),[e,t])},Ic=["icon","label","isOpen","onVisible","onClose","ulProps","position","children","className","buttonStyle","buttonProps","customTarget","disabled","closeOnEsc","closeOnSelect","closeOnOutsideClick","dropdownModifiers"];function Lc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Bc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lc(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Pc=function(){},jc=Object(p.forwardRef)((function(e,t){e.icon;var n=e.label,i=e.isOpen,r=e.onVisible,a=void 0===r?Pc:r,o=e.onClose,s=void 0===o?Pc:o,l=e.ulProps,d=e.position,_=e.children,g=e.className,F=(e.buttonStyle,e.buttonProps),y=e.customTarget,E=(e.disabled,e.closeOnEsc),v=void 0===E||E,k=e.closeOnSelect,D=void 0===k||k,C=e.closeOnOutsideClick,w=void 0===C||C,S=e.dropdownModifiers,O=void 0===S?[]:S,x=h()(e,Ic),T=Object(p.useRef)(),N=y(),A=!(null==i),M=Object(p.useState)(!1),R=f()(M,2),I=R[0],L=R[1],B=Object(p.useState)(null),P=f()(B,2),j=P[0],q=P[1],U=Object(p.useState)(null),z=f()(U,2),H=z[0],W=z[1],G=function(e,t,n){void 0===n&&(n={});var i=p.useRef(null),r={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||sc},a=p.useState({styles:{popper:{position:r.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=a[0],s=a[1],l=p.useMemo((function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(e){var t=e.state,n=Object.keys(t.elements);s({styles:ac(n.map((function(e){return[e,t.styles[e]||{}]}))),attributes:ac(n.map((function(e){return[e,t.attributes[e]]})))})},requires:["computeStyles"]}}),[]),u=p.useMemo((function(){var e={onFirstUpdate:r.onFirstUpdate,placement:r.placement,strategy:r.strategy,modifiers:[].concat(r.modifiers,[l,{name:"applyStyles",enabled:!1}])};return rc()(i.current,e)?i.current||e:(i.current=e,e)}),[r.onFirstUpdate,r.placement,r.strategy,r.modifiers,l]),d=p.useRef();return oc((function(){d.current&&d.current.setOptions(u)}),[u]),oc((function(){if(null!=e&&null!=t){var i=(n.createPopper||wl)(e,t,u);return d.current=i,function(){i.destroy(),d.current=null}}}),[e,t,n.createPopper]),{state:d.current?d.current.state:null,styles:o.styles,attributes:o.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}}(j,H,{placement:d||"bottom-end",modifiers:O}),Y=G.styles,V=G.attributes;Object(p.useImperativeHandle)(t,(function(){return{close:function(){return L(!1)},visible:I}}));var $=function(){A||L(!1),s()},K=function(){!A&&L(!I)};return v&&Mc("esc",$),w&&Rc(T,$),A||(F=Bc(Bc({},F),{},{onClick:function(){K()}})),Object(p.useEffect)((function(){A&&L(i)}),[i]),Object(p.useEffect)((function(){I&&a()}),[I]),m.a.createElement("div",u()({ref:T,className:b()("ne-dropdown__wrapper",c()({},g,g))},x),y?m.a.createElement("div",{ref:q,onClick:K},N):m.a.createElement("div",null,n,m.a.createElement(Uu.Down,null)),I&&m.a.createElement("ul",u()({className:"ne-dropdown__popup",ref:W,onClick:function(){D&&$()},"data-cy":"neeto-editor-".concat(qu(n),"-dropdown-container")},l,{style:Bc(Bc({display:"block"},Y.offset),Y.popper)},V.popper),_))})),qc=function(e){var t=e.editor;return m.a.createElement(jc,{customTarget:function(){return m.a.createElement(Zd,{icon:Uu.TextSize,iconActive:t.isActive("heading"),tooltipProps:{content:"Font Size",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-font-size-option"})},className:"neeto-editor-font-size-wrapper",placement:"bottom"},[{label:"H1",value:1},{label:"H2",value:2},{label:"H3",value:3}].map((function(e){var n,i=e.label,r=e.value;return m.a.createElement("li",{onClick:function(){return e=r,t.chain().focus().toggleHeading({level:e}).run();var e},key:r,className:b()({active:(n=r,t.isActive("heading",{level:n}))}),"data-cy":"neeto-editor-fixed-menu-font-size-option-".concat(i)},i)})))};function Uc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function zc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Uc(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Hc=function(e){var t=e.onClickVariable,n=e.variables,i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=[];return e.forEach((function(e){var i=e.category_key,r=e.category_label,a=e.variables;if(i&&a){var o=a.map((function(e){return zc(zc({},e),{},{category_key:i})}));n.push({label:r,variables:o})}else t.push(e)})),t.length&&n.push({label:n.length?"Others":null,variables:t}),n}(n);return n&&n.length?m.a.createElement("div",{className:"neeto-editor-variables-list"},i.map((function(e,n){var i=e.label,r=e.variables;return m.a.createElement(Wc,{key:n,index:n,title:i,variables:r,onClickItem:t})}))):null},Wc=function(e){var t=e.index,n=e.title,i=e.variables,r=e.onClickItem;return m.a.createElement("div",{className:"neeto-editor-variables-block","data-cy":"neeto-editor-variable-option-category-".concat(t)},n&&m.a.createElement("h6",null,n),m.a.createElement("div",{className:"neeto-editor-variables-row"},i.map((function(e){return m.a.createElement("button",{type:"button",onClick:function(){return r(e)},key:"".concat(e.label,"--").concat(e.value),className:"neeto-editor-variable","data-cy":"neeto-editor-variable-option-item-".concat(e.label,"--").concat(e.value)},e.label)}))))},Gc=["color"],Yc=function(e){var t=e.editor,n=e.variables;return n&&n.length?m.a.createElement(jc,{customTarget:function(){return m.a.createElement(Zd,{icon:function(e){e.color;var t=h()(e,Gc);return m.a.createElement(tc,t)},tooltipProps:{content:"Variables",position:"bottom",delay:[500]},"data-cy":"neeto-editor-variable-option"})}},m.a.createElement(Hc,{onClickVariable:function(e){var n=e.category_key,i=e.key,r=n?"".concat(n,".").concat(i):i;t.chain().focus().setVariable({label:r}).run()},variables:n})):null},Vc=["size","user","isSquare","status","onClick","className"],$c={small:24,medium:32,large:40,xlarge:64},Kc=["#E5E7EB","#FECACA","#FDE68A","#A7F3D0","#BFDBFE","#C7D2FE","#DDD6FE","#FBCFE8"];function Qc(e){var t,n,i=e.size,r=e.user,a=e.isSquare,o=e.status,s=e.onClick,l=e.className,d=h()(e,Vc),c=Object(p.useState)(!1),_=f()(c,2),g=_[0],F=_[1],y=r.name,E=void 0===y?"":y,v=r.imageUrl,k="medium"===i,D="large"===i,C="xlarge"===i,w=(t=E.trim().split(" ")).reduce((function(e,n,i){return 0!==i&&i!==t.length-1||(e="".concat(e).concat(n.charAt(0).toUpperCase())),e}),""),S={height:$c[i],width:$c[i],backgroundColor:(n=(w.charCodeAt(0)||0)+(w.charCodeAt(1)||0),Kc[n%65%Kc.length]||Kc[0])},O=b()("ne-avatar",{"ne-avatar--medium":k,"ne-avatar--large":D,"ne-avatar--xlarge":C,"ne-avatar--round":!a,hidden:!g}),x=b()("ne-avatar__text",{"ne-avatar__text-medium":k,"ne-avatar__text-large":D,"ne-avatar__text-xlarge":C}),T=b()("ne-avatar__status","".concat(o),{"ne-avatar__status-medium":k,"ne-avatar__status-large":D,"ne-avatar__status-xlarge":C,"ne-avatar__status-square":a}),N=function(){return null==o?m.a.Fragment:m.a.createElement("span",{className:T})},A=function(){return m.a.createElement("span",{className:x},w)},M=w&&!v&&!g;return m.a.createElement("div",u()({onClick:s,style:S,className:b()("ne-avatar--container",{"ne-avatar--container-round":!a},l)},d),m.a.createElement(N,null),M?m.a.createElement(A,null):m.a.createElement("img",{className:O,onLoad:function(){return F(!0)},onError:function(){return F(!1)},src:v,alt:"avatar-".concat(w)}))}Qc.defaultProps={size:"medium",user:{imageUrl:"",name:""},isSquare:!1,onClick:function(){},status:null},Qc.propTypes={size:$d.a.oneOf(Object.keys($c)),user:$d.a.shape({imageUrl:$d.a.string,name:$d.a.string}),isSquare:$d.a.bool,onClick:$d.a.func,status:$d.a.oneOf(Object.keys({online:"online",idle:"idle",offline:"offline"})),className:$d.a.string};var Zc=Qc,Xc=function(e){var t=e.editor,n=e.mentions,i=e.showImageInMention,r=Object(p.useRef)();return n&&n.length?m.a.createElement(jc,{ref:r,customTarget:function(){var e;return m.a.createElement(Zd,{icon:Uu.Email,iconActive:null===(e=r.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Mention",position:"bottom",delay:[500]},"data-cy":"neeto-editor-mention-option"})}},m.a.createElement("div",{className:"neeto-editor-mentions__wrapper neeto-editor-mentions__wrapper--small"},n.map((function(e){var n="string"==typeof e?e:e.label,r="string"==typeof e?"":e.imageUrl;return m.a.createElement("button",{className:"neeto-editor-mentions__item neeto-editor-mentions__item--light",key:n,onClick:function(){return t.commands.setMention(n)},type:"button","data-cy":"neeto-editor-mention-option-".concat(e.label)},i&&m.a.createElement(Zc,{size:"small",user:{name:n,imageUrl:r}}),m.a.createElement("p",null,n))})))):null},Jc=["children","className","required","helpIconProps"],e_=["onClick","icon","tooltipProps","className"],t_=function(e){var t=e.children,n=e.className,i=void 0===n?"":n,r=e.required,a=void 0!==r&&r,o=e.helpIconProps,s=void 0===o?null:o,l=h()(e,Jc),d=s||{},_=d.onClick,f=d.icon,g=d.tooltipProps,p=d.className,F=h()(d,e_),y=f||Uu.Info;return m.a.createElement("label",u()({className:b()("ne-label flex items-center",i)},l),t,a&&m.a.createElement("span",{"aria-hidden":!0},"*"),s&&m.a.createElement(rd,u()({},g,{disabled:!g}),m.a.createElement("span",{className:b()("ml-1",c()({},p,p)),onClick:_},m.a.createElement(y,u()({size:16},F)))))},n_=["id","size","type","label","error","suffix","prefix","disabled","helpText","className","nakedInput","contentSize","required"],i_=Object(p.forwardRef)((function(e,t){var n=e.id,i=e.size,r=void 0===i?"small":i,a=e.type,o=void 0===a?"text":a,s=e.label,l=e.error,d=void 0===l?null:l,c=e.suffix,_=void 0===c?null:c,f=e.prefix,g=void 0===f?null:f,p=e.disabled,F=void 0!==p&&p,y=e.helpText,E=void 0===y?"":y,v=e.className,k=void 0===v?"":v,D=e.nakedInput,C=void 0!==D&&D,w=e.contentSize,S=void 0===w?null:w,O=e.required,x=void 0!==O&&O,T=h()(e,n_);return m.a.createElement("div",{className:b()(["ne-input__wrapper",k])},s&&m.a.createElement(t_,{required:x,"data-cy":"neeto-editor-".concat(qu(s),"-input-label"),htmlFor:n},s),m.a.createElement("div",{className:b()("ne-input",{"ne-input--naked":!!C,"ne-input--error":!!d,"ne-input--disabled":!!F,"ne-input--small":"small"===r})},g&&m.a.createElement("div",{className:"ne-input__prefix"},g),m.a.createElement("input",u()({ref:t,type:o,disabled:F,size:S,required:x,"aria-invalid":!!d,"data-cy":"".concat(qu(s),"-input-field")},T)),_&&m.a.createElement("div",{className:"ne-input__suffix"},_)),!!d&&m.a.createElement("p",{"data-cy":"".concat(qu(s),"-input-error"),className:"ne-input__error"},d),E&&m.a.createElement("p",{className:"ne-input__help-text"},E))}));i_.displayName="Input";var r_=i_,a_=function(e){var t=e.editor,n=Object(p.useRef)(),i=Object(p.useRef)(),r=Object(p.useState)(""),a=f()(r,2),o=a[0],s=a[1],l=Object(p.useState)(""),u=f()(l,2),d=u[0],c=u[1],_=t.isActive("link"),g=function(){c(t.getAttributes("link").href||"")},h=function(){var e;Ud.test(d)?(t.chain().focus().setLink({href:d}).run(),null===(e=n.current)||void 0===e||e.close()):s("Please enter a valid url")};return m.a.createElement(jc,{ref:n,onVisible:function(){var e;return null===(e=i.current)||void 0===e?void 0:e.focus({preventScroll:!0})},customTarget:function(){return m.a.createElement(Zd,{icon:Uu.Link,iconActive:_,onClick:g,tooltipProps:{content:"Link",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-link-option"})},className:"neeto-editor-link-wrapper",closeOnSelect:!1,position:"bottom"},m.a.createElement("div",{onKeyDown:function(e){"Escape"===e.key?n.current.close():"Enter"===e.key&&h()},className:"neeto-editor-link__item"},m.a.createElement(r_,{ref:i,name:"url",value:d,placeholder:"Paste URL",onFocus:function(){return s("")},error:o,onChange:function(e){var t=e.target.value;return c(t)},"data-cy":"neeto-editor-fixed-menu-link-option-input"}),m.a.createElement(qd,{label:"Link",onClick:h,"data-cy":"neeto-editor-fixed-menu-link-option-link-button"}),_&&m.a.createElement(qd,{label:"Unlink",onClick:function(){var e;t.chain().focus().unsetLink().run(),null===(e=n.current)||void 0===e||e.close()},"data-cy":"neeto-editor-fixed-menu-link-option-unlink-button"})))},o_=n(21),s_=n.n(o_),l_=n(22),u_=n.n(l_),d_=n(15),c_=n.n(d_),__=n(23),f_=n.n(__),g_=n(24),h_=n.n(g_),p_=n(19),m_=n.n(p_),F_=n(32),b_=n(10),y_=n.n(b_),E_=n(11),v_=n.n(E_),k_=n(47),D_=n.n(k_),C_={name:"a",unified:"b",non_qualified:"c",has_img_apple:"d",has_img_google:"e",has_img_twitter:"f",has_img_facebook:"h",keywords:"j",sheet:"k",emoticons:"l",text:"m",short_names:"n",added_in:"o"},w_=function(e){var t=[],n=function(e,n){e&&(Array.isArray(e)?e:[e]).forEach((function(e){(n?e.split(/[-|_|\s]+/):[e]).forEach((function(e){e=e.toLowerCase(),-1==t.indexOf(e)&&t.push(e)}))}))};return n(e.short_names,!0),n(e.name,!0),n(e.keywords,!1),n(e.emoticons,!1),t.join(",")},S_=function(e){for(var t in e.compressed=!1,e.emojis){var n=e.emojis[t];for(var i in C_)n[i]=n[C_[i]],delete n[C_[i]];n.short_names||(n.short_names=[]),n.short_names.unshift(t),n.sheet_x=n.sheet[0],n.sheet_y=n.sheet[1],delete n.sheet,n.text||(n.text=""),n.added_in||(n.added_in=6),n.added_in=n.added_in.toFixed(1),n.search=w_(n)}},O_=String.fromCodePoint||function(){var e,t,n=16384,i=[],r=-1,a=arguments.length;if(!a)return"";for(var o="";++r<a;){var s=Number(arguments[r]);if(!isFinite(s)||s<0||s>1114111||Math.floor(s)!=s)throw RangeError("Invalid code point: "+s);s<=65535?i.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,i.push(e,t)),(r+1===a||i.length>n)&&(o+=String.fromCharCode.apply(null,i),i.length=0)}return o},x_=/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/,T_=["1F3FA","1F3FB","1F3FC","1F3FD","1F3FE","1F3FF"];function N_(e){var t=e.split("-").map((function(e){return"0x".concat(e)}));return O_.apply(null,t)}function A_(e){var t=e.name,n=e.short_names,i=e.skin_tone,r=e.skin_variations,a=e.emoticons,o=e.unified,s=e.custom,l=e.customCategory,u=e.imageUrl,d=e.id||n[0],c=":".concat(d,":");return s?{id:d,name:t,short_names:n,colons:c,emoticons:a,custom:s,customCategory:l,imageUrl:u}:(i&&(c+=":skin-tone-".concat(i,":")),{id:d,name:t,short_names:n,colons:c,emoticons:a,unified:o.toLowerCase(),skin:i||(r?1:null),native:N_(o)})}function M_(){return A_(R_.apply(void 0,arguments))}function R_(e,t,n,i){var r={};if("string"==typeof e){var a=e.match(x_);if(a&&(e=a[1],a[2]&&(t=parseInt(a[2],10))),i.aliases.hasOwnProperty(e)&&(e=i.aliases[e]),!i.emojis.hasOwnProperty(e))return null;r=i.emojis[e]}else e.id&&(i.aliases.hasOwnProperty(e.id)&&(e.id=i.aliases[e.id]),i.emojis.hasOwnProperty(e.id)&&(r=i.emojis[e.id],t||(t=e.skin)));if(Object.keys(r).length||((r=e).custom=!0,r.search||(r.search=w_(e))),r.emoticons||(r.emoticons=[]),r.variations||(r.variations=[]),r.skin_variations&&t>1){r=JSON.parse(JSON.stringify(r));var o=T_[t-1],s=r.skin_variations[o];if(s&&(!s.variations&&r.variations&&delete r.variations,n&&(null==s["has_img_".concat(n)]||s["has_img_".concat(n)])||!n))for(var l in r.skin_tone=t,s){var u=s[l];r[l]=u}}return r.variations&&r.variations.length&&((r=JSON.parse(JSON.stringify(r))).unified=r.variations.shift()),r}function I_(e){return e.reduce((function(e,t){return-1===e.indexOf(t)&&e.push(t),e}),[])}function L_(e,t){var n=I_(e),i=I_(t);return n.filter((function(e){return i.indexOf(e)>=0}))}function B_(e,t){var n={};for(var i in e){var r=e[i],a=r;t.hasOwnProperty(i)&&(a=t[i]),"object"===D_()(a)&&(a=B_(r,a)),n[i]=a}return n}var P_,j_,q_="emoji-mart",U_="undefined"!=typeof window&&"localStorage"in window;function z_(e,t){if(j_)j_(e,t);else{if(!U_)return;try{window.localStorage["".concat(q_,".").concat(e)]=JSON.stringify(t)}catch(e){}}}var H_={update:function(e){for(var t in e){z_(t,e[t])}},set:z_,get:function(e){if(P_)return P_(e);if(U_)try{var t=window.localStorage["".concat(q_,".").concat(e)];if(t)return JSON.parse(t)}catch(e){return}},setNamespace:function(e){q_=e},setHandlers:function(e){e||(e={}),P_=e.getter,j_=e.setter}},W_=function(){function e(t,n){y_()(this,e),t.compressed&&S_(t),this.data=t||{},this.set=n||null,this.originalPool={},this.index={},this.emojis={},this.emoticons={},this.customEmojisList=[],this.buildIndex()}return v_()(e,[{key:"buildIndex",value:function(){var e=this,t=function(t){var n=e.data.emojis[t],i=n.short_names,r=n.emoticons,a=n.skin_variations,o=i[0];if(r&&r.forEach((function(t){e.emoticons[t]||(e.emoticons[t]=o)})),a){e.emojis[o]={};for(var s=1;s<=6;s++)e.emojis[o][s]=M_({id:o,skin:s},s,e.set,e.data)}else e.emojis[o]=M_(o,null,e.set,e.data);e.originalPool[o]=n};for(var n in this.data.emojis)t(n)}},{key:"clearCustomEmojis",value:function(e){var t=this;this.customEmojisList.forEach((function(n){var i=n.id||n.short_names[0];delete e[i],delete t.emojis[i]}))}},{key:"addCustomToPool",value:function(e,t){var n=this;this.customEmojisList.length&&this.clearCustomEmojis(t),e.forEach((function(e){var i=e.id||e.short_names[0];i&&!t[i]&&(t[i]=R_(e,null,null,n.data),n.emojis[i]=M_(e,null,null,n.data))})),this.customEmojisList=e,this.index={}}},{key:"search",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.emojisToShowFilter,r=n.maxResults,a=n.include,o=n.exclude,s=n.custom,l=void 0===s?[]:s;this.customEmojisList!=l&&this.addCustomToPool(l,this.originalPool);var u=H_.get("skin")||1;r||(r=75),a||(a=[]),o||(o=[]);var d=null,c=this.originalPool;if(e.length){if("-"==e||"-1"==e)return[this.emojis[-1][u]];var _=e.toLowerCase().split(/[\s|,|\-|_]+/),f=[];if(_.length>2&&(_=[_[0],_[1]]),(a.length||o.length)&&(c={},this.data.categories.forEach((function(e){var n=!a||!a.length||a.indexOf(e.id)>-1,i=!(!o||!o.length)&&o.indexOf(e.id)>-1;n&&!i&&e.emojis.forEach((function(e){return c[e]=t.data.emojis[e]}))})),l.length)){var g=!a||!a.length||a.indexOf("custom")>-1,h=!(!o||!o.length)&&o.indexOf("custom")>-1;g&&!h&&this.addCustomToPool(l,c)}d=(f=_.map((function(e){for(var n=c,i=t.index,r=0,a=0;a<e.length;a++){var o=e[a];r++,i[o]||(i[o]={}),(i=i[o]).results||function(){var a={};for(var o in i.results=[],i.pool={},n){var s=n[o],l=s.search,d=e.substr(0,r),c=l.indexOf(d);if(-1!=c){var _=c+1;d==o&&(_=0),t.emojis[o]&&t.emojis[o][u]?i.results.push(t.emojis[o][u]):i.results.push(t.emojis[o]),i.pool[o]=s,a[o]=_}}i.results.sort((function(e,t){var n=a[e.id],i=a[t.id];return n==i?e.id.localeCompare(t.id):n-i}))}(),n=i.pool}return i.results})).filter((function(e){return e}))).length>1?L_.apply(null,f):f.length?f[0]:[]}return d&&(i&&(d=d.filter((function(e){return i(c[e.id])}))),d&&d.length>r&&(d=d.slice(0,r))),d}}]),e}(),G_=new W_(F_);var Y_,V_,$_={search:function(){return G_.search.apply(G_,arguments)},emojis:G_.emojis,emoticons:G_.emoticons},K_=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart","poop"],Q_={};function Z_(){V_=!0,Y_=H_.get("frequently")}var X_={add:function(e){V_||Z_();var t=e.id;Y_||(Y_=Q_),Y_[t]||(Y_[t]=0),Y_[t]+=1,H_.set("last",t),H_.set("frequently",Y_)},get:function(e){if(V_||Z_(),!Y_){Q_={};for(var t=[],n=0;n<e;n++)Q_[K_[n]]=e-n,t.push(K_[n]);return t}var i=4*e,r=[];for(var a in Y_)Y_.hasOwnProperty(a)&&r.push(a);var o=r.sort((function(e,t){return Y_[e]-Y_[t]})).reverse().slice(0,i),s=H_.get("last");return s&&-1==o.indexOf(s)&&(o.pop(),o.push(s)),o}},J_=n(17),ef=n.n(J_),tf=n(25),nf=n.n(tf),rf=n(12),af=n.n(rf),of=n(13),sf=n.n(of),lf=n(14),uf=n.n(lf),df=n(8),cf=n.n(df),_f={activity:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113"}))},custom:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("g",{transform:"translate(2.000000, 1.000000)"},m.a.createElement("rect",{id:"Rectangle",x:"8",y:"0",width:"3",height:"21",rx:"1.5"}),m.a.createElement("rect",{id:"Rectangle",transform:"translate(9.843, 10.549) rotate(60) translate(-9.843, -10.549) ",x:"8.343",y:"0.049",width:"3",height:"21",rx:"1.5"}),m.a.createElement("rect",{id:"Rectangle",transform:"translate(9.843, 10.549) rotate(-60) translate(-9.843, -10.549) ",x:"8.343",y:"0.049",width:"3",height:"21",rx:"1.5"})))},flags:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z"}))},foods:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M17 4.978c-1.838 0-2.876.396-3.68.934.513-1.172 1.768-2.934 4.68-2.934a1 1 0 0 0 0-2c-2.921 0-4.629 1.365-5.547 2.512-.064.078-.119.162-.18.244C11.73 1.838 10.798.023 9.207.023 8.579.022 7.85.306 7 .978 5.027 2.54 5.329 3.902 6.492 4.999 3.609 5.222 0 7.352 0 12.969c0 4.582 4.961 11.009 9 11.009 1.975 0 2.371-.486 3-1 .629.514 1.025 1 3 1 4.039 0 9-6.418 9-11 0-5.953-4.055-8-7-8M8.242 2.546c.641-.508.943-.523.965-.523.426.169.975 1.405 1.357 3.055-1.527-.629-2.741-1.352-2.98-1.846.059-.112.241-.356.658-.686M15 21.978c-1.08 0-1.21-.109-1.559-.402l-.176-.146c-.367-.302-.816-.452-1.266-.452s-.898.15-1.266.452l-.176.146c-.347.292-.477.402-1.557.402-2.813 0-7-5.389-7-9.009 0-5.823 4.488-5.991 5-5.991 1.939 0 2.484.471 3.387 1.251l.323.276a1.995 1.995 0 0 0 2.58 0l.323-.276c.902-.78 1.447-1.251 3.387-1.251.512 0 5 .168 5 6 0 3.617-4.187 9-7 9"}))},nature:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8"}),m.a.createElement("path",{d:"M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235"}))},objects:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0a9 9 0 0 0-5 16.482V21s2.035 3 5 3 5-3 5-3v-4.518A9 9 0 0 0 12 0zm0 2c3.86 0 7 3.141 7 7s-3.14 7-7 7-7-3.141-7-7 3.14-7 7-7zM9 17.477c.94.332 1.946.523 3 .523s2.06-.19 3-.523v.834c-.91.436-1.925.689-3 .689a6.924 6.924 0 0 1-3-.69v-.833zm.236 3.07A8.854 8.854 0 0 0 12 21c.965 0 1.888-.167 2.758-.451C14.155 21.173 13.153 22 12 22c-1.102 0-2.117-.789-2.764-1.453z"}),m.a.createElement("path",{d:"M14.745 12.449h-.004c-.852-.024-1.188-.858-1.577-1.824-.421-1.061-.703-1.561-1.182-1.566h-.009c-.481 0-.783.497-1.235 1.537-.436.982-.801 1.811-1.636 1.791l-.276-.043c-.565-.171-.853-.691-1.284-1.794-.125-.313-.202-.632-.27-.913-.051-.213-.127-.53-.195-.634C7.067 9.004 7.039 9 6.99 9A1 1 0 0 1 7 7h.01c1.662.017 2.015 1.373 2.198 2.134.486-.981 1.304-2.058 2.797-2.075 1.531.018 2.28 1.153 2.731 2.141l.002-.008C14.944 8.424 15.327 7 16.979 7h.032A1 1 0 1 1 17 9h-.011c-.149.076-.256.474-.319.709a6.484 6.484 0 0 1-.311.951c-.429.973-.79 1.789-1.614 1.789"}))},people:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}),m.a.createElement("path",{d:"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0"}))},places:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M6.5 12C5.122 12 4 13.121 4 14.5S5.122 17 6.5 17 9 15.879 9 14.5 7.878 12 6.5 12m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5M17.5 12c-1.378 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.122-2.5-2.5-2.5m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5"}),m.a.createElement("path",{d:"M22.482 9.494l-1.039-.346L21.4 9h.6c.552 0 1-.439 1-.992 0-.006-.003-.008-.003-.008H23c0-1-.889-2-1.984-2h-.642l-.731-1.717C19.262 3.012 18.091 2 16.764 2H7.236C5.909 2 4.738 3.012 4.357 4.283L3.626 6h-.642C1.889 6 1 7 1 8h.003S1 8.002 1 8.008C1 8.561 1.448 9 2 9h.6l-.043.148-1.039.346a2.001 2.001 0 0 0-1.359 2.097l.751 7.508a1 1 0 0 0 .994.901H3v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h6v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h1.096a.999.999 0 0 0 .994-.901l.751-7.508a2.001 2.001 0 0 0-1.359-2.097M6.273 4.857C6.402 4.43 6.788 4 7.236 4h9.527c.448 0 .834.43.963.857L19.313 9H4.688l1.585-4.143zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.189-3H2.811l-.662-6.607L3 11h18l.852.393L21.189 18z"}))},recent:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z"}),m.a.createElement("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}))},symbols:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76"}))}},ff={search:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 20 20",opacity:"0.5"},m.a.createElement("path",{d:"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"}))},delete:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 20 20",opacity:"0.5"},m.a.createElement("path",{d:"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"}))}},gf={data:$d.a.object.isRequired,onOver:$d.a.func,onLeave:$d.a.func,onClick:$d.a.func,fallback:$d.a.func,backgroundImageFn:$d.a.func,native:$d.a.bool,forceSize:$d.a.bool,tooltip:$d.a.bool,useButton:$d.a.bool,skin:$d.a.oneOf([1,2,3,4,5,6]),sheetSize:$d.a.oneOf([16,20,32,64]),sheetColumns:$d.a.number,sheetRows:$d.a.number,set:$d.a.oneOf(["apple","google","twitter","facebook"]),size:$d.a.number.isRequired,emoji:$d.a.oneOfType([$d.a.string,$d.a.object]).isRequired},hf={onClick:$d.a.func,onSelect:$d.a.func,onSkinChange:$d.a.func,perLine:$d.a.number,emojiSize:$d.a.number,i18n:$d.a.object,style:$d.a.object,title:$d.a.string,emoji:$d.a.string,color:$d.a.string,set:gf.set,skin:gf.skin,native:$d.a.bool,backgroundImageFn:gf.backgroundImageFn,sheetSize:gf.sheetSize,emojisToShowFilter:$d.a.func,showPreview:$d.a.bool,showSkinTones:$d.a.bool,emojiTooltip:gf.tooltip,useButton:gf.useButton,theme:$d.a.oneOf(["auto","light","dark"]),include:$d.a.arrayOf($d.a.string),exclude:$d.a.arrayOf($d.a.string),recent:$d.a.arrayOf($d.a.string),autoFocus:$d.a.bool,enableFrequentEmojiSort:$d.a.bool,custom:$d.a.arrayOf($d.a.shape({name:$d.a.string.isRequired,short_names:$d.a.arrayOf($d.a.string).isRequired,emoticons:$d.a.arrayOf($d.a.string),keywords:$d.a.arrayOf($d.a.string),imageUrl:$d.a.string,spriteUrl:$d.a.string,sheet_x:$d.a.number,sheet_y:$d.a.number,size:$d.a.number,sheetColumns:$d.a.number,sheetRows:$d.a.number})),skinEmoji:$d.a.string,notFound:$d.a.func,notFoundEmoji:$d.a.string,icons:$d.a.object},pf=function(e){function t(e){var n;y_()(this,t),n=af()(this,sf()(t).call(this,e));var i=e.categories.filter((function(e){return e.first}))[0];return n.state={selected:i.name},n.handleClick=n.handleClick.bind(cf()(n)),n}return uf()(t,e),v_()(t,[{key:"handleClick",value:function(e){var t=e.currentTarget.getAttribute("data-index"),n=this.props,i=n.categories;(0,n.onAnchorClick)(i[t],t)}},{key:"render",value:function(){var e=this,t=this.props,n=t.categories,i=t.color,r=t.i18n,a=t.icons,o=this.state.selected;return m.a.createElement("nav",{className:"emoji-mart-anchors","aria-label":r.categorieslabel},n.map((function(t,n){var s=t.id,l=t.name,u=t.anchor,d=l==o;if(!1===u)return null;var c=s.startsWith("custom-")?"custom":s;return m.a.createElement("button",{key:s,"aria-label":r.categories[c],title:r.categories[c],"data-index":n,type:"button",onClick:e.handleClick,className:"emoji-mart-anchor ".concat(d?"emoji-mart-anchor-selected":""),style:{color:d?i:null}},m.a.createElement("div",{className:"emoji-mart-anchor-icon"},a.categories[c]()),m.a.createElement("span",{className:"emoji-mart-anchor-bar",style:{backgroundColor:i}}))})))}}]),t}(m.a.PureComponent);pf.propTypes={categories:$d.a.array,onAnchorClick:$d.a.func,icons:$d.a.object},pf.defaultProps={categories:[],onAnchorClick:function(){},icons:{}};var mf={skin:1,set:"apple",sheetSize:64,sheetColumns:57,sheetRows:57,native:!1,forceSize:!1,tooltip:!1,useButton:!0,backgroundImageFn:function(e,t){return"https://unpkg.com/emoji-datasource-".concat(e,"@").concat("5.0.1","/img/").concat(e,"/sheets-256/").concat(t,".png")}},Ff={onClick:function(){},onSelect:function(){},onSkinChange:function(){},emojiSize:24,perLine:9,i18n:{},style:{},title:"Emoji Mart™",emoji:"department_store",color:"#ae65c5",set:mf.set,theme:"light",skin:null,defaultSkin:mf.skin,native:mf.native,sheetSize:mf.sheetSize,backgroundImageFn:mf.backgroundImageFn,emojisToShowFilter:null,showPreview:!0,showSkinTones:!0,emojiTooltip:mf.tooltip,useButton:mf.useButton,autoFocus:!1,enableFrequentEmojiSort:!1,custom:[],skinEmoji:"",notFound:function(){},notFoundEmoji:"sleuth_or_spy",icons:{}};function bf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function yf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bf(Object(n),!0).forEach((function(t){ef()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ef=function(e){return R_(e.emoji,e.skin,e.set,e.data)},vf=function(e){var t=Ef(e),n=t.sheet_x,i=t.sheet_y,r=100/(e.sheetColumns-1),a=100/(e.sheetRows-1);return"".concat(r*n,"% ").concat(a*i,"%")},kf=function(e){return M_(e.emoji,e.skin,e.set,e.data)},Df=function(e){return!isNaN(e-parseFloat(e))},Cf=function e(t){for(var n in t.data.compressed&&S_(t.data),e.defaultProps)null==t[n]&&null!=e.defaultProps[n]&&(t[n]=e.defaultProps[n]);var i=Ef(t);if(!i)return t.fallback?t.fallback(null,t):null;var r=i.unified,a=i.custom,o=i.short_names,s=i.imageUrl,l={},u=t.children,d="emoji-mart-emoji",c=r&&N_(r),_=[c].concat(o).filter(Boolean).join(", "),f=null;if(!r&&!a)return t.fallback?t.fallback(i,t):null;if(t.tooltip&&(f=o[0]),t.native&&r)d+=" emoji-mart-emoji-native",l={fontSize:t.size},u=c,t.forceSize&&(l.display="inline-block",l.width=t.size,l.height=t.size,l.wordBreak="keep-all");else if(a)d+=" emoji-mart-emoji-custom",l={width:t.size,height:t.size,display:"inline-block"},l=i.spriteUrl?yf({},l,{backgroundImage:"url(".concat(i.spriteUrl,")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:vf(t)}):yf({},l,{backgroundImage:"url(".concat(s,")"),backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center"});else{if(!(null==i["has_img_".concat(t.set)]||i["has_img_".concat(t.set)]))return t.fallback?t.fallback(i,t):null;l={width:t.size,height:t.size,display:"inline-block",backgroundImage:"url(".concat(t.backgroundImageFn(t.set,t.sheetSize),")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:vf(t)}}var g={name:"span",props:{}};return t.onClick&&t.useButton&&(g.name="button",g.props={type:"button"}),t.html?(l=function(e){var t=document.createElement("div");for(var n in e){var i=e[n];Df(i)&&(i+="px"),t.style[n]=i}return t.getAttribute("style")}(l),"<".concat(g.name," style='").concat(l,"' aria-label='").concat(_,"' ").concat(f?"title='".concat(f,"'"):""," class='").concat(d,"'>").concat(u||"","</").concat(g.name,">")):m.a.createElement(g.name,nf()({onClick:function(e){return function(e,t){t.onClick&&(0,t.onClick)(kf(t),e)}(e,t)},onMouseEnter:function(e){return function(e,t){t.onOver&&(0,t.onOver)(kf(t),e)}(e,t)},onMouseLeave:function(e){return function(e,t){t.onLeave&&(0,t.onLeave)(kf(t),e)}(e,t)},"aria-label":_,title:f,className:d},g.props),m.a.createElement("span",{style:l},u))};Cf.propTypes=yf({},gf,{data:$d.a.object.isRequired}),Cf.defaultProps=mf;var wf=Cf;function Sf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var Of=function(e){function t(){return y_()(this,t),af()(this,sf()(t).apply(this,arguments))}return uf()(t,e),v_()(t,[{key:"render",value:function(){var e=this.props,t=e.data,n=e.emojiProps,i=e.i18n,r=e.notFound,a=e.notFoundEmoji;return r&&r()||m.a.createElement("div",{className:"emoji-mart-no-results"},wf(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sf(Object(n),!0).forEach((function(t){ef()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({data:t},n,{size:38,emoji:a,onOver:null,onLeave:null,onClick:null})),m.a.createElement("div",{className:"emoji-mart-no-results-label"},i.notfound))}}]),t}(m.a.PureComponent);function xf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}Of.propTypes={notFound:$d.a.func.isRequired,emojiProps:$d.a.object.isRequired};var Tf=function(e){function t(e){var n;return y_()(this,t),(n=af()(this,sf()(t).call(this,e))).data=e.data,n.setContainerRef=n.setContainerRef.bind(cf()(n)),n.setLabelRef=n.setLabelRef.bind(cf()(n)),n}return uf()(t,e),v_()(t,[{key:"componentDidMount",value:function(){this.margin=0,this.minMargin=0,this.memoizeSize()}},{key:"shouldComponentUpdate",value:function(e,t){var n=this.props,i=n.name,r=n.perLine,a=n.native,o=n.hasStickyPosition,s=n.emojis,l=n.emojiProps,u=l.skin,d=l.size,c=l.set,_=e.perLine,f=e.native,g=e.hasStickyPosition,h=e.emojis,p=e.emojiProps,m=p.skin,F=p.size,b=p.set,y=!1;return"Recent"==i&&r!=_&&(y=!0),"Search"==i&&(y=!(s==h)),u==m&&d==F&&a==f&&c==b&&o==g||(y=!0),y}},{key:"memoizeSize",value:function(){if(!this.container)return this.top=0,void(this.maxMargin=0);var e=this.container.parentElement,t=this.container.getBoundingClientRect(),n=t.top,i=t.height,r=e.getBoundingClientRect().top,a=this.label.getBoundingClientRect().height;this.top=n-r+e.scrollTop,this.maxMargin=0==i?0:i-a}},{key:"handleScroll",value:function(e){var t=e-this.top;if((t=(t=t<this.minMargin?this.minMargin:t)>this.maxMargin?this.maxMargin:t)!=this.margin)return this.props.hasStickyPosition||(this.label.style.top="".concat(t,"px")),this.margin=t,!0}},{key:"getEmojis",value:function(){var e=this,t=this.props,n=t.name,i=t.emojis,r=t.recent,a=t.perLine;if("Recent"==n){var o=this.props.custom,s=r||X_.get(a);if(s.length&&(i=s.map((function(e){var t=o.filter((function(t){return t.id===e}))[0];return t||e})).filter((function(t){return!!R_(t,null,null,e.data)}))),0===i.length&&s.length>0)return null}return i&&(i=i.slice(0)),i}},{key:"updateDisplay",value:function(e){this.getEmojis()&&this.container&&(this.container.style.display=e)}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"setLabelRef",value:function(e){this.label=e}},{key:"render",value:function(){var e=this,t=this.props,n=t.id,i=t.name,r=t.hasStickyPosition,a=t.emojiProps,o=t.i18n,s=t.notFound,l=t.notFoundEmoji,u=this.getEmojis(),d={},c={},_={};u||(_={display:"none"}),r||(d={height:28},c={position:"absolute"});var f=o.categories[n]||i;return m.a.createElement("section",{ref:this.setContainerRef,className:"emoji-mart-category","aria-label":f,style:_},m.a.createElement("div",{style:d,"data-name":i,className:"emoji-mart-category-label"},m.a.createElement("span",{style:c,ref:this.setLabelRef,"aria-hidden":!0},f)),m.a.createElement("ul",{className:"emoji-mart-category-list"},u&&u.map((function(t){return m.a.createElement("li",{key:t.short_names&&t.short_names.join("_")||t},wf(function(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){ef()(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}({emoji:t,data:e.data},a)))}))),u&&!u.length&&m.a.createElement(Of,{i18n:o,notFound:s,notFoundEmoji:l,data:this.data,emojiProps:a}))}}]),t}(m.a.Component);Tf.propTypes={emojis:$d.a.array,hasStickyPosition:$d.a.bool,name:$d.a.string.isRequired,native:$d.a.bool.isRequired,perLine:$d.a.number.isRequired,emojiProps:$d.a.object.isRequired,recent:$d.a.arrayOf($d.a.string),notFound:$d.a.func,notFoundEmoji:$d.a.string.isRequired},Tf.defaultProps={emojis:[],hasStickyPosition:!0};var Nf=function(e){function t(e){var n;return y_()(this,t),(n=af()(this,sf()(t).call(this,e))).state={opened:!1},n}return uf()(t,e),v_()(t,[{key:"handleClick",value:function(e){var t=parseInt(e.currentTarget.getAttribute("data-skin")),n=this.props.onChange;this.state.opened?(this.setState({opened:!1}),t!=this.props.skin&&n(t)):this.setState({opened:!0})}},{key:"render",value:function(){return null}}]),t}(m.a.PureComponent);Nf.propTypes={onChange:$d.a.func,skin:$d.a.number.isRequired},Nf.defaultProps={onChange:function(){}};var Af=function(e){function t(e){var n;return y_()(this,t),(n=af()(this,sf()(t).call(this,e))).handleClick=n.handleClick.bind(cf()(n)),n}return uf()(t,e),v_()(t,[{key:"render",value:function(){for(var e=this.props,t=e.skin,n=e.emojiProps,i=e.data,r=e.skinEmoji,a=e.i18n,o=this.state.opened,s=[],l=1;l<=6;l++){var u=l===t;s.push(m.a.createElement("span",{key:"skin-tone-".concat(l),className:"emoji-mart-skin-swatch custom".concat(u?" selected":"")},m.a.createElement("span",{onClick:this.handleClick,"data-skin":l,className:"emoji-mart-skin-tone-".concat(l)},wf({emoji:r,data:i,skin:l,backgroundImageFn:n.backgroundImageFn,native:n.native,set:n.set,sheetSize:n.sheetSize,size:23}))))}return m.a.createElement("div",{className:"emoji-mart-skin-swatches custom".concat(o?" opened":"")},m.a.createElement("div",{className:"emoji-mart-skin-text".concat(o?" opened":"")},a.skintext),s)}}]),t}(Nf);Af.propTypes={onChange:$d.a.func,skin:$d.a.number.isRequired,emojiProps:$d.a.object.isRequired,skinTone:$d.a.number,skinEmoji:$d.a.string.isRequired,i18n:$d.a.object},Af.defaultProps={onChange:function(){},skinTone:null};var Mf=function(e){function t(e){var n;return y_()(this,t),(n=af()(this,sf()(t).call(this,e))).handleClick=n.handleClick.bind(cf()(n)),n.handleKeyDown=n.handleKeyDown.bind(cf()(n)),n}return uf()(t,e),v_()(t,[{key:"handleKeyDown",value:function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),this.handleClick(e))}},{key:"render",value:function(){for(var e=this.props,t=e.skin,n=e.i18n,i=this.state.opened,r=[],a=1;a<=6;a++){var o=a===t,s=i||o;r.push(m.a.createElement("span",nf()({key:"skin-tone-".concat(a),className:"emoji-mart-skin-swatch".concat(o?" selected":""),"aria-label":n.skintones[a],"aria-hidden":!s},i?{role:"menuitem"}:{}),m.a.createElement("span",nf()({onClick:this.handleClick,onKeyDown:this.handleKeyDown,role:"button"},o?{"aria-haspopup":!0,"aria-expanded":!!i}:{},i?{"aria-pressed":!!o}:{},{tabIndex:s?"0":"","aria-label":n.skintones[a],title:n.skintones[a],"data-skin":a,className:"emoji-mart-skin emoji-mart-skin-tone-".concat(a)}))))}return m.a.createElement("section",{className:"emoji-mart-skin-swatches".concat(i?" opened":""),"aria-label":n.skintext},m.a.createElement("div",i?{role:"menubar"}:{},r))}}]),t}(Nf);function Rf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function If(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rf(Object(n),!0).forEach((function(t){ef()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Mf.propTypes={onChange:$d.a.func,skin:$d.a.number.isRequired,i18n:$d.a.object},Mf.defaultProps={onChange:function(){}};var Lf=function(e){function t(e){var n;return y_()(this,t),(n=af()(this,sf()(t).call(this,e))).data=e.data,n.state={emoji:null},n}return uf()(t,e),v_()(t,[{key:"render",value:function(){var e=this.state.emoji,t=this.props,n=t.emojiProps,i=t.skinsProps,r=t.showSkinTones,a=t.title,o=t.emoji,s=t.i18n,l=t.showPreview;if(e&&l){var u=R_(e,null,null,this.data),d=u.emoticons,c=[],_=[];return(void 0===d?[]:d).forEach((function(e){c.indexOf(e.toLowerCase())>=0||(c.push(e.toLowerCase()),_.push(e))})),m.a.createElement("div",{className:"emoji-mart-preview"},m.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},wf(If({key:e.id,emoji:e,data:this.data},n))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("div",{className:"emoji-mart-preview-name"},e.name),m.a.createElement("div",{className:"emoji-mart-preview-shortnames"},u.short_names.map((function(e){return m.a.createElement("span",{key:e,className:"emoji-mart-preview-shortname"},":",e,":")}))),m.a.createElement("div",{className:"emoji-mart-preview-emoticons"},_.map((function(e){return m.a.createElement("span",{key:e,className:"emoji-mart-preview-emoticon"},e)})))))}return m.a.createElement("div",{className:"emoji-mart-preview"},m.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},o&&o.length&&wf(If({emoji:o,data:this.data},n))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("span",{className:"emoji-mart-title-label"},a)),r&&m.a.createElement("div",{className:"emoji-mart-preview-skins".concat(i.skinEmoji?" custom":"")},i.skinEmoji?m.a.createElement(Af,{skin:i.skin,emojiProps:n,data:this.data,skinEmoji:i.skinEmoji,i18n:s,onChange:i.onChange}):m.a.createElement(Mf,{skin:i.skin,i18n:s,onChange:i.onChange})))}}]),t}(m.a.PureComponent);Lf.propTypes={showSkinTones:$d.a.bool,title:$d.a.string.isRequired,emoji:$d.a.string.isRequired,emojiProps:$d.a.object.isRequired,skinsProps:$d.a.object.isRequired},Lf.defaultProps={showSkinTones:!0,onChange:function(){}};var Bf=0,Pf=function(e){function t(e){var n,i,r,a;return y_()(this,t),(n=af()(this,sf()(t).call(this,e))).state={icon:ff.search,isSearching:!1,id:++Bf},n.data=e.data,n.emojiIndex=new W_(n.data),n.setRef=n.setRef.bind(cf()(n)),n.clear=n.clear.bind(cf()(n)),n.handleKeyUp=n.handleKeyUp.bind(cf()(n)),n.handleChange=(i=n.handleChange.bind(cf()(n)),r="function"==typeof requestIdleCallback?requestIdleCallback:setTimeout,a=!1,function(){a||(a=!0,r((function(){a=!1,i()})))}),n}return uf()(t,e),v_()(t,[{key:"componentDidMount",value:function(){this.input&&this.input.value&&this.search(this.input.value)}},{key:"search",value:function(e){""==e?this.setState({icon:ff.search,isSearching:!1}):this.setState({icon:ff.delete,isSearching:!0}),this.props.onSearch(this.emojiIndex.search(e,{emojisToShowFilter:this.props.emojisToShowFilter,maxResults:this.props.maxResults,include:this.props.include,exclude:this.props.exclude,custom:this.props.custom}))}},{key:"clear",value:function(){""!=this.input.value&&(this.input.value="",this.input.focus(),this.search(""))}},{key:"handleChange",value:function(){this.input&&this.search(this.input.value)}},{key:"handleKeyUp",value:function(e){13===e.keyCode&&this.clear()}},{key:"setRef",value:function(e){this.input=e}},{key:"render",value:function(){var e=this.props,t=e.i18n,n=e.autoFocus,i=this.state,r=i.icon,a=i.isSearching,o=i.id,s="emoji-mart-search-".concat(o);return m.a.createElement("section",{className:"emoji-mart-search","aria-label":t.search},m.a.createElement("input",{id:s,ref:this.setRef,type:"search",onChange:this.handleChange,placeholder:t.search,autoFocus:n}),m.a.createElement("label",{className:"emoji-mart-sr-only",htmlFor:s},t.search),m.a.createElement("button",{className:"emoji-mart-search-icon",onClick:this.clear,onKeyUp:this.handleKeyUp,"aria-label":t.clear,disabled:!a},r()))}}]),t}(m.a.PureComponent);function jf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function qf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jf(Object(n),!0).forEach((function(t){ef()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Pf.propTypes={onSearch:$d.a.func,maxResults:$d.a.number,emojisToShowFilter:$d.a.func,autoFocus:$d.a.bool},Pf.defaultProps={onSearch:function(){},maxResults:75,emojisToShowFilter:null,autoFocus:!1};var Uf={search:"Search",clear:"Clear",notfound:"No Emoji Found",skintext:"Choose your default skin tone",categories:{search:"Search Results",recent:"Frequently Used",people:"Smileys & People",nature:"Animals & Nature",foods:"Food & Drink",activity:"Activity",places:"Travel & Places",objects:"Objects",symbols:"Symbols",flags:"Flags",custom:"Custom"},categorieslabel:"Emoji categories",skintones:{1:"Default Skin Tone",2:"Light Skin Tone",3:"Medium-Light Skin Tone",4:"Medium Skin Tone",5:"Medium-Dark Skin Tone",6:"Dark Skin Tone"}},zf=function(e){function t(e){var n;y_()(this,t),(n=af()(this,sf()(t).call(this,e))).CUSTOM=[],n.RECENT_CATEGORY={id:"recent",name:"Recent",emojis:null},n.SEARCH_CATEGORY={id:"search",name:"Search",emojis:null,anchor:!1},e.data.compressed&&S_(e.data),n.data=e.data,n.i18n=B_(Uf,e.i18n),n.icons=B_(i,e.icons),n.state={firstRender:!0},n.categories=[];var r=[].concat(n.data.categories);if(e.custom.length>0){var a={},o=0;e.custom.forEach((function(e){a[e.customCategory]||(a[e.customCategory]={id:e.customCategory?"custom-".concat(e.customCategory):"custom",name:e.customCategory||"Custom",emojis:[],anchor:0===o},o++);var t=a[e.customCategory],i=qf({},e,{id:e.short_names[0],custom:!0});t.emojis.push(i),n.CUSTOM.push(i)})),r=r.concat(Object.keys(a).map((function(e){return a[e]})))}n.hideRecent=!0,null!=e.include&&r.sort((function(t,n){return e.include.indexOf(t.id)>e.include.indexOf(n.id)?1:-1}));for(var s=0;s<r.length;s++){var l=r[s],u=!e.include||!e.include.length||e.include.indexOf(l.id)>-1,d=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(l.id)>-1;if(u&&!d)if(e.emojisToShowFilter){for(var c=[],_=l.emojis,f=0;f<_.length;f++){var g=_[f];e.emojisToShowFilter(n.data.emojis[g]||g)&&c.push(g)}if(c.length){var h={emojis:c,name:l.name,id:l.id};n.categories.push(h)}}else n.categories.push(l)}var p=!e.include||!e.include.length||e.include.indexOf(n.RECENT_CATEGORY.id)>-1,m=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(n.RECENT_CATEGORY.id)>-1;return p&&!m&&(n.hideRecent=!1,n.categories.unshift(n.RECENT_CATEGORY)),n.categories[0]&&(n.categories[0].first=!0),n.categories.unshift(n.SEARCH_CATEGORY),n.setAnchorsRef=n.setAnchorsRef.bind(cf()(n)),n.handleAnchorClick=n.handleAnchorClick.bind(cf()(n)),n.setSearchRef=n.setSearchRef.bind(cf()(n)),n.handleSearch=n.handleSearch.bind(cf()(n)),n.setScrollRef=n.setScrollRef.bind(cf()(n)),n.handleScroll=n.handleScroll.bind(cf()(n)),n.handleScrollPaint=n.handleScrollPaint.bind(cf()(n)),n.handleEmojiOver=n.handleEmojiOver.bind(cf()(n)),n.handleEmojiLeave=n.handleEmojiLeave.bind(cf()(n)),n.handleEmojiClick=n.handleEmojiClick.bind(cf()(n)),n.handleEmojiSelect=n.handleEmojiSelect.bind(cf()(n)),n.setPreviewRef=n.setPreviewRef.bind(cf()(n)),n.handleSkinChange=n.handleSkinChange.bind(cf()(n)),n.handleKeyDown=n.handleKeyDown.bind(cf()(n)),n.handleDarkMatchMediaChange=n.handleDarkMatchMediaChange.bind(cf()(n)),n}return uf()(t,e),v_()(t,[{key:"componentDidMount",value:function(){var e=this;this.state.firstRender&&(this.testStickyPosition(),this.firstRenderTimeout=setTimeout((function(){e.setState({firstRender:!1})}),60))}},{key:"componentDidUpdate",value:function(){this.updateCategoriesSize(),this.handleScroll()}},{key:"componentWillUnmount",value:function(){this.SEARCH_CATEGORY.emojis=null,clearTimeout(this.leaveTimeout),clearTimeout(this.firstRenderTimeout),this.darkMatchMedia&&this.darkMatchMedia.removeListener(this.handleDarkMatchMediaChange)}},{key:"testStickyPosition",value:function(){var e=document.createElement("div");["","-webkit-","-ms-","-moz-","-o-"].forEach((function(t){return e.style.position="".concat(t,"sticky")})),this.hasStickyPosition=!!e.style.position.length}},{key:"getPreferredTheme",value:function(){return"auto"!=this.props.theme?this.props.theme:this.state.theme?this.state.theme:"function"!=typeof matchMedia?Ff.theme:(this.darkMatchMedia||(this.darkMatchMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMatchMedia.addListener(this.handleDarkMatchMediaChange)),this.darkMatchMedia.media.match(/^not/)?Ff.theme:this.darkMatchMedia.matches?"dark":"light")}},{key:"handleDarkMatchMediaChange",value:function(){this.setState({theme:this.darkMatchMedia.matches?"dark":"light"})}},{key:"handleEmojiOver",value:function(e){var t=this.preview;if(t){var n=this.CUSTOM.filter((function(t){return t.id===e.id}))[0];for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i]);t.setState({emoji:e}),clearTimeout(this.leaveTimeout)}}},{key:"handleEmojiLeave",value:function(e){var t=this.preview;t&&(this.leaveTimeout=setTimeout((function(){t.setState({emoji:null})}),16))}},{key:"handleEmojiClick",value:function(e,t){this.props.onClick(e,t),this.handleEmojiSelect(e)}},{key:"handleEmojiSelect",value:function(e){var t=this;this.props.onSelect(e),this.hideRecent||this.props.recent||X_.add(e);var n=this.categoryRefs["category-1"];if(n){var i=n.maxMargin;this.props.enableFrequentEmojiSort&&n.forceUpdate(),requestAnimationFrame((function(){t.scroll&&(n.memoizeSize(),i!=n.maxMargin&&(t.updateCategoriesSize(),t.handleScrollPaint(),t.SEARCH_CATEGORY.emojis&&n.updateDisplay("none")))}))}}},{key:"handleScroll",value:function(){this.waitingForPaint||(this.waitingForPaint=!0,requestAnimationFrame(this.handleScrollPaint))}},{key:"handleScrollPaint",value:function(){if(this.waitingForPaint=!1,this.scroll){var e=null;if(this.SEARCH_CATEGORY.emojis)e=this.SEARCH_CATEGORY;else{for(var t=this.scroll.scrollTop,n=t>(this.scrollTop||0),i=0,r=0,a=this.categories.length;r<a;r++){var o=n?this.categories.length-1-r:r,s=this.categories[o],l=this.categoryRefs["category-".concat(o)];if(l){var u=l.handleScroll(t);(!i||l.top<i)&&l.top>0&&(i=l.top),u&&!e&&(e=s)}}t<i?e=this.categories.filter((function(e){return!(!1===e.anchor)}))[0]:t+this.clientHeight>=this.scrollHeight&&(e=this.categories[this.categories.length-1])}if(e){var d=this.anchors,c=e.name;d.state.selected!=c&&d.setState({selected:c})}this.scrollTop=t}}},{key:"handleSearch",value:function(e){this.SEARCH_CATEGORY.emojis=e;for(var t=0,n=this.categories.length;t<n;t++){var i=this.categoryRefs["category-".concat(t)];if(i&&"Search"!=i.props.name){var r=e?"none":"inherit";i.updateDisplay(r)}}this.forceUpdate(),this.scroll&&(this.scroll.scrollTop=0),this.handleScroll()}},{key:"handleAnchorClick",value:function(e,t){var n,i=this.categoryRefs["category-".concat(t)],r=this.scroll;this.anchors;n=function(){if(i){var t=i.top;e.first?t=0:t+=1,r.scrollTop=t}},this.SEARCH_CATEGORY.emojis?(this.handleSearch(null),this.search.clear(),requestAnimationFrame(n)):n()}},{key:"handleSkinChange",value:function(e){var t={skin:e},n=this.props.onSkinChange;this.setState(t),H_.update(t),n(e)}},{key:"handleKeyDown",value:function(e){var t=!1;switch(e.keyCode){case 13:var n;this.SEARCH_CATEGORY.emojis&&this.SEARCH_CATEGORY.emojis.length&&(n=M_(this.SEARCH_CATEGORY.emojis[0],this.state.skin,this.props.set,this.props.data))&&(this.handleEmojiSelect(n),t=!0)}t&&e.preventDefault()}},{key:"updateCategoriesSize",value:function(){for(var e=0,t=this.categories.length;e<t;e++){var n=this.categoryRefs["category-".concat(e)];n&&n.memoizeSize()}if(this.scroll){var i=this.scroll;this.scrollHeight=i.scrollHeight,this.clientHeight=i.clientHeight}}},{key:"getCategories",value:function(){return this.state.firstRender?this.categories.slice(0,3):this.categories}},{key:"setAnchorsRef",value:function(e){this.anchors=e}},{key:"setSearchRef",value:function(e){this.search=e}},{key:"setPreviewRef",value:function(e){this.preview=e}},{key:"setScrollRef",value:function(e){this.scroll=e}},{key:"setCategoryRef",value:function(e,t){this.categoryRefs||(this.categoryRefs={}),this.categoryRefs[e]=t}},{key:"render",value:function(){var e=this,t=this.props,n=t.perLine,i=t.emojiSize,r=t.set,a=t.sheetSize,o=t.sheetColumns,s=t.sheetRows,l=t.style,u=t.title,d=t.emoji,c=t.color,_=t.native,f=t.backgroundImageFn,g=t.emojisToShowFilter,h=t.showPreview,p=t.showSkinTones,F=t.emojiTooltip,b=t.useButton,y=t.include,E=t.exclude,v=t.recent,k=t.autoFocus,D=t.skinEmoji,C=t.notFound,w=t.notFoundEmoji,S=n*(i+12)+12+2+function(){if("undefined"==typeof document)return 0;var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.overflow="scroll",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}(),O=this.getPreferredTheme(),x=this.props.skin||this.state.skin||H_.get("skin")||this.props.defaultSkin;return m.a.createElement("section",{style:qf({width:S},l),className:"emoji-mart emoji-mart-".concat(O),"aria-label":u,onKeyDown:this.handleKeyDown},m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(pf,{ref:this.setAnchorsRef,data:this.data,i18n:this.i18n,color:c,categories:this.categories,onAnchorClick:this.handleAnchorClick,icons:this.icons})),m.a.createElement(Pf,{ref:this.setSearchRef,onSearch:this.handleSearch,data:this.data,i18n:this.i18n,emojisToShowFilter:g,include:y,exclude:E,custom:this.CUSTOM,autoFocus:k}),m.a.createElement("div",{ref:this.setScrollRef,className:"emoji-mart-scroll",onScroll:this.handleScroll},this.getCategories().map((function(t,l){return m.a.createElement(Tf,{ref:e.setCategoryRef.bind(e,"category-".concat(l)),key:t.name,id:t.id,name:t.name,emojis:t.emojis,perLine:n,native:_,hasStickyPosition:e.hasStickyPosition,data:e.data,i18n:e.i18n,recent:t.id==e.RECENT_CATEGORY.id?v:void 0,custom:t.id==e.RECENT_CATEGORY.id?e.CUSTOM:void 0,emojiProps:{native:_,skin:x,size:i,set:r,sheetSize:a,sheetColumns:o,sheetRows:s,forceSize:_,tooltip:F,backgroundImageFn:f,useButton:b,onOver:e.handleEmojiOver,onLeave:e.handleEmojiLeave,onClick:e.handleEmojiClick},notFound:C,notFoundEmoji:w})}))),(h||p)&&m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(Lf,{ref:this.setPreviewRef,data:this.data,title:u,emoji:d,showSkinTones:p,showPreview:h,emojiProps:{native:_,size:38,skin:x,set:r,sheetSize:a,sheetColumns:o,sheetRows:s,backgroundImageFn:f},skinsProps:{skin:x,onChange:this.handleSkinChange,skinEmoji:D},i18n:this.i18n})))}}]),t}(m.a.PureComponent);function Hf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}zf.propTypes=qf({},hf,{data:$d.a.object.isRequired}),zf.defaultProps=qf({},Ff);var Wf=function(e){function t(){return y_()(this,t),af()(this,sf()(t).apply(this,arguments))}return uf()(t,e),v_()(t,[{key:"render",value:function(){return m.a.createElement(zf,nf()({},this.props,this.state))}}]),t}(m.a.PureComponent);function Gf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Yf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gf(Object(n),!0).forEach((function(t){ef()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Wf.propTypes=hf,Wf.defaultProps=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hf(Object(n),!0).forEach((function(t){ef()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},Ff,{data:F_});var Vf=function e(t){for(var n in e.defaultProps)null==t[n]&&null!=e.defaultProps[n]&&(t[n]=e.defaultProps[n]);return wf(Yf({},t))};Vf.propTypes=gf,Vf.defaultProps=Yf({},mf,{data:F_});var $f=n(50),Kf={insert:"head",singleton:!1},Qf=(a()($f.a,Kf),$f.a.locals,n(90));function Zf(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,i=m_()(e);if(t){var r=m_()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return h_()(this,n)}}var Xf=function(e){f_()(n,e);var t=Zf(n);function n(){var e;s_()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),c()(c_()(e),"onKeyDown",(function(t){return"Escape"===t.event.key&&(e.props.editor.chain().focus().deleteRange(e.props.range).run(),!0)})),c()(c_()(e),"handleSelect",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(t).run()})),e}return u_()(n,[{key:"render",value:function(){return m.a.createElement(zf,{style:{maxWidth:"100%"},data:Qf,theme:"light",native:!0,set:"apple",showPreview:!1,showSkinTones:!1,onSelect:this.handleSelect,"data-cy":"neeto-editor-emoji-picker"})}}]),n}(m.a.Component);Xf.defaultProps={editor:{},range:{}},Xf.propTypes={editor:$d.a.object.isRequired,range:$d.a.object};var Jf=Xf,eg=function(e){var t=e.editor,n=Object(p.useRef)();return m.a.createElement(jc,{ref:n,closeOnSelect:!1,customTarget:function(){var e;return m.a.createElement(Zd,{icon:Uu.Smiley,iconActive:null==n||null===(e=n.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Emoji",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-emoji-option-button"})},position:"bottom-start"},m.a.createElement(Jf,{editor:t}))},tg=function(e){var t=e.editor,n=e.variables,i=e.setImageUploadVisible,r=e.options,a=e.mentions,o=e.showImageInMention;if(!t)return null;var s=[{Icon:Uu.TextBold,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:Uu.TextItalic,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:Uu.Underline,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline"},{Icon:Uu.TextCross,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:Uu.Highlight,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}].filter((function(e){return r.includes(e.optionName)})),l=[{Icon:Uu.Quote,command:function(){return t.chain().focus().toggleBlockquote().run()},active:t.isActive("blockquote"),optionName:"block-quote"},{Icon:Uu.Code,command:function(){return t.chain().focus().toggleCodeBlock().run()},active:t.isActive("codeBlock"),optionName:"code-block"},{Icon:Uu.Image,command:function(){return i(!0)},active:t.isActive("imageUpload"),optionName:"image-upload"}].filter((function(e){return r.includes(e.optionName)})),u=[{Icon:Uu.ListDot,command:function(){return t.chain().focus().toggleBulletList().run()},active:t.isActive("bulletList"),optionName:"bullet-list"},{Icon:Uu.ListNumber,command:function(){return t.chain().focus().toggleOrderedList().run()},active:t.isActive("orderedList"),optionName:"ordered-list"}].filter((function(e){return r.includes(e.optionName)})),d=r.includes("font-color"),c=r.includes("font-size"),_=r.includes("emoji"),f=r.includes("link"),g=function(e,t){var n=e.Icon,i=e.command,r=e.active,a=e.optionName;return m.a.createElement(Zd,{key:t,icon:n,iconActive:r,onClick:i,tooltipProps:{content:ju(a),position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-".concat(a,"-option")})};return m.a.createElement("div",{className:"neeto-editor-fixed-menu"},c&&m.a.createElement(qc,{editor:t}),s.map(g),d&&m.a.createElement(nc,{color:t.getAttributes("textStyle").color,onChange:function(e){return t.chain().focus().setColor(e).run()}}),_&&m.a.createElement(eg,{editor:t}),f&&m.a.createElement(a_,{editor:t}),l.map(g),u.map(g),m.a.createElement("div",{className:"neeto-editor-fixed-menu-addons"},m.a.createElement(Yc,{editor:t,variables:n}),m.a.createElement(Xc,{editor:t,mentions:a,showImageInMention:o})))},ng=function(e){var t=e.children,n=e.className,i=void 0===n?"root-portal":n,r=e.el,a=void 0===r?"div":r,o=document.getElementsByClassName(i)[0];return o||(o=document.createElement(a)).classList.add(i),m.a.useEffect((function(){document.body.appendChild(o)}),[]),Cu.a.createPortal(t,o)},ig=["children","className"],rg=function(e){var t=e.children,n=e.className,i=h()(e,ig);return m.a.createElement("div",u()({className:b()("ne-backdrop",c()({},n,n))},i),t)},ag=["size","isOpen","onClose","loading","children","className","closeOnEsc","closeButton","backdropClassName","closeOnOutsideClick"],og=function(){},sg="xs",lg="sm",ug="md",dg=function(e){var t=e.size,n=void 0===t?"sm":t,i=e.isOpen,r=void 0!==i&&i,a=e.onClose,o=void 0===a?og:a,s=e.loading,l=void 0!==s&&s,d=e.children,_=e.className,f=void 0===_?"":_,g=e.closeOnEsc,F=void 0===g||g,y=e.closeButton,E=void 0===y||y,v=e.backdropClassName,k=void 0===v?"":v,D=e.closeOnOutsideClick,C=void 0===D||D,w=h()(e,ag),S=Object(p.useRef)();return C&&Rc(S,o),F&&Mc("esc",o),m.a.createElement(ng,{className:"ne-portal"},r&&m.a.createElement(rg,{key:"modal-backdrop",className:b()("ne-modal__backdrop",k)},m.a.createElement("div",u()({ref:S,key:"modal-wrapper",className:b()("ne-modal__wrapper",c()({"ne-modal__wrapper--xs":n===sg,"ne-modal__wrapper--sm":n===lg,"ne-modal__wrapper--md":n===ug},f,f))},w),E&&m.a.createElement(qd,{style:"text",icon:Uu.Close,className:"ne-modal__close",onClick:o}),l?m.a.createElement(m.a.Fragment,null):d)))},cg=["children","size","noUnderline","className"],_g=["active","className","children","icon","onClick","activeClassName"],fg=function(){},gg="large",hg=function(e){var t=e.children,n=e.size,i=e.noUnderline,r=e.className,a=void 0===r?"":r,o=h()(e,cg);return m.a.createElement("div",u()({className:b()({"ne-tab__wrapper":!0},{"ne-tab__wrapper--size-large":n===gg},{"ne-tab__wrapper--underline-none":i},[a]),"data-cy":"tab-container"},o),t)};hg.Item=function(e){var t=e.active,n=e.className,i=void 0===n?"":n,r=e.children,a=e.icon,o=void 0===a?null:a,s=e.onClick,l=void 0===s?fg:s,d=e.activeClassName,c=void 0===d?"":d,_=h()(e,_g),f="button",g="string"==typeof o?function(){return m.a.createElement("i",{className:o,"data-cy":"tab-item-icon"})}:o||m.a.Fragment;return c&&(f=xd),m.a.createElement(f,u()({className:b()(["ne-tab flex items-center justify-center select-none",i],{active:t}),onClick:l,"data-cy":"tab-item"},_),o&&m.a.createElement(g,{className:"ne-tab__icon"}),r)};var pg=hg,mg=function(e){var t,n=Object(p.useState)(null===(t=e[0])||void 0===t?void 0:t.key),i=f()(n,2),r=i[0],a=i[1];return[r,function(e){return a(e.key)}]},Fg=function(e){var t=e.buttonLabel,n=void 0===t?"Submit":t,i=e.placeholder,r=e.onSubmit,a=e.className,o=Object(p.useState)(""),s=f()(o,2),l=s[0],u=s[1],d=Object(p.useState)(""),_=f()(d,2),g=_[0],h=_[1];return m.a.createElement("div",{className:b()("neeto-editor-url-form__wrapper",c()({},a,a))},m.a.createElement(r_,{name:"url",value:l,placeholder:i,onFocus:function(){return h("")},error:g,onChange:function(e){var t=e.target.value;return u(t)},"data-cy":"neeto-editor-image-upload-url-input"}),m.a.createElement(qd,{size:"large",label:n,onClick:function(e){e.preventDefault(),Ud.test(l)?r(l):h("Please enter a valid url")},"data-cy":"neeto-editor-image-upload-url-submit"}))},bg=n(20),yg=n.n(bg),Eg=(n(62),n(74),n(75)),vg=n.n(Eg),kg=(n(76),n(77),n(78),n(79)),Dg=n.n(kg),Cg=n(91),wg=n.n(Cg),Sg=function(e){var t,n=e.uppy,i=Object(p.useState)(0),r=f()(i,2),a=r[0],o=r[1];Object(p.useEffect)((function(){n.on("progress",o)}),[n]);var s="".concat(a,"%");return m.a.createElement("div",{className:"neeto-editor-image-uploader__progress"},m.a.createElement("p",{className:"neeto-editor-image-uploader__progress-title"},"Uploading..."),m.a.createElement("p",{className:"neeto-editor-image-uploader__progress-file"},null===(t=n.getFiles()[0])||void 0===t?void 0:t.name),m.a.createElement("div",{className:"neeto-editor-progress-bar__wrapper","data-cy":"neeto-editor-image-upload-progress-bar"},m.a.createElement("div",{className:"neeto-editor-progress-bar__percent"},m.a.createElement("p",null,s),m.a.createElement(qd,{icon:Uu.Close,onClick:function(){return n.cancelAll()},size:"small",style:"text"})),m.a.createElement("div",{className:"neeto-editor-progress-bar__indicator"},m.a.createElement("div",{style:{width:s},className:"neeto-editor-progress-bar__indicator-inner"}))))};function Og(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var xg={allowMultipleUploads:!1,autoProceed:!0,debug:!0},Tg={formData:!0,fieldName:"blob"},Ng=function(e){var t=e.endpoint,n=void 0===t?"/api/v1/direct_uploads/image_upload":t,i=e.onSuccess,r=Object(p.useState)(!1),a=f()(r,2),o=a[0],s=a[1],l=Dg()((function(){return new yg.a(xg).use(wg.a,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Og(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Og(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({endpoint:n},Tg)).on("upload",(function(){return s(!0)})).on("upload-success",(function(e,t){return i(t.body.imageURL)})).on("cancel-all",(function(){return s(!1)})).on("complete",(function(){return s(!1)}))}));return o?m.a.createElement(Sg,{uppy:l}):m.a.createElement(vg.a,{className:"neeto-editor-image-uploader__dnd",note:"Max. File Size: 5MB",locale:{strings:{dropHereOr:"Drop your file(s) here or %{browse}",browse:"Browse"}},uppy:l,"data-cy":"neeto-editor-image-local-uploader"})},Ag=n(51),Mg=n.n(Ag),Rg=n(92),Ig=n.n(Rg),Lg=n(52),Bg=n.n(Lg),Pg=n(93),jg=n.n(Pg),qg=n(94),Ug=n.n(qg),zg=function(e){var t=e.pageNo,n=e.query,i=e.apiKey;return Ug.a.get("https://api.unsplash.com/search/photos",{headers:{Authorization:"Client-ID ".concat(i)},params:{page:t,per_page:30,order_by:"popular",query:n}})},Hg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:800,n=Object(p.useState)(e),i=f()(n,2),r=i[0],a=i[1];return Object(p.useEffect)((function(){var n=setTimeout((function(){a(e)}),t);return function(){clearTimeout(n)}}),[e]),r},Wg=function(){return m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__loader"},m.a.createElement("span",{className:"neeto-editor-unsplash-gallery__spinner-icon"}))},Gg=function(e){var t=e.onSubmit,n=e.unsplashApiKey,i=Object(p.useRef)(null),r=Object(p.useState)(""),a=f()(r,2),o=a[0],s=a[1],l=Object(p.useState)(!1),u=f()(l,2),d=u[0],c=u[1],_=Object(p.useState)([]),g=f()(_,2),h=g[0],F=g[1],b=Object(p.useState)(1),y=f()(b,2),E=y[0],v=y[1],k=Object(p.useState)(!0),D=f()(k,2),C=D[0],w=D[1],S=Object(p.useState)(!1),O=f()(S,2),x=O[0],T=O[1],N=Hg(o||"latest");Object(p.useEffect)((function(){A(1)}),[N]);var A=function(){var e=Ig()(Bg.a.mark((function e(t){var i,r,a,o;return Bg.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,T(!0),c(!1),e.next=5,zg({page:t,query:N,apiKey:n});case 5:i=e.sent,r=i.data,a=r.results,o=r.total_pages,F(1===t?a:[].concat(Mg()(h),Mg()(a))),v(t+1),w(t<o),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),c(!0);case 15:return e.prev=15,T(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[0,12,15,18]])})));return function(t){return e.apply(this,arguments)}}();return m.a.createElement("div",{className:"neeto-editor-unsplash-wrapper"},m.a.createElement(r_,{name:"text",value:o,placeholder:"Search Unsplash",onChange:function(e){var t=e.target.value;s(t)},"data-cy":"neeto-editor-unsplash-image-picker-search-input"}),d&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-error"},"Something went wrong! Please try again later."),!d&&!x&&od()(h)&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-no-results-error"},"No results"),!d&&m.a.createElement("div",{className:"neeto-editor-unsplash-container"},m.a.createElement(jg.a,{ref:i,pack:!0,style:{width:"100%"},sizes:[{columns:3,gutter:0},{mq:"768px",columns:3,gutter:0},{mq:"1024px",columns:3,gutter:0}],hasMore:C,loadMore:function(){!x&&C&&E>1&&A(E)},position:!0,useWindow:!1,className:"neeto-editor-unsplash-gallery",loader:m.a.createElement(Wg,{key:0})},h&&h.map((function(e,n){return m.a.createElement("div",{key:n,className:"neeto-editor-unsplash-gallery__item","data-cy":"neeto-editor-unsplash-image-picker-result-".concat(n)},m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__item-placeholder",style:{paddingBottom:"".concat(e.height/e.width*100,"%")}},m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__item-inner",id:"unsplashImage".concat(n)},m.a.createElement("img",{src:e.urls.regular,onClick:function(){return t(e.urls.small)}}),m.a.createElement("a",{href:"https://unsplash.com/@".concat(e.user.username),target:"_blank",rel:"noreferrer"},e.user.name," "))))}))),!C&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text"},"End of results")))},Yg=[{title:"Upload",key:"local"},{title:"Link",key:"link"},{title:"Unsplash",key:"unsplash"}],Vg=function(e){var t=e.editor,n=e.imageUploadUrl,i=e.isVisible,r=e.setIsVisible,a=e.unsplashApiKey,o=e.isUnsplashImageUploadActive,s=mg(Yg),l=f()(s,2),u=l[0],d=l[1],c=function(e){t.chain().focus().setImage({src:e}).run(),r(!1)},_={local:function(){return m.a.createElement(Ng,{enpoint:n,onSuccess:c})},link:function(){return m.a.createElement(Fg,{onSubmit:c,buttonLabel:"Upload Image",placeholder:"Paste the image link"})},unsplash:function(){return m.a.createElement(Gg,{unsplashApiKey:a,onSubmit:c})}}[u];return m.a.createElement(dg,{isOpen:i,onClose:function(){return r(!1)},closeButton:!1},m.a.createElement("div",{className:"neeto-editor-image-uploader"},m.a.createElement(pg,null,Yg.filter((function(e){return"unsplash"!==e.key||o})).map((function(e){return m.a.createElement(pg.Item,{key:e.key,active:u===e.key,onClick:function(){return d(e)}},e.title)}))),m.a.createElement("div",{className:"neeto-editor-image-uploader__content"},m.a.createElement(_,null))))},$g=n(39),Kg=n.n($g),Qg=n(95);function Zg(e,t){return Array(t+1).join(e)}var Xg=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function Jg(e){return ih(e,Xg)}var eh=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function th(e){return ih(e,eh)}var nh=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function ih(e,t){return t.indexOf(e.nodeName)>=0}function rh(e,t){return e.getElementsByTagName&&t.some((function(t){return e.getElementsByTagName(t).length}))}var ah={};function oh(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function sh(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function lh(e,t,n){for(var i=0;i<e.length;i++){var r=e[i];if(uh(r,t,n))return r}}function uh(e,t,n){var i=e.filter;if("string"==typeof i){if(i===t.nodeName.toLowerCase())return!0}else if(Array.isArray(i)){if(i.indexOf(t.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof i)throw new TypeError("`filter` needs to be a string, array, or function");if(i.call(e,t,n))return!0}}function dh(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function ch(e,t,n){return e&&e.parentNode===t||n(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}ah.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},ah.lineBreak={filter:"br",replacement:function(e,t,n){return n.br+"\n"}},ah.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,n){var i=Number(t.nodeName.charAt(1));return"setext"===n.headingStyle&&i<3?"\n\n"+e+"\n"+Zg(1===i?"=":"-",e.length)+"\n\n":"\n\n"+Zg("#",i)+" "+e+"\n\n"}},ah.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},ah.list={filter:["ul","ol"],replacement:function(e,t){var n=t.parentNode;return"LI"===n.nodeName&&n.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},ah.listItem={filter:"li",replacement:function(e,t,n){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var i=n.bulletListMarker+" ",r=t.parentNode;if("OL"===r.nodeName){var a=r.getAttribute("start"),o=Array.prototype.indexOf.call(r.children,t);i=(a?Number(a)+o:o+1)+". "}return i+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},ah.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},ah.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){for(var i,r=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],a=t.firstChild.textContent,o=n.fence.charAt(0),s=3,l=new RegExp("^"+o+"{3,}","gm");i=l.exec(a);)i[0].length>=s&&(s=i[0].length+1);var u=Zg(o,s);return"\n\n"+u+r+"\n"+a.replace(/\n$/,"")+"\n"+u+"\n\n"}},ah.horizontalRule={filter:"hr",replacement:function(e,t,n){return"\n\n"+n.hr+"\n\n"}},ah.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var n=t.getAttribute("href"),i=oh(t.getAttribute("title"));return i&&(i=' "'+i+'"'),"["+e+"]("+n+i+")"}},ah.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,n){var i,r,a=t.getAttribute("href"),o=oh(t.getAttribute("title"));switch(o&&(o=' "'+o+'"'),n.linkReferenceStyle){case"collapsed":i="["+e+"][]",r="["+e+"]: "+a+o;break;case"shortcut":i="["+e+"]",r="["+e+"]: "+a+o;break;default:var s=this.references.length+1;i="["+e+"]["+s+"]",r="["+s+"]: "+a+o}return this.references.push(r),i},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},ah.emphasis={filter:["em","i"],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:""}},ah.strong={filter:["strong","b"],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:""}},ah.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!n},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",n="`",i=e.match(/`+/gm)||[];-1!==i.indexOf(n);)n+="`";return n+t+e+t+n}},ah.image={filter:"img",replacement:function(e,t){var n=oh(t.getAttribute("alt")),i=t.getAttribute("src")||"",r=oh(t.getAttribute("title"));return i?"!["+n+"]("+i+(r?' "'+r+'"':"")+")":""}},sh.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){return e.isBlank?this.blankRule:(t=lh(this.array,e,this.options))||(t=lh(this._keep,e,this.options))||(t=lh(this._remove,e,this.options))?t:this.defaultRule;var t},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};var _h="undefined"!=typeof window?window:{};var fh,gh,hh=function(){var e=_h.DOMParser,t=!1;try{(new e).parseFromString("","text/html")&&(t=!0)}catch(e){}return t}()?_h.DOMParser:(fh=function(){},function(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch(t){window.ActiveXObject&&(e=!0)}return e}()?fh.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t}:fh.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t},fh);function ph(e,t){var n;"string"==typeof e?n=(gh=gh||new hh).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):n=e.cloneNode(!0);return function(e){var t=e.element,n=e.isBlock,i=e.isVoid,r=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!r(t)){for(var a=null,o=!1,s=null,l=ch(s,t,r);l!==t;){if(3===l.nodeType||4===l.nodeType){var u=l.data.replace(/[ \r\n\t]+/g," ");if(a&&!/ $/.test(a.data)||o||" "!==u[0]||(u=u.substr(1)),!u){l=dh(l);continue}l.data=u,a=l}else{if(1!==l.nodeType){l=dh(l);continue}n(l)||"BR"===l.nodeName?(a&&(a.data=a.data.replace(/ $/,"")),a=null,o=!1):i(l)||r(l)?(a=null,o=!0):a&&(o=!1)}var d=ch(s,l,r);s=l,l=d}a&&(a.data=a.data.replace(/ $/,""),a.data||dh(a))}}({element:n,isBlock:Jg,isVoid:th,isPre:t.preformattedCode?mh:null}),n}function mh(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function Fh(e,t){return e.isBlock=Jg(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=function(e){return!th(e)&&!function(e){return ih(e,nh)}(e)&&/^\s*$/i.test(e.textContent)&&!function(e){return rh(e,eh)}(e)&&!function(e){return rh(e,nh)}(e)}(e),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var n=(i=e.textContent,r=i.match(/^(([ \t\r\n]*)(\s*))[\s\S]*?((\s*?)([ \t\r\n]*))$/),{leading:r[1],leadingAscii:r[2],leadingNonAscii:r[3],trailing:r[4],trailingNonAscii:r[5],trailingAscii:r[6]});var i,r;n.leadingAscii&&bh("left",e,t)&&(n.leading=n.leadingNonAscii);n.trailingAscii&&bh("right",e,t)&&(n.trailing=n.trailingNonAscii);return{leading:n.leading,trailing:n.trailing}}(e,t),e}function bh(e,t,n){var i,r,a;return"left"===e?(i=t.previousSibling,r=/ $/):(i=t.nextSibling,r=/^ /),i&&(3===i.nodeType?a=r.test(i.nodeValue):n.preformattedCode&&"CODE"===i.nodeName?a=!1:1!==i.nodeType||Jg(i)||(a=r.test(i.textContent))),a}var yh=Array.prototype.reduce,Eh=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function vh(e){if(!(this instanceof vh))return new vh(e);var t={rules:ah,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])}return e}({},t,e),this.rules=new sh(this.options)}function kh(e){var t=this;return yh.call(e.childNodes,(function(e,n){var i="";return 3===(n=new Fh(n,t.options)).nodeType?i=n.isCode?n.nodeValue:t.escape(n.nodeValue):1===n.nodeType&&(i=Ch.call(t,n)),wh(e,i)}),"")}function Dh(e){var t=this;return this.rules.forEach((function(n){"function"==typeof n.append&&(e=wh(e,n.append(t.options)))})),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function Ch(e){var t=this.rules.forNode(e),n=kh.call(this,e),i=e.flankingWhitespace;return(i.leading||i.trailing)&&(n=n.trim()),i.leading+t.replacement(n,e,this.options)+i.trailing}function wh(e,t){var n=function(e){for(var t=e.length;t>0&&"\n"===e[t-1];)t--;return e.substring(0,t)}(e),i=t.replace(/^\n*/,""),r=Math.max(e.length-n.length,t.length-i.length);return n+"\n\n".substring(0,r)+i}vh.prototype={turndown:function(e){if(!function(e){return null!=e&&("string"==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(""===e)return"";var t=kh.call(this,new ph(e,this.options));return Dh.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else{if("function"!=typeof e)throw new TypeError("plugin must be a Function or an Array of Functions");e(this)}return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return Eh.reduce((function(e,t){return e.replace(t[0],t[1])}),e)}};var Sh=vh,Oh=function(e){e=e.replaceAll(/^\\$/gm,"<p></p>");var t=Qg.marked.parse(e);return t=(t=(t=t.replace(/<p><img[^>]*><\/p>/g,(function(e){return e.replace(/<\/?p>/g,"")}))).replaceAll(/==([^=]+)==/g,"<mark>$1</mark>")).replaceAll(/--([^-]+)--/g,"<u>$1</u>"),Kg.a.sanitize(t)},xh=["editor","className","style","strategy","onChange","onSubmit","value"],Th=function(e){var t=e.editor,n=e.className,i=e.style,r=e.strategy,a=e.onChange,o=e.onSubmit,s=e.value,l=h()(e,xh),d=Object(p.useState)((function(){return e=(null==t?void 0:t.getHTML())||s,(n=new Sh({headingStyle:"atx",codeBlockStyle:"fenced",blankReplacement:function(e,t){return t.isBlock?"\\\n":""}})).addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~".concat(e,"~")}}),n.addRule("highlight",{filter:["mark"],replacement:function(e){return"==".concat(e,"==")}}),n.addRule("underline",{filter:["u"],replacement:function(e){return"--".concat(e,"--")}}),n.turndown(e);var e,n})),_=f()(d,2),g=_[0],F=_[1],y=Object(p.useRef)(),E=Object(p.useRef)(g);Object(p.useEffect)((function(){E.current=g}),[g]),Object(p.useEffect)((function(){return document.addEventListener("keydown",v),function(){null==t||t.commands.setContent(Oh(E.current)),document.removeEventListener("keydown",v)}}),[]),Object(p.useLayoutEffect)((function(){y.current.style=i,"flexible"===r&&(y.current.style.height=y.current.scrollHeight+2+"px")}),[g]);var v=function(e){"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(null==o||o(Oh(E.current)),y.current.blur())};return m.a.createElement("textarea",u()({ref:y,value:g,onChange:function(e){F(e.target.value),null==a||a(Oh(e.target.value))},className:b()("ProseMirror neeto-editor-markdown",c()({},n,n)),"data-cy":"neeto-editor-markdown-editor"},l))};const Nh=/^\s*>\s$/,Ah=_s.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block*",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",rs(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[bs({find:Nh,type:this.type})]}}),Mh=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Rh=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Ih=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Lh=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Bh=fs.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",rs(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[ps({find:Mh,type:this.type}),ps({find:Ih,type:this.type})]},addPasteRules(){return[ys({find:Rh,type:this.type}),ys({find:Lh,type:this.type})]}}),Ph=/^\s*([-+*])\s$/,jh=_s.create({name:"bulletList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",rs(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleBulletList:()=>({commands:e})=>e.toggleList("bulletList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[bs({find:Ph,type:this.type})]}}),qh=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,Uh=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,zh=fs.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",rs(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[ps({find:qh,type:this.type})]},addPasteRules(){return[ys({find:Uh,type:this.type})]}}),Hh=/^```(?<language>[a-z]*)?[\s\n]$/,Wh=/^~~~(?<language>[a-z]*)?[\s\n]$/,Gh=_s.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,i=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return i||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[ms({find:Hh,type:this.type,getAttributes:({groups:e})=>e}),ms({find:Wh,type:this.type,getAttributes:({groups:e})=>e})]},addProseMirrorPlugins(){return[new Mt({key:new Lt("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"),i=t.clipboardData.getData("vscode-editor-data"),r=i?JSON.parse(i):void 0,a=null==r?void 0:r.mode;if(!n||!a)return!1;const{tr:o}=e.state;return o.replaceSelectionWith(this.type.create({language:a})),o.setSelection(mt.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.insertText(n.replace(/\r\n?/g,"\n")),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}});var Yh=_s.create({name:"doc",topNode:!0,content:"block+"});var Vh=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 i=function(e){return n[t](e)};return e.dom.addEventListener(t,i),{name:t,handler:i}}))};Vh.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var n=t.name,i=t.handler;return e.editorView.dom.removeEventListener(n,i)}))},Vh.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())},Vh.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},Vh.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,i=t.nodeAfter;if(n||i){var r=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),a=n?r.bottom:r.top;n&&i&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:r.left,right:r.right,top:a-this.width/2,bottom:a+this.width/2}}}if(!e){var o=this.editorView.coordsAtPos(this.cursorPos);e={left:o.left-this.width/2,right:o.left+this.width/2,top:o.top,bottom:o.bottom}}var s,l,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!u||u==document.body&&"static"==getComputedStyle(u).position)s=-pageXOffset,l=-pageYOffset;else{var d=u.getBoundingClientRect();s=d.left-u.scrollLeft,l=d.top-u.scrollTop}this.element.style.left=e.left-s+"px",this.element.style.top=e.top-l+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"},Vh.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},Vh.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=Je(this.editorView.state.doc,n,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(n),this.scheduleRemoval(5e3)}}},Vh.prototype.dragend=function(){this.scheduleRemoval(20)},Vh.prototype.drop=function(){this.scheduleRemoval(20)},Vh.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};const $h=ma.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:null}),addProseMirrorPlugins(){return[(e=this.options,void 0===e&&(e={}),new Mt({view:function(t){return new Vh(t,e)}}))];var e}});var Kh=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,i){var r=n.resolve(i.map(this.head));return t.valid(r)?new t(r):e.near(r)},t.prototype.content=function(){return x.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 Qh(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 i=e.node(t).child(n-1);;i=i.lastChild){if(0==i.childCount&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var n=e.indexAfter(t),i=e.node(t);if(n!=i.childCount)for(var r=i.child(n);;r=r.firstChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}(e))return!1;var n=t.type.spec.allowGapCursor;if(null!=n)return n;var i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock},t.findFrom=function(e,n,i){e:for(;;){if(!i&&t.valid(e))return e;for(var r=e.pos,a=null,o=e.depth;;o--){var s=e.node(o);if(n>0?e.indexAfter(o)<s.childCount:e.index(o)>0){a=s.child(n>0?e.indexAfter(o):e.index(o)-1);break}if(0==o)return null;r+=n;var l=e.doc.resolve(r);if(t.valid(l))return l}for(;;){var u=n>0?a.firstChild:a.lastChild;if(!u){if(a.isAtom&&!a.isText&&!bt.isSelectable(a)){e=e.doc.resolve(r+a.nodeSize*n),i=!1;continue e}break}a=u,r+=n;var d=e.doc.resolve(r);if(t.valid(d))return d}return null}},t}(gt);Kh.prototype.visible=!1,gt.jsonID("gapcursor",Kh);var Qh=function(e){this.pos=e};Qh.prototype.map=function(e){return new Qh(e.map(this.pos))},Qh.prototype.resolve=function(e){var t=e.resolve(this.pos);return Kh.valid(t)?new Kh(t):gt.near(t)};var Zh=ca({ArrowLeft:Xh("horiz",-1),ArrowRight:Xh("horiz",1),ArrowUp:Xh("vert",-1),ArrowDown:Xh("vert",1)});function Xh(e,t){var n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,i,r){var a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof mt){if(!r.endOfTextblock(n)||0==o.depth)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}var l=Kh.findFrom(o,t,s);return!!l&&(i&&i(e.tr.setSelection(new Kh(l))),!0)}}function Jh(e,t,n){if(!e.editable)return!1;var i=e.state.doc.resolve(t);if(!Kh.valid(i))return!1;var r=e.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(r>-1&&bt.isSelectable(e.state.doc.nodeAt(r)))&&(e.dispatch(e.state.tr.setSelection(new Kh(i))),!0)}function ep(e){if(!(e.selection instanceof Kh))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",Rr.create(e.doc,[Tr.widget(e.selection.head,t,{key:"gapcursor"})])}const tp=ma.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Mt({props:{decorations:ep,createSelectionBetween:function(e,t,n){if(t.pos==n.pos&&Kh.valid(n))return new Kh(n)},handleClick:Jh,handleKeyDown:Zh}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=ha(pa(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),np=_s.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",rs(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:i})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{keepMarks:e}=this.options,{splittableMarks:r}=i.extensionManager,a=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();return t().insertContent({type:this.name}).command(({tr:t,dispatch:n})=>{if(n&&a&&e){const e=a.filter(e=>r.includes(e.type.name));t.ensureMarks(e)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ip=_s.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]),rs(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=>ms({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var rp=function(){};rp.prototype.append=function(e){return e.length?(e=rp.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},rp.prototype.prepend=function(e){return e.length?rp.from(e).append(this):this},rp.prototype.appendInner=function(e){return new op(this,e)},rp.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?rp.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},rp.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},rp.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)},rp.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var i=[];return this.forEach((function(t,n){return i.push(e(t,n))}),t,n),i},rp.from=function(e){return e instanceof rp?e:e&&e.length?new ap(e):rp.empty};var ap=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,i){for(var r=t;r<n;r++)if(!1===e(this.values[r],i+r))return!1},t.prototype.forEachInvertedInner=function(e,t,n,i){for(var r=t-1;r>=n;r--)if(!1===e(this.values[r],i+r))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}(rp);rp.empty=new ap([]);var op=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,i){var r=this.left.length;return!(t<r&&!1===this.left.forEachInner(e,t,Math.min(n,r),i))&&(!(n>r&&!1===this.right.forEachInner(e,Math.max(t-r,0),Math.min(this.length,n)-r,i+r))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,i){var r=this.left.length;return!(t>r&&!1===this.right.forEachInvertedInner(e,t-r,Math.max(n,r)-r,i+r))&&(!(n<r&&!1===this.left.forEachInvertedInner(e,Math.min(t,r),n,i))&&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}(rp),sp=rp,lp=function(e,t){this.items=e,this.eventCount=t};lp.prototype.popEvent=function(e,t){var n=this;if(0==this.eventCount)return null;for(var i,r,a=this.items.length;;a--){if(this.items.get(a-1).selection){--a;break}}t&&(i=this.remapping(a,this.items.length),r=i.maps.length);var o,s,l=e.tr,u=[],d=[];return this.items.forEach((function(e,t){if(!e.step)return i||(i=n.remapping(a,t+1),r=i.maps.length),r--,void d.push(e);if(i){d.push(new up(e.map));var c,_=e.step.map(i.slice(r));_&&l.maybeStep(_).doc&&(c=l.mapping.maps[l.mapping.maps.length-1],u.push(new up(c,null,null,u.length+d.length))),r--,c&&i.appendMap(c,r)}else l.maybeStep(e.step);return e.selection?(o=i?e.selection.map(i.slice(r)):e.selection,s=new lp(n.items.slice(0,a).append(d.reverse().concat(u)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:o}},lp.prototype.addTransform=function(e,t,n,i){for(var r=[],a=this.eventCount,o=this.items,s=!i&&o.length?o.get(o.length-1):null,l=0;l<e.steps.length;l++){var u,d=e.steps[l].invert(e.docs[l]),c=new up(e.mapping.maps[l],d,t);(u=s&&s.merge(c))&&(c=u,l?r.pop():o=o.slice(0,o.length-1)),r.push(c),t&&(a++,t=null),i||(s=c)}var _,f,g,h=a-n.depth;return h>cp&&(f=h,(_=o).forEach((function(e,t){if(e.selection&&0==f--)return g=t,!1})),o=_.slice(g),a-=h),new lp(o.append(r),a)},lp.prototype.remapping=function(e,t){var n=new Ie;return this.items.forEach((function(t,i){var r=null!=t.mirrorOffset&&i-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:null;n.appendMap(t.map,r)}),e,t),n},lp.prototype.addMaps=function(e){return 0==this.eventCount?this:new lp(this.items.append(e.map((function(e){return new up(e)}))),this.eventCount)},lp.prototype.rebased=function(e,t){if(!this.eventCount)return this;var n=[],i=Math.max(0,this.items.length-t),r=e.mapping,a=e.steps.length,o=this.eventCount;this.items.forEach((function(e){e.selection&&o--}),i);var s=t;this.items.forEach((function(t){var i=r.getMirror(--s);if(null!=i){a=Math.min(a,i);var l=r.maps[i];if(t.step){var u=e.steps[i].invert(e.docs[i]),d=t.selection&&t.selection.map(r.slice(s+1,i));d&&o++,n.push(new up(l,u,d))}else n.push(new up(l))}}),i);for(var l=[],u=t;u<a;u++)l.push(new up(r.maps[u]));var d=this.items.slice(0,i).append(l).append(n),c=new lp(d,o);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c},lp.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},lp.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),n=t.maps.length,i=[],r=0;return this.items.forEach((function(a,o){if(o>=e)i.push(a),a.selection&&r++;else if(a.step){var s=a.step.map(t.slice(n)),l=s&&s.getMap();if(n--,l&&t.appendMap(l,n),s){var u=a.selection&&a.selection.map(t.slice(n));u&&r++;var d,c=new up(l.invert(),s,u),_=i.length-1;(d=i.length&&i[_].merge(c))?i[_]=d:i.push(c)}}else a.map&&n--}),this.items.length,0),new lp(sp.from(i.reverse()),r)},lp.empty=new lp(sp.empty,0);var up=function(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i};up.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new up(t.getMap().invert(),t,this.selection)}};var dp=function(e,t,n,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i},cp=20;function _p(e){var t=[];return e.forEach((function(e,n,i,r){return t.push(i,r)})),t}function fp(e,t){if(!e)return null;for(var n=[],i=0;i<e.length;i+=2){var r=t.map(e[i],1),a=t.map(e[i+1],-1);r<=a&&n.push(r,a)}return n}function gp(e,t,n,i){var r=mp(t),a=Fp.get(t).spec.config,o=(i?e.undone:e.done).popEvent(t,r);if(o){var s=o.selection.resolve(o.transform.doc),l=(i?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),a,r),u=new dp(i?l:o.remaining,i?o.remaining:l,null,0);n(o.transform.setSelection(s).setMeta(Fp,{redo:i,historyState:u}).scrollIntoView())}}var hp=!1,pp=null;function mp(e){var t=e.plugins;if(pp!=t){hp=!1,pp=t;for(var n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){hp=!0;break}}return hp}var Fp=new Lt("history"),bp=new Lt("closeHistory");function yp(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new Mt({key:Fp,state:{init:function(){return new dp(lp.empty,lp.empty,null,0)},apply:function(t,n,i){return function(e,t,n,i){var r,a=n.getMeta(Fp);if(a)return a.historyState;n.getMeta(bp)&&(e=new dp(e.done,e.undone,null,0));var o=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(o&&o.getMeta(Fp))return o.getMeta(Fp).redo?new dp(e.done.addTransform(n,null,i,mp(t)),e.undone,_p(n.mapping.maps[n.steps.length-1]),e.prevTime):new dp(e.done,e.undone.addTransform(n,null,i,mp(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))return(r=n.getMeta("rebased"))?new dp(e.done.rebased(n,r),e.undone.rebased(n,r),fp(e.prevRanges,n.mapping),e.prevTime):new dp(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),fp(e.prevRanges,n.mapping),e.prevTime);var s=0==e.prevTime||!o&&(e.prevTime<(n.time||0)-i.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;return e.mapping.maps[0].forEach((function(e,i){for(var r=0;r<t.length;r+=2)e<=t[r+1]&&i>=t[r]&&(n=!0)})),n}(n,e.prevRanges)),l=o?fp(e.prevRanges,n.mapping):_p(n.mapping.maps[n.steps.length-1]);return new dp(e.done.addTransform(n,s?t.selection.getBookmark():null,i,mp(t)),lp.empty,l,n.time)}(n,i,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var n="historyUndo"==t.inputType?Ep(e.state,e.dispatch):"historyRedo"==t.inputType&&vp(e.state,e.dispatch);return n&&t.preventDefault(),n}}}})}function Ep(e,t){var n=Fp.getState(e);return!(!n||0==n.done.eventCount)&&(t&&gp(n,e,t,!1),!0)}function vp(e,t){var n=Fp.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&gp(n,e,t,!0),!0)}const kp=ma.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Ep(e,t),redo:()=>({state:e,dispatch:t})=>vp(e,t)}),addProseMirrorPlugins(){return[yp(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()}}}),Dp=_s.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",rs(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().command(({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:i,$anchor:r}=n,a=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;if(!i||!a||!t)return!0;const o=r.before(),s=r.start();return e.deleteRange(o,s),e.setSelection(mt.create(e.doc,o)),!0}).insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{var n;if(t){const{parent:t,pos:i}=e.selection.$from,r=i+1;if(!e.doc.nodeAt(r)){const i=null===(n=t.type.contentMatch.defaultType)||void 0===n?void 0:n.create();i&&(e.insert(r,i),e.setSelection(mt.create(e.doc,r)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[gs({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Cp=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,wp=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,Sp=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,Op=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,xp=fs.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",rs(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[ps({find:Cp,type:this.type}),ps({find:Sp,type:this.type})]},addPasteRules(){return[ys({find:wp,type:this.type}),ys({find:Op,type:this.type})]}}),Tp=_s.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",rs(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")}}}),Np=/^(\d+)\.\s$/,Ap=_s.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",rs(this.options.HTMLAttributes,n),0]:["ol",rs(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleOrderedList:()=>({commands:e})=>e.toggleList("orderedList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[bs({find:Np,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),Mp=_s.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",rs(this.options.HTMLAttributes,e),0]},addCommands:()=>({setParagraph:()=>({commands:e})=>e.setNode("paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Rp=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,Ip=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,Lp=fs.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",rs(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[ps({find:Rp,type:this.type})]},addPasteRules(){return[ys({find:Ip,type:this.type})]}});var Bp=_s.create({name:"text",group:"inline"});const Pp=ma.create({name:"starterKit",addExtensions(){var e,t,n,i,r,a,o,s,l,u,d,c,_,f,g,h,p,m;const F=[];return!1!==this.options.blockquote&&F.push(Ah.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&F.push(Bh.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&F.push(jh.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&F.push(zh.configure(null===(i=this.options)||void 0===i?void 0:i.code)),!1!==this.options.codeBlock&&F.push(Gh.configure(null===(r=this.options)||void 0===r?void 0:r.codeBlock)),!1!==this.options.document&&F.push(Yh.configure(null===(a=this.options)||void 0===a?void 0:a.document)),!1!==this.options.dropcursor&&F.push($h.configure(null===(o=this.options)||void 0===o?void 0:o.dropcursor)),!1!==this.options.gapcursor&&F.push(tp.configure(null===(s=this.options)||void 0===s?void 0:s.gapcursor)),!1!==this.options.hardBreak&&F.push(np.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&F.push(ip.configure(null===(u=this.options)||void 0===u?void 0:u.heading)),!1!==this.options.history&&F.push(kp.configure(null===(d=this.options)||void 0===d?void 0:d.history)),!1!==this.options.horizontalRule&&F.push(Dp.configure(null===(c=this.options)||void 0===c?void 0:c.horizontalRule)),!1!==this.options.italic&&F.push(xp.configure(null===(_=this.options)||void 0===_?void 0:_.italic)),!1!==this.options.listItem&&F.push(Tp.configure(null===(f=this.options)||void 0===f?void 0:f.listItem)),!1!==this.options.orderedList&&F.push(Ap.configure(null===(g=this.options)||void 0===g?void 0:g.orderedList)),!1!==this.options.paragraph&&F.push(Mp.configure(null===(h=this.options)||void 0===h?void 0:h.paragraph)),!1!==this.options.strike&&F.push(Lp.configure(null===(p=this.options)||void 0===p?void 0:p.strike)),!1!==this.options.text&&F.push(Bp.configure(null===(m=this.options)||void 0===m?void 0:m.text)),F}}),jp=Fs({find:/--$/,replace:"—"}),qp=Fs({find:/\.\.\.$/,replace:"…"}),Up=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:"“"}),zp=Fs({find:/"$/,replace:"”"}),Hp=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:"‘"}),Wp=Fs({find:/'$/,replace:"’"}),Gp=Fs({find:/<-$/,replace:"←"}),Yp=Fs({find:/->$/,replace:"→"}),Vp=Fs({find:/\(c\)$/,replace:"©"}),$p=Fs({find:/\(tm\)$/,replace:"™"}),Kp=Fs({find:/\(r\)$/,replace:"®"}),Qp=Fs({find:/1\/2$/,replace:"½"}),Zp=Fs({find:/\+\/-$/,replace:"±"}),Xp=Fs({find:/!=$/,replace:"≠"}),Jp=Fs({find:/<<$/,replace:"«"}),em=Fs({find:/>>$/,replace:"»"}),tm=Fs({find:/\d+\s?([*x])\s?\d+$/,replace:"×"}),nm=Fs({find:/\^2$/,replace:"²"}),im=Fs({find:/\^3$/,replace:"³"}),rm=Fs({find:/1\/4$/,replace:"¼"}),am=Fs({find:/3\/4$/,replace:"¾"}),om=ma.create({name:"typography",addInputRules:()=>[jp,qp,Up,zp,Hp,Wp,Gp,Yp,Vp,$p,Kp,Qp,Zp,Xp,Jp,em,tm,nm,im,rm,am]}),sm=/(?:^|\s)((?:==)((?:[^~]+))(?:==))$/,lm=/(?:^|\s)((?:==)((?:[^~]+))(?:==))/g,um=fs.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",rs(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[ps({find:sm,type:this.type})]},addPasteRules(){return[ys({find:lm,type:this.type})]}});var dm=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var n=0;n<e.length;n++)this.size+=e[n].nodeSize},cm={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};dm.prototype.nodesBetween=function(e,t,n,i,r){void 0===i&&(i=0);for(var a=0,o=0;o<t;a++){var s=this.content[a],l=o+s.nodeSize;if(l>e&&!1!==n(s,i+o,r,a)&&s.content.size){var u=o+1;s.nodesBetween(Math.max(0,e-u),Math.min(s.content.size,t-u),n,i+u)}o=l}},dm.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},dm.prototype.textBetween=function(e,t,n,i){var r="",a=!0;return this.nodesBetween(e,t,(function(o,s){o.isText?(r+=o.text.slice(Math.max(e,s)-s,t-s),a=!n):o.isLeaf&&i?(r+="function"==typeof i?i(o):i,a=!n):!a&&o.isBlock&&(r+=n,a=!0)}),0),r},dm.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,n=e.firstChild,i=this.content.slice(),r=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),r=1);r<e.content.length;r++)i.push(e.content[r]);return new dm(i,this.size+e.size)},dm.prototype.cut=function(e,t){if(null==t&&(t=this.size),0==e&&t==this.size)return this;var n=[],i=0;if(t>e)for(var r=0,a=0;a<t;r++){var o=this.content[r],s=a+o.nodeSize;s>e&&((a<e||s>t)&&(o=o.isText?o.cut(Math.max(0,e-a),Math.min(o.text.length,t-a)):o.cut(Math.max(0,e-a-1),Math.min(o.content.size,t-a-1))),n.push(o),i+=o.nodeSize),a=s}return new dm(n,i)},dm.prototype.cutByIndex=function(e,t){return e==t?dm.empty:0==e&&t==this.content.length?this:new dm(this.content.slice(e,t))},dm.prototype.replaceChild=function(e,t){var n=this.content[e];if(n==t)return this;var i=this.content.slice(),r=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new dm(i,r)},dm.prototype.addToStart=function(e){return new dm([e].concat(this.content),this.size+e.nodeSize)},dm.prototype.addToEnd=function(e){return new dm(this.content.concat(e),this.size+e.nodeSize)},dm.prototype.eq=function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0},cm.firstChild.get=function(){return this.content.length?this.content[0]:null},cm.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},cm.childCount.get=function(){return this.content.length},dm.prototype.child=function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t},dm.prototype.maybeChild=function(e){return this.content[e]},dm.prototype.forEach=function(e){for(var t=0,n=0;t<this.content.length;t++){var i=this.content[t];e(i,n,t),n+=i.nodeSize}},dm.prototype.findDiffStart=function(e,t){return void 0===t&&(t=0),function e(t,n,i){for(var r=0;;r++){if(r==t.childCount||r==n.childCount)return t.childCount==n.childCount?null:i;var a=t.child(r),o=n.child(r);if(a!=o){if(!a.sameMarkup(o))return i;if(a.isText&&a.text!=o.text){for(var s=0;a.text[s]==o.text[s];s++)i++;return i}if(a.content.size||o.content.size){var l=e(a.content,o.content,i+1);if(null!=l)return l}i+=a.nodeSize}else i+=a.nodeSize}}(this,e,t)},dm.prototype.findDiffEnd=function(e,t,n){return void 0===t&&(t=this.size),void 0===n&&(n=e.size),function e(t,n,i,r){for(var a=t.childCount,o=n.childCount;;){if(0==a||0==o)return a==o?null:{a:i,b:r};var s=t.child(--a),l=n.child(--o),u=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:i,b:r};if(s.isText&&s.text!=l.text){for(var d=0,c=Math.min(s.text.length,l.text.length);d<c&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,i--,r--;return{a:i,b:r}}if(s.content.size||l.content.size){var _=e(s.content,l.content,i-1,r-1);if(_)return _}i-=u,r-=u}else i-=u,r-=u}}(this,e,t,n)},dm.prototype.findIndex=function(e,t){if(void 0===t&&(t=-1),0==e)return fm(0,e);if(e==this.size)return fm(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var n=0,i=0;;n++){var r=i+this.child(n).nodeSize;if(r>=e)return r==e||t>0?fm(n+1,r):fm(n,i);i=r}},dm.prototype.toString=function(){return"<"+this.toStringInner()+">"},dm.prototype.toStringInner=function(){return this.content.join(", ")},dm.prototype.toJSON=function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null},dm.fromJSON=function(e,t){if(!t)return dm.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new dm(t.map(e.nodeFromJSON))},dm.fromArray=function(e){if(!e.length)return dm.empty;for(var t,n=0,i=0;i<e.length;i++){var r=e[i];n+=r.nodeSize,i&&r.isText&&e[i-1].sameMarkup(r)?(t||(t=e.slice(0,i)),t[t.length-1]=r.withText(t[t.length-1].text+r.text)):t&&t.push(r)}return new dm(t||e,n)},dm.from=function(e){if(!e)return dm.empty;if(e instanceof dm)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new dm([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(dm.prototype,cm);var _m={index:0,offset:0};function fm(e,t){return _m.index=e,_m.offset=t,_m}function gm(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!gm(e[i],t[i]))return!1}else{for(var r in e)if(!(r in t)||!gm(e[r],t[r]))return!1;for(var a in t)if(!(a in e))return!1}return!0}dm.empty=new dm([],0);var hm=function(e,t){this.type=e,this.attrs=t};function pm(e){var t=Error.call(this,e);return t.__proto__=pm.prototype,t}hm.prototype.addToSet=function(e){for(var t,n=!1,i=0;i<e.length;i++){var r=e[i];if(this.eq(r))return e;if(this.type.excludes(r.type))t||(t=e.slice(0,i));else{if(r.type.excludes(this.type))return e;!n&&r.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(r)}}return t||(t=e.slice()),n||t.push(this),t},hm.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e},hm.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1},hm.prototype.eq=function(e){return this==e||this.type==e.type&&gm(this.attrs,e.attrs)},hm.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e},hm.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[t.type];if(!n)throw new RangeError("There is no mark type "+t.type+" in this schema");return n.create(t.attrs)},hm.sameSet=function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0},hm.setFrom=function(e){if(!e||0==e.length)return hm.none;if(e instanceof hm)return[e];var t=e.slice();return t.sort((function(e,t){return e.type.rank-t.type.rank})),t},hm.none=[],pm.prototype=Object.create(Error.prototype),pm.prototype.constructor=pm,pm.prototype.name="ReplaceError";var mm=function(e,t,n){this.content=e,this.openStart=t,this.openEnd=n},Fm={size:{configurable:!0}};function bm(e,t,n){if(n.openStart>e.depth)throw new pm("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new pm("Inconsistent open depths");return function e(t,n,i,r){var a=t.index(r),o=t.node(r);if(a==n.index(r)&&r<t.depth-i.openStart){var s=e(t,n,i,r+1);return o.copy(o.content.replaceChild(a,s))}if(i.content.size){if(i.openStart||i.openEnd||t.depth!=r||n.depth!=r){var l=function(e,t){for(var n=t.depth-e.openStart,i=t.node(n).copy(e.content),r=n-1;r>=0;r--)i=t.node(r).copy(dm.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}(i,t),u=l.start,d=l.end;return Dm(o,function e(t,n,i,r,a){var o=t.depth>a&&Em(t,n,a+1),s=r.depth>a&&Em(i,r,a+1),l=[];km(null,t,a,l),o&&s&&n.index(a)==i.index(a)?(ym(o,s),vm(Dm(o,e(t,n,i,r,a+1)),l)):(o&&vm(Dm(o,Cm(t,n,a+1)),l),km(n,i,a,l),s&&vm(Dm(s,Cm(i,r,a+1)),l));return km(r,null,a,l),new dm(l)}(t,u,d,n,r))}var c=t.parent,_=c.content;return Dm(c,_.cut(0,t.parentOffset).append(i.content).append(_.cut(n.parentOffset)))}return Dm(o,Cm(t,n,r))}(e,t,n,0)}function ym(e,t){if(!t.type.compatibleContent(e.type))throw new pm("Cannot join "+t.type.name+" onto "+e.type.name)}function Em(e,t,n){var i=e.node(n);return ym(i,t.node(n)),i}function vm(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function km(e,t,n,i){var r=(t||e).node(n),a=0,o=t?t.index(n):r.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(vm(e.nodeAfter,i),a++));for(var s=a;s<o;s++)vm(r.child(s),i);t&&t.depth==n&&t.textOffset&&vm(t.nodeBefore,i)}function Dm(e,t){if(!e.type.validContent(t))throw new pm("Invalid content for node "+e.type.name);return e.copy(t)}function Cm(e,t,n){var i=[];(km(null,e,n,i),e.depth>n)&&vm(Dm(Em(e,t,n+1),Cm(e,t,n+1)),i);return km(t,null,n,i),new dm(i)}Fm.size.get=function(){return this.content.size-this.openStart-this.openEnd},mm.prototype.insertAt=function(e,t){var n=function e(t,n,i,r){var a=t.findIndex(n),o=a.index,s=a.offset,l=t.maybeChild(o);if(s==n||l.isText)return r&&!r.canReplace(o,o,i)?null:t.cut(0,n).append(i).append(t.cut(n));var u=e(l.content,n-s-1,i);return u&&t.replaceChild(o,l.copy(u))}(this.content,e+this.openStart,t,null);return n&&new mm(n,this.openStart,this.openEnd)},mm.prototype.removeBetween=function(e,t){return new mm(function e(t,n,i){var r=t.findIndex(n),a=r.index,o=r.offset,s=t.maybeChild(a),l=t.findIndex(i),u=l.index,d=l.offset;if(o==n||s.isText){if(d!=i&&!t.child(u).isText)throw new RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(i))}if(a!=u)throw new RangeError("Removing non-flat range");return t.replaceChild(a,s.copy(e(s.content,n-o-1,i-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},mm.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},mm.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},mm.prototype.toJSON=function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e},mm.fromJSON=function(e,t){if(!t)return mm.empty;var n=t.openStart||0,i=t.openEnd||0;if("number"!=typeof n||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new mm(dm.fromJSON(e,t.content),n,i)},mm.maxOpen=function(e,t){void 0===t&&(t=!0);for(var n=0,i=0,r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(var a=e.lastChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.lastChild)i++;return new mm(e,n,i)},Object.defineProperties(mm.prototype,Fm),mm.empty=new mm(dm.empty,0,0);var wm=function(e,t,n){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=n},Sm={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};wm.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},Sm.parent.get=function(){return this.node(this.depth)},Sm.doc.get=function(){return this.node(0)},wm.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},wm.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},wm.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},wm.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},wm.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},wm.prototype.before=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]},wm.prototype.after=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize},Sm.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},Sm.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i},Sm.nodeBefore.get=function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)},wm.prototype.posAtIndex=function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],i=0==t?0:this.path[3*t-1]+1,r=0;r<e;r++)i+=n.child(r).nodeSize;return i},wm.prototype.marks=function(){var e=this.parent,t=this.index();if(0==e.content.size)return hm.none;if(this.textOffset)return e.child(t).marks;var n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){var r=n;n=i,i=r}for(var a=n.marks,o=0;o<a.length;o++)!1!==a[o].type.spec.inclusive||i&&a[o].isInSet(i.marks)||(a=a[o--].removeFromSet(a));return a},wm.prototype.marksAcross=function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var n=t.marks,i=e.parent.maybeChild(e.index()),r=0;r<n.length;r++)!1!==n[r].type.spec.inclusive||i&&n[r].isInSet(i.marks)||(n=n[r--].removeFromSet(n));return n},wm.prototype.sharedDepth=function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0},wm.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Nm(this,e,n)},wm.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},wm.prototype.max=function(e){return e.pos>this.pos?e:this},wm.prototype.min=function(e){return e.pos<this.pos?e:this},wm.prototype.toString=function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset},wm.resolve=function(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var n=[],i=0,r=t,a=e;;){var o=a.content.findIndex(r),s=o.index,l=o.offset,u=r-l;if(n.push(a,s,i+l),!u)break;if((a=a.child(s)).isText)break;r=u-1,i+=l+1}return new wm(t,n,r)},wm.resolveCached=function(e,t){for(var n=0;n<Om.length;n++){var i=Om[n];if(i.pos==t&&i.doc==e)return i}var r=Om[xm]=wm.resolve(e,t);return xm=(xm+1)%Tm,r},Object.defineProperties(wm.prototype,Sm);var Om=[],xm=0,Tm=12,Nm=function(e,t,n){this.$from=e,this.$to=t,this.depth=n},Am={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};Am.start.get=function(){return this.$from.before(this.depth+1)},Am.end.get=function(){return this.$to.after(this.depth+1)},Am.parent.get=function(){return this.$from.node(this.depth)},Am.startIndex.get=function(){return this.$from.index(this.depth)},Am.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(Nm.prototype,Am);var Mm=Object.create(null),Rm=function(e,t,n,i){this.type=e,this.attrs=t,this.content=n||dm.empty,this.marks=i||hm.none},Im={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};Im.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},Im.childCount.get=function(){return this.content.childCount},Rm.prototype.child=function(e){return this.content.child(e)},Rm.prototype.maybeChild=function(e){return this.content.maybeChild(e)},Rm.prototype.forEach=function(e){this.content.forEach(e)},Rm.prototype.nodesBetween=function(e,t,n,i){void 0===i&&(i=0),this.content.nodesBetween(e,t,n,i,this)},Rm.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},Im.textContent.get=function(){return this.textBetween(0,this.content.size,"")},Rm.prototype.textBetween=function(e,t,n,i){return this.content.textBetween(e,t,n,i)},Im.firstChild.get=function(){return this.content.firstChild},Im.lastChild.get=function(){return this.content.lastChild},Rm.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},Rm.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},Rm.prototype.hasMarkup=function(e,t,n){return this.type==e&&gm(this.attrs,t||e.defaultAttrs||Mm)&&hm.sameSet(this.marks,n||hm.none)},Rm.prototype.copy=function(e){return void 0===e&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},Rm.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},Rm.prototype.cut=function(e,t){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))},Rm.prototype.slice=function(e,t,n){if(void 0===t&&(t=this.content.size),void 0===n&&(n=!1),e==t)return mm.empty;var i=this.resolve(e),r=this.resolve(t),a=n?0:i.sharedDepth(t),o=i.start(a),s=i.node(a).content.cut(i.pos-o,r.pos-o);return new mm(s,i.depth-a,r.depth-a)},Rm.prototype.replace=function(e,t,n){return bm(this.resolve(e),this.resolve(t),n)},Rm.prototype.nodeAt=function(e){for(var t=this;;){var n=t.content.findIndex(e),i=n.index,r=n.offset;if(!(t=t.maybeChild(i)))return null;if(r==e||t.isText)return t;e-=r+1}},Rm.prototype.childAfter=function(e){var t=this.content.findIndex(e),n=t.index,i=t.offset;return{node:this.content.maybeChild(n),index:n,offset:i}},Rm.prototype.childBefore=function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,i=t.offset;if(i<e)return{node:this.content.child(n),index:n,offset:i};var r=this.content.child(n-1);return{node:r,index:n-1,offset:i-r.nodeSize}},Rm.prototype.resolve=function(e){return wm.resolveCached(this,e)},Rm.prototype.resolveNoCache=function(e){return wm.resolve(this,e)},Rm.prototype.rangeHasMark=function(e,t,n){var i=!1;return t>e&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.marks)&&(i=!0),!i})),i},Im.isBlock.get=function(){return this.type.isBlock},Im.isTextblock.get=function(){return this.type.isTextblock},Im.inlineContent.get=function(){return this.type.inlineContent},Im.isInline.get=function(){return this.type.isInline},Im.isText.get=function(){return this.type.isText},Im.isLeaf.get=function(){return this.type.isLeaf},Im.isAtom.get=function(){return this.type.isAtom},Rm.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),function(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}(this.marks,e)},Rm.prototype.contentMatchAt=function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t},Rm.prototype.canReplace=function(e,t,n,i,r){void 0===n&&(n=dm.empty),void 0===i&&(i=0),void 0===r&&(r=n.childCount);var a=this.contentMatchAt(e).matchFragment(n,i,r),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(var s=i;s<r;s++)if(!this.type.allowsMarks(n.child(s).marks))return!1;return!0},Rm.prototype.canReplaceWith=function(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;var r=this.contentMatchAt(e).matchType(n),a=r&&r.matchFragment(this.content,t);return!!a&&a.validEnd},Rm.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},Rm.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));for(var e=hm.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!hm.sameSet(e,this.marks))throw new RangeError("Invalid collection of marks for node "+this.type.name+": "+this.marks.map((function(e){return e.type.name})));this.content.forEach((function(e){return e.check()}))},Rm.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((function(e){return e.toJSON()}))),e},Rm.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}var i=dm.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,n)},Object.defineProperties(Rm.prototype,Im);var Lm=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},Bm={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};Lm.parse=function(e,t){var n=new Pm(e,t);if(null==n.next)return Lm.empty;var i=qm(n);n.next&&n.err("Unexpected trailing text");var r=function(e){var t=Object.create(null);return function n(i){var r=[];i.forEach((function(t){e[t].forEach((function(t){var n=t.term,i=t.to;if(n){var a=r.indexOf(n),o=a>-1&&r[a+1];Ym(e,i).forEach((function(e){o||r.push(n,o=[]),-1==o.indexOf(e)&&o.push(e)}))}}))}));for(var a=t[i.join(",")]=new Lm(i.indexOf(e.length-1)>-1),o=0;o<r.length;o+=2){var s=r[o+1].sort(Gm);a.next.push(r[o],t[s.join(",")]||n(s))}return a}(Ym(e,0))}(function(e){var t=[[]];return r(function e(t,a){if("choice"==t.type)return t.exprs.reduce((function(t,n){return t.concat(e(n,a))}),[]);if("seq"==t.type)for(var o=0;;o++){var s=e(t.exprs[o],a);if(o==t.exprs.length-1)return s;r(s,a=n())}else{if("star"==t.type){var l=n();return i(a,l),r(e(t.expr,l),l),[i(l)]}if("plus"==t.type){var u=n();return r(e(t.expr,a),u),r(e(t.expr,u),u),[i(u)]}if("opt"==t.type)return[i(a)].concat(e(t.expr,a));if("range"==t.type){for(var d=a,c=0;c<t.min;c++){var _=n();r(e(t.expr,d),_),d=_}if(-1==t.max)r(e(t.expr,d),d);else for(var f=t.min;f<t.max;f++){var g=n();i(d,g),r(e(t.expr,d),g),d=g}return[i(d)]}if("name"==t.type)return[i(a,null,t.value)]}}(e,0),n()),t;function n(){return t.push([])-1}function i(e,n,i){var r={term:i,to:n};return t[e].push(r),r}function r(e,t){e.forEach((function(e){return e.to=t}))}}(i));return function(e,t){for(var n=0,i=[e];n<i.length;n++){for(var r=i[n],a=!r.validEnd,o=[],s=0;s<r.next.length;s+=2){var l=r.next[s],u=r.next[s+1];o.push(l.name),!a||l.isText||l.hasRequiredAttrs()||(a=!1),-1==i.indexOf(u)&&i.push(u)}a&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(r,n),r},Lm.prototype.matchType=function(e){for(var t=0;t<this.next.length;t+=2)if(this.next[t]==e)return this.next[t+1];return null},Lm.prototype.matchFragment=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.childCount);for(var i=this,r=t;i&&r<n;r++)i=i.matchType(e.child(r).type);return i},Bm.inlineContent.get=function(){var e=this.next[0];return!!e&&e.isInline},Bm.defaultType.get=function(){for(var e=0;e<this.next.length;e+=2){var t=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}},Lm.prototype.compatible=function(e){for(var t=0;t<this.next.length;t+=2)for(var n=0;n<e.next.length;n+=2)if(this.next[t]==e.next[n])return!0;return!1},Lm.prototype.fillBefore=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=0);var i=[this];return function r(a,o){var s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return dm.from(o.map((function(e){return e.createAndFill()})));for(var l=0;l<a.next.length;l+=2){var u=a.next[l],d=a.next[l+1];if(!u.isText&&!u.hasRequiredAttrs()&&-1==i.indexOf(d)){i.push(d);var c=r(d,o.concat(u));if(c)return c}}}(this,[])},Lm.prototype.findWrapping=function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var n=this.computeWrapping(e);return this.wrapCache.push(e,n),n},Lm.prototype.computeWrapping=function(e){for(var t=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var i=n.shift(),r=i.match;if(r.matchType(e)){for(var a=[],o=i;o.type;o=o.via)a.push(o.type);return a.reverse()}for(var s=0;s<r.next.length;s+=2){var l=r.next[s];l.isLeaf||l.hasRequiredAttrs()||l.name in t||i.type&&!r.next[s+1].validEnd||(n.push({match:l.contentMatch,type:l,via:i}),t[l.name]=!0)}}},Bm.edgeCount.get=function(){return this.next.length>>1},Lm.prototype.edge=function(e){var t=e<<1;if(t>=this.next.length)throw new RangeError("There's no "+e+"th edge in this content match");return{type:this.next[t],next:this.next[t+1]}},Lm.prototype.toString=function(){var e=[];return function t(n){e.push(n);for(var i=1;i<n.next.length;i+=2)-1==e.indexOf(n.next[i])&&t(n.next[i])}(this),e.map((function(t,n){for(var i=n+(t.validEnd?"*":" ")+" ",r=0;r<t.next.length;r+=2)i+=(r?", ":"")+t.next[r].name+"->"+e.indexOf(t.next[r+1]);return i})).join("\n")},Object.defineProperties(Lm.prototype,Bm),Lm.empty=new Lm(!0);var Pm=function(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},jm={next:{configurable:!0}};function qm(e){var t=[];do{t.push(Um(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Um(e){var t=[];do{t.push(zm(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function zm(e){for(var t=function(e){if(e.eat("(")){var t=qm(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,i=n[t];if(i)return[i];var r=[];for(var a in n){var o=n[a];o.groups.indexOf(t)>-1&&r.push(o)}0==r.length&&e.err("No node type or group '"+t+"' found");return r}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=Wm(e,t)}return t}function Hm(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function Wm(e,t){var n=Hm(e),i=n;return e.eat(",")&&(i="}"!=e.next?Hm(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function Gm(e,t){return t-e}function Ym(e,t){var n=[];return function t(i){var r=e[i];if(1==r.length&&!r[0].term)return t(r[0].to);n.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=o.term,l=o.to;s||-1!=n.indexOf(l)||t(l)}}(t),n.sort(Gm)}function Vm(e){var t=Object.create(null);for(var n in e){var i=e[n];if(!i.hasDefault)return null;t[n]=i.default}return t}function $m(e,t){var n=Object.create(null);for(var i in e){var r=t&&t[i];if(void 0===r){var a=e[i];if(!a.hasDefault)throw new RangeError("No value supplied for attribute "+i);r=a.default}n[i]=r}return n}function Km(e){var t=Object.create(null);if(e)for(var n in e)t[n]=new Xm(e[n]);return t}jm.next.get=function(){return this.tokens[this.pos]},Pm.prototype.eat=function(e){return this.next==e&&(this.pos++||!0)},Pm.prototype.err=function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")},Object.defineProperties(Pm.prototype,jm);var Qm=function(e,t,n){this.name=e,this.schema=t,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=Km(n.attrs),this.defaultAttrs=Vm(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e},Zm={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};Zm.isInline.get=function(){return!this.isBlock},Zm.isTextblock.get=function(){return this.isBlock&&this.inlineContent},Zm.isLeaf.get=function(){return this.contentMatch==Lm.empty},Zm.isAtom.get=function(){return this.isLeaf||this.spec.atom},Qm.prototype.hasRequiredAttrs=function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1},Qm.prototype.compatibleContent=function(e){return this==e||this.contentMatch.compatible(e.contentMatch)},Qm.prototype.computeAttrs=function(e){return!e&&this.defaultAttrs?this.defaultAttrs:$m(this.attrs,e)},Qm.prototype.create=function(e,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Rm(this,this.computeAttrs(e),dm.from(t),hm.setFrom(n))},Qm.prototype.createChecked=function(e,t,n){if(t=dm.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new Rm(this,this.computeAttrs(e),t,hm.setFrom(n))},Qm.prototype.createAndFill=function(e,t,n){if(e=this.computeAttrs(e),(t=dm.from(t)).size){var i=this.contentMatch.fillBefore(t);if(!i)return null;t=i.append(t)}var r=this.contentMatch.matchFragment(t).fillBefore(dm.empty,!0);return r?new Rm(this,e,t.append(r),hm.setFrom(n)):null},Qm.prototype.validContent=function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0},Qm.prototype.allowsMarkType=function(e){return null==this.markSet||this.markSet.indexOf(e)>-1},Qm.prototype.allowsMarks=function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0},Qm.prototype.allowedMarks=function(e){if(null==this.markSet)return e;for(var t,n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:hm.empty:e},Qm.compile=function(e,t){var n=Object.create(null);e.forEach((function(e,i){return n[e]=new Qm(e,t,i)}));var i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(var r in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties(Qm.prototype,Zm);var Xm=function(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default},Jm={isRequired:{configurable:!0}};Jm.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(Xm.prototype,Jm);var eF=function(e,t,n,i){this.name=e,this.schema=n,this.spec=i,this.attrs=Km(i.attrs),this.rank=t,this.excluded=null;var r=Vm(this.attrs);this.instance=r&&new hm(this,r)};eF.prototype.create=function(e){return!e&&this.instance?this.instance:new hm(this,$m(this.attrs,e))},eF.compile=function(e,t){var n=Object.create(null),i=0;return e.forEach((function(e,r){return n[e]=new eF(e,i++,t,r)})),n},eF.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e},eF.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]},eF.prototype.excludes=function(e){return this.excluded.indexOf(e)>-1};var tF={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},nF={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},iF={ol:!0,ul:!0};function rF(e){return(e?1:0)|("full"===e?2:0)}var aF=function(e,t,n,i,r,a,o){this.type=e,this.attrs=t,this.solid=r,this.match=a||(4&o?null:e.contentMatch),this.options=o,this.content=[],this.marks=n,this.activeMarks=hm.none,this.pendingMarks=i,this.stashMarks=[]};aF.prototype.findWrapping=function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(dm.from(e));if(!t){var n,i=this.type.contentMatch;return(n=i.findWrapping(e.type))?(this.match=i,n):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)},aF.prototype.finish=function(e){if(!(1&this.options)){var t,n=this.content[this.content.length-1];n&&n.isText&&(t=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length)))}var i=dm.from(this.content);return!e&&this.match&&(i=i.append(this.match.fillBefore(dm.empty,!0))),this.type?this.type.create(this.attrs,i,this.marks):i},aF.prototype.popFromStashMark=function(e){for(var t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]},aF.prototype.applyPending=function(e){for(var t=0,n=this.pendingMarks;t<n.length;t++){var i=n[t];(this.type?this.type.allowsMarkType(i.type):lF(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}},aF.prototype.inlineContext=function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!tF.hasOwnProperty(e.parentNode.nodeName.toLowerCase())};var oF=function(e,t,n){this.parser=e,this.options=t,this.isOpen=n;var i,r=t.topNode,a=rF(t.preserveWhitespace)|(n?4:0);i=r?new aF(r.type,r.attrs,hm.none,hm.none,!0,t.topMatch||r.type.contentMatch,a):new aF(n?null:e.schema.topNodeType,null,hm.none,hm.none,!0,null,a),this.nodes=[i],this.open=0,this.find=t.findPositions,this.needsBlock=!1},sF={top:{configurable:!0},currentPos:{configurable:!0}};function lF(e,t){var n=t.schema.nodes,i=function(i){var r=n[i];if(r.allowsMarkType(e)){var a=[],o=function(e){a.push(e);for(var n=0;n<e.edgeCount;n++){var i=e.edge(n),r=i.type,s=i.next;if(r==t)return!0;if(a.indexOf(s)<0&&o(s))return!0}};return o(r.contentMatch)?{v:!0}:void 0}};for(var r in n){var a=i(r);if(a)return a.v}}sF.top.get=function(){return this.nodes[this.open]},oF.prototype.addDOM=function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),n=t?this.readStyles(function(e){var t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,i=[];for(;t=n.exec(e);)i.push(t[1],t[2].trim());return i}(t)):null,i=this.top;if(null!=n)for(var r=0;r<n.length;r++)this.addPendingMark(n[r]);if(this.addElement(e),null!=n)for(var a=0;a<n.length;a++)this.removePendingMark(n[a],i)}},oF.prototype.addTextNode=function(e){var t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){var i=n.content[n.content.length-1],r=e.previousSibling;(!i||r&&"BR"==r.nodeName||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)},oF.prototype.addElement=function(e,t){var n,i=e.nodeName.toLowerCase();iF.hasOwnProperty(i)&&this.parser.normalizeLists&&function(e){for(var t=e.firstChild,n=null;t;t=t.nextSibling){var i=1==t.nodeType?t.nodeName.toLowerCase():null;i&&iF.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):"li"==i?n=t:i&&(n=null)}}(e);var r=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(r?r.ignore:nF.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e);else if(!r||r.skip||r.closeParent){r&&r.closeParent?this.open=Math.max(0,this.open-1):r&&r.skip.nodeType&&(e=r.skip);var a,o=this.top,s=this.needsBlock;if(tF.hasOwnProperty(i))a=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),a&&this.sync(o),this.needsBlock=s}else this.addElementByRule(e,r,!1===r.consuming?n:null)},oF.prototype.leafFallback=function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))},oF.prototype.ignoreFallback=function(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))},oF.prototype.readStyles=function(e){var t=hm.none;e:for(var n=0;n<e.length;n+=2)for(var i=null;;){var r=this.parser.matchStyle(e[n],e[n+1],this,i);if(!r)continue e;if(r.ignore)return null;if(t=this.parser.schema.marks[r.mark].create(r.attrs).addToSet(t),!1!==r.consuming)break;i=r}return t},oF.prototype.addElementByRule=function(e,t,n){var i,r,a,o=this;t.node?(r=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(r.create(t.attrs))||this.leafFallback(e):i=this.enter(r,t.attrs,t.preserveWhitespace):(a=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(a));var s=this.top;if(r&&r.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((function(e){return o.insertNode(e)}));else{var l=t.contentElement;"string"==typeof l?l=e.querySelector(l):"function"==typeof l&&(l=l(e)),l||(l=e),this.findAround(e,l,!0),this.addAll(l,i)}i&&(this.sync(s),this.open--),a&&this.removePendingMark(a,s)},oF.prototype.addAll=function(e,t,n,i){for(var r=n||0,a=n?e.childNodes[n]:e.firstChild,o=null==i?null:e.childNodes[i];a!=o;a=a.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(a),t&&tF.hasOwnProperty(a.nodeName.toLowerCase())&&this.sync(t);this.findAtPoint(e,r)},oF.prototype.findPlace=function(e){for(var t,n,i=this.open;i>=0;i--){var r=this.nodes[i],a=r.findWrapping(e);if(a&&(!t||t.length>a.length)&&(t=a,n=r,!a.length))break;if(r.solid)break}if(!t)return!1;this.sync(n);for(var o=0;o<t.length;o++)this.enterInner(t[o],null,!1);return!0},oF.prototype.insertNode=function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));for(var i=n.activeMarks,r=0;r<e.marks.length;r++)n.type&&!n.type.allowsMarkType(e.marks[r].type)||(i=e.marks[r].addToSet(i));return n.content.push(e.mark(i)),!0}return!1},oF.prototype.enter=function(e,t,n){var i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,n),i},oF.prototype.enterInner=function(e,t,n,i){this.closeExtra();var r=this.top;r.applyPending(e),r.match=r.match&&r.match.matchType(e,t);var a=null==i?-5&r.options:rF(i);4&r.options&&0==r.content.length&&(a|=4),this.nodes.push(new aF(e,t,r.activeMarks,r.pendingMarks,n,null,a)),this.open++},oF.prototype.closeExtra=function(e){var t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}},oF.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},oF.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},sF.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e},oF.prototype.findAtPoint=function(e,t){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)},oF.prototype.findInside=function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)},oF.prototype.findAround=function(e,t,n){if(e!=t&&this.find)for(var i=0;i<this.find.length;i++){if(null==this.find[i].pos&&1==e.nodeType&&e.contains(this.find[i].node))t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}},oF.prototype.findInText=function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))},oF.prototype.matchesContext=function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),i=this.options.context,r=!(this.isOpen||i&&i.parent.type!=this.nodes[0].type),a=-(i?i.depth+1:0)+(r?0:1),o=function(e,s){for(;e>=0;e--){var l=n[e];if(""==l){if(e==n.length-1||0==e)continue;for(;s>=a;s--)if(o(e-1,s))return!0;return!1}var u=s>0||0==s&&r?t.nodes[s].type:i&&s>=a?i.node(s-a).type:null;if(!u||u.name!=l&&-1==u.groups.indexOf(l))return!1;s--}return!0};return o(n.length-1,this.open)},oF.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var i in this.parser.schema.nodes){var r=this.parser.schema.nodes[i];if(r.isTextblock&&r.defaultAttrs)return r}},oF.prototype.addPendingMark=function(e){var t=function(e,t){for(var n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)},oF.prototype.removePendingMark=function(e,t){for(var n=this.open;n>=0;n--){var i=this.nodes[n];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);var r=i.popFromStashMark(e);r&&i.type&&i.type.allowsMarkType(r.type)&&(i.activeMarks=r.addToSet(i.activeMarks))}if(i==t)break}},Object.defineProperties(oF.prototype,sF);var uF=Math.pow(2,16);function dF(e){return 65535&e}var cF=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=null),this.pos=e,this.deleted=t,this.recover=n},_F=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};_F.prototype.recover=function(e){var t=0,n=dF(e);if(!this.inverted)for(var i=0;i<n;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/uF}(e)},_F.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},_F.prototype.map=function(e,t){return void 0===t&&(t=1),this._map(e,t,!0)},_F.prototype._map=function(e,t,n){for(var i=0,r=this.inverted?2:1,a=this.inverted?1:2,o=0;o<this.ranges.length;o+=3){var s=this.ranges[o]-(this.inverted?i:0);if(s>e)break;var l=this.ranges[o+r],u=this.ranges[o+a],d=s+l;if(e<=d){var c=s+i+((l?e==s?-1:e==d?1:t:t)<0?0:u);if(n)return c;var _=e==(t<0?s:d)?null:o/3+(e-s)*uF;return new cF(c,t<0?e!=s:e!=d,_)}i+=u-l}return n?e+i:new cF(e+i)},_F.prototype.touches=function(e,t){for(var n=0,i=dF(t),r=this.inverted?2:1,a=this.inverted?1:2,o=0;o<this.ranges.length;o+=3){var s=this.ranges[o]-(this.inverted?n:0);if(s>e)break;var l=this.ranges[o+r];if(e<=s+l&&o==3*i)return!0;n+=this.ranges[o+a]-l}return!1},_F.prototype.forEach=function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,i=0,r=0;i<this.ranges.length;i+=3){var a=this.ranges[i],o=a-(this.inverted?r:0),s=a+(this.inverted?0:r),l=this.ranges[i+t],u=this.ranges[i+n];e(o,o+l,s,s+u),r+=u-l}},_F.prototype.invert=function(){return new _F(this.ranges,!this.inverted)},_F.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},_F.offset=function(e){return 0==e?_F.empty:new _F(e<0?[0,-e,0]:[0,0,e])},_F.empty=new _F([]);var fF=function(e,t,n,i){this.maps=e||[],this.from=n||0,this.to=null==i?this.maps.length:i,this.mirror=t};function gF(e){var t=Error.call(this,e);return t.__proto__=gF.prototype,t}fF.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.maps.length),new fF(this.maps,this.mirror,e,t)},fF.prototype.copy=function(){return new fF(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},fF.prototype.appendMap=function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)},fF.prototype.appendMapping=function(e){for(var t=0,n=this.maps.length;t<e.maps.length;t++){var i=e.getMirror(t);this.appendMap(e.maps[t],null!=i&&i<t?n+i:null)}},fF.prototype.getMirror=function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]},fF.prototype.setMirror=function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)},fF.prototype.appendMappingInverted=function(e){for(var t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){var i=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=i&&i>t?n-i-1:null)}},fF.prototype.invert=function(){var e=new fF;return e.appendMappingInverted(this),e},fF.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e},fF.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},fF.prototype._map=function(e,t,n){for(var i=!1,r=this.from;r<this.to;r++){var a=this.maps[r].mapResult(e,t);if(null!=a.recover){var o=this.getMirror(r);if(null!=o&&o>r&&o<this.to){r=o,e=this.maps[o].recover(a.recover);continue}}a.deleted&&(i=!0),e=a.pos}return n?e:new cF(e,i)},gF.prototype=Object.create(Error.prototype),gF.prototype.constructor=gF,gF.prototype.name="TransformError";var hF=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new fF},pF={before:{configurable:!0},docChanged:{configurable:!0}};function mF(){throw new Error("Override me")}pF.before.get=function(){return this.docs.length?this.docs[0]:this.doc},hF.prototype.step=function(e){var t=this.maybeStep(e);if(t.failed)throw new gF(t.failed);return this},hF.prototype.maybeStep=function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t},pF.docChanged.get=function(){return this.steps.length>0},hF.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(hF.prototype,pF);var FF=Object.create(null),bF=function(){};bF.prototype.apply=function(e){return mF()},bF.prototype.getMap=function(){return _F.empty},bF.prototype.invert=function(e){return mF()},bF.prototype.map=function(e){return mF()},bF.prototype.merge=function(e){return null},bF.prototype.toJSON=function(){return mF()},bF.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=FF[t.stepType];if(!n)throw new RangeError("No step type "+t.stepType+" defined");return n.fromJSON(e,t)},bF.jsonID=function(e,t){if(e in FF)throw new RangeError("Duplicate use of step JSON ID "+e);return FF[e]=t,t.prototype.jsonID=e,t};var yF=function(e,t){this.doc=e,this.failed=t};yF.ok=function(e){return new yF(e,null)},yF.fail=function(e){return new yF(null,e)},yF.fromReplace=function(e,t,n,i){try{return yF.ok(e.replace(t,n,i))}catch(e){if(e instanceof pm)return yF.fail(e.message);throw e}};var EF=function(e){function t(t,n,i,r){e.call(this),this.from=t,this.to=n,this.slice=i,this.structure=!!r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&kF(e,this.from,this.to)?yF.fail("Structure replace would overwrite content"):yF.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new _F([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted?null:new t(n.pos,Math.max(n.pos,i.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var n=this.slice.size+e.slice.size==0?mm.empty:new mm(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}var i=this.slice.size+e.slice.size==0?mm.empty:new mm(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),i,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,mm.fromJSON(e,n.slice),!!n.structure)},t}(bF);bF.jsonID("replace",EF);var vF=function(e){function t(t,n,i,r,a,o,s){e.call(this),this.from=t,this.to=n,this.gapFrom=i,this.gapTo=r,this.slice=a,this.insert=o,this.structure=!!s}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&(kF(e,this.from,this.gapFrom)||kF(e,this.gapTo,this.to)))return yF.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return yF.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?yF.fromReplace(e,this.from,this.to,n):yF.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new _F([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),a=e.map(this.gapTo,1);return n.deleted&&i.deleted||r<n.pos||a>i.pos?null:new t(n.pos,i.pos,r,a,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,mm.fromJSON(e,n.slice),n.insert,!!n.structure)},t}(bF);function kF(e,t,n){for(var i=e.resolve(t),r=n-t,a=i.depth;r>0&&a>0&&i.indexAfter(a)==i.node(a).childCount;)a--,r--;if(r>0)for(var o=i.node(a).maybeChild(i.indexAfter(a));r>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,r--}return!1}function DF(e,t,n){for(var i=[],r=0;r<e.childCount;r++){var a=e.child(r);a.content.size&&(a=a.copy(DF(a.content,t,a))),a.isInline&&(a=t(a,n,r)),i.push(a)}return dm.fromArray(i)}bF.jsonID("replaceAround",vF),hF.prototype.lift=function(e,t){for(var n=e.$from,i=e.$to,r=e.depth,a=n.before(r+1),o=i.after(r+1),s=a,l=o,u=dm.empty,d=0,c=r,_=!1;c>t;c--)_||n.index(c)>0?(_=!0,u=dm.from(n.node(c).copy(u)),d++):s--;for(var f=dm.empty,g=0,h=r,p=!1;h>t;h--)p||i.after(h+1)<i.end(h)?(p=!0,f=dm.from(i.node(h).copy(f)),g++):l++;return this.step(new vF(s,l,a,o,new mm(u.append(f),d,g),u.size-d,!0))},hF.prototype.wrap=function(e,t){for(var n=dm.empty,i=t.length-1;i>=0;i--)n=dm.from(t[i].type.create(t[i].attrs,n));var r=e.start,a=e.end;return this.step(new vF(r,a,r,a,new mm(n,0,0),t.length,!0))},hF.prototype.setBlockType=function(e,t,n,i){var r=this;if(void 0===t&&(t=e),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var a=this.steps.length;return this.doc.nodesBetween(e,t,(function(e,t){if(e.isTextblock&&!e.hasMarkup(n,i)&&function(e,t,n){var i=e.resolve(t),r=i.index();return i.parent.canReplaceWith(r,r+1,n)}(r.doc,r.mapping.slice(a).map(t),n)){r.clearIncompatible(r.mapping.slice(a).map(t,1),n);var o=r.mapping.slice(a),s=o.map(t,1),l=o.map(t+e.nodeSize,1);return r.step(new vF(s,l,s+1,l-1,new mm(dm.from(n.create(i,null,e.marks)),0,0),1,!0)),!1}})),this},hF.prototype.setNodeMarkup=function(e,t,n,i){var r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at given position");t||(t=r.type);var a=t.create(n,null,i||r.marks);if(r.isLeaf)return this.replaceWith(e,e+r.nodeSize,a);if(!t.validContent(r.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new vF(e,e+r.nodeSize,e+1,e+r.nodeSize-1,new mm(dm.from(a),0,0),1,!0))},hF.prototype.split=function(e,t,n){void 0===t&&(t=1);for(var i=this.doc.resolve(e),r=dm.empty,a=dm.empty,o=i.depth,s=i.depth-t,l=t-1;o>s;o--,l--){r=dm.from(i.node(o).copy(r));var u=n&&n[l];a=dm.from(u?u.type.create(u.attrs,a):i.node(o).copy(a))}return this.step(new EF(e,e,new mm(r.append(a),t,t),!0))},hF.prototype.join=function(e,t){void 0===t&&(t=1);var n=new EF(e-t,e+t,mm.empty,!0);return this.step(n)};var CF=function(e){function t(t,n,i){e.call(this),this.from=t,this.to=n,this.mark=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),i=e.resolve(this.from),r=i.node(i.sharedDepth(this.to)),a=new mm(DF(n.content,(function(e,n){return e.isAtom&&n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),r),n.openStart,n.openEnd);return yF.fromReplace(e,this.from,this.to,a)},t.prototype.invert=function(){return new wF(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new t(n.pos,i.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(bF);bF.jsonID("addMark",CF);var wF=function(e){function t(t,n,i){e.call(this),this.from=t,this.to=n,this.mark=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),i=new mm(DF(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))})),n.openStart,n.openEnd);return yF.fromReplace(e,this.from,this.to,i)},t.prototype.invert=function(){return new CF(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new t(n.pos,i.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(bF);function SF(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}bF.jsonID("removeMark",wF),hF.prototype.addMark=function(e,t,n){var i=this,r=[],a=[],o=null,s=null;return this.doc.nodesBetween(e,t,(function(i,l,u){if(i.isInline){var d=i.marks;if(!n.isInSet(d)&&u.type.allowsMarkType(n.type)){for(var c=Math.max(l,e),_=Math.min(l+i.nodeSize,t),f=n.addToSet(d),g=0;g<d.length;g++)d[g].isInSet(f)||(o&&o.to==c&&o.mark.eq(d[g])?o.to=_:r.push(o=new wF(c,_,d[g])));s&&s.to==c?s.to=_:a.push(s=new CF(c,_,n))}}})),r.forEach((function(e){return i.step(e)})),a.forEach((function(e){return i.step(e)})),this},hF.prototype.removeMark=function(e,t,n){var i=this;void 0===n&&(n=null);var r=[],a=0;return this.doc.nodesBetween(e,t,(function(i,o){if(i.isInline){a++;var s=null;if(n instanceof eF)for(var l,u=i.marks;l=n.isInSet(u);)(s||(s=[])).push(l),u=l.removeFromSet(u);else n?n.isInSet(i.marks)&&(s=[n]):s=i.marks;if(s&&s.length)for(var d=Math.min(o+i.nodeSize,t),c=0;c<s.length;c++){for(var _=s[c],f=void 0,g=0;g<r.length;g++){var h=r[g];h.step==a-1&&_.eq(r[g].style)&&(f=h)}f?(f.to=d,f.step=a):r.push({style:_,from:Math.max(o,e),to:d,step:a})}}})),r.forEach((function(e){return i.step(new wF(e.from,e.to,e.style))})),this},hF.prototype.clearIncompatible=function(e,t,n){void 0===n&&(n=t.contentMatch);for(var i=this.doc.nodeAt(e),r=[],a=e+1,o=0;o<i.childCount;o++){var s=i.child(o),l=a+s.nodeSize,u=n.matchType(s.type,s.attrs);if(u){n=u;for(var d=0;d<s.marks.length;d++)t.allowsMarkType(s.marks[d].type)||this.step(new wF(a,l,s.marks[d]))}else r.push(new EF(a,l,mm.empty));a=l}if(!n.validEnd){var c=n.fillBefore(dm.empty,!0);this.replace(a,a,new mm(c,0,0))}for(var _=r.length-1;_>=0;_--)this.step(r[_]);return this},hF.prototype.replace=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=mm.empty);var i=function(e,t,n,i){if(void 0===n&&(n=t),void 0===i&&(i=mm.empty),t==n&&!i.size)return null;var r=e.resolve(t),a=e.resolve(n);return SF(r,a,i)?new EF(t,n,i):new OF(r,a,i).fit()}(this.doc,e,t,n);return i&&this.step(i),this},hF.prototype.replaceWith=function(e,t,n){return this.replace(e,t,new mm(dm.from(n),0,0))},hF.prototype.delete=function(e,t){return this.replace(e,t,mm.empty)},hF.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var OF=function(e,t,n){this.$to=t,this.$from=e,this.unplaced=n,this.frontier=[];for(var i=0;i<=e.depth;i++){var r=e.node(i);this.frontier.push({type:r.type,match:r.contentMatchAt(e.indexAfter(i))})}this.placed=dm.empty;for(var a=e.depth;a>0;a--)this.placed=dm.from(e.node(a).copy(this.placed))},xF={depth:{configurable:!0}};function TF(e,t,n){return 0==t?e.cutByIndex(n):e.replaceChild(0,e.firstChild.copy(TF(e.firstChild.content,t-1,n)))}function NF(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(NF(e.lastChild.content,t-1,n)))}function AF(e,t){for(var n=0;n<t;n++)e=e.firstChild.content;return e}function MF(e,t,n){if(t<=0)return e;var i=e.content;return t>1&&(i=i.replaceChild(0,MF(i.firstChild,t-1,1==i.childCount?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(dm.empty,!0)))),e.copy(i)}function RF(e,t,n,i,r){var a=e.node(t),o=r?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;var s=i.fillBefore(a.content,!0,o);return s&&!function(e,t,n){for(var i=n;i<t.childCount;i++)if(!e.allowsMarks(t.child(i).marks))return!0;return!1}(n,a.content,o)?s:null}function IF(e,t,n,i,r){if(t<n){var a=e.firstChild;e=e.replaceChild(0,a.copy(IF(a.content,t+1,n,i,a)))}if(t>i){var o=r.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(dm.empty,!0))}return e}function LF(e,t){for(var n=[],i=Math.min(e.depth,t.depth);i>=0;i--){var r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}xF.depth.get=function(){return this.frontier.length-1},OF.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,r=this.close(t<0?this.$to:i.doc.resolve(t));if(!r)return null;for(var a=this.placed,o=i.depth,s=r.depth;o&&s&&1==a.childCount;)a=a.firstChild.content,o--,s--;var l=new mm(a,o,s);return t>-1?new vF(i.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||i.pos!=this.$to.pos?new EF(i.pos,r.pos,l):void 0},OF.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var n=void 0,i=(t?(n=AF(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,r=this.depth;r>=0;r--){var a=this.frontier[r],o=a.type,s=a.match,l=void 0,u=void 0;if(1==e&&(i?s.matchType(i.type)||(u=s.fillBefore(dm.from(i),!1)):o.compatibleContent(n.type)))return{sliceDepth:t,frontierDepth:r,parent:n,inject:u};if(2==e&&i&&(l=s.findWrapping(i.type)))return{sliceDepth:t,frontierDepth:r,parent:n,wrap:l};if(n&&s.matchType(n.type))break}},OF.prototype.openMore=function(){var e=this.unplaced,t=e.content,n=e.openStart,i=e.openEnd,r=AF(t,n);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new mm(t,n+1,Math.max(i,r.size+n>=t.size-i?n+1:0)),!0)},OF.prototype.dropNode=function(){var e=this.unplaced,t=e.content,n=e.openStart,i=e.openEnd,r=AF(t,n);if(r.childCount<=1&&n>0){var a=t.size-n<=n+r.size;this.unplaced=new mm(TF(t,n-1,1),n-1,a?n-1:i)}else this.unplaced=new mm(TF(t,n,1),n,i)},OF.prototype.placeNodes=function(e){for(var t=e.sliceDepth,n=e.frontierDepth,i=e.parent,r=e.inject,a=e.wrap;this.depth>n;)this.closeFrontierNode();if(a)for(var o=0;o<a.length;o++)this.openFrontierNode(a[o]);var s=this.unplaced,l=i?i.content:s.content,u=s.openStart-t,d=0,c=[],_=this.frontier[n],f=_.match,g=_.type;if(r){for(var h=0;h<r.childCount;h++)c.push(r.child(h));f=f.matchFragment(r)}for(var p=l.size+t-(s.content.size-s.openEnd);d<l.childCount;){var m=l.child(d),F=f.matchType(m.type);if(!F)break;(++d>1||0==u||m.content.size)&&(f=F,c.push(MF(m.mark(g.allowedMarks(m.marks)),1==d?u:0,d==l.childCount?p:-1)))}var b=d==l.childCount;b||(p=-1),this.placed=NF(this.placed,n,dm.from(c)),this.frontier[n].match=f,b&&p<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var y=0,E=l;y<p;y++){var v=E.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),E=v.content}this.unplaced=b?0==t?mm.empty:new mm(TF(s.content,t-1,1),t-1,p<0?s.openEnd:t-1):new mm(TF(s.content,t,d),s.openStart,s.openEnd)},OF.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock||this.$to.end()==this.$to.pos)return-1;var e,t=this.frontier[this.depth];if(!t.type.isTextblock||!RF(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;for(var n=this.$to.depth,i=this.$to.after(n);n>1&&i==this.$to.end(--n);)++i;return i},OF.prototype.findCloseLevel=function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],i=n.match,r=n.type,a=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=RF(e,t,r,i,a);if(o){for(var s=t-1;s>=0;s--){var l=this.frontier[s],u=l.match,d=RF(e,s,l.type,u,!0);if(!d||d.childCount)continue e}return{depth:t,fit:o,move:a?e.doc.resolve(e.after(t+1)):e}}}},OF.prototype.close=function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=NF(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var i=e.node(n),r=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,r)}return e},OF.prototype.openFrontierNode=function(e,t,n){var i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=NF(this.placed,this.depth,dm.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})},OF.prototype.closeFrontierNode=function(){var e=this.frontier.pop().match.fillBefore(dm.empty,!0);e.childCount&&(this.placed=NF(this.placed,this.frontier.length,e))},Object.defineProperties(OF.prototype,xF),hF.prototype.replaceRange=function(e,t,n){if(!n.size)return this.deleteRange(e,t);var i=this.doc.resolve(e),r=this.doc.resolve(t);if(SF(i,r,n))return this.step(new EF(e,t,n));var a=LF(i,this.doc.resolve(t));0==a[a.length-1]&&a.pop();var o=-(i.depth+1);a.unshift(o);for(var s=i.depth,l=i.pos-1;s>0;s--,l--){var u=i.node(s).type.spec;if(u.defining||u.isolating)break;a.indexOf(s)>-1?o=s:i.before(s)==l&&a.splice(1,0,-s)}for(var d=a.indexOf(o),c=[],_=n.openStart,f=n.content,g=0;;g++){var h=f.firstChild;if(c.push(h),g==n.openStart)break;f=h.content}_>0&&c[_-1].type.spec.defining&&i.node(d).type!=c[_-1].type?_-=1:_>=2&&c[_-1].isTextblock&&c[_-2].type.spec.defining&&i.node(d).type!=c[_-2].type&&(_-=2);for(var p=n.openStart;p>=0;p--){var m=(p+_+1)%(n.openStart+1),F=c[m];if(F)for(var b=0;b<a.length;b++){var y=a[(b+d)%a.length],E=!0;y<0&&(E=!1,y=-y);var v=i.node(y-1),k=i.index(y-1);if(v.canReplaceWith(k,k,F.type,F.marks))return this.replace(i.before(y),E?r.after(y):t,new mm(IF(n.content,0,n.openStart,m),m,n.openEnd))}}for(var D=this.steps.length,C=a.length-1;C>=0&&(this.replace(e,t,n),!(this.steps.length>D));C--){var w=a[C];w<0||(e=i.before(w),t=r.after(w))}return this},hF.prototype.replaceRangeWith=function(e,t,n){if(!n.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var i=function(e,t,n){var i=e.resolve(t);if(i.parent.canReplaceWith(i.index(),i.index(),n))return t;if(0==i.parentOffset)for(var r=i.depth-1;r>=0;r--){var a=i.index(r);if(i.node(r).canReplaceWith(a,a,n))return i.before(r+1);if(a>0)return null}if(i.parentOffset==i.parent.content.size)for(var o=i.depth-1;o>=0;o--){var s=i.indexAfter(o);if(i.node(o).canReplaceWith(s,s,n))return i.after(o+1);if(s<i.node(o).childCount)return null}}(this.doc,e,n.type);null!=i&&(e=t=i)}return this.replaceRange(e,t,new mm(dm.from(n),0,0))},hF.prototype.deleteRange=function(e,t){for(var n=this.doc.resolve(e),i=this.doc.resolve(t),r=LF(n,i),a=0;a<r.length;a++){var o=r[a],s=a==r.length-1;if(s&&0==o||n.node(o).type.contentMatch.validEnd)return this.delete(n.start(o),i.end(o));if(o>0&&(s||n.node(o-1).canReplace(n.index(o-1),i.indexAfter(o-1))))return this.delete(n.before(o),i.after(o))}for(var l=1;l<=n.depth&&l<=i.depth;l++)if(e-n.start(l)==n.depth-l&&t>n.end(l)&&i.end(l)-t!=i.depth-l)return this.delete(n.before(l),t);return this.delete(e,t)};var BF=Object.create(null),PF=function(e,t,n){this.ranges=n||[new qF(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},jF={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};jF.anchor.get=function(){return this.$anchor.pos},jF.head.get=function(){return this.$head.pos},jF.from.get=function(){return this.$from.pos},jF.to.get=function(){return this.$to.pos},jF.$from.get=function(){return this.ranges[0].$from},jF.$to.get=function(){return this.ranges[0].$to},jF.empty.get=function(){for(var e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0},PF.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},PF.prototype.replace=function(e,t){void 0===t&&(t=mm.empty);for(var n=t.content.lastChild,i=null,r=0;r<t.openEnd;r++)i=n,n=n.lastChild;for(var a=e.steps.length,o=this.ranges,s=0;s<o.length;s++){var l=o[s],u=l.$from,d=l.$to,c=e.mapping.slice(a);e.replaceRange(c.map(u.pos),c.map(d.pos),s?mm.empty:t),0==s&&$F(e,a,(n?n.isInline:i&&i.isTextblock)?-1:1)}},PF.prototype.replaceWith=function(e,t){for(var n=e.steps.length,i=this.ranges,r=0;r<i.length;r++){var a=i[r],o=a.$from,s=a.$to,l=e.mapping.slice(n),u=l.map(o.pos),d=l.map(s.pos);r?e.deleteRange(u,d):(e.replaceRangeWith(u,d,t),$F(e,n,t.isInline?-1:1))}},PF.findFrom=function(e,t,n){var i=e.parent.inlineContent?new UF(e):VF(e.node(0),e.parent,e.pos,e.index(),t,n);if(i)return i;for(var r=e.depth-1;r>=0;r--){var a=t<0?VF(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):VF(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(a)return a}},PF.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new GF(e.node(0))},PF.atStart=function(e){return VF(e,e,0,0,1)||new GF(e)},PF.atEnd=function(e){return VF(e,e,e.content.size,e.childCount,-1)||new GF(e)},PF.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=BF[t.type];if(!n)throw new RangeError("No selection type "+t.type+" defined");return n.fromJSON(e,t)},PF.jsonID=function(e,t){if(e in BF)throw new RangeError("Duplicate use of selection JSON ID "+e);return BF[e]=t,t.prototype.jsonID=e,t},PF.prototype.getBookmark=function(){return UF.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(PF.prototype,jF),PF.prototype.visible=!0;var qF=function(e,t){this.$from=e,this.$to=t},UF=function(e){function t(t,n){void 0===n&&(n=t),e.call(this,t,n)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(n,i){var r=n.resolve(i.map(this.head));if(!r.parent.inlineContent)return e.near(r);var a=n.resolve(i.map(this.anchor));return new t(a.parent.inlineContent?a:r,r)},t.prototype.replace=function(t,n){if(void 0===n&&(n=mm.empty),e.prototype.replace.call(this,t,n),n==mm.empty){var i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new zF(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,t,n){void 0===n&&(n=t);var i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))},t.between=function(n,i,r){var a=n.pos-i.pos;if(r&&!a||(r=a>=0?1:-1),!i.parent.inlineContent){var o=e.findFrom(i,r,!0)||e.findFrom(i,-r,!0);if(!o)return e.near(i,r);i=o.$head}return n.parent.inlineContent||(0==a||(n=(e.findFrom(n,-r,!0)||e.findFrom(n,r,!0)).$anchor).pos<i.pos!=a<0)&&(n=i),new t(n,i)},Object.defineProperties(t.prototype,n),t}(PF);PF.jsonID("text",UF);var zF=function(e,t){this.anchor=e,this.head=t};zF.prototype.map=function(e){return new zF(e.map(this.anchor),e.map(this.head))},zF.prototype.resolve=function(e){return UF.between(e.resolve(this.anchor),e.resolve(this.head))};var HF=function(e){function t(t){var n=t.nodeAfter,i=t.node(0).resolve(t.pos+n.nodeSize);e.call(this,t,i),this.node=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,i){var r=i.mapResult(this.anchor),a=r.deleted,o=r.pos,s=n.resolve(o);return a?e.near(s):new t(s)},t.prototype.content=function(){return new mm(dm.from(this.node),0,0)},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor},t.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},t.prototype.getBookmark=function(){return new WF(this.anchor)},t.fromJSON=function(e,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(n.anchor))},t.create=function(e,t){return new this(e.resolve(t))},t.isSelectable=function(e){return!e.isText&&!1!==e.type.spec.selectable},t}(PF);HF.prototype.visible=!1,PF.jsonID("node",HF);var WF=function(e){this.anchor=e};WF.prototype.map=function(e){var t=e.mapResult(this.anchor),n=t.deleted,i=t.pos;return n?new zF(i,i):new WF(i)},WF.prototype.resolve=function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&HF.isSelectable(n)?new HF(t):PF.near(t)};var GF=function(e){function t(t){e.call(this,t.resolve(0),t.resolve(t.content.size))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.replace=function(t,n){if(void 0===n&&(n=mm.empty),n==mm.empty){t.delete(0,t.doc.content.size);var i=e.atStart(t.doc);i.eq(t.selection)||t.setSelection(i)}else e.prototype.replace.call(this,t,n)},t.prototype.toJSON=function(){return{type:"all"}},t.fromJSON=function(e){return new t(e)},t.prototype.map=function(e){return new t(e)},t.prototype.eq=function(e){return e instanceof t},t.prototype.getBookmark=function(){return YF},t}(PF);PF.jsonID("all",GF);var YF={map:function(){return this},resolve:function(e){return new GF(e)}};function VF(e,t,n,i,r,a){if(t.inlineContent)return UF.create(e,n);for(var o=i-(r>0?0:1);r>0?o<t.childCount:o>=0;o+=r){var s=t.child(o);if(s.isAtom){if(!a&&HF.isSelectable(s))return HF.create(e,n-(r<0?s.nodeSize:0))}else{var l=VF(e,s,n+r,r<0?s.childCount:0,r,a);if(l)return l}n+=s.nodeSize*r}}function $F(e,t,n){var i=e.steps.length-1;if(!(i<t)){var r,a=e.steps[i];if(a instanceof EF||a instanceof vF)e.mapping.maps[i].forEach((function(e,t,n,i){null==r&&(r=i)})),e.setSelection(PF.near(e.doc.resolve(r),n))}}var KF=function(e){function t(t){e.call(this,t.doc),this.time=Date.now(),this.curSelection=t.selection,this.curSelectionFor=0,this.storedMarks=t.storedMarks,this.updated=0,this.meta=Object.create(null)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return n.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},t.prototype.setSelection=function(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},n.selectionSet.get=function(){return(1&this.updated)>0},t.prototype.setStoredMarks=function(e){return this.storedMarks=e,this.updated|=2,this},t.prototype.ensureMarks=function(e){return hm.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this},t.prototype.addStoredMark=function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,n){e.prototype.addStep.call(this,t,n),this.updated=-3&this.updated,this.storedMarks=null},t.prototype.setTime=function(e){return this.time=e,this},t.prototype.replaceSelection=function(e){return this.selection.replace(this,e),this},t.prototype.replaceSelectionWith=function(e,t){var n=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||hm.none))),n.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,n){void 0===n&&(n=t);var i=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,n);var r=this.storedMarks;if(!r){var a=this.doc.resolve(t);r=n==t?a.marks():a.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,r)),this.selection.empty||this.setSelection(PF.near(this.selection.$to)),this},t.prototype.setMeta=function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this},t.prototype.getMeta=function(e){return this.meta["string"==typeof e?e:e.key]},n.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,n),t}(hF);function QF(e,t){return t&&e?e.bind(t):e}var ZF=function(e,t,n){this.name=e,this.init=QF(t.init,n),this.apply=QF(t.apply,n)},XF=[new ZF("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new ZF("selection",{init:function(e,t){return e.selection||PF.atStart(t.doc)},apply:function(e){return e.selection}}),new ZF("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new ZF("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],JF=function(e,t){var n=this;this.schema=e,this.fields=XF.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach((function(e){if(n.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");n.plugins.push(e),n.pluginsByKey[e.key]=e,e.spec.state&&n.fields.push(new ZF(e.key,e.spec.state,e))}))},eb=function(e){this.config=e},tb={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};tb.schema.get=function(){return this.config.schema},tb.plugins.get=function(){return this.config.plugins},eb.prototype.apply=function(e){return this.applyTransaction(e).state},eb.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=t){var i=this.config.plugins[n];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0},eb.prototype.applyTransaction=function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],n=this.applyInner(e),i=null;;){for(var r=!1,a=0;a<this.config.plugins.length;a++){var o=this.config.plugins[a];if(o.spec.appendTransaction){var s=i?i[a].n:0,l=i?i[a].state:this,u=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,l,n);if(u&&n.filterTransaction(u,a)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(var d=0;d<this.config.plugins.length;d++)i.push(d<a?{state:n,n:t.length}:{state:this,n:0})}t.push(u),n=n.applyInner(u),r=!0}i&&(i[a]={state:n,n:t.length})}}if(!r)return{state:n,transactions:t}}},eb.prototype.applyInner=function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var t=new eb(this.config),n=this.config.fields,i=0;i<n.length;i++){var r=n[i];t[r.name]=r.apply(e,this[r.name],this,t)}for(var a=0;a<nb.length;a++)nb[a](this,e,t);return t},tb.tr.get=function(){return new KF(this)},eb.create=function(e){for(var t=new JF(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new eb(t),i=0;i<t.fields.length;i++)n[t.fields[i].name]=t.fields[i].init(e,n);return n},eb.prototype.reconfigure=function(e){for(var t=new JF(this.schema,e.plugins),n=t.fields,i=new eb(t),r=0;r<n.length;r++){var a=n[r].name;i[a]=this.hasOwnProperty(a)?this[a]:n[r].init(e,i)}return i},eb.prototype.toJSON=function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((function(e){return e.toJSON()}))),e&&"object"==typeof e)for(var n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var i=e[n],r=i.spec.state;r&&r.toJSON&&(t[n]=r.toJSON.call(i,this[i.key]))}return t},eb.fromJSON=function(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var i=new JF(e.schema,e.plugins),r=new eb(i);return i.fields.forEach((function(i){if("doc"==i.name)r.doc=Rm.fromJSON(e.schema,t.doc);else if("selection"==i.name)r.selection=PF.fromJSON(r.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(r.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(var a in n){var o=n[a],s=o.spec.state;if(o.key==i.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(t,a))return void(r[i.name]=s.fromJSON.call(o,e,t[a],r))}r[i.name]=i.init(e,r)}})),r},eb.addApplyListener=function(e){nb.push(e)},eb.removeApplyListener=function(e){var t=nb.indexOf(e);t>-1&&nb.splice(t,1)},Object.defineProperties(eb.prototype,tb);var nb=[];var ib=function(e){this.props={},e.props&&function e(t,n,i){for(var r in t){var a=t[r];a instanceof Function?a=a.bind(n):"handleDOMEvents"==r&&(a=e(a,n,{})),i[r]=a}return i}(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:ab("plugin")};ib.prototype.getState=function(e){return e[this.key]};var rb=Object.create(null);function ab(e){return e in rb?e+"$"+ ++rb[e]:(rb[e]=0,e+"$")}var ob=function(e){void 0===e&&(e="key"),this.key=ab(e)};ob.prototype.get=function(e){return e.config.pluginsByKey[this.key]},ob.prototype.getState=function(e){return e[this.key]};const sb=ma.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize"}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){return t.textBetween(0,t.content.size,void 0," ").length}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;return t.textBetween(0,t.content.size," "," ").split(" ").filter(e=>""!==e).length}},addProseMirrorPlugins(){return[new ib({key:new ob("characterCount"),filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const i=this.storage.characters({node:t.doc}),r=this.storage.characters({node:e.doc});if(r<=n)return!0;if(i>n&&r>n&&r<=i)return!0;if(i>n&&r>n&&r>i)return!1;if(!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,o=a-(r-n),s=a;e.deleteRange(o,s);return!(this.storage.characters({node:e.doc})>n)}})]}});var lb=n(53);const ub=fs.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",rs(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[ys({find:e=>Object(lb.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 Mt({key:new Lt("handleClickLink"),props:{handleClick:(e,t,n)=>{var i;const r=this.editor.getAttributes("link");return!(!(null===(i=n.target)||void 0===i?void 0:i.closest("a"))||!r.href)&&(window.open(r.href,r.target),!0)}}})),this.options.linkOnPaste&&e.push(new Mt({key:new Lt("handlePasteLink"),props:{handlePaste:(e,t,n)=>{const{state:i}=e,{selection:r}=i,{empty:a}=r;if(a)return!1;let o="";n.content.forEach(e=>{o+=e.textContent});const s=Object(lb.find)(o).find(e=>e.isLink&&e.value===o);return!(!o||!s)&&(this.editor.commands.setMark(this.type,{href:s.href}),!0)}}})),e}}),db=fs.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",rs(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=po(e,this.type);return!!Object.entries(n).some(([,e])=>!!e)||t.unsetMark("textStyle")}}}}),cb=ma.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 _b=_s.create({name:"doc",topNode:!0,content:"block+"}).extend({content:"root",addProseMirrorPlugins:function(){var e=this.editor;return[new Mt({key:new Lt("eventHandler"),props:{handleClick:function(t,n){var i=t.state,r=i.doc.lastChild,a=i.doc.resolve(n).nodeBefore;if(r&&a){var o=r.eq(a),s=r.isInline,l=["paragraph","text"].includes(r.type.name);!o||s||l||e.commands.insertContentAt(n,{type:"paragraph",content:""})}}}})]}}),fb=ip.extend({name:"title",defining:!0,addAttributes:function(){return{level:{default:1,rendered:!1}}},parseHTML:function(){return[{tag:"h1"}]},renderHTML:function(e){e.node;var t=e.HTMLAttributes;return["h1",rs(this.options.HTMLAttributes,t),0]}});const gb=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/,hb=_s.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",rs(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[gs({find:gb,type:this.type,getAttributes:e=>{const[,,t,n,i]=e;return{src:n,alt:t,title:i}}})]}});function pb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function mb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pb(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Fb=hb.extend({name:"image",addAttributes:function(){return mb(mb({},hb.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 i,r,a,o=n.tr,s=n.commands;return"image"==(null===(i=o.selection)||void 0===i||null===(r=i.node)||void 0===r||null===(a=r.type)||void 0===a?void 0:a.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",rs(this.options.HTMLAttributes,n)]}});const bb=fs.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",rs(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()}}});var yb=function(e){var t=e.wrapperRef,n=e.index;if(t.current&&!(n>=t.current.children.length)){var i=t.current,r=i.children[n],a=r.clientHeight+8,o=i.scrollTop;r.offsetTop+a>o+i.clientHeight?o=r.offsetTop-i.clientHeight+a:o>r.offsetTop&&(o=r.offsetTop-8),t.current.scrollTop=o}};function Eb(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,i=m_()(e);if(t){var r=m_()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return h_()(this,n)}}var vb=function(e){f_()(n,e);var t=Eb(n);function n(e){var i;return s_()(this,n),i=t.call(this,e),c()(c_()(i),"onKeyDown",(function(e){var t=e.event;return"ArrowUp"===t.key?(i.upHandler(),!0):"ArrowDown"===t.key?(i.downHandler(),!0):"Enter"===t.key&&(i.enterHandler(),!0)})),c()(c_()(i),"upHandler",(function(){i.setState({selectedIndex:(i.state.selectedIndex+i.props.items.length-1)%i.props.items.length})})),c()(c_()(i),"downHandler",(function(){i.setState({selectedIndex:(i.state.selectedIndex+1)%i.props.items.length})})),c()(c_()(i),"enterHandler",(function(){i.selectItem(i.state.selectedIndex)})),c()(c_()(i),"selectItem",(function(e){var t=i.props.items[e];if(t&&od()(t.items)){var n=i.props,r=n.editor,a=n.range;t.command({editor:r,range:a})}})),i.state={selectedIndex:0},i.menuRef=m.a.createRef(),i}return u_()(n,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),yb({wrapperRef:this.menuRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this,t=this.props.items;return m.a.createElement("div",{ref:this.menuRef,className:"neeto-editor-slash-commands__wrapper"},t.map((function(t,i){var r=od()(t.items),a=m.a.createElement(kb,{key:t.title,item:t,index:i,selectedIndex:e.state.selectedIndex,selectItem:function(){return e.selectItem(i)}});return r?a:m.a.createElement(nd,{key:t.title,interactive:!0,placement:"right",hideOnClick:!1,content:m.a.createElement(n,u()({},e.props,{items:t.items})),onCreate:function(e){return e.popper.style.width="max-content"}},a)})))}}]),n}(m.a.Component),kb=Object(p.forwardRef)((function(e,t){var n=e.item,i=e.selectedIndex,r=e.index,a=e.selectItem,o=n.Icon;return m.a.createElement("div",{className:b()("neeto-editor-slash-commands__item",{active:r===i}),onClick:function(){return a(r)},ref:t,"data-cy":"neeto-editor-command-list-item-".concat(r)},o&&m.a.createElement(o,{size:20}),m.a.createElement("div",{className:"neeto-editor-slash-commands__item-content"},m.a.createElement("h5",null,n.title),m.a.createElement("p",null,n.description)))})),Db=vb;const Cb=new Lt("suggestion");function wb({pluginKey:e=Cb,editor:t,char:n="@",allowSpaces:i=!1,prefixSpace:r=!0,startOfLine:a=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:d=(()=>({})),allow:c=(()=>!0)}){const _=null==d?void 0:d();return new Mt({key:e,view(){return{update:async(e,n)=>{var i,r,a,o,s;const d=null===(i=this.key)||void 0===i?void 0:i.getState(n),c=null===(r=this.key)||void 0===r?void 0:r.getState(e.state),f=d.active&&c.active&&d.range.from!==c.range.from,g=!d.active&&c.active,h=d.active&&!c.active,p=g||f,m=!g&&!h&&d.query!==c.query&&!f,F=h||f;if(!p&&!m&&!F)return;const b=F&&!p?d:c,y=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),E={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.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};F&&(null===(a=null==_?void 0:_.onExit)||void 0===a||a.call(_,E)),m&&(null===(o=null==_?void 0:_.onUpdate)||void 0===o||o.call(_,E)),p&&(null===(s=null==_?void 0:_.onStart)||void 0===s||s.call(_,E))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from:d}=l,_={...o};if(_.composing=s,u||t.view.composing){!(d<o.range.from||d>o.range.to)||s||o.composing||(_.active=!1);const e=function(e){const{char:t,allowSpaces:n,prefixSpace:i,startOfLine:r,$position:a}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=r?"^":"",u=n?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),d=a.depth<=0?0:a.before(),c=a.pos,_=a.doc.textBetween(d,c,"\0","\0"),f=Array.from(_.matchAll(u)).pop();if(!f||void 0===f.input||void 0===f.index)return null;const g=f.input.slice(Math.max(0,f.index-1),f.index),h=/^[\s\0]?$/.test(g);if(i&&!h)return null;const p=f.index+a.start();let m=p+f[0].length;return n&&s.test(_.slice(m-1,m+1))&&(f[0]+=" ",m+=1),p<a.pos&&m>=a.pos?{range:{from:p,to:m},query:f[0].slice(t.length),text:f[0]}:null}({char:n,allowSpaces:i,prefixSpace:r,startOfLine:a,$position:l.$from}),u="id_"+Math.floor(4294967295*Math.random());e&&c({editor:t,range:e.range})?(_.active=!0,_.decorationId=o.decorationId?o.decorationId:u,_.range=e.range,_.query=e.query,_.text=e.text):_.active=!1}else _.active=!1;return _.active||(_.decorationId=null,_.range={},_.query=null,_.text=null),_}},props:{handleKeyDown(e,t){var n;const{active:i,range:r}=this.getState(e.state);return i&&(null===(n=null==_?void 0:_.onKeyDown)||void 0===n?void 0:n.call(_,{view:e,event:t,range:r}))||!1},decorations(e){const{active:t,range:n,decorationId:i}=this.getState(e);return t?Rr.create(e.doc,[Tr.inline(n.from,n.to,{nodeName:o,class:s,"data-decoration-id":i})]):null}}})}function Sb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ob(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sb(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var xb=new Lt("commands"),Tb=function(e){var t=e.setImageUploadVisible,n=e.mentions,i=e.addonCommands,r=e.options,a=[{title:"Paragraph",description:"Add a plain text block",Icon:Uu.Paragraph,optionName:"font-size",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:Uu.TextH1,optionName:"font-size",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:Uu.TextH2,optionName:"font-size",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:Uu.ListNumber,optionName:"ordered-list",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:Uu.ListDot,optionName:"bullet-list",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleBulletList().run()}},{title:"Blockquote",description:"Add a quote",Icon:Uu.Blockquote,optionName:"block-quote",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleBlockquote().run()}},{title:"Image",description:"Add an image",Icon:Uu.Image,optionName:"image-upload",command:function(e){var n=e.editor,i=e.range;t(!0),n.chain().focus().deleteRange(i).run()}},{title:"Code block",description:"Add a code block with syntax highlighting",Icon:Uu.Code,optionName:"code-block",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleCodeBlock().run()}},{title:"Emoji",description:"Add an emoji",Icon:Uu.Smiley,optionName:"emoji",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).insertContent("::").run()}},{title:"Divider",description:"Add an horizontal line to separate sections",optionName:"divider",Icon:Uu.Minus,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).setHorizontalRule().run()}},{title:"Embed Youtube/Vimeo",description:"Embed a video from major services",Icon:Uu.Video,optionName:"video-embed",command:function(e){var t,n=e.editor,i=e.range,r=prompt("Please enter Youtube/Vimeo embed URL"),a=(t=r.match(zd))&&"https://www.youtube.com/embed/".concat(t[5])||function(e){var t=e.match(Hd);return t&&"https://player.vimeo.com/video/".concat(t[4],"?h=").concat(t[5])}(r);a?n.chain().focus().deleteRange(i).setExternalVideo({src:a}).run():n.chain().focus().deleteRange(i).insertContent("#invalid").run()}}];return od()(n)||a.push({title:"Mention",description:"Mention a user",optionName:"mention",Icon:Uu.Email,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).insertContent("@").run()}}),od()(r)||(a=a.filter((function(e){var t=e.optionName;return r.includes(t)}))),od()(i)||(a=a.concat(i)),ma.create({addOptions:function(){return{HTMLAttributes:{class:"commands"},suggestion:{char:"/",startOfLine:!1,pluginKey:xb,command:function(e){var t=e.editor,n=e.range;e.props.command({editor:t,range:n})},items:function(e){var t=e.query,n=a.filter((function(e){return e.title.toLowerCase().includes(t.toLowerCase())}));return od()(n)?[{title:"No results",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).run()}}]:n},render:function(){var e,t;return{onStart:function(n){var i=document.querySelector('[id^="tippy"]');i&&i.remove(),e=new xu(Db,{props:n,editor:n.editor}),t=bu("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1,zIndex:99999})},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&&t[0].destroy(),e&&e.destroy()}}}}}},addProseMirrorPlugins:function(){return[wb(Ob({editor:this.editor},this.options.suggestion))]}})},Nb={};function Ab(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)||Ab(n)})),e}var Mb=Ab,Rb=Ab;Mb.default=Rb;class Ib{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Lb(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Bb(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 Pb=e=>!!e.kind;class jb{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=Lb(e)}openNode(e){if(!Pb(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){Pb(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class qb{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=>{qb._collapse(e)}))}}class Ub extends qb{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 jb(this,this.options).value()}finalize(){return!0}}function zb(e){return e?"string"==typeof e?e:e.source:null}const Hb=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const Wb="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Gb={begin:"\\\\[\\s\\S]",relevance:0},Yb={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[Gb]},Vb={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[Gb]},$b={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/},Kb=function(e,t,n={}){const i=Bb({className:"comment",begin:e,end:t,contains:[]},n);return i.contains.push($b),i.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),i},Qb=Kb("//","$"),Zb=Kb("/\\*","\\*/"),Xb=Kb("#","$"),Jb={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},ey={className:"number",begin:Wb,relevance:0},ty={className:"number",begin:"\\b(0b[01]+)",relevance:0},ny={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},iy={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Gb,{begin:/\[/,end:/\]/,relevance:0,contains:[Gb]}]}]},ry={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},ay={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},oy={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var sy=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:Wb,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>zb(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),Bb({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:Gb,APOS_STRING_MODE:Yb,QUOTE_STRING_MODE:Vb,PHRASAL_WORDS_MODE:$b,COMMENT:Kb,C_LINE_COMMENT_MODE:Qb,C_BLOCK_COMMENT_MODE:Zb,HASH_COMMENT_MODE:Xb,NUMBER_MODE:Jb,C_NUMBER_MODE:ey,BINARY_NUMBER_MODE:ty,CSS_NUMBER_MODE:ny,REGEXP_MODE:iy,TITLE_MODE:ry,UNDERSCORE_TITLE_MODE:ay,METHOD_GUARD:oy,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 ly(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function uy(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=ly,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function dy(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map(e=>zb(e)).join("|")+")"}(...e.illegal))}function cy(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 _y(e,t){void 0===e.relevance&&(e.relevance=1)}const fy=["of","and","for","in","not","or","if","then","parent","list","value"];function gy(e,t){return t?Number(t):function(e){return fy.includes(e.toLowerCase())}(e)?0:1}function hy(e,{plugins:t}){function n(t,n){return new RegExp(zb(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))}class i{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 i=zb(e),r="";for(;i.length>0;){const e=Hb.exec(i);if(!e){r+=i;break}r+=i.substring(0,e.index),i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+String(Number(e[1])+t):(r+=e[0],"("===e[0]&&n++)}return r}).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),i=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,i)}}class r{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 i;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=Bb(e.classNameAliases||{}),function t(i,a){const o=i;if(i.isCompiled)return o;[cy].forEach(e=>e(i,a)),e.compilerExtensions.forEach(e=>e(i,a)),i.__beforeBegin=null,[uy,dy,_y].forEach(e=>e(i,a)),i.isCompiled=!0;let s=null;if("object"==typeof i.keywords&&(s=i.keywords.$pattern,delete i.keywords.$pattern),i.keywords&&(i.keywords=function e(t,n,i="keyword"){const r={};return"string"==typeof t?a(i,t.split(" ")):Array.isArray(t)?a(i,t):Object.keys(t).forEach((function(i){Object.assign(r,e(t[i],n,i))})),r;function a(e,t){n&&(t=t.map(e=>e.toLowerCase())),t.forEach((function(t){const n=t.split("|");r[n[0]]=[e,gy(n[0],n[1])]}))}}(i.keywords,e.case_insensitive)),i.lexemes&&s)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return s=s||i.lexemes||/\w+/,o.keywordPatternRe=n(s,!0),a&&(i.begin||(i.begin=/\B|\b/),o.beginRe=n(i.begin),i.endSameAsBegin&&(i.end=i.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(o.endRe=n(i.end)),o.terminatorEnd=zb(i.end)||"",i.endsWithParent&&a.terminatorEnd&&(o.terminatorEnd+=(i.end?"|":"")+a.terminatorEnd)),i.illegal&&(o.illegalRe=n(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return Bb(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e))return Bb(e,{starts:e.starts?Bb(e.starts):null});if(Object.isFrozen(e))return Bb(e);return e}("self"===e?i:e)}))),i.contains.forEach((function(e){t(e,o)})),i.starts&&t(i.starts,a),o.matcher=function(e){const t=new r;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}(o),o}(e)}function py(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,Lb(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 my={"after:highlightElement":({el:e,result:t,text:n})=>{const i=by(e);if(!i.length)return;const r=document.createElement("div");r.innerHTML=t.value,t.value=function(e,t,n){let i=0,r="";const a=[];function o(){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){r+="<"+Fy(e)+[].map.call(e.attributes,(function(e){return" "+e.nodeName+'="'+Lb(e.value)+'"'})).join("")+">"}function l(e){r+="</"+Fy(e)+">"}function u(e){("start"===e.event?s:l)(e.node)}for(;e.length||t.length;){let t=o();if(r+=Lb(n.substring(i,t[0].offset)),i=t[0].offset,t===e){a.reverse().forEach(l);do{u(t.splice(0,1)[0]),t=o()}while(t===e&&t.length&&t[0].offset===i);a.reverse().forEach(s)}else"start"===t[0].event?a.push(t[0].node):a.pop(),u(t.splice(0,1)[0])}return r+Lb(n.substr(i))}(i,by(r),n)}};function Fy(e){return e.nodeName.toLowerCase()}function by(e){const t=[];return function e(n,i){for(let r=n.firstChild;r;r=r.nextSibling)3===r.nodeType?i+=r.nodeValue.length:1===r.nodeType&&(t.push({event:"start",offset:i,node:r}),i=e(r,i),Fy(r).match(/br|hr|img|input/)||t.push({event:"stop",offset:i,node:r}));return i}(e,0),t}const yy={},Ey=e=>{console.error(e)},vy=(e,...t)=>{console.log("WARN: "+e,...t)},ky=(e,t)=>{yy[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),yy[`${e}/${t}`]=!0)},Dy=Lb,Cy=Bb,wy=Symbol("nomatch");var Sy=function(e){const t=Object.create(null),n=Object.create(null),i=[];let r=!0;const a=/(^(<[^>]+>|\t|)+|\n)/gm,o="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:Ub};function u(e){return l.noHighlightRe.test(e)}function d(e,t,n,i){let r="",a="";"object"==typeof t?(r=e,n=t.ignoreIllegals,a=t.language,i=void 0):(ky("10.7.0","highlight(lang, code, ...args) has been deprecated."),ky("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),a=e,r=t);const o={code:r,language:a};k("before:highlight",o);const s=o.result?o.result:c(o.language,o.code,n,i);return s.code=o.code,k("after:highlight",s),s}function c(e,n,a,s){function u(e,t){const n=b.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,n)&&e.keywords[n]}function d(){null!=k.subLanguage?function(){if(""===w)return;let e=null;if("string"==typeof k.subLanguage){if(!t[k.subLanguage])return void C.addText(w);e=c(k.subLanguage,w,!0,D[k.subLanguage]),D[k.subLanguage]=e.top}else e=_(w,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(S+=e.relevance),C.addSublanguage(e.emitter,e.language)}():function(){if(!k.keywords)return void C.addText(w);let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(w),n="";for(;t;){n+=w.substring(e,t.index);const i=u(k,t);if(i){const[e,r]=i;if(C.addText(n),n="",S+=r,e.startsWith("_"))n+=t[0];else{const n=b.classNameAliases[e]||e;C.addKeyword(t[0],n)}}else n+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(w)}n+=w.substr(e),C.addText(n)}(),w=""}function f(e){return e.className&&C.openNode(b.classNameAliases[e.className]||e.className),k=Object.create(e,{parent:{value:k}}),k}function g(e){return 0===k.matcher.regexIndex?(w+=e[0],1):(T=!0,0)}function h(e){const t=e[0],n=e.rule,i=new Ib(n),r=[n.__beforeBegin,n["on:begin"]];for(const n of r)if(n&&(n(e,i),i.isMatchIgnored))return g(t);return n&&n.endSameAsBegin&&(n.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),n.skip?w+=t:(n.excludeBegin&&(w+=t),d(),n.returnBegin||n.excludeBegin||(w=t)),f(n),n.returnBegin?0:t.length}function p(e){const t=e[0],i=n.substr(e.index),r=function e(t,n,i){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(t.endRe,i);if(r){if(t["on:end"]){const e=new Ib(t);t["on:end"](n,e),e.isMatchIgnored&&(r=!1)}if(r){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,i)}(k,e,i);if(!r)return wy;const a=k;a.skip?w+=t:(a.returnEnd||a.excludeEnd||(w+=t),d(),a.excludeEnd&&(w=t));do{k.className&&C.closeNode(),k.skip||k.subLanguage||(S+=k.relevance),k=k.parent}while(k!==r.parent);return r.starts&&(r.endSameAsBegin&&(r.starts.endRe=r.endRe),f(r.starts)),a.returnEnd?0:t.length}let m={};function F(t,i){const o=i&&i[0];if(w+=t,null==o)return d(),0;if("begin"===m.type&&"end"===i.type&&m.index===i.index&&""===o){if(w+=n.slice(i.index,i.index+1),!r){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=m.rule,t}return 1}if(m=i,"begin"===i.type)return h(i);if("illegal"===i.type&&!a){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(k.className||"<unnamed>")+'"');throw e.mode=k,e}if("end"===i.type){const e=p(i);if(e!==wy)return e}if("illegal"===i.type&&""===o)return 1;if(x>1e5&&x>3*i.index){throw new Error("potential infinite loop, way more iterations than matches")}return w+=o,o.length}const b=y(e);if(!b)throw Ey(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const E=hy(b,{plugins:i});let v="",k=s||E;const D={},C=new l.__emitter(l);!function(){const e=[];for(let t=k;t!==b;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>C.openNode(e))}();let w="",S=0,O=0,x=0,T=!1;try{for(k.matcher.considerAll();;){x++,T?T=!1:k.matcher.considerAll(),k.matcher.lastIndex=O;const e=k.matcher.exec(n);if(!e)break;const t=F(n.substring(O,e.index),e);O=e.index+t}return F(n.substr(O)),C.closeAllNodes(),C.finalize(),v=C.toHTML(),{relevance:Math.floor(S),value:v,language:e,illegal:!1,emitter:C,top:k}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:n.slice(O-100,O+100),mode:t.mode},sofar:v,relevance:0,value:Dy(n),emitter:C};if(r)return{illegal:!1,relevance:0,value:Dy(n),emitter:C,language:e,top:k,errorRaised:t};throw t}}function _(e,n){n=n||l.languages||Object.keys(t);const i=function(e){const t={relevance:0,emitter:new l.__emitter(l),value:Dy(e),illegal:!1,top:s};return t.emitter.addText(e),t}(e),r=n.filter(y).filter(v).map(t=>c(t,e,!1));r.unshift(i);const a=r.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}),[o,u]=a,d=o;return d.second_best=u,d}const f={"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>"))}},g=/^(<[^>]+>|\t)+/gm,h={"after:highlightElement":({result:e})=>{l.tabReplace&&(e.value=e.value.replace(g,e=>e.replace(/\t/g,l.tabReplace)))}};function p(e){let t=null;const i=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||(vy(o.replace("{}",n[1])),vy("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>u(e)||y(e))}(e);if(u(i))return;k("before:highlightElement",{el:e,language:i}),t=e;const r=t.textContent,a=i?d(r,{language:i,ignoreIllegals:!0}):_(r);k("after:highlightElement",{el:e,result:a,text:r}),e.innerHTML=a.value,function(e,t,i){const r=t?n[t]:i;e.classList.add("hljs"),r&&e.classList.add(r)}(e,i,a.language),e.result={language:a.language,re:a.relevance,relavance:a.relevance},a.second_best&&(e.second_best={language:a.second_best.language,re:a.second_best.relevance,relavance:a.second_best.relevance})}const m=()=>{if(m.called)return;m.called=!0,ky("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(p)};let F=!1;function b(){if("loading"===document.readyState)return void(F=!0);document.querySelectorAll("pre code").forEach(p)}function y(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function E(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function v(e){const t=y(e);return t&&!t.disableAutodetect}function k(e,t){const n=e;i.forEach((function(e){e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){F&&b()}),!1),Object.assign(e,{highlight:d,highlightAuto:_,highlightAll:b,fixMarkup:function(e){return ky("10.2.0","fixMarkup will be removed entirely in v11.0"),ky("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),t=e,l.tabReplace||l.useBR?t.replace(a,e=>"\n"===e?l.useBR?"<br>":e:l.tabReplace?e.replace(/\t/g,l.tabReplace):e):t;var t},highlightElement:p,highlightBlock:function(e){return ky("10.7.0","highlightBlock will be removed entirely in v12.0"),ky("10.7.0","Please use highlightElement now."),p(e)},configure:function(e){e.useBR&&(ky("10.3.0","'useBR' will be removed entirely in v11.0"),ky("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),l=Cy(l,e)},initHighlighting:m,initHighlightingOnLoad:function(){ky("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),F=!0},registerLanguage:function(n,i){let a=null;try{a=i(e)}catch(e){if(Ey("Language definition for '{}' could not be registered.".replace("{}",n)),!r)throw e;Ey(e),a=s}a.name||(a.name=n),t[n]=a,a.rawDefinition=i.bind(null,e),a.aliases&&E(a.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:E,requireLanguage:function(e){ky("10.4.0","requireLanguage will be removed entirely in v11."),ky("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:v,inherit:Cy,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),i.push(e)},vuePlugin:py(e).VuePlugin}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString="10.7.3";for(const e in sy)"object"==typeof sy[e]&&Mb(sy[e]);return Object.assign(e,sy),e.addPlugin(f),e.addPlugin(my),e.addPlugin(h),e}({}),Oy={exports:{}};!function(e){!function(){var t;function n(e){for(var t,n,i,r,a=1,o=[].slice.call(arguments),s=0,l=e.length,u="",d=!1,c=!1,_=function(){return o[a++]},f=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],d)switch(d=!1,"."==t?(c=!1,t=e[++s]):"0"==t&&"."==e[s+1]?(c=!0,t=e[s+=2]):c=!0,r=f(),t){case"b":u+=parseInt(_(),10).toString(2);break;case"c":u+="string"==typeof(n=_())||n instanceof String?n:String.fromCharCode(parseInt(n,10));break;case"d":u+=parseInt(_(),10);break;case"f":i=String(parseFloat(_()).toFixed(r||6)),u+=c?i:i.replace(/^0/,"");break;case"j":u+=JSON.stringify(_());break;case"o":u+="0"+parseInt(_(),10).toString(8);break;case"s":u+=_();break;case"x":u+="0x"+parseInt(_(),10).toString(16);break;case"X":u+="0x"+parseInt(_(),10).toString(16).toUpperCase();break;default:u+=t}else"%"===t?d=!0:u+=t;return u}(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))})}()}(Oy);var xy=Oy.exports,Ty=Ay(Error),Ny=Ty;function Ay(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=xy.apply(null,arguments)),new e(t)}}Ty.eval=Ay(EvalError),Ty.range=Ay(RangeError),Ty.reference=Ay(ReferenceError),Ty.syntax=Ay(SyntaxError),Ty.type=Ay(TypeError),Ty.uri=Ay(URIError),Ty.create=Ay;var My=Sy,Ry=Ny;Nb.highlight=Iy,Nb.highlightAuto=function(e,t){var n=t||{},i=n.subset||My.listLanguages();n.prefix;var r,a,o,s,l=i.length,u=-1;if("string"!=typeof e)throw Ry("Expected `string` for value, got `%s`",e);a={relevance:0,language:null,value:[]},r={relevance:0,language:null,value:[]};for(;++u<l;)s=i[u],My.getLanguage(s)&&((o=Iy(s,e,t)).language=s,o.relevance>a.relevance&&(a=o),o.relevance>r.relevance&&(a=r,r=o));a.language&&(r.secondBest=a);return r},Nb.registerLanguage=function(e,t){My.registerLanguage(e,t)},Nb.listLanguages=function(){return My.listLanguages()},Nb.registerAlias=function(e,t){var n,i=e;t&&((i={})[e]=t);for(n in i)My.registerAliases(i[n],{languageName:n})},Ly.prototype.addText=function(e){var t,n,i=this.stack;if(""===e)return;t=i[i.length-1],(n=t.children[t.children.length-1])&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})},Ly.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},Ly.prototype.addSublanguage=function(e,t){var n=this.stack,i=n[n.length-1],r=e.rootNode.children,a=t?{type:"element",tagName:"span",properties:{className:[t]},children:r}:r;i.children=i.children.concat(a)},Ly.prototype.openNode=function(e){var t=this.stack,n=this.options.classPrefix+e,i=t[t.length-1],r={type:"element",tagName:"span",properties:{className:[n]},children:[]};i.children.push(r),t.push(r)},Ly.prototype.closeNode=function(){this.stack.pop()},Ly.prototype.closeAllNodes=By,Ly.prototype.finalize=By,Ly.prototype.toHTML=function(){return""};function Iy(e,t,n){var i,r=My.configure({}),a=(n||{}).prefix;if("string"!=typeof e)throw Ry("Expected `string` for name, got `%s`",e);if(!My.getLanguage(e))throw Ry("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw Ry("Expected `string` for value, got `%s`",t);if(null==a&&(a="hljs-"),My.configure({__emitter:Ly,classPrefix:a}),i=My.highlight(t,{language:e,ignoreIllegals:!0}),My.configure(r||{}),i.errorRaised)throw i.errorRaised;return{relevance:i.relevance,language:i.language,value:i.emitter.rootNode.children}}function Ly(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function By(){}function Py(e){return e.value||e.children||[]}function jy({doc:e,name:t,lowlight:n}){const i=[];return Es(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1;const{language:r}=e.node.attrs,a=n.listLanguages();(function e(t,n=[]){return t.map(t=>{const i=[...n,...t.properties?t.properties.className:[]];return t.children?e(t.children,i):{text:t.value,classes:i}}).flat()})(r&&a.includes(r)?Py(n.highlight(r,e.node.textContent)):Py(n.highlightAuto(e.node.textContent))).forEach(e=>{const n=t+e.text.length;if(e.classes.length){const r=Tr.inline(t,n,{class:e.classes.join(" ")});i.push(r)}t=n})}),Rr.create(e,i)}function qy({name:e,lowlight:t}){return new Mt({key:new Lt("lowlight"),state:{init:(n,{doc:i})=>jy({doc:i,name:e,lowlight:t}),apply:(n,i,r,a)=>{const o=r.selection.$head.parent.type.name,s=a.selection.$head.parent.type.name,l=Es(r.doc,t=>t.type.name===e),u=Es(a.doc,t=>t.type.name===e);return n.docChanged&&([o,s].includes(e)||u.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)))?jy({doc:n.doc,name:e,lowlight:t}):i.map(n.mapping,n.doc)}},props:{decorations(e){return this.getState(e)}}})}const Uy=Gh.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:Nb}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],qy({name:this.name,lowlight:this.options.lowlight})]}});function zy(){return m.a.createElement(Bu,{"data-cy":"neeto-editor-code-block"},m.a.createElement("pre",null,m.a.createElement(Pu,{as:"code"})))}var Hy=n(96),Wy=n.n(Hy),Gy=Uy.extend({addNodeView:function(){return new Mu(zy)}}).configure({lowlight:Wy.a}),Yy=function(e){var t=e.items,n=e.command;return m.a.createElement("div",{className:"neeto-editor-variables-suggestion"},m.a.createElement(Hc,{variables:t,onClickVariable:function(e){var t=e.category_key,i=e.key,r=t?"".concat(t,".").concat(i):i;n({label:r,id:r})}}))};function Vy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function $y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vy(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ky=new Lt("variables"),Qy=_s.create({name:"variable",addOptions:function(){return{HTMLAttributes:{class:"neeto-editor-variable"},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",rs({"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,i=t.state,r=!1,a=i.selection,o=a.empty,s=a.anchor;return!!o&&(i.doc.nodesBetween(s-1,s,(function(t,i){if(t.type.name===e.name)return r=!0,n.insertText("",i,i+t.nodeSize),!1})),r)}))}}},addProseMirrorPlugins:function(){return[wb($y({editor:this.editor},this.options.suggestion))]}}),Zy={char:"{{",startOfLine:!1,pluginKey:Ky,command:function(e){var t=e.editor,n=e.range,i=e.props;t.chain().focus().deleteRange(n).setVariable(i).run()},items:function(){return[]},render:function(){var e,t;return{onStart:function(n){e=new xu(Yy,{props:n,editor:n.editor}),t=bu("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onExit:function(){t[0].destroy(),e.destroy()}}}},Xy=function(e){var t=e.suggestion,n=void 0===t?{}:t;return Qy.configure({suggestion:$y($y({},Zy),n)})},Jy=n(35),eE=n.n(Jy),tE=n(97),nE=n.n(tE),iE=function(e){var t=eE()(e);return"string"===t||"funtion"===t?e:nE()(e)?function(t){var n=t.node.type.name;return e[n]}:""},rE=ma.create({name:"placeholder",addOptions:function(){return{excludeNodeTypes:["variable","codeBlock"],emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!1}},addProseMirrorPlugins:function(){var e=this;return[new Mt({props:{decorations:function(t){var n=t.doc,i=t.selection,r=e.editor.isEditable||!e.options.showOnlyWhenEditable,a=i.anchor,o=[];if(r)return n.descendants((function(t,n){var i=a>=n&&a<=n+t.nodeSize,r=!t.isLeaf&&!t.childCount,s=e.options.excludeNodeTypes.includes(t.type.name);if((i||!e.options.showOnlyCurrent)&&!s&&r){var l=[e.options.emptyNodeClass];e.editor.isEmpty&&l.push(e.options.emptyEditorClass);var u=Tr.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});o.push(u)}return e.options.includeChildren})),Rr.create(n,o)}}})]}});const aE=new Lt("suggestion");function oE({pluginKey:e=aE,editor:t,char:n="@",allowSpaces:i=!1,prefixSpace:r=!0,startOfLine:a=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:d=(()=>({})),allow:c=(()=>!0)}){const _=null==d?void 0:d();return new Mt({key:e,view(){return{update:async(e,n)=>{var i,r,a,o,s;const d=null===(i=this.key)||void 0===i?void 0:i.getState(n),c=null===(r=this.key)||void 0===r?void 0:r.getState(e.state),f=d.active&&c.active&&d.range.from!==c.range.from,g=!d.active&&c.active,h=d.active&&!c.active,p=g||f,m=!g&&!h&&d.query!==c.query&&!f,F=h||f;if(!p&&!m&&!F)return;const b=F&&!p?d:c,y=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),E={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.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};F&&(null===(a=null==_?void 0:_.onExit)||void 0===a||a.call(_,E)),m&&(null===(o=null==_?void 0:_.onUpdate)||void 0===o||o.call(_,E)),p&&(null===(s=null==_?void 0:_.onStart)||void 0===s||s.call(_,E))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from:d}=l,_={...o};if(_.composing=s,u||t.view.composing){!(d<o.range.from||d>o.range.to)||s||o.composing||(_.active=!1);const e=function(e){const{char:t,allowSpaces:n,prefixSpace:i,startOfLine:r,$position:a}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=r?"^":"",u=n?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),d=a.depth<=0?0:a.before(),c=a.pos,_=a.doc.textBetween(d,c,"\0","\0"),f=Array.from(_.matchAll(u)).pop();if(!f||void 0===f.input||void 0===f.index)return null;const g=f.input.slice(Math.max(0,f.index-1),f.index),h=/^[\s\0]?$/.test(g);if(i&&!h)return null;const p=f.index+a.start();let m=p+f[0].length;return n&&s.test(_.slice(m-1,m+1))&&(f[0]+=" ",m+=1),p<a.pos&&m>=a.pos?{range:{from:p,to:m},query:f[0].slice(t.length),text:f[0]}:null}({char:n,allowSpaces:i,prefixSpace:r,startOfLine:a,$position:l.$from}),u="id_"+Math.floor(4294967295*Math.random());e&&c({editor:t,range:e.range})?(_.active=!0,_.decorationId=o.decorationId?o.decorationId:u,_.range=e.range,_.query=e.query,_.text=e.text):_.active=!1}else _.active=!1;return _.active||(_.decorationId=null,_.range={},_.query=null,_.text=null),_}},props:{handleKeyDown(e,t){var n;const{active:i,range:r}=this.getState(e.state);return i&&(null===(n=null==_?void 0:_.onKeyDown)||void 0===n?void 0:n.call(_,{view:e,event:t,range:r}))||!1},decorations(e){const{active:t,range:n,decorationId:i}=this.getState(e);return t?Rr.create(e.doc,[Tr.inline(n.from,n.to,{nodeName:o,class:s,"data-decoration-id":i})]):null}}})}const sE=new Lt("mention"),lE=_s.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:sE,command:({editor:e,range:t,props:n})=>{var i;const r=e.view.state.selection.$to.nodeAfter;(null===(i=null==r?void 0:r.text)||void 0===i?void 0:i.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),i=e.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(i)}}}},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",rs({"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:i}=t,{empty:r,anchor:a}=i;return!!r&&(t.doc.nodesBetween(a-1,a,(t,i)=>{if(t.type.name===this.name)return n=!0,e.insertText(this.options.suggestion.char||"",i,i+t.nodeSize),!1}),n)})}},addProseMirrorPlugins(){return[oE({editor:this.editor,...this.options.suggestion})]}});function uE(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,i=m_()(e);if(t){var r=m_()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return h_()(this,n)}}var dE=function(e){f_()(n,e);var t=uE(n);function n(e){var i;return s_()(this,n),i=t.call(this,e),c()(c_()(i),"selectItem",(function(e){var t=i.props,n=t.items,r=t.command,a=n[e];a&&r({label:a.label,id:a.key})})),c()(c_()(i),"upHandler",(function(){var e=i.props.items;i.setState((function(t){return{selectedIndex:(t.selectedIndex+e.length-1)%e.length}}))})),c()(c_()(i),"downHandler",(function(){var e=i.props.items;i.setState((function(t){return{selectedIndex:(t.selectedIndex+1)%e.length}}))})),c()(c_()(i),"enterHandler",(function(){var e=i.state.selectedIndex;i.selectItem(e)})),c()(c_()(i),"onKeyDown",(function(e){var t=e.event,n={ArrowUp:i.upHandler,ArrowDown:i.downHandler,Enter:i.enterHandler};return!!n.hasOwnProperty(t.key)&&(n[t.key](),!0)})),i.state={selectedIndex:0},i.mentionRef=m.a.createRef(),i}return u_()(n,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),yb({wrapperRef:this.mentionRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this,t=this.state.selectedIndex,n=this.props.items;return 0===n.length?m.a.createElement("div",{className:"neeto-editor-mentions__wrapper"},m.a.createElement("p",{className:"neeto-editor-mentions__item"},"No Results")):m.a.createElement("div",{ref:this.mentionRef,className:"neeto-editor-mentions__wrapper","data-cy":"neeto-editor-mention-list"},n.map((function(n,i){var r=n.label,a=n.imageUrl,o=n.showImage;return m.a.createElement("button",{className:b()("neeto-editor-mentions__item",{active:i===t}),key:r,onClick:function(){return e.selectItem(i)},type:"button","data-cy":"neeto-editor-mention-list-".concat(r)},o&&m.a.createElement(Zc,{user:{name:r,imageUrl:a}}),m.a.createElement("p",null,r))})))}}]),n}(m.a.Component);function cE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function _E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cE(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cE(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var fE=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.showImage,i=void 0!==n&&n,r=e.map((function(e){var t;return"string"==typeof e?t={key:e,label:e}:"object"===eE()(e)&&(t=_E({},e)),t.showImage=i,t}));return function(e){var t=e.query;return r.filter((function(e){return e.label.toLowerCase().includes(t.toLowerCase())}))}},gE=["suggestion"];function hE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function pE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hE(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hE(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var mE={render:function(){var e,t;return{onStart:function(n){e=new xu(dE,{props:n,editor:n.editor}),t=bu("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown:function(n){var i;return"Escape"===n.event.key?(t[0].hide(),!0):null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(n)},onExit:function(){t[0].destroy(),e.destroy()}}}},FE=lE.extend({addCommands:function(){var e=this;return{setMention:function(t){return function(n){(0,n.chain)().focus().insertContent([{type:e.name,attrs:{id:t,label:t}},{type:"text",text:" "}]).run()}}}}}),bE=function(e){var t=e.suggestion,n=void 0===t?{}:t,i=h()(e,gE);return FE.configure(pE(pE({},i),{},{suggestion:pE(pE({},mE),n)}))},yE=_s.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",rs(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})}}}}}),EE=n(98);function vE(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,i=m_()(e);if(t){var r=m_()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return h_()(this,n)}}var kE=function(e){f_()(n,e);var t=vE(n);function n(){var e;s_()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),c()(c_()(e),"state",{selectedIndex:0,emojiSuggestions:$_.search(e.props.query||"smile").slice(0,5)}),c()(c_()(e),"onKeyDown",(function(t){var n=t.event;if("ArrowLeft"===n.key||"ArrowDown"===n.key)return e.setState({selectedIndex:(e.state.selectedIndex+e.state.emojiSuggestions.length-1)%e.state.emojiSuggestions.length}),!0;if("ArrowRight"===n.key||"ArrowUp"===n.key)return e.setState({selectedIndex:(e.state.selectedIndex+1)%e.state.emojiSuggestions.length}),!0;if("Enter"===n.key)return e.selectItem(e.state.selectedIndex),!0;if(" "===n.key){var i;if(Object(EE.isEmpty)(e.props.query))e.props.editor.chain().focus().insertContent(" ").run();else e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(null===(i=$_.search(e.props.query))||void 0===i?void 0:i[0]).run();return!0}return"Escape"===n.key&&(e.props.editor.chain().focus().insertContent(" ").run(),!0)})),c()(c_()(e),"selectItem",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(e.state.emojiSuggestions[t]).run()})),e}return u_()(n,[{key:"componentDidUpdate",value:function(e){this.props.query!==e.query&&this.setState({emojiSuggestions:$_.search(this.props.query||"smile").slice(0,5)})}},{key:"render",value:function(){var e=this;return m.a.createElement("div",{className:"neeto-editor-emoji-suggestion"},this.state.emojiSuggestions.length>0?this.state.emojiSuggestions.map((function(t,n){return m.a.createElement("div",{key:t.id,onClick:function(){return e.selectItem(n)},className:b()("neeto-editor-emoji-suggestion__item",{"neeto-editor-emoji-suggestion__item--highlight":n===e.state.selectedIndex}),"data-cy":"neeto-editor-emoji-suggestion-".concat(t.id)},t.native)})):m.a.createElement("p",null,"No results"))}}]),n}(m.a.Component);function DE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function CE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?DE(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DE(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var wE=new Lt("emoji-suggestion"),SE=_s.create({name:"emojiSuggestion",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:":",startOfLine:!1,pluginKey:wE,items:function(){return[]},render:function(){var e,t;return{onStart:function(n){e=new xu(kE,{props:n,editor:n.editor}),t=bu("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",zIndex:99999})},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()}}}}}},addCommands:function(){return{setEmoji:function(e){return function(t){(0,t.chain)().focus().insertContent("".concat((null==e?void 0:e.native)||""," ")).run()}}}},addProseMirrorPlugins:function(){return[wb(CE({editor:this.editor},this.options.suggestion))]}});function OE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function xE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?OE(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OE(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var TE=new Lt("emoji-picker"),NE=_s.create({name:"emojiPicker",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:"::",startOfLine:!1,pluginKey:TE,items:function(){return[]},render:function(){var e,t;return{onStart:function(n){e=new xu(Jf,{props:n,editor:n.editor}),t=bu("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},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[wb(xE({editor:this.editor},this.options.suggestion))]}}),AE=function(e){return function(e){var t=e.handleSubmit;return ma.create({addKeyboardShortcuts:function(){var e=this;return{"Mod-Enter":function(){return null==t||t(e.editor.getHTML()),e.editor.commands.blur(),!0}}}})}({handleSubmit:e.handleSubmit})};var ME=function(e){var t,n,i,r,a,o,s=e.editor,l=e.limit,u=e.strategy;if("hidden"===u)return null;var d="limit"===u&&l;return m.a.createElement("p",{className:"neeto-editor-character-count","data-cy":"neeto-editor-character-count"},d?"".concat(l-(null==s||null===(t=s.storage)||void 0===t||null===(n=t.characterCount)||void 0===n?void 0:n.characters())," characters remaining"):"".concat(null==s||null===(i=s.storage)||void 0===i||null===(r=i.characterCount)||void 0===r?void 0:r.characters()," characters, ").concat(null==s||null===(a=s.storage)||void 0===a||null===(o=a.characterCount)||void 0===o?void 0:o.words()," words"))},RE=["forceTitle","titleError","hideSlashCommands","addons","addonCommands","markdownMode","className","uploadEndpoint","value","onChange","menuType","variables","mentions","showImageInMention","placeholder","extensions","contentClassName","characterLimit","editorSecrets","rows","autoFocus","onSubmit","heightStrategy","characterCountStrategy"],IE=function(e,t){var n=e.forceTitle,i=void 0!==n&&n,r=e.titleError,a=void 0!==r&&r,o=e.hideSlashCommands,s=void 0!==o&&o,l=e.addons,d=void 0===l?[]:l,_=e.addonCommands,g=e.markdownMode,F=void 0!==g&&g,y=e.className,E=e.uploadEndpoint,v=e.value,k=void 0===v?"":v,D=e.onChange,C=void 0===D?function(){}:D,w=e.menuType,S=void 0===w?"fixed":w,O=e.variables,x=e.mentions,T=e.showImageInMention,N=void 0!==T&&T,A=e.placeholder,M=void 0===A?i?{title:"Untitled"}:null:A,R=e.extensions,I=e.contentClassName,L=e.characterLimit,B=e.editorSecrets,P=e.rows,j=void 0===P?6:P,q=e.autoFocus,U=void 0!==q&&q,z=e.onSubmit,H=e.heightStrategy,W=void 0===H?"fixed":H,G=e.characterCountStrategy,Y=void 0===G?"hidden":G,V=h()(e,RE),$=Object(p.useState)(!1),K=f()($,2),Q=K[0],Z=K[1],X=!1;if(M){var J=Object.keys(M).length;X="string"==typeof M||(1===J?!M.title:!!J)}var ee="fixed"===S,te="bubble"===S,ne=!s,ie=!X&&ne,re=d.includes("image-upload-unsplash"),ae=d.map((function(e){return e.toLowerCase()}));re&&ae.push("image-upload");var oe=["font-color","font-size","bold","italic","underline","strike","link","bullet-list","ordered-list"].concat(ae),se=function(e){var t=e.forceTitle,n=e.placeholder,i=e.extensions,r=e.mentions,a=e.variables,o=e.isSlashCommandsActive,s=e.showImageInMention,l=e.setImageUploadVisible,u=e.options,d=e.addonCommands,c=e.characterLimit,_=e.onSubmit,f=[fb,_b.extend({content:t?"title block*":"block+"}),Pp.configure({document:!1,codeBlock:!1}),bb,om,db,um,Gy,Fb,$h,yE,ub,cb,rE.configure({placeholder:iE(n)}),SE,NE,sb.configure({limit:c}),AE({handleSubmit:_})];return o&&f.push(Tb({setImageUploadVisible:l,options:u,addonCommands:d,mentions:r})),od()(r)||f.push(bE({suggestion:{items:fE(r.sort((function(e,t){var n="string"==typeof e?e:e.label,i="string"==typeof t?t:t.label;return n.localeCompare(i)})),{showImage:s})}})),od()(a)||f.push(Xy({suggestion:{items:function(){return a}}})),od()(i)||(f=f.concat(i)),f}({contentClassName:I,forceTitle:i,placeholder:M,extensions:R,mentions:x,variables:O,isSlashCommandsActive:ne,showImageInMention:N,setImageUploadVisible:Z,options:oe,addonCommands:_,characterLimit:L,onSubmit:z}),le=b()("neeto-editor",c()({"slash-active":ie,"fixed-menu-active border":ee,"bubble-menu-active":te,"force-title":i,"force-title--error":a,"placeholder-active":X},y,y)),ue=21*j+26,de="\n ".concat("flexible"===W?"min-height":"height",": ").concat(ue,"px;\n "),ce=Ou({extensions:se,content:k,injectCSS:!1,editorProps:{attributes:{class:le,style:de}},onUpdate:function(e){var t=e.editor;return C(t.getHTML())}});return Object(p.useEffect)((function(){U&&(null==ce||ce.commands.focus("end"))}),[ce]),Object(p.useEffect)((function(){var e=null==ce?void 0:ce.state.selection.anchor;"string"==typeof k?null==ce||ce.commands.setContent(function(e){return"string"!=typeof e?"":e.replaceAll(/<(\S*?)[^>]*>(.*?)<\/\1>/g,(function(e,t,n){return"<".concat(t,">").concat(n.replaceAll(" ","&nbsp;"),"</").concat(t,">")}))}(k)):null==ce||ce.commands.setContent(""),null==ce||ce.commands.setTextSelection(e)}),[k]),m.a.useImperativeHandle(t,(function(){return{editor:ce}})),m.a.createElement("div",{className:"neeto-editor-wrapper"},ee&&m.a.createElement(tg,{editor:ce,variables:O,setImageUploadVisible:Z,options:oe,mentions:x,showImageInMention:N}),te&&m.a.createElement(Gd,{editor:ce,options:oe}),m.a.createElement(Vg,{isVisible:Q,setIsVisible:Z,editor:ce,imageUploadUrl:E,isUnsplashImageUploadActive:re,unsplashApiKey:null==B?void 0:B.unsplash}),F&&m.a.createElement(Th,u()({editor:ce,strategy:W,style:de,className:le,onChange:C,onSubmit:z,value:k},V)),m.a.createElement("div",{className:b()({"neeto-editor-content--hidden":F})},m.a.createElement(Lu,u()({editor:ce},V))),m.a.createElement(ME,{editor:ce,limit:L,strategy:Y}))},LE=m.a.forwardRef(IE),BE=n(99),PE=n.n(BE);var jE=["content","classNames"],qE=function(e){var t=e.content,n=void 0===t?"":t,i=e.classNames,r=h()(e,jE);return Object(p.useEffect)((function(){document.querySelectorAll("div.".concat("neeto-editor-content"," pre code")).forEach((function(e){PE.a.highlightElement(e)}))}),[n]),m.a.createElement("div",u()({className:b()("neeto-editor-content",c()({},i,i)),dangerouslySetInnerHTML:{__html:Kg.a.sanitize(n)},"data-cy":"neeto-editor-content"},r))}}])}));
59
+ */;function Dd(){return(Dd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function Cd(e,t){if(null==e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}const wd=["onClick","reloadDocument","replace","state","target","to"],Sd=["aria-current","caseSensitive","className","end","style","to"];const Od=Object(p.forwardRef)((function(e,t){let{onClick:n,reloadDocument:i,replace:r=!1,state:a,target:o,to:s}=e,l=Cd(e,wd),u=hd(s),d=function(e,t){let{target:n,replace:i,state:r}=void 0===t?{}:t,a=Fd(),o=md(),s=bd(e);return Object(p.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=!!i||ud(o)===ud(s);a(e,{replace:n,state:r})}},[o,a,s,i,r,n,e])}(s,{replace:r,state:a,target:o});return Object(p.createElement)("a",Dd({},l,{href:u,onClick:function(e){n&&n(e),e.defaultPrevented||i||d(e)},ref:t,target:o}))}));const xd=Object(p.forwardRef)((function(e,t){let{"aria-current":n="page",caseSensitive:i=!1,className:r="",end:a=!1,style:o,to:s}=e,l=Cd(e,Sd),u=md(),d=bd(s),c=u.pathname,_=d.pathname;i||(c=c.toLowerCase(),_=_.toLowerCase());let f,g=c===_||!a&&c.startsWith(_)&&"/"===c.charAt(_.length),h=g?n:void 0;f="function"==typeof r?r({isActive:g}):[r,g?"active":null].filter(Boolean).join(" ");let m="function"==typeof o?o({isActive:g}):o;return Object(p.createElement)(Od,Dd({},l,{"aria-current":h,className:f,ref:t,style:m,to:s}))}));var Td=["icon","iconPosition","iconSize","label","loading","onClick","to","type","style","fullWidth","className","disabled","size","href","tooltipProps"],Nd=function(){},Ad="primary",Md="secondary",Rd="danger",Id="text",Ld="link",Bd="large",Pd="left",jd=Object(p.forwardRef)((function(e,t){var n,i,r=e.icon,a=void 0===r?null:r,o=e.iconPosition,s=void 0===o?"right":o,l=e.iconSize,d=void 0===l?16:l,c=e.label,_=void 0===c?"":c,f=e.loading,g=void 0!==f&&f,p=e.onClick,F=void 0===p?Nd:p,y=e.to,E=void 0===y?null:y,v=e.type,k=void 0===v?"button":v,D=e.style,C=void 0===D?"primary":D,w=e.fullWidth,S=void 0!==w&&w,O=e.className,x=void 0===O?"":O,T=e.disabled,N=void 0!==T&&T,A=e.size,M=void 0===A?null:A,R=e.href,I=void 0===R?null:R,L=e.tooltipProps,B=void 0===L?null:L,P=h()(e,Td);E?(n=Od,i={to:E}):I?(n="a",i={href:I}):(n="button",i={type:k});var j="string"==typeof a?function(){return m.a.createElement("i",{className:b()("ne-btn__icon",[a])})}:a||m.a.Fragment;return m.a.createElement(rd,u()({},B,{disabled:!B}),m.a.createElement(n,u()({ref:t,onClick:function(e){g||N||F(e)},className:b()("ne-btn",[x],{"ne-btn--style-primary":C===Ad,"ne-btn--style-secondary":C===Md,"ne-btn--style-danger":C===Rd,"ne-btn--style-text":C===Id,"ne-btn--style-link":C===Ld,"ne-btn--size-large":M===Bd,"ne-btn--width-full":S,"ne-btn--icon-left":s==Pd,"ne-btn--icon-only":!_,disabled:N}),disabled:N},i,P),_&&m.a.createElement("span",null,_),a?m.a.createElement(j,{key:"2",size:d,className:"ne-btn__icon"}):null))}));jd.displayName="Button";var qd=jd,Ud=/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/,zd=/^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,Hd=/((?:http|https):\/\/)?(www\.|player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|(?:manage\/)?videos?\/|)(\d+)(?:(?:\/|\?h=)(\w+))?(?:|\/\?)/,Wd=function(e){var t=e.editor,n=e.handleClose,i=e.handleAnimateInvalidLink,r=Object(p.useState)(""),a=f()(r,2),o=a[0],s=a[1];Object(p.useEffect)((function(){s(t.getAttributes("link").href||"")}),[]);var l=function(){Ud.test(o)?(t.chain().focus().setLink({href:o}).run(),n()):od()(o)?(t.chain().focus().unsetLink().run(),n()):(s(""),i())};return m.a.createElement("div",{onKeyDown:function(e){"Escape"===e.key?n():"Enter"===e.key&&l()},className:"neeto-editor-bubble-menu__link"},m.a.createElement("input",{autoFocus:!0,name:"url",value:o,placeholder:"Paste or type a link...",onChange:function(e){var t=e.target.value;return s(t)},className:"neeto-editor-bubble-menu-link__input","data-cy":"neeto-editor-link-input"}),m.a.createElement(qd,{style:"icon",icon:Uu.Close,onClick:function(){o?(s(""),t.chain().focus().unsetLink().run()):n()},"data-cy":"neeto-editor-link-submit-button"}))};function Gd(e){var t=e.editor,n=e.options,i=Object(p.useState)(!1),r=f()(i,2),a=r[0],o=r[1],s=Object(p.useState)(!1),l=f()(s,2),d=l[0],c=l[1];if(!t)return null;var _=[{Icon:Uu.TextBold,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:Uu.TextItalic,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:Uu.Underline,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline"},{Icon:Uu.TextCross,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:Uu.Link,command:function(){o(!0)},active:t.isActive("link"),optionName:"link"},{Icon:Uu.Code,command:function(){return t.chain().focus().toggleCode().run()},active:t.isActive("code"),optionName:"code-block"},{Icon:Uu.Highlight,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}];return m.a.createElement(wu,{editor:t,tippyOptions:{arrow:'<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',placement:"top-start",zIndex:99999,onHide:function(){return o(!1)}},className:b()("neeto-editor-bubble-menu",{"neeto-editor-bubble-menu-animate-shake":d})},a?m.a.createElement(Wd,{editor:t,handleClose:function(){return o(!1)},handleAnimateInvalidLink:function(){c(!0);var e=setTimeout((function(){c(!1),clearTimeout(e)}),1e3)}}):_.filter((function(e){var t=e.optionName;return n.includes(t)})).map((function(e){return m.a.createElement(Yd,u()({},e,{key:e.optionName}))})))}var Yd=function(e){var t=e.Icon,n=e.command,i=e.active,r=e.optionName;return m.a.createElement(rd,{content:ju(r),position:"top",delay:[500]},m.a.createElement("div",{className:b()("neeto-editor-bubble-menu__item",{active:i}),onClick:n,"data-cy":"neeto-editor-bubble-menu-".concat(r,"-option")},m.a.createElement(t,{size:20})))},Vd=n(1),$d=n.n(Vd),Kd=["icon","iconActive","tooltipProps"],Qd=function(e){var t=e.icon,n=e.iconActive,i=void 0===n||n,r=e.tooltipProps,a=h()(e,Kd);return m.a.createElement(rd,r,m.a.createElement("button",u()({className:"neeto-editor-fixed-menu__item",type:"button"},a),m.a.createElement(t,{color:i?"#2F3941":"#87929D",size:20})))};Qd.propTypes={icon:$d.a.oneOfType([$d.a.element,$d.a.func]),iconActive:$d.a.bool,onClick:$d.a.func,tooltipProps:$d.a.object};var Zd=Qd,Xd=["size","color","underlineColor"];function Jd(e){var t=e.size,n=e.color,i=e.underlineColor,r=h()(e,Xd);return m.a.createElement("svg",u()({viewBox:"0 0 24 24",fill:"none",height:t,width:t},r),m.a.createElement("path",{d:"M21 20H3",stroke:i||n,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M17.3125 15L12.1562 4L7 15M8.03125 12.8H16.2812",stroke:n,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}Jd.defaultProps={color:"currentColor",size:24},Jd.propTypes={color:$d.a.string,size:$d.a.oneOfType([$d.a.string,$d.a.number])};var ec=["size","color","bgColor"];function tc(e){var t=e.size,n=e.color,i=e.bgColor,r=h()(e,ec);return m.a.createElement("svg",u()({viewBox:"0 0 24 24",fill:"none",height:t,width:t},r),m.a.createElement("path",{d:"M21 7V17C21 19.209 19.209 21 17 21H7C4.791 21 3 19.209 3 17V7C3 4.791 4.791 3 7 3H17C19.209 3 21 4.791 21 7Z",fill:i,stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M10 8V16",stroke:n,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M14 8V16",stroke:n,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M8 14H16",stroke:n,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),m.a.createElement("path",{d:"M8 10H16",stroke:n,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}))}tc.defaultProps={color:"white",bgColor:"#68737D",size:24},tc.propTypes={color:$d.a.string,bgColor:$d.a.string,size:$d.a.oneOfType([$d.a.string,$d.a.number])};var nc=function(e){var t=e.color,n=void 0===t?"#000":t,i=e.onChange,r=Object(p.useRef)();return m.a.createElement(Zd,{icon:function(e){var t=e.color,a=e.size;return m.a.createElement(m.a.Fragment,null,m.a.createElement(Jd,{size:a,color:t,underlineColor:n}),m.a.createElement("input",{ref:r,type:"color",onChange:function(e){return i&&i(e.target.value)}}))},iconActive:!1,onClick:function(){var e;return null===(e=r.current)||void 0===e?void 0:e.click()},tooltipProps:{content:"Text Color",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-text-color-option"})},ic=n(89),rc=n.n(ic),ac=function(e){return e.reduce((function(e,t){var n=t[0],i=t[1];return e[n]=i,e}),{})},oc="undefined"!=typeof window&&window.document&&window.document.createElement?p.useLayoutEffect:p.useEffect,sc=[],lc="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function uc(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function dc(e,t){for(var n=t.slice(0,t.length-1),i=0;i<n.length;i++)n[i]=e[n[i].toLowerCase()];return n}function cc(e){"string"!=typeof e&&(e="");for(var t=(e=e.replace(/\s/g,"")).split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}for(var _c={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":lc?173:189,"=":lc?61:187,";":lc?59:186,"'":222,"[":219,"]":221,"\\":220},fc={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},gc={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},hc={16:!1,18:!1,17:!1,91:!1},pc={},mc=1;mc<20;mc++)_c["f".concat(mc)]=111+mc;var Fc=[],bc="all",yc=[],Ec=function(e){return _c[e.toLowerCase()]||fc[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function vc(e){bc=e||"all"}function kc(){return bc||"all"}var Dc=function(e){var t=e.key,n=e.scope,i=e.method,r=e.splitKey,a=void 0===r?"+":r;cc(t).forEach((function(e){var t=e.split(a),r=t.length,o=t[r-1],s="*"===o?"*":Ec(o);if(pc[s]){n||(n=kc());var l=r>1?dc(fc,t):[];pc[s]=pc[s].map((function(e){return(!i||e.method===i)&&e.scope===n&&function(e,t){for(var n=e.length>=t.length?e:t,i=e.length>=t.length?t:e,r=!0,a=0;a<n.length;a++)-1===i.indexOf(n[a])&&(r=!1);return r}(e.mods,l)?{}:e}))}}))};function Cc(e,t,n){var i;if(t.scope===n||"all"===t.scope){for(var r in i=t.mods.length>0,hc)Object.prototype.hasOwnProperty.call(hc,r)&&(!hc[r]&&t.mods.indexOf(+r)>-1||hc[r]&&-1===t.mods.indexOf(+r))&&(i=!1);(0!==t.mods.length||hc[16]||hc[18]||hc[17]||hc[91])&&!i&&"*"!==t.shortcut||!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function wc(e){var t=pc["*"],n=e.keyCode||e.which||e.charCode;if(Sc.filter.call(this,e)){if(93!==n&&224!==n||(n=91),-1===Fc.indexOf(n)&&229!==n&&Fc.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var n=gc[t];e[t]&&-1===Fc.indexOf(n)?Fc.push(n):!e[t]&&Fc.indexOf(n)>-1?Fc.splice(Fc.indexOf(n),1):"metaKey"===t&&e[t]&&3===Fc.length&&(e.ctrlKey||e.shiftKey||e.altKey||(Fc=Fc.slice(Fc.indexOf(n))))})),n in hc){for(var i in hc[n]=!0,fc)fc[i]===n&&(Sc[i]=!0);if(!t)return}for(var r in hc)Object.prototype.hasOwnProperty.call(hc,r)&&(hc[r]=e[gc[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===Fc.indexOf(17)&&Fc.push(17),-1===Fc.indexOf(18)&&Fc.push(18),hc[17]=!0,hc[18]=!0);var a=kc();if(t)for(var o=0;o<t.length;o++)t[o].scope===a&&("keydown"===e.type&&t[o].keydown||"keyup"===e.type&&t[o].keyup)&&Cc(e,t[o],a);if(n in pc)for(var s=0;s<pc[n].length;s++)if(("keydown"===e.type&&pc[n][s].keydown||"keyup"===e.type&&pc[n][s].keyup)&&pc[n][s].key){for(var l=pc[n][s],u=l.splitKey,d=l.key.split(u),c=[],_=0;_<d.length;_++)c.push(Ec(d[_]));c.sort().join("")===Fc.sort().join("")&&Cc(e,l,a)}}}function Sc(e,t,n){Fc=[];var i=cc(e),r=[],a="all",o=document,s=0,l=!1,u=!0,d="+";for(void 0===n&&"function"==typeof t&&(n=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(a=t.scope),t.element&&(o=t.element),t.keyup&&(l=t.keyup),void 0!==t.keydown&&(u=t.keydown),"string"==typeof t.splitKey&&(d=t.splitKey)),"string"==typeof t&&(a=t);s<i.length;s++)r=[],(e=i[s].split(d)).length>1&&(r=dc(fc,e)),(e="*"===(e=e[e.length-1])?"*":Ec(e))in pc||(pc[e]=[]),pc[e].push({keyup:l,keydown:u,scope:a,mods:r,shortcut:i[s],method:n,key:i[s],splitKey:d});void 0!==o&&!function(e){return yc.indexOf(e)>-1}(o)&&window&&(yc.push(o),uc(o,"keydown",(function(e){wc(e)})),uc(window,"focus",(function(){Fc=[]})),uc(o,"keyup",(function(e){wc(e),function(e){var t=e.keyCode||e.which||e.charCode,n=Fc.indexOf(t);if(n>=0&&Fc.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&Fc.splice(0,Fc.length),93!==t&&224!==t||(t=91),t in hc)for(var i in hc[t]=!1,fc)fc[i]===t&&(Sc[i]=!1)}(e)})))}var Oc={setScope:vc,getScope:kc,deleteScope:function(e,t){var n,i;for(var r in e||(e=kc()),pc)if(Object.prototype.hasOwnProperty.call(pc,r))for(n=pc[r],i=0;i<n.length;)n[i].scope===e?n.splice(i,1):i++;kc()===e&&vc(t||"all")},getPressedKeyCodes:function(){return Fc.slice(0)},isPressed:function(e){return"string"==typeof e&&(e=Ec(e)),-1!==Fc.indexOf(e)},filter:function(e){var t=e.target||e.srcElement,n=t.tagName,i=!0;return!t.isContentEditable&&("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n||t.readOnly)||(i=!1),i},unbind:function(e){if(e){if(Array.isArray(e))e.forEach((function(e){e.key&&Dc(e)}));else if("object"==typeof e)e.key&&Dc(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r=n[0],a=n[1];"function"==typeof r&&(a=r,r=""),Dc({key:e,scope:r,method:a,splitKey:"+"})}}else Object.keys(pc).forEach((function(e){return delete pc[e]}))}};for(var xc in Oc)Object.prototype.hasOwnProperty.call(Oc,xc)&&(Sc[xc]=Oc[xc]);if("undefined"!=typeof window){var Tc=window.hotkeys;Sc.noConflict=function(e){return e&&window.hotkeys===Sc&&(window.hotkeys=Tc),Sc},window.hotkeys=Sc}var Nc=Sc;Nc.filter=function(){return!0};var Ac=function(e,t){var n=e.target,i=n&&n.tagName;return Boolean(i&&t&&t.includes(i))};function Mc(e,t,n,i){n instanceof Array&&(i=n,n=void 0);var r=n||{},a=r.enableOnTags,o=r.filter,s=r.keyup,l=r.keydown,u=r.filterPreventDefault,d=void 0===u||u,c=r.enabled,_=void 0===c||c,f=r.enableOnContentEditable,g=void 0!==f&&f,h=Object(p.useRef)(null),m=Object(p.useCallback)((function(e,n){var i;return o&&!o(e)?!d:!!(Ac(e,["INPUT","TEXTAREA","SELECT"])&&!Ac(e,a)||null!=(i=e.target)&&i.isContentEditable&&!g)||(null===h.current||document.activeElement===h.current)&&(t(e,n),!0)}),i?[h,a,o].concat(i):[h,a,o]);return Object(p.useEffect)((function(){if(_)return s&&!0!==l&&(n.keydown=!1),Nc(e,n||{},m),function(){return Nc.unbind(e,m)};Nc.unbind(e,m)}),[m,e,_]),h}Nc.isPressed;var Rc=function(e,t){Object(p.useEffect)((function(){var n=function(n){e.current&&!e.current.contains(n.target)&&t(n)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),function(){document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}}),[e,t])},Ic=["icon","label","isOpen","onVisible","onClose","ulProps","position","children","className","buttonStyle","buttonProps","customTarget","disabled","closeOnEsc","closeOnSelect","closeOnOutsideClick","dropdownModifiers"];function Lc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Bc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lc(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Pc=function(){},jc=Object(p.forwardRef)((function(e,t){e.icon;var n=e.label,i=e.isOpen,r=e.onVisible,a=void 0===r?Pc:r,o=e.onClose,s=void 0===o?Pc:o,l=e.ulProps,d=e.position,_=e.children,g=e.className,F=(e.buttonStyle,e.buttonProps),y=e.customTarget,E=(e.disabled,e.closeOnEsc),v=void 0===E||E,k=e.closeOnSelect,D=void 0===k||k,C=e.closeOnOutsideClick,w=void 0===C||C,S=e.dropdownModifiers,O=void 0===S?[]:S,x=h()(e,Ic),T=Object(p.useRef)(),N=y(),A=!(null==i),M=Object(p.useState)(!1),R=f()(M,2),I=R[0],L=R[1],B=Object(p.useState)(null),P=f()(B,2),j=P[0],q=P[1],U=Object(p.useState)(null),z=f()(U,2),H=z[0],W=z[1],G=function(e,t,n){void 0===n&&(n={});var i=p.useRef(null),r={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||sc},a=p.useState({styles:{popper:{position:r.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=a[0],s=a[1],l=p.useMemo((function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(e){var t=e.state,n=Object.keys(t.elements);s({styles:ac(n.map((function(e){return[e,t.styles[e]||{}]}))),attributes:ac(n.map((function(e){return[e,t.attributes[e]]})))})},requires:["computeStyles"]}}),[]),u=p.useMemo((function(){var e={onFirstUpdate:r.onFirstUpdate,placement:r.placement,strategy:r.strategy,modifiers:[].concat(r.modifiers,[l,{name:"applyStyles",enabled:!1}])};return rc()(i.current,e)?i.current||e:(i.current=e,e)}),[r.onFirstUpdate,r.placement,r.strategy,r.modifiers,l]),d=p.useRef();return oc((function(){d.current&&d.current.setOptions(u)}),[u]),oc((function(){if(null!=e&&null!=t){var i=(n.createPopper||wl)(e,t,u);return d.current=i,function(){i.destroy(),d.current=null}}}),[e,t,n.createPopper]),{state:d.current?d.current.state:null,styles:o.styles,attributes:o.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}}(j,H,{placement:d||"bottom-end",modifiers:O}),Y=G.styles,V=G.attributes;Object(p.useImperativeHandle)(t,(function(){return{close:function(){return L(!1)},visible:I}}));var $=function(){A||L(!1),s()},K=function(){!A&&L(!I)};return v&&Mc("esc",$),w&&Rc(T,$),A||(F=Bc(Bc({},F),{},{onClick:function(){K()}})),Object(p.useEffect)((function(){A&&L(i)}),[i]),Object(p.useEffect)((function(){I&&a()}),[I]),m.a.createElement("div",u()({ref:T,className:b()("ne-dropdown__wrapper",c()({},g,g))},x),y?m.a.createElement("div",{ref:q,onClick:K},N):m.a.createElement("div",null,n,m.a.createElement(Uu.Down,null)),I&&m.a.createElement("ul",u()({className:"ne-dropdown__popup",ref:W,onClick:function(){D&&$()},"data-cy":"neeto-editor-".concat(qu(n),"-dropdown-container")},l,{style:Bc(Bc({display:"block"},Y.offset),Y.popper)},V.popper),_))})),qc=function(e){var t=e.editor;return m.a.createElement(jc,{customTarget:function(){return m.a.createElement(Zd,{icon:Uu.TextSize,iconActive:t.isActive("heading"),tooltipProps:{content:"Font Size",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-font-size-option"})},className:"neeto-editor-font-size-wrapper",placement:"bottom"},[{label:"H1",value:1},{label:"H2",value:2},{label:"H3",value:3}].map((function(e){var n,i=e.label,r=e.value;return m.a.createElement("li",{onClick:function(){return e=r,t.chain().focus().toggleHeading({level:e}).run();var e},key:r,className:b()({active:(n=r,t.isActive("heading",{level:n}))}),"data-cy":"neeto-editor-fixed-menu-font-size-option-".concat(i)},i)})))};function Uc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function zc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Uc(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Hc=function(e){var t=e.onClickVariable,n=e.variables,i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=[];return e.forEach((function(e){var i=e.category_key,r=e.category_label,a=e.variables;if(i&&a){var o=a.map((function(e){return zc(zc({},e),{},{category_key:i})}));n.push({label:r,variables:o})}else t.push(e)})),t.length&&n.push({label:n.length?"Others":null,variables:t}),n}(n);return n&&n.length?m.a.createElement("div",{className:"neeto-editor-variables-list"},i.map((function(e,n){var i=e.label,r=e.variables;return m.a.createElement(Wc,{key:n,index:n,title:i,variables:r,onClickItem:t})}))):null},Wc=function(e){var t=e.index,n=e.title,i=e.variables,r=e.onClickItem;return m.a.createElement("div",{className:"neeto-editor-variables-block","data-cy":"neeto-editor-variable-option-category-".concat(t)},n&&m.a.createElement("h6",null,n),m.a.createElement("div",{className:"neeto-editor-variables-row"},i.map((function(e){return m.a.createElement("button",{type:"button",onClick:function(){return r(e)},key:"".concat(e.label,"--").concat(e.value),className:"neeto-editor-variable","data-cy":"neeto-editor-variable-option-item-".concat(e.label,"--").concat(e.value)},e.label)}))))},Gc=["color"],Yc=function(e){var t=e.editor,n=e.variables;return n&&n.length?m.a.createElement(jc,{customTarget:function(){return m.a.createElement(Zd,{icon:function(e){e.color;var t=h()(e,Gc);return m.a.createElement(tc,t)},tooltipProps:{content:"Variables",position:"bottom",delay:[500]},"data-cy":"neeto-editor-variable-option"})}},m.a.createElement(Hc,{onClickVariable:function(e){var n=e.category_key,i=e.key,r=n?"".concat(n,".").concat(i):i;t.chain().focus().setVariable({label:r}).run()},variables:n})):null},Vc=["size","user","isSquare","status","onClick","className"],$c={small:24,medium:32,large:40,xlarge:64},Kc=["#E5E7EB","#FECACA","#FDE68A","#A7F3D0","#BFDBFE","#C7D2FE","#DDD6FE","#FBCFE8"];function Qc(e){var t,n,i=e.size,r=e.user,a=e.isSquare,o=e.status,s=e.onClick,l=e.className,d=h()(e,Vc),c=Object(p.useState)(!1),_=f()(c,2),g=_[0],F=_[1],y=r.name,E=void 0===y?"":y,v=r.imageUrl,k="medium"===i,D="large"===i,C="xlarge"===i,w=(t=E.trim().split(" ")).reduce((function(e,n,i){return 0!==i&&i!==t.length-1||(e="".concat(e).concat(n.charAt(0).toUpperCase())),e}),""),S={height:$c[i],width:$c[i],backgroundColor:(n=(w.charCodeAt(0)||0)+(w.charCodeAt(1)||0),Kc[n%65%Kc.length]||Kc[0])},O=b()("ne-avatar",{"ne-avatar--medium":k,"ne-avatar--large":D,"ne-avatar--xlarge":C,"ne-avatar--round":!a,hidden:!g}),x=b()("ne-avatar__text",{"ne-avatar__text-medium":k,"ne-avatar__text-large":D,"ne-avatar__text-xlarge":C}),T=b()("ne-avatar__status","".concat(o),{"ne-avatar__status-medium":k,"ne-avatar__status-large":D,"ne-avatar__status-xlarge":C,"ne-avatar__status-square":a}),N=function(){return null==o?m.a.Fragment:m.a.createElement("span",{className:T})},A=function(){return m.a.createElement("span",{className:x},w)},M=w&&!v&&!g;return m.a.createElement("div",u()({onClick:s,style:S,className:b()("ne-avatar--container",{"ne-avatar--container-round":!a},l)},d),m.a.createElement(N,null),M?m.a.createElement(A,null):m.a.createElement("img",{className:O,onLoad:function(){return F(!0)},onError:function(){return F(!1)},src:v,alt:"avatar-".concat(w)}))}Qc.defaultProps={size:"medium",user:{imageUrl:"",name:""},isSquare:!1,onClick:function(){},status:null},Qc.propTypes={size:$d.a.oneOf(Object.keys($c)),user:$d.a.shape({imageUrl:$d.a.string,name:$d.a.string}),isSquare:$d.a.bool,onClick:$d.a.func,status:$d.a.oneOf(Object.keys({online:"online",idle:"idle",offline:"offline"})),className:$d.a.string};var Zc=Qc,Xc=function(e){var t=e.editor,n=e.mentions,i=e.showImageInMention,r=Object(p.useRef)();return n&&n.length?m.a.createElement(jc,{ref:r,customTarget:function(){var e;return m.a.createElement(Zd,{icon:Uu.Email,iconActive:null===(e=r.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Mention",position:"bottom",delay:[500]},"data-cy":"neeto-editor-mention-option"})}},m.a.createElement("div",{className:"neeto-editor-mentions__wrapper neeto-editor-mentions__wrapper--small"},n.map((function(e){var n="string"==typeof e?e:e.label,r="string"==typeof e?"":e.imageUrl;return m.a.createElement("button",{className:"neeto-editor-mentions__item neeto-editor-mentions__item--light",key:n,onClick:function(){return t.commands.setMention(n)},type:"button","data-cy":"neeto-editor-mention-option-".concat(e.label)},i&&m.a.createElement(Zc,{size:"small",user:{name:n,imageUrl:r}}),m.a.createElement("p",null,n))})))):null},Jc=["children","className","required","helpIconProps"],e_=["onClick","icon","tooltipProps","className"],t_=function(e){var t=e.children,n=e.className,i=void 0===n?"":n,r=e.required,a=void 0!==r&&r,o=e.helpIconProps,s=void 0===o?null:o,l=h()(e,Jc),d=s||{},_=d.onClick,f=d.icon,g=d.tooltipProps,p=d.className,F=h()(d,e_),y=f||Uu.Info;return m.a.createElement("label",u()({className:b()("ne-label flex items-center",i)},l),t,a&&m.a.createElement("span",{"aria-hidden":!0},"*"),s&&m.a.createElement(rd,u()({},g,{disabled:!g}),m.a.createElement("span",{className:b()("ml-1",c()({},p,p)),onClick:_},m.a.createElement(y,u()({size:16},F)))))},n_=["id","size","type","label","error","suffix","prefix","disabled","helpText","className","nakedInput","contentSize","required"],i_=Object(p.forwardRef)((function(e,t){var n=e.id,i=e.size,r=void 0===i?"small":i,a=e.type,o=void 0===a?"text":a,s=e.label,l=e.error,d=void 0===l?null:l,c=e.suffix,_=void 0===c?null:c,f=e.prefix,g=void 0===f?null:f,p=e.disabled,F=void 0!==p&&p,y=e.helpText,E=void 0===y?"":y,v=e.className,k=void 0===v?"":v,D=e.nakedInput,C=void 0!==D&&D,w=e.contentSize,S=void 0===w?null:w,O=e.required,x=void 0!==O&&O,T=h()(e,n_);return m.a.createElement("div",{className:b()(["ne-input__wrapper",k])},s&&m.a.createElement(t_,{required:x,"data-cy":"neeto-editor-".concat(qu(s),"-input-label"),htmlFor:n},s),m.a.createElement("div",{className:b()("ne-input",{"ne-input--naked":!!C,"ne-input--error":!!d,"ne-input--disabled":!!F,"ne-input--small":"small"===r})},g&&m.a.createElement("div",{className:"ne-input__prefix"},g),m.a.createElement("input",u()({ref:t,type:o,disabled:F,size:S,required:x,"aria-invalid":!!d,"data-cy":"".concat(qu(s),"-input-field")},T)),_&&m.a.createElement("div",{className:"ne-input__suffix"},_)),!!d&&m.a.createElement("p",{"data-cy":"".concat(qu(s),"-input-error"),className:"ne-input__error"},d),E&&m.a.createElement("p",{className:"ne-input__help-text"},E))}));i_.displayName="Input";var r_=i_,a_=function(e){var t=e.editor,n=Object(p.useRef)(),i=Object(p.useRef)(),r=Object(p.useState)(""),a=f()(r,2),o=a[0],s=a[1],l=Object(p.useState)(""),u=f()(l,2),d=u[0],c=u[1],_=t.isActive("link"),g=function(){c(t.getAttributes("link").href||"")},h=function(){var e;Ud.test(d)?(t.chain().focus().setLink({href:d}).run(),null===(e=n.current)||void 0===e||e.close()):s("Please enter a valid url")};return m.a.createElement(jc,{ref:n,onVisible:function(){var e;return null===(e=i.current)||void 0===e?void 0:e.focus({preventScroll:!0})},customTarget:function(){return m.a.createElement(Zd,{icon:Uu.Link,iconActive:_,onClick:g,tooltipProps:{content:"Link",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-link-option"})},className:"neeto-editor-link-wrapper",closeOnSelect:!1,position:"bottom"},m.a.createElement("div",{onKeyDown:function(e){"Escape"===e.key?n.current.close():"Enter"===e.key&&h()},className:"neeto-editor-link__item"},m.a.createElement(r_,{ref:i,name:"url",value:d,placeholder:"Paste URL",onFocus:function(){return s("")},error:o,onChange:function(e){var t=e.target.value;return c(t)},"data-cy":"neeto-editor-fixed-menu-link-option-input"}),m.a.createElement(qd,{label:"Link",onClick:h,"data-cy":"neeto-editor-fixed-menu-link-option-link-button"}),_&&m.a.createElement(qd,{label:"Unlink",onClick:function(){var e;t.chain().focus().unsetLink().run(),null===(e=n.current)||void 0===e||e.close()},"data-cy":"neeto-editor-fixed-menu-link-option-unlink-button"})))},o_=n(21),s_=n.n(o_),l_=n(22),u_=n.n(l_),d_=n(15),c_=n.n(d_),__=n(23),f_=n.n(__),g_=n(24),h_=n.n(g_),p_=n(19),m_=n.n(p_),F_=n(32),b_=n(10),y_=n.n(b_),E_=n(11),v_=n.n(E_),k_=n(47),D_=n.n(k_),C_={name:"a",unified:"b",non_qualified:"c",has_img_apple:"d",has_img_google:"e",has_img_twitter:"f",has_img_facebook:"h",keywords:"j",sheet:"k",emoticons:"l",text:"m",short_names:"n",added_in:"o"},w_=function(e){var t=[],n=function(e,n){e&&(Array.isArray(e)?e:[e]).forEach((function(e){(n?e.split(/[-|_|\s]+/):[e]).forEach((function(e){e=e.toLowerCase(),-1==t.indexOf(e)&&t.push(e)}))}))};return n(e.short_names,!0),n(e.name,!0),n(e.keywords,!1),n(e.emoticons,!1),t.join(",")},S_=function(e){for(var t in e.compressed=!1,e.emojis){var n=e.emojis[t];for(var i in C_)n[i]=n[C_[i]],delete n[C_[i]];n.short_names||(n.short_names=[]),n.short_names.unshift(t),n.sheet_x=n.sheet[0],n.sheet_y=n.sheet[1],delete n.sheet,n.text||(n.text=""),n.added_in||(n.added_in=6),n.added_in=n.added_in.toFixed(1),n.search=w_(n)}},O_=String.fromCodePoint||function(){var e,t,n=16384,i=[],r=-1,a=arguments.length;if(!a)return"";for(var o="";++r<a;){var s=Number(arguments[r]);if(!isFinite(s)||s<0||s>1114111||Math.floor(s)!=s)throw RangeError("Invalid code point: "+s);s<=65535?i.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,i.push(e,t)),(r+1===a||i.length>n)&&(o+=String.fromCharCode.apply(null,i),i.length=0)}return o},x_=/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/,T_=["1F3FA","1F3FB","1F3FC","1F3FD","1F3FE","1F3FF"];function N_(e){var t=e.split("-").map((function(e){return"0x".concat(e)}));return O_.apply(null,t)}function A_(e){var t=e.name,n=e.short_names,i=e.skin_tone,r=e.skin_variations,a=e.emoticons,o=e.unified,s=e.custom,l=e.customCategory,u=e.imageUrl,d=e.id||n[0],c=":".concat(d,":");return s?{id:d,name:t,short_names:n,colons:c,emoticons:a,custom:s,customCategory:l,imageUrl:u}:(i&&(c+=":skin-tone-".concat(i,":")),{id:d,name:t,short_names:n,colons:c,emoticons:a,unified:o.toLowerCase(),skin:i||(r?1:null),native:N_(o)})}function M_(){return A_(R_.apply(void 0,arguments))}function R_(e,t,n,i){var r={};if("string"==typeof e){var a=e.match(x_);if(a&&(e=a[1],a[2]&&(t=parseInt(a[2],10))),i.aliases.hasOwnProperty(e)&&(e=i.aliases[e]),!i.emojis.hasOwnProperty(e))return null;r=i.emojis[e]}else e.id&&(i.aliases.hasOwnProperty(e.id)&&(e.id=i.aliases[e.id]),i.emojis.hasOwnProperty(e.id)&&(r=i.emojis[e.id],t||(t=e.skin)));if(Object.keys(r).length||((r=e).custom=!0,r.search||(r.search=w_(e))),r.emoticons||(r.emoticons=[]),r.variations||(r.variations=[]),r.skin_variations&&t>1){r=JSON.parse(JSON.stringify(r));var o=T_[t-1],s=r.skin_variations[o];if(s&&(!s.variations&&r.variations&&delete r.variations,n&&(null==s["has_img_".concat(n)]||s["has_img_".concat(n)])||!n))for(var l in r.skin_tone=t,s){var u=s[l];r[l]=u}}return r.variations&&r.variations.length&&((r=JSON.parse(JSON.stringify(r))).unified=r.variations.shift()),r}function I_(e){return e.reduce((function(e,t){return-1===e.indexOf(t)&&e.push(t),e}),[])}function L_(e,t){var n=I_(e),i=I_(t);return n.filter((function(e){return i.indexOf(e)>=0}))}function B_(e,t){var n={};for(var i in e){var r=e[i],a=r;t.hasOwnProperty(i)&&(a=t[i]),"object"===D_()(a)&&(a=B_(r,a)),n[i]=a}return n}var P_,j_,q_="emoji-mart",U_="undefined"!=typeof window&&"localStorage"in window;function z_(e,t){if(j_)j_(e,t);else{if(!U_)return;try{window.localStorage["".concat(q_,".").concat(e)]=JSON.stringify(t)}catch(e){}}}var H_={update:function(e){for(var t in e){z_(t,e[t])}},set:z_,get:function(e){if(P_)return P_(e);if(U_)try{var t=window.localStorage["".concat(q_,".").concat(e)];if(t)return JSON.parse(t)}catch(e){return}},setNamespace:function(e){q_=e},setHandlers:function(e){e||(e={}),P_=e.getter,j_=e.setter}},W_=function(){function e(t,n){y_()(this,e),t.compressed&&S_(t),this.data=t||{},this.set=n||null,this.originalPool={},this.index={},this.emojis={},this.emoticons={},this.customEmojisList=[],this.buildIndex()}return v_()(e,[{key:"buildIndex",value:function(){var e=this,t=function(t){var n=e.data.emojis[t],i=n.short_names,r=n.emoticons,a=n.skin_variations,o=i[0];if(r&&r.forEach((function(t){e.emoticons[t]||(e.emoticons[t]=o)})),a){e.emojis[o]={};for(var s=1;s<=6;s++)e.emojis[o][s]=M_({id:o,skin:s},s,e.set,e.data)}else e.emojis[o]=M_(o,null,e.set,e.data);e.originalPool[o]=n};for(var n in this.data.emojis)t(n)}},{key:"clearCustomEmojis",value:function(e){var t=this;this.customEmojisList.forEach((function(n){var i=n.id||n.short_names[0];delete e[i],delete t.emojis[i]}))}},{key:"addCustomToPool",value:function(e,t){var n=this;this.customEmojisList.length&&this.clearCustomEmojis(t),e.forEach((function(e){var i=e.id||e.short_names[0];i&&!t[i]&&(t[i]=R_(e,null,null,n.data),n.emojis[i]=M_(e,null,null,n.data))})),this.customEmojisList=e,this.index={}}},{key:"search",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.emojisToShowFilter,r=n.maxResults,a=n.include,o=n.exclude,s=n.custom,l=void 0===s?[]:s;this.customEmojisList!=l&&this.addCustomToPool(l,this.originalPool);var u=H_.get("skin")||1;r||(r=75),a||(a=[]),o||(o=[]);var d=null,c=this.originalPool;if(e.length){if("-"==e||"-1"==e)return[this.emojis[-1][u]];var _=e.toLowerCase().split(/[\s|,|\-|_]+/),f=[];if(_.length>2&&(_=[_[0],_[1]]),(a.length||o.length)&&(c={},this.data.categories.forEach((function(e){var n=!a||!a.length||a.indexOf(e.id)>-1,i=!(!o||!o.length)&&o.indexOf(e.id)>-1;n&&!i&&e.emojis.forEach((function(e){return c[e]=t.data.emojis[e]}))})),l.length)){var g=!a||!a.length||a.indexOf("custom")>-1,h=!(!o||!o.length)&&o.indexOf("custom")>-1;g&&!h&&this.addCustomToPool(l,c)}d=(f=_.map((function(e){for(var n=c,i=t.index,r=0,a=0;a<e.length;a++){var o=e[a];r++,i[o]||(i[o]={}),(i=i[o]).results||function(){var a={};for(var o in i.results=[],i.pool={},n){var s=n[o],l=s.search,d=e.substr(0,r),c=l.indexOf(d);if(-1!=c){var _=c+1;d==o&&(_=0),t.emojis[o]&&t.emojis[o][u]?i.results.push(t.emojis[o][u]):i.results.push(t.emojis[o]),i.pool[o]=s,a[o]=_}}i.results.sort((function(e,t){var n=a[e.id],i=a[t.id];return n==i?e.id.localeCompare(t.id):n-i}))}(),n=i.pool}return i.results})).filter((function(e){return e}))).length>1?L_.apply(null,f):f.length?f[0]:[]}return d&&(i&&(d=d.filter((function(e){return i(c[e.id])}))),d&&d.length>r&&(d=d.slice(0,r))),d}}]),e}(),G_=new W_(F_);var Y_,V_,$_={search:function(){return G_.search.apply(G_,arguments)},emojis:G_.emojis,emoticons:G_.emoticons},K_=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart","poop"],Q_={};function Z_(){V_=!0,Y_=H_.get("frequently")}var X_={add:function(e){V_||Z_();var t=e.id;Y_||(Y_=Q_),Y_[t]||(Y_[t]=0),Y_[t]+=1,H_.set("last",t),H_.set("frequently",Y_)},get:function(e){if(V_||Z_(),!Y_){Q_={};for(var t=[],n=0;n<e;n++)Q_[K_[n]]=e-n,t.push(K_[n]);return t}var i=4*e,r=[];for(var a in Y_)Y_.hasOwnProperty(a)&&r.push(a);var o=r.sort((function(e,t){return Y_[e]-Y_[t]})).reverse().slice(0,i),s=H_.get("last");return s&&-1==o.indexOf(s)&&(o.pop(),o.push(s)),o}},J_=n(17),ef=n.n(J_),tf=n(25),nf=n.n(tf),rf=n(12),af=n.n(rf),of=n(13),sf=n.n(of),lf=n(14),uf=n.n(lf),df=n(8),cf=n.n(df),_f={activity:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113"}))},custom:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("g",{transform:"translate(2.000000, 1.000000)"},m.a.createElement("rect",{id:"Rectangle",x:"8",y:"0",width:"3",height:"21",rx:"1.5"}),m.a.createElement("rect",{id:"Rectangle",transform:"translate(9.843, 10.549) rotate(60) translate(-9.843, -10.549) ",x:"8.343",y:"0.049",width:"3",height:"21",rx:"1.5"}),m.a.createElement("rect",{id:"Rectangle",transform:"translate(9.843, 10.549) rotate(-60) translate(-9.843, -10.549) ",x:"8.343",y:"0.049",width:"3",height:"21",rx:"1.5"})))},flags:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z"}))},foods:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M17 4.978c-1.838 0-2.876.396-3.68.934.513-1.172 1.768-2.934 4.68-2.934a1 1 0 0 0 0-2c-2.921 0-4.629 1.365-5.547 2.512-.064.078-.119.162-.18.244C11.73 1.838 10.798.023 9.207.023 8.579.022 7.85.306 7 .978 5.027 2.54 5.329 3.902 6.492 4.999 3.609 5.222 0 7.352 0 12.969c0 4.582 4.961 11.009 9 11.009 1.975 0 2.371-.486 3-1 .629.514 1.025 1 3 1 4.039 0 9-6.418 9-11 0-5.953-4.055-8-7-8M8.242 2.546c.641-.508.943-.523.965-.523.426.169.975 1.405 1.357 3.055-1.527-.629-2.741-1.352-2.98-1.846.059-.112.241-.356.658-.686M15 21.978c-1.08 0-1.21-.109-1.559-.402l-.176-.146c-.367-.302-.816-.452-1.266-.452s-.898.15-1.266.452l-.176.146c-.347.292-.477.402-1.557.402-2.813 0-7-5.389-7-9.009 0-5.823 4.488-5.991 5-5.991 1.939 0 2.484.471 3.387 1.251l.323.276a1.995 1.995 0 0 0 2.58 0l.323-.276c.902-.78 1.447-1.251 3.387-1.251.512 0 5 .168 5 6 0 3.617-4.187 9-7 9"}))},nature:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8"}),m.a.createElement("path",{d:"M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235"}))},objects:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0a9 9 0 0 0-5 16.482V21s2.035 3 5 3 5-3 5-3v-4.518A9 9 0 0 0 12 0zm0 2c3.86 0 7 3.141 7 7s-3.14 7-7 7-7-3.141-7-7 3.14-7 7-7zM9 17.477c.94.332 1.946.523 3 .523s2.06-.19 3-.523v.834c-.91.436-1.925.689-3 .689a6.924 6.924 0 0 1-3-.69v-.833zm.236 3.07A8.854 8.854 0 0 0 12 21c.965 0 1.888-.167 2.758-.451C14.155 21.173 13.153 22 12 22c-1.102 0-2.117-.789-2.764-1.453z"}),m.a.createElement("path",{d:"M14.745 12.449h-.004c-.852-.024-1.188-.858-1.577-1.824-.421-1.061-.703-1.561-1.182-1.566h-.009c-.481 0-.783.497-1.235 1.537-.436.982-.801 1.811-1.636 1.791l-.276-.043c-.565-.171-.853-.691-1.284-1.794-.125-.313-.202-.632-.27-.913-.051-.213-.127-.53-.195-.634C7.067 9.004 7.039 9 6.99 9A1 1 0 0 1 7 7h.01c1.662.017 2.015 1.373 2.198 2.134.486-.981 1.304-2.058 2.797-2.075 1.531.018 2.28 1.153 2.731 2.141l.002-.008C14.944 8.424 15.327 7 16.979 7h.032A1 1 0 1 1 17 9h-.011c-.149.076-.256.474-.319.709a6.484 6.484 0 0 1-.311.951c-.429.973-.79 1.789-1.614 1.789"}))},people:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}),m.a.createElement("path",{d:"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0"}))},places:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M6.5 12C5.122 12 4 13.121 4 14.5S5.122 17 6.5 17 9 15.879 9 14.5 7.878 12 6.5 12m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5M17.5 12c-1.378 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.122-2.5-2.5-2.5m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5"}),m.a.createElement("path",{d:"M22.482 9.494l-1.039-.346L21.4 9h.6c.552 0 1-.439 1-.992 0-.006-.003-.008-.003-.008H23c0-1-.889-2-1.984-2h-.642l-.731-1.717C19.262 3.012 18.091 2 16.764 2H7.236C5.909 2 4.738 3.012 4.357 4.283L3.626 6h-.642C1.889 6 1 7 1 8h.003S1 8.002 1 8.008C1 8.561 1.448 9 2 9h.6l-.043.148-1.039.346a2.001 2.001 0 0 0-1.359 2.097l.751 7.508a1 1 0 0 0 .994.901H3v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h6v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h1.096a.999.999 0 0 0 .994-.901l.751-7.508a2.001 2.001 0 0 0-1.359-2.097M6.273 4.857C6.402 4.43 6.788 4 7.236 4h9.527c.448 0 .834.43.963.857L19.313 9H4.688l1.585-4.143zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.189-3H2.811l-.662-6.607L3 11h18l.852.393L21.189 18z"}))},recent:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z"}),m.a.createElement("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}))},symbols:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76"}))}},ff={search:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 20 20",opacity:"0.5"},m.a.createElement("path",{d:"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"}))},delete:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 20 20",opacity:"0.5"},m.a.createElement("path",{d:"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"}))}},gf={data:$d.a.object.isRequired,onOver:$d.a.func,onLeave:$d.a.func,onClick:$d.a.func,fallback:$d.a.func,backgroundImageFn:$d.a.func,native:$d.a.bool,forceSize:$d.a.bool,tooltip:$d.a.bool,useButton:$d.a.bool,skin:$d.a.oneOf([1,2,3,4,5,6]),sheetSize:$d.a.oneOf([16,20,32,64]),sheetColumns:$d.a.number,sheetRows:$d.a.number,set:$d.a.oneOf(["apple","google","twitter","facebook"]),size:$d.a.number.isRequired,emoji:$d.a.oneOfType([$d.a.string,$d.a.object]).isRequired},hf={onClick:$d.a.func,onSelect:$d.a.func,onSkinChange:$d.a.func,perLine:$d.a.number,emojiSize:$d.a.number,i18n:$d.a.object,style:$d.a.object,title:$d.a.string,emoji:$d.a.string,color:$d.a.string,set:gf.set,skin:gf.skin,native:$d.a.bool,backgroundImageFn:gf.backgroundImageFn,sheetSize:gf.sheetSize,emojisToShowFilter:$d.a.func,showPreview:$d.a.bool,showSkinTones:$d.a.bool,emojiTooltip:gf.tooltip,useButton:gf.useButton,theme:$d.a.oneOf(["auto","light","dark"]),include:$d.a.arrayOf($d.a.string),exclude:$d.a.arrayOf($d.a.string),recent:$d.a.arrayOf($d.a.string),autoFocus:$d.a.bool,enableFrequentEmojiSort:$d.a.bool,custom:$d.a.arrayOf($d.a.shape({name:$d.a.string.isRequired,short_names:$d.a.arrayOf($d.a.string).isRequired,emoticons:$d.a.arrayOf($d.a.string),keywords:$d.a.arrayOf($d.a.string),imageUrl:$d.a.string,spriteUrl:$d.a.string,sheet_x:$d.a.number,sheet_y:$d.a.number,size:$d.a.number,sheetColumns:$d.a.number,sheetRows:$d.a.number})),skinEmoji:$d.a.string,notFound:$d.a.func,notFoundEmoji:$d.a.string,icons:$d.a.object},pf=function(e){function t(e){var n;y_()(this,t),n=af()(this,sf()(t).call(this,e));var i=e.categories.filter((function(e){return e.first}))[0];return n.state={selected:i.name},n.handleClick=n.handleClick.bind(cf()(n)),n}return uf()(t,e),v_()(t,[{key:"handleClick",value:function(e){var t=e.currentTarget.getAttribute("data-index"),n=this.props,i=n.categories;(0,n.onAnchorClick)(i[t],t)}},{key:"render",value:function(){var e=this,t=this.props,n=t.categories,i=t.color,r=t.i18n,a=t.icons,o=this.state.selected;return m.a.createElement("nav",{className:"emoji-mart-anchors","aria-label":r.categorieslabel},n.map((function(t,n){var s=t.id,l=t.name,u=t.anchor,d=l==o;if(!1===u)return null;var c=s.startsWith("custom-")?"custom":s;return m.a.createElement("button",{key:s,"aria-label":r.categories[c],title:r.categories[c],"data-index":n,type:"button",onClick:e.handleClick,className:"emoji-mart-anchor ".concat(d?"emoji-mart-anchor-selected":""),style:{color:d?i:null}},m.a.createElement("div",{className:"emoji-mart-anchor-icon"},a.categories[c]()),m.a.createElement("span",{className:"emoji-mart-anchor-bar",style:{backgroundColor:i}}))})))}}]),t}(m.a.PureComponent);pf.propTypes={categories:$d.a.array,onAnchorClick:$d.a.func,icons:$d.a.object},pf.defaultProps={categories:[],onAnchorClick:function(){},icons:{}};var mf={skin:1,set:"apple",sheetSize:64,sheetColumns:57,sheetRows:57,native:!1,forceSize:!1,tooltip:!1,useButton:!0,backgroundImageFn:function(e,t){return"https://unpkg.com/emoji-datasource-".concat(e,"@").concat("5.0.1","/img/").concat(e,"/sheets-256/").concat(t,".png")}},Ff={onClick:function(){},onSelect:function(){},onSkinChange:function(){},emojiSize:24,perLine:9,i18n:{},style:{},title:"Emoji Mart™",emoji:"department_store",color:"#ae65c5",set:mf.set,theme:"light",skin:null,defaultSkin:mf.skin,native:mf.native,sheetSize:mf.sheetSize,backgroundImageFn:mf.backgroundImageFn,emojisToShowFilter:null,showPreview:!0,showSkinTones:!0,emojiTooltip:mf.tooltip,useButton:mf.useButton,autoFocus:!1,enableFrequentEmojiSort:!1,custom:[],skinEmoji:"",notFound:function(){},notFoundEmoji:"sleuth_or_spy",icons:{}};function bf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function yf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bf(Object(n),!0).forEach((function(t){ef()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ef=function(e){return R_(e.emoji,e.skin,e.set,e.data)},vf=function(e){var t=Ef(e),n=t.sheet_x,i=t.sheet_y,r=100/(e.sheetColumns-1),a=100/(e.sheetRows-1);return"".concat(r*n,"% ").concat(a*i,"%")},kf=function(e){return M_(e.emoji,e.skin,e.set,e.data)},Df=function(e){return!isNaN(e-parseFloat(e))},Cf=function e(t){for(var n in t.data.compressed&&S_(t.data),e.defaultProps)null==t[n]&&null!=e.defaultProps[n]&&(t[n]=e.defaultProps[n]);var i=Ef(t);if(!i)return t.fallback?t.fallback(null,t):null;var r=i.unified,a=i.custom,o=i.short_names,s=i.imageUrl,l={},u=t.children,d="emoji-mart-emoji",c=r&&N_(r),_=[c].concat(o).filter(Boolean).join(", "),f=null;if(!r&&!a)return t.fallback?t.fallback(i,t):null;if(t.tooltip&&(f=o[0]),t.native&&r)d+=" emoji-mart-emoji-native",l={fontSize:t.size},u=c,t.forceSize&&(l.display="inline-block",l.width=t.size,l.height=t.size,l.wordBreak="keep-all");else if(a)d+=" emoji-mart-emoji-custom",l={width:t.size,height:t.size,display:"inline-block"},l=i.spriteUrl?yf({},l,{backgroundImage:"url(".concat(i.spriteUrl,")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:vf(t)}):yf({},l,{backgroundImage:"url(".concat(s,")"),backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center"});else{if(!(null==i["has_img_".concat(t.set)]||i["has_img_".concat(t.set)]))return t.fallback?t.fallback(i,t):null;l={width:t.size,height:t.size,display:"inline-block",backgroundImage:"url(".concat(t.backgroundImageFn(t.set,t.sheetSize),")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:vf(t)}}var g={name:"span",props:{}};return t.onClick&&t.useButton&&(g.name="button",g.props={type:"button"}),t.html?(l=function(e){var t=document.createElement("div");for(var n in e){var i=e[n];Df(i)&&(i+="px"),t.style[n]=i}return t.getAttribute("style")}(l),"<".concat(g.name," style='").concat(l,"' aria-label='").concat(_,"' ").concat(f?"title='".concat(f,"'"):""," class='").concat(d,"'>").concat(u||"","</").concat(g.name,">")):m.a.createElement(g.name,nf()({onClick:function(e){return function(e,t){t.onClick&&(0,t.onClick)(kf(t),e)}(e,t)},onMouseEnter:function(e){return function(e,t){t.onOver&&(0,t.onOver)(kf(t),e)}(e,t)},onMouseLeave:function(e){return function(e,t){t.onLeave&&(0,t.onLeave)(kf(t),e)}(e,t)},"aria-label":_,title:f,className:d},g.props),m.a.createElement("span",{style:l},u))};Cf.propTypes=yf({},gf,{data:$d.a.object.isRequired}),Cf.defaultProps=mf;var wf=Cf;function Sf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var Of=function(e){function t(){return y_()(this,t),af()(this,sf()(t).apply(this,arguments))}return uf()(t,e),v_()(t,[{key:"render",value:function(){var e=this.props,t=e.data,n=e.emojiProps,i=e.i18n,r=e.notFound,a=e.notFoundEmoji;return r&&r()||m.a.createElement("div",{className:"emoji-mart-no-results"},wf(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sf(Object(n),!0).forEach((function(t){ef()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({data:t},n,{size:38,emoji:a,onOver:null,onLeave:null,onClick:null})),m.a.createElement("div",{className:"emoji-mart-no-results-label"},i.notfound))}}]),t}(m.a.PureComponent);function xf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}Of.propTypes={notFound:$d.a.func.isRequired,emojiProps:$d.a.object.isRequired};var Tf=function(e){function t(e){var n;return y_()(this,t),(n=af()(this,sf()(t).call(this,e))).data=e.data,n.setContainerRef=n.setContainerRef.bind(cf()(n)),n.setLabelRef=n.setLabelRef.bind(cf()(n)),n}return uf()(t,e),v_()(t,[{key:"componentDidMount",value:function(){this.margin=0,this.minMargin=0,this.memoizeSize()}},{key:"shouldComponentUpdate",value:function(e,t){var n=this.props,i=n.name,r=n.perLine,a=n.native,o=n.hasStickyPosition,s=n.emojis,l=n.emojiProps,u=l.skin,d=l.size,c=l.set,_=e.perLine,f=e.native,g=e.hasStickyPosition,h=e.emojis,p=e.emojiProps,m=p.skin,F=p.size,b=p.set,y=!1;return"Recent"==i&&r!=_&&(y=!0),"Search"==i&&(y=!(s==h)),u==m&&d==F&&a==f&&c==b&&o==g||(y=!0),y}},{key:"memoizeSize",value:function(){if(!this.container)return this.top=0,void(this.maxMargin=0);var e=this.container.parentElement,t=this.container.getBoundingClientRect(),n=t.top,i=t.height,r=e.getBoundingClientRect().top,a=this.label.getBoundingClientRect().height;this.top=n-r+e.scrollTop,this.maxMargin=0==i?0:i-a}},{key:"handleScroll",value:function(e){var t=e-this.top;if((t=(t=t<this.minMargin?this.minMargin:t)>this.maxMargin?this.maxMargin:t)!=this.margin)return this.props.hasStickyPosition||(this.label.style.top="".concat(t,"px")),this.margin=t,!0}},{key:"getEmojis",value:function(){var e=this,t=this.props,n=t.name,i=t.emojis,r=t.recent,a=t.perLine;if("Recent"==n){var o=this.props.custom,s=r||X_.get(a);if(s.length&&(i=s.map((function(e){var t=o.filter((function(t){return t.id===e}))[0];return t||e})).filter((function(t){return!!R_(t,null,null,e.data)}))),0===i.length&&s.length>0)return null}return i&&(i=i.slice(0)),i}},{key:"updateDisplay",value:function(e){this.getEmojis()&&this.container&&(this.container.style.display=e)}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"setLabelRef",value:function(e){this.label=e}},{key:"render",value:function(){var e=this,t=this.props,n=t.id,i=t.name,r=t.hasStickyPosition,a=t.emojiProps,o=t.i18n,s=t.notFound,l=t.notFoundEmoji,u=this.getEmojis(),d={},c={},_={};u||(_={display:"none"}),r||(d={height:28},c={position:"absolute"});var f=o.categories[n]||i;return m.a.createElement("section",{ref:this.setContainerRef,className:"emoji-mart-category","aria-label":f,style:_},m.a.createElement("div",{style:d,"data-name":i,className:"emoji-mart-category-label"},m.a.createElement("span",{style:c,ref:this.setLabelRef,"aria-hidden":!0},f)),m.a.createElement("ul",{className:"emoji-mart-category-list"},u&&u.map((function(t){return m.a.createElement("li",{key:t.short_names&&t.short_names.join("_")||t},wf(function(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){ef()(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}({emoji:t,data:e.data},a)))}))),u&&!u.length&&m.a.createElement(Of,{i18n:o,notFound:s,notFoundEmoji:l,data:this.data,emojiProps:a}))}}]),t}(m.a.Component);Tf.propTypes={emojis:$d.a.array,hasStickyPosition:$d.a.bool,name:$d.a.string.isRequired,native:$d.a.bool.isRequired,perLine:$d.a.number.isRequired,emojiProps:$d.a.object.isRequired,recent:$d.a.arrayOf($d.a.string),notFound:$d.a.func,notFoundEmoji:$d.a.string.isRequired},Tf.defaultProps={emojis:[],hasStickyPosition:!0};var Nf=function(e){function t(e){var n;return y_()(this,t),(n=af()(this,sf()(t).call(this,e))).state={opened:!1},n}return uf()(t,e),v_()(t,[{key:"handleClick",value:function(e){var t=parseInt(e.currentTarget.getAttribute("data-skin")),n=this.props.onChange;this.state.opened?(this.setState({opened:!1}),t!=this.props.skin&&n(t)):this.setState({opened:!0})}},{key:"render",value:function(){return null}}]),t}(m.a.PureComponent);Nf.propTypes={onChange:$d.a.func,skin:$d.a.number.isRequired},Nf.defaultProps={onChange:function(){}};var Af=function(e){function t(e){var n;return y_()(this,t),(n=af()(this,sf()(t).call(this,e))).handleClick=n.handleClick.bind(cf()(n)),n}return uf()(t,e),v_()(t,[{key:"render",value:function(){for(var e=this.props,t=e.skin,n=e.emojiProps,i=e.data,r=e.skinEmoji,a=e.i18n,o=this.state.opened,s=[],l=1;l<=6;l++){var u=l===t;s.push(m.a.createElement("span",{key:"skin-tone-".concat(l),className:"emoji-mart-skin-swatch custom".concat(u?" selected":"")},m.a.createElement("span",{onClick:this.handleClick,"data-skin":l,className:"emoji-mart-skin-tone-".concat(l)},wf({emoji:r,data:i,skin:l,backgroundImageFn:n.backgroundImageFn,native:n.native,set:n.set,sheetSize:n.sheetSize,size:23}))))}return m.a.createElement("div",{className:"emoji-mart-skin-swatches custom".concat(o?" opened":"")},m.a.createElement("div",{className:"emoji-mart-skin-text".concat(o?" opened":"")},a.skintext),s)}}]),t}(Nf);Af.propTypes={onChange:$d.a.func,skin:$d.a.number.isRequired,emojiProps:$d.a.object.isRequired,skinTone:$d.a.number,skinEmoji:$d.a.string.isRequired,i18n:$d.a.object},Af.defaultProps={onChange:function(){},skinTone:null};var Mf=function(e){function t(e){var n;return y_()(this,t),(n=af()(this,sf()(t).call(this,e))).handleClick=n.handleClick.bind(cf()(n)),n.handleKeyDown=n.handleKeyDown.bind(cf()(n)),n}return uf()(t,e),v_()(t,[{key:"handleKeyDown",value:function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),this.handleClick(e))}},{key:"render",value:function(){for(var e=this.props,t=e.skin,n=e.i18n,i=this.state.opened,r=[],a=1;a<=6;a++){var o=a===t,s=i||o;r.push(m.a.createElement("span",nf()({key:"skin-tone-".concat(a),className:"emoji-mart-skin-swatch".concat(o?" selected":""),"aria-label":n.skintones[a],"aria-hidden":!s},i?{role:"menuitem"}:{}),m.a.createElement("span",nf()({onClick:this.handleClick,onKeyDown:this.handleKeyDown,role:"button"},o?{"aria-haspopup":!0,"aria-expanded":!!i}:{},i?{"aria-pressed":!!o}:{},{tabIndex:s?"0":"","aria-label":n.skintones[a],title:n.skintones[a],"data-skin":a,className:"emoji-mart-skin emoji-mart-skin-tone-".concat(a)}))))}return m.a.createElement("section",{className:"emoji-mart-skin-swatches".concat(i?" opened":""),"aria-label":n.skintext},m.a.createElement("div",i?{role:"menubar"}:{},r))}}]),t}(Nf);function Rf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function If(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rf(Object(n),!0).forEach((function(t){ef()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Mf.propTypes={onChange:$d.a.func,skin:$d.a.number.isRequired,i18n:$d.a.object},Mf.defaultProps={onChange:function(){}};var Lf=function(e){function t(e){var n;return y_()(this,t),(n=af()(this,sf()(t).call(this,e))).data=e.data,n.state={emoji:null},n}return uf()(t,e),v_()(t,[{key:"render",value:function(){var e=this.state.emoji,t=this.props,n=t.emojiProps,i=t.skinsProps,r=t.showSkinTones,a=t.title,o=t.emoji,s=t.i18n,l=t.showPreview;if(e&&l){var u=R_(e,null,null,this.data),d=u.emoticons,c=[],_=[];return(void 0===d?[]:d).forEach((function(e){c.indexOf(e.toLowerCase())>=0||(c.push(e.toLowerCase()),_.push(e))})),m.a.createElement("div",{className:"emoji-mart-preview"},m.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},wf(If({key:e.id,emoji:e,data:this.data},n))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("div",{className:"emoji-mart-preview-name"},e.name),m.a.createElement("div",{className:"emoji-mart-preview-shortnames"},u.short_names.map((function(e){return m.a.createElement("span",{key:e,className:"emoji-mart-preview-shortname"},":",e,":")}))),m.a.createElement("div",{className:"emoji-mart-preview-emoticons"},_.map((function(e){return m.a.createElement("span",{key:e,className:"emoji-mart-preview-emoticon"},e)})))))}return m.a.createElement("div",{className:"emoji-mart-preview"},m.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},o&&o.length&&wf(If({emoji:o,data:this.data},n))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("span",{className:"emoji-mart-title-label"},a)),r&&m.a.createElement("div",{className:"emoji-mart-preview-skins".concat(i.skinEmoji?" custom":"")},i.skinEmoji?m.a.createElement(Af,{skin:i.skin,emojiProps:n,data:this.data,skinEmoji:i.skinEmoji,i18n:s,onChange:i.onChange}):m.a.createElement(Mf,{skin:i.skin,i18n:s,onChange:i.onChange})))}}]),t}(m.a.PureComponent);Lf.propTypes={showSkinTones:$d.a.bool,title:$d.a.string.isRequired,emoji:$d.a.string.isRequired,emojiProps:$d.a.object.isRequired,skinsProps:$d.a.object.isRequired},Lf.defaultProps={showSkinTones:!0,onChange:function(){}};var Bf=0,Pf=function(e){function t(e){var n,i,r,a;return y_()(this,t),(n=af()(this,sf()(t).call(this,e))).state={icon:ff.search,isSearching:!1,id:++Bf},n.data=e.data,n.emojiIndex=new W_(n.data),n.setRef=n.setRef.bind(cf()(n)),n.clear=n.clear.bind(cf()(n)),n.handleKeyUp=n.handleKeyUp.bind(cf()(n)),n.handleChange=(i=n.handleChange.bind(cf()(n)),r="function"==typeof requestIdleCallback?requestIdleCallback:setTimeout,a=!1,function(){a||(a=!0,r((function(){a=!1,i()})))}),n}return uf()(t,e),v_()(t,[{key:"componentDidMount",value:function(){this.input&&this.input.value&&this.search(this.input.value)}},{key:"search",value:function(e){""==e?this.setState({icon:ff.search,isSearching:!1}):this.setState({icon:ff.delete,isSearching:!0}),this.props.onSearch(this.emojiIndex.search(e,{emojisToShowFilter:this.props.emojisToShowFilter,maxResults:this.props.maxResults,include:this.props.include,exclude:this.props.exclude,custom:this.props.custom}))}},{key:"clear",value:function(){""!=this.input.value&&(this.input.value="",this.input.focus(),this.search(""))}},{key:"handleChange",value:function(){this.input&&this.search(this.input.value)}},{key:"handleKeyUp",value:function(e){13===e.keyCode&&this.clear()}},{key:"setRef",value:function(e){this.input=e}},{key:"render",value:function(){var e=this.props,t=e.i18n,n=e.autoFocus,i=this.state,r=i.icon,a=i.isSearching,o=i.id,s="emoji-mart-search-".concat(o);return m.a.createElement("section",{className:"emoji-mart-search","aria-label":t.search},m.a.createElement("input",{id:s,ref:this.setRef,type:"search",onChange:this.handleChange,placeholder:t.search,autoFocus:n}),m.a.createElement("label",{className:"emoji-mart-sr-only",htmlFor:s},t.search),m.a.createElement("button",{className:"emoji-mart-search-icon",onClick:this.clear,onKeyUp:this.handleKeyUp,"aria-label":t.clear,disabled:!a},r()))}}]),t}(m.a.PureComponent);function jf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function qf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jf(Object(n),!0).forEach((function(t){ef()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Pf.propTypes={onSearch:$d.a.func,maxResults:$d.a.number,emojisToShowFilter:$d.a.func,autoFocus:$d.a.bool},Pf.defaultProps={onSearch:function(){},maxResults:75,emojisToShowFilter:null,autoFocus:!1};var Uf={search:"Search",clear:"Clear",notfound:"No Emoji Found",skintext:"Choose your default skin tone",categories:{search:"Search Results",recent:"Frequently Used",people:"Smileys & People",nature:"Animals & Nature",foods:"Food & Drink",activity:"Activity",places:"Travel & Places",objects:"Objects",symbols:"Symbols",flags:"Flags",custom:"Custom"},categorieslabel:"Emoji categories",skintones:{1:"Default Skin Tone",2:"Light Skin Tone",3:"Medium-Light Skin Tone",4:"Medium Skin Tone",5:"Medium-Dark Skin Tone",6:"Dark Skin Tone"}},zf=function(e){function t(e){var n;y_()(this,t),(n=af()(this,sf()(t).call(this,e))).CUSTOM=[],n.RECENT_CATEGORY={id:"recent",name:"Recent",emojis:null},n.SEARCH_CATEGORY={id:"search",name:"Search",emojis:null,anchor:!1},e.data.compressed&&S_(e.data),n.data=e.data,n.i18n=B_(Uf,e.i18n),n.icons=B_(i,e.icons),n.state={firstRender:!0},n.categories=[];var r=[].concat(n.data.categories);if(e.custom.length>0){var a={},o=0;e.custom.forEach((function(e){a[e.customCategory]||(a[e.customCategory]={id:e.customCategory?"custom-".concat(e.customCategory):"custom",name:e.customCategory||"Custom",emojis:[],anchor:0===o},o++);var t=a[e.customCategory],i=qf({},e,{id:e.short_names[0],custom:!0});t.emojis.push(i),n.CUSTOM.push(i)})),r=r.concat(Object.keys(a).map((function(e){return a[e]})))}n.hideRecent=!0,null!=e.include&&r.sort((function(t,n){return e.include.indexOf(t.id)>e.include.indexOf(n.id)?1:-1}));for(var s=0;s<r.length;s++){var l=r[s],u=!e.include||!e.include.length||e.include.indexOf(l.id)>-1,d=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(l.id)>-1;if(u&&!d)if(e.emojisToShowFilter){for(var c=[],_=l.emojis,f=0;f<_.length;f++){var g=_[f];e.emojisToShowFilter(n.data.emojis[g]||g)&&c.push(g)}if(c.length){var h={emojis:c,name:l.name,id:l.id};n.categories.push(h)}}else n.categories.push(l)}var p=!e.include||!e.include.length||e.include.indexOf(n.RECENT_CATEGORY.id)>-1,m=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(n.RECENT_CATEGORY.id)>-1;return p&&!m&&(n.hideRecent=!1,n.categories.unshift(n.RECENT_CATEGORY)),n.categories[0]&&(n.categories[0].first=!0),n.categories.unshift(n.SEARCH_CATEGORY),n.setAnchorsRef=n.setAnchorsRef.bind(cf()(n)),n.handleAnchorClick=n.handleAnchorClick.bind(cf()(n)),n.setSearchRef=n.setSearchRef.bind(cf()(n)),n.handleSearch=n.handleSearch.bind(cf()(n)),n.setScrollRef=n.setScrollRef.bind(cf()(n)),n.handleScroll=n.handleScroll.bind(cf()(n)),n.handleScrollPaint=n.handleScrollPaint.bind(cf()(n)),n.handleEmojiOver=n.handleEmojiOver.bind(cf()(n)),n.handleEmojiLeave=n.handleEmojiLeave.bind(cf()(n)),n.handleEmojiClick=n.handleEmojiClick.bind(cf()(n)),n.handleEmojiSelect=n.handleEmojiSelect.bind(cf()(n)),n.setPreviewRef=n.setPreviewRef.bind(cf()(n)),n.handleSkinChange=n.handleSkinChange.bind(cf()(n)),n.handleKeyDown=n.handleKeyDown.bind(cf()(n)),n.handleDarkMatchMediaChange=n.handleDarkMatchMediaChange.bind(cf()(n)),n}return uf()(t,e),v_()(t,[{key:"componentDidMount",value:function(){var e=this;this.state.firstRender&&(this.testStickyPosition(),this.firstRenderTimeout=setTimeout((function(){e.setState({firstRender:!1})}),60))}},{key:"componentDidUpdate",value:function(){this.updateCategoriesSize(),this.handleScroll()}},{key:"componentWillUnmount",value:function(){this.SEARCH_CATEGORY.emojis=null,clearTimeout(this.leaveTimeout),clearTimeout(this.firstRenderTimeout),this.darkMatchMedia&&this.darkMatchMedia.removeListener(this.handleDarkMatchMediaChange)}},{key:"testStickyPosition",value:function(){var e=document.createElement("div");["","-webkit-","-ms-","-moz-","-o-"].forEach((function(t){return e.style.position="".concat(t,"sticky")})),this.hasStickyPosition=!!e.style.position.length}},{key:"getPreferredTheme",value:function(){return"auto"!=this.props.theme?this.props.theme:this.state.theme?this.state.theme:"function"!=typeof matchMedia?Ff.theme:(this.darkMatchMedia||(this.darkMatchMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMatchMedia.addListener(this.handleDarkMatchMediaChange)),this.darkMatchMedia.media.match(/^not/)?Ff.theme:this.darkMatchMedia.matches?"dark":"light")}},{key:"handleDarkMatchMediaChange",value:function(){this.setState({theme:this.darkMatchMedia.matches?"dark":"light"})}},{key:"handleEmojiOver",value:function(e){var t=this.preview;if(t){var n=this.CUSTOM.filter((function(t){return t.id===e.id}))[0];for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i]);t.setState({emoji:e}),clearTimeout(this.leaveTimeout)}}},{key:"handleEmojiLeave",value:function(e){var t=this.preview;t&&(this.leaveTimeout=setTimeout((function(){t.setState({emoji:null})}),16))}},{key:"handleEmojiClick",value:function(e,t){this.props.onClick(e,t),this.handleEmojiSelect(e)}},{key:"handleEmojiSelect",value:function(e){var t=this;this.props.onSelect(e),this.hideRecent||this.props.recent||X_.add(e);var n=this.categoryRefs["category-1"];if(n){var i=n.maxMargin;this.props.enableFrequentEmojiSort&&n.forceUpdate(),requestAnimationFrame((function(){t.scroll&&(n.memoizeSize(),i!=n.maxMargin&&(t.updateCategoriesSize(),t.handleScrollPaint(),t.SEARCH_CATEGORY.emojis&&n.updateDisplay("none")))}))}}},{key:"handleScroll",value:function(){this.waitingForPaint||(this.waitingForPaint=!0,requestAnimationFrame(this.handleScrollPaint))}},{key:"handleScrollPaint",value:function(){if(this.waitingForPaint=!1,this.scroll){var e=null;if(this.SEARCH_CATEGORY.emojis)e=this.SEARCH_CATEGORY;else{for(var t=this.scroll.scrollTop,n=t>(this.scrollTop||0),i=0,r=0,a=this.categories.length;r<a;r++){var o=n?this.categories.length-1-r:r,s=this.categories[o],l=this.categoryRefs["category-".concat(o)];if(l){var u=l.handleScroll(t);(!i||l.top<i)&&l.top>0&&(i=l.top),u&&!e&&(e=s)}}t<i?e=this.categories.filter((function(e){return!(!1===e.anchor)}))[0]:t+this.clientHeight>=this.scrollHeight&&(e=this.categories[this.categories.length-1])}if(e){var d=this.anchors,c=e.name;d.state.selected!=c&&d.setState({selected:c})}this.scrollTop=t}}},{key:"handleSearch",value:function(e){this.SEARCH_CATEGORY.emojis=e;for(var t=0,n=this.categories.length;t<n;t++){var i=this.categoryRefs["category-".concat(t)];if(i&&"Search"!=i.props.name){var r=e?"none":"inherit";i.updateDisplay(r)}}this.forceUpdate(),this.scroll&&(this.scroll.scrollTop=0),this.handleScroll()}},{key:"handleAnchorClick",value:function(e,t){var n,i=this.categoryRefs["category-".concat(t)],r=this.scroll;this.anchors;n=function(){if(i){var t=i.top;e.first?t=0:t+=1,r.scrollTop=t}},this.SEARCH_CATEGORY.emojis?(this.handleSearch(null),this.search.clear(),requestAnimationFrame(n)):n()}},{key:"handleSkinChange",value:function(e){var t={skin:e},n=this.props.onSkinChange;this.setState(t),H_.update(t),n(e)}},{key:"handleKeyDown",value:function(e){var t=!1;switch(e.keyCode){case 13:var n;this.SEARCH_CATEGORY.emojis&&this.SEARCH_CATEGORY.emojis.length&&(n=M_(this.SEARCH_CATEGORY.emojis[0],this.state.skin,this.props.set,this.props.data))&&(this.handleEmojiSelect(n),t=!0)}t&&e.preventDefault()}},{key:"updateCategoriesSize",value:function(){for(var e=0,t=this.categories.length;e<t;e++){var n=this.categoryRefs["category-".concat(e)];n&&n.memoizeSize()}if(this.scroll){var i=this.scroll;this.scrollHeight=i.scrollHeight,this.clientHeight=i.clientHeight}}},{key:"getCategories",value:function(){return this.state.firstRender?this.categories.slice(0,3):this.categories}},{key:"setAnchorsRef",value:function(e){this.anchors=e}},{key:"setSearchRef",value:function(e){this.search=e}},{key:"setPreviewRef",value:function(e){this.preview=e}},{key:"setScrollRef",value:function(e){this.scroll=e}},{key:"setCategoryRef",value:function(e,t){this.categoryRefs||(this.categoryRefs={}),this.categoryRefs[e]=t}},{key:"render",value:function(){var e=this,t=this.props,n=t.perLine,i=t.emojiSize,r=t.set,a=t.sheetSize,o=t.sheetColumns,s=t.sheetRows,l=t.style,u=t.title,d=t.emoji,c=t.color,_=t.native,f=t.backgroundImageFn,g=t.emojisToShowFilter,h=t.showPreview,p=t.showSkinTones,F=t.emojiTooltip,b=t.useButton,y=t.include,E=t.exclude,v=t.recent,k=t.autoFocus,D=t.skinEmoji,C=t.notFound,w=t.notFoundEmoji,S=n*(i+12)+12+2+function(){if("undefined"==typeof document)return 0;var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.overflow="scroll",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}(),O=this.getPreferredTheme(),x=this.props.skin||this.state.skin||H_.get("skin")||this.props.defaultSkin;return m.a.createElement("section",{style:qf({width:S},l),className:"emoji-mart emoji-mart-".concat(O),"aria-label":u,onKeyDown:this.handleKeyDown},m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(pf,{ref:this.setAnchorsRef,data:this.data,i18n:this.i18n,color:c,categories:this.categories,onAnchorClick:this.handleAnchorClick,icons:this.icons})),m.a.createElement(Pf,{ref:this.setSearchRef,onSearch:this.handleSearch,data:this.data,i18n:this.i18n,emojisToShowFilter:g,include:y,exclude:E,custom:this.CUSTOM,autoFocus:k}),m.a.createElement("div",{ref:this.setScrollRef,className:"emoji-mart-scroll",onScroll:this.handleScroll},this.getCategories().map((function(t,l){return m.a.createElement(Tf,{ref:e.setCategoryRef.bind(e,"category-".concat(l)),key:t.name,id:t.id,name:t.name,emojis:t.emojis,perLine:n,native:_,hasStickyPosition:e.hasStickyPosition,data:e.data,i18n:e.i18n,recent:t.id==e.RECENT_CATEGORY.id?v:void 0,custom:t.id==e.RECENT_CATEGORY.id?e.CUSTOM:void 0,emojiProps:{native:_,skin:x,size:i,set:r,sheetSize:a,sheetColumns:o,sheetRows:s,forceSize:_,tooltip:F,backgroundImageFn:f,useButton:b,onOver:e.handleEmojiOver,onLeave:e.handleEmojiLeave,onClick:e.handleEmojiClick},notFound:C,notFoundEmoji:w})}))),(h||p)&&m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(Lf,{ref:this.setPreviewRef,data:this.data,title:u,emoji:d,showSkinTones:p,showPreview:h,emojiProps:{native:_,size:38,skin:x,set:r,sheetSize:a,sheetColumns:o,sheetRows:s,backgroundImageFn:f},skinsProps:{skin:x,onChange:this.handleSkinChange,skinEmoji:D},i18n:this.i18n})))}}]),t}(m.a.PureComponent);function Hf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}zf.propTypes=qf({},hf,{data:$d.a.object.isRequired}),zf.defaultProps=qf({},Ff);var Wf=function(e){function t(){return y_()(this,t),af()(this,sf()(t).apply(this,arguments))}return uf()(t,e),v_()(t,[{key:"render",value:function(){return m.a.createElement(zf,nf()({},this.props,this.state))}}]),t}(m.a.PureComponent);function Gf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Yf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gf(Object(n),!0).forEach((function(t){ef()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Wf.propTypes=hf,Wf.defaultProps=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hf(Object(n),!0).forEach((function(t){ef()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},Ff,{data:F_});var Vf=function e(t){for(var n in e.defaultProps)null==t[n]&&null!=e.defaultProps[n]&&(t[n]=e.defaultProps[n]);return wf(Yf({},t))};Vf.propTypes=gf,Vf.defaultProps=Yf({},mf,{data:F_});var $f=n(50),Kf={insert:"head",singleton:!1},Qf=(a()($f.a,Kf),$f.a.locals,n(90));function Zf(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,i=m_()(e);if(t){var r=m_()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return h_()(this,n)}}var Xf=function(e){f_()(n,e);var t=Zf(n);function n(){var e;s_()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),c()(c_()(e),"onKeyDown",(function(t){return"Escape"===t.event.key&&(e.props.editor.chain().focus().deleteRange(e.props.range).run(),!0)})),c()(c_()(e),"handleSelect",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(t).run()})),e}return u_()(n,[{key:"render",value:function(){return m.a.createElement(zf,{style:{maxWidth:"100%"},data:Qf,theme:"light",native:!0,set:"apple",showPreview:!1,showSkinTones:!1,onSelect:this.handleSelect,"data-cy":"neeto-editor-emoji-picker"})}}]),n}(m.a.Component);Xf.defaultProps={editor:{},range:{}},Xf.propTypes={editor:$d.a.object.isRequired,range:$d.a.object};var Jf=Xf,eg=function(e){var t=e.editor,n=Object(p.useRef)();return m.a.createElement(jc,{ref:n,closeOnSelect:!1,customTarget:function(){var e;return m.a.createElement(Zd,{icon:Uu.Smiley,iconActive:null==n||null===(e=n.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Emoji",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-emoji-option-button"})},position:"bottom-start"},m.a.createElement(Jf,{editor:t}))},tg=function(e){var t=e.editor,n=e.variables,i=e.setImageUploadVisible,r=e.options,a=e.mentions,o=e.showImageInMention;if(!t)return null;var s=[{Icon:Uu.TextBold,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:Uu.TextItalic,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:Uu.Underline,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline"},{Icon:Uu.TextCross,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:Uu.Highlight,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}].filter((function(e){return r.includes(e.optionName)})),l=[{Icon:Uu.Quote,command:function(){return t.chain().focus().toggleBlockquote().run()},active:t.isActive("blockquote"),optionName:"block-quote"},{Icon:Uu.Code,command:function(){return t.chain().focus().toggleCodeBlock().run()},active:t.isActive("codeBlock"),optionName:"code-block"},{Icon:Uu.Image,command:function(){return i(!0)},active:t.isActive("imageUpload"),optionName:"image-upload"}].filter((function(e){return r.includes(e.optionName)})),u=[{Icon:Uu.ListDot,command:function(){return t.chain().focus().toggleBulletList().run()},active:t.isActive("bulletList"),optionName:"bullet-list"},{Icon:Uu.ListNumber,command:function(){return t.chain().focus().toggleOrderedList().run()},active:t.isActive("orderedList"),optionName:"ordered-list"}].filter((function(e){return r.includes(e.optionName)})),d=r.includes("font-color"),c=r.includes("font-size"),_=r.includes("emoji"),f=r.includes("link"),g=function(e,t){var n=e.Icon,i=e.command,r=e.active,a=e.optionName;return m.a.createElement(Zd,{key:t,icon:n,iconActive:r,onClick:i,tooltipProps:{content:ju(a),position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-".concat(a,"-option")})};return m.a.createElement("div",{className:"neeto-editor-fixed-menu"},c&&m.a.createElement(qc,{editor:t}),s.map(g),d&&m.a.createElement(nc,{color:t.getAttributes("textStyle").color,onChange:function(e){return t.chain().focus().setColor(e).run()}}),_&&m.a.createElement(eg,{editor:t}),f&&m.a.createElement(a_,{editor:t}),l.map(g),u.map(g),m.a.createElement("div",{className:"neeto-editor-fixed-menu-addons"},m.a.createElement(Yc,{editor:t,variables:n}),m.a.createElement(Xc,{editor:t,mentions:a,showImageInMention:o})))},ng=function(e){var t=e.children,n=e.className,i=void 0===n?"root-portal":n,r=e.el,a=void 0===r?"div":r,o=document.getElementsByClassName(i)[0];return o||(o=document.createElement(a)).classList.add(i),m.a.useEffect((function(){document.body.appendChild(o)}),[]),Cu.a.createPortal(t,o)},ig=["children","className"],rg=function(e){var t=e.children,n=e.className,i=h()(e,ig);return m.a.createElement("div",u()({className:b()("ne-backdrop",c()({},n,n))},i),t)},ag=["size","isOpen","onClose","loading","children","className","closeOnEsc","closeButton","backdropClassName","closeOnOutsideClick"],og=function(){},sg="xs",lg="sm",ug="md",dg=function(e){var t=e.size,n=void 0===t?"sm":t,i=e.isOpen,r=void 0!==i&&i,a=e.onClose,o=void 0===a?og:a,s=e.loading,l=void 0!==s&&s,d=e.children,_=e.className,f=void 0===_?"":_,g=e.closeOnEsc,F=void 0===g||g,y=e.closeButton,E=void 0===y||y,v=e.backdropClassName,k=void 0===v?"":v,D=e.closeOnOutsideClick,C=void 0===D||D,w=h()(e,ag),S=Object(p.useRef)();return C&&Rc(S,o),F&&Mc("esc",o),m.a.createElement(ng,{className:"ne-portal"},r&&m.a.createElement(rg,{key:"modal-backdrop",className:b()("ne-modal__backdrop",k)},m.a.createElement("div",u()({ref:S,key:"modal-wrapper",className:b()("ne-modal__wrapper",c()({"ne-modal__wrapper--xs":n===sg,"ne-modal__wrapper--sm":n===lg,"ne-modal__wrapper--md":n===ug},f,f))},w),E&&m.a.createElement(qd,{style:"text",icon:Uu.Close,className:"ne-modal__close",onClick:o}),l?m.a.createElement(m.a.Fragment,null):d)))},cg=["children","size","noUnderline","className"],_g=["active","className","children","icon","onClick","activeClassName"],fg=function(){},gg="large",hg=function(e){var t=e.children,n=e.size,i=e.noUnderline,r=e.className,a=void 0===r?"":r,o=h()(e,cg);return m.a.createElement("div",u()({className:b()({"ne-tab__wrapper":!0},{"ne-tab__wrapper--size-large":n===gg},{"ne-tab__wrapper--underline-none":i},[a]),"data-cy":"tab-container"},o),t)};hg.Item=function(e){var t=e.active,n=e.className,i=void 0===n?"":n,r=e.children,a=e.icon,o=void 0===a?null:a,s=e.onClick,l=void 0===s?fg:s,d=e.activeClassName,c=void 0===d?"":d,_=h()(e,_g),f="button",g="string"==typeof o?function(){return m.a.createElement("i",{className:o,"data-cy":"tab-item-icon"})}:o||m.a.Fragment;return c&&(f=xd),m.a.createElement(f,u()({className:b()(["ne-tab flex items-center justify-center select-none",i],{active:t}),onClick:l,"data-cy":"tab-item"},_),o&&m.a.createElement(g,{className:"ne-tab__icon"}),r)};var pg=hg,mg=function(e){var t,n=Object(p.useState)(null===(t=e[0])||void 0===t?void 0:t.key),i=f()(n,2),r=i[0],a=i[1];return[r,function(e){return a(e.key)}]},Fg=function(e){var t=e.buttonLabel,n=void 0===t?"Submit":t,i=e.placeholder,r=e.onSubmit,a=e.className,o=Object(p.useState)(""),s=f()(o,2),l=s[0],u=s[1],d=Object(p.useState)(""),_=f()(d,2),g=_[0],h=_[1];return m.a.createElement("div",{className:b()("neeto-editor-url-form__wrapper",c()({},a,a))},m.a.createElement(r_,{name:"url",value:l,placeholder:i,onFocus:function(){return h("")},error:g,onChange:function(e){var t=e.target.value;return u(t)},"data-cy":"neeto-editor-image-upload-url-input"}),m.a.createElement(qd,{size:"large",label:n,onClick:function(e){e.preventDefault(),Ud.test(l)?r(l):h("Please enter a valid url")},"data-cy":"neeto-editor-image-upload-url-submit"}))},bg=n(20),yg=n.n(bg),Eg=(n(62),n(74),n(75)),vg=n.n(Eg),kg=(n(76),n(77),n(78),n(79)),Dg=n.n(kg),Cg=n(91),wg=n.n(Cg),Sg=function(e){var t,n=e.uppy,i=Object(p.useState)(0),r=f()(i,2),a=r[0],o=r[1];Object(p.useEffect)((function(){n.on("progress",o)}),[n]);var s="".concat(a,"%");return m.a.createElement("div",{className:"neeto-editor-image-uploader__progress"},m.a.createElement("p",{className:"neeto-editor-image-uploader__progress-title"},"Uploading..."),m.a.createElement("p",{className:"neeto-editor-image-uploader__progress-file"},null===(t=n.getFiles()[0])||void 0===t?void 0:t.name),m.a.createElement("div",{className:"neeto-editor-progress-bar__wrapper","data-cy":"neeto-editor-image-upload-progress-bar"},m.a.createElement("div",{className:"neeto-editor-progress-bar__percent"},m.a.createElement("p",null,s),m.a.createElement(qd,{icon:Uu.Close,onClick:function(){return n.cancelAll()},size:"small",style:"text"})),m.a.createElement("div",{className:"neeto-editor-progress-bar__indicator"},m.a.createElement("div",{style:{width:s},className:"neeto-editor-progress-bar__indicator-inner"}))))};function Og(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var xg={allowMultipleUploads:!1,autoProceed:!0,debug:!0},Tg={formData:!0,fieldName:"blob"},Ng=function(e){var t=e.endpoint,n=void 0===t?"/api/v1/direct_uploads/image_upload":t,i=e.onSuccess,r=Object(p.useState)(!1),a=f()(r,2),o=a[0],s=a[1],l=Dg()((function(){return new yg.a(xg).use(wg.a,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Og(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Og(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({endpoint:n},Tg)).on("upload",(function(){return s(!0)})).on("upload-success",(function(e,t){return i(t.body.imageURL)})).on("cancel-all",(function(){return s(!1)})).on("complete",(function(){return s(!1)}))}));return o?m.a.createElement(Sg,{uppy:l}):m.a.createElement(vg.a,{className:"neeto-editor-image-uploader__dnd",note:"Max. File Size: 5MB",locale:{strings:{dropHereOr:"Drop your file(s) here or %{browse}",browse:"Browse"}},uppy:l,"data-cy":"neeto-editor-image-local-uploader"})},Ag=n(51),Mg=n.n(Ag),Rg=n(92),Ig=n.n(Rg),Lg=n(52),Bg=n.n(Lg),Pg=n(93),jg=n.n(Pg),qg=n(94),Ug=n.n(qg),zg=function(e){var t=e.pageNo,n=e.query,i=e.apiKey;return Ug.a.get("https://api.unsplash.com/search/photos",{headers:{Authorization:"Client-ID ".concat(i)},params:{page:t,per_page:30,order_by:"popular",query:n}})},Hg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:800,n=Object(p.useState)(e),i=f()(n,2),r=i[0],a=i[1];return Object(p.useEffect)((function(){var n=setTimeout((function(){a(e)}),t);return function(){clearTimeout(n)}}),[e]),r},Wg=function(){return m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__loader"},m.a.createElement("span",{className:"neeto-editor-unsplash-gallery__spinner-icon"}))},Gg=function(e){var t=e.onSubmit,n=e.unsplashApiKey,i=Object(p.useRef)(null),r=Object(p.useState)(""),a=f()(r,2),o=a[0],s=a[1],l=Object(p.useState)(!1),u=f()(l,2),d=u[0],c=u[1],_=Object(p.useState)([]),g=f()(_,2),h=g[0],F=g[1],b=Object(p.useState)(1),y=f()(b,2),E=y[0],v=y[1],k=Object(p.useState)(!0),D=f()(k,2),C=D[0],w=D[1],S=Object(p.useState)(!1),O=f()(S,2),x=O[0],T=O[1],N=Hg(o||"latest");Object(p.useEffect)((function(){A(1)}),[N]);var A=function(){var e=Ig()(Bg.a.mark((function e(t){var i,r,a,o;return Bg.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,T(!0),c(!1),e.next=5,zg({page:t,query:N,apiKey:n});case 5:i=e.sent,r=i.data,a=r.results,o=r.total_pages,F(1===t?a:[].concat(Mg()(h),Mg()(a))),v(t+1),w(t<o),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),c(!0);case 15:return e.prev=15,T(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[0,12,15,18]])})));return function(t){return e.apply(this,arguments)}}();return m.a.createElement("div",{className:"neeto-editor-unsplash-wrapper"},m.a.createElement(r_,{name:"text",value:o,placeholder:"Search Unsplash",onChange:function(e){var t=e.target.value;s(t)},"data-cy":"neeto-editor-unsplash-image-picker-search-input"}),d&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-error"},"Something went wrong! Please try again later."),!d&&!x&&od()(h)&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-no-results-error"},"No results"),!d&&m.a.createElement("div",{className:"neeto-editor-unsplash-container"},m.a.createElement(jg.a,{ref:i,pack:!0,style:{width:"100%"},sizes:[{columns:3,gutter:0},{mq:"768px",columns:3,gutter:0},{mq:"1024px",columns:3,gutter:0}],hasMore:C,loadMore:function(){!x&&C&&E>1&&A(E)},position:!0,useWindow:!1,className:"neeto-editor-unsplash-gallery",loader:m.a.createElement(Wg,{key:0})},h&&h.map((function(e,n){return m.a.createElement("div",{key:n,className:"neeto-editor-unsplash-gallery__item","data-cy":"neeto-editor-unsplash-image-picker-result-".concat(n)},m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__item-placeholder",style:{paddingBottom:"".concat(e.height/e.width*100,"%")}},m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__item-inner",id:"unsplashImage".concat(n)},m.a.createElement("img",{src:e.urls.regular,onClick:function(){return t(e.urls.small)}}),m.a.createElement("a",{href:"https://unsplash.com/@".concat(e.user.username),target:"_blank",rel:"noreferrer"},e.user.name," "))))}))),!C&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text"},"End of results")))},Yg=[{title:"Upload",key:"local"},{title:"Link",key:"link"},{title:"Unsplash",key:"unsplash"}],Vg=function(e){var t=e.editor,n=e.imageUploadUrl,i=e.isVisible,r=e.setIsVisible,a=e.unsplashApiKey,o=e.isUnsplashImageUploadActive,s=mg(Yg),l=f()(s,2),u=l[0],d=l[1],c=function(e){t.chain().focus().setImage({src:e}).run(),r(!1)},_={local:function(){return m.a.createElement(Ng,{enpoint:n,onSuccess:c})},link:function(){return m.a.createElement(Fg,{onSubmit:c,buttonLabel:"Upload Image",placeholder:"Paste the image link"})},unsplash:function(){return m.a.createElement(Gg,{unsplashApiKey:a,onSubmit:c})}}[u];return m.a.createElement(dg,{isOpen:i,onClose:function(){return r(!1)},closeButton:!1},m.a.createElement("div",{className:"neeto-editor-image-uploader"},m.a.createElement(pg,null,Yg.filter((function(e){return"unsplash"!==e.key||o})).map((function(e){return m.a.createElement(pg.Item,{key:e.key,active:u===e.key,onClick:function(){return d(e)}},e.title)}))),m.a.createElement("div",{className:"neeto-editor-image-uploader__content"},m.a.createElement(_,null))))},$g=n(39),Kg=n.n($g),Qg=n(95);function Zg(e,t){return Array(t+1).join(e)}var Xg=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function Jg(e){return ih(e,Xg)}var eh=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function th(e){return ih(e,eh)}var nh=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function ih(e,t){return t.indexOf(e.nodeName)>=0}function rh(e,t){return e.getElementsByTagName&&t.some((function(t){return e.getElementsByTagName(t).length}))}var ah={};function oh(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function sh(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function lh(e,t,n){for(var i=0;i<e.length;i++){var r=e[i];if(uh(r,t,n))return r}}function uh(e,t,n){var i=e.filter;if("string"==typeof i){if(i===t.nodeName.toLowerCase())return!0}else if(Array.isArray(i)){if(i.indexOf(t.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof i)throw new TypeError("`filter` needs to be a string, array, or function");if(i.call(e,t,n))return!0}}function dh(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function ch(e,t,n){return e&&e.parentNode===t||n(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}ah.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},ah.lineBreak={filter:"br",replacement:function(e,t,n){return n.br+"\n"}},ah.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,n){var i=Number(t.nodeName.charAt(1));return"setext"===n.headingStyle&&i<3?"\n\n"+e+"\n"+Zg(1===i?"=":"-",e.length)+"\n\n":"\n\n"+Zg("#",i)+" "+e+"\n\n"}},ah.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},ah.list={filter:["ul","ol"],replacement:function(e,t){var n=t.parentNode;return"LI"===n.nodeName&&n.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},ah.listItem={filter:"li",replacement:function(e,t,n){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var i=n.bulletListMarker+" ",r=t.parentNode;if("OL"===r.nodeName){var a=r.getAttribute("start"),o=Array.prototype.indexOf.call(r.children,t);i=(a?Number(a)+o:o+1)+". "}return i+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},ah.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},ah.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){for(var i,r=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],a=t.firstChild.textContent,o=n.fence.charAt(0),s=3,l=new RegExp("^"+o+"{3,}","gm");i=l.exec(a);)i[0].length>=s&&(s=i[0].length+1);var u=Zg(o,s);return"\n\n"+u+r+"\n"+a.replace(/\n$/,"")+"\n"+u+"\n\n"}},ah.horizontalRule={filter:"hr",replacement:function(e,t,n){return"\n\n"+n.hr+"\n\n"}},ah.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var n=t.getAttribute("href"),i=oh(t.getAttribute("title"));return i&&(i=' "'+i+'"'),"["+e+"]("+n+i+")"}},ah.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,n){var i,r,a=t.getAttribute("href"),o=oh(t.getAttribute("title"));switch(o&&(o=' "'+o+'"'),n.linkReferenceStyle){case"collapsed":i="["+e+"][]",r="["+e+"]: "+a+o;break;case"shortcut":i="["+e+"]",r="["+e+"]: "+a+o;break;default:var s=this.references.length+1;i="["+e+"]["+s+"]",r="["+s+"]: "+a+o}return this.references.push(r),i},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},ah.emphasis={filter:["em","i"],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:""}},ah.strong={filter:["strong","b"],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:""}},ah.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!n},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",n="`",i=e.match(/`+/gm)||[];-1!==i.indexOf(n);)n+="`";return n+t+e+t+n}},ah.image={filter:"img",replacement:function(e,t){var n=oh(t.getAttribute("alt")),i=t.getAttribute("src")||"",r=oh(t.getAttribute("title"));return i?"!["+n+"]("+i+(r?' "'+r+'"':"")+")":""}},sh.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){return e.isBlank?this.blankRule:(t=lh(this.array,e,this.options))||(t=lh(this._keep,e,this.options))||(t=lh(this._remove,e,this.options))?t:this.defaultRule;var t},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};var _h="undefined"!=typeof window?window:{};var fh,gh,hh=function(){var e=_h.DOMParser,t=!1;try{(new e).parseFromString("","text/html")&&(t=!0)}catch(e){}return t}()?_h.DOMParser:(fh=function(){},function(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch(t){window.ActiveXObject&&(e=!0)}return e}()?fh.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t}:fh.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t},fh);function ph(e,t){var n;"string"==typeof e?n=(gh=gh||new hh).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):n=e.cloneNode(!0);return function(e){var t=e.element,n=e.isBlock,i=e.isVoid,r=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!r(t)){for(var a=null,o=!1,s=null,l=ch(s,t,r);l!==t;){if(3===l.nodeType||4===l.nodeType){var u=l.data.replace(/[ \r\n\t]+/g," ");if(a&&!/ $/.test(a.data)||o||" "!==u[0]||(u=u.substr(1)),!u){l=dh(l);continue}l.data=u,a=l}else{if(1!==l.nodeType){l=dh(l);continue}n(l)||"BR"===l.nodeName?(a&&(a.data=a.data.replace(/ $/,"")),a=null,o=!1):i(l)||r(l)?(a=null,o=!0):a&&(o=!1)}var d=ch(s,l,r);s=l,l=d}a&&(a.data=a.data.replace(/ $/,""),a.data||dh(a))}}({element:n,isBlock:Jg,isVoid:th,isPre:t.preformattedCode?mh:null}),n}function mh(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function Fh(e,t){return e.isBlock=Jg(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=function(e){return!th(e)&&!function(e){return ih(e,nh)}(e)&&/^\s*$/i.test(e.textContent)&&!function(e){return rh(e,eh)}(e)&&!function(e){return rh(e,nh)}(e)}(e),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var n=(i=e.textContent,r=i.match(/^(([ \t\r\n]*)(\s*))[\s\S]*?((\s*?)([ \t\r\n]*))$/),{leading:r[1],leadingAscii:r[2],leadingNonAscii:r[3],trailing:r[4],trailingNonAscii:r[5],trailingAscii:r[6]});var i,r;n.leadingAscii&&bh("left",e,t)&&(n.leading=n.leadingNonAscii);n.trailingAscii&&bh("right",e,t)&&(n.trailing=n.trailingNonAscii);return{leading:n.leading,trailing:n.trailing}}(e,t),e}function bh(e,t,n){var i,r,a;return"left"===e?(i=t.previousSibling,r=/ $/):(i=t.nextSibling,r=/^ /),i&&(3===i.nodeType?a=r.test(i.nodeValue):n.preformattedCode&&"CODE"===i.nodeName?a=!1:1!==i.nodeType||Jg(i)||(a=r.test(i.textContent))),a}var yh=Array.prototype.reduce,Eh=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function vh(e){if(!(this instanceof vh))return new vh(e);var t={rules:ah,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])}return e}({},t,e),this.rules=new sh(this.options)}function kh(e){var t=this;return yh.call(e.childNodes,(function(e,n){var i="";return 3===(n=new Fh(n,t.options)).nodeType?i=n.isCode?n.nodeValue:t.escape(n.nodeValue):1===n.nodeType&&(i=Ch.call(t,n)),wh(e,i)}),"")}function Dh(e){var t=this;return this.rules.forEach((function(n){"function"==typeof n.append&&(e=wh(e,n.append(t.options)))})),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function Ch(e){var t=this.rules.forNode(e),n=kh.call(this,e),i=e.flankingWhitespace;return(i.leading||i.trailing)&&(n=n.trim()),i.leading+t.replacement(n,e,this.options)+i.trailing}function wh(e,t){var n=function(e){for(var t=e.length;t>0&&"\n"===e[t-1];)t--;return e.substring(0,t)}(e),i=t.replace(/^\n*/,""),r=Math.max(e.length-n.length,t.length-i.length);return n+"\n\n".substring(0,r)+i}vh.prototype={turndown:function(e){if(!function(e){return null!=e&&("string"==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(""===e)return"";var t=kh.call(this,new ph(e,this.options));return Dh.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else{if("function"!=typeof e)throw new TypeError("plugin must be a Function or an Array of Functions");e(this)}return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return Eh.reduce((function(e,t){return e.replace(t[0],t[1])}),e)}};var Sh=vh,Oh=function(e){e=e.replaceAll(/^\\$/gm,"<p></p>");var t=Qg.marked.parse(e);return t=(t=(t=(t=t.replaceAll(/<p><img[^>]*><\/p>/g,(function(e){return e.replace(/<\/?p>/g,"")}))).replaceAll(/!\[(.*?)\]\((.*?)\)/g,(function(e,t,n){return'<img src="'.concat(n,'" alt="').concat(t,'">')}))).replaceAll(/==([^=]+)==/g,"<mark>$1</mark>")).replaceAll(/--([^-]+)--/g,"<u>$1</u>"),Kg.a.sanitize(t)},xh=["editor","className","style","strategy","onChange","onSubmit","value"],Th=function(e){var t=e.editor,n=e.className,i=e.style,r=e.strategy,a=e.onChange,o=e.onSubmit,s=e.value,l=h()(e,xh),d=Object(p.useState)((function(){return e=(null==t?void 0:t.getHTML())||s,(n=new Sh({headingStyle:"atx",codeBlockStyle:"fenced",blankReplacement:function(e,t){return t.isBlock?"\\\n":""}})).addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~".concat(e,"~")}}),n.addRule("highlight",{filter:["mark"],replacement:function(e){return"==".concat(e,"==")}}),n.addRule("underline",{filter:["u"],replacement:function(e){return"--".concat(e,"--")}}),n.turndown(e);var e,n})),_=f()(d,2),g=_[0],F=_[1],y=Object(p.useRef)(),E=Object(p.useRef)(g);Object(p.useEffect)((function(){E.current=g}),[g]),Object(p.useEffect)((function(){return document.addEventListener("keydown",v),function(){null==t||t.commands.setContent(Oh(E.current)),document.removeEventListener("keydown",v)}}),[]),Object(p.useLayoutEffect)((function(){y.current.style=i,"flexible"===r&&(y.current.style.height=y.current.scrollHeight+2+"px")}),[g]);var v=function(e){"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(null==o||o(Oh(E.current)),y.current.blur())};return m.a.createElement("textarea",u()({ref:y,value:g,onChange:function(e){F(e.target.value),null==a||a(Oh(e.target.value))},className:b()("ProseMirror neeto-editor-markdown",c()({},n,n)),"data-cy":"neeto-editor-markdown-editor"},l))};const Nh=/^\s*>\s$/,Ah=_s.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block*",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",rs(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[bs({find:Nh,type:this.type})]}}),Mh=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Rh=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Ih=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Lh=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Bh=fs.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",rs(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[ps({find:Mh,type:this.type}),ps({find:Ih,type:this.type})]},addPasteRules(){return[ys({find:Rh,type:this.type}),ys({find:Lh,type:this.type})]}}),Ph=/^\s*([-+*])\s$/,jh=_s.create({name:"bulletList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",rs(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleBulletList:()=>({commands:e})=>e.toggleList("bulletList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[bs({find:Ph,type:this.type})]}}),qh=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,Uh=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,zh=fs.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",rs(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[ps({find:qh,type:this.type})]},addPasteRules(){return[ys({find:Uh,type:this.type})]}}),Hh=/^```(?<language>[a-z]*)?[\s\n]$/,Wh=/^~~~(?<language>[a-z]*)?[\s\n]$/,Gh=_s.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,i=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return i||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[ms({find:Hh,type:this.type,getAttributes:({groups:e})=>e}),ms({find:Wh,type:this.type,getAttributes:({groups:e})=>e})]},addProseMirrorPlugins(){return[new Mt({key:new Lt("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"),i=t.clipboardData.getData("vscode-editor-data"),r=i?JSON.parse(i):void 0,a=null==r?void 0:r.mode;if(!n||!a)return!1;const{tr:o}=e.state;return o.replaceSelectionWith(this.type.create({language:a})),o.setSelection(mt.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.insertText(n.replace(/\r\n?/g,"\n")),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}});var Yh=_s.create({name:"doc",topNode:!0,content:"block+"});var Vh=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 i=function(e){return n[t](e)};return e.dom.addEventListener(t,i),{name:t,handler:i}}))};Vh.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var n=t.name,i=t.handler;return e.editorView.dom.removeEventListener(n,i)}))},Vh.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())},Vh.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},Vh.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,i=t.nodeAfter;if(n||i){var r=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),a=n?r.bottom:r.top;n&&i&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:r.left,right:r.right,top:a-this.width/2,bottom:a+this.width/2}}}if(!e){var o=this.editorView.coordsAtPos(this.cursorPos);e={left:o.left-this.width/2,right:o.left+this.width/2,top:o.top,bottom:o.bottom}}var s,l,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!u||u==document.body&&"static"==getComputedStyle(u).position)s=-pageXOffset,l=-pageYOffset;else{var d=u.getBoundingClientRect();s=d.left-u.scrollLeft,l=d.top-u.scrollTop}this.element.style.left=e.left-s+"px",this.element.style.top=e.top-l+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"},Vh.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},Vh.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=Je(this.editorView.state.doc,n,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(n),this.scheduleRemoval(5e3)}}},Vh.prototype.dragend=function(){this.scheduleRemoval(20)},Vh.prototype.drop=function(){this.scheduleRemoval(20)},Vh.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};const $h=ma.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:null}),addProseMirrorPlugins(){return[(e=this.options,void 0===e&&(e={}),new Mt({view:function(t){return new Vh(t,e)}}))];var e}});var Kh=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,i){var r=n.resolve(i.map(this.head));return t.valid(r)?new t(r):e.near(r)},t.prototype.content=function(){return x.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 Qh(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 i=e.node(t).child(n-1);;i=i.lastChild){if(0==i.childCount&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var n=e.indexAfter(t),i=e.node(t);if(n!=i.childCount)for(var r=i.child(n);;r=r.firstChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}(e))return!1;var n=t.type.spec.allowGapCursor;if(null!=n)return n;var i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock},t.findFrom=function(e,n,i){e:for(;;){if(!i&&t.valid(e))return e;for(var r=e.pos,a=null,o=e.depth;;o--){var s=e.node(o);if(n>0?e.indexAfter(o)<s.childCount:e.index(o)>0){a=s.child(n>0?e.indexAfter(o):e.index(o)-1);break}if(0==o)return null;r+=n;var l=e.doc.resolve(r);if(t.valid(l))return l}for(;;){var u=n>0?a.firstChild:a.lastChild;if(!u){if(a.isAtom&&!a.isText&&!bt.isSelectable(a)){e=e.doc.resolve(r+a.nodeSize*n),i=!1;continue e}break}a=u,r+=n;var d=e.doc.resolve(r);if(t.valid(d))return d}return null}},t}(gt);Kh.prototype.visible=!1,gt.jsonID("gapcursor",Kh);var Qh=function(e){this.pos=e};Qh.prototype.map=function(e){return new Qh(e.map(this.pos))},Qh.prototype.resolve=function(e){var t=e.resolve(this.pos);return Kh.valid(t)?new Kh(t):gt.near(t)};var Zh=ca({ArrowLeft:Xh("horiz",-1),ArrowRight:Xh("horiz",1),ArrowUp:Xh("vert",-1),ArrowDown:Xh("vert",1)});function Xh(e,t){var n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,i,r){var a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof mt){if(!r.endOfTextblock(n)||0==o.depth)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}var l=Kh.findFrom(o,t,s);return!!l&&(i&&i(e.tr.setSelection(new Kh(l))),!0)}}function Jh(e,t,n){if(!e.editable)return!1;var i=e.state.doc.resolve(t);if(!Kh.valid(i))return!1;var r=e.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(r>-1&&bt.isSelectable(e.state.doc.nodeAt(r)))&&(e.dispatch(e.state.tr.setSelection(new Kh(i))),!0)}function ep(e){if(!(e.selection instanceof Kh))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",Rr.create(e.doc,[Tr.widget(e.selection.head,t,{key:"gapcursor"})])}const tp=ma.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Mt({props:{decorations:ep,createSelectionBetween:function(e,t,n){if(t.pos==n.pos&&Kh.valid(n))return new Kh(n)},handleClick:Jh,handleKeyDown:Zh}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=ha(pa(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),np=_s.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",rs(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:i})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{keepMarks:e}=this.options,{splittableMarks:r}=i.extensionManager,a=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();return t().insertContent({type:this.name}).command(({tr:t,dispatch:n})=>{if(n&&a&&e){const e=a.filter(e=>r.includes(e.type.name));t.ensureMarks(e)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ip=_s.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]),rs(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=>ms({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var rp=function(){};rp.prototype.append=function(e){return e.length?(e=rp.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},rp.prototype.prepend=function(e){return e.length?rp.from(e).append(this):this},rp.prototype.appendInner=function(e){return new op(this,e)},rp.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?rp.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},rp.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},rp.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)},rp.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var i=[];return this.forEach((function(t,n){return i.push(e(t,n))}),t,n),i},rp.from=function(e){return e instanceof rp?e:e&&e.length?new ap(e):rp.empty};var ap=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,i){for(var r=t;r<n;r++)if(!1===e(this.values[r],i+r))return!1},t.prototype.forEachInvertedInner=function(e,t,n,i){for(var r=t-1;r>=n;r--)if(!1===e(this.values[r],i+r))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}(rp);rp.empty=new ap([]);var op=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,i){var r=this.left.length;return!(t<r&&!1===this.left.forEachInner(e,t,Math.min(n,r),i))&&(!(n>r&&!1===this.right.forEachInner(e,Math.max(t-r,0),Math.min(this.length,n)-r,i+r))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,i){var r=this.left.length;return!(t>r&&!1===this.right.forEachInvertedInner(e,t-r,Math.max(n,r)-r,i+r))&&(!(n<r&&!1===this.left.forEachInvertedInner(e,Math.min(t,r),n,i))&&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}(rp),sp=rp,lp=function(e,t){this.items=e,this.eventCount=t};lp.prototype.popEvent=function(e,t){var n=this;if(0==this.eventCount)return null;for(var i,r,a=this.items.length;;a--){if(this.items.get(a-1).selection){--a;break}}t&&(i=this.remapping(a,this.items.length),r=i.maps.length);var o,s,l=e.tr,u=[],d=[];return this.items.forEach((function(e,t){if(!e.step)return i||(i=n.remapping(a,t+1),r=i.maps.length),r--,void d.push(e);if(i){d.push(new up(e.map));var c,_=e.step.map(i.slice(r));_&&l.maybeStep(_).doc&&(c=l.mapping.maps[l.mapping.maps.length-1],u.push(new up(c,null,null,u.length+d.length))),r--,c&&i.appendMap(c,r)}else l.maybeStep(e.step);return e.selection?(o=i?e.selection.map(i.slice(r)):e.selection,s=new lp(n.items.slice(0,a).append(d.reverse().concat(u)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:o}},lp.prototype.addTransform=function(e,t,n,i){for(var r=[],a=this.eventCount,o=this.items,s=!i&&o.length?o.get(o.length-1):null,l=0;l<e.steps.length;l++){var u,d=e.steps[l].invert(e.docs[l]),c=new up(e.mapping.maps[l],d,t);(u=s&&s.merge(c))&&(c=u,l?r.pop():o=o.slice(0,o.length-1)),r.push(c),t&&(a++,t=null),i||(s=c)}var _,f,g,h=a-n.depth;return h>cp&&(f=h,(_=o).forEach((function(e,t){if(e.selection&&0==f--)return g=t,!1})),o=_.slice(g),a-=h),new lp(o.append(r),a)},lp.prototype.remapping=function(e,t){var n=new Ie;return this.items.forEach((function(t,i){var r=null!=t.mirrorOffset&&i-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:null;n.appendMap(t.map,r)}),e,t),n},lp.prototype.addMaps=function(e){return 0==this.eventCount?this:new lp(this.items.append(e.map((function(e){return new up(e)}))),this.eventCount)},lp.prototype.rebased=function(e,t){if(!this.eventCount)return this;var n=[],i=Math.max(0,this.items.length-t),r=e.mapping,a=e.steps.length,o=this.eventCount;this.items.forEach((function(e){e.selection&&o--}),i);var s=t;this.items.forEach((function(t){var i=r.getMirror(--s);if(null!=i){a=Math.min(a,i);var l=r.maps[i];if(t.step){var u=e.steps[i].invert(e.docs[i]),d=t.selection&&t.selection.map(r.slice(s+1,i));d&&o++,n.push(new up(l,u,d))}else n.push(new up(l))}}),i);for(var l=[],u=t;u<a;u++)l.push(new up(r.maps[u]));var d=this.items.slice(0,i).append(l).append(n),c=new lp(d,o);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c},lp.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},lp.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),n=t.maps.length,i=[],r=0;return this.items.forEach((function(a,o){if(o>=e)i.push(a),a.selection&&r++;else if(a.step){var s=a.step.map(t.slice(n)),l=s&&s.getMap();if(n--,l&&t.appendMap(l,n),s){var u=a.selection&&a.selection.map(t.slice(n));u&&r++;var d,c=new up(l.invert(),s,u),_=i.length-1;(d=i.length&&i[_].merge(c))?i[_]=d:i.push(c)}}else a.map&&n--}),this.items.length,0),new lp(sp.from(i.reverse()),r)},lp.empty=new lp(sp.empty,0);var up=function(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i};up.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new up(t.getMap().invert(),t,this.selection)}};var dp=function(e,t,n,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i},cp=20;function _p(e){var t=[];return e.forEach((function(e,n,i,r){return t.push(i,r)})),t}function fp(e,t){if(!e)return null;for(var n=[],i=0;i<e.length;i+=2){var r=t.map(e[i],1),a=t.map(e[i+1],-1);r<=a&&n.push(r,a)}return n}function gp(e,t,n,i){var r=mp(t),a=Fp.get(t).spec.config,o=(i?e.undone:e.done).popEvent(t,r);if(o){var s=o.selection.resolve(o.transform.doc),l=(i?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),a,r),u=new dp(i?l:o.remaining,i?o.remaining:l,null,0);n(o.transform.setSelection(s).setMeta(Fp,{redo:i,historyState:u}).scrollIntoView())}}var hp=!1,pp=null;function mp(e){var t=e.plugins;if(pp!=t){hp=!1,pp=t;for(var n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){hp=!0;break}}return hp}var Fp=new Lt("history"),bp=new Lt("closeHistory");function yp(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new Mt({key:Fp,state:{init:function(){return new dp(lp.empty,lp.empty,null,0)},apply:function(t,n,i){return function(e,t,n,i){var r,a=n.getMeta(Fp);if(a)return a.historyState;n.getMeta(bp)&&(e=new dp(e.done,e.undone,null,0));var o=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(o&&o.getMeta(Fp))return o.getMeta(Fp).redo?new dp(e.done.addTransform(n,null,i,mp(t)),e.undone,_p(n.mapping.maps[n.steps.length-1]),e.prevTime):new dp(e.done,e.undone.addTransform(n,null,i,mp(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))return(r=n.getMeta("rebased"))?new dp(e.done.rebased(n,r),e.undone.rebased(n,r),fp(e.prevRanges,n.mapping),e.prevTime):new dp(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),fp(e.prevRanges,n.mapping),e.prevTime);var s=0==e.prevTime||!o&&(e.prevTime<(n.time||0)-i.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;return e.mapping.maps[0].forEach((function(e,i){for(var r=0;r<t.length;r+=2)e<=t[r+1]&&i>=t[r]&&(n=!0)})),n}(n,e.prevRanges)),l=o?fp(e.prevRanges,n.mapping):_p(n.mapping.maps[n.steps.length-1]);return new dp(e.done.addTransform(n,s?t.selection.getBookmark():null,i,mp(t)),lp.empty,l,n.time)}(n,i,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var n="historyUndo"==t.inputType?Ep(e.state,e.dispatch):"historyRedo"==t.inputType&&vp(e.state,e.dispatch);return n&&t.preventDefault(),n}}}})}function Ep(e,t){var n=Fp.getState(e);return!(!n||0==n.done.eventCount)&&(t&&gp(n,e,t,!1),!0)}function vp(e,t){var n=Fp.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&gp(n,e,t,!0),!0)}const kp=ma.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Ep(e,t),redo:()=>({state:e,dispatch:t})=>vp(e,t)}),addProseMirrorPlugins(){return[yp(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()}}}),Dp=_s.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",rs(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().command(({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:i,$anchor:r}=n,a=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;if(!i||!a||!t)return!0;const o=r.before(),s=r.start();return e.deleteRange(o,s),e.setSelection(mt.create(e.doc,o)),!0}).insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{var n;if(t){const{parent:t,pos:i}=e.selection.$from,r=i+1;if(!e.doc.nodeAt(r)){const i=null===(n=t.type.contentMatch.defaultType)||void 0===n?void 0:n.create();i&&(e.insert(r,i),e.setSelection(mt.create(e.doc,r)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[gs({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Cp=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,wp=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,Sp=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,Op=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,xp=fs.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",rs(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[ps({find:Cp,type:this.type}),ps({find:Sp,type:this.type})]},addPasteRules(){return[ys({find:wp,type:this.type}),ys({find:Op,type:this.type})]}}),Tp=_s.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",rs(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")}}}),Np=/^(\d+)\.\s$/,Ap=_s.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",rs(this.options.HTMLAttributes,n),0]:["ol",rs(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleOrderedList:()=>({commands:e})=>e.toggleList("orderedList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[bs({find:Np,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),Mp=_s.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",rs(this.options.HTMLAttributes,e),0]},addCommands:()=>({setParagraph:()=>({commands:e})=>e.setNode("paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Rp=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,Ip=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,Lp=fs.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",rs(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[ps({find:Rp,type:this.type})]},addPasteRules(){return[ys({find:Ip,type:this.type})]}});var Bp=_s.create({name:"text",group:"inline"});const Pp=ma.create({name:"starterKit",addExtensions(){var e,t,n,i,r,a,o,s,l,u,d,c,_,f,g,h,p,m;const F=[];return!1!==this.options.blockquote&&F.push(Ah.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&F.push(Bh.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&F.push(jh.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&F.push(zh.configure(null===(i=this.options)||void 0===i?void 0:i.code)),!1!==this.options.codeBlock&&F.push(Gh.configure(null===(r=this.options)||void 0===r?void 0:r.codeBlock)),!1!==this.options.document&&F.push(Yh.configure(null===(a=this.options)||void 0===a?void 0:a.document)),!1!==this.options.dropcursor&&F.push($h.configure(null===(o=this.options)||void 0===o?void 0:o.dropcursor)),!1!==this.options.gapcursor&&F.push(tp.configure(null===(s=this.options)||void 0===s?void 0:s.gapcursor)),!1!==this.options.hardBreak&&F.push(np.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&F.push(ip.configure(null===(u=this.options)||void 0===u?void 0:u.heading)),!1!==this.options.history&&F.push(kp.configure(null===(d=this.options)||void 0===d?void 0:d.history)),!1!==this.options.horizontalRule&&F.push(Dp.configure(null===(c=this.options)||void 0===c?void 0:c.horizontalRule)),!1!==this.options.italic&&F.push(xp.configure(null===(_=this.options)||void 0===_?void 0:_.italic)),!1!==this.options.listItem&&F.push(Tp.configure(null===(f=this.options)||void 0===f?void 0:f.listItem)),!1!==this.options.orderedList&&F.push(Ap.configure(null===(g=this.options)||void 0===g?void 0:g.orderedList)),!1!==this.options.paragraph&&F.push(Mp.configure(null===(h=this.options)||void 0===h?void 0:h.paragraph)),!1!==this.options.strike&&F.push(Lp.configure(null===(p=this.options)||void 0===p?void 0:p.strike)),!1!==this.options.text&&F.push(Bp.configure(null===(m=this.options)||void 0===m?void 0:m.text)),F}}),jp=Fs({find:/--$/,replace:"—"}),qp=Fs({find:/\.\.\.$/,replace:"…"}),Up=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:"“"}),zp=Fs({find:/"$/,replace:"”"}),Hp=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:"‘"}),Wp=Fs({find:/'$/,replace:"’"}),Gp=Fs({find:/<-$/,replace:"←"}),Yp=Fs({find:/->$/,replace:"→"}),Vp=Fs({find:/\(c\)$/,replace:"©"}),$p=Fs({find:/\(tm\)$/,replace:"™"}),Kp=Fs({find:/\(r\)$/,replace:"®"}),Qp=Fs({find:/1\/2$/,replace:"½"}),Zp=Fs({find:/\+\/-$/,replace:"±"}),Xp=Fs({find:/!=$/,replace:"≠"}),Jp=Fs({find:/<<$/,replace:"«"}),em=Fs({find:/>>$/,replace:"»"}),tm=Fs({find:/\d+\s?([*x])\s?\d+$/,replace:"×"}),nm=Fs({find:/\^2$/,replace:"²"}),im=Fs({find:/\^3$/,replace:"³"}),rm=Fs({find:/1\/4$/,replace:"¼"}),am=Fs({find:/3\/4$/,replace:"¾"}),om=ma.create({name:"typography",addInputRules:()=>[jp,qp,Up,zp,Hp,Wp,Gp,Yp,Vp,$p,Kp,Qp,Zp,Xp,Jp,em,tm,nm,im,rm,am]}),sm=/(?:^|\s)((?:==)((?:[^~]+))(?:==))$/,lm=/(?:^|\s)((?:==)((?:[^~]+))(?:==))/g,um=fs.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",rs(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[ps({find:sm,type:this.type})]},addPasteRules(){return[ys({find:lm,type:this.type})]}});var dm=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var n=0;n<e.length;n++)this.size+=e[n].nodeSize},cm={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};dm.prototype.nodesBetween=function(e,t,n,i,r){void 0===i&&(i=0);for(var a=0,o=0;o<t;a++){var s=this.content[a],l=o+s.nodeSize;if(l>e&&!1!==n(s,i+o,r,a)&&s.content.size){var u=o+1;s.nodesBetween(Math.max(0,e-u),Math.min(s.content.size,t-u),n,i+u)}o=l}},dm.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},dm.prototype.textBetween=function(e,t,n,i){var r="",a=!0;return this.nodesBetween(e,t,(function(o,s){o.isText?(r+=o.text.slice(Math.max(e,s)-s,t-s),a=!n):o.isLeaf&&i?(r+="function"==typeof i?i(o):i,a=!n):!a&&o.isBlock&&(r+=n,a=!0)}),0),r},dm.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,n=e.firstChild,i=this.content.slice(),r=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),r=1);r<e.content.length;r++)i.push(e.content[r]);return new dm(i,this.size+e.size)},dm.prototype.cut=function(e,t){if(null==t&&(t=this.size),0==e&&t==this.size)return this;var n=[],i=0;if(t>e)for(var r=0,a=0;a<t;r++){var o=this.content[r],s=a+o.nodeSize;s>e&&((a<e||s>t)&&(o=o.isText?o.cut(Math.max(0,e-a),Math.min(o.text.length,t-a)):o.cut(Math.max(0,e-a-1),Math.min(o.content.size,t-a-1))),n.push(o),i+=o.nodeSize),a=s}return new dm(n,i)},dm.prototype.cutByIndex=function(e,t){return e==t?dm.empty:0==e&&t==this.content.length?this:new dm(this.content.slice(e,t))},dm.prototype.replaceChild=function(e,t){var n=this.content[e];if(n==t)return this;var i=this.content.slice(),r=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new dm(i,r)},dm.prototype.addToStart=function(e){return new dm([e].concat(this.content),this.size+e.nodeSize)},dm.prototype.addToEnd=function(e){return new dm(this.content.concat(e),this.size+e.nodeSize)},dm.prototype.eq=function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0},cm.firstChild.get=function(){return this.content.length?this.content[0]:null},cm.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},cm.childCount.get=function(){return this.content.length},dm.prototype.child=function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t},dm.prototype.maybeChild=function(e){return this.content[e]},dm.prototype.forEach=function(e){for(var t=0,n=0;t<this.content.length;t++){var i=this.content[t];e(i,n,t),n+=i.nodeSize}},dm.prototype.findDiffStart=function(e,t){return void 0===t&&(t=0),function e(t,n,i){for(var r=0;;r++){if(r==t.childCount||r==n.childCount)return t.childCount==n.childCount?null:i;var a=t.child(r),o=n.child(r);if(a!=o){if(!a.sameMarkup(o))return i;if(a.isText&&a.text!=o.text){for(var s=0;a.text[s]==o.text[s];s++)i++;return i}if(a.content.size||o.content.size){var l=e(a.content,o.content,i+1);if(null!=l)return l}i+=a.nodeSize}else i+=a.nodeSize}}(this,e,t)},dm.prototype.findDiffEnd=function(e,t,n){return void 0===t&&(t=this.size),void 0===n&&(n=e.size),function e(t,n,i,r){for(var a=t.childCount,o=n.childCount;;){if(0==a||0==o)return a==o?null:{a:i,b:r};var s=t.child(--a),l=n.child(--o),u=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:i,b:r};if(s.isText&&s.text!=l.text){for(var d=0,c=Math.min(s.text.length,l.text.length);d<c&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,i--,r--;return{a:i,b:r}}if(s.content.size||l.content.size){var _=e(s.content,l.content,i-1,r-1);if(_)return _}i-=u,r-=u}else i-=u,r-=u}}(this,e,t,n)},dm.prototype.findIndex=function(e,t){if(void 0===t&&(t=-1),0==e)return fm(0,e);if(e==this.size)return fm(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var n=0,i=0;;n++){var r=i+this.child(n).nodeSize;if(r>=e)return r==e||t>0?fm(n+1,r):fm(n,i);i=r}},dm.prototype.toString=function(){return"<"+this.toStringInner()+">"},dm.prototype.toStringInner=function(){return this.content.join(", ")},dm.prototype.toJSON=function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null},dm.fromJSON=function(e,t){if(!t)return dm.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new dm(t.map(e.nodeFromJSON))},dm.fromArray=function(e){if(!e.length)return dm.empty;for(var t,n=0,i=0;i<e.length;i++){var r=e[i];n+=r.nodeSize,i&&r.isText&&e[i-1].sameMarkup(r)?(t||(t=e.slice(0,i)),t[t.length-1]=r.withText(t[t.length-1].text+r.text)):t&&t.push(r)}return new dm(t||e,n)},dm.from=function(e){if(!e)return dm.empty;if(e instanceof dm)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new dm([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(dm.prototype,cm);var _m={index:0,offset:0};function fm(e,t){return _m.index=e,_m.offset=t,_m}function gm(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!gm(e[i],t[i]))return!1}else{for(var r in e)if(!(r in t)||!gm(e[r],t[r]))return!1;for(var a in t)if(!(a in e))return!1}return!0}dm.empty=new dm([],0);var hm=function(e,t){this.type=e,this.attrs=t};function pm(e){var t=Error.call(this,e);return t.__proto__=pm.prototype,t}hm.prototype.addToSet=function(e){for(var t,n=!1,i=0;i<e.length;i++){var r=e[i];if(this.eq(r))return e;if(this.type.excludes(r.type))t||(t=e.slice(0,i));else{if(r.type.excludes(this.type))return e;!n&&r.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(r)}}return t||(t=e.slice()),n||t.push(this),t},hm.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e},hm.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1},hm.prototype.eq=function(e){return this==e||this.type==e.type&&gm(this.attrs,e.attrs)},hm.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e},hm.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[t.type];if(!n)throw new RangeError("There is no mark type "+t.type+" in this schema");return n.create(t.attrs)},hm.sameSet=function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0},hm.setFrom=function(e){if(!e||0==e.length)return hm.none;if(e instanceof hm)return[e];var t=e.slice();return t.sort((function(e,t){return e.type.rank-t.type.rank})),t},hm.none=[],pm.prototype=Object.create(Error.prototype),pm.prototype.constructor=pm,pm.prototype.name="ReplaceError";var mm=function(e,t,n){this.content=e,this.openStart=t,this.openEnd=n},Fm={size:{configurable:!0}};function bm(e,t,n){if(n.openStart>e.depth)throw new pm("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new pm("Inconsistent open depths");return function e(t,n,i,r){var a=t.index(r),o=t.node(r);if(a==n.index(r)&&r<t.depth-i.openStart){var s=e(t,n,i,r+1);return o.copy(o.content.replaceChild(a,s))}if(i.content.size){if(i.openStart||i.openEnd||t.depth!=r||n.depth!=r){var l=function(e,t){for(var n=t.depth-e.openStart,i=t.node(n).copy(e.content),r=n-1;r>=0;r--)i=t.node(r).copy(dm.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}(i,t),u=l.start,d=l.end;return Dm(o,function e(t,n,i,r,a){var o=t.depth>a&&Em(t,n,a+1),s=r.depth>a&&Em(i,r,a+1),l=[];km(null,t,a,l),o&&s&&n.index(a)==i.index(a)?(ym(o,s),vm(Dm(o,e(t,n,i,r,a+1)),l)):(o&&vm(Dm(o,Cm(t,n,a+1)),l),km(n,i,a,l),s&&vm(Dm(s,Cm(i,r,a+1)),l));return km(r,null,a,l),new dm(l)}(t,u,d,n,r))}var c=t.parent,_=c.content;return Dm(c,_.cut(0,t.parentOffset).append(i.content).append(_.cut(n.parentOffset)))}return Dm(o,Cm(t,n,r))}(e,t,n,0)}function ym(e,t){if(!t.type.compatibleContent(e.type))throw new pm("Cannot join "+t.type.name+" onto "+e.type.name)}function Em(e,t,n){var i=e.node(n);return ym(i,t.node(n)),i}function vm(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function km(e,t,n,i){var r=(t||e).node(n),a=0,o=t?t.index(n):r.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(vm(e.nodeAfter,i),a++));for(var s=a;s<o;s++)vm(r.child(s),i);t&&t.depth==n&&t.textOffset&&vm(t.nodeBefore,i)}function Dm(e,t){if(!e.type.validContent(t))throw new pm("Invalid content for node "+e.type.name);return e.copy(t)}function Cm(e,t,n){var i=[];(km(null,e,n,i),e.depth>n)&&vm(Dm(Em(e,t,n+1),Cm(e,t,n+1)),i);return km(t,null,n,i),new dm(i)}Fm.size.get=function(){return this.content.size-this.openStart-this.openEnd},mm.prototype.insertAt=function(e,t){var n=function e(t,n,i,r){var a=t.findIndex(n),o=a.index,s=a.offset,l=t.maybeChild(o);if(s==n||l.isText)return r&&!r.canReplace(o,o,i)?null:t.cut(0,n).append(i).append(t.cut(n));var u=e(l.content,n-s-1,i);return u&&t.replaceChild(o,l.copy(u))}(this.content,e+this.openStart,t,null);return n&&new mm(n,this.openStart,this.openEnd)},mm.prototype.removeBetween=function(e,t){return new mm(function e(t,n,i){var r=t.findIndex(n),a=r.index,o=r.offset,s=t.maybeChild(a),l=t.findIndex(i),u=l.index,d=l.offset;if(o==n||s.isText){if(d!=i&&!t.child(u).isText)throw new RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(i))}if(a!=u)throw new RangeError("Removing non-flat range");return t.replaceChild(a,s.copy(e(s.content,n-o-1,i-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},mm.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},mm.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},mm.prototype.toJSON=function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e},mm.fromJSON=function(e,t){if(!t)return mm.empty;var n=t.openStart||0,i=t.openEnd||0;if("number"!=typeof n||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new mm(dm.fromJSON(e,t.content),n,i)},mm.maxOpen=function(e,t){void 0===t&&(t=!0);for(var n=0,i=0,r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(var a=e.lastChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.lastChild)i++;return new mm(e,n,i)},Object.defineProperties(mm.prototype,Fm),mm.empty=new mm(dm.empty,0,0);var wm=function(e,t,n){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=n},Sm={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};wm.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},Sm.parent.get=function(){return this.node(this.depth)},Sm.doc.get=function(){return this.node(0)},wm.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},wm.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},wm.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},wm.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},wm.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},wm.prototype.before=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]},wm.prototype.after=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize},Sm.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},Sm.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i},Sm.nodeBefore.get=function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)},wm.prototype.posAtIndex=function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],i=0==t?0:this.path[3*t-1]+1,r=0;r<e;r++)i+=n.child(r).nodeSize;return i},wm.prototype.marks=function(){var e=this.parent,t=this.index();if(0==e.content.size)return hm.none;if(this.textOffset)return e.child(t).marks;var n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){var r=n;n=i,i=r}for(var a=n.marks,o=0;o<a.length;o++)!1!==a[o].type.spec.inclusive||i&&a[o].isInSet(i.marks)||(a=a[o--].removeFromSet(a));return a},wm.prototype.marksAcross=function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var n=t.marks,i=e.parent.maybeChild(e.index()),r=0;r<n.length;r++)!1!==n[r].type.spec.inclusive||i&&n[r].isInSet(i.marks)||(n=n[r--].removeFromSet(n));return n},wm.prototype.sharedDepth=function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0},wm.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Nm(this,e,n)},wm.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},wm.prototype.max=function(e){return e.pos>this.pos?e:this},wm.prototype.min=function(e){return e.pos<this.pos?e:this},wm.prototype.toString=function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset},wm.resolve=function(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var n=[],i=0,r=t,a=e;;){var o=a.content.findIndex(r),s=o.index,l=o.offset,u=r-l;if(n.push(a,s,i+l),!u)break;if((a=a.child(s)).isText)break;r=u-1,i+=l+1}return new wm(t,n,r)},wm.resolveCached=function(e,t){for(var n=0;n<Om.length;n++){var i=Om[n];if(i.pos==t&&i.doc==e)return i}var r=Om[xm]=wm.resolve(e,t);return xm=(xm+1)%Tm,r},Object.defineProperties(wm.prototype,Sm);var Om=[],xm=0,Tm=12,Nm=function(e,t,n){this.$from=e,this.$to=t,this.depth=n},Am={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};Am.start.get=function(){return this.$from.before(this.depth+1)},Am.end.get=function(){return this.$to.after(this.depth+1)},Am.parent.get=function(){return this.$from.node(this.depth)},Am.startIndex.get=function(){return this.$from.index(this.depth)},Am.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(Nm.prototype,Am);var Mm=Object.create(null),Rm=function(e,t,n,i){this.type=e,this.attrs=t,this.content=n||dm.empty,this.marks=i||hm.none},Im={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};Im.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},Im.childCount.get=function(){return this.content.childCount},Rm.prototype.child=function(e){return this.content.child(e)},Rm.prototype.maybeChild=function(e){return this.content.maybeChild(e)},Rm.prototype.forEach=function(e){this.content.forEach(e)},Rm.prototype.nodesBetween=function(e,t,n,i){void 0===i&&(i=0),this.content.nodesBetween(e,t,n,i,this)},Rm.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},Im.textContent.get=function(){return this.textBetween(0,this.content.size,"")},Rm.prototype.textBetween=function(e,t,n,i){return this.content.textBetween(e,t,n,i)},Im.firstChild.get=function(){return this.content.firstChild},Im.lastChild.get=function(){return this.content.lastChild},Rm.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},Rm.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},Rm.prototype.hasMarkup=function(e,t,n){return this.type==e&&gm(this.attrs,t||e.defaultAttrs||Mm)&&hm.sameSet(this.marks,n||hm.none)},Rm.prototype.copy=function(e){return void 0===e&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},Rm.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},Rm.prototype.cut=function(e,t){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))},Rm.prototype.slice=function(e,t,n){if(void 0===t&&(t=this.content.size),void 0===n&&(n=!1),e==t)return mm.empty;var i=this.resolve(e),r=this.resolve(t),a=n?0:i.sharedDepth(t),o=i.start(a),s=i.node(a).content.cut(i.pos-o,r.pos-o);return new mm(s,i.depth-a,r.depth-a)},Rm.prototype.replace=function(e,t,n){return bm(this.resolve(e),this.resolve(t),n)},Rm.prototype.nodeAt=function(e){for(var t=this;;){var n=t.content.findIndex(e),i=n.index,r=n.offset;if(!(t=t.maybeChild(i)))return null;if(r==e||t.isText)return t;e-=r+1}},Rm.prototype.childAfter=function(e){var t=this.content.findIndex(e),n=t.index,i=t.offset;return{node:this.content.maybeChild(n),index:n,offset:i}},Rm.prototype.childBefore=function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,i=t.offset;if(i<e)return{node:this.content.child(n),index:n,offset:i};var r=this.content.child(n-1);return{node:r,index:n-1,offset:i-r.nodeSize}},Rm.prototype.resolve=function(e){return wm.resolveCached(this,e)},Rm.prototype.resolveNoCache=function(e){return wm.resolve(this,e)},Rm.prototype.rangeHasMark=function(e,t,n){var i=!1;return t>e&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.marks)&&(i=!0),!i})),i},Im.isBlock.get=function(){return this.type.isBlock},Im.isTextblock.get=function(){return this.type.isTextblock},Im.inlineContent.get=function(){return this.type.inlineContent},Im.isInline.get=function(){return this.type.isInline},Im.isText.get=function(){return this.type.isText},Im.isLeaf.get=function(){return this.type.isLeaf},Im.isAtom.get=function(){return this.type.isAtom},Rm.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),function(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}(this.marks,e)},Rm.prototype.contentMatchAt=function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t},Rm.prototype.canReplace=function(e,t,n,i,r){void 0===n&&(n=dm.empty),void 0===i&&(i=0),void 0===r&&(r=n.childCount);var a=this.contentMatchAt(e).matchFragment(n,i,r),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(var s=i;s<r;s++)if(!this.type.allowsMarks(n.child(s).marks))return!1;return!0},Rm.prototype.canReplaceWith=function(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;var r=this.contentMatchAt(e).matchType(n),a=r&&r.matchFragment(this.content,t);return!!a&&a.validEnd},Rm.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},Rm.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));for(var e=hm.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!hm.sameSet(e,this.marks))throw new RangeError("Invalid collection of marks for node "+this.type.name+": "+this.marks.map((function(e){return e.type.name})));this.content.forEach((function(e){return e.check()}))},Rm.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((function(e){return e.toJSON()}))),e},Rm.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}var i=dm.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,n)},Object.defineProperties(Rm.prototype,Im);var Lm=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},Bm={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};Lm.parse=function(e,t){var n=new Pm(e,t);if(null==n.next)return Lm.empty;var i=qm(n);n.next&&n.err("Unexpected trailing text");var r=function(e){var t=Object.create(null);return function n(i){var r=[];i.forEach((function(t){e[t].forEach((function(t){var n=t.term,i=t.to;if(n){var a=r.indexOf(n),o=a>-1&&r[a+1];Ym(e,i).forEach((function(e){o||r.push(n,o=[]),-1==o.indexOf(e)&&o.push(e)}))}}))}));for(var a=t[i.join(",")]=new Lm(i.indexOf(e.length-1)>-1),o=0;o<r.length;o+=2){var s=r[o+1].sort(Gm);a.next.push(r[o],t[s.join(",")]||n(s))}return a}(Ym(e,0))}(function(e){var t=[[]];return r(function e(t,a){if("choice"==t.type)return t.exprs.reduce((function(t,n){return t.concat(e(n,a))}),[]);if("seq"==t.type)for(var o=0;;o++){var s=e(t.exprs[o],a);if(o==t.exprs.length-1)return s;r(s,a=n())}else{if("star"==t.type){var l=n();return i(a,l),r(e(t.expr,l),l),[i(l)]}if("plus"==t.type){var u=n();return r(e(t.expr,a),u),r(e(t.expr,u),u),[i(u)]}if("opt"==t.type)return[i(a)].concat(e(t.expr,a));if("range"==t.type){for(var d=a,c=0;c<t.min;c++){var _=n();r(e(t.expr,d),_),d=_}if(-1==t.max)r(e(t.expr,d),d);else for(var f=t.min;f<t.max;f++){var g=n();i(d,g),r(e(t.expr,d),g),d=g}return[i(d)]}if("name"==t.type)return[i(a,null,t.value)]}}(e,0),n()),t;function n(){return t.push([])-1}function i(e,n,i){var r={term:i,to:n};return t[e].push(r),r}function r(e,t){e.forEach((function(e){return e.to=t}))}}(i));return function(e,t){for(var n=0,i=[e];n<i.length;n++){for(var r=i[n],a=!r.validEnd,o=[],s=0;s<r.next.length;s+=2){var l=r.next[s],u=r.next[s+1];o.push(l.name),!a||l.isText||l.hasRequiredAttrs()||(a=!1),-1==i.indexOf(u)&&i.push(u)}a&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(r,n),r},Lm.prototype.matchType=function(e){for(var t=0;t<this.next.length;t+=2)if(this.next[t]==e)return this.next[t+1];return null},Lm.prototype.matchFragment=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.childCount);for(var i=this,r=t;i&&r<n;r++)i=i.matchType(e.child(r).type);return i},Bm.inlineContent.get=function(){var e=this.next[0];return!!e&&e.isInline},Bm.defaultType.get=function(){for(var e=0;e<this.next.length;e+=2){var t=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}},Lm.prototype.compatible=function(e){for(var t=0;t<this.next.length;t+=2)for(var n=0;n<e.next.length;n+=2)if(this.next[t]==e.next[n])return!0;return!1},Lm.prototype.fillBefore=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=0);var i=[this];return function r(a,o){var s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return dm.from(o.map((function(e){return e.createAndFill()})));for(var l=0;l<a.next.length;l+=2){var u=a.next[l],d=a.next[l+1];if(!u.isText&&!u.hasRequiredAttrs()&&-1==i.indexOf(d)){i.push(d);var c=r(d,o.concat(u));if(c)return c}}}(this,[])},Lm.prototype.findWrapping=function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var n=this.computeWrapping(e);return this.wrapCache.push(e,n),n},Lm.prototype.computeWrapping=function(e){for(var t=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var i=n.shift(),r=i.match;if(r.matchType(e)){for(var a=[],o=i;o.type;o=o.via)a.push(o.type);return a.reverse()}for(var s=0;s<r.next.length;s+=2){var l=r.next[s];l.isLeaf||l.hasRequiredAttrs()||l.name in t||i.type&&!r.next[s+1].validEnd||(n.push({match:l.contentMatch,type:l,via:i}),t[l.name]=!0)}}},Bm.edgeCount.get=function(){return this.next.length>>1},Lm.prototype.edge=function(e){var t=e<<1;if(t>=this.next.length)throw new RangeError("There's no "+e+"th edge in this content match");return{type:this.next[t],next:this.next[t+1]}},Lm.prototype.toString=function(){var e=[];return function t(n){e.push(n);for(var i=1;i<n.next.length;i+=2)-1==e.indexOf(n.next[i])&&t(n.next[i])}(this),e.map((function(t,n){for(var i=n+(t.validEnd?"*":" ")+" ",r=0;r<t.next.length;r+=2)i+=(r?", ":"")+t.next[r].name+"->"+e.indexOf(t.next[r+1]);return i})).join("\n")},Object.defineProperties(Lm.prototype,Bm),Lm.empty=new Lm(!0);var Pm=function(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},jm={next:{configurable:!0}};function qm(e){var t=[];do{t.push(Um(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Um(e){var t=[];do{t.push(zm(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function zm(e){for(var t=function(e){if(e.eat("(")){var t=qm(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,i=n[t];if(i)return[i];var r=[];for(var a in n){var o=n[a];o.groups.indexOf(t)>-1&&r.push(o)}0==r.length&&e.err("No node type or group '"+t+"' found");return r}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=Wm(e,t)}return t}function Hm(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function Wm(e,t){var n=Hm(e),i=n;return e.eat(",")&&(i="}"!=e.next?Hm(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function Gm(e,t){return t-e}function Ym(e,t){var n=[];return function t(i){var r=e[i];if(1==r.length&&!r[0].term)return t(r[0].to);n.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=o.term,l=o.to;s||-1!=n.indexOf(l)||t(l)}}(t),n.sort(Gm)}function Vm(e){var t=Object.create(null);for(var n in e){var i=e[n];if(!i.hasDefault)return null;t[n]=i.default}return t}function $m(e,t){var n=Object.create(null);for(var i in e){var r=t&&t[i];if(void 0===r){var a=e[i];if(!a.hasDefault)throw new RangeError("No value supplied for attribute "+i);r=a.default}n[i]=r}return n}function Km(e){var t=Object.create(null);if(e)for(var n in e)t[n]=new Xm(e[n]);return t}jm.next.get=function(){return this.tokens[this.pos]},Pm.prototype.eat=function(e){return this.next==e&&(this.pos++||!0)},Pm.prototype.err=function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")},Object.defineProperties(Pm.prototype,jm);var Qm=function(e,t,n){this.name=e,this.schema=t,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=Km(n.attrs),this.defaultAttrs=Vm(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e},Zm={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};Zm.isInline.get=function(){return!this.isBlock},Zm.isTextblock.get=function(){return this.isBlock&&this.inlineContent},Zm.isLeaf.get=function(){return this.contentMatch==Lm.empty},Zm.isAtom.get=function(){return this.isLeaf||this.spec.atom},Qm.prototype.hasRequiredAttrs=function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1},Qm.prototype.compatibleContent=function(e){return this==e||this.contentMatch.compatible(e.contentMatch)},Qm.prototype.computeAttrs=function(e){return!e&&this.defaultAttrs?this.defaultAttrs:$m(this.attrs,e)},Qm.prototype.create=function(e,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Rm(this,this.computeAttrs(e),dm.from(t),hm.setFrom(n))},Qm.prototype.createChecked=function(e,t,n){if(t=dm.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new Rm(this,this.computeAttrs(e),t,hm.setFrom(n))},Qm.prototype.createAndFill=function(e,t,n){if(e=this.computeAttrs(e),(t=dm.from(t)).size){var i=this.contentMatch.fillBefore(t);if(!i)return null;t=i.append(t)}var r=this.contentMatch.matchFragment(t).fillBefore(dm.empty,!0);return r?new Rm(this,e,t.append(r),hm.setFrom(n)):null},Qm.prototype.validContent=function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0},Qm.prototype.allowsMarkType=function(e){return null==this.markSet||this.markSet.indexOf(e)>-1},Qm.prototype.allowsMarks=function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0},Qm.prototype.allowedMarks=function(e){if(null==this.markSet)return e;for(var t,n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:hm.empty:e},Qm.compile=function(e,t){var n=Object.create(null);e.forEach((function(e,i){return n[e]=new Qm(e,t,i)}));var i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(var r in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties(Qm.prototype,Zm);var Xm=function(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default},Jm={isRequired:{configurable:!0}};Jm.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(Xm.prototype,Jm);var eF=function(e,t,n,i){this.name=e,this.schema=n,this.spec=i,this.attrs=Km(i.attrs),this.rank=t,this.excluded=null;var r=Vm(this.attrs);this.instance=r&&new hm(this,r)};eF.prototype.create=function(e){return!e&&this.instance?this.instance:new hm(this,$m(this.attrs,e))},eF.compile=function(e,t){var n=Object.create(null),i=0;return e.forEach((function(e,r){return n[e]=new eF(e,i++,t,r)})),n},eF.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e},eF.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]},eF.prototype.excludes=function(e){return this.excluded.indexOf(e)>-1};var tF={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},nF={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},iF={ol:!0,ul:!0};function rF(e){return(e?1:0)|("full"===e?2:0)}var aF=function(e,t,n,i,r,a,o){this.type=e,this.attrs=t,this.solid=r,this.match=a||(4&o?null:e.contentMatch),this.options=o,this.content=[],this.marks=n,this.activeMarks=hm.none,this.pendingMarks=i,this.stashMarks=[]};aF.prototype.findWrapping=function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(dm.from(e));if(!t){var n,i=this.type.contentMatch;return(n=i.findWrapping(e.type))?(this.match=i,n):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)},aF.prototype.finish=function(e){if(!(1&this.options)){var t,n=this.content[this.content.length-1];n&&n.isText&&(t=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length)))}var i=dm.from(this.content);return!e&&this.match&&(i=i.append(this.match.fillBefore(dm.empty,!0))),this.type?this.type.create(this.attrs,i,this.marks):i},aF.prototype.popFromStashMark=function(e){for(var t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]},aF.prototype.applyPending=function(e){for(var t=0,n=this.pendingMarks;t<n.length;t++){var i=n[t];(this.type?this.type.allowsMarkType(i.type):lF(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}},aF.prototype.inlineContext=function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!tF.hasOwnProperty(e.parentNode.nodeName.toLowerCase())};var oF=function(e,t,n){this.parser=e,this.options=t,this.isOpen=n;var i,r=t.topNode,a=rF(t.preserveWhitespace)|(n?4:0);i=r?new aF(r.type,r.attrs,hm.none,hm.none,!0,t.topMatch||r.type.contentMatch,a):new aF(n?null:e.schema.topNodeType,null,hm.none,hm.none,!0,null,a),this.nodes=[i],this.open=0,this.find=t.findPositions,this.needsBlock=!1},sF={top:{configurable:!0},currentPos:{configurable:!0}};function lF(e,t){var n=t.schema.nodes,i=function(i){var r=n[i];if(r.allowsMarkType(e)){var a=[],o=function(e){a.push(e);for(var n=0;n<e.edgeCount;n++){var i=e.edge(n),r=i.type,s=i.next;if(r==t)return!0;if(a.indexOf(s)<0&&o(s))return!0}};return o(r.contentMatch)?{v:!0}:void 0}};for(var r in n){var a=i(r);if(a)return a.v}}sF.top.get=function(){return this.nodes[this.open]},oF.prototype.addDOM=function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),n=t?this.readStyles(function(e){var t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,i=[];for(;t=n.exec(e);)i.push(t[1],t[2].trim());return i}(t)):null,i=this.top;if(null!=n)for(var r=0;r<n.length;r++)this.addPendingMark(n[r]);if(this.addElement(e),null!=n)for(var a=0;a<n.length;a++)this.removePendingMark(n[a],i)}},oF.prototype.addTextNode=function(e){var t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){var i=n.content[n.content.length-1],r=e.previousSibling;(!i||r&&"BR"==r.nodeName||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)},oF.prototype.addElement=function(e,t){var n,i=e.nodeName.toLowerCase();iF.hasOwnProperty(i)&&this.parser.normalizeLists&&function(e){for(var t=e.firstChild,n=null;t;t=t.nextSibling){var i=1==t.nodeType?t.nodeName.toLowerCase():null;i&&iF.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):"li"==i?n=t:i&&(n=null)}}(e);var r=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(r?r.ignore:nF.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e);else if(!r||r.skip||r.closeParent){r&&r.closeParent?this.open=Math.max(0,this.open-1):r&&r.skip.nodeType&&(e=r.skip);var a,o=this.top,s=this.needsBlock;if(tF.hasOwnProperty(i))a=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),a&&this.sync(o),this.needsBlock=s}else this.addElementByRule(e,r,!1===r.consuming?n:null)},oF.prototype.leafFallback=function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))},oF.prototype.ignoreFallback=function(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))},oF.prototype.readStyles=function(e){var t=hm.none;e:for(var n=0;n<e.length;n+=2)for(var i=null;;){var r=this.parser.matchStyle(e[n],e[n+1],this,i);if(!r)continue e;if(r.ignore)return null;if(t=this.parser.schema.marks[r.mark].create(r.attrs).addToSet(t),!1!==r.consuming)break;i=r}return t},oF.prototype.addElementByRule=function(e,t,n){var i,r,a,o=this;t.node?(r=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(r.create(t.attrs))||this.leafFallback(e):i=this.enter(r,t.attrs,t.preserveWhitespace):(a=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(a));var s=this.top;if(r&&r.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((function(e){return o.insertNode(e)}));else{var l=t.contentElement;"string"==typeof l?l=e.querySelector(l):"function"==typeof l&&(l=l(e)),l||(l=e),this.findAround(e,l,!0),this.addAll(l,i)}i&&(this.sync(s),this.open--),a&&this.removePendingMark(a,s)},oF.prototype.addAll=function(e,t,n,i){for(var r=n||0,a=n?e.childNodes[n]:e.firstChild,o=null==i?null:e.childNodes[i];a!=o;a=a.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(a),t&&tF.hasOwnProperty(a.nodeName.toLowerCase())&&this.sync(t);this.findAtPoint(e,r)},oF.prototype.findPlace=function(e){for(var t,n,i=this.open;i>=0;i--){var r=this.nodes[i],a=r.findWrapping(e);if(a&&(!t||t.length>a.length)&&(t=a,n=r,!a.length))break;if(r.solid)break}if(!t)return!1;this.sync(n);for(var o=0;o<t.length;o++)this.enterInner(t[o],null,!1);return!0},oF.prototype.insertNode=function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));for(var i=n.activeMarks,r=0;r<e.marks.length;r++)n.type&&!n.type.allowsMarkType(e.marks[r].type)||(i=e.marks[r].addToSet(i));return n.content.push(e.mark(i)),!0}return!1},oF.prototype.enter=function(e,t,n){var i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,n),i},oF.prototype.enterInner=function(e,t,n,i){this.closeExtra();var r=this.top;r.applyPending(e),r.match=r.match&&r.match.matchType(e,t);var a=null==i?-5&r.options:rF(i);4&r.options&&0==r.content.length&&(a|=4),this.nodes.push(new aF(e,t,r.activeMarks,r.pendingMarks,n,null,a)),this.open++},oF.prototype.closeExtra=function(e){var t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}},oF.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},oF.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},sF.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e},oF.prototype.findAtPoint=function(e,t){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)},oF.prototype.findInside=function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)},oF.prototype.findAround=function(e,t,n){if(e!=t&&this.find)for(var i=0;i<this.find.length;i++){if(null==this.find[i].pos&&1==e.nodeType&&e.contains(this.find[i].node))t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}},oF.prototype.findInText=function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))},oF.prototype.matchesContext=function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),i=this.options.context,r=!(this.isOpen||i&&i.parent.type!=this.nodes[0].type),a=-(i?i.depth+1:0)+(r?0:1),o=function(e,s){for(;e>=0;e--){var l=n[e];if(""==l){if(e==n.length-1||0==e)continue;for(;s>=a;s--)if(o(e-1,s))return!0;return!1}var u=s>0||0==s&&r?t.nodes[s].type:i&&s>=a?i.node(s-a).type:null;if(!u||u.name!=l&&-1==u.groups.indexOf(l))return!1;s--}return!0};return o(n.length-1,this.open)},oF.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var i in this.parser.schema.nodes){var r=this.parser.schema.nodes[i];if(r.isTextblock&&r.defaultAttrs)return r}},oF.prototype.addPendingMark=function(e){var t=function(e,t){for(var n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)},oF.prototype.removePendingMark=function(e,t){for(var n=this.open;n>=0;n--){var i=this.nodes[n];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);var r=i.popFromStashMark(e);r&&i.type&&i.type.allowsMarkType(r.type)&&(i.activeMarks=r.addToSet(i.activeMarks))}if(i==t)break}},Object.defineProperties(oF.prototype,sF);var uF=Math.pow(2,16);function dF(e){return 65535&e}var cF=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=null),this.pos=e,this.deleted=t,this.recover=n},_F=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};_F.prototype.recover=function(e){var t=0,n=dF(e);if(!this.inverted)for(var i=0;i<n;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/uF}(e)},_F.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},_F.prototype.map=function(e,t){return void 0===t&&(t=1),this._map(e,t,!0)},_F.prototype._map=function(e,t,n){for(var i=0,r=this.inverted?2:1,a=this.inverted?1:2,o=0;o<this.ranges.length;o+=3){var s=this.ranges[o]-(this.inverted?i:0);if(s>e)break;var l=this.ranges[o+r],u=this.ranges[o+a],d=s+l;if(e<=d){var c=s+i+((l?e==s?-1:e==d?1:t:t)<0?0:u);if(n)return c;var _=e==(t<0?s:d)?null:o/3+(e-s)*uF;return new cF(c,t<0?e!=s:e!=d,_)}i+=u-l}return n?e+i:new cF(e+i)},_F.prototype.touches=function(e,t){for(var n=0,i=dF(t),r=this.inverted?2:1,a=this.inverted?1:2,o=0;o<this.ranges.length;o+=3){var s=this.ranges[o]-(this.inverted?n:0);if(s>e)break;var l=this.ranges[o+r];if(e<=s+l&&o==3*i)return!0;n+=this.ranges[o+a]-l}return!1},_F.prototype.forEach=function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,i=0,r=0;i<this.ranges.length;i+=3){var a=this.ranges[i],o=a-(this.inverted?r:0),s=a+(this.inverted?0:r),l=this.ranges[i+t],u=this.ranges[i+n];e(o,o+l,s,s+u),r+=u-l}},_F.prototype.invert=function(){return new _F(this.ranges,!this.inverted)},_F.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},_F.offset=function(e){return 0==e?_F.empty:new _F(e<0?[0,-e,0]:[0,0,e])},_F.empty=new _F([]);var fF=function(e,t,n,i){this.maps=e||[],this.from=n||0,this.to=null==i?this.maps.length:i,this.mirror=t};function gF(e){var t=Error.call(this,e);return t.__proto__=gF.prototype,t}fF.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.maps.length),new fF(this.maps,this.mirror,e,t)},fF.prototype.copy=function(){return new fF(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},fF.prototype.appendMap=function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)},fF.prototype.appendMapping=function(e){for(var t=0,n=this.maps.length;t<e.maps.length;t++){var i=e.getMirror(t);this.appendMap(e.maps[t],null!=i&&i<t?n+i:null)}},fF.prototype.getMirror=function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]},fF.prototype.setMirror=function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)},fF.prototype.appendMappingInverted=function(e){for(var t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){var i=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=i&&i>t?n-i-1:null)}},fF.prototype.invert=function(){var e=new fF;return e.appendMappingInverted(this),e},fF.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e},fF.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},fF.prototype._map=function(e,t,n){for(var i=!1,r=this.from;r<this.to;r++){var a=this.maps[r].mapResult(e,t);if(null!=a.recover){var o=this.getMirror(r);if(null!=o&&o>r&&o<this.to){r=o,e=this.maps[o].recover(a.recover);continue}}a.deleted&&(i=!0),e=a.pos}return n?e:new cF(e,i)},gF.prototype=Object.create(Error.prototype),gF.prototype.constructor=gF,gF.prototype.name="TransformError";var hF=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new fF},pF={before:{configurable:!0},docChanged:{configurable:!0}};function mF(){throw new Error("Override me")}pF.before.get=function(){return this.docs.length?this.docs[0]:this.doc},hF.prototype.step=function(e){var t=this.maybeStep(e);if(t.failed)throw new gF(t.failed);return this},hF.prototype.maybeStep=function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t},pF.docChanged.get=function(){return this.steps.length>0},hF.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(hF.prototype,pF);var FF=Object.create(null),bF=function(){};bF.prototype.apply=function(e){return mF()},bF.prototype.getMap=function(){return _F.empty},bF.prototype.invert=function(e){return mF()},bF.prototype.map=function(e){return mF()},bF.prototype.merge=function(e){return null},bF.prototype.toJSON=function(){return mF()},bF.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=FF[t.stepType];if(!n)throw new RangeError("No step type "+t.stepType+" defined");return n.fromJSON(e,t)},bF.jsonID=function(e,t){if(e in FF)throw new RangeError("Duplicate use of step JSON ID "+e);return FF[e]=t,t.prototype.jsonID=e,t};var yF=function(e,t){this.doc=e,this.failed=t};yF.ok=function(e){return new yF(e,null)},yF.fail=function(e){return new yF(null,e)},yF.fromReplace=function(e,t,n,i){try{return yF.ok(e.replace(t,n,i))}catch(e){if(e instanceof pm)return yF.fail(e.message);throw e}};var EF=function(e){function t(t,n,i,r){e.call(this),this.from=t,this.to=n,this.slice=i,this.structure=!!r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&kF(e,this.from,this.to)?yF.fail("Structure replace would overwrite content"):yF.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new _F([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted?null:new t(n.pos,Math.max(n.pos,i.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var n=this.slice.size+e.slice.size==0?mm.empty:new mm(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}var i=this.slice.size+e.slice.size==0?mm.empty:new mm(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),i,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,mm.fromJSON(e,n.slice),!!n.structure)},t}(bF);bF.jsonID("replace",EF);var vF=function(e){function t(t,n,i,r,a,o,s){e.call(this),this.from=t,this.to=n,this.gapFrom=i,this.gapTo=r,this.slice=a,this.insert=o,this.structure=!!s}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&(kF(e,this.from,this.gapFrom)||kF(e,this.gapTo,this.to)))return yF.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return yF.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?yF.fromReplace(e,this.from,this.to,n):yF.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new _F([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),a=e.map(this.gapTo,1);return n.deleted&&i.deleted||r<n.pos||a>i.pos?null:new t(n.pos,i.pos,r,a,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,mm.fromJSON(e,n.slice),n.insert,!!n.structure)},t}(bF);function kF(e,t,n){for(var i=e.resolve(t),r=n-t,a=i.depth;r>0&&a>0&&i.indexAfter(a)==i.node(a).childCount;)a--,r--;if(r>0)for(var o=i.node(a).maybeChild(i.indexAfter(a));r>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,r--}return!1}function DF(e,t,n){for(var i=[],r=0;r<e.childCount;r++){var a=e.child(r);a.content.size&&(a=a.copy(DF(a.content,t,a))),a.isInline&&(a=t(a,n,r)),i.push(a)}return dm.fromArray(i)}bF.jsonID("replaceAround",vF),hF.prototype.lift=function(e,t){for(var n=e.$from,i=e.$to,r=e.depth,a=n.before(r+1),o=i.after(r+1),s=a,l=o,u=dm.empty,d=0,c=r,_=!1;c>t;c--)_||n.index(c)>0?(_=!0,u=dm.from(n.node(c).copy(u)),d++):s--;for(var f=dm.empty,g=0,h=r,p=!1;h>t;h--)p||i.after(h+1)<i.end(h)?(p=!0,f=dm.from(i.node(h).copy(f)),g++):l++;return this.step(new vF(s,l,a,o,new mm(u.append(f),d,g),u.size-d,!0))},hF.prototype.wrap=function(e,t){for(var n=dm.empty,i=t.length-1;i>=0;i--)n=dm.from(t[i].type.create(t[i].attrs,n));var r=e.start,a=e.end;return this.step(new vF(r,a,r,a,new mm(n,0,0),t.length,!0))},hF.prototype.setBlockType=function(e,t,n,i){var r=this;if(void 0===t&&(t=e),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var a=this.steps.length;return this.doc.nodesBetween(e,t,(function(e,t){if(e.isTextblock&&!e.hasMarkup(n,i)&&function(e,t,n){var i=e.resolve(t),r=i.index();return i.parent.canReplaceWith(r,r+1,n)}(r.doc,r.mapping.slice(a).map(t),n)){r.clearIncompatible(r.mapping.slice(a).map(t,1),n);var o=r.mapping.slice(a),s=o.map(t,1),l=o.map(t+e.nodeSize,1);return r.step(new vF(s,l,s+1,l-1,new mm(dm.from(n.create(i,null,e.marks)),0,0),1,!0)),!1}})),this},hF.prototype.setNodeMarkup=function(e,t,n,i){var r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at given position");t||(t=r.type);var a=t.create(n,null,i||r.marks);if(r.isLeaf)return this.replaceWith(e,e+r.nodeSize,a);if(!t.validContent(r.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new vF(e,e+r.nodeSize,e+1,e+r.nodeSize-1,new mm(dm.from(a),0,0),1,!0))},hF.prototype.split=function(e,t,n){void 0===t&&(t=1);for(var i=this.doc.resolve(e),r=dm.empty,a=dm.empty,o=i.depth,s=i.depth-t,l=t-1;o>s;o--,l--){r=dm.from(i.node(o).copy(r));var u=n&&n[l];a=dm.from(u?u.type.create(u.attrs,a):i.node(o).copy(a))}return this.step(new EF(e,e,new mm(r.append(a),t,t),!0))},hF.prototype.join=function(e,t){void 0===t&&(t=1);var n=new EF(e-t,e+t,mm.empty,!0);return this.step(n)};var CF=function(e){function t(t,n,i){e.call(this),this.from=t,this.to=n,this.mark=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),i=e.resolve(this.from),r=i.node(i.sharedDepth(this.to)),a=new mm(DF(n.content,(function(e,n){return e.isAtom&&n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),r),n.openStart,n.openEnd);return yF.fromReplace(e,this.from,this.to,a)},t.prototype.invert=function(){return new wF(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new t(n.pos,i.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(bF);bF.jsonID("addMark",CF);var wF=function(e){function t(t,n,i){e.call(this),this.from=t,this.to=n,this.mark=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),i=new mm(DF(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))})),n.openStart,n.openEnd);return yF.fromReplace(e,this.from,this.to,i)},t.prototype.invert=function(){return new CF(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new t(n.pos,i.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(bF);function SF(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}bF.jsonID("removeMark",wF),hF.prototype.addMark=function(e,t,n){var i=this,r=[],a=[],o=null,s=null;return this.doc.nodesBetween(e,t,(function(i,l,u){if(i.isInline){var d=i.marks;if(!n.isInSet(d)&&u.type.allowsMarkType(n.type)){for(var c=Math.max(l,e),_=Math.min(l+i.nodeSize,t),f=n.addToSet(d),g=0;g<d.length;g++)d[g].isInSet(f)||(o&&o.to==c&&o.mark.eq(d[g])?o.to=_:r.push(o=new wF(c,_,d[g])));s&&s.to==c?s.to=_:a.push(s=new CF(c,_,n))}}})),r.forEach((function(e){return i.step(e)})),a.forEach((function(e){return i.step(e)})),this},hF.prototype.removeMark=function(e,t,n){var i=this;void 0===n&&(n=null);var r=[],a=0;return this.doc.nodesBetween(e,t,(function(i,o){if(i.isInline){a++;var s=null;if(n instanceof eF)for(var l,u=i.marks;l=n.isInSet(u);)(s||(s=[])).push(l),u=l.removeFromSet(u);else n?n.isInSet(i.marks)&&(s=[n]):s=i.marks;if(s&&s.length)for(var d=Math.min(o+i.nodeSize,t),c=0;c<s.length;c++){for(var _=s[c],f=void 0,g=0;g<r.length;g++){var h=r[g];h.step==a-1&&_.eq(r[g].style)&&(f=h)}f?(f.to=d,f.step=a):r.push({style:_,from:Math.max(o,e),to:d,step:a})}}})),r.forEach((function(e){return i.step(new wF(e.from,e.to,e.style))})),this},hF.prototype.clearIncompatible=function(e,t,n){void 0===n&&(n=t.contentMatch);for(var i=this.doc.nodeAt(e),r=[],a=e+1,o=0;o<i.childCount;o++){var s=i.child(o),l=a+s.nodeSize,u=n.matchType(s.type,s.attrs);if(u){n=u;for(var d=0;d<s.marks.length;d++)t.allowsMarkType(s.marks[d].type)||this.step(new wF(a,l,s.marks[d]))}else r.push(new EF(a,l,mm.empty));a=l}if(!n.validEnd){var c=n.fillBefore(dm.empty,!0);this.replace(a,a,new mm(c,0,0))}for(var _=r.length-1;_>=0;_--)this.step(r[_]);return this},hF.prototype.replace=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=mm.empty);var i=function(e,t,n,i){if(void 0===n&&(n=t),void 0===i&&(i=mm.empty),t==n&&!i.size)return null;var r=e.resolve(t),a=e.resolve(n);return SF(r,a,i)?new EF(t,n,i):new OF(r,a,i).fit()}(this.doc,e,t,n);return i&&this.step(i),this},hF.prototype.replaceWith=function(e,t,n){return this.replace(e,t,new mm(dm.from(n),0,0))},hF.prototype.delete=function(e,t){return this.replace(e,t,mm.empty)},hF.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var OF=function(e,t,n){this.$to=t,this.$from=e,this.unplaced=n,this.frontier=[];for(var i=0;i<=e.depth;i++){var r=e.node(i);this.frontier.push({type:r.type,match:r.contentMatchAt(e.indexAfter(i))})}this.placed=dm.empty;for(var a=e.depth;a>0;a--)this.placed=dm.from(e.node(a).copy(this.placed))},xF={depth:{configurable:!0}};function TF(e,t,n){return 0==t?e.cutByIndex(n):e.replaceChild(0,e.firstChild.copy(TF(e.firstChild.content,t-1,n)))}function NF(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(NF(e.lastChild.content,t-1,n)))}function AF(e,t){for(var n=0;n<t;n++)e=e.firstChild.content;return e}function MF(e,t,n){if(t<=0)return e;var i=e.content;return t>1&&(i=i.replaceChild(0,MF(i.firstChild,t-1,1==i.childCount?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(dm.empty,!0)))),e.copy(i)}function RF(e,t,n,i,r){var a=e.node(t),o=r?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;var s=i.fillBefore(a.content,!0,o);return s&&!function(e,t,n){for(var i=n;i<t.childCount;i++)if(!e.allowsMarks(t.child(i).marks))return!0;return!1}(n,a.content,o)?s:null}function IF(e,t,n,i,r){if(t<n){var a=e.firstChild;e=e.replaceChild(0,a.copy(IF(a.content,t+1,n,i,a)))}if(t>i){var o=r.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(dm.empty,!0))}return e}function LF(e,t){for(var n=[],i=Math.min(e.depth,t.depth);i>=0;i--){var r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}xF.depth.get=function(){return this.frontier.length-1},OF.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,r=this.close(t<0?this.$to:i.doc.resolve(t));if(!r)return null;for(var a=this.placed,o=i.depth,s=r.depth;o&&s&&1==a.childCount;)a=a.firstChild.content,o--,s--;var l=new mm(a,o,s);return t>-1?new vF(i.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||i.pos!=this.$to.pos?new EF(i.pos,r.pos,l):void 0},OF.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var n=void 0,i=(t?(n=AF(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,r=this.depth;r>=0;r--){var a=this.frontier[r],o=a.type,s=a.match,l=void 0,u=void 0;if(1==e&&(i?s.matchType(i.type)||(u=s.fillBefore(dm.from(i),!1)):o.compatibleContent(n.type)))return{sliceDepth:t,frontierDepth:r,parent:n,inject:u};if(2==e&&i&&(l=s.findWrapping(i.type)))return{sliceDepth:t,frontierDepth:r,parent:n,wrap:l};if(n&&s.matchType(n.type))break}},OF.prototype.openMore=function(){var e=this.unplaced,t=e.content,n=e.openStart,i=e.openEnd,r=AF(t,n);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new mm(t,n+1,Math.max(i,r.size+n>=t.size-i?n+1:0)),!0)},OF.prototype.dropNode=function(){var e=this.unplaced,t=e.content,n=e.openStart,i=e.openEnd,r=AF(t,n);if(r.childCount<=1&&n>0){var a=t.size-n<=n+r.size;this.unplaced=new mm(TF(t,n-1,1),n-1,a?n-1:i)}else this.unplaced=new mm(TF(t,n,1),n,i)},OF.prototype.placeNodes=function(e){for(var t=e.sliceDepth,n=e.frontierDepth,i=e.parent,r=e.inject,a=e.wrap;this.depth>n;)this.closeFrontierNode();if(a)for(var o=0;o<a.length;o++)this.openFrontierNode(a[o]);var s=this.unplaced,l=i?i.content:s.content,u=s.openStart-t,d=0,c=[],_=this.frontier[n],f=_.match,g=_.type;if(r){for(var h=0;h<r.childCount;h++)c.push(r.child(h));f=f.matchFragment(r)}for(var p=l.size+t-(s.content.size-s.openEnd);d<l.childCount;){var m=l.child(d),F=f.matchType(m.type);if(!F)break;(++d>1||0==u||m.content.size)&&(f=F,c.push(MF(m.mark(g.allowedMarks(m.marks)),1==d?u:0,d==l.childCount?p:-1)))}var b=d==l.childCount;b||(p=-1),this.placed=NF(this.placed,n,dm.from(c)),this.frontier[n].match=f,b&&p<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var y=0,E=l;y<p;y++){var v=E.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),E=v.content}this.unplaced=b?0==t?mm.empty:new mm(TF(s.content,t-1,1),t-1,p<0?s.openEnd:t-1):new mm(TF(s.content,t,d),s.openStart,s.openEnd)},OF.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock||this.$to.end()==this.$to.pos)return-1;var e,t=this.frontier[this.depth];if(!t.type.isTextblock||!RF(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;for(var n=this.$to.depth,i=this.$to.after(n);n>1&&i==this.$to.end(--n);)++i;return i},OF.prototype.findCloseLevel=function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],i=n.match,r=n.type,a=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=RF(e,t,r,i,a);if(o){for(var s=t-1;s>=0;s--){var l=this.frontier[s],u=l.match,d=RF(e,s,l.type,u,!0);if(!d||d.childCount)continue e}return{depth:t,fit:o,move:a?e.doc.resolve(e.after(t+1)):e}}}},OF.prototype.close=function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=NF(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var i=e.node(n),r=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,r)}return e},OF.prototype.openFrontierNode=function(e,t,n){var i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=NF(this.placed,this.depth,dm.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})},OF.prototype.closeFrontierNode=function(){var e=this.frontier.pop().match.fillBefore(dm.empty,!0);e.childCount&&(this.placed=NF(this.placed,this.frontier.length,e))},Object.defineProperties(OF.prototype,xF),hF.prototype.replaceRange=function(e,t,n){if(!n.size)return this.deleteRange(e,t);var i=this.doc.resolve(e),r=this.doc.resolve(t);if(SF(i,r,n))return this.step(new EF(e,t,n));var a=LF(i,this.doc.resolve(t));0==a[a.length-1]&&a.pop();var o=-(i.depth+1);a.unshift(o);for(var s=i.depth,l=i.pos-1;s>0;s--,l--){var u=i.node(s).type.spec;if(u.defining||u.isolating)break;a.indexOf(s)>-1?o=s:i.before(s)==l&&a.splice(1,0,-s)}for(var d=a.indexOf(o),c=[],_=n.openStart,f=n.content,g=0;;g++){var h=f.firstChild;if(c.push(h),g==n.openStart)break;f=h.content}_>0&&c[_-1].type.spec.defining&&i.node(d).type!=c[_-1].type?_-=1:_>=2&&c[_-1].isTextblock&&c[_-2].type.spec.defining&&i.node(d).type!=c[_-2].type&&(_-=2);for(var p=n.openStart;p>=0;p--){var m=(p+_+1)%(n.openStart+1),F=c[m];if(F)for(var b=0;b<a.length;b++){var y=a[(b+d)%a.length],E=!0;y<0&&(E=!1,y=-y);var v=i.node(y-1),k=i.index(y-1);if(v.canReplaceWith(k,k,F.type,F.marks))return this.replace(i.before(y),E?r.after(y):t,new mm(IF(n.content,0,n.openStart,m),m,n.openEnd))}}for(var D=this.steps.length,C=a.length-1;C>=0&&(this.replace(e,t,n),!(this.steps.length>D));C--){var w=a[C];w<0||(e=i.before(w),t=r.after(w))}return this},hF.prototype.replaceRangeWith=function(e,t,n){if(!n.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var i=function(e,t,n){var i=e.resolve(t);if(i.parent.canReplaceWith(i.index(),i.index(),n))return t;if(0==i.parentOffset)for(var r=i.depth-1;r>=0;r--){var a=i.index(r);if(i.node(r).canReplaceWith(a,a,n))return i.before(r+1);if(a>0)return null}if(i.parentOffset==i.parent.content.size)for(var o=i.depth-1;o>=0;o--){var s=i.indexAfter(o);if(i.node(o).canReplaceWith(s,s,n))return i.after(o+1);if(s<i.node(o).childCount)return null}}(this.doc,e,n.type);null!=i&&(e=t=i)}return this.replaceRange(e,t,new mm(dm.from(n),0,0))},hF.prototype.deleteRange=function(e,t){for(var n=this.doc.resolve(e),i=this.doc.resolve(t),r=LF(n,i),a=0;a<r.length;a++){var o=r[a],s=a==r.length-1;if(s&&0==o||n.node(o).type.contentMatch.validEnd)return this.delete(n.start(o),i.end(o));if(o>0&&(s||n.node(o-1).canReplace(n.index(o-1),i.indexAfter(o-1))))return this.delete(n.before(o),i.after(o))}for(var l=1;l<=n.depth&&l<=i.depth;l++)if(e-n.start(l)==n.depth-l&&t>n.end(l)&&i.end(l)-t!=i.depth-l)return this.delete(n.before(l),t);return this.delete(e,t)};var BF=Object.create(null),PF=function(e,t,n){this.ranges=n||[new qF(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},jF={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};jF.anchor.get=function(){return this.$anchor.pos},jF.head.get=function(){return this.$head.pos},jF.from.get=function(){return this.$from.pos},jF.to.get=function(){return this.$to.pos},jF.$from.get=function(){return this.ranges[0].$from},jF.$to.get=function(){return this.ranges[0].$to},jF.empty.get=function(){for(var e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0},PF.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},PF.prototype.replace=function(e,t){void 0===t&&(t=mm.empty);for(var n=t.content.lastChild,i=null,r=0;r<t.openEnd;r++)i=n,n=n.lastChild;for(var a=e.steps.length,o=this.ranges,s=0;s<o.length;s++){var l=o[s],u=l.$from,d=l.$to,c=e.mapping.slice(a);e.replaceRange(c.map(u.pos),c.map(d.pos),s?mm.empty:t),0==s&&$F(e,a,(n?n.isInline:i&&i.isTextblock)?-1:1)}},PF.prototype.replaceWith=function(e,t){for(var n=e.steps.length,i=this.ranges,r=0;r<i.length;r++){var a=i[r],o=a.$from,s=a.$to,l=e.mapping.slice(n),u=l.map(o.pos),d=l.map(s.pos);r?e.deleteRange(u,d):(e.replaceRangeWith(u,d,t),$F(e,n,t.isInline?-1:1))}},PF.findFrom=function(e,t,n){var i=e.parent.inlineContent?new UF(e):VF(e.node(0),e.parent,e.pos,e.index(),t,n);if(i)return i;for(var r=e.depth-1;r>=0;r--){var a=t<0?VF(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):VF(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(a)return a}},PF.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new GF(e.node(0))},PF.atStart=function(e){return VF(e,e,0,0,1)||new GF(e)},PF.atEnd=function(e){return VF(e,e,e.content.size,e.childCount,-1)||new GF(e)},PF.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=BF[t.type];if(!n)throw new RangeError("No selection type "+t.type+" defined");return n.fromJSON(e,t)},PF.jsonID=function(e,t){if(e in BF)throw new RangeError("Duplicate use of selection JSON ID "+e);return BF[e]=t,t.prototype.jsonID=e,t},PF.prototype.getBookmark=function(){return UF.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(PF.prototype,jF),PF.prototype.visible=!0;var qF=function(e,t){this.$from=e,this.$to=t},UF=function(e){function t(t,n){void 0===n&&(n=t),e.call(this,t,n)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(n,i){var r=n.resolve(i.map(this.head));if(!r.parent.inlineContent)return e.near(r);var a=n.resolve(i.map(this.anchor));return new t(a.parent.inlineContent?a:r,r)},t.prototype.replace=function(t,n){if(void 0===n&&(n=mm.empty),e.prototype.replace.call(this,t,n),n==mm.empty){var i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new zF(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,t,n){void 0===n&&(n=t);var i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))},t.between=function(n,i,r){var a=n.pos-i.pos;if(r&&!a||(r=a>=0?1:-1),!i.parent.inlineContent){var o=e.findFrom(i,r,!0)||e.findFrom(i,-r,!0);if(!o)return e.near(i,r);i=o.$head}return n.parent.inlineContent||(0==a||(n=(e.findFrom(n,-r,!0)||e.findFrom(n,r,!0)).$anchor).pos<i.pos!=a<0)&&(n=i),new t(n,i)},Object.defineProperties(t.prototype,n),t}(PF);PF.jsonID("text",UF);var zF=function(e,t){this.anchor=e,this.head=t};zF.prototype.map=function(e){return new zF(e.map(this.anchor),e.map(this.head))},zF.prototype.resolve=function(e){return UF.between(e.resolve(this.anchor),e.resolve(this.head))};var HF=function(e){function t(t){var n=t.nodeAfter,i=t.node(0).resolve(t.pos+n.nodeSize);e.call(this,t,i),this.node=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,i){var r=i.mapResult(this.anchor),a=r.deleted,o=r.pos,s=n.resolve(o);return a?e.near(s):new t(s)},t.prototype.content=function(){return new mm(dm.from(this.node),0,0)},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor},t.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},t.prototype.getBookmark=function(){return new WF(this.anchor)},t.fromJSON=function(e,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(n.anchor))},t.create=function(e,t){return new this(e.resolve(t))},t.isSelectable=function(e){return!e.isText&&!1!==e.type.spec.selectable},t}(PF);HF.prototype.visible=!1,PF.jsonID("node",HF);var WF=function(e){this.anchor=e};WF.prototype.map=function(e){var t=e.mapResult(this.anchor),n=t.deleted,i=t.pos;return n?new zF(i,i):new WF(i)},WF.prototype.resolve=function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&HF.isSelectable(n)?new HF(t):PF.near(t)};var GF=function(e){function t(t){e.call(this,t.resolve(0),t.resolve(t.content.size))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.replace=function(t,n){if(void 0===n&&(n=mm.empty),n==mm.empty){t.delete(0,t.doc.content.size);var i=e.atStart(t.doc);i.eq(t.selection)||t.setSelection(i)}else e.prototype.replace.call(this,t,n)},t.prototype.toJSON=function(){return{type:"all"}},t.fromJSON=function(e){return new t(e)},t.prototype.map=function(e){return new t(e)},t.prototype.eq=function(e){return e instanceof t},t.prototype.getBookmark=function(){return YF},t}(PF);PF.jsonID("all",GF);var YF={map:function(){return this},resolve:function(e){return new GF(e)}};function VF(e,t,n,i,r,a){if(t.inlineContent)return UF.create(e,n);for(var o=i-(r>0?0:1);r>0?o<t.childCount:o>=0;o+=r){var s=t.child(o);if(s.isAtom){if(!a&&HF.isSelectable(s))return HF.create(e,n-(r<0?s.nodeSize:0))}else{var l=VF(e,s,n+r,r<0?s.childCount:0,r,a);if(l)return l}n+=s.nodeSize*r}}function $F(e,t,n){var i=e.steps.length-1;if(!(i<t)){var r,a=e.steps[i];if(a instanceof EF||a instanceof vF)e.mapping.maps[i].forEach((function(e,t,n,i){null==r&&(r=i)})),e.setSelection(PF.near(e.doc.resolve(r),n))}}var KF=function(e){function t(t){e.call(this,t.doc),this.time=Date.now(),this.curSelection=t.selection,this.curSelectionFor=0,this.storedMarks=t.storedMarks,this.updated=0,this.meta=Object.create(null)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return n.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},t.prototype.setSelection=function(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},n.selectionSet.get=function(){return(1&this.updated)>0},t.prototype.setStoredMarks=function(e){return this.storedMarks=e,this.updated|=2,this},t.prototype.ensureMarks=function(e){return hm.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this},t.prototype.addStoredMark=function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,n){e.prototype.addStep.call(this,t,n),this.updated=-3&this.updated,this.storedMarks=null},t.prototype.setTime=function(e){return this.time=e,this},t.prototype.replaceSelection=function(e){return this.selection.replace(this,e),this},t.prototype.replaceSelectionWith=function(e,t){var n=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||hm.none))),n.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,n){void 0===n&&(n=t);var i=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,n);var r=this.storedMarks;if(!r){var a=this.doc.resolve(t);r=n==t?a.marks():a.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,r)),this.selection.empty||this.setSelection(PF.near(this.selection.$to)),this},t.prototype.setMeta=function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this},t.prototype.getMeta=function(e){return this.meta["string"==typeof e?e:e.key]},n.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,n),t}(hF);function QF(e,t){return t&&e?e.bind(t):e}var ZF=function(e,t,n){this.name=e,this.init=QF(t.init,n),this.apply=QF(t.apply,n)},XF=[new ZF("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new ZF("selection",{init:function(e,t){return e.selection||PF.atStart(t.doc)},apply:function(e){return e.selection}}),new ZF("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new ZF("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],JF=function(e,t){var n=this;this.schema=e,this.fields=XF.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach((function(e){if(n.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");n.plugins.push(e),n.pluginsByKey[e.key]=e,e.spec.state&&n.fields.push(new ZF(e.key,e.spec.state,e))}))},eb=function(e){this.config=e},tb={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};tb.schema.get=function(){return this.config.schema},tb.plugins.get=function(){return this.config.plugins},eb.prototype.apply=function(e){return this.applyTransaction(e).state},eb.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=t){var i=this.config.plugins[n];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0},eb.prototype.applyTransaction=function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],n=this.applyInner(e),i=null;;){for(var r=!1,a=0;a<this.config.plugins.length;a++){var o=this.config.plugins[a];if(o.spec.appendTransaction){var s=i?i[a].n:0,l=i?i[a].state:this,u=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,l,n);if(u&&n.filterTransaction(u,a)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(var d=0;d<this.config.plugins.length;d++)i.push(d<a?{state:n,n:t.length}:{state:this,n:0})}t.push(u),n=n.applyInner(u),r=!0}i&&(i[a]={state:n,n:t.length})}}if(!r)return{state:n,transactions:t}}},eb.prototype.applyInner=function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var t=new eb(this.config),n=this.config.fields,i=0;i<n.length;i++){var r=n[i];t[r.name]=r.apply(e,this[r.name],this,t)}for(var a=0;a<nb.length;a++)nb[a](this,e,t);return t},tb.tr.get=function(){return new KF(this)},eb.create=function(e){for(var t=new JF(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new eb(t),i=0;i<t.fields.length;i++)n[t.fields[i].name]=t.fields[i].init(e,n);return n},eb.prototype.reconfigure=function(e){for(var t=new JF(this.schema,e.plugins),n=t.fields,i=new eb(t),r=0;r<n.length;r++){var a=n[r].name;i[a]=this.hasOwnProperty(a)?this[a]:n[r].init(e,i)}return i},eb.prototype.toJSON=function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((function(e){return e.toJSON()}))),e&&"object"==typeof e)for(var n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var i=e[n],r=i.spec.state;r&&r.toJSON&&(t[n]=r.toJSON.call(i,this[i.key]))}return t},eb.fromJSON=function(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var i=new JF(e.schema,e.plugins),r=new eb(i);return i.fields.forEach((function(i){if("doc"==i.name)r.doc=Rm.fromJSON(e.schema,t.doc);else if("selection"==i.name)r.selection=PF.fromJSON(r.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(r.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(var a in n){var o=n[a],s=o.spec.state;if(o.key==i.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(t,a))return void(r[i.name]=s.fromJSON.call(o,e,t[a],r))}r[i.name]=i.init(e,r)}})),r},eb.addApplyListener=function(e){nb.push(e)},eb.removeApplyListener=function(e){var t=nb.indexOf(e);t>-1&&nb.splice(t,1)},Object.defineProperties(eb.prototype,tb);var nb=[];var ib=function(e){this.props={},e.props&&function e(t,n,i){for(var r in t){var a=t[r];a instanceof Function?a=a.bind(n):"handleDOMEvents"==r&&(a=e(a,n,{})),i[r]=a}return i}(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:ab("plugin")};ib.prototype.getState=function(e){return e[this.key]};var rb=Object.create(null);function ab(e){return e in rb?e+"$"+ ++rb[e]:(rb[e]=0,e+"$")}var ob=function(e){void 0===e&&(e="key"),this.key=ab(e)};ob.prototype.get=function(e){return e.config.pluginsByKey[this.key]},ob.prototype.getState=function(e){return e[this.key]};const sb=ma.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize"}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){return t.textBetween(0,t.content.size,void 0," ").length}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;return t.textBetween(0,t.content.size," "," ").split(" ").filter(e=>""!==e).length}},addProseMirrorPlugins(){return[new ib({key:new ob("characterCount"),filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const i=this.storage.characters({node:t.doc}),r=this.storage.characters({node:e.doc});if(r<=n)return!0;if(i>n&&r>n&&r<=i)return!0;if(i>n&&r>n&&r>i)return!1;if(!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,o=a-(r-n),s=a;e.deleteRange(o,s);return!(this.storage.characters({node:e.doc})>n)}})]}});var lb=n(53);const ub=fs.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",rs(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[ys({find:e=>Object(lb.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 Mt({key:new Lt("handleClickLink"),props:{handleClick:(e,t,n)=>{var i;const r=this.editor.getAttributes("link");return!(!(null===(i=n.target)||void 0===i?void 0:i.closest("a"))||!r.href)&&(window.open(r.href,r.target),!0)}}})),this.options.linkOnPaste&&e.push(new Mt({key:new Lt("handlePasteLink"),props:{handlePaste:(e,t,n)=>{const{state:i}=e,{selection:r}=i,{empty:a}=r;if(a)return!1;let o="";n.content.forEach(e=>{o+=e.textContent});const s=Object(lb.find)(o).find(e=>e.isLink&&e.value===o);return!(!o||!s)&&(this.editor.commands.setMark(this.type,{href:s.href}),!0)}}})),e}}),db=fs.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",rs(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=po(e,this.type);return!!Object.entries(n).some(([,e])=>!!e)||t.unsetMark("textStyle")}}}}),cb=ma.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 _b=_s.create({name:"doc",topNode:!0,content:"block+"}).extend({content:"root",addProseMirrorPlugins:function(){var e=this.editor;return[new Mt({key:new Lt("eventHandler"),props:{handleClick:function(t,n){var i=t.state,r=i.doc.lastChild,a=i.doc.resolve(n).nodeBefore;if(r&&a){var o=r.eq(a),s=r.isInline,l=["paragraph","text"].includes(r.type.name);!o||s||l||e.commands.insertContentAt(n,{type:"paragraph",content:""})}}}})]}}),fb=ip.extend({name:"title",defining:!0,addAttributes:function(){return{level:{default:1,rendered:!1}}},parseHTML:function(){return[{tag:"h1"}]},renderHTML:function(e){e.node;var t=e.HTMLAttributes;return["h1",rs(this.options.HTMLAttributes,t),0]}});const gb=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/,hb=_s.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",rs(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[gs({find:gb,type:this.type,getAttributes:e=>{const[,,t,n,i]=e;return{src:n,alt:t,title:i}}})]}});function pb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function mb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pb(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Fb=hb.extend({name:"image",addAttributes:function(){return mb(mb({},hb.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 i,r,a,o=n.tr,s=n.commands;return"image"==(null===(i=o.selection)||void 0===i||null===(r=i.node)||void 0===r||null===(a=r.type)||void 0===a?void 0:a.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",rs(this.options.HTMLAttributes,n)]}});const bb=fs.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",rs(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()}}});var yb=function(e){var t=e.wrapperRef,n=e.index;if(t.current&&!(n>=t.current.children.length)){var i=t.current,r=i.children[n],a=r.clientHeight+8,o=i.scrollTop;r.offsetTop+a>o+i.clientHeight?o=r.offsetTop-i.clientHeight+a:o>r.offsetTop&&(o=r.offsetTop-8),t.current.scrollTop=o}};function Eb(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,i=m_()(e);if(t){var r=m_()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return h_()(this,n)}}var vb=function(e){f_()(n,e);var t=Eb(n);function n(e){var i;return s_()(this,n),i=t.call(this,e),c()(c_()(i),"onKeyDown",(function(e){var t=e.event;return"ArrowUp"===t.key?(i.upHandler(),!0):"ArrowDown"===t.key?(i.downHandler(),!0):"Enter"===t.key&&(i.enterHandler(),!0)})),c()(c_()(i),"upHandler",(function(){i.setState({selectedIndex:(i.state.selectedIndex+i.props.items.length-1)%i.props.items.length})})),c()(c_()(i),"downHandler",(function(){i.setState({selectedIndex:(i.state.selectedIndex+1)%i.props.items.length})})),c()(c_()(i),"enterHandler",(function(){i.selectItem(i.state.selectedIndex)})),c()(c_()(i),"selectItem",(function(e){var t=i.props.items[e];if(t&&od()(t.items)){var n=i.props,r=n.editor,a=n.range;t.command({editor:r,range:a})}})),i.state={selectedIndex:0},i.menuRef=m.a.createRef(),i}return u_()(n,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),yb({wrapperRef:this.menuRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this,t=this.props.items;return m.a.createElement("div",{ref:this.menuRef,className:"neeto-editor-slash-commands__wrapper"},t.map((function(t,i){var r=od()(t.items),a=m.a.createElement(kb,{key:t.title,item:t,index:i,selectedIndex:e.state.selectedIndex,selectItem:function(){return e.selectItem(i)}});return r?a:m.a.createElement(nd,{key:t.title,interactive:!0,placement:"right",hideOnClick:!1,content:m.a.createElement(n,u()({},e.props,{items:t.items})),onCreate:function(e){return e.popper.style.width="max-content"}},a)})))}}]),n}(m.a.Component),kb=Object(p.forwardRef)((function(e,t){var n=e.item,i=e.selectedIndex,r=e.index,a=e.selectItem,o=n.Icon;return m.a.createElement("div",{className:b()("neeto-editor-slash-commands__item",{active:r===i}),onClick:function(){return a(r)},ref:t,"data-cy":"neeto-editor-command-list-item-".concat(r)},o&&m.a.createElement(o,{size:20}),m.a.createElement("div",{className:"neeto-editor-slash-commands__item-content"},m.a.createElement("h5",null,n.title),m.a.createElement("p",null,n.description)))})),Db=vb;const Cb=new Lt("suggestion");function wb({pluginKey:e=Cb,editor:t,char:n="@",allowSpaces:i=!1,prefixSpace:r=!0,startOfLine:a=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:d=(()=>({})),allow:c=(()=>!0)}){const _=null==d?void 0:d();return new Mt({key:e,view(){return{update:async(e,n)=>{var i,r,a,o,s;const d=null===(i=this.key)||void 0===i?void 0:i.getState(n),c=null===(r=this.key)||void 0===r?void 0:r.getState(e.state),f=d.active&&c.active&&d.range.from!==c.range.from,g=!d.active&&c.active,h=d.active&&!c.active,p=g||f,m=!g&&!h&&d.query!==c.query&&!f,F=h||f;if(!p&&!m&&!F)return;const b=F&&!p?d:c,y=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),E={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.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};F&&(null===(a=null==_?void 0:_.onExit)||void 0===a||a.call(_,E)),m&&(null===(o=null==_?void 0:_.onUpdate)||void 0===o||o.call(_,E)),p&&(null===(s=null==_?void 0:_.onStart)||void 0===s||s.call(_,E))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from:d}=l,_={...o};if(_.composing=s,u||t.view.composing){!(d<o.range.from||d>o.range.to)||s||o.composing||(_.active=!1);const e=function(e){const{char:t,allowSpaces:n,prefixSpace:i,startOfLine:r,$position:a}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=r?"^":"",u=n?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),d=a.depth<=0?0:a.before(),c=a.pos,_=a.doc.textBetween(d,c,"\0","\0"),f=Array.from(_.matchAll(u)).pop();if(!f||void 0===f.input||void 0===f.index)return null;const g=f.input.slice(Math.max(0,f.index-1),f.index),h=/^[\s\0]?$/.test(g);if(i&&!h)return null;const p=f.index+a.start();let m=p+f[0].length;return n&&s.test(_.slice(m-1,m+1))&&(f[0]+=" ",m+=1),p<a.pos&&m>=a.pos?{range:{from:p,to:m},query:f[0].slice(t.length),text:f[0]}:null}({char:n,allowSpaces:i,prefixSpace:r,startOfLine:a,$position:l.$from}),u="id_"+Math.floor(4294967295*Math.random());e&&c({editor:t,range:e.range})?(_.active=!0,_.decorationId=o.decorationId?o.decorationId:u,_.range=e.range,_.query=e.query,_.text=e.text):_.active=!1}else _.active=!1;return _.active||(_.decorationId=null,_.range={},_.query=null,_.text=null),_}},props:{handleKeyDown(e,t){var n;const{active:i,range:r}=this.getState(e.state);return i&&(null===(n=null==_?void 0:_.onKeyDown)||void 0===n?void 0:n.call(_,{view:e,event:t,range:r}))||!1},decorations(e){const{active:t,range:n,decorationId:i}=this.getState(e);return t?Rr.create(e.doc,[Tr.inline(n.from,n.to,{nodeName:o,class:s,"data-decoration-id":i})]):null}}})}function Sb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ob(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sb(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var xb=new Lt("commands"),Tb=function(e){var t=e.setImageUploadVisible,n=e.mentions,i=e.addonCommands,r=e.options,a=[{title:"Paragraph",description:"Add a plain text block",Icon:Uu.Paragraph,optionName:"font-size",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:Uu.TextH1,optionName:"font-size",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:Uu.TextH2,optionName:"font-size",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:Uu.ListNumber,optionName:"ordered-list",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:Uu.ListDot,optionName:"bullet-list",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleBulletList().run()}},{title:"Blockquote",description:"Add a quote",Icon:Uu.Blockquote,optionName:"block-quote",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleBlockquote().run()}},{title:"Image",description:"Add an image",Icon:Uu.Image,optionName:"image-upload",command:function(e){var n=e.editor,i=e.range;t(!0),n.chain().focus().deleteRange(i).run()}},{title:"Code block",description:"Add a code block with syntax highlighting",Icon:Uu.Code,optionName:"code-block",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).toggleCodeBlock().run()}},{title:"Emoji",description:"Add an emoji",Icon:Uu.Smiley,optionName:"emoji",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).insertContent("::").run()}},{title:"Divider",description:"Add an horizontal line to separate sections",optionName:"divider",Icon:Uu.Minus,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).setHorizontalRule().run()}},{title:"Embed Youtube/Vimeo",description:"Embed a video from major services",Icon:Uu.Video,optionName:"video-embed",command:function(e){var t,n=e.editor,i=e.range,r=prompt("Please enter Youtube/Vimeo embed URL"),a=(t=r.match(zd))&&"https://www.youtube.com/embed/".concat(t[5])||function(e){var t=e.match(Hd);return t&&"https://player.vimeo.com/video/".concat(t[4],"?h=").concat(t[5])}(r);a?n.chain().focus().deleteRange(i).setExternalVideo({src:a}).run():n.chain().focus().deleteRange(i).insertContent("#invalid").run()}}];return od()(n)||a.push({title:"Mention",description:"Mention a user",optionName:"mention",Icon:Uu.Email,command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).insertContent("@").run()}}),od()(r)||(a=a.filter((function(e){var t=e.optionName;return r.includes(t)}))),od()(i)||(a=a.concat(i)),ma.create({addOptions:function(){return{HTMLAttributes:{class:"commands"},suggestion:{char:"/",startOfLine:!1,pluginKey:xb,command:function(e){var t=e.editor,n=e.range;e.props.command({editor:t,range:n})},items:function(e){var t=e.query,n=a.filter((function(e){return e.title.toLowerCase().includes(t.toLowerCase())}));return od()(n)?[{title:"No results",command:function(e){var t=e.editor,n=e.range;t.chain().focus().deleteRange(n).run()}}]:n},render:function(){var e,t;return{onStart:function(n){var i=document.querySelector('[id^="tippy"]');i&&i.remove(),e=new xu(Db,{props:n,editor:n.editor}),t=bu("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1,zIndex:99999})},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&&t[0].destroy(),e&&e.destroy()}}}}}},addProseMirrorPlugins:function(){return[wb(Ob({editor:this.editor},this.options.suggestion))]}})},Nb={};function Ab(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)||Ab(n)})),e}var Mb=Ab,Rb=Ab;Mb.default=Rb;class Ib{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Lb(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Bb(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 Pb=e=>!!e.kind;class jb{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=Lb(e)}openNode(e){if(!Pb(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){Pb(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class qb{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=>{qb._collapse(e)}))}}class Ub extends qb{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 jb(this,this.options).value()}finalize(){return!0}}function zb(e){return e?"string"==typeof e?e:e.source:null}const Hb=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const Wb="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Gb={begin:"\\\\[\\s\\S]",relevance:0},Yb={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[Gb]},Vb={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[Gb]},$b={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/},Kb=function(e,t,n={}){const i=Bb({className:"comment",begin:e,end:t,contains:[]},n);return i.contains.push($b),i.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),i},Qb=Kb("//","$"),Zb=Kb("/\\*","\\*/"),Xb=Kb("#","$"),Jb={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},ey={className:"number",begin:Wb,relevance:0},ty={className:"number",begin:"\\b(0b[01]+)",relevance:0},ny={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},iy={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Gb,{begin:/\[/,end:/\]/,relevance:0,contains:[Gb]}]}]},ry={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},ay={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},oy={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var sy=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:Wb,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>zb(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),Bb({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:Gb,APOS_STRING_MODE:Yb,QUOTE_STRING_MODE:Vb,PHRASAL_WORDS_MODE:$b,COMMENT:Kb,C_LINE_COMMENT_MODE:Qb,C_BLOCK_COMMENT_MODE:Zb,HASH_COMMENT_MODE:Xb,NUMBER_MODE:Jb,C_NUMBER_MODE:ey,BINARY_NUMBER_MODE:ty,CSS_NUMBER_MODE:ny,REGEXP_MODE:iy,TITLE_MODE:ry,UNDERSCORE_TITLE_MODE:ay,METHOD_GUARD:oy,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 ly(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function uy(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=ly,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function dy(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map(e=>zb(e)).join("|")+")"}(...e.illegal))}function cy(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 _y(e,t){void 0===e.relevance&&(e.relevance=1)}const fy=["of","and","for","in","not","or","if","then","parent","list","value"];function gy(e,t){return t?Number(t):function(e){return fy.includes(e.toLowerCase())}(e)?0:1}function hy(e,{plugins:t}){function n(t,n){return new RegExp(zb(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))}class i{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 i=zb(e),r="";for(;i.length>0;){const e=Hb.exec(i);if(!e){r+=i;break}r+=i.substring(0,e.index),i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+String(Number(e[1])+t):(r+=e[0],"("===e[0]&&n++)}return r}).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),i=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,i)}}class r{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 i;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=Bb(e.classNameAliases||{}),function t(i,a){const o=i;if(i.isCompiled)return o;[cy].forEach(e=>e(i,a)),e.compilerExtensions.forEach(e=>e(i,a)),i.__beforeBegin=null,[uy,dy,_y].forEach(e=>e(i,a)),i.isCompiled=!0;let s=null;if("object"==typeof i.keywords&&(s=i.keywords.$pattern,delete i.keywords.$pattern),i.keywords&&(i.keywords=function e(t,n,i="keyword"){const r={};return"string"==typeof t?a(i,t.split(" ")):Array.isArray(t)?a(i,t):Object.keys(t).forEach((function(i){Object.assign(r,e(t[i],n,i))})),r;function a(e,t){n&&(t=t.map(e=>e.toLowerCase())),t.forEach((function(t){const n=t.split("|");r[n[0]]=[e,gy(n[0],n[1])]}))}}(i.keywords,e.case_insensitive)),i.lexemes&&s)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return s=s||i.lexemes||/\w+/,o.keywordPatternRe=n(s,!0),a&&(i.begin||(i.begin=/\B|\b/),o.beginRe=n(i.begin),i.endSameAsBegin&&(i.end=i.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(o.endRe=n(i.end)),o.terminatorEnd=zb(i.end)||"",i.endsWithParent&&a.terminatorEnd&&(o.terminatorEnd+=(i.end?"|":"")+a.terminatorEnd)),i.illegal&&(o.illegalRe=n(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return Bb(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e))return Bb(e,{starts:e.starts?Bb(e.starts):null});if(Object.isFrozen(e))return Bb(e);return e}("self"===e?i:e)}))),i.contains.forEach((function(e){t(e,o)})),i.starts&&t(i.starts,a),o.matcher=function(e){const t=new r;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}(o),o}(e)}function py(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,Lb(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 my={"after:highlightElement":({el:e,result:t,text:n})=>{const i=by(e);if(!i.length)return;const r=document.createElement("div");r.innerHTML=t.value,t.value=function(e,t,n){let i=0,r="";const a=[];function o(){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){r+="<"+Fy(e)+[].map.call(e.attributes,(function(e){return" "+e.nodeName+'="'+Lb(e.value)+'"'})).join("")+">"}function l(e){r+="</"+Fy(e)+">"}function u(e){("start"===e.event?s:l)(e.node)}for(;e.length||t.length;){let t=o();if(r+=Lb(n.substring(i,t[0].offset)),i=t[0].offset,t===e){a.reverse().forEach(l);do{u(t.splice(0,1)[0]),t=o()}while(t===e&&t.length&&t[0].offset===i);a.reverse().forEach(s)}else"start"===t[0].event?a.push(t[0].node):a.pop(),u(t.splice(0,1)[0])}return r+Lb(n.substr(i))}(i,by(r),n)}};function Fy(e){return e.nodeName.toLowerCase()}function by(e){const t=[];return function e(n,i){for(let r=n.firstChild;r;r=r.nextSibling)3===r.nodeType?i+=r.nodeValue.length:1===r.nodeType&&(t.push({event:"start",offset:i,node:r}),i=e(r,i),Fy(r).match(/br|hr|img|input/)||t.push({event:"stop",offset:i,node:r}));return i}(e,0),t}const yy={},Ey=e=>{console.error(e)},vy=(e,...t)=>{console.log("WARN: "+e,...t)},ky=(e,t)=>{yy[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),yy[`${e}/${t}`]=!0)},Dy=Lb,Cy=Bb,wy=Symbol("nomatch");var Sy=function(e){const t=Object.create(null),n=Object.create(null),i=[];let r=!0;const a=/(^(<[^>]+>|\t|)+|\n)/gm,o="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:Ub};function u(e){return l.noHighlightRe.test(e)}function d(e,t,n,i){let r="",a="";"object"==typeof t?(r=e,n=t.ignoreIllegals,a=t.language,i=void 0):(ky("10.7.0","highlight(lang, code, ...args) has been deprecated."),ky("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),a=e,r=t);const o={code:r,language:a};k("before:highlight",o);const s=o.result?o.result:c(o.language,o.code,n,i);return s.code=o.code,k("after:highlight",s),s}function c(e,n,a,s){function u(e,t){const n=b.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,n)&&e.keywords[n]}function d(){null!=k.subLanguage?function(){if(""===w)return;let e=null;if("string"==typeof k.subLanguage){if(!t[k.subLanguage])return void C.addText(w);e=c(k.subLanguage,w,!0,D[k.subLanguage]),D[k.subLanguage]=e.top}else e=_(w,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(S+=e.relevance),C.addSublanguage(e.emitter,e.language)}():function(){if(!k.keywords)return void C.addText(w);let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(w),n="";for(;t;){n+=w.substring(e,t.index);const i=u(k,t);if(i){const[e,r]=i;if(C.addText(n),n="",S+=r,e.startsWith("_"))n+=t[0];else{const n=b.classNameAliases[e]||e;C.addKeyword(t[0],n)}}else n+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(w)}n+=w.substr(e),C.addText(n)}(),w=""}function f(e){return e.className&&C.openNode(b.classNameAliases[e.className]||e.className),k=Object.create(e,{parent:{value:k}}),k}function g(e){return 0===k.matcher.regexIndex?(w+=e[0],1):(T=!0,0)}function h(e){const t=e[0],n=e.rule,i=new Ib(n),r=[n.__beforeBegin,n["on:begin"]];for(const n of r)if(n&&(n(e,i),i.isMatchIgnored))return g(t);return n&&n.endSameAsBegin&&(n.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),n.skip?w+=t:(n.excludeBegin&&(w+=t),d(),n.returnBegin||n.excludeBegin||(w=t)),f(n),n.returnBegin?0:t.length}function p(e){const t=e[0],i=n.substr(e.index),r=function e(t,n,i){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(t.endRe,i);if(r){if(t["on:end"]){const e=new Ib(t);t["on:end"](n,e),e.isMatchIgnored&&(r=!1)}if(r){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,i)}(k,e,i);if(!r)return wy;const a=k;a.skip?w+=t:(a.returnEnd||a.excludeEnd||(w+=t),d(),a.excludeEnd&&(w=t));do{k.className&&C.closeNode(),k.skip||k.subLanguage||(S+=k.relevance),k=k.parent}while(k!==r.parent);return r.starts&&(r.endSameAsBegin&&(r.starts.endRe=r.endRe),f(r.starts)),a.returnEnd?0:t.length}let m={};function F(t,i){const o=i&&i[0];if(w+=t,null==o)return d(),0;if("begin"===m.type&&"end"===i.type&&m.index===i.index&&""===o){if(w+=n.slice(i.index,i.index+1),!r){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=m.rule,t}return 1}if(m=i,"begin"===i.type)return h(i);if("illegal"===i.type&&!a){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(k.className||"<unnamed>")+'"');throw e.mode=k,e}if("end"===i.type){const e=p(i);if(e!==wy)return e}if("illegal"===i.type&&""===o)return 1;if(x>1e5&&x>3*i.index){throw new Error("potential infinite loop, way more iterations than matches")}return w+=o,o.length}const b=y(e);if(!b)throw Ey(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const E=hy(b,{plugins:i});let v="",k=s||E;const D={},C=new l.__emitter(l);!function(){const e=[];for(let t=k;t!==b;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>C.openNode(e))}();let w="",S=0,O=0,x=0,T=!1;try{for(k.matcher.considerAll();;){x++,T?T=!1:k.matcher.considerAll(),k.matcher.lastIndex=O;const e=k.matcher.exec(n);if(!e)break;const t=F(n.substring(O,e.index),e);O=e.index+t}return F(n.substr(O)),C.closeAllNodes(),C.finalize(),v=C.toHTML(),{relevance:Math.floor(S),value:v,language:e,illegal:!1,emitter:C,top:k}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:n.slice(O-100,O+100),mode:t.mode},sofar:v,relevance:0,value:Dy(n),emitter:C};if(r)return{illegal:!1,relevance:0,value:Dy(n),emitter:C,language:e,top:k,errorRaised:t};throw t}}function _(e,n){n=n||l.languages||Object.keys(t);const i=function(e){const t={relevance:0,emitter:new l.__emitter(l),value:Dy(e),illegal:!1,top:s};return t.emitter.addText(e),t}(e),r=n.filter(y).filter(v).map(t=>c(t,e,!1));r.unshift(i);const a=r.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}),[o,u]=a,d=o;return d.second_best=u,d}const f={"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>"))}},g=/^(<[^>]+>|\t)+/gm,h={"after:highlightElement":({result:e})=>{l.tabReplace&&(e.value=e.value.replace(g,e=>e.replace(/\t/g,l.tabReplace)))}};function p(e){let t=null;const i=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||(vy(o.replace("{}",n[1])),vy("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>u(e)||y(e))}(e);if(u(i))return;k("before:highlightElement",{el:e,language:i}),t=e;const r=t.textContent,a=i?d(r,{language:i,ignoreIllegals:!0}):_(r);k("after:highlightElement",{el:e,result:a,text:r}),e.innerHTML=a.value,function(e,t,i){const r=t?n[t]:i;e.classList.add("hljs"),r&&e.classList.add(r)}(e,i,a.language),e.result={language:a.language,re:a.relevance,relavance:a.relevance},a.second_best&&(e.second_best={language:a.second_best.language,re:a.second_best.relevance,relavance:a.second_best.relevance})}const m=()=>{if(m.called)return;m.called=!0,ky("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(p)};let F=!1;function b(){if("loading"===document.readyState)return void(F=!0);document.querySelectorAll("pre code").forEach(p)}function y(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function E(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function v(e){const t=y(e);return t&&!t.disableAutodetect}function k(e,t){const n=e;i.forEach((function(e){e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){F&&b()}),!1),Object.assign(e,{highlight:d,highlightAuto:_,highlightAll:b,fixMarkup:function(e){return ky("10.2.0","fixMarkup will be removed entirely in v11.0"),ky("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),t=e,l.tabReplace||l.useBR?t.replace(a,e=>"\n"===e?l.useBR?"<br>":e:l.tabReplace?e.replace(/\t/g,l.tabReplace):e):t;var t},highlightElement:p,highlightBlock:function(e){return ky("10.7.0","highlightBlock will be removed entirely in v12.0"),ky("10.7.0","Please use highlightElement now."),p(e)},configure:function(e){e.useBR&&(ky("10.3.0","'useBR' will be removed entirely in v11.0"),ky("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),l=Cy(l,e)},initHighlighting:m,initHighlightingOnLoad:function(){ky("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),F=!0},registerLanguage:function(n,i){let a=null;try{a=i(e)}catch(e){if(Ey("Language definition for '{}' could not be registered.".replace("{}",n)),!r)throw e;Ey(e),a=s}a.name||(a.name=n),t[n]=a,a.rawDefinition=i.bind(null,e),a.aliases&&E(a.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:E,requireLanguage:function(e){ky("10.4.0","requireLanguage will be removed entirely in v11."),ky("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:v,inherit:Cy,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),i.push(e)},vuePlugin:py(e).VuePlugin}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString="10.7.3";for(const e in sy)"object"==typeof sy[e]&&Mb(sy[e]);return Object.assign(e,sy),e.addPlugin(f),e.addPlugin(my),e.addPlugin(h),e}({}),Oy={exports:{}};!function(e){!function(){var t;function n(e){for(var t,n,i,r,a=1,o=[].slice.call(arguments),s=0,l=e.length,u="",d=!1,c=!1,_=function(){return o[a++]},f=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],d)switch(d=!1,"."==t?(c=!1,t=e[++s]):"0"==t&&"."==e[s+1]?(c=!0,t=e[s+=2]):c=!0,r=f(),t){case"b":u+=parseInt(_(),10).toString(2);break;case"c":u+="string"==typeof(n=_())||n instanceof String?n:String.fromCharCode(parseInt(n,10));break;case"d":u+=parseInt(_(),10);break;case"f":i=String(parseFloat(_()).toFixed(r||6)),u+=c?i:i.replace(/^0/,"");break;case"j":u+=JSON.stringify(_());break;case"o":u+="0"+parseInt(_(),10).toString(8);break;case"s":u+=_();break;case"x":u+="0x"+parseInt(_(),10).toString(16);break;case"X":u+="0x"+parseInt(_(),10).toString(16).toUpperCase();break;default:u+=t}else"%"===t?d=!0:u+=t;return u}(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))})}()}(Oy);var xy=Oy.exports,Ty=Ay(Error),Ny=Ty;function Ay(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=xy.apply(null,arguments)),new e(t)}}Ty.eval=Ay(EvalError),Ty.range=Ay(RangeError),Ty.reference=Ay(ReferenceError),Ty.syntax=Ay(SyntaxError),Ty.type=Ay(TypeError),Ty.uri=Ay(URIError),Ty.create=Ay;var My=Sy,Ry=Ny;Nb.highlight=Iy,Nb.highlightAuto=function(e,t){var n=t||{},i=n.subset||My.listLanguages();n.prefix;var r,a,o,s,l=i.length,u=-1;if("string"!=typeof e)throw Ry("Expected `string` for value, got `%s`",e);a={relevance:0,language:null,value:[]},r={relevance:0,language:null,value:[]};for(;++u<l;)s=i[u],My.getLanguage(s)&&((o=Iy(s,e,t)).language=s,o.relevance>a.relevance&&(a=o),o.relevance>r.relevance&&(a=r,r=o));a.language&&(r.secondBest=a);return r},Nb.registerLanguage=function(e,t){My.registerLanguage(e,t)},Nb.listLanguages=function(){return My.listLanguages()},Nb.registerAlias=function(e,t){var n,i=e;t&&((i={})[e]=t);for(n in i)My.registerAliases(i[n],{languageName:n})},Ly.prototype.addText=function(e){var t,n,i=this.stack;if(""===e)return;t=i[i.length-1],(n=t.children[t.children.length-1])&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})},Ly.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},Ly.prototype.addSublanguage=function(e,t){var n=this.stack,i=n[n.length-1],r=e.rootNode.children,a=t?{type:"element",tagName:"span",properties:{className:[t]},children:r}:r;i.children=i.children.concat(a)},Ly.prototype.openNode=function(e){var t=this.stack,n=this.options.classPrefix+e,i=t[t.length-1],r={type:"element",tagName:"span",properties:{className:[n]},children:[]};i.children.push(r),t.push(r)},Ly.prototype.closeNode=function(){this.stack.pop()},Ly.prototype.closeAllNodes=By,Ly.prototype.finalize=By,Ly.prototype.toHTML=function(){return""};function Iy(e,t,n){var i,r=My.configure({}),a=(n||{}).prefix;if("string"!=typeof e)throw Ry("Expected `string` for name, got `%s`",e);if(!My.getLanguage(e))throw Ry("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw Ry("Expected `string` for value, got `%s`",t);if(null==a&&(a="hljs-"),My.configure({__emitter:Ly,classPrefix:a}),i=My.highlight(t,{language:e,ignoreIllegals:!0}),My.configure(r||{}),i.errorRaised)throw i.errorRaised;return{relevance:i.relevance,language:i.language,value:i.emitter.rootNode.children}}function Ly(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function By(){}function Py(e){return e.value||e.children||[]}function jy({doc:e,name:t,lowlight:n}){const i=[];return Es(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1;const{language:r}=e.node.attrs,a=n.listLanguages();(function e(t,n=[]){return t.map(t=>{const i=[...n,...t.properties?t.properties.className:[]];return t.children?e(t.children,i):{text:t.value,classes:i}}).flat()})(r&&a.includes(r)?Py(n.highlight(r,e.node.textContent)):Py(n.highlightAuto(e.node.textContent))).forEach(e=>{const n=t+e.text.length;if(e.classes.length){const r=Tr.inline(t,n,{class:e.classes.join(" ")});i.push(r)}t=n})}),Rr.create(e,i)}function qy({name:e,lowlight:t}){return new Mt({key:new Lt("lowlight"),state:{init:(n,{doc:i})=>jy({doc:i,name:e,lowlight:t}),apply:(n,i,r,a)=>{const o=r.selection.$head.parent.type.name,s=a.selection.$head.parent.type.name,l=Es(r.doc,t=>t.type.name===e),u=Es(a.doc,t=>t.type.name===e);return n.docChanged&&([o,s].includes(e)||u.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)))?jy({doc:n.doc,name:e,lowlight:t}):i.map(n.mapping,n.doc)}},props:{decorations(e){return this.getState(e)}}})}const Uy=Gh.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:Nb}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],qy({name:this.name,lowlight:this.options.lowlight})]}});function zy(){return m.a.createElement(Bu,{"data-cy":"neeto-editor-code-block"},m.a.createElement("pre",null,m.a.createElement(Pu,{as:"code"})))}var Hy=n(96),Wy=n.n(Hy),Gy=Uy.extend({addNodeView:function(){return new Mu(zy)}}).configure({lowlight:Wy.a}),Yy=function(e){var t=e.items,n=e.command;return m.a.createElement("div",{className:"neeto-editor-variables-suggestion"},m.a.createElement(Hc,{variables:t,onClickVariable:function(e){var t=e.category_key,i=e.key,r=t?"".concat(t,".").concat(i):i;n({label:r,id:r})}}))};function Vy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function $y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vy(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ky=new Lt("variables"),Qy=_s.create({name:"variable",addOptions:function(){return{HTMLAttributes:{class:"neeto-editor-variable"},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",rs({"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,i=t.state,r=!1,a=i.selection,o=a.empty,s=a.anchor;return!!o&&(i.doc.nodesBetween(s-1,s,(function(t,i){if(t.type.name===e.name)return r=!0,n.insertText("",i,i+t.nodeSize),!1})),r)}))}}},addProseMirrorPlugins:function(){return[wb($y({editor:this.editor},this.options.suggestion))]}}),Zy={char:"{{",startOfLine:!1,pluginKey:Ky,command:function(e){var t=e.editor,n=e.range,i=e.props;t.chain().focus().deleteRange(n).setVariable(i).run()},items:function(){return[]},render:function(){var e,t;return{onStart:function(n){e=new xu(Yy,{props:n,editor:n.editor}),t=bu("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onExit:function(){t[0].destroy(),e.destroy()}}}},Xy=function(e){var t=e.suggestion,n=void 0===t?{}:t;return Qy.configure({suggestion:$y($y({},Zy),n)})},Jy=n(35),eE=n.n(Jy),tE=n(97),nE=n.n(tE),iE=function(e){var t=eE()(e);return"string"===t||"funtion"===t?e:nE()(e)?function(t){var n=t.node.type.name;return e[n]}:""},rE=ma.create({name:"placeholder",addOptions:function(){return{excludeNodeTypes:["variable","codeBlock"],emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!1}},addProseMirrorPlugins:function(){var e=this;return[new Mt({props:{decorations:function(t){var n=t.doc,i=t.selection,r=e.editor.isEditable||!e.options.showOnlyWhenEditable,a=i.anchor,o=[];if(r)return n.descendants((function(t,n){var i=a>=n&&a<=n+t.nodeSize,r=!t.isLeaf&&!t.childCount,s=e.options.excludeNodeTypes.includes(t.type.name);if((i||!e.options.showOnlyCurrent)&&!s&&r){var l=[e.options.emptyNodeClass];e.editor.isEmpty&&l.push(e.options.emptyEditorClass);var u=Tr.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});o.push(u)}return e.options.includeChildren})),Rr.create(n,o)}}})]}});const aE=new Lt("suggestion");function oE({pluginKey:e=aE,editor:t,char:n="@",allowSpaces:i=!1,prefixSpace:r=!0,startOfLine:a=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:d=(()=>({})),allow:c=(()=>!0)}){const _=null==d?void 0:d();return new Mt({key:e,view(){return{update:async(e,n)=>{var i,r,a,o,s;const d=null===(i=this.key)||void 0===i?void 0:i.getState(n),c=null===(r=this.key)||void 0===r?void 0:r.getState(e.state),f=d.active&&c.active&&d.range.from!==c.range.from,g=!d.active&&c.active,h=d.active&&!c.active,p=g||f,m=!g&&!h&&d.query!==c.query&&!f,F=h||f;if(!p&&!m&&!F)return;const b=F&&!p?d:c,y=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),E={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.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};F&&(null===(a=null==_?void 0:_.onExit)||void 0===a||a.call(_,E)),m&&(null===(o=null==_?void 0:_.onUpdate)||void 0===o||o.call(_,E)),p&&(null===(s=null==_?void 0:_.onStart)||void 0===s||s.call(_,E))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from:d}=l,_={...o};if(_.composing=s,u||t.view.composing){!(d<o.range.from||d>o.range.to)||s||o.composing||(_.active=!1);const e=function(e){const{char:t,allowSpaces:n,prefixSpace:i,startOfLine:r,$position:a}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=r?"^":"",u=n?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),d=a.depth<=0?0:a.before(),c=a.pos,_=a.doc.textBetween(d,c,"\0","\0"),f=Array.from(_.matchAll(u)).pop();if(!f||void 0===f.input||void 0===f.index)return null;const g=f.input.slice(Math.max(0,f.index-1),f.index),h=/^[\s\0]?$/.test(g);if(i&&!h)return null;const p=f.index+a.start();let m=p+f[0].length;return n&&s.test(_.slice(m-1,m+1))&&(f[0]+=" ",m+=1),p<a.pos&&m>=a.pos?{range:{from:p,to:m},query:f[0].slice(t.length),text:f[0]}:null}({char:n,allowSpaces:i,prefixSpace:r,startOfLine:a,$position:l.$from}),u="id_"+Math.floor(4294967295*Math.random());e&&c({editor:t,range:e.range})?(_.active=!0,_.decorationId=o.decorationId?o.decorationId:u,_.range=e.range,_.query=e.query,_.text=e.text):_.active=!1}else _.active=!1;return _.active||(_.decorationId=null,_.range={},_.query=null,_.text=null),_}},props:{handleKeyDown(e,t){var n;const{active:i,range:r}=this.getState(e.state);return i&&(null===(n=null==_?void 0:_.onKeyDown)||void 0===n?void 0:n.call(_,{view:e,event:t,range:r}))||!1},decorations(e){const{active:t,range:n,decorationId:i}=this.getState(e);return t?Rr.create(e.doc,[Tr.inline(n.from,n.to,{nodeName:o,class:s,"data-decoration-id":i})]):null}}})}const sE=new Lt("mention"),lE=_s.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:sE,command:({editor:e,range:t,props:n})=>{var i;const r=e.view.state.selection.$to.nodeAfter;(null===(i=null==r?void 0:r.text)||void 0===i?void 0:i.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),i=e.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(i)}}}},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",rs({"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:i}=t,{empty:r,anchor:a}=i;return!!r&&(t.doc.nodesBetween(a-1,a,(t,i)=>{if(t.type.name===this.name)return n=!0,e.insertText(this.options.suggestion.char||"",i,i+t.nodeSize),!1}),n)})}},addProseMirrorPlugins(){return[oE({editor:this.editor,...this.options.suggestion})]}});function uE(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,i=m_()(e);if(t){var r=m_()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return h_()(this,n)}}var dE=function(e){f_()(n,e);var t=uE(n);function n(e){var i;return s_()(this,n),i=t.call(this,e),c()(c_()(i),"selectItem",(function(e){var t=i.props,n=t.items,r=t.command,a=n[e];a&&r({label:a.label,id:a.key})})),c()(c_()(i),"upHandler",(function(){var e=i.props.items;i.setState((function(t){return{selectedIndex:(t.selectedIndex+e.length-1)%e.length}}))})),c()(c_()(i),"downHandler",(function(){var e=i.props.items;i.setState((function(t){return{selectedIndex:(t.selectedIndex+1)%e.length}}))})),c()(c_()(i),"enterHandler",(function(){var e=i.state.selectedIndex;i.selectItem(e)})),c()(c_()(i),"onKeyDown",(function(e){var t=e.event,n={ArrowUp:i.upHandler,ArrowDown:i.downHandler,Enter:i.enterHandler};return!!n.hasOwnProperty(t.key)&&(n[t.key](),!0)})),i.state={selectedIndex:0},i.mentionRef=m.a.createRef(),i}return u_()(n,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),yb({wrapperRef:this.mentionRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this,t=this.state.selectedIndex,n=this.props.items;return 0===n.length?m.a.createElement("div",{className:"neeto-editor-mentions__wrapper"},m.a.createElement("p",{className:"neeto-editor-mentions__item"},"No Results")):m.a.createElement("div",{ref:this.mentionRef,className:"neeto-editor-mentions__wrapper","data-cy":"neeto-editor-mention-list"},n.map((function(n,i){var r=n.label,a=n.imageUrl,o=n.showImage;return m.a.createElement("button",{className:b()("neeto-editor-mentions__item",{active:i===t}),key:r,onClick:function(){return e.selectItem(i)},type:"button","data-cy":"neeto-editor-mention-list-".concat(r)},o&&m.a.createElement(Zc,{user:{name:r,imageUrl:a}}),m.a.createElement("p",null,r))})))}}]),n}(m.a.Component);function cE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function _E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cE(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cE(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var fE=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.showImage,i=void 0!==n&&n,r=e.map((function(e){var t;return"string"==typeof e?t={key:e,label:e}:"object"===eE()(e)&&(t=_E({},e)),t.showImage=i,t}));return function(e){var t=e.query;return r.filter((function(e){return e.label.toLowerCase().includes(t.toLowerCase())}))}},gE=["suggestion"];function hE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function pE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hE(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hE(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var mE={render:function(){var e,t;return{onStart:function(n){e=new xu(dE,{props:n,editor:n.editor}),t=bu("body",{getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown:function(n){var i;return"Escape"===n.event.key?(t[0].hide(),!0):null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(n)},onExit:function(){t[0].destroy(),e.destroy()}}}},FE=lE.extend({addCommands:function(){var e=this;return{setMention:function(t){return function(n){(0,n.chain)().focus().insertContent([{type:e.name,attrs:{id:t,label:t}},{type:"text",text:" "}]).run()}}}}}),bE=function(e){var t=e.suggestion,n=void 0===t?{}:t,i=h()(e,gE);return FE.configure(pE(pE({},i),{},{suggestion:pE(pE({},mE),n)}))},yE=_s.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",rs(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})}}}}}),EE=n(98);function vE(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,i=m_()(e);if(t){var r=m_()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return h_()(this,n)}}var kE=function(e){f_()(n,e);var t=vE(n);function n(){var e;s_()(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),c()(c_()(e),"state",{selectedIndex:0,emojiSuggestions:$_.search(e.props.query||"smile").slice(0,5)}),c()(c_()(e),"onKeyDown",(function(t){var n=t.event;if("ArrowLeft"===n.key||"ArrowDown"===n.key)return e.setState({selectedIndex:(e.state.selectedIndex+e.state.emojiSuggestions.length-1)%e.state.emojiSuggestions.length}),!0;if("ArrowRight"===n.key||"ArrowUp"===n.key)return e.setState({selectedIndex:(e.state.selectedIndex+1)%e.state.emojiSuggestions.length}),!0;if("Enter"===n.key)return e.selectItem(e.state.selectedIndex),!0;if(" "===n.key){var i;if(Object(EE.isEmpty)(e.props.query))e.props.editor.chain().focus().insertContent(" ").run();else e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(null===(i=$_.search(e.props.query))||void 0===i?void 0:i[0]).run();return!0}return"Escape"===n.key&&(e.props.editor.chain().focus().insertContent(" ").run(),!0)})),c()(c_()(e),"selectItem",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(e.state.emojiSuggestions[t]).run()})),e}return u_()(n,[{key:"componentDidUpdate",value:function(e){this.props.query!==e.query&&this.setState({emojiSuggestions:$_.search(this.props.query||"smile").slice(0,5)})}},{key:"render",value:function(){var e=this;return m.a.createElement("div",{className:"neeto-editor-emoji-suggestion"},this.state.emojiSuggestions.length>0?this.state.emojiSuggestions.map((function(t,n){return m.a.createElement("div",{key:t.id,onClick:function(){return e.selectItem(n)},className:b()("neeto-editor-emoji-suggestion__item",{"neeto-editor-emoji-suggestion__item--highlight":n===e.state.selectedIndex}),"data-cy":"neeto-editor-emoji-suggestion-".concat(t.id)},t.native)})):m.a.createElement("p",null,"No results"))}}]),n}(m.a.Component);function DE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function CE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?DE(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DE(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var wE=new Lt("emoji-suggestion"),SE=_s.create({name:"emojiSuggestion",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:":",startOfLine:!1,pluginKey:wE,items:function(){return[]},render:function(){var e,t;return{onStart:function(n){e=new xu(kE,{props:n,editor:n.editor}),t=bu("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",zIndex:99999})},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()}}}}}},addCommands:function(){return{setEmoji:function(e){return function(t){(0,t.chain)().focus().insertContent("".concat((null==e?void 0:e.native)||""," ")).run()}}}},addProseMirrorPlugins:function(){return[wb(CE({editor:this.editor},this.options.suggestion))]}});function OE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function xE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?OE(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OE(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var TE=new Lt("emoji-picker"),NE=_s.create({name:"emojiPicker",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:"::",startOfLine:!1,pluginKey:TE,items:function(){return[]},render:function(){var e,t;return{onStart:function(n){e=new xu(Jf,{props:n,editor:n.editor}),t=bu("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},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[wb(xE({editor:this.editor},this.options.suggestion))]}}),AE=function(e){return function(e){var t=e.handleSubmit;return ma.create({addKeyboardShortcuts:function(){var e=this;return{"Mod-Enter":function(){return null==t||t(e.editor.getHTML()),e.editor.commands.blur(),!0}}}})}({handleSubmit:e.handleSubmit})};var ME=function(e){var t,n,i,r,a,o,s=e.editor,l=e.limit,u=e.strategy;if("hidden"===u)return null;var d="limit"===u&&l;return m.a.createElement("p",{className:"neeto-editor-character-count","data-cy":"neeto-editor-character-count"},d?"".concat(l-(null==s||null===(t=s.storage)||void 0===t||null===(n=t.characterCount)||void 0===n?void 0:n.characters())," characters remaining"):"".concat(null==s||null===(i=s.storage)||void 0===i||null===(r=i.characterCount)||void 0===r?void 0:r.characters()," characters, ").concat(null==s||null===(a=s.storage)||void 0===a||null===(o=a.characterCount)||void 0===o?void 0:o.words()," words"))},RE=["forceTitle","titleError","hideSlashCommands","addons","addonCommands","markdownMode","className","uploadEndpoint","value","onChange","menuType","variables","mentions","showImageInMention","placeholder","extensions","contentClassName","characterLimit","editorSecrets","rows","autoFocus","onSubmit","heightStrategy","characterCountStrategy"],IE=function(e,t){var n=e.forceTitle,i=void 0!==n&&n,r=e.titleError,a=void 0!==r&&r,o=e.hideSlashCommands,s=void 0!==o&&o,l=e.addons,d=void 0===l?[]:l,_=e.addonCommands,g=e.markdownMode,F=void 0!==g&&g,y=e.className,E=e.uploadEndpoint,v=e.value,k=void 0===v?"":v,D=e.onChange,C=void 0===D?function(){}:D,w=e.menuType,S=void 0===w?"fixed":w,O=e.variables,x=e.mentions,T=e.showImageInMention,N=void 0!==T&&T,A=e.placeholder,M=void 0===A?i?{title:"Untitled"}:null:A,R=e.extensions,I=e.contentClassName,L=e.characterLimit,B=e.editorSecrets,P=e.rows,j=void 0===P?6:P,q=e.autoFocus,U=void 0!==q&&q,z=e.onSubmit,H=e.heightStrategy,W=void 0===H?"fixed":H,G=e.characterCountStrategy,Y=void 0===G?"hidden":G,V=h()(e,RE),$=Object(p.useState)(!1),K=f()($,2),Q=K[0],Z=K[1],X=!1;if(M){var J=Object.keys(M).length;X="string"==typeof M||(1===J?!M.title:!!J)}var ee="fixed"===S,te="bubble"===S,ne=!s,ie=!X&&ne,re=d.includes("image-upload-unsplash"),ae=d.map((function(e){return e.toLowerCase()}));re&&ae.push("image-upload");var oe=["font-color","font-size","bold","italic","underline","strike","link","bullet-list","ordered-list"].concat(ae),se=function(e){var t=e.forceTitle,n=e.placeholder,i=e.extensions,r=e.mentions,a=e.variables,o=e.isSlashCommandsActive,s=e.showImageInMention,l=e.setImageUploadVisible,u=e.options,d=e.addonCommands,c=e.characterLimit,_=e.onSubmit,f=[fb,_b.extend({content:t?"title block*":"block+"}),Pp.configure({document:!1,codeBlock:!1}),bb,om,db,um,Gy,Fb,$h,yE,ub,cb,rE.configure({placeholder:iE(n)}),SE,NE,sb.configure({limit:c}),AE({handleSubmit:_})];return o&&f.push(Tb({setImageUploadVisible:l,options:u,addonCommands:d,mentions:r})),od()(r)||f.push(bE({suggestion:{items:fE(r.sort((function(e,t){var n="string"==typeof e?e:e.label,i="string"==typeof t?t:t.label;return n.localeCompare(i)})),{showImage:s})}})),od()(a)||f.push(Xy({suggestion:{items:function(){return a}}})),od()(i)||(f=f.concat(i)),f}({contentClassName:I,forceTitle:i,placeholder:M,extensions:R,mentions:x,variables:O,isSlashCommandsActive:ne,showImageInMention:N,setImageUploadVisible:Z,options:oe,addonCommands:_,characterLimit:L,onSubmit:z}),le=b()("neeto-editor",c()({"slash-active":ie,"fixed-menu-active border":ee,"bubble-menu-active":te,"force-title":i,"force-title--error":a,"placeholder-active":X},y,y)),ue=21*j+26,de="\n ".concat("flexible"===W?"min-height":"height",": ").concat(ue,"px;\n "),ce=Ou({extensions:se,content:k,injectCSS:!1,editorProps:{attributes:{class:le,style:de}},onUpdate:function(e){var t=e.editor;return C(t.getHTML())}});return Object(p.useEffect)((function(){U&&(null==ce||ce.commands.focus("end"))}),[ce]),Object(p.useEffect)((function(){var e=null==ce?void 0:ce.state.selection.anchor;"string"==typeof k?null==ce||ce.commands.setContent(function(e){return"string"!=typeof e?"":e.replaceAll(/<(\S*?)[^>]*>(.*?)<\/\1>/g,(function(e,t,n){return"<".concat(t,">").concat(n.replaceAll(" ","&nbsp;"),"</").concat(t,">")}))}(k)):null==ce||ce.commands.setContent(""),null==ce||ce.commands.setTextSelection(e)}),[k]),m.a.useImperativeHandle(t,(function(){return{editor:ce}})),m.a.createElement("div",{className:"neeto-editor-wrapper"},ee&&m.a.createElement(tg,{editor:ce,variables:O,setImageUploadVisible:Z,options:oe,mentions:x,showImageInMention:N}),te&&m.a.createElement(Gd,{editor:ce,options:oe}),m.a.createElement(Vg,{isVisible:Q,setIsVisible:Z,editor:ce,imageUploadUrl:E,isUnsplashImageUploadActive:re,unsplashApiKey:null==B?void 0:B.unsplash}),F&&m.a.createElement(Th,u()({editor:ce,strategy:W,style:de,className:le,onChange:C,onSubmit:z,value:k},V)),m.a.createElement("div",{className:b()({"neeto-editor-content--hidden":F})},m.a.createElement(Lu,u()({editor:ce},V))),m.a.createElement(ME,{editor:ce,limit:L,strategy:Y}))},LE=m.a.forwardRef(IE),BE=n(99),PE=n.n(BE);var jE=["content","classNames"],qE=function(e){var t=e.content,n=void 0===t?"":t,i=e.classNames,r=h()(e,jE);return Object(p.useEffect)((function(){document.querySelectorAll("div.".concat("neeto-editor-content"," pre code")).forEach((function(e){PE.a.highlightElement(e)}))}),[n]),m.a.createElement("div",u()({className:b()("neeto-editor-content",c()({},i,i)),dangerouslySetInnerHTML:{__html:Kg.a.sanitize(n)},"data-cy":"neeto-editor-content"},r))}}])}));