/*!
* froala_editor v3.0.0-rc.2 (https://www.froala.com/wysiwyg-editor)
* License https://froala.com/wysiwyg-editor/terms/
* Copyright 2014-2019 Froala Labs
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(w){"use strict";w=w&&w.hasOwnProperty("default")?w["default"]:w,Object.assign(w.DEFAULTS,{wordDeniedTags:[],wordDeniedAttrs:[],wordAllowedStyleProps:["font-family","font-size","background","color","width","text-align","vertical-align","background-color","padding","margin","height","margin-top","margin-left","margin-right","margin-bottom","text-decoration","font-weight","font-style","text-indent","border","border-.*","line-height"],wordPasteModal:!0,wordPasteKeepFormatting:!0}),w.PLUGINS.wordPaste=function(E){var a,n,f=E.$,l="word_paste",g={};function t(e){var t=E.opts.wordAllowedStyleProps;e||(E.opts.wordAllowedStyleProps=[]),0===n.indexOf("
")&&(n=""),n=function(e,t){0<=e.indexOf("]*(]*>[.\s\S\w\W<>]*<\/html>)[.\s\S\w\W<>]*/i,"$1"));!function(e){for(var t=e.split("v:shape"),r=1;r').remove()}}(e,t),!0});for(var a=n.querySelectorAll("ul > ul, ul > ol, ol > ul, ol > ol"),l=a.length-1;0<=l;l--)a[l].previousElementSibling&&"LI"===a[l].previousElementSibling.tagName&&a[l].previousElementSibling.appendChild(a[l]);u(n,function(t){if(t.nodeType===Node.TEXT_NODE)return t.data=t.data.replace(/
(\n|\r)/gi,"
"),!1;if(t.nodeType===Node.ELEMENT_NODE){if(y(t)){var r=t.parentNode,i=t.previousSibling,n=function e(t,r,i){var n=/[0-9a-zA-Z]./gi;var a=!1;var l=!1;var o=!1;var s;var d=t.querySelector('span[style="mso-list:Ignore"]');var f;var g;d&&(a=a||n.test(d.textContent));var u=a?"ol":"ul";var p="<"+u+">";for(;t;){if(!y(t)){if(t.outerHTML&&0"+f+""):(g=e(t,r,c),p+=g.el.outerHTML,t=g.currentNode);var h=t&&t.nextElementSibling;h&&(s=h.previousElementSibling),t&&t.parentNode&&t.parentNode.removeChild(t),t=h}}p+=""+u+">";var m=document.createElement("div");m.innerHTML=p;var v=m.firstElementChild;return{el:v,currentNode:t}}(t,o).el,a=null;return(a=i?i.nextSibling:r.firstChild)?r.insertBefore(n,a):r.appendChild(n),!1}return"FONT"===t.tagName&&o["."+t.getAttribute("class")]&&(t=N(t,"span")),h(t,o)}if(t.nodeType===Node.COMMENT_NODE){if(-1([\r\n\u00a0 ]*)<\/span>/g,function(e,t){for(var r="",i=0;i++/gi,"")}function N(e,t){for(var r=document.createElement(t),i=0;i");for(var l=r.firstElementChild,o=1===r.children.length;l;)"P"!==l.tagName||y(l)||o&&C(l),l=l.nextElementSibling;if(t){var s=r.getAttribute("class");if(s){var d=(s=T(s)).match(/xl[0-9]+/gi);if(d){var f="."+d[0];t[f]&&x(r,t[f])}}t.td&&x(r,t.td)}var g=r.getAttribute("style");g&&(g=T(g))&&";"!==g.slice(-1)&&(g+=";");var u=r.getAttribute("valign");if(!u&&g){var p=g.match(/vertical-align:.+?[; "]{1,1}/gi);p&&(u=p[p.length-1].replace(/vertical-align:(.+?)[; "]{1,1}/gi,"$1"))}var c=null;if(g){var h=g.match(/text-align:.+?[; "]{1,1}/gi);h&&(c=h[h.length-1].replace(/text-align:(.+?)[; "]{1,1}/gi,"$1")),"general"===c&&(c=null)}var m=null;if(g){var v=g.match(/background:.+?[; "]{1,1}/gi);v&&(m=v[v.length-1].replace(/background:(.+?)[; "]{1,1}/gi,"$1"))}var b=r.getAttribute("colspan"),N=r.getAttribute("rowspan");b&&r.setAttribute("colspan",b),N&&r.setAttribute("rowspan",N),u&&(r.style["vertical-align"]=u),c&&(r.style["text-align"]=c),m&&(r.style["background-color"]=m),a&&r.setAttribute("width",a),r=r.nextElementSibling}for(r=e.firstElementChild;r;)a=r.getAttribute("width"),n?r.removeAttribute("width"):r.setAttribute("width",100*parseInt(a,10)/i+"%"),r=r.nextElementSibling}(e,t),"A"!==r||e.attributes.getNamedItem("href")||e.attributes.getNamedItem("name")||!e.innerHTML||(e.outerHTML=e.innerHTML),"A"==r&&e.getAttribute("href")&&e.querySelector("img")){var v=e.querySelectorAll("span");for(i=0;i"),"TABLE"===r&&(e.style.width=e.style.width||"100%"),e.getAttribute("lang")&&e.removeAttribute("lang"),e.getAttribute("style")&&-1!==e.getAttribute("style").toLowerCase().indexOf("mso")){var b=T(e.getAttribute("style"));(b=b.replace(/[0-9a-z-_]*mso[0-9a-z-_]*:.+?(;{1,1}|$)/gi,""))?e.setAttribute("style",b):e.removeAttribute("style")}return!0}return{_init:function(){E.events.on("paste.wordPaste",function(e){return n=e,E.opts.wordPasteModal?function(){if(!a){var e=' '+E.language.translate("Word Paste Detected")+"
",t=(n='',n+='
'+E.language.translate("The pasted content is coming from a Microsoft Word document. Do you want to keep the format or clean it up?")+"
",n+='
",n+="
"),r=E.modals.create(l,e,t),i=r.$body;a=r.$modal,r.$modal.addClass("fr-middle"),E.events.bindClick(i,"button.fr-remove-word",function(){var e=a.data("instance")||E;e.wordPaste.clean()}),E.events.bindClick(i,"button.fr-keep-word",function(){var e=a.data("instance")||E;e.wordPaste.clean(!0)}),E.events.$on(f(E.o_win),"resize",function(){E.modals.resize(l)})}var n;E.modals.show(l),E.modals.resize(l)}():t(E.opts.wordPasteKeepFormatting),!1})},clean:t}}});