UNPKG

froala-editor

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.

7 lines (6 loc) 1.3 MB
/*! * froala_editor v4.7.0 (https://www.froala.com/wysiwyg-editor) * License https://froala.com/wysiwyg-editor/terms/ * Copyright 2014-2025 Froala Labs */ !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 a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function E(s){return function(){var e=this,i=arguments;return new Promise(function(t,n){var r=s.apply(e,i);function a(e){l(r,t,n,a,o,"next",e)}function o(e){l(r,t,n,a,o,"throw",e)}a(void 0)})}}function $e(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=c(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n["return"]||n["return"]()}finally{if(s)throw o}}}}function S(e,t,n){return(t=function r(e){var t=function a(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function B(){var h,g,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function r(e,t,n,u){var r=t&&t.prototype instanceof o?t:o,a=Object.create(r.prototype);return d(a,"_invoke",function(r,a,e){var o,i,s,l=0,c=u||[],d=!1,f={p:0,n:0,v:h,a:p,f:p.bind(h,4),d:function(e,t){return o=e,i=0,s=h,f.n=t,m}};function p(e,t){for(i=e,s=t,g=0;!d&&l&&!n&&g<c.length;g++){var n,r=c[g],a=f.p,o=r[2];3<e?(n=o===t)&&(s=r[(i=r[4])?5:(i=3,3)],r[4]=r[5]=h):r[0]<=a&&((n=e<2&&a<r[1])?(i=0,f.v=t,f.n=r[1]):a<o&&(n=e<3||r[0]>t||o<t)&&(r[4]=e,r[5]=t,f.n=o,i=0))}if(n||1<e)return m;throw d=!0,t}return function(e,t,n){if(1<l)throw TypeError("Generator is already running");for(d&&1===t&&p(t,n),i=t,s=n;(g=i<2?h:s)||!d;){o||(i?i<3?(1<i&&(f.n=-1),p(i,s)):f.n=s:f.v=s);try{if(l=2,o){if(i||(e="next"),g=o[e]){if(!(g=g.call(o,s)))throw TypeError("iterator result is not an object");if(!g.done)return g;s=g.value,i<2&&(i=0)}else 1===i&&(g=o["return"])&&g.call(o),i<2&&(s=TypeError("The iterator does not provide a '"+e+"' method"),i=1);o=h}else if((g=(d=f.n<0)?s:r.call(a,f))!==m)break}catch(g){o=h,i=1,s=g}finally{l=1}}return{value:g,done:d}}}(e,n),!0),a}var m={};function o(){}function a(){}function i(){}g=Object.getPrototypeOf;var s=[][t]?g(g([][t]())):(d(g={},t,function(){return this}),g),l=i.prototype=o.prototype=Object.create(s);function c(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,d(e,n,"GeneratorFunction")),e.prototype=Object.create(l),e}return d(l,"constructor",a.prototype=i),d(i,"constructor",a),d(i,n,a.displayName="GeneratorFunction"),d(l),d(l,n,"Generator"),d(l,t,function(){return this}),d(l,"toString",function(){return"[object Generator]"}),(B=function(){return{w:r,m:c}})()}function d(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(d=function(e,t,n,r){function a(t,n){d(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))})(e,t,n,r)}function s(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function k(e,t){return function n(e){if(Array.isArray(e))return e}(e)||function d(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n["return"]&&(i=n["return"](),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||c(e,t)||function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ue(e){return function t(e){if(Array.isArray(e))return a(e)}(e)||function n(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(e)||function r(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _t(e){return(_t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}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))return null;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&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),r=1;r<arguments.length;r++){var a=arguments[r];if(null!=a)for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o])}return n},writable:!0,configurable:!0}),function(){var i=/^\s*:scope/gi,s=/,\s*:scope/gi,l=document.createElement("div");function e(e,t){var o=e[t];e[t]=function(e){var t,n=!1,r=!1;if(!e||Array.isArray(e)||!e.match(i)&&!e.match(s))return o.call(this,e);this.parentNode||(l.appendChild(this),r=!0);var a=this.parentNode;return this.id||(this.id="rootedQuerySelector_id_".concat((new Date).getTime()),n=!0),t=o.call(a,e.replace(i,"#".concat(this.id)).replace(s,",#".concat(this.id))),n&&(this.id=""),r&&l.removeChild(this),t}}try{var t=l.querySelectorAll(":scope *");if(!t||Array.isArray(t))throw"error"}catch(n){e(Element.prototype,"querySelector"),e(Element.prototype,"querySelectorAll"),e(HTMLElement.prototype,"querySelector"),e(HTMLElement.prototype,"querySelectorAll")}}(),"document"in self&&("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g"))||function(e){if("Element"in e){var t="classList",n="prototype",r=e.Element[n],a=Object,o=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},i=Array[n].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1},s=function s(e,t){this.name=e,this.code=DOMException[e],this.message=t},l=function l(e,t){if(""===t)throw new s("SYNTAX_ERR","The token must not be empty.");if(/\s/.test(t))throw new s("INVALID_CHARACTER_ERR","The token must not contain space characters.");return i.call(e,t)},c=function c(e){for(var t=o.call(e.getAttribute("class")||""),n=t?t.split(/\s+/):[],r=0,a=n.length;r<a;r++)this.push(n[r]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},d=c[n]=[],f=function f(){return new c(this)};if(s[n]=Error[n],d.item=function(e){return this[e]||null},d.contains=function(e){return~l(this,e+"")},d.add=function(){for(var e,t=arguments,n=0,r=t.length,a=!1;e=t[n]+"",~l(this,e)||(this.push(e),a=!0),++n<r;);a&&this._updateClassName()},d.remove=function(){var e,t,n=arguments,r=0,a=n.length,o=!1;do{for(e=n[r]+"",t=l(this,e);~t;)this.splice(t,1),o=!0,t=l(this,e)}while(++r<a);o&&this._updateClassName()},d.toggle=function(e,t){var n=this.contains(e),r=n?!0!==t&&"remove":!1!==t&&"add";return r&&this[r](e),!0===t||!1===t?t:!n},d.replace=function(e,t){var n=l(e+"");~n&&(this.splice(n,1,t),this._updateClassName())},d.toString=function(){return this.join(" ")},a.defineProperty){var p={get:f,enumerable:!0,configurable:!0};try{a.defineProperty(r,t,p)}catch(u){void 0!==u.number&&-2146823252!==u.number||(p.enumerable=!1,a.defineProperty(r,t,p))}}else a[n].__defineGetter__&&r.__defineGetter__(t,f)}}(self),function(){var e=document.createElement("_");if(e.classList.add("c1","c2"),!e.classList.contains("c2")){var t=function Vf(e){var Vf=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var t,n=arguments.length;for(t=0;t<n;t++)e=arguments[t],Vf.call(this,e)}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var 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(" "),r=n.indexOf(e+"");~r&&(n=n.slice(r),this.remove.apply(this,n),this.add(t),this.add.apply(this,n.slice(1)))}),e=null}()),function(){var e,t=-1;if("Microsoft Internet Explorer"===navigator.appName?(e=navigator.userAgent,null!==new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1))):"Netscape"===navigator.appName&&(e=navigator.userAgent,null!==new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1))),!("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof HTMLElement||t<0)){var n=!1;try{var r=document.createElement("div");r.addEventListener("focus",function(e){e.preventDefault(),e.stopPropagation()},!0),r.focus(Object.defineProperty({},"preventScroll",{get:function(){if(navigator&&"undefined"!=typeof navigator.userAgent&&navigator.userAgent&&navigator.userAgent.match(/Edge\/1[7-8]/))return n=!1;n=!0}}))}catch(s){}if(HTMLElement.prototype.nativeFocus===undefined&&!n){HTMLElement.prototype.nativeFocus=HTMLElement.prototype.focus;var a=function a(e){for(var t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;t&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push([t,t.scrollTop,t.scrollLeft]),t=t.parentNode;return t=r,n.push([t,t.scrollTop,t.scrollLeft]),n},o=function o(e){for(var t=0;t<e.length;t++)e[t][0].scrollTop=e[t][1],e[t][0].scrollLeft=e[t][2];e=[]},i=function i(e){if(e&&e.preventScroll){var t=a(this);if("function"==typeof setTimeout){var n=this;setTimeout(function(){n.nativeFocus(),o(t)},0)}else this.nativeFocus(),o(t)}else this.nativeFocus()};HTMLElement.prototype.focus=i}}}();function kt(e,t,n){if("string"!=typeof e)return new kt.Bootstrap(e,t,n);var r=document.querySelectorAll(e);t&&t.iframe_document&&(r=t.iframe_document.querySelectorAll(e));for(var a=[],o=0;o<r.length;o++){var i=r[o]["data-froala.editor"];i?a.push(i):a.push(new kt.Bootstrap(r[o],t,n))}return 1==a.length?a[0]:a}kt.RegisterPlugins=function(e){for(var t=0;t<e.length;t++)e[t].call(kt)},Object.assign(kt,{DEFAULTS:{allowStylingOnNonEditable:!1,initOnClick:!1,pluginsEnabled:null,pluginsDisabled:null},MODULES:{},PLUGINS:{},VERSION:"4.7.0",INSTANCES:[],OPTS_MAPPING:{},SHARED:{},ID:0}),kt.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<=kt.BLOCK_TAGS.indexOf(e.tagName.toLowerCase()))}function c(e){var t={},n=e.attributes;if(n)for(var r=0;r<n.length;r++){var a=n[r];t[a.nodeName]=a.value}return t}function t(e){for(var t="",n=c(e),r=Object.keys(n),a=0;a<r.length;a++){var o=r[a],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 r(e){return e===i.el}return{isBlock:l,isEmpty:function d(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 r=!1,a=0;a<n.length;a++){var o=n[a];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(r)return!1;"BR"===o.tagName&&(r=!0)}}return!(e.querySelectorAll(kt.VOID_ELEMENTS.join(",")).length-e.querySelectorAll("br").length||e.querySelector("".concat(i.opts.htmlAllowedEmptyTags.join(":not(.fr-marker),"),":not(.fr-marker)"))||1<e.querySelectorAll(kt.BLOCK_TAGS.join(",")).length||e.querySelector("".concat(i.opts.htmlDoNotWrapTags.join(":not(.fr-marker),"),":not(.fr-marker)")))},blockParent:function a(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 o(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=!0),t.push(i.el),0<=t.indexOf(e.parentNode)||e.parentNode&&i.node.hasClass(e.parentNode,"fr-inner")||e.parentNode&&0<=kt.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")&&(kt.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 f(e){for(var t=e.attributes,n=t.length-1;0<=n;n--){var r=t[n];e.removeAttribute(r.nodeName)}},openTagString:function p(e){return"<".concat(e.tagName.toLowerCase()).concat(t(e),">")},closeTagString:function u(e){return"</".concat(e.tagName.toLowerCase(),">")},isFirstSibling:function h(e,t){void 0===t&&(t=!0);for(var n=e.previousSibling;n&&t&&i.node.hasClass(n,"fr-marker");)n=n.previousSibling;return!n||n.nodeType===Node.TEXT_NODE&&""===n.textContent&&h(n)},isLastSibling:function g(e,t){void 0===t&&(t=!0);for(var n=e.nextSibling;n&&t&&i.node.hasClass(n,"fr-marker");)n=n.nextSibling;return!n||n.nodeType===Node.TEXT_NODE&&""===n.textContent&&g(n)},isList:function m(e){return!!e&&0<=["UL","OL"].indexOf(e.tagName)},isLink:function v(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&"a"===e.tagName.toLowerCase()},isElement:r,contents:s,isVoid:function b(e){return e&&e.nodeType===Node.ELEMENT_NODE&&0<=kt.VOID_ELEMENTS.indexOf((e.tagName||"").toLowerCase())},hasFocus:function C(e){return e===i.doc.activeElement&&(!i.doc.hasFocus||i.doc.hasFocus())&&Boolean(r(e)||e.type||e.href||~e.tabIndex)},isEditable:function E(e){return(!e.getAttribute||"false"!==e.getAttribute("contenteditable"))&&["STYLE","SCRIPT"].indexOf(e.tagName)<0&&!(e.viewportElement&&"svg"===e.viewportElement.tagName)},isDeletable:function y(e){return e&&e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("class")&&0<=(e.getAttribute("class")||"").indexOf("fr-deletable")},hasClass:function A(e,t){return e instanceof n&&(e=e.get(0)),e&&e.classList&&e.classList.contains(t)},filter:function w(e){return i.browser.msie?e:{acceptNode:e}}}},Object.assign(kt.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,preserveTabSpaces:!1,fullPage:!1}),kt.HTML5Map={B:"STRONG",I:"EM",STRIKE:"S"},kt.MODULES.clean=function(m){var v,b,C,E,f=m.$;function a(e){if(e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("class")&&0<=e.getAttribute("class").indexOf("fr-marker")||["TABLE","TBODY","THEAD","TFOOT","TR","TD","TH"].includes(e.nodeName))return!1;var t,n=m.node.contents(e),r=[];for(t=0;t<n.length;t++)n[t].nodeType!==Node.ELEMENT_NODE||m.node.isVoid(n[t])?n[t].nodeType===Node.TEXT_NODE&&(n[t].textContent=n[t].textContent.replace(/\u200b/g,"")):n[t].textContent.replace(/\u200b/g,"").length!==n[t].textContent.length&&a(n[t]);if(e.nodeType===Node.ELEMENT_NODE&&!m.node.isVoid(e)&&(e.normalize(),n=m.node.contents(e),r=e.querySelectorAll(".fr-marker"),n.length-r.length==0)){for(t=0;t<n.length;t++)if(n[t].nodeType===Node.ELEMENT_NODE&&(n[t].getAttribute("class")||"").indexOf("fr-marker")<0)return!1;for(t=0;t<r.length;t++)e.parentNode.insertBefore(r[t].cloneNode(!0),e);return e.parentNode.removeChild(e),!1}}function s(e,t){if(e.nodeType===Node.COMMENT_NODE)return"\x3c!--".concat(e.nodeValue,"--\x3e");if(e.nodeType===Node.TEXT_NODE)return t?e.textContent.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):m.opts.preserveTabSpaces?e.textContent.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\u00A0/g,"&nbsp;").replace(/\t/g," ".repeat(m.opts.tabSpaces)||" ".repeat(4)):e.textContent.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\u00A0/g,"&nbsp;").replace(/\t/g,"");if(e.nodeType!==Node.ELEMENT_NODE)return e.outerHTML;if(e.nodeType===Node.ELEMENT_NODE&&0<=["STYLE","SCRIPT","NOSCRIPT"].indexOf(e.tagName))return e.outerHTML;if(e.nodeType===Node.ELEMENT_NODE&&"svg"===e.tagName){var n=document.createElement("div"),r=e.cloneNode(!0);return n.appendChild(r),n.innerHTML}if("IFRAME"===e.tagName)return e.outerHTML.replace(/&lt;/g,"<").replace(/&gt;/g,">");var a=e.childNodes;if(0===a.length)return e.outerHTML;for(var o="",i=0;i<a.length;i++)"PRE"===e.tagName&&(t=!0),o+=s(a[i],t);return m.node.openTagString(e)+o+m.node.closeTagString(e)}var l=[];function y(e){var t=e.replace(/;;/gi,";");return";"!==(t=t.replace(/^;/gi,"")).charAt(t.length)&&(t+=";"),t}function c(e){var t;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=t.match(C),r=null;"style"===t&&m.opts.htmlAllowedStyleProps.length&&(r=e[t].match(E)),n&&r?e[t]=y(r.join(";")):n&&("style"!==t||r)||delete e[t]}for(var a="",o=Object.keys(e).sort(),i=0;i<o.length;i++)e[t=o[i]].indexOf('"')<0?a+=" ".concat(t,'="').concat(e[t],'"'):a+=" ".concat(t,"='").concat(e[t],"'");return a}function d(e,t){var n,r=document.implementation.createHTMLDocument("Froala DOC").createElement("DIV"),a=e.replace(/(<col[^>]*>)&nbsp;/g,"$1");f(r).append(a);var o="";if(r){var i=m.node.contents(r);for(n=0;n<i.length;n++)t(i[n]);for(i=m.node.contents(r),n=0;n<i.length;n++)o+=s(i[n])}return o}function p(e,t,n){var r=e=function o(e){return l=[],e=(e=(e=(e=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,function(e){return l.push(e),"[FROALA.EDITOR.SCRIPT ".concat(l.length-1,"]")})).replace(/<noscript\b[^<]*(?:(?!<\/noscript>)<[^<]*)*<\/noscript>/gi,function(e){return l.push(e),"[FROALA.EDITOR.NOSCRIPT ".concat(l.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="')}(e),a=null;return m.opts.fullPage&&(r=m.html.extractNode(e,"body")||(0<=e.indexOf("<body")?"":e),n&&(a=m.html.extractNode(e,"head")||"")),r=d(r,t),a&&(a=d(a,t)),function i(e){return e=(e=(e=e.replace(/\[FROALA\.EDITOR\.SCRIPT ([\d]*)\]/gi,function(e,t){return 0<=m.opts.htmlRemoveTags.indexOf("script")?"":l[parseInt(t,10)]})).replace(/\[FROALA\.EDITOR\.NOSCRIPT ([\d]*)\]/gi,function(e,t){if(0<=m.opts.htmlRemoveTags.indexOf("noscript"))return"";var n=l[parseInt(t,10)].replace(/&lt;/g,"<").replace(/&gt;/g,">"),r=f(n);if(r&&r.length){var a=d(r.html(),u);r.html(a),n=r.get(0).outerHTML}return n})).replace(/<img((?:[\w\W]*?)) data-fr-src="/g,'<img$1 src="')}(function s(e,t,n){if(m.opts.fullPage){var r=m.html.extractDoctype(n),a=c(m.html.extractNodeAttrs(n,"html"));t=null===t?m.html.extractNode(n,"head")||"<title></title>":t;var o=c(m.html.extractNodeAttrs(n,"head")),i=c(m.html.extractNodeAttrs(n,"body"));return"".concat(r,"<html").concat(a,"><head").concat(o,">").concat(t,"</head><body").concat(i,">").concat(e,"</body></html>")}return e}(r,a,e))}function A(e){var t=m.doc.createElement("DIV");return t.innerText=e,t.textContent}function u(e){for(var t=m.node.contents(e),n=0;n<t.length;n++)t[n].nodeType!==Node.TEXT_NODE&&u(t[n]);!function g(n){if("SPAN"===n.tagName&&0<=(n.getAttribute("class")||"").indexOf("fr-marker"))return!1;if("PRE"===n.tagName&&function h(e){var t=e.innerHTML;0<=t.indexOf("\n")&&(e.innerHTML=t.replace(/\n/g,"<br>"))}(n),n.nodeType===Node.ELEMENT_NODE&&(n.getAttribute("data-fr-src")&&0!==n.getAttribute("data-fr-src").indexOf("blob:")&&n.setAttribute("data-fr-src",m.helpers.sanitizeURL(A(n.getAttribute("data-fr-src")))),n.getAttribute("href")&&n.setAttribute("href",m.helpers.sanitizeURL(A(n.getAttribute("href")))),n.getAttribute("src")&&n.setAttribute("src",m.helpers.sanitizeURL(A(n.getAttribute("src")))),n.getAttribute("srcdoc")&&n.setAttribute("srcdoc",m.clean.html(n.getAttribute("srcdoc"))),0<=["TABLE","TBODY","TFOOT","TR"].indexOf(n.tagName)&&(n.innerHTML=n.innerHTML.trim())),!m.opts.pasteAllowLocalImages&&n.nodeType===Node.ELEMENT_NODE&&"IMG"===n.tagName&&n.getAttribute("data-fr-src")&&0===n.getAttribute("data-fr-src").indexOf("file://"))return n.parentNode.removeChild(n),!1;if(n.nodeType===Node.ELEMENT_NODE&&kt.HTML5Map[n.tagName]&&""===m.node.attributes(n)){var e=kt.HTML5Map[n.tagName],t="<".concat(e,">").concat(n.innerHTML,"</").concat(e,">");n.insertAdjacentHTML("beforebegin",t),(n=n.previousSibling).parentNode.removeChild(n.nextSibling)}if(m.opts.htmlAllowComments||n.nodeType!==Node.COMMENT_NODE)if(n.tagName&&n.tagName.match(b)){if("STYLE"==n.tagName&&m.helpers.isMac()){var r,a=n.innerHTML.trim(),o=[],i=/{([^}]+)}/g;for(a=a.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*|<!--[\s\S]*?-->$/,"");r=i.exec(a);)o.push(r[1]);for(var s=function s(t){var e=a.substring(0,a.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])}),a=a.substring(a.indexOf("}")+1)},l=0;-1!=a.indexOf("{");l++)s(l)}n.parentNode.removeChild(n)}else if(n.tagName&&!n.tagName.match(v))"svg"===n.tagName?n.parentNode.removeChild(n):m.browser.safari&&"path"===n.tagName&&n.parentNode&&"svg"===n.parentNode.tagName||(n.outerHTML=n.innerHTML);else{var c=n.attributes;if(c)for(var d=c.length-1;0<=d;d--){var f=c[d],p=f.nodeName.match(C),u=null;"style"===f.nodeName&&m.opts.htmlAllowedStyleProps.length&&(u=f.value.match(E)),p&&u?f.value=y(u.join(";")):p&&("style"!==f.nodeName||u)||n.removeAttribute(f.nodeName)}}else 0!==n.data.indexOf("[FROALA.EDITOR")&&n.parentNode.removeChild(n)}(e)}return{_init:function e(){m.opts.fullPage&&f.merge(m.opts.htmlAllowedTags,["head","title","style","link","base","body","html","meta"])},html:function h(e,t,n,r){if(void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r=!1),0<=e.indexOf("<plaintext>")){e=e.replace(/<plaintext>/g,"").replace(/<\/plaintext>/g,"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\u00A0/g,"&nbsp;").replace(/\t/g,m.opts.preserveTabSpaces?" ".repeat(m.opts.tabSpaces||4):"");var a=m.html.defaultTag();m.opts.enter!=kt.ENTER_BR&&(e="<".concat(a,">").concat(e,"</").concat(a,">"))}var o,i=f.merge([],m.opts.htmlAllowedTags);for(o=0;o<t.length;o++)0<=i.indexOf(t[o])&&i.splice(i.indexOf(t[o]),1);var s=f.merge([],m.opts.htmlAllowedAttrs);for(o=0;o<n.length;o++)0<=s.indexOf(n[o])&&s.splice(s.indexOf(n[o]),1);if(s.push("data-fr-.*"),s.push("fr-.*"),v=new RegExp("^".concat(i.join("$|^"),"$"),"gi"),C=new RegExp("^".concat(s.join("$|^"),"$"),"gi"),b=new RegExp("^".concat(m.opts.htmlRemoveTags.join("$|^"),"$"),"gi"),E=m.opts.htmlAllowedStyleProps.length?new RegExp("((^|;|\\s)".concat(m.opts.htmlAllowedStyleProps.join(":.+?(?=;|$))|((^|;|\\s)"),":.+?(?=(;)|$))"),"gi"):null,e=p(e,u,!0),"undefined"!=typeof m.opts.DOMPurify){var l={ALLOW_UNKNOWN_PROTOCOLS:!0};1===m.opts.htmlAllowedTags.length&&".*"===m.opts.htmlAllowedTags[0]||(l.ALLOWED_TAGS=m.opts.htmlAllowedTags),1===m.opts.htmlAllowedAttrs.length&&".*"===m.opts.htmlAllowedAttrs[0]||(l.ALLOWED_ATTR=m.opts.htmlAllowedAttrs),e=m.opts.DOMPurify.sanitize(e,l)}return e},toHTML5:function r(){var e=m.el.querySelectorAll(Object.keys(kt.HTML5Map).join(","));if(e.length){var t=!1;m.el.querySelector(".fr-marker")||(m.selection.save(),t=!0);for(var n=0;n<e.length;n++)""===m.node.attributes(e[n])&&f(e[n]).replaceWith("<".concat(kt.HTML5Map[e[n].tagName],">").concat(e[n].innerHTML,"</").concat(kt.HTML5Map[e[n].tagName],">"));t&&m.selection.restore()}},tables:function t(){!function d(){for(var e=m.el.querySelectorAll("tr"),t=0,n=0;n<e.length;n++){var r=e[n].outerHTML.match(/rowspan="([0-9]+)"/);r&&(t+=Number(r[1])-1);for(var a=e[n].children,o=!0,i=0;i<a.length;i++)if("TH"!==a[i].tagName){o=!1;break}if(!1!==o&&0!==a.length)if(1===a.length&&"TH"===a[0].tagName&&t)t--;else{var s=e[n],l=s.closest("table");if(l){var c=l.querySelector("thead");c||(c=m.doc.createElement("THEAD"),l.insertBefore(c,l.firstChild)),c.contains(s)||c.appendChild(s)}}}}(),function s(){for(var e=m.$el.find("table[style]"),t=0;t<e.length;t++){var n=f(e[t]);n.attr("style").indexOf("width")<0&&n.css("width","100%")}for(var r=m.$el.find("td[width]"),a=0;a<r.length;a++){var o=f(r[a]),i=o.attr("width");i&&(o.css("width",i),o.removeAttr("width"))}}()},lists:function g(){!function s(){var e,t=[];do{if(t.length){var n=t[0],r=m.doc.createElement("ul");n.parentNode.insertBefore(r,n);do{var a=n;n=n.nextSibling,r.appendChild(a)}while(n&&"LI"===n.tagName)}t=[];for(var o=m.el.querySelectorAll("li"),i=0;i<o.length;i++)e=o[i],m.node.isList(e.parentNode)||t.push(o[i])}while(0<t.length)}(),function o(){for(var e=m.el.querySelectorAll("ol + ol, ul + ul"),t=0;t<e.length;t++){var n=e[t];if(m.node.isList(n.previousSibling)&&m.node.openTagString(n)===m.node.openTagString(n.previousSibling)){for(var r=m.node.contents(n),a=0;a<r.length;a++)n.previousSibling.appendChild(r[a]);n.parentNode.removeChild(n)}}}(),function i(){for(var e=m.el.querySelectorAll("ul, ol"),t=0;t<e.length;t++)for(var n=m.node.contents(e[t]),r=null,a=n.length-1;0<=a;a--)!n[a].tagName&&m.opts.htmlUntouched||"LI"===n[a].tagName||"UL"==n[a].tagName||"OL"==n[a].tagName?r=null:"BR"==n[a].tagName?f(n[a]).remove():(r||(r=f(m.doc.createElement("LI"))).insertBefore(n[a]),r.prepend(n[a]))}(),function l(){var e,t,n;do{t=!1;var r=m.el.querySelectorAll("li:empty");for(e=0;e<r.length;e++)r[e].parentNode.removeChild(r[e]);var a=m.el.querySelectorAll("ul, ol");for(e=0;e<a.length;e++)(n=a[e]).querySelector("LI")||(t=!0,n.parentNode.removeChild(n))}while(!0===t)}(),function a(){for(var e=m.el.querySelectorAll("ul > ul, ol > ol, ul > ol, ol > ul"),t=0;t<e.length;t++){var n=e[t],r=n.previousSibling;r&&("LI"===r.tagName?r.appendChild(n):f(n).wrap("<li></li>"))}}(),function c(){for(var e=m.el.querySelectorAll("li > ul, li > ol"),t=0;t<e.length;t++){var n=e[t];if(n.nextSibling)for(var r=n.nextSibling;0<r.childNodes.length;)n.append(r.childNodes[0])}}(),function d(){for(var e=m.el.querySelectorAll("li > ul, li > ol"),t=0;t<e.length;t++){var n=e[t];if(m.node.isFirstSibling(n)&&"none"!=n.parentNode.style.listStyleType)f(n).before("<br/>");else if(n.previousSibling&&"BR"===n.previousSibling.tagName){for(var r=n.previousSibling.previousSibling;r&&m.node.hasClass(r,"fr-marker");)r=r.previousSibling;r&&"BR"!==r.tagName&&f(n.previousSibling).remove()}}}(),function n(){for(var e=m.el.querySelectorAll("li:empty"),t=0;t<e.length;t++)f(e[t]).remove()}(),function r(){for(var e=m.el.querySelectorAll("ul, ol"),t=0;t<e.length;t++)for(var n=e[t],i=m.node.contents(n),s=function s(){var e=i[l],t=m.node.contents(e);if(e.nodeType!==Node.ELEMENT_NODE)return 0;var n=e.querySelectorAll("ul, ol");if(0<n.length&&1==t.length&&t[0].nodeType===Node.ELEMENT_NODE){var r=n[0],a=i[l-1];if(!a)return 0;var o=f(a).data("tracking")&&m.opts.trackChangesEnabled;Ue(r.querySelectorAll("li")).reverse().forEach(function(e){if(o){var t="pending-".concat(m.id,"-").concat(m.track_changes.getPendingChanges().length),n=m.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=e.innerHTML;e.innerHTML='<span data-tracking="true" data-track-id="'.concat(t,'" ').concat(n,">").concat(r,"</span>"),m.track_changes.pushChange(t)}}),a.append(r),e.remove()}},l=0;l<i.length;l++)s()}()},invisibleSpaces:function n(e){return e.replace(/\u200b/g,"").length===e.length?e:m.clean.exec(e,a)},exec:p}},kt.XS=0,kt.SM=1,kt.MD=2,kt.LG=3;kt.LinkRegExCommon="[".concat("a-z\\u0080-\\u009f\\u00a1-\\uffff0-9-_\\.","]{1,}"),kt.LinkRegExEnd="((:[0-9]{1,5})|)(((\\/|\\?|#)[a-zA-Z0-9\\u00a1-\\uffff@\\[\\]\\(\\)\\{\\}.,:;!?%&$^=*+~#_\\-`'\"\\\\\\/|]*)|())",kt.LinkRegExTLD="((".concat(kt.LinkRegExCommon,")(\\.(com|net|org|edu|mil|gov|co|biz|info|me|dev|in|fr|it)))"),kt.LinkRegExHTTP="((ftp|http|https):\\/\\/".concat(kt.LinkRegExCommon,")"),kt.LinkRegExAuth="((ftp|http|https):\\/\\/[\\u0021-\\uffff]{1,}@".concat(kt.LinkRegExCommon,")"),kt.LinkRegExWWW="(www\\.".concat(kt.LinkRegExCommon,"\\.[a-z0-9-]{2,24})"),kt.LinkRegEx="(".concat(kt.LinkRegExTLD,"|").concat(kt.LinkRegExHTTP,"|").concat(kt.LinkRegExWWW,"|").concat(kt.LinkRegExAuth,")").concat(kt.LinkRegExEnd),kt.LinkProtocols=["mailto","tel","sms","notes","data"],kt.MAIL_REGEX=/.+@.+\..+/i,kt.MODULES.helpers=function(o){var i,s=o.$;function e(){var e={},t=function o(){var e,t=-1;return"Microsoft Internet Explorer"===navigator.appName?(e=navigator.userAgent,null!==new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1))):"Netscape"===navigator.appName&&(e=navigator.userAgent,null!==new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1))),t}();if(0<t)e.msie=!0;else{var n=navigator.userAgent.toLowerCase(),r=/(edge)[ /]([\w.]+)/.exec(n)||/(chrome)[ /]([\w.]+)/.exec(n)||/(webkit)[ /]([\w.]+)/.exec(n)||/(opera)(?:.*version|)[ /]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n)||[],a=r[1]||"";r[2];r[1]&&(e[a]=!0),e.chrome?e.webkit=!0:e.webkit&&(e.safari=!0)}return e.msie&&(e.version=t),e}function t(){return(/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||function e(){return navigator.maxTouchPoints&&2<navigator.maxTouchPoints&&/Macintosh/.test(navigator.userAgent)}())&&!a()}function n(){return/(Android)/g.test(navigator.userAgent)&&!a()}function r(){return/(Blackberry)/g.test(navigator.userAgent)}function a(){return/(Windows Phone)/gi.test(navigator.userAgent)}var l=null;return{_init:function c(){o.browser=e()},isIOS:t,isMac:function d(){return null===l&&(l=0<=navigator.platform.toUpperCase().indexOf("MAC")),l},getIOSVersion:function f(){if(t()){var e=navigator.userAgent.match(/OS (\d)?\d_\d(_\d)?/i)||navigator.userAgent.match(/\b[0-9]+_[0-9]+(?:_[0-9]+)?\b/);return e&&e.length&&Math.abs(e[0].split("_")[0].replace("OS ",""))||NaN}return NaN},getSafariVersion:function p(){var e=navigator.userAgent;if(-1!==e.indexOf("Safari")){var t=e.match(/Version\/(\d+\.\d+)/);if(t)return parseInt(t[1])}return null},isAndroid:n,isBlackberry:r,isWindowsPhone:a,isMobile:function u(){return n()||t()||r()},isEmail:function h(e){return!/^(https?:|ftps?:|)\/\//i.test(e)&&kt.MAIL_REGEX.test(e)},requestAnimationFrame:function g(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}},getPX:function m(e){return parseInt(e,10)||0},screenSize:function v(e){try{var t=0;if((t=e?o.$box.width():o.$sc.width())<768)return kt.XS;if(768<=t&&t<992)return kt.SM;if(992<=t&&t<1200)return kt.MD;if(1200<=t)return kt.LG}catch(n){return kt.LG}},isTouch:function b(){return"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch},sanitizeURL:function C(e){if(o.opts.DOMPurify){var t={ALLOW_UNKNOWN_PROTOCOLS:!0,ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|xxx):|[^a-z]|[a-z+.]+(?:[^a-z+.\-:]|$))/i};1===o.opts.htmlAllowedTags.length&&".*"===o.opts.htmlAllowedTags[0]||(t.ALLOWED_TAGS=o.opts.htmlAllowedTags),1===o.opts.htmlAllowedAttrs.length&&".*"===o.opts.htmlAllowedAttrs[0]||(t.ALLOWED_ATTR=o.opts.htmlAllowedAttrs),e=o.opts.DOMPurify.sanitize(e,t)}return e=e.replace(/(["'/]|\s+)on\w+=(?:"[^"]*"|'[^']*'|[^>\s]+)/gi,""),/^(https?:|ftps?:|)\/\//i.test(e)?e:/^([A-Za-z]:(\\){1,2}|[A-Za-z]:((\\){1,2}[^\\]+)+)(\\)?$/i.test(e)?e:new RegExp("^(".concat(kt.LinkProtocols.join("|"),"):"),"i").test(e)?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(e){return e&&!Object.prototype.propertyIsEnumerable.call(e,"length")&&"object"===_t(e)&&"number"==typeof e.length},RGBToHex:function y(e){function t(e){return"0".concat(parseInt(e,10).toString(16)).slice(-2)}try{if(!e||"transparent"===e)return"";if(/^#[0-9A-F]{6}$/i.test(e)||/^#[0-9A-F]{8}$/i.test(e))return e.toUpperCase();var n=e.match(/^rgb\(\s*(\d+),\s*(\d+),\s*(\d+)\s*\)$/i);if(n)return"#".concat(t(n[1])).concat(t(n[2])).concat(t(n[3])).toUpperCase();if(n=e.match(/^rgba\(\s*(\d+),\s*(\d+),\s*(\d+),\s*(\d*\.?\d+)\s*\)$/i))return"#".concat(t(n[1])).concat(t(n[2])).concat(t(n[3])).concat(t(Math.round(255*parseFloat(n[4])))).toUpperCase()}catch(r){return null}},HEXtoRGB:function A(e){if(e=e.replace(/^#/,""),/^rgba?\(\d+,\s*\d+,\s*\d+(,\s*(0|1|0?\.\d+))?\)$/i.test(e))return e;if(3!==e.length&&4!==e.length||(e=e.split("").map(function(e){return e+e}).join("")),6===e.length){var t=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?"rgb(".concat(parseInt(t[1],16),", ").concat(parseInt(t[2],16),", ").concat(parseInt(t[3],16),")"):""}if(8===e.length){var n=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n){var r=parseInt(n[1],16),a=parseInt(n[2],16),o=parseInt(n[3],16),i=parseInt(n[4],16)/255;return"rgba(".concat(r,", ").concat(a,", ").concat(o,", ").concat(i.toFixed(2),")")}}return""},isURL:function w(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(kt.LinkRegExHTTP).concat(kt.LinkRegExEnd,"$"),"gi").test(e))},getAlignment:function T(e){e.css||(e=s(e));var t=(e.css("text-align")||"").replace(/-(.*)-/g,"");if(["left","right","justify","center"].indexOf(t)<0){if(!i){var n=s('<div dir="'.concat("rtl"===o.opts.direction?"rtl":"auto",'" style="text-align: ').concat(o.$el.css("text-align"),'; position: fixed; left: -3000px;"><span id="s1">.</span><span id="s2">.</span></div>'));s("body").first().append(n);var r=n.find("#s1").get(0).getBoundingClientRect().left,a=n.find("#s2").get(0).getBoundingClientRect().left;n.remove(),i=r<a?"left":"right"}t=i}return t},scrollTop:function L(){return o.o_win.pageYOffset?o.o_win.pageYOffset:o.o_doc.documentElement&&o.o_doc.documentElement.scrollTop?o.o_doc.documentElement.scrollTop:o.o_doc.body.scrollTop?o.o_doc.body.scrollTop:0},scrollLeft:function S(){return o.o_win.pageXOffset?o.o_win.pageXOffset:o.o_doc.documentElement&&o.o_doc.documentElement.scrollLeft?o.o_doc.documentElement.scrollLeft:o.o_doc.body.scrollLeft?o.o_doc.body.scrollLeft:0},isInViewPort:function _(e){var t=e.getBoundingClientRect();return 0<=(t={top:Math.round(t.top),bottom:Math.round(t.bottom)}).top&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)||t.top<=0&&t.bottom>=(window.innerHeight||document.documentElement.clientHeight)},isValidHexColor:function k(e){return/^#([0-9A-F]{3}|[0-9A-F]{6})$/i.test(e)},isRGBColor:function x(e){return/^rgba?\(\d+,\s*\d+,\s*\d+(,\s*\d+\.?\d*)?\)$/i.test(e)}}},kt.MODULES.events=function(p){var e,o=p.$,i={};function s(e,t,n){E(e,t,n)}function l(e){if(e.originalEvent&&"insertReplacementText"===e.originalEvent.inputType){var t=p.selection.get();if(!t||0===t.rangeCount)return;for(var n=t.getRangeAt(0),r=n.startContainer,a=n.startOffset,o=n.endContainer,i=n.endOffset;r;){for(var s=r.textContent,l=a-1;0<=l&&g(s[l]);)l--;if(l<=a-1){a=l+1;break}a=(r=u(r))?r.textContent.length:0}for(;o;){for(var c=o.textContent,d=i;d<c.length&&g(c[d]);)d++;if(i<=d&&(d<c.length||!r.isSameNode(o))){i=d;break}o=h(o),i=0}if(r&&o){var f=document.createRange();f.setStart(r,a),f.setEnd(o,i),t.removeAllRanges(),t.addRange(f)}}}function u(e){for(;e;)if((!(e=e.previousSibling)||!o(e).hasClass("fr-marker"))&&e&&e.nodeType===Node.TEXT_NODE&&e.textContent.trim())return e;return null}function h(e){for(;e;)if((!(e=e.nextSibling)||!o(e).hasClass("fr-marker"))&&e&&e.nodeType===Node.TEXT_NODE&&e.textContent.trim())return e;return null}function g(e){return/\w/.test(e)}function c(e){if(void 0===e&&(e=!0),!p.$wp)return!1;if(p.helpers.isIOS()&&p.$win.get(0).focus(),p.core.hasFocus())return!1;if(!p.core.hasFocus()&&e){var t=p.$win.scrollTop();if(p.browser.msie&&p.$box&&p.$box.css("position","fixed"),p.browser.msie&&p.$wp&&p.$wp.css("overflow","visible"),p.browser.msie&&p.$sc&&p.$sc.css("position","fixed"),p.browser.msie||(m(),p.el.focus(),p.events.trigger("focus"),f()),p.browser.msie&&p.$sc&&p.$sc.css("position",""),p.browser.msie&&p.$box&&p.$box.css("position",""),p.browser.msie&&p.$wp&&p.$wp.css("overflow","auto"),t!==p.$win.scrollTop()&&p.$win.scrollTop(t),!p.selection.info(p.el).atStart)return!1}if(!p.core.hasFocus()||0<p.$el.find(".fr-marker").length)return!1;if(p.selection.info(p.el).atStart&&p.selection.isCollapsed()&&null!==p.html.defaultTag()){var n=p.markers.insert();if(n&&!p.node.blockParent(n)){o(n).remove();var r=p.$el.find(p.html.blockTagsQuery()).get(0);r&&(o(r).prepend(kt.MARKERS),p.selection.restore())}else n&&o(n).remove()}}var d=!1;function f(){e=!0}function m(){e=!1}function v(){return e}function b(e,t,n){var r,a=e.split(" ");if(1<a.length){for(var o=0;o<a.length;o++)b(a[o],t,n);return!0}void 0===n&&(n=!1),r=0!==e.indexOf("shared.")?(i[e]=i[e]||[],i[e]):(p.shared._events[e]=p.shared._events[e]||[],p.shared._events[e]),n?r.unshift(t):r.push(t)}var C=[];function E(e,t,n,r,a){"function"==typeof n&&(a=r,r=n,n=!1);var o=a?p.shared.$_events:C,i=a?p.sid:p.id,s="".concat(t.trim().split(" ").join(".ed".concat(i," ")),".ed").concat(i);n?e.on(s,n,r):e.on(s,r),o.push([e,s])}function t(e){for(var t=0;t<e.length;t++)e[t][0].off(e[t][1])}function y(e,t,n){if(!p.edit.isDisabled()||n){var r,a;if(0!==e.indexOf("shared."))r=i[e];else{if(0<p.shared.count)return!1;r=p.shared._events[e]}if(r)for(var o=0;o<r.length;o++)if(!1===(a=r[o].apply(p,t)))return!1;return(!p.opts.events||!p.opts.events[e]||!1!==(a=p.opts.events[e].apply(p,t)))&&a}}function A(){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&delete i[e]}function w(){for(var e in p.shared._events)Object.prototype.hasOwnProperty.call(p.shared._events,e)&&delete p.shared._events[e]}return{_init:function T(){p.shared.$_events=p.shared.$_events||[],p.shared._events={},function e(){p.helpers.isMobile()?(p._mousedown="touchstart",p._mouseup="touchend",p._move="touchmove",p._mousemove="touchmove"):(p._mousedown="mousedown",p._mouseup="mouseup",p._move="",p._mousemove="mousemove")}(),function t(){s(p.$el,"click mouseup mousemove mousedown touchstart touchend dragenter dragover dragleave dragend drop dragstart",function(e){y(e.type,[e])}),b("mousedown",function(){for(var e=0;e<kt.INSTANCES.length;e++)kt.INSTANCES[e]!==p&&kt.INSTANCES[e].popups&&kt.INSTANCES[e].popups.areVisible()&&kt.INSTANCES[e].$el.find(".fr-marker").remove()})}(),function n(){s(p.$win,p._mousedown,function(e){y("window.mousedown",[e]),f()}),s(p.$win,p._mouseup,function(e){y("window.mouseup",[e])}),s(p.$win,"beforeinput cut copy keydown keyup touchmove touchend",function(e){y("window.".concat(e.type),[e])})}(),function r(){s(p.$doc,"dragend drop",function(e){y("document.".concat(e.type),[e])})}(),function a(){s(p.$el,"beforeinput keydown keypress keyup input",function(e){y(e.type,[e])})}(),function o(){s(p.$el,"focus",function(e){v()&&(c(!1),!1===d&&(y(e.type,[e]),p.helpers.isMobile()&&m()))}),s(p.$el,"blur",function(e){v()&&!0===d&&(y(e.type,[e]),p.helpers.isMobile()&&p.opts.toolbarContainer&&(p.shared.selected_editor=p.id),f())}),E(p.$el,"mousedown",'[contenteditable="true"]',function(){m(),p.$el.blur()}),b("focus",function(){d=!0}),b("blur",function(){d=!1})}(),f(),function i(){s(p.$el,"cut copy paste beforepaste",function(e){y(e.type,[e])})}(),b("destroy",A),b("shared.destroy",w),b("beforeinput",l)},on:b,trigger:y,bindClick:function r(e,t,n){E(e,p._mousedown,t,function(e){p.edit.isDisabled()||function n(e){var t=o(e.currentTarget);return p.edit.isDisabled()||p.node.hasClass(t.get(0),"fr-disabled")?(e.preventDefault(),!1):"mousedown"===e.type&&1!==e.which||(p.helpers.isMobile()||e.preventDefault(),(p.helpers.isAndroid()||p.helpers.isWindowsPhone())&&0===t.parents(".fr-dropdown-menu").length&&(e.preventDefault(),e.stopPropagation()),t.addClass("fr-selected"),void p.events.trigger("commands.mousedown",[t]))}(e)},!0),E(e,"".concat(p._mouseup," ").concat(p._move),t,function(e){p.edit.isDisabled()||(p.helpers.isIOS()&&null!==p.selection.get().focusNode&&p.selection.save(),function a(e,t){var n=o(e.currentTarget);if(p.edit.isDisabled()||p.node.hasClass(n.get(0),"fr-disabled"))return e.preventDefault(),!1;if("mouseup"===e.type&&1!==e.which)return!0;if(p.button.getButtons(".fr-selected",!0).get(0)==n.get(0)&&!p.node.hasClass(n.get(0),"fr-selected"))return!0;if("touchmove"!==e.type){if(e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault(),!p.node.hasClass(n.get(0),"fr-selected"))return p.button.getButtons(".fr-selected",!0).removeClass("fr-selected"),!1;if(p.button.getButtons(".fr-selected",!0).removeClass("fr-selected"),n.data("dragging")||n.attr("disabled"))return n.removeData("dragging"),!1;var r=n.data("timeout");r&&(clearTimeout(r),n.removeData("timeout")),t.apply(p,[e])}else n.data("timeout")||n.data("timeout",setTimeout(function(){n.data("dragging",!0)},100))}(e,n))},!0),E(e,"mousedown click mouseup",t,function(e){p.edit.isDisabled()||e.stopPropagation()},!0),b("window.mouseup",function(){p.edit.isDisabled()||(e.find(t).removeClass("fr-selected"),f())}),E(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")}),E(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:m,enableBlur:f,blurActive:v,focus:c,chainTrigger:function L(e,t,n){if(!p.edit.isDisabled()||n){var r,a;if(0!==e.indexOf("shared."))r=i[e];else{if(0<p.shared.count)return!1;r=p.shared._events[e]}if(r)for(var o=0;o<r.length;o++)void 0!==(a=r[o].apply(p,[t]))&&(t=a);return p.opts.events&&p.opts.events[e]&&void 0!==(a=p.opts.events[e].apply(p,[t]))&&(t=a),t}},$on:E,$off:function n(){t(C),C=[],0===p.shared.count&&(t(p.shared.$_events),p.shared.$_events=[])}}},Object.assign(kt.DEFAULTS,{indentMargin:20}),kt.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}},kt.RegisterCommand=function(e,t){kt.COMMANDS[e]=t},kt.MODULES.commands=function(f){var p=f.$;function i(e){return f.html.defaultTag()&&(e="<".concat(f.html.defaultTag(),">").concat(e,"</").concat(f.html.defaultTag(),">")),e}var s={bold:function(){e("bold","strong")},subscript:function(){f.format.is("sup")&&f.format.remove("sup"),e("subscript","sub")},superscript:function(){f.format.is("sub")&&f.format.remove("sub"),e("superscript","sup")},italic:function(){e("italic","em")},strikeThrough:function(){e("strikeThrough","s")},underline:function(){e("underline","u")},undo:function(){f.undo.run()},redo:function(){f.undo.redo()},indent:function(){r(1)},outdent:function(){r(-1)},show:function(){f.opts.toolbarInline&&f.toolbar.showInline(null,!0)},insertHR:function(){f.selection.remove();var e="";f.core.isEmpty()&&(e=i(e="<br>"));var t='<hr id="fr-just" class="fr-just">'.concat(e);f.opts.trackChangesEnabled&&(t=f.track_changes.wrapInTracking(p(t),"hrWrapper").get(0).outerHTML);f.html.insert(t);var n,r=f.$el.find("hr#fr-just").length?f.$el.find("hr#fr-just"):f.$el.find(".fr-just");r.removeAttr("id"),r.removeAttr("class");var a=f.opts.trackChangesEnabled&&"SPAN"===r[0].parentNode.tagName&&"P"===r[0].parentNode.parentNode.tagName;if(0===r.next().length){var o=f.html.defaultTag();o&&!a?r.after(p(f.doc.createElement(o)).append("<br>").get(0)):a?r[0].parentNode.after(p(f.doc.createElement(o)).append("<br>").get(0)):r.after("<br>")}r.prev().is("hr")?n=f.selection.setAfter(r.get(0),!1):r.next().is("hr")?n=f.selection.setBefore(r.get(0),!1):a||f.selection.setAfter(r.get(0),!1)?f.selection.setAfter(r[0].parentNode,!1):f.selection.setBefore(r.get(0),!1),n||void 0===n||(e=i(e="".concat(kt.MARKERS,"<br>")),r.after(e)),f.selection.restore()},clearFormatting:function(){f.format.remove()},selectAll:function(){f.doc.execCommand("selectAll",!1,!1),function d(){var e=null,t=null,n=null,r=null,a=!0===f.opts.iframe,o=p(".fr-iframe")[0],i=a?p(o.contentWindow.document.body):f.$el;if(a&&o){var s=o.contentWindow;n=s.document.createRange.bind(s.document),r=s.getSelection()}else n=document.createRange.bind(document),r=window.getSelection();if(f.selection.isCollapsed()){r.removeAllRanges();var l=i.contents();if(e=l.first()[0],t=l.last()[0],e&&t){var c=n();c.setStart(e,0),c.setEnd(t,t.nodeType===Node.TEXT_NODE?t.textContent.length:t.childNodes.length),r.addRange(c),f.selection.save()}}}()},moreText:f