@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
JavaScript
!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 dt(e){return(dt="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 n,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,n=!1,a=!1;return e&&!Array.isArray(e)&&(e.match(o)||e.match(i))?(this.parentNode||(s.appendChild(this),a=!0),t=this.parentNode,this.id||(this.id="rootedQuerySelector_id_".concat((new Date).getTime()),n=!0),t=r.call(t,e.replace(o,"#".concat(this.id)).replace(i,",#".concat(this.id))),n&&(this.id=""),a&&s.removeChild(this),t):r.call(this,e)}}try{var a=s.querySelectorAll(":scope *");if(!a||Array.isArray(a))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(a=self)){var r="classList",e="prototype",a=a.Element[e],l=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},c=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},d=function(e,t){if(""===t)throw new c("SYNTAX_ERR","The token must not be empty.");if(/\s/.test(t))throw new c("INVALID_CHARACTER_ERR","The token must not contain space characters.");return D.call(e,t)},f=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())}},p=f[e]=[],u=function(){return new f(this)};if(c[e]=Error[e],p.item=function(e){return this[e]||null},p.contains=function(e){return~d(this,e+"")},p.add=function(){for(var e,t=arguments,n=0,a=t.length,r=!1;~d(this,e=t[n]+"")||(this.push(e),r=!0),++n<a;);r&&this._updateClassName()},p.remove=function(){var e,t,n=arguments,a=0,r=n.length,o=!1;do{for(t=d(this,e=n[a]+"");~t;)this.splice(t,1),o=!0,t=d(this,e)}while(++a<r);o&&this._updateClassName()},p.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},p.replace=function(e,t){e=d(e+"");~e&&(this.splice(e,1,t),this._updateClassName())},p.toString=function(){return this.join(" ")},l.defineProperty){p={get:u,enumerable:!0,configurable:!0};try{l.defineProperty(a,r,p)}catch(e){void 0!==e.number&&-2146823252!==e.number||(p.enumerable=!1,l.defineProperty(a,r,p))}}else l[e].__defineGetter__&&a.__defineGetter__(r,u)}(p=document.createElement("_")).classList.add("c1","c2"),p.classList.contains("c2")||((l=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"),l("remove")),p.classList.toggle("c3",!1),p.classList.contains("c3")&&(n=DOMTokenList.prototype.toggle,DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:n.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 h,e=-1;if("Microsoft Internet Explorer"===navigator.appName?(h=navigator.userAgent,null!==new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})").exec(h)&&(e=parseFloat(RegExp.$1))):"Netscape"===navigator.appName&&(h=navigator.userAgent,null!==new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})").exec(h))&&(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 ft(e,t,n){if("string"!=typeof e)return new ft.Bootstrap(e,t,n);for(var a=document.querySelectorAll(e),r=(t&&t.iframe_document&&(a=t.iframe_document.querySelectorAll(e)),[]),o=0;o<a.length;o++){var i=a[o]["data-froala.editor"];r.push(i||new ft.Bootstrap(a[o],t,n))}return 1==r.length?r[0]:r}ft.RegisterPlugins=function(e){for(var t=0;t<e.length;t++)e[t].call(ft)},Object.assign(ft,{DEFAULTS:{initOnClick:!1,pluginsEnabled:null},MODULES:{},PLUGINS:{},VERSION:"4.0.16",INSTANCES:[],OPTS_MAPPING:{},SHARED:{},ID:0}),ft.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<=ft.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,""")),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;for(var n=s(e),a=(1===n.length&&l(n[0])&&(n=s(n[0])),!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(ft.VOID_ELEMENTS.join(",")).length-e.querySelectorAll("br").length||e.querySelector("".concat(i.opts.htmlAllowedEmptyTags.join(":not(.fr-marker),"),":not(.fr-marker)"))||1<e.querySelectorAll(ft.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<=ft.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")&&(ft.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<=ft.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(ft.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}),ft.HTML5Map={B:"STRONG",I:"EM",STRIKE:"S"},ft.MODULES.clean=function(A){var u,h,g,m,w=A.$;function r(e){if(e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("class")&&0<=e.getAttribute("class").indexOf("fr-marker"))return!1;for(var t=A.node.contents(e),n=[],a=0;a<t.length;a++)t[a].nodeType!==Node.ELEMENT_NODE||A.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&&!A.node.isVoid(e)&&(e.normalize(),t=A.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 v(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(g),a=null,"style"===t&&A.opts.htmlAllowedStyleProps.length&&(a=e[t].match(m)),n&&a?e[t]=v(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=(w(n).append(e),"");if(n){for(var r=A.node.contents(n),o=0;o<r.length;o++)t(r[o]);for(r=A.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,"&").replace(/</g,"<").replace(/>/g,">"):t.textContent.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\u00A0/g," ").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(/</g,"<").replace(/>/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 A.node.openTagString(t)+i+A.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,o=(A.opts.fullPage&&(r=A.html.extractNode(e,"body")||(0<=e.indexOf("<body")?"":e),n)&&(o=A.html.extractNode(e,"head")||""),r=l(r,t),o=o&&l(o,t),n=r,t=o,r=e,A.opts.fullPage?(o=A.html.extractDoctype(r),e=s(A.html.extractNodeAttrs(r,"html")),t=null===t?A.html.extractNode(r,"head")||"<title></title>":t,a=s(A.html.extractNodeAttrs(r,"head")),r=s(A.html.extractNodeAttrs(r,"body")),"".concat(o,"<html").concat(e,"><head").concat(a,">").concat(t,"</head><body").concat(r,">").concat(n,"</body></html>")):n);return o.replace(/\[FROALA\.EDITOR\.SCRIPT ([\d]*)\]/gi,function(e,t){return 0<=A.opts.htmlRemoveTags.indexOf("script")?"":i[parseInt(t,10)]}).replace(/\[FROALA\.EDITOR\.NOSCRIPT ([\d]*)\]/gi,function(e,t){var n,a;return 0<=A.opts.htmlRemoveTags.indexOf("noscript")?"":(t=i[parseInt(t,10)].replace(/</g,"<").replace(/>/g,">"),(n=w(t))&&n.length&&(a=l(n.html(),d),n.html(a),t=n.get(0).outerHTML),t)}).replace(/<img((?:[\w\W]*?)) data-fr-src="/g,'<img$1 src="')}function b(e){var t=A.doc.createElement("DIV");return t.innerText=e,t.textContent}function a(n){var e,t;if(!("SPAN"===n.tagName&&0<=(n.getAttribute("class")||"").indexOf("fr-marker")))if("PRE"===n.tagName&&0<=(t=(e=n).innerHTML).indexOf("\n")&&(e.innerHTML=t.replace(/\n/g,"<br>")),n.nodeType===Node.ELEMENT_NODE&&(n.getAttribute("data-fr-src")&&0!==n.getAttribute("data-fr-src").indexOf("blob:")&&n.setAttribute("data-fr-src",A.helpers.sanitizeURL(b(n.getAttribute("data-fr-src")))),n.getAttribute("href")&&n.setAttribute("href",A.helpers.sanitizeURL(b(n.getAttribute("href")))),n.getAttribute("src")&&n.setAttribute("src",A.helpers.sanitizeURL(b(n.getAttribute("src")))),n.getAttribute("srcdoc")&&n.setAttribute("srcdoc",A.clean.html(n.getAttribute("srcdoc"))),0<=["TABLE","TBODY","TFOOT","TR"].indexOf(n.tagName))&&(n.innerHTML=n.innerHTML.trim()),!A.opts.pasteAllowLocalImages&&n.nodeType===Node.ELEMENT_NODE&&"IMG"===n.tagName&&n.getAttribute("data-fr-src")&&0===n.getAttribute("data-fr-src").indexOf("file://"))n.parentNode.removeChild(n);else if(n.nodeType===Node.ELEMENT_NODE&&ft.HTML5Map[n.tagName]&&""===A.node.attributes(n)&&(e=ft.HTML5Map[n.tagName],t="<".concat(e,">").concat(n.innerHTML,"</").concat(e,">"),n.insertAdjacentHTML("beforebegin",t),(n=n.previousSibling).parentNode.removeChild(n.nextSibling)),A.opts.htmlAllowComments||n.nodeType!==Node.COMMENT_NODE)if(n.tagName&&n.tagName.match(h)){if("STYLE"==n.tagName&&A.helpers.isMac()){for(var a,r=n.innerHTML.trim(),o=[],i=/{([^}]+)}/g,r=r.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*|<!--[\s\S]*?-->$/,"");a=i.exec(r);)o.push(a[1]);for(var s=0;-1!=r.indexOf("{");s++)!function(t){var e=r.substring(0,r.indexOf("{")).trim();0==!/^[a-z_-][a-z\d_-]*$/i.test(e)&&n.parentNode.querySelectorAll(e).forEach(function(e){e.removeAttribute("class"),e.setAttribute("style",o[t])}),r=r.substring(r.indexOf("}")+1)}(s)}n.parentNode.removeChild(n)}else if(n.tagName&&!n.tagName.match(u))"svg"===n.tagName?n.parentNode.removeChild(n):A.browser.safari&&"path"===n.tagName&&n.parentNode&&"svg"===n.parentNode.tagName||(n.outerHTML=n.innerHTML);else{var l=n.attributes;if(l)for(var c=l.length-1;0<=c;c--){var d=l[c],f=d.nodeName.match(g),p=null;"style"===d.nodeName&&A.opts.htmlAllowedStyleProps.length&&(p=d.value.match(m)),f&&p?d.value=v(p.join(";")):f&&("style"!==d.nodeName||p)||n.removeAttribute(d.nodeName)}}else 0!==n.data.indexOf("[FROALA.EDITOR")&&n.parentNode.removeChild(n)}function d(e){for(var t=A.node.contents(e),n=0;n<t.length;n++)t[n].nodeType!==Node.TEXT_NODE&&d(t[n]);a(e)}function T(){var e,t=[];do{if(t.length){var n=t[0],a=A.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=A.el.querySelectorAll("li"),i=0;i<o.length;i++)e=o[i],A.node.isList(e.parentNode)||t.push(o[i])}while(0<t.length)}function S(){var e;do{for(var t=!1,n=A.el.querySelectorAll("li:empty"),a=0;a<n.length;a++)n[a].parentNode.removeChild(n[a]);var r=A.el.querySelectorAll("ul, ol");for(a=0;a<r.length;a++)(e=r[a]).querySelector("LI")||(t=!0,e.parentNode.removeChild(e))}while(!0===t)}return{_init:function(){A.opts.fullPage&&w.merge(A.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=w.merge([],A.opts.htmlAllowedTags),o=0;o<t.length;o++)0<=r.indexOf(t[o])&&r.splice(r.indexOf(t[o]),1);var i=w.merge([],A.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-.*"),u=new RegExp("^".concat(r.join("$|^"),"$"),"gi"),g=new RegExp("^".concat(i.join("$|^"),"$"),"gi"),h=new RegExp("^".concat(A.opts.htmlRemoveTags.join("$|^"),"$"),"gi"),m=A.opts.htmlAllowedStyleProps.length?new RegExp("((^|;|\\s)".concat(A.opts.htmlAllowedStyleProps.join(":.+?(?=;|$))|((^|;|\\s)"),":.+?(?=(;)|$))"),"gi"):null,e=c(e,d,!0),e=void 0!==A.opts.DOMPurify?A.opts.DOMPurify.sanitize(e,{ADD_TAGS:A.opts.htmlAllowedTags,ALLOW_UNKNOWN_PROTOCOLS:!0}):e},toHTML5:function(){var e=A.el.querySelectorAll(Object.keys(ft.HTML5Map).join(","));if(e.length){var t=!1;A.el.querySelector(".fr-marker")||(A.selection.save(),t=!0);for(var n=0;n<e.length;n++)""===A.node.attributes(e[n])&&w(e[n]).replaceWith("<".concat(ft.HTML5Map[e[n].tagName],">").concat(e[n].innerHTML,"</").concat(ft.HTML5Map[e[n].tagName],">"));t&&A.selection.restore()}},tables:function(){for(var e=A.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=A.doc.createElement("THEAD"),o.insertBefore(i,o.firstChild)),i.appendChild(e[t])}}},lists:function(){T();for(var e=A.el.querySelectorAll("ol + ol, ul + ul"),t=0;t<e.length;t++){var n=e[t];if(A.node.isList(n.previousSibling)&&A.node.openTagString(n)===A.node.openTagString(n.previousSibling)){for(var a=A.node.contents(n),r=0;r<a.length;r++)n.previousSibling.appendChild(a[r]);n.parentNode.removeChild(n)}}for(var o=A.el.querySelectorAll("ul, ol"),i=0;i<o.length;i++)for(var s=A.node.contents(o[i]),l=null,c=s.length-1;0<=c;c--)(s[c].tagName||!A.opts.htmlUntouched)&&"LI"!==s[c].tagName&&"UL"!=s[c].tagName&&"OL"!=s[c].tagName?"BR"==s[c].tagName?w(s[c]).remove():(l||(l=w(A.doc.createElement("LI"))).insertBefore(s[c]),l.prepend(s[c])):l=null;S();for(var d=A.el.querySelectorAll("ul > ul, ol > ol, ul > ol, ol > ul"),f=0;f<d.length;f++){var p=d[f],u=p.previousSibling;u&&("LI"===u.tagName?u.appendChild(p):w(p).wrap("<li></li>"))}for(var h=A.el.querySelectorAll("li > ul, li > ol"),g=0;g<h.length;g++){var m=h[g];if(m.nextSibling)for(var v=m.nextSibling;0<v.childNodes.length;)m.append(v.childNodes[0])}for(var b=A.el.querySelectorAll("li > ul, li > ol"),C=0;C<b.length;C++){var E=b[C];if(A.node.isFirstSibling(E)&&"none"!=E.parentNode.style.listStyleType)w(E).before("<br/>");else if(E.previousSibling&&"BR"===E.previousSibling.tagName){for(var y=E.previousSibling.previousSibling;y&&A.node.hasClass(y,"fr-marker");)y=y.previousSibling;y&&"BR"!==y.tagName&&w(E.previousSibling).remove()}}for(var L=A.el.querySelectorAll("li:empty"),_=0;_<L.length;_++)w(L[_]).remove()},invisibleSpaces:function(e){return e.replace(/\u200b/g,"").length===e.length?e:A.clean.exec(e,r)},exec:c}},ft.XS=0,ft.SM=1,ft.MD=2,ft.LG=3;function B(e,t){return{altKey:e.altKey,bubbles:e.bubbles,cancelable:e.cancelable,changedTouches:e.changedTouches,ctrlKey:e.ctrlKey,detail:e.detail,eventPhase:e.eventPhase,metaKey:e.metaKey,pageX:e.pageX,pageY:e.pageY,shiftKey:e.shiftKey,view:e.view,char:e.char,key:e.key,keyCode:e.keyCode,button:e.button,buttons:e.buttons,clientX:e.clientX,clientY:e.clientY,offsetX:e.offsetX,offsetY:e.offsetY,pointerId:e.pointerId,pointerType:e.pointerType,screenX:e.screenX,screenY:e.screenY,targetTouches:e.targetTouches,toElement:e.toElement,touches:e.touches,type:e.type,which:e.which,target:e.target,currentTarget:t,originalEvent:e,stopPropagation:function(){e.stopPropagation()},stopImmediatePropagation:function(){e.stopImmediatePropagation()},preventDefault:function(){-1===P.indexOf(e.type)&&e.preventDefault()}}}function $(a,r){return function(e){var t,n=e.target;if(r)for(r=b(r);n&&n!==this;)Element.prototype.matches.call(n,b(r))&&a.call(n,B(e,n)),n=n.parentNode;else((t=n).ownerDocument&&t.ownerDocument.body&&t.ownerDocument.body.contains(t)||"#document"===t.nodeName||"HTML"===t.nodeName||t===window)&&a.call(n,B(e,n))}}function b(e){return e&&"string"==typeof e?e.replace(/^\s*>/g,":scope >").replace(/,\s*>/g,", :scope >"):e}function H(e){return"function"==typeof e&&"number"!=typeof e.nodeType}ft.LinkRegExCommon="[".concat("a-z\\u0080-\\u009f\\u00a1-\\uffff0-9-_\\.","]{1,}"),ft.LinkRegExEnd="((:[0-9]{1,5})|)(((\\/|\\?|#)[a-z\\u00a1-\\uffff0-9@?\\|!^=%&\\/~+#-\\'*-_{}]*)|())",ft.LinkRegExTLD="((".concat(ft.LinkRegExCommon,")(\\.(com|net|org|edu|mil|gov|co|biz|info|me|dev)))"),ft.LinkRegExHTTP="((ftp|http|https):\\/\\/".concat(ft.LinkRegExCommon,")"),ft.LinkRegExAuth="((ftp|http|https):\\/\\/[\\u0021-\\uffff]{1,}@".concat(ft.LinkRegExCommon,")"),ft.LinkRegExWWW="(www\\.".concat(ft.LinkRegExCommon,"\\.[a-z0-9-]{2,24})"),ft.LinkRegEx="(".concat(ft.LinkRegExTLD,"|").concat(ft.LinkRegExHTTP,"|").concat(ft.LinkRegExWWW,"|").concat(ft.LinkRegExAuth,")").concat(ft.LinkRegExEnd),ft.LinkProtocols=["mailto","tel","sms","notes","data"],ft.MAIL_REGEX=/.+@.+\..+/i,ft.MODULES.helpers=function(r){var o,i=r.$;function e(){var e,t,n={},a=(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)),e);return 0<a?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}function t(){return/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&!s()}function n(){return/(Android)/g.test(navigator.userAgent)&&!s()}function a(){return/(Blackberry)/g.test(navigator.userAgent)}function s(){return/(Windows Phone)/gi.test(navigator.userAgent)}var l=null;return{_init:function(){r.browser=e()},isIOS:t,isMac:function(){return l=null===l?0<=navigator.platform.toUpperCase().indexOf("MAC"):l},isAndroid:n,isBlackberry:a,isWindowsPhone:s,isMobile:function(){return n()||t()||a()},isEmail:function(e){return!/^(https?:|ftps?:|)\/\//i.test(e)&&ft.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=0;return(t=(e?r.$box:r.$sc).width())<768?ft.XS:768<=t&&t<992?ft.SM:992<=t&&t<1200?ft.MD:1200<=t?ft.LG:void 0}catch(e){return ft.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})),e=/^(https?:|ftps?:|)\/\//i.test(e)||/^([A-Za-z]:(\\){1,2}|[A-Za-z]:((\\){1,2}[^\\]+)+)(\\)?$/i.test(e)||new RegExp("^(".concat(ft.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(/&/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"===dt(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){return 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))?"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(ft.LinkRegExHTTP).concat(ft.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){return e=e.getBoundingClientRect(),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)}}},ft.MODULES.events=function(i){var t,o=i.$,s={};function e(e,t,n){p(e,t,n)}function n(e){var t;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){var 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;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(ft.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))?!1: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<ft.INSTANCES.length;e++)ft.INSTANCES[e]!==i&&ft.INSTANCES[e].popups&&ft.INSTANCES[e].popups.areVisible()&&ft.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){var t,n,a;i.edit.isDisabled()||(t=r,a=o((e=e).currentTarget),i.edit.isDisabled()||i.node.hasClass(a.get(0),"fr-disabled")?e.preventDefault():"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"):((n=a.data("timeout"))&&(clearTimeout(n),a.removeData("timeout")),t.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(ft.DEFAULTS,{indentMargin:20}),ft.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}},ft.RegisterCommand=function(e,t){ft.COMMANDS[e]=t},ft.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,n="",a=(i.core.isEmpty()&&(n=o(n="<br>")),'<hr id="fr-just" class="fr-just">'.concat(n)),a=(i.opts.trackChangesEnabled&&(a=i.track_changes.wrapInTracking(s(a),"hrWrapper").get(0).outerHTML),i.html.insert(a),i.$el.find("hr#fr-just").length?i.$el.find("hr#fr-just"):i.$el.find(".fr-just")),r=(a.removeAttr("id"),a.removeAttr("class"),i.opts.trackChangesEnabled&&"SPAN"===a[0].parentNode.tagName&&"P"===a[0].parentNode.parentNode.tagName);0===a.next().length&&((t=i.html.defaultTag())&&!r?a.after(s(i.doc.createElement(t)).append("<br>").get(0)):r?a[0].parentNode.after(s(i.doc.createElement(t)).append("<br>").get(0)):a.after("<br>")),a.prev().is("hr")?e=i.selection.setAfter(a.get(0),!1):a.next().is("hr")?e=i.selection.setBefore(a.get(0),!1):r||i.selection.setAfter(a.get(0),!1)?i.selection.setAfter(a[0].parentNode,!1):i.selection.setBefore(a.get(0),!1),e||void 0===e||(n=o(n="".concat(ft.MARKERS,"<br>")),a.after(n)),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 e=i.$tb.find("[data-cmd=".concat(e,"]")),t=i.$tb.find("[data-cmd=html]"),n=(i.opts.trackChangesEnabled?t&&t.addClass("fr-disabled"):t&&t.removeClass("fr-disabled"),e),t=(i.helpers.isMobile()&&i.opts.toolbarInline&&i.events.disableBlur(),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=ft.COMMANDS[e]&&ft.COMMANDS[e].callback||l[e],r=!(a=!0),ft.COMMANDS[e]&&(void 0!==ft.COMMANDS[e].focus&&(a=ft.COMMANDS[e].focus),void 0!==ft.COMMANDS[e].accessibilityFocus)&&(r=ft.COMMANDS[e].accessibilityFocus),(!i.core.hasFocus()&&a||!i.core.hasFocus()&&r&&i.accessibility.hasFocus())&&(i.el.focus({preventScroll:!0}),i.events.trigger("focus")),ft.COMMANDS[e]&&!1!==ft.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||[])),ft.COMMANDS[e])&&!1!==ft.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,n,a,r=i.selection.blocks(),o=0;o<r.length;o++)"LI"===r[o].tagName||"LI"==r[o].parentNode.tagName||"LI"===r[o].tagName&&"LI"===r[o].parentNode.tagName||(t=s(r[o]),"LI"!=r[o].tagName&&"LI"==r[o].parentNode.tagName&&(t=s(r[o].parentNode)),n="rtl"===i.opts.direction||"rtl"===t.css("direction")?"margin-right":"margin-left",a=i.helpers.getPX(t.css(n)),t.width()<2*i.opts.indentMargin&&0<e)||("UL"!=r[o].parentNode.tagName&&"OL"!=r[o].parentNode.tagName&&"LI"!=r[o].parentNode.tagName&&t.css(n,Math.max(a+e*i.opts.indentMargin,0)||""),t.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===ft.KEYCODE.ARROW_LEFT||e.which===ft.KEYCODE.ARROW_UP){if(t.previousSibling)return i.node.isBlock(t.previousSibling)?i.selection.setAtEnd(t.previousSibling):s(t).before(ft.MARKERS),i.selection.restore(),!1}else if((e.which===ft.KEYCODE.ARROW_RIGHT||e.which===ft.KEYCODE.ARROW_DOWN)&&t.nextSibling)return i.node.isBlock(t.nextSibling)?i.selection.setAtStart(t.nextSibling):s(t).after(ft.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(ft.MARKERS)),i.selection.restore())})}})},ft.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(ft.MARKERS,"<br>"):r?"".concat(i,"<").concat(r,">").concat(ft.MARKERS,"<br></").concat(r,">"):"".concat(i+ft.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(ft.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)+ft.MARKERS,"<br></li>")):m(p.parentNode).after("".concat(g.node.openTagString(t)+ft.MARKERS,"<br></li>")):r?m(p).before("<".concat(r,">").concat(ft.MARKERS,"<br></").concat(r,">")):m(p).before("".concat(ft.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+=ft.INVISIBLE_SPACE),r=g.node.openTagString(m(a).clone().addClass(s).get(0))+r,o+=g.node.closeTagString(a)}t=o+""+r+ft.MARKERS+(g.opts.keepFormatOnDelete?ft.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=ft.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+=ft.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(ft.MARKERS);for(var a,r=g.node.contents(n),o=(r.length&&"BR"===r[r.length-1].tagName&&m(r[r.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>"))}),g.node.contents(t)[0]);o&&!g.node.isList(o);)a=o.nextSibling,m(n).append(o),o=a;for(n=t.previousSibling;o;)a=o.nextSibling,m(n).append(o),o=a;1<(r=g.node.contents(n)).length&&"BR"===r[r.length-1].tagName&&m(r[r.length-1]).remove(),m(t).remove()}else{r=b(t);m(e).replaceWith(ft.MARKERS),r.parentNode&&"LI"===r.parentNode.tagName?(e=r.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(r).before(m(t).html())):(e=g.html.defaultTag())&&0===m(t).find(g.html.blockTagsQuery()).length?m(r).before("<".concat(e,">").concat(m(t).html(),"</").concat(e,">")):m(r).before(m(t).html()),m(t).remove(),g.html.wrap(),0===m(r).find("li").length&&m(r).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(ft.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))ft.NO_DELETE_TAGS.indexOf(s.tagName)<0&&(m(e).replaceWith(ft.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(ft.MARKERS);s&&!g.node.isBlock(s)&&"BR"!==s.tagName;)m(n).append(m(s)),s=s.nextSibling;m(s).remove()}}}}},ft.NO_DELETE_TAGS=["TH","TD","TR","TABLE","FORM"],ft.SIMPLE_ENTER_TAGS=["TH","TD","LI","DL","DT","FORM"],ft.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)