UNPKG

@firestitch/froala

Version:

The next generation Javascript WYSIWYG HTML rich text editor made by devs for devs. High performance and modern design make it easy to use for developers and loved by users.

1 lines 1.08 MB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.FroalaEditor=t()}(this,function(){"use strict";function at(e){return(at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;if(document.documentElement.contains(t))do{if(t.matches(e))return t}while(null!==(t=t.parentElement||t.parentNode)&&1===t.nodeType);return null}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length;0<=--n&&t.item(n)!==this;);return-1<n}),Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),a=1;a<arguments.length;a++){var r=arguments[a];if(null!=r)for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])}return n},writable:!0,configurable:!0});var o=/^\s*:scope/gi,i=/,\s*:scope/gi,s=document.createElement("div");function t(e,t){var r=e[t];e[t]=function(e){var t=!1,n=!1;if(!e||Array.isArray(e)||!e.match(o)&&!e.match(i))return r.call(this,e);this.parentNode||(s.appendChild(this),n=!0);var a=this.parentNode;return this.id||(this.id="rootedQuerySelector_id_".concat((new Date).getTime()),t=!0),a=r.call(a,e.replace(o,"#".concat(this.id)).replace(i,",#".concat(this.id))),t&&(this.id=""),n&&s.removeChild(this),a}}try{var n=s.querySelectorAll(":scope *");if(!n||Array.isArray(n))throw"error"}catch(e){t(Element.prototype,"querySelector"),t(Element.prototype,"querySelectorAll"),t(HTMLElement.prototype,"querySelector"),t(HTMLElement.prototype,"querySelectorAll")}if("document"in self){if(!("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g")))&&"Element"in(n=self)){var a="classList",e="prototype",n=n.Element[e],r=Object,I=String[e].trim||function(){return this.replace(/^\s+|\s+$/g,"")},D=Array[e].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1},l=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},c=function(e,t){if(""===t)throw new l("SYNTAX_ERR","The token must not be empty.");if(/\s/.test(t))throw new l("INVALID_CHARACTER_ERR","The token must not contain space characters.");return D.call(e,t)},d=function(e){for(var t=I.call(e.getAttribute("class")||""),n=t?t.split(/\s+/):[],a=0,r=n.length;a<r;a++)this.push(n[a]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},f=d[e]=[],p=function(){return new d(this)};if(l[e]=Error[e],f.item=function(e){return this[e]||null},f.contains=function(e){return~c(this,e+"")},f.add=function(){for(var e,t=arguments,n=0,a=t.length,r=!1;~c(this,e=t[n]+"")||(this.push(e),r=!0),++n<a;);r&&this._updateClassName()},f.remove=function(){var e,t,n=arguments,a=0,r=n.length,o=!1;do{for(t=c(this,e=n[a]+"");~t;)this.splice(t,1),o=!0,t=c(this,e)}while(++a<r);o&&this._updateClassName()},f.toggle=function(e,t){var n=this.contains(e),a=n?!0!==t&&"remove":!1!==t&&"add";return a&&this[a](e),!0===t||!1===t?t:!n},f.replace=function(e,t){e=c(e+"");~e&&(this.splice(e,1,t),this._updateClassName())},f.toString=function(){return this.join(" ")},r.defineProperty){f={get:p,enumerable:!0,configurable:!0};try{r.defineProperty(n,a,f)}catch(e){void 0!==e.number&&-2146823252!==e.number||(f.enumerable=!1,r.defineProperty(n,a,f))}}else r[e].__defineGetter__&&n.__defineGetter__(a,p)}(f=document.createElement("_")).classList.add("c1","c2"),f.classList.contains("c2")||((r=function(e){var a=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){for(var t=arguments.length,n=0;n<t;n++)a.call(this,arguments[n])}})("add"),r("remove")),f.classList.toggle("c3",!1),f.classList.contains("c3")&&(h=DOMTokenList.prototype.toggle,DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:h.call(this,e)}),"replace"in document.createElement("_").classList||(DOMTokenList.prototype.replace=function(e,t){var n=this.toString().split(" "),e=n.indexOf(e+"");~e&&(n=n.slice(e),this.remove.apply(this,n),this.add(t),this.add.apply(this,n.slice(1)))})}var u,h,e=-1;if("Microsoft Internet Explorer"===navigator.appName?(u=navigator.userAgent,null!==new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})").exec(u)&&(e=parseFloat(RegExp.$1))):"Netscape"===navigator.appName&&(u=navigator.userAgent,null!==new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})").exec(u))&&(e=parseFloat(RegExp.$1)),!("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof HTMLElement||e<0)){var g,m=!1;try{var v=document.createElement("div");v.addEventListener("focus",function(e){e.preventDefault(),e.stopPropagation()},!0),v.focus(Object.defineProperty({},"preventScroll",{get:function(){if(navigator&&void 0!==navigator.userAgent&&navigator.userAgent&&navigator.userAgent.match(/Edge\/1[7-8]/))return m=!1;m=!0}}))}catch(e){}void 0!==HTMLElement.prototype.nativeFocus||m||(HTMLElement.prototype.nativeFocus=HTMLElement.prototype.focus,g=function(e){for(var t=0;t<e.length;t++)e[t][0].scrollTop=e[t][1],e[t][0].scrollLeft=e[t][2]},HTMLElement.prototype.focus=function(e){var t,n;e&&e.preventScroll?(t=function(e){for(var t=e.parentNode,n=[],a=document.scrollingElement||document.documentElement;t&&t!==a;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push([t,t.scrollTop,t.scrollLeft]),t=t.parentNode;return n.push([t=a,t.scrollTop,t.scrollLeft]),n}(this),"function"==typeof setTimeout?(n=this,setTimeout(function(){n.nativeFocus(),g(t)},0)):(this.nativeFocus(),g(t))):this.nativeFocus()})}function rt(e,t,n){if("string"!=typeof e)return new rt.Bootstrap(e,t,n);var a=document.querySelectorAll(e);t&&t.iframe_document&&(a=t.iframe_document.querySelectorAll(e));for(var r=[],o=0;o<a.length;o++){var i=a[o]["data-froala.editor"];r.push(i||new rt.Bootstrap(a[o],t,n))}return 1==r.length?r[0]:r}rt.RegisterPlugins=function(e){for(var t=0;t<e.length;t++)e[t].call(rt)},Object.assign(rt,{DEFAULTS:{initOnClick:!1,pluginsEnabled:null},MODULES:{},PLUGINS:{},VERSION:"4.0.16",INSTANCES:[],OPTS_MAPPING:{},SHARED:{},ID:0}),rt.MODULES.node=function(i){var n=i.$;function s(e){return e&&"IFRAME"!==e.tagName?Array.prototype.slice.call(e.childNodes||[]):[]}function l(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&0<=rt.BLOCK_TAGS.indexOf(e.tagName.toLowerCase())}function c(e){var t={},n=e.attributes;if(n)for(var a=0;a<n.length;a++){var r=n[a];t[r.nodeName]=r.value}return t}function t(e){for(var t="",n=c(e),a=Object.keys(n).sort(),r=0;r<a.length;r++){var o=a[r],i=n[o];i.indexOf("'")<0&&0<=i.indexOf('"')?t+=" ".concat(o,"='").concat(i,"'"):(0<=i.indexOf('"')&&0<=i.indexOf("'")&&(i=i.replace(/"/g,"&quot;")),t+=" ".concat(o,'="').concat(i,'"'))}return t}function a(e){return e===i.el}return{isBlock:l,isEmpty:function(e,t){if(!e)return!0;if(e.querySelector("table"))return!1;var n=s(e);1===n.length&&l(n[0])&&(n=s(n[0]));for(var a=!1,r=0;r<n.length;r++){var o=n[r];if(!(t&&i.node.hasClass(o,"fr-marker")||o.nodeType===Node.TEXT_NODE&&0===o.textContent.length)){if("BR"!==o.tagName&&0<(o.textContent||"").replace(/\u200B/gi,"").replace(/\n/g,"").length)return!1;if(a)return!1;"BR"===o.tagName&&(a=!0)}}return!(e.querySelectorAll(rt.VOID_ELEMENTS.join(",")).length-e.querySelectorAll("br").length||e.querySelector("".concat(i.opts.htmlAllowedEmptyTags.join(":not(.fr-marker),"),":not(.fr-marker)"))||1<e.querySelectorAll(rt.BLOCK_TAGS.join(",")).length||e.querySelector("".concat(i.opts.htmlDoNotWrapTags.join(":not(.fr-marker),"),":not(.fr-marker)")))},blockParent:function(e){for(;e&&e.parentNode!==i.el&&(!e.parentNode||!i.node.hasClass(e.parentNode,"fr-inner"));)if(l(e=e.parentNode))return e;return null},deepestParent:function(e,t,n){if(void 0===n&&(n=!0),(t=void 0===t?[]:t).push(i.el),0<=t.indexOf(e.parentNode)||e.parentNode&&i.node.hasClass(e.parentNode,"fr-inner")||e.parentNode&&0<=rt.SIMPLE_ENTER_TAGS.indexOf(e.parentNode.tagName)&&n)return null;for(;t.indexOf(e.parentNode)<0&&e.parentNode&&!i.node.hasClass(e.parentNode,"fr-inner")&&(rt.SIMPLE_ENTER_TAGS.indexOf(e.parentNode.tagName)<0||!n)&&(!l(e)||l(e.parentNode))&&(!l(e)||!l(e.parentNode)||!n);)e=e.parentNode;return e},rawAttributes:c,attributes:t,clearAttributes:function(e){for(var t=e.attributes,n=t.length-1;0<=n;n--){var a=t[n];e.removeAttribute(a.nodeName)}},openTagString:function(e){return"<".concat(e.tagName.toLowerCase()).concat(t(e),">")},closeTagString:function(e){return"</".concat(e.tagName.toLowerCase(),">")},isFirstSibling:function e(t,n){void 0===n&&(n=!0);for(var a=t.previousSibling;a&&n&&i.node.hasClass(a,"fr-marker");)a=a.previousSibling;return!a||a.nodeType===Node.TEXT_NODE&&""===a.textContent&&e(a)},isLastSibling:function e(t,n){void 0===n&&(n=!0);for(var a=t.nextSibling;a&&n&&i.node.hasClass(a,"fr-marker");)a=a.nextSibling;return!a||a.nodeType===Node.TEXT_NODE&&""===a.textContent&&e(a)},isList:function(e){return!!e&&0<=["UL","OL"].indexOf(e.tagName)},isLink:function(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&"a"===e.tagName.toLowerCase()},isElement:a,contents:s,isVoid:function(e){return e&&e.nodeType===Node.ELEMENT_NODE&&0<=rt.VOID_ELEMENTS.indexOf((e.tagName||"").toLowerCase())},hasFocus:function(e){return e===i.doc.activeElement&&(!i.doc.hasFocus||i.doc.hasFocus())&&Boolean(a(e)||e.type||e.href||~e.tabIndex)},isEditable:function(e){return(!e.getAttribute||"false"!==e.getAttribute("contenteditable"))&&["STYLE","SCRIPT"].indexOf(e.tagName)<0},isDeletable:function(e){return e&&e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("class")&&0<=(e.getAttribute("class")||"").indexOf("fr-deletable")},hasClass:function(e,t){return(e=e instanceof n?e.get(0):e)&&e.classList&&e.classList.contains(t)},filter:function(e){return i.browser.msie?e:{acceptNode:e}}}},Object.assign(rt.DEFAULTS,{DOMPurify:window.DOMPurify,htmlAllowedTags:["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","br","button","canvas","caption","cite","code","col","colgroup","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meter","nav","noscript","object","ol","optgroup","option","output","p","param","pre","progress","queue","rp","rt","ruby","s","samp","script","style","section","select","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","var","video","wbr"],htmlRemoveTags:["script","style"],htmlAllowedAttrs:["accept","accept-charset","accesskey","action","align","allowfullscreen","allowtransparency","alt","async","autocomplete","autofocus","autoplay","autosave","background","bgcolor","border","charset","cellpadding","cellspacing","checked","cite","class","color","cols","colspan","content","contenteditable","contextmenu","controls","coords","data","data-.*","datetime","default","defer","dir","dirname","disabled","download","draggable","dropzone","enctype","for","form","formaction","frameborder","headers","height","hidden","high","href","hreflang","http-equiv","icon","id","ismap","itemprop","keytype","kind","label","lang","language","list","loop","low","max","maxlength","media","method","min","mozallowfullscreen","multiple","muted","name","novalidate","open","optimum","pattern","ping","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","reversed","rows","rowspan","sandbox","scope","scoped","scrolling","seamless","selected","shape","size","sizes","span","src","srcdoc","srclang","srcset","start","step","summary","spellcheck","style","tabindex","target","title","type","translate","usemap","value","valign","webkitallowfullscreen","width","wrap"],htmlAllowedStyleProps:[".*"],htmlAllowComments:!0,htmlUntouched:!1,fullPage:!1}),rt.HTML5Map={B:"STRONG",I:"EM",STRIKE:"S"},rt.MODULES.clean=function(B){var m,v,b,C,$=B.$;function r(e){if(e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("class")&&0<=e.getAttribute("class").indexOf("fr-marker"))return!1;for(var t=B.node.contents(e),n=[],a=0;a<t.length;a++)t[a].nodeType!==Node.ELEMENT_NODE||B.node.isVoid(t[a])?t[a].nodeType===Node.TEXT_NODE&&(t[a].textContent=t[a].textContent.replace(/\u200b/g,"")):t[a].textContent.replace(/\u200b/g,"").length!==t[a].textContent.length&&r(t[a]);if(e.nodeType===Node.ELEMENT_NODE&&!B.node.isVoid(e)&&(e.normalize(),t=B.node.contents(e),n=e.querySelectorAll(".fr-marker"),t.length-n.length==0)){for(a=0;a<t.length;a++)if(t[a].nodeType===Node.ELEMENT_NODE&&(t[a].getAttribute("class")||"").indexOf("fr-marker")<0)return!1;for(a=0;a<n.length;a++)e.parentNode.insertBefore(n[a].cloneNode(!0),e);return e.parentNode.removeChild(e),!1}}var i=[];function E(e){e=e.replace(/;;/gi,";");return";"!==(e=e.replace(/^;/gi,"")).charAt(e.length)&&(e+=";"),e}function s(e){var t,n,a;for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n=t.match(b),a=null,"style"===t&&B.opts.htmlAllowedStyleProps.length&&(a=e[t].match(C)),n&&a?e[t]=E(a.join(";")):n&&("style"!==t||a)||delete e[t]);for(var r="",o=Object.keys(e).sort(),i=0;i<o.length;i++)e[t=o[i]].indexOf('"')<0?r+=" ".concat(t,'="').concat(e[t],'"'):r+=" ".concat(t,"='").concat(e[t],"'");return r}function l(e,t){var n=document.implementation.createHTMLDocument("Froala DOC").createElement("DIV"),a=($(n).append(e),"");if(n){for(var r=B.node.contents(n),o=0;o<r.length;o++)t(r[o]);for(r=B.node.contents(n),o=0;o<r.length;o++)a+=function e(t,n){if(t.nodeType===Node.COMMENT_NODE)return"\x3c!--".concat(t.nodeValue,"--\x3e");if(t.nodeType===Node.TEXT_NODE)return n?t.textContent.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):t.textContent.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\u00A0/g,"&nbsp;").replace(/\u0009/g,"");if(t.nodeType!==Node.ELEMENT_NODE)return t.outerHTML;if(t.nodeType===Node.ELEMENT_NODE&&0<=["STYLE","SCRIPT","NOSCRIPT"].indexOf(t.tagName))return t.outerHTML;var a,r;if(t.nodeType===Node.ELEMENT_NODE&&"svg"===t.tagName)return a=document.createElement("div"),r=t.cloneNode(!0),a.appendChild(r),a.innerHTML;if("IFRAME"===t.tagName)return t.outerHTML.replace(/&lt;/g,"<").replace(/&gt;/g,">");var o=t.childNodes;if(0===o.length)return t.outerHTML;for(var i="",s=0;s<o.length;s++)"PRE"===t.tagName&&(n=!0),i+=e(o[s],n);return B.node.openTagString(t)+i+B.node.closeTagString(t)}(r[o])}return a}function c(e,t,n){i=[];var a,r=e=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,function(e){return i.push(e),"[FROALA.EDITOR.SCRIPT ".concat(i.length-1,"]")}).replace(/<noscript\b[^<]*(?:(?!<\/noscript>)<[^<]*)*<\/noscript>/gi,function(e){return i.push(e),"[FROALA.EDITOR.NOSCRIPT ".concat(i.length-1,"]")}).replace(/<meta((?:[\w\W]*?)) http-equiv="/g,'<meta$1 data-fr-http-equiv="').replace(/<img((?:[\w\W]*?)) src="/g,'<img$1 data-fr-src="'),o=null;return B.opts.fullPage&&(r=B.html.extractNode(e,"body")||(0<=e.indexOf("<body")?"":e),n)&&(o=B.html.extractNode(e,"head")||""),r=l(r,t),o=o&&l(o,t),n=r,t=o,r=e,(B.opts.fullPage?(o=B.html.extractDoctype(r),e=s(B.html.extractNodeAttrs(r,"html")),t=null===t?B.html.extractNode(r,"head")||"<title></title>":t,a=s(B.html.extractNodeAttrs(r,"head")),r=s(B.html.extractNodeAttrs(r,"body")),"".concat(o,"<html").concat(e,"><head").concat(a,">").concat(t,"</head><body").concat(r,">").concat(n,"</body></html>")):n).replace(/\[FROALA\.EDITOR\.SCRIPT ([\d]*)\]/gi,function(e,t){return 0<=B.opts.htmlRemoveTags.indexOf("script")?"":i[parseInt(t,10)]}).replace(/\[FROALA\.EDITOR\.NOSCRIPT ([\d]*)\]/gi,function(e,t){var n,a;return 0<=B.opts.htmlRemoveTags.indexOf("noscript")?"":(t=i[parseInt(t,10)].replace(/&lt;/g,"<").replace(/&gt;/g,">"),(n=$(t))&&n.length&&(a=l(n.html(),L),n.html(a),t=n.get(0).outerHTML),t)}).replace(/<img((?:[\w\W]*?)) data-fr-src="/g,'<img$1 src="')}function y(e){var t=B.doc.createElement("DIV");return t.innerText=e,t.textContent}function L(e){for(var t,n,a=B.node.contents(e),r=0;r<a.length;r++)a[r].nodeType!==Node.TEXT_NODE&&L(a[r]);var o=e;if(!("SPAN"===o.tagName&&0<=(o.getAttribute("class")||"").indexOf("fr-marker"))){if("PRE"===o.tagName&&(0<=(n=(t=o).innerHTML).indexOf("\n")&&(t.innerHTML=n.replace(/\n/g,"<br>"))),o.nodeType===Node.ELEMENT_NODE&&(o.getAttribute("data-fr-src")&&0!==o.getAttribute("data-fr-src").indexOf("blob:")&&o.setAttribute("data-fr-src",B.helpers.sanitizeURL(y(o.getAttribute("data-fr-src")))),o.getAttribute("href")&&o.setAttribute("href",B.helpers.sanitizeURL(y(o.getAttribute("href")))),o.getAttribute("src")&&o.setAttribute("src",B.helpers.sanitizeURL(y(o.getAttribute("src")))),o.getAttribute("srcdoc")&&o.setAttribute("srcdoc",B.clean.html(o.getAttribute("srcdoc"))),0<=["TABLE","TBODY","TFOOT","TR"].indexOf(o.tagName))&&(o.innerHTML=o.innerHTML.trim()),!B.opts.pasteAllowLocalImages&&o.nodeType===Node.ELEMENT_NODE&&"IMG"===o.tagName&&o.getAttribute("data-fr-src")&&0===o.getAttribute("data-fr-src").indexOf("file://"))return void o.parentNode.removeChild(o);if(o.nodeType===Node.ELEMENT_NODE&&rt.HTML5Map[o.tagName]&&""===B.node.attributes(o)&&(t=rt.HTML5Map[o.tagName],n="<".concat(t,">").concat(o.innerHTML,"</").concat(t,">"),o.insertAdjacentHTML("beforebegin",n),(o=o.previousSibling).parentNode.removeChild(o.nextSibling)),B.opts.htmlAllowComments||o.nodeType!==Node.COMMENT_NODE)if(o.tagName&&o.tagName.match(v)){if("STYLE"==o.tagName&&B.helpers.isMac()){for(var i,s=o.innerHTML.trim(),l=[],c=/{([^}]+)}/g,s=s.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*|<!--[\s\S]*?-->$/,"");i=c.exec(s);)l.push(i[1]);for(var d=0;-1!=s.indexOf("{");d++)!function(t){var e=s.substring(0,s.indexOf("{")).trim();0==!/^[a-z_-][a-z\d_-]*$/i.test(e)&&o.parentNode.querySelectorAll(e).forEach(function(e){e.removeAttribute("class"),e.setAttribute("style",l[t])}),s=s.substring(s.indexOf("}")+1)}(d)}o.parentNode.removeChild(o)}else if(o.tagName&&!o.tagName.match(m))"svg"===o.tagName?o.parentNode.removeChild(o):B.browser.safari&&"path"===o.tagName&&o.parentNode&&"svg"===o.parentNode.tagName||(o.outerHTML=o.innerHTML);else{var f=o.attributes;if(f)for(var p=f.length-1;0<=p;p--){var u=f[p],h=u.nodeName.match(b),g=null;"style"===u.nodeName&&B.opts.htmlAllowedStyleProps.length&&(g=u.value.match(C)),h&&g?u.value=E(g.join(";")):h&&("style"!==u.nodeName||g)||o.removeAttribute(u.nodeName)}}else 0!==o.data.indexOf("[FROALA.EDITOR")&&o.parentNode.removeChild(o)}}return{_init:function(){B.opts.fullPage&&$.merge(B.opts.htmlAllowedTags,["head","title","style","link","base","body","html","meta"])},html:function(e,t,n,a){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===a&&(a=!1);for(var r=$.merge([],B.opts.htmlAllowedTags),o=0;o<t.length;o++)0<=r.indexOf(t[o])&&r.splice(r.indexOf(t[o]),1);var i=$.merge([],B.opts.htmlAllowedAttrs);for(o=0;o<n.length;o++)0<=i.indexOf(n[o])&&i.splice(i.indexOf(n[o]),1);return i.push("data-fr-.*"),i.push("fr-.*"),m=new RegExp("^".concat(r.join("$|^"),"$"),"gi"),b=new RegExp("^".concat(i.join("$|^"),"$"),"gi"),v=new RegExp("^".concat(B.opts.htmlRemoveTags.join("$|^"),"$"),"gi"),C=B.opts.htmlAllowedStyleProps.length?new RegExp("((^|;|\\s)".concat(B.opts.htmlAllowedStyleProps.join(":.+?(?=;|$))|((^|;|\\s)"),":.+?(?=(;)|$))"),"gi"):null,e=c(e,L,!0),e=void 0!==B.opts.DOMPurify?B.opts.DOMPurify.sanitize(e,{ADD_TAGS:B.opts.htmlAllowedTags,ALLOW_UNKNOWN_PROTOCOLS:!0}):e},toHTML5:function(){var e=B.el.querySelectorAll(Object.keys(rt.HTML5Map).join(","));if(e.length){var t=!1;B.el.querySelector(".fr-marker")||(B.selection.save(),t=!0);for(var n=0;n<e.length;n++)""===B.node.attributes(e[n])&&$(e[n]).replaceWith("<".concat(rt.HTML5Map[e[n].tagName],">").concat(e[n].innerHTML,"</").concat(rt.HTML5Map[e[n].tagName],">"));t&&B.selection.restore()}},tables:function(){for(var e=B.el.querySelectorAll("tr"),t=0;t<e.length;t++){for(var n=e[t].children,a=!0,r=0;r<n.length;r++)if("TH"!==n[r].tagName){a=!1;break}if(!1!==a&&0!==n.length){for(var o=e[t];o&&"TABLE"!==o.tagName&&"THEAD"!==o.tagName;)o=o.parentNode;var i=o;"THEAD"!==i.tagName&&(i=B.doc.createElement("THEAD"),o.insertBefore(i,o.firstChild)),i.appendChild(e[t])}}},lists:function(){var e,t=[];do{if(t.length){var n=t[0],a=B.doc.createElement("ul");n.parentNode.insertBefore(a,n);do{var r=n,n=n.nextSibling}while(a.appendChild(r),n&&"LI"===n.tagName)}for(var t=[],o=B.el.querySelectorAll("li"),i=0;i<o.length;i++)e=o[i],B.node.isList(e.parentNode)||t.push(o[i])}while(0<t.length);for(var s=B.el.querySelectorAll("ol + ol, ul + ul"),l=0;l<s.length;l++){var c=s[l];if(B.node.isList(c.previousSibling)&&B.node.openTagString(c)===B.node.openTagString(c.previousSibling)){for(var d=B.node.contents(c),f=0;f<d.length;f++)c.previousSibling.appendChild(d[f]);c.parentNode.removeChild(c)}}for(var p,u=B.el.querySelectorAll("ul, ol"),h=0;h<u.length;h++)for(var g=B.node.contents(u[h]),m=null,v=g.length-1;0<=v;v--)!g[v].tagName&&B.opts.htmlUntouched||"LI"===g[v].tagName||"UL"==g[v].tagName||"OL"==g[v].tagName?m=null:"BR"==g[v].tagName?$(g[v]).remove():(m||(m=$(B.doc.createElement("LI"))).insertBefore(g[v]),m.prepend(g[v]));do{for(var b=!1,C=B.el.querySelectorAll("li:empty"),E=0;E<C.length;E++)C[E].parentNode.removeChild(C[E]);var y=B.el.querySelectorAll("ul, ol");for(E=0;E<y.length;E++)(p=y[E]).querySelector("LI")||(b=!0,p.parentNode.removeChild(p))}while(!0===b);for(var L=B.el.querySelectorAll("ul > ul, ol > ol, ul > ol, ol > ul"),_=0;_<L.length;_++){var w=L[_],A=w.previousSibling;A&&("LI"===A.tagName?A.appendChild(w):$(w).wrap("<li></li>"))}for(var T=B.el.querySelectorAll("li > ul, li > ol"),S=0;S<T.length;S++){var k=T[S];if(k.nextSibling)for(var x=k.nextSibling;0<x.childNodes.length;)k.append(x.childNodes[0])}for(var R=B.el.querySelectorAll("li > ul, li > ol"),M=0;M<R.length;M++){var N=R[M];if(B.node.isFirstSibling(N)&&"none"!=N.parentNode.style.listStyleType)$(N).before("<br/>");else if(N.previousSibling&&"BR"===N.previousSibling.tagName){for(var O=N.previousSibling.previousSibling;O&&B.node.hasClass(O,"fr-marker");)O=O.previousSibling;O&&"BR"!==O.tagName&&$(N.previousSibling).remove()}}for(var I=B.el.querySelectorAll("li:empty"),D=0;D<I.length;D++)$(I[D]).remove()},invisibleSpaces:function(e){return e.replace(/\u200b/g,"").length===e.length?e:B.clean.exec(e,r)},exec:c}},rt.XS=0,rt.SM=1,rt.MD=2,rt.LG=3,rt.LinkRegExCommon="[".concat("a-z\\u0080-\\u009f\\u00a1-\\uffff0-9-_\\.","]{1,}"),rt.LinkRegExEnd="((:[0-9]{1,5})|)(((\\/|\\?|#)[a-z\\u00a1-\\uffff0-9@?\\|!^=%&amp;\\/~+#-\\'*-_{}]*)|())",rt.LinkRegExTLD="((".concat(rt.LinkRegExCommon,")(\\.(com|net|org|edu|mil|gov|co|biz|info|me|dev)))"),rt.LinkRegExHTTP="((ftp|http|https):\\/\\/".concat(rt.LinkRegExCommon,")"),rt.LinkRegExAuth="((ftp|http|https):\\/\\/[\\u0021-\\uffff]{1,}@".concat(rt.LinkRegExCommon,")"),rt.LinkRegExWWW="(www\\.".concat(rt.LinkRegExCommon,"\\.[a-z0-9-]{2,24})"),rt.LinkRegEx="(".concat(rt.LinkRegExTLD,"|").concat(rt.LinkRegExHTTP,"|").concat(rt.LinkRegExWWW,"|").concat(rt.LinkRegExAuth,")").concat(rt.LinkRegExEnd),rt.LinkProtocols=["mailto","tel","sms","notes","data"],rt.MAIL_REGEX=/.+@.+\..+/i,rt.MODULES.helpers=function(r){var o,i=r.$;function e(){return/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&!a()}function t(){return/(Android)/g.test(navigator.userAgent)&&!a()}function n(){return/(Blackberry)/g.test(navigator.userAgent)}function a(){return/(Windows Phone)/gi.test(navigator.userAgent)}var s=null;return{_init:function(){var e,t,n,a;r.browser=(n={},e=-1,"Microsoft Internet Explorer"===navigator.appName?(a=navigator.userAgent,null!==new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})").exec(a)&&(e=parseFloat(RegExp.$1))):"Netscape"===navigator.appName&&(a=navigator.userAgent,null!==new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})").exec(a))&&(e=parseFloat(RegExp.$1)),0<(a=e)?n.msie=!0:(e=navigator.userAgent.toLowerCase(),t=(e=/(edge)[ /]([\w.]+)/.exec(e)||/(chrome)[ /]([\w.]+)/.exec(e)||/(webkit)[ /]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ /]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[])[1]||"",e[2],e[1]&&(n[t]=!0),n.chrome?n.webkit=!0:n.webkit&&(n.safari=!0)),n.msie&&(n.version=a),n)},isIOS:e,isMac:function(){return s=null===s?0<=navigator.platform.toUpperCase().indexOf("MAC"):s},isAndroid:t,isBlackberry:n,isWindowsPhone:a,isMobile:function(){return t()||e()||n()},isEmail:function(e){return!/^(https?:|ftps?:|)\/\//i.test(e)&&rt.MAIL_REGEX.test(e)},requestAnimationFrame:function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}},getPX:function(e){return parseInt(e,10)||0},screenSize:function(e){try{var t;return(t=(e?r.$box:r.$sc).width())<768?rt.XS:768<=t&&t<992?rt.SM:992<=t&&t<1200?rt.MD:1200<=t?rt.LG:void 0}catch(e){return rt.LG}},isTouch:function(){return"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch},sanitizeURL:function(e){return r.opts.DOMPurify&&(e=r.opts.DOMPurify.sanitize(e,{ADD_TAGS:r.opts.htmlAllowedTags,ALLOW_UNKNOWN_PROTOCOLS:!0,ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|xxx):|[^a-z]|[a-z+.]+(?:[^a-z+.\-:]|$))/i})),/^(https?:|ftps?:|)\/\//i.test(e)||/^([A-Za-z]:(\\){1,2}|[A-Za-z]:((\\){1,2}[^\\]+)+)(\\)?$/i.test(e)||new RegExp("^(".concat(rt.LinkProtocols.join("|"),"):"),"i").test(e)?e:encodeURIComponent(e).replace(/%23/g,"#").replace(/%2F/g,"/").replace(/%25/g,"%").replace(/mailto%3A/gi,"mailto:").replace(/file%3A/gi,"file:").replace(/sms%3A/gi,"sms:").replace(/tel%3A/gi,"tel:").replace(/notes%3A/gi,"notes:").replace(/data%3Aimage/gi,"data:image").replace(/blob%3A/gi,"blob:").replace(/%3A(\d)/gi,":$1").replace(/webkit-fake-url%3A/gi,"webkit-fake-url:").replace(/%3F/g,"?").replace(/%3D/g,"=").replace(/%26/g,"&").replace(/&amp;/g,"&").replace(/%2C/g,",").replace(/%3B/g,";").replace(/%2B/g,"+").replace(/%40/g,"@").replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/%7B/g,"{").replace(/%7D/g,"}").replace(/%[0-1]+[0-9]+|%[0-1]+[A-F]+/g,"")},isArray:function(e){return e&&!Object.prototype.propertyIsEnumerable.call(e,"length")&&"object"===at(e)&&"number"==typeof e.length},RGBToHex:function(e){function t(e){return"0".concat(parseInt(e,10).toString(16)).slice(-2)}try{return e&&"transparent"!==e?/^#[0-9A-F]{6}$/i.test(e)?e:(e=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/),"#".concat(t(e[1])).concat(t(e[2])).concat(t(e[3])).toUpperCase()):""}catch(e){return null}},HEXtoRGB:function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,n,a){return t+t+n+n+a+a});e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return e?"rgb(".concat(parseInt(e[1],16),", ").concat(parseInt(e[2],16),", ").concat(parseInt(e[3],16),")"):""},isURL:function(e){return!!/^(https?:|ftps?:|)\/\//i.test(e)&&(e=String(e).replace(/</g,"%3C").replace(/>/g,"%3E").replace(/"/g,"%22").replace(/ /g,"%20"),new RegExp("^".concat(rt.LinkRegExHTTP).concat(rt.LinkRegExEnd,"$"),"gi").test(e))},getAlignment:function(e){var t,n,a,e=((e=e.css?e:i(e)).css("text-align")||"").replace(/-(.*)-/g,"");return["left","right","justify","center"].indexOf(e)<0&&(o||(t=i('<div dir="'.concat("rtl"===r.opts.direction?"rtl":"auto",'" style="text-align: ').concat(r.$el.css("text-align"),'; position: fixed; left: -3000px;"><span id="s1">.</span><span id="s2">.</span></div>')),i("body").first().append(t),n=t.find("#s1").get(0).getBoundingClientRect().left,a=t.find("#s2").get(0).getBoundingClientRect().left,t.remove(),o=n<a?"left":"right"),e=o),e},scrollTop:function(){return r.o_win.pageYOffset||(r.o_doc.documentElement&&r.o_doc.documentElement.scrollTop?r.o_doc.documentElement.scrollTop:r.o_doc.body.scrollTop||0)},scrollLeft:function(){return r.o_win.pageXOffset||(r.o_doc.documentElement&&r.o_doc.documentElement.scrollLeft?r.o_doc.documentElement.scrollLeft:r.o_doc.body.scrollLeft||0)},isInViewPort:function(e){e=e.getBoundingClientRect();return 0<=(e={top:Math.round(e.top),bottom:Math.round(e.bottom)}).top&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)||e.top<=0&&e.bottom>=(window.innerHeight||document.documentElement.clientHeight)}}},rt.MODULES.events=function(i){var t,o=i.$,s={};function e(e,t,n){p(e,t,n)}function n(e){if(void 0===e&&(e=!0),!i.$wp)return!1;if(i.helpers.isIOS()&&i.$win.get(0).focus(),i.core.hasFocus())return!1;if(!i.core.hasFocus()&&e){e=i.$win.scrollTop();if(i.browser.msie&&i.$box&&i.$box.css("position","fixed"),i.browser.msie&&i.$wp&&i.$wp.css("overflow","visible"),i.browser.msie&&i.$sc&&i.$sc.css("position","fixed"),i.browser.msie||(r(),i.el.focus(),i.events.trigger("focus"),l()),i.browser.msie&&i.$sc&&i.$sc.css("position",""),i.browser.msie&&i.$box&&i.$box.css("position",""),i.browser.msie&&i.$wp&&i.$wp.css("overflow","auto"),e!==i.$win.scrollTop()&&i.$win.scrollTop(e),!i.selection.info(i.el).atStart)return!1}if(!i.core.hasFocus()||0<i.$el.find(".fr-marker").length)return!1;var t;i.selection.info(i.el).atStart&&i.selection.isCollapsed()&&null!==i.html.defaultTag()&&((e=i.markers.insert())&&!i.node.blockParent(e)?(o(e).remove(),(t=i.$el.find(i.html.blockTagsQuery()).get(0))&&(o(t).prepend(rt.MARKERS),i.selection.restore())):e&&o(e).remove())}var a=!1;function l(){t=!0}function r(){t=!1}function c(){return t}function d(e,t,n){var a=e.split(" ");if(1<a.length){for(var r=0;r<a.length;r++)d(a[r],t,n);return!0}void 0===n&&(n=!1),e=(0!==e.indexOf("shared.")?(s[e]=s[e]||[],s):(i.shared._events[e]=i.shared._events[e]||[],i.shared._events))[e],n?e.unshift(t):e.push(t)}var f=[];function p(e,t,n,a,r){"function"==typeof n&&(r=a,a=n,n=!1);var o=r?i.shared.$_events:f,r=r?i.sid:i.id,t="".concat(t.trim().split(" ").join(".ed".concat(r," ")),".ed").concat(r);n?e.on(t,n,a):e.on(t,a),o.push([e,t])}function u(e){for(var t=0;t<e.length;t++)e[t][0].off(e[t][1])}function h(e,t,n){if(!i.edit.isDisabled()||n){var a,r;if(0!==e.indexOf("shared."))a=s[e];else{if(0<i.shared.count)return!1;a=i.shared._events[e]}if(a)for(var o=0;o<a.length;o++)if(!1===(r=a[o].apply(i,t)))return!1;return(!i.opts.events||!i.opts.events[e]||!1!==(r=i.opts.events[e].apply(i,t)))&&r}}function g(){for(var e in s)Object.prototype.hasOwnProperty.call(s,e)&&delete s[e]}function m(){for(var e in i.shared._events)Object.prototype.hasOwnProperty.call(i.shared._events,e)&&delete i.shared._events[e]}return{_init:function(){i.shared.$_events=i.shared.$_events||[],i.shared._events={},i.helpers.isMobile()?(i._mousedown="touchstart",i._mouseup="touchend",i._move="touchmove",i._mousemove="touchmove"):(i._mousedown="mousedown",i._mouseup="mouseup",i._move="",i._mousemove="mousemove"),e(i.$el,"click mouseup mousemove mousedown touchstart touchend dragenter dragover dragleave dragend drop dragstart",function(e){h(e.type,[e])}),d("mousedown",function(){for(var e=0;e<rt.INSTANCES.length;e++)rt.INSTANCES[e]!==i&&rt.INSTANCES[e].popups&&rt.INSTANCES[e].popups.areVisible()&&rt.INSTANCES[e].$el.find(".fr-marker").remove()}),e(i.$win,i._mousedown,function(e){h("window.mousedown",[e]),l()}),e(i.$win,i._mouseup,function(e){h("window.mouseup",[e])}),e(i.$win,"beforeinput cut copy keydown keyup touchmove touchend",function(e){h("window.".concat(e.type),[e])}),e(i.$doc,"dragend drop",function(e){h("document.".concat(e.type),[e])}),e(i.$el,"beforeinput keydown keypress keyup input",function(e){h(e.type,[e])}),e(i.$el,"focus",function(e){t&&(n(!1),!1===a)&&(h(e.type,[e]),i.helpers.isMobile())&&r()}),e(i.$el,"blur",function(e){t&&!0===a&&(h(e.type,[e]),i.helpers.isMobile()&&i.opts.toolbarContainer&&(i.shared.selected_editor=i.id),l())}),p(i.$el,"mousedown",'[contenteditable="true"]',function(){r(),i.$el.blur()}),d("focus",function(){a=!0}),d("blur",function(){a=!1}),l(),e(i.$el,"cut copy paste beforepaste",function(e){h(e.type,[e])}),d("destroy",g),d("shared.destroy",m)},on:d,trigger:h,bindClick:function(e,t,r){p(e,i._mousedown,t,function(e){var t;i.edit.isDisabled()||(t=o((e=e).currentTarget),i.edit.isDisabled()||i.node.hasClass(t.get(0),"fr-disabled")?e.preventDefault():"mousedown"===e.type&&1!==e.which||(i.helpers.isMobile()||e.preventDefault(),(i.helpers.isAndroid()||i.helpers.isWindowsPhone())&&0===t.parents(".fr-dropdown-menu").length&&(e.preventDefault(),e.stopPropagation()),t.addClass("fr-selected"),i.events.trigger("commands.mousedown",[t])))},!0),p(e,"".concat(i._mouseup," ").concat(i._move),t,function(e){if(!i.edit.isDisabled()){var t,n=r,a=o(e.currentTarget);if(i.edit.isDisabled()||i.node.hasClass(a.get(0),"fr-disabled"))e.preventDefault();else if(("mouseup"!==e.type||1===e.which)&&(i.button.getButtons(".fr-selected",!0).get(0)!=a.get(0)||i.node.hasClass(a.get(0),"fr-selected")))"touchmove"!==e.type?(e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault(),i.node.hasClass(a.get(0),"fr-selected")?(i.button.getButtons(".fr-selected",!0).removeClass("fr-selected"),a.data("dragging")||a.attr("disabled")?a.removeData("dragging"):((t=a.data("timeout"))&&(clearTimeout(t),a.removeData("timeout")),n.apply(i,[e]))):i.button.getButtons(".fr-selected",!0).removeClass("fr-selected")):a.data("timeout")||a.data("timeout",setTimeout(function(){a.data("dragging",!0)},100))}},!0),p(e,"mousedown click mouseup",t,function(e){i.edit.isDisabled()||e.stopPropagation()},!0),d("window.mouseup",function(){i.edit.isDisabled()||(e.find(t).removeClass("fr-selected"),l())}),p(e,"mouseover",t,function(){o(this).hasClass("fr-options")&&o(this).prev(".fr-btn").addClass("fr-btn-hover"),o(this).next(".fr-btn").hasClass("fr-options")&&o(this).next(".fr-btn").addClass("fr-btn-hover")}),p(e,"mouseout",t,function(){o(this).hasClass("fr-options")&&o(this).prev(".fr-btn").removeClass("fr-btn-hover"),o(this).next(".fr-btn").hasClass("fr-options")&&o(this).next(".fr-btn").removeClass("fr-btn-hover")})},disableBlur:r,enableBlur:l,blurActive:c,focus:n,chainTrigger:function(e,t,n){if(!i.edit.isDisabled()||n){var a,r;if(0!==e.indexOf("shared."))a=s[e];else{if(0<i.shared.count)return!1;a=i.shared._events[e]}if(a)for(var o=0;o<a.length;o++)void 0!==(r=a[o].apply(i,[t]))&&(t=r);return t=i.opts.events&&i.opts.events[e]&&void 0!==(r=i.opts.events[e].apply(i,[t]))?r:t}},$on:p,$off:function(){u(f),f=[],0===i.shared.count&&(u(i.shared.$_events),i.shared.$_events=[])}}},Object.assign(rt.DEFAULTS,{indentMargin:20}),rt.COMMANDS={bold:{title:"Bold",toggle:!0,refresh:function(e){var t=this.format.is("strong");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},italic:{title:"Italic",toggle:!0,refresh:function(e){var t=this.format.is("em");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},underline:{title:"Underline",toggle:!0,refresh:function(e){var t=this.format.is("u");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},strikeThrough:{title:"Strikethrough",toggle:!0,refresh:function(e){var t=this.format.is("s");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},subscript:{title:"Subscript",toggle:!0,refresh:function(e){var t=this.format.is("sub");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},superscript:{title:"Superscript",toggle:!0,refresh:function(e){var t=this.format.is("sup");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},outdent:{title:"Decrease Indent"},indent:{title:"Increase Indent"},undo:{title:"Undo",undo:!1,forcedRefresh:!0,disabled:!0},redo:{title:"Redo",undo:!1,forcedRefresh:!0,disabled:!0},insertHR:{title:"Insert Horizontal Line"},clearFormatting:{title:"Clear Formatting"},selectAll:{title:"Select All",undo:!1},moreText:{title:"More Text",undo:!1},moreParagraph:{title:"More Paragraph",undo:!1},moreRich:{title:"More Rich",undo:!1},moreMisc:{title:"More Misc",undo:!1}},rt.RegisterCommand=function(e,t){rt.COMMANDS[e]=t},rt.MODULES.commands=function(i){var s=i.$;function o(e){return e=i.html.defaultTag()?"<".concat(i.html.defaultTag(),">").concat(e,"</").concat(i.html.defaultTag(),">"):e}var l={bold:function(){e(0,"strong")},subscript:function(){i.format.is("sup")&&i.format.remove("sup"),e(0,"sub")},superscript:function(){i.format.is("sub")&&i.format.remove("sub"),e(0,"sup")},italic:function(){e(0,"em")},strikeThrough:function(){e(0,"s")},underline:function(){e(0,"u")},undo:function(){i.undo.run()},redo:function(){i.undo.redo()},indent:function(){a(1)},outdent:function(){a(-1)},show:function(){i.opts.toolbarInline&&i.toolbar.showInline(null,!0)},insertHR:function(){i.selection.remove();var e="",t=(i.core.isEmpty()&&(e=o(e="<br>")),'<hr id="fr-just" class="fr-just">'.concat(e));i.opts.trackChangesEnabled&&(t=i.track_changes.wrapInTracking(s(t),"hrWrapper").get(0).outerHTML),i.html.insert(t);var n,a,t=i.$el.find("hr#fr-just").length?i.$el.find("hr#fr-just"):i.$el.find(".fr-just"),r=(t.removeAttr("id"),t.removeAttr("class"),i.opts.trackChangesEnabled&&"SPAN"===t[0].parentNode.tagName&&"P"===t[0].parentNode.parentNode.tagName);0===t.next().length&&((a=i.html.defaultTag())&&!r?t.after(s(i.doc.createElement(a)).append("<br>").get(0)):r?t[0].parentNode.after(s(i.doc.createElement(a)).append("<br>").get(0)):t.after("<br>")),t.prev().is("hr")?n=i.selection.setAfter(t.get(0),!1):t.next().is("hr")?n=i.selection.setBefore(t.get(0),!1):r||i.selection.setAfter(t.get(0),!1)?i.selection.setAfter(t[0].parentNode,!1):i.selection.setBefore(t.get(0),!1),n||void 0===n||(e=o(e="".concat(rt.MARKERS,"<br>")),t.after(e)),i.selection.restore()},clearFormatting:function(){i.format.remove()},selectAll:function(){i.doc.execCommand("selectAll",!1,!1)},moreText:function(e){t(e)},moreParagraph:function(e){t(e)},moreRich:function(e){t(e)},moreMisc:function(e){t(e)},moreTrackChanges:function(){t("trackChanges")}};function t(e){var n,e=i.$tb.find("[data-cmd=".concat(e,"]")),t=i.$tb.find("[data-cmd=html]");i.opts.trackChangesEnabled?t&&t.addClass("fr-disabled"):t&&t.removeClass("fr-disabled"),n=e,i.helpers.isMobile()&&i.opts.toolbarInline&&i.events.disableBlur(),t=i.$tb.find('.fr-more-toolbar[data-name="'.concat(n.attr("data-group-name"),'"]')),"trackChanges"===n.data("cmd")&&(t=i.$tb.find('.fr-more-toolbar[data-name="'.concat(n.attr("id"),'"]'))),i.$tb.find(".fr-open").not(n).not('[data-cmd="trackChanges"]').removeClass("fr-open"),n.toggleClass("fr-open"),i.$tb.find(".fr-more-toolbar").removeClass("fr-overflow-visible"),i.$tb.find(".fr-expanded").not(t).length?(i.$tb.find(".fr-expanded").not(t).each(function(e,t){(0==s(t).data("name").indexOf("trackChanges-")||0==s(t).data("name").indexOf("moreRich-"))&&(n.parents('[data-name^="moreRich-"]').length||0==s(t).data("name").indexOf("trackChanges-")||s(t).find('[id^="trackChanges-"]').length&&i.opts.trackChangesEnabled)||s(t).toggleClass("fr-expanded")}),t.toggleClass("fr-expanded")):(t.toggleClass("fr-expanded"),i.$box.toggleClass("fr-toolbar-open"),i.$tb.toggleClass("fr-toolbar-open")),i.toolbar.setMoreToolbarsHeight()}function n(e,t){var n,a,r;i.markdown&&i.markdown.isEnabled()&&("bold"===e||"italic"===e||"underline"===e)||i.opts.trackChangesEnabled&&"markdown"===e||!1===i.events.trigger("commands.before",s.merge([e],t||[]))||(n=rt.COMMANDS[e]&&rt.COMMANDS[e].callback||l[e],r=!(a=!0),rt.COMMANDS[e]&&(void 0!==rt.COMMANDS[e].focus&&(a=rt.COMMANDS[e].focus),void 0!==rt.COMMANDS[e].accessibilityFocus)&&(r=rt.COMMANDS[e].accessibilityFocus),(!i.core.hasFocus()&&a||!i.core.hasFocus()&&r&&i.accessibility.hasFocus())&&(i.el.focus({preventScroll:!0}),i.events.trigger("focus")),rt.COMMANDS[e]&&!1!==rt.COMMANDS[e].undo&&(i.$el.find(".fr-marker").length&&(i.events.disableBlur(),i.selection.restore()),i.undo.saveStep()),n&&n.apply(i,s.merge([e],t||[])),i.events.trigger("commands.after",s.merge([e],t||[])),rt.COMMANDS[e]&&!1!==rt.COMMANDS[e].undo&&i.undo.saveStep())}function e(e,t){i.format.toggle(t)}function a(e){i.selection.save(),i.html.wrap(!0,!0,!0,!0),i.selection.restore();for(var t=i.selection.blocks(),n=0;n<t.length;n++)if("LI"!==t[n].tagName&&"LI"!=t[n].parentNode.tagName&&("LI"!==t[n].tagName||"LI"!==t[n].parentNode.tagName)){var a=s(t[n]),r=("LI"!=t[n].tagName&&"LI"==t[n].parentNode.tagName&&(a=s(t[n].parentNode)),"rtl"===i.opts.direction||"rtl"===a.css("direction")?"margin-right":"margin-left"),o=i.helpers.getPX(a.css(r));if(a.width()<2*i.opts.indentMargin&&0<e)continue;"UL"!=t[n].parentNode.tagName&&"OL"!=t[n].parentNode.tagName&&"LI"!=t[n].parentNode.tagName&&a.css(r,Math.max(o+e*i.opts.indentMargin,0)||""),a.removeClass("fr-temp-div")}i.selection.save(),i.html.unwrap(),i.selection.restore()}var r,c={};for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(c[r]=function(e){return function(){n(e)}}(r));return Object.assign(c,{exec:n,_init:function(){i.events.on("keydown",function(e){var t=i.selection.element();if(t&&"HR"===t.tagName&&!i.keys.isArrow(e.which))return e.preventDefault(),!1}),i.events.on("keyup",function(e){var t=i.selection.element();if(t&&"HR"===t.tagName)if(e.which===rt.KEYCODE.ARROW_LEFT||e.which===rt.KEYCODE.ARROW_UP){if(t.previousSibling)return i.node.isBlock(t.previousSibling)?i.selection.setAtEnd(t.previousSibling):s(t).before(rt.MARKERS),i.selection.restore(),!1}else if((e.which===rt.KEYCODE.ARROW_RIGHT||e.which===rt.KEYCODE.ARROW_DOWN)&&t.nextSibling)return i.node.isBlock(t.nextSibling)?i.selection.setAtStart(t.nextSibling):s(t).after(rt.MARKERS),i.selection.restore(),!1}),i.events.on("mousedown",function(e){if(e.target&&"HR"===e.target.tagName)return e.preventDefault(),e.stopPropagation(),!1}),i.events.on("mouseup",function(){var e=i.selection.element();e===i.selection.endElement()&&e&&"HR"===e.tagName&&(e.nextSibling&&(i.node.isBlock(e.nextSibling)?i.selection.setAtStart(e.nextSibling):s(e).after(rt.MARKERS)),i.selection.restore())})}})},rt.MODULES.cursorLists=function(g){var m=g.$;function v(e){for(var t=e;"LI"!==t.tagName;)t=t.parentNode;return t}function b(e){for(var t=e;!g.node.isList(t);)t=t.parentNode;return t}function C(e){for(var t="",n=0;n<e.length;n++){var a=e[n];t+="".concat(a.name,"='").concat(a.value,"' ")}return t}return{_startEnter:function(e){var t=v(e),n=t.nextSibling,a=t.previousSibling,r=g.html.defaultTag();if(g.node.isEmpty(t,!0)&&n){for(var o="",i="",s=e.parentNode;!g.node.isList(s)&&s.parentNode&&("LI"!==s.parentNode.tagName||s.parentNode===t);)-1<["OL","LI","UL"].indexOf(s.tagName)&&(o=g.node.openTagString(s)+o,i+=g.node.closeTagString(s)),s=s.parentNode;o=g.node.openTagString(s)+o,i+=g.node.closeTagString(s);var l="";for(l=(s.parentNode&&"LI"===s.parentNode.tagName?(s.parentNode.attributes.length?(c=C(s.parentNode.attributes),"".concat(i,"<li ").concat(c,">")):"".concat(i,"<li>")).concat(rt.MARKERS,"<br>"):r?"".concat(i,"<").concat(r,">").concat(rt.MARKERS,"<br></").concat(r,">"):"".concat(i+rt.MARKERS,"<br>")).concat(o);["UL","OL"].indexOf(s.tagName)<0||s.parentNode&&"LI"===s.parentNode.tagName;)s=s.parentNode;m(t).replaceWith('<span id="fr-break"></span>');var c=(c=g.node.openTagString(s)+m(s).html()+g.node.closeTagString(s)).replace(/<span id="fr-break"><\/span>/g,l);m(s).replaceWith(c),g.$el.find("li:empty").remove(),g.$el.find("li > p > span:empty").length&&g.$el.find("li > p > span:empty")[0].parentNode.parentNode.remove()}else if(a&&n||!g.node.isEmpty(t,!0)){var d="<br>",f=e.parentNode;for(f&&"A"===f.tagName&&(f=null);f&&"LI"!==f.tagName;)d=g.node.openTagString(f)+d+g.node.closeTagString(f),f=f.parentNode;f&&f.attributes.length?(l=C(f.attributes),m(t).before("<li ".concat(l,">").concat(d,"</li>"))):m(t).before("<li>".concat(d,"</li>")),m(e).remove()}else{if(a){for(var p=b(t),u="".concat(rt.MARKERS,"<br>"),h=e.parentNode;h&&"LI"!==h.tagName;)u=g.node.openTagString(h)+u+g.node.closeTagString(h),h=h.parentNode;p.parentNode&&"LI"===p.parentNode.tagName?p.parentNode.attributes.length?(c=C(p.parentNode.attributes),m(p.parentNode).after("<li ".concat(c,">").concat(u,"</li>"))):m(p.parentNode).after("<li>".concat(u,"</li>")):r?m(p).after("<".concat(r,">").concat(u,"</").concat(r,">")):m(p).after(u)}else(p=b(t)).parentNode&&"LI"===p.parentNode.tagName?n?m(p.parentNode).before("".concat(g.node.openTagString(t)+rt.MARKERS,"<br></li>")):m(p.parentNode).after("".concat(g.node.openTagString(t)+rt.MARKERS,"<br></li>")):r?m(p).before("<".concat(r,">").concat(rt.MARKERS,"<br></").concat(r,">")):m(p).before("".concat(rt.MARKERS,"<br>"));m(t).remove()}},_middleEnter:function(e){for(var t,n=v(e),a=e,r="",o="",i=!1;a!==n;){var s="A"===(a=a.parentNode).tagName&&g.cursor.isAtEnd(e,a)?"fr-to-remove":"";i||a==n||g.node.isBlock(a)||(i=!0,r+=rt.INVISIBLE_SPACE),r=g.node.openTagString(m(a).clone().addClass(s).get(0))+r,o+=g.node.closeTagString(a)}t=o+""+r+rt.MARKERS+(g.opts.keepFormatOnDelete?rt.INVISIBLE_SPACE:""),m(e).replaceWith('<span id="fr-break"></span>');var l=(l=g.node.openTagString(n)+m(n).html()+g.node.closeTagString(n)).replace(/<span id="fr-break"><\/span>/g,t);m(n).replaceWith(l)},_endEnter:function(e){for(var t,n=v(e),a=rt.MARKERS,r="",o=e,i=!1;o!==n;)(o=o.parentNode).classList.contains("fr-img-space-wrap")||o.classList.contains("fr-img-space-wrap2")||(t="A"===o.tagName&&g.cursor.isAtEnd(e,o)?"fr-to-remove":"",i||o===n||g.node.isBlock(o)||(i=!0,r+=rt.INVISIBLE_SPACE),r=g.node.openTagString(m(o).clone().addClass(t).get(0))+r,a+=g.node.closeTagString(o));var s=r+a;m(e).remove(),m(n).after(s)},_backspace:function(e){var t=v(e),n=t.previousSibling;if(n){n=m(n).find(g.html.blockTagsQuery()).get(-1)||n,m(e).replaceWith(rt.MARKERS);var a=g.node.contents(n);a.length&&"BR"===a[a.length-1].tagName&&m(a[a.length-1]).remove(),m(t).find(g.html.blockTagsQuery()).not("ol, ul, table").each(function(){this.parentNode===t&&m(this).replaceWith(m(this).html()+(g.node.isEmpty(this)?"":"<br>"))});for(var r,o=g.node.contents(t)[0];o&&!g.node.isList(o);)r=o.nextSibling,m(n).append(o),o=r;for(n=t.previousSibling;o;)r=o.nextSibling,m(n).append(o),o=r;1<(a=g.node.contents(n)).length&&"BR"===a[a.length-1].tagName&&m(a[a.length-1]).remove(),m(t).remove()}else{a=b(t);m(e).replaceWith(rt.MARKERS),a.parentNode&&"LI"===a.parentNode.tagName?(e=a.previousSibling,g.node.isBlock(e)?(m(t).find(g.html.blockTagsQuery()).not("ol, ul, table").each(function(){this.parentNode===t&&m(this).replaceWith(m(this).html()+(g.node.isEmpty(this)?"":"<br>"))}),m(e).append(m(t).html())):m(a).before(m(t).html())):(e=g.html.defaultTag())&&0===m(t).find(g.html.blockTagsQuery()).length?m(a).before("<".concat(e,">").concat(m(t).html(),"</").concat(e,">")):m(a).before(m(t).html()),m(t).remove(),g.html.wrap(),0===m(a).find("li").length&&m(a).remove()}},_del:function(e){var t,n=v(e),a=n.nextSibling;if(a){(t=g.node.contents(a)).length&&"BR"===t[0].tagName&&m(t[0]).remove(),m(a).find(g.html.blockTagsQuery()).not("ol, ul, table").each(function(){this.parentNode===a&&m(this).replaceWith(m(this).html()+(g.node.isEmpty(this)?"":"<br>"))});for(var r,o=e,i=g.node.contents(a)[0];i&&!g.node.isList(i);)r=i.nextSibling,m(o).after(i),o=i,i=r;for(;i;)r=i.nextSibling,m(n).append(i),i=r;m(e).replaceWith(rt.MARKERS),m(a).remove()}else{for(var s=n;!s.nextSibling&&s!==g.el;)s=s.parentNode;if(s===g.el)return!1;if(s=s.nextSibling,g.node.isBlock(s))rt.NO_DELETE_TAGS.indexOf(s.tagName)<0&&(m(e).replaceWith(rt.MARKERS),(t=g.node.contents(n)).length&&"BR"===t[t.length-1].tagName&&m(t[t.length-1]).remove(),!s.isContentEditable||"DIV"!==s.tagName||g.node.isBlock(s.previousSibling)&&"DIV"!==s.previousSibling.tagName)&&(m(n).append(m(s).html()),m(s).remove());else{for((t=g.node.contents(n)).length&&"BR"===t[t.length-1].tagName&&m(t[t.length-1]).remove(),m(e).replaceWith(rt.MARKERS);s&&!g.node.isBlock(s)&&"BR"!==s.tagName;)m(n).append(m(s)),s=s.nextSibling;m(s).remove()}}}}},rt.NO_DELETE_TAGS=["TH","TD","TR","TABLE","FORM"],rt.SIMPLE_ENTER_TAGS=["TH","TD","LI","DL","DT","FORM"],rt.MODULES.cursor=function(f){var p=f.$;function c(e){return!!e&&(f.node.isBlock(e)?"P"!==e.tagName||!e.nextElementSibling||!e.parentElement||"OL"!==e.nextElementSibling.tagName||"LI"!==e.parentElement.tagName:e.nextSibling&&e.nextSibling.nodeType===Node.TEXT_NODE&&0===e.nextSibling.textContent.replace(/\u200b/g,"").length?c(e.nextSibling):!(e.nextSibling&&(!e.previousSibling||"BR"!==e.nextSibling.tagName||e.nextSibling.nextSibling))&&c(e.parentNode))}function d(e){return!!e&&(!!f.node.isBlock(e)||(e.previousSibling&&e.previousSibling.nodeType===Node.TEXT_NODE&&0===e.previousSibling.textContent.replace(/\u200b/g,"").length?d(e.previousSibling):!e.previousSibling&&(!(e.previousSibling||!f.node.hasClass(e.parentNode,"fr-inner"))||d(e.parentNode))))}function u(e,t){return!!e&&e!==f.$wp.get(0)&&(e.previousSibling&&e.previousSibling.nodeType===Node.TEXT_NODE&&0===e.previousSibling.textContent.replace(/\u200b/g,"").length?u(e.previousSibling,t):!e.previousSibling&&(e.parentNode===t||u(e.parentNode,t)))}function h(e,t){return!!e&&e!==f.$wp.get(0)&&(e.nextSibling&&e.nextSibling.nodeType===Node.TEXT_NODE&&0===e.nextSibling.textContent.replace(/\u200b/g,"").length?h(e.nextSibling,t):!(e.nextSibling&&(!e.previousSibling||"BR"!==e.nextSibling.tagName||e.nextSibling.nextSibling))&&(e.parentNode===t||h(e.parentNode,t)))}function g(e){return 0<p(e).parentsUntil(f.$el,"LI").length&&0===p(e).parentsUntil("LI","TABLE").length}function m(e,t){t=new RegExp("".concat(t?"^":"","(([\\uD83C-\\uDBFF\\uDC00-\\uDFFF]+\\u200D)*[\\uD83C-\\uDBFF\\uDC00-\\uDFFF]{2})").concat(t?"":"$"),"i"),e=e.match(t);return e?e[0].length:1}function v(e){for(var t,n=e;!n.previousSibling;)if(n=n.parentNode,f.node.isElement(n))return!1;var n=n.previousSibling,a=f.opts.htmlAllowedEmptyTags,r=n.tagName&&n.tagName.toLowerCase();if((!f.node.isBlock(n)||n.lastChild