/*!
* froala_editor v2.2.1 (https://www.froala.com/wysiwyg-editor)
* License https://froala.com/wysiwyg-editor/terms/
* Copyright 2014-2016 Froala Labs
*/
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){"use strict";a.extend(a.FE.DEFAULTS,{codeMirror:!0,codeMirrorOptions:{lineNumbers:!0,tabMode:"indent",indentWithTabs:!0,lineWrapping:!0,mode:"text/html",tabSize:2}}),a.FE.PLUGINS.codeView=function(b){function c(){return b.$box.hasClass("fr-code-view")}function d(){return l?l.getValue():k.val()}function e(a){var c=d();b.html.set(c),b.$el.blur(),b.$tb.find(" > .fr-command").not(a).removeClass("fr-disabled"),a.removeClass("fr-active"),b.events.focus(!0),b.placeholder.refresh(),b.undo.saveStep()}function f(a,c){k||i(),!l&&b.opts.codeMirror&&"undefined"!=typeof CodeMirror&&(l=CodeMirror.fromTextArea(k.get(0),b.opts.codeMirrorOptions)),b.undo.saveStep(),b.html.cleanEmptyTags(),b.html.cleanWhiteTags(!0),b.core.hasFocus()&&(b.core.isEmpty()||(b.selection.save(),b.$el.find('.fr-marker[data-type="true"]:first').replaceWith('F'),b.$el.find('.fr-marker[data-type="false"]:last').replaceWith('F')),b.$el.blur());var d=b.html.get(!1,!0);b.$el.find("span.fr-tmp").remove(),d=d.replace(/F<\/span>/,"FROALA-SM"),d=d.replace(/F<\/span>/,"FROALA-EM"),b.codeBeautifier&&(d=b.codeBeautifier.run(d,{end_with_newline:!0,indent_inner_html:!0,extra_liners:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","ol","table","dl"],brace_style:"expand",indent_char:" ",indent_size:1,wrap_line_length:0}));var e,f;if(l){e=d.indexOf("FROALA-SM"),f=d.indexOf("FROALA-EM"),e>f?e=f:f-=9,d=d.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"");var g=d.substring(0,e).length-d.substring(0,e).replace(/\n/g,"").length,h=d.substring(0,f).length-d.substring(0,f).replace(/\n/g,"").length;e=d.substring(0,e).length-d.substring(0,d.substring(0,e).lastIndexOf("\n")+1).length,f=d.substring(0,f).length-d.substring(0,d.substring(0,f).lastIndexOf("\n")+1).length,l.setSize(null,Math.max(c,150)),l.setValue(d),l.focus(),l.setSelection({line:g,ch:e},{line:h,ch:f}),l.refresh(),l.clearHistory()}else e=d.indexOf("FROALA-SM"),f=d.indexOf("FROALA-EM")-9,k.css("height",c),(b.opts.height||b.opts.heightMax)&&k.css("max-height",b.opts.height||b.opts.heightMax),k.val(d.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")),k.focus(),k.get(0).setSelectionRange(e,f);b.$tb.find(" > .fr-command").not(a).addClass("fr-disabled"),a.addClass("fr-active"),!b.helpers.isMobile()&&b.opts.toolbarInline&&b.toolbar.hide()}function g(){var a=b.$tb.find('.fr-command[data-cmd="html"]');if(c())b.$box.toggleClass("fr-code-view",!1),e(a);else{b.popups.hideAll();var d=b.$wp.outerHeight();b.$box.toggleClass("fr-code-view",!0),f(a,d)}}function h(){c()&&(g(b.$tb.find('button[data-cmd="html"]')),k.val("").removeData().remove()),m&&m.remove()}function i(){k=a('