wysiwyg-rails 4.1.0 → 4.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/froala_editor.min.js +2 -2
  3. data/app/assets/javascripts/froala_editor.pkgd.min.js +2 -2
  4. data/app/assets/javascripts/languages/ar.js +1 -1
  5. data/app/assets/javascripts/languages/bs.js +1 -1
  6. data/app/assets/javascripts/languages/cs.js +1 -1
  7. data/app/assets/javascripts/languages/da.js +1 -1
  8. data/app/assets/javascripts/languages/de.js +1 -1
  9. data/app/assets/javascripts/languages/el.js +1 -1
  10. data/app/assets/javascripts/languages/en_ca.js +1 -1
  11. data/app/assets/javascripts/languages/en_gb.js +1 -1
  12. data/app/assets/javascripts/languages/es.js +1 -1
  13. data/app/assets/javascripts/languages/et.js +1 -1
  14. data/app/assets/javascripts/languages/fa.js +1 -1
  15. data/app/assets/javascripts/languages/fi.js +1 -1
  16. data/app/assets/javascripts/languages/fr.js +1 -1
  17. data/app/assets/javascripts/languages/he.js +1 -1
  18. data/app/assets/javascripts/languages/hr.js +1 -1
  19. data/app/assets/javascripts/languages/hu.js +1 -1
  20. data/app/assets/javascripts/languages/id.js +1 -1
  21. data/app/assets/javascripts/languages/it.js +1 -1
  22. data/app/assets/javascripts/languages/ja.js +1 -1
  23. data/app/assets/javascripts/languages/ko.js +1 -1
  24. data/app/assets/javascripts/languages/ku.js +1 -1
  25. data/app/assets/javascripts/languages/me.js +1 -1
  26. data/app/assets/javascripts/languages/nb.js +1 -1
  27. data/app/assets/javascripts/languages/nl.js +1 -1
  28. data/app/assets/javascripts/languages/pl.js +1 -1
  29. data/app/assets/javascripts/languages/pt_br.js +1 -1
  30. data/app/assets/javascripts/languages/pt_pt.js +1 -1
  31. data/app/assets/javascripts/languages/ro.js +1 -1
  32. data/app/assets/javascripts/languages/ru.js +1 -1
  33. data/app/assets/javascripts/languages/sk.js +1 -1
  34. data/app/assets/javascripts/languages/sl.js +1 -1
  35. data/app/assets/javascripts/languages/sr.js +1 -1
  36. data/app/assets/javascripts/languages/sv.js +1 -1
  37. data/app/assets/javascripts/languages/th.js +1 -1
  38. data/app/assets/javascripts/languages/tr.js +1 -1
  39. data/app/assets/javascripts/languages/uk.js +1 -1
  40. data/app/assets/javascripts/languages/vi.js +1 -1
  41. data/app/assets/javascripts/languages/zh_cn.js +1 -1
  42. data/app/assets/javascripts/languages/zh_tw.js +1 -1
  43. data/app/assets/javascripts/plugins/align.min.js +1 -1
  44. data/app/assets/javascripts/plugins/char_counter.min.js +1 -1
  45. data/app/assets/javascripts/plugins/code_beautifier.min.js +1 -1
  46. data/app/assets/javascripts/plugins/code_view.min.js +1 -1
  47. data/app/assets/javascripts/plugins/colors.min.js +1 -1
  48. data/app/assets/javascripts/plugins/cryptojs.min.js +1 -1
  49. data/app/assets/javascripts/plugins/draggable.min.js +1 -1
  50. data/app/assets/javascripts/plugins/edit_in_popup.min.js +1 -1
  51. data/app/assets/javascripts/plugins/emoticons.min.js +1 -1
  52. data/app/assets/javascripts/plugins/entities.min.js +1 -1
  53. data/app/assets/javascripts/plugins/file.min.js +1 -1
  54. data/app/assets/javascripts/plugins/files_manager.min.js +1 -1
  55. data/app/assets/javascripts/plugins/font_family.min.js +1 -1
  56. data/app/assets/javascripts/plugins/font_size.min.js +1 -1
  57. data/app/assets/javascripts/plugins/forms.min.js +1 -1
  58. data/app/assets/javascripts/plugins/fullscreen.min.js +1 -1
  59. data/app/assets/javascripts/plugins/help.min.js +1 -1
  60. data/app/assets/javascripts/plugins/image.min.js +1 -1
  61. data/app/assets/javascripts/plugins/image_manager.min.js +1 -1
  62. data/app/assets/javascripts/plugins/inline_class.min.js +1 -1
  63. data/app/assets/javascripts/plugins/inline_style.min.js +1 -1
  64. data/app/assets/javascripts/plugins/line_breaker.min.js +1 -1
  65. data/app/assets/javascripts/plugins/line_height.min.js +1 -1
  66. data/app/assets/javascripts/plugins/link.min.js +2 -2
  67. data/app/assets/javascripts/plugins/lists.min.js +1 -1
  68. data/app/assets/javascripts/plugins/markdown.min.js +1 -1
  69. data/app/assets/javascripts/plugins/paragraph_format.min.js +1 -1
  70. data/app/assets/javascripts/plugins/paragraph_style.min.js +1 -1
  71. data/app/assets/javascripts/plugins/print.min.js +1 -1
  72. data/app/assets/javascripts/plugins/quick_insert.min.js +1 -1
  73. data/app/assets/javascripts/plugins/quote.min.js +1 -1
  74. data/app/assets/javascripts/plugins/save.min.js +1 -1
  75. data/app/assets/javascripts/plugins/special_characters.min.js +1 -1
  76. data/app/assets/javascripts/plugins/table.min.js +1 -1
  77. data/app/assets/javascripts/plugins/track_changes.min.js +1 -1
  78. data/app/assets/javascripts/plugins/trim_video.min.js +1 -1
  79. data/app/assets/javascripts/plugins/url.min.js +2 -2
  80. data/app/assets/javascripts/plugins/video.min.js +1 -1
  81. data/app/assets/javascripts/plugins/word_paste.min.js +1 -1
  82. data/app/assets/javascripts/plugins.pkgd.min.js +2 -2
  83. data/app/assets/javascripts/third_party/embedly.min.js +1 -1
  84. data/app/assets/javascripts/third_party/font_awesome.min.js +1 -1
  85. data/app/assets/javascripts/third_party/image_tui.min.js +1 -1
  86. data/app/assets/javascripts/third_party/showdown.min.js +1 -1
  87. data/app/assets/javascripts/third_party/spell_checker.min.js +1 -1
  88. data/app/assets/stylesheets/froala_editor.css +1 -1
  89. data/app/assets/stylesheets/froala_editor.min.css +1 -1
  90. data/app/assets/stylesheets/froala_editor.pkgd.css +1 -1
  91. data/app/assets/stylesheets/froala_editor.pkgd.min.css +1 -1
  92. data/app/assets/stylesheets/froala_style.css +1 -1
  93. data/app/assets/stylesheets/froala_style.min.css +1 -1
  94. data/app/assets/stylesheets/plugins/char_counter.css +1 -1
  95. data/app/assets/stylesheets/plugins/char_counter.min.css +1 -1
  96. data/app/assets/stylesheets/plugins/code_view.css +1 -1
  97. data/app/assets/stylesheets/plugins/code_view.min.css +1 -1
  98. data/app/assets/stylesheets/plugins/colors.css +1 -1
  99. data/app/assets/stylesheets/plugins/colors.min.css +1 -1
  100. data/app/assets/stylesheets/plugins/draggable.css +1 -1
  101. data/app/assets/stylesheets/plugins/draggable.min.css +1 -1
  102. data/app/assets/stylesheets/plugins/emoticons.css +1 -1
  103. data/app/assets/stylesheets/plugins/emoticons.min.css +1 -1
  104. data/app/assets/stylesheets/plugins/file.css +1 -1
  105. data/app/assets/stylesheets/plugins/file.min.css +1 -1
  106. data/app/assets/stylesheets/plugins/files_manager.css +1 -1
  107. data/app/assets/stylesheets/plugins/files_manager.min.css +1 -1
  108. data/app/assets/stylesheets/plugins/fullscreen.css +1 -1
  109. data/app/assets/stylesheets/plugins/fullscreen.min.css +1 -1
  110. data/app/assets/stylesheets/plugins/help.css +1 -1
  111. data/app/assets/stylesheets/plugins/help.min.css +1 -1
  112. data/app/assets/stylesheets/plugins/image.css +1 -1
  113. data/app/assets/stylesheets/plugins/image.min.css +1 -1
  114. data/app/assets/stylesheets/plugins/image_manager.css +1 -1
  115. data/app/assets/stylesheets/plugins/image_manager.min.css +1 -1
  116. data/app/assets/stylesheets/plugins/line_breaker.css +1 -1
  117. data/app/assets/stylesheets/plugins/line_breaker.min.css +1 -1
  118. data/app/assets/stylesheets/plugins/markdown.css +1 -1
  119. data/app/assets/stylesheets/plugins/markdown.min.css +1 -1
  120. data/app/assets/stylesheets/plugins/quick_insert.css +1 -1
  121. data/app/assets/stylesheets/plugins/quick_insert.min.css +1 -1
  122. data/app/assets/stylesheets/plugins/special_characters.css +1 -1
  123. data/app/assets/stylesheets/plugins/special_characters.min.css +1 -1
  124. data/app/assets/stylesheets/plugins/table.css +1 -1
  125. data/app/assets/stylesheets/plugins/table.min.css +1 -1
  126. data/app/assets/stylesheets/plugins/trim_video.css +1 -1
  127. data/app/assets/stylesheets/plugins/trim_video.min.css +1 -1
  128. data/app/assets/stylesheets/plugins/video.css +1 -1
  129. data/app/assets/stylesheets/plugins/video.min.css +1 -1
  130. data/app/assets/stylesheets/plugins.pkgd.css +1 -1
  131. data/app/assets/stylesheets/plugins.pkgd.min.css +1 -1
  132. data/app/assets/stylesheets/themes/dark.css +1 -1
  133. data/app/assets/stylesheets/themes/dark.min.css +1 -1
  134. data/app/assets/stylesheets/themes/gray.css +1 -1
  135. data/app/assets/stylesheets/themes/gray.min.css +1 -1
  136. data/app/assets/stylesheets/themes/royal.css +1 -1
  137. data/app/assets/stylesheets/themes/royal.min.css +1 -1
  138. data/app/assets/stylesheets/third_party/embedly.css +1 -1
  139. data/app/assets/stylesheets/third_party/embedly.min.css +1 -1
  140. data/app/assets/stylesheets/third_party/font_awesome.css +1 -1
  141. data/app/assets/stylesheets/third_party/font_awesome.min.css +1 -1
  142. data/app/assets/stylesheets/third_party/image_tui.css +1 -1
  143. data/app/assets/stylesheets/third_party/image_tui.min.css +1 -1
  144. data/app/assets/stylesheets/third_party/spell_checker.css +1 -1
  145. data/app/assets/stylesheets/third_party/spell_checker.min.css +1 -1
  146. data/lib/wysiwyg-rails/version.rb +1 -1
  147. metadata +2 -2
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.1.0 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.1.2 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2023 Froala Labs
5
5
  */
6
6
 
7
- !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(y){"use strict";y=y&&y.hasOwnProperty("default")?y["default"]:y,Object.assign(y.POPUP_TEMPLATES,{"link.edit":"[_BUTTONS_]","link.insert":"[_BUTTONS_][_INPUT_LAYER_]"}),Object.assign(y.DEFAULTS,{linkEditButtons:["linkOpen","linkStyle","linkEdit","linkRemove"],linkInsertButtons:["linkBack","|","linkList"],linkAttributes:{},linkAutoPrefix:"http://",linkStyles:{"fr-green":"Green","fr-strong":"Thick"},linkMultipleStyles:!0,linkConvertEmailAddress:!0,linkAlwaysBlank:!1,linkAlwaysNoFollow:!1,linkNoOpener:!0,linkNoReferrer:!0,linkList:[{text:"Froala",href:"https://froala.com",target:"_blank"},{text:"Google",href:"https://google.com",target:"_blank"},{displayText:"Facebook",href:"https://facebook.com"}],linkText:!0}),y.PLUGINS.link=function(h){var m=h.$;function v(){var e=h.image?h.image.get():null;if(e||!h.$wp)return"A"==h.el.tagName?h.el:e&&e.get(0).parentNode&&"A"==e.get(0).parentNode.tagName?e.get(0).parentNode:void 0;var t=h.selection.ranges(0).commonAncestorContainer;try{t&&(t.contains&&t.contains(h.el)||!h.el.contains(t)||h.el==t)&&(t=null)}catch(r){t=null}if(t&&"A"===t.tagName)return t;var n=h.selection.element(),i=h.selection.endElement();"A"==n.tagName||h.node.isElement(n)||(n=h.opts.iframe&&h.markdown.isEnabled?null:m(n).parentsUntil(h.$el,"a").first().get(0)),"A"==i.tagName||h.node.isElement(i)||(i=h.opts.iframe&&h.markdown.isEnabled?null:m(i).parentsUntil(h.$el,"a").first().get(0));try{i&&(i.contains&&i.contains(h.el)||!h.el.contains(i)||h.el==i)&&(i=null)}catch(r){i=null}try{n&&(n.contains&&n.contains(h.el)||!h.el.contains(n)||h.el==n)&&(n=null)}catch(r){n=null}return i&&i==n&&"A"==i.tagName?(h.browser.msie||h.helpers.isMobile())&&(h.selection.info(n).atEnd||h.selection.info(n).atStart)?null:n:null}function b(){var e,t,n,i,r=h.image?h.image.get():null,a=[];if(r)"A"==r.get(0).parentNode.tagName&&a.push(r.get(0).parentNode);else if(h.win.getSelection){var l=h.win.getSelection();if(l.getRangeAt&&l.rangeCount){i=h.doc.createRange();for(var s=0;s<l.rangeCount;++s)if((t=(e=l.getRangeAt(s)).commonAncestorContainer)&&1!=t.nodeType&&(t=t.parentNode),t&&"a"==t.nodeName.toLowerCase())a.push(t);else{n=t.getElementsByTagName("a");for(var o=0;o<n.length;++o)i.selectNodeContents(n[o]),i.compareBoundaryPoints(e.END_TO_START,e)<1&&-1<i.compareBoundaryPoints(e.START_TO_END,e)&&a.push(n[o])}}}else if(h.doc.selection&&"Control"!=h.doc.selection.type)if("a"==(t=(e=h.doc.selection.createRange()).parentElement()).nodeName.toLowerCase())a.push(t);else{n=t.getElementsByTagName("a"),i=h.doc.body.createTextRange();for(var p=0;p<n.length;++p)i.moveToElementText(n[p]),-1<i.compareEndPoints("StartToEnd",e)&&i.compareEndPoints("EndToStart",e)<1&&a.push(n[p])}return a}function E(r){if(h.core.hasFocus()||h.opts.iframe&&(!document.hasFocus||document.hasFocus())){if(a(),r&&"keyup"===r.type&&(r.altKey||r.which==y.KEYCODE.ALT))return!0;setTimeout(function(){if(!r||r&&(1==r.which||"mouseup"!=r.type)){var e=v(),t=h.image?h.image.get():null;if(e&&!t){if(h.image){var n=h.node.contents(e);if(1==n.length&&"IMG"==n[0].tagName){var i=h.selection.ranges(0);return 0===i.startOffset&&0===i.endOffset?m(e).before(y.INVISIBLE_SPACE+y.MARKERS):m(e).after(y.INVISIBLE_SPACE+y.MARKERS),h.selection.restore(),!1}}r&&r.stopPropagation(),l(e)}}},h.helpers.isIOS()?100:0)}}function l(e){var t=h.popups.get("link.edit");t||(t=function a(){var e="";1<=h.opts.linkEditButtons.length&&("A"==h.el.tagName&&0<=h.opts.linkEditButtons.indexOf("linkRemove")&&h.opts.linkEditButtons.splice(h.opts.linkEditButtons.indexOf("linkRemove"),1),e='<div class="fr-buttons">'.concat(h.button.buildList(h.opts.linkEditButtons),"</div>"));var t={buttons:e},n=h.popups.create("link.edit",t);h.$wp&&h.events.$on(h.$wp,"scroll.link-edit",function(){v()&&h.popups.isVisible("link.edit")&&l(v())});return n}());var n=m(e);h.popups.isVisible("link.edit")||h.popups.refresh("link.edit"),h.popups.setContainer("link.edit",h.$sc);var i=n.offset().left+n.outerWidth()/2,r=n.offset().top+n.outerHeight();h.popups.show("link.edit",i,r,n.outerHeight(),!0)}function a(){h.popups.hide("link.edit")}function o(){var e=h.popups.get("link.insert"),t=v();if(t){var n,i,r=m(t),a=e.find('input.fr-link-attr[type="text"]'),l=e.find('input.fr-link-attr[type="checkbox"]');for(n=0;n<a.length;n++)(i=m(a[n])).val(r.attr(i.attr("name")||""));for(l.attr("checked",!1),n=0;n<l.length;n++)i=m(l[n]),r.attr(i.attr("name"))==i.data("checked")&&i.attr("checked",!0);e.find('input.fr-link-attr[type="text"][name="text"]').val(r.text())}else e.find('input.fr-link-attr[type="text"]').val(""),e.find('input.fr-link-attr[type="checkbox"]').attr("checked",!1),e.find('input.fr-link-attr[type="text"][name="text"]').val(h.selection.text());e.find("input.fr-link-attr").trigger("change"),(h.image?h.image.get():null)?e.find('.fr-link-attr[name="text"]').parent().hide():e.find('.fr-link-attr[name="text"]').parent().show()}function s(e){if(e)return h.popups.onRefresh("link.insert",o),!0;var t="";1<=h.opts.linkInsertButtons.length&&(t='<div class="fr-buttons fr-tabs">'.concat(h.button.buildList(h.opts.linkInsertButtons),"</div>"));var n="",i=0;for(var r in n='<div class="fr-link-insert-layer fr-layer fr-active" id="fr-link-insert-layer-'.concat(h.id,'">'),n+='<div class="fr-input-line"><input id="fr-link-insert-layer-url-'.concat(h.id,'" name="href" type="text" class="fr-link-attr" placeholder="').concat(h.language.translate("URL"),'" tabIndex="').concat(++i,'"></div>'),h.opts.linkText&&(n+='<div class="fr-input-line"><input id="fr-link-insert-layer-text-'.concat(h.id,'" name="text" type="text" class="fr-link-attr" placeholder="').concat(h.language.translate("Text"),'" tabIndex="').concat(++i,'"></div>')),h.opts.linkAttributes)if(h.opts.linkAttributes.hasOwnProperty(r)){var a=h.opts.linkAttributes[r];n+='<div class="fr-input-line"><input name="'.concat(r,'" type="text" class="fr-link-attr" placeholder="').concat(h.language.translate(a),'" tabIndex="').concat(++i,'"></div>')}h.opts.linkAlwaysBlank||(n+='<div class="fr-checkbox-line"><span class="fr-checkbox"><input name="target" class="fr-link-attr" data-checked="_blank" type="checkbox" id="fr-link-target-'.concat(h.id,'" tabIndex="').concat(++i,'"><span>').concat('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10" height="10" viewBox="0 0 32 32"><path d="M27 4l-15 15-7-7-5 5 12 12 20-20z" fill="#FFF"></path></svg>','</span></span><label id="fr-label-target-').concat(h.id,'">').concat(h.language.translate("Open in new tab"),"</label></div>"));var l={buttons:t,input_layer:n+='<div class="fr-action-buttons"><button class="fr-command fr-submit" role="button" data-cmd="linkInsert" href="#" tabIndex="'.concat(++i,'" type="button">').concat(h.language.translate("Insert"),"</button></div></div>")},s=h.popups.create("link.insert",l);return h.$wp&&h.events.$on(h.$wp,"scroll.link-insert",function(){(h.image?h.image.get():null)&&h.popups.isVisible("link.insert")&&f(),h.popups.isVisible("link.insert")&&c()}),s}function p(e,t,n){if(h.opts.trackChangesEnabled){if(h.edit.on(),h.events.focus(!0),h.undo.saveStep(),h.markers.insert(),h.html.wrap(),!h.$el.find(".fr-marker").length)return void h.popups.hide("link.insert");h.markers.remove()}if(void 0===n&&(n={}),!1===h.events.trigger("link.beforeInsert",[e,t,n]))return!1;var i=h.image?h.image.get():null;i||"A"==h.el.tagName?"A"==h.el.tagName&&h.$el.focus():(h.selection.restore(),h.popups.hide("link.insert"));var r=e;h.opts.linkConvertEmailAddress&&h.helpers.isEmail(e)&&!/^mailto:.*/i.test(e)&&(e="mailto:".concat(e));if(""===h.opts.linkAutoPrefix||new RegExp("^("+y.LinkProtocols.join("|")+"):.","i").test(e)||/^data:image.*/i.test(e)||/^(https?:|ftps?:|file:|)\/\//i.test(e)||/^([A-Za-z]:(\\){1,2}|[A-Za-z]:((\\){1,2}[^\\]+)+)(\\)?$/i.test(e)||["/","{","[","#","(",".",'"',"\\"].indexOf((e||"")[0])<0&&(e=h.opts.linkAutoPrefix+e),e=h.helpers.sanitizeURL(e),h.opts.linkAlwaysBlank&&(n.target="_blank"),h.opts.linkAlwaysNoFollow&&(n.rel="nofollow"),h.helpers.isEmail(r)&&(n.target=null,n.rel=null),"_blank"==n.target?(h.opts.linkNoOpener&&(n.rel?n.rel+=" noopener":n.rel="noopener"),h.opts.linkNoReferrer&&(n.rel?n.rel+=" noreferrer":n.rel="noreferrer")):null==n.target&&(n.rel?n.rel=n.rel.replace(/noopener/,"").replace(/noreferrer/,""):n.rel=null),t=t||"",e===h.opts.linkAutoPrefix)return h.popups.get("link.insert").find('input[name="href"]').addClass("fr-error"),h.events.trigger("link.bad",[r]),!1;var a,l=v();if(l){if((a=m(l)).attr("href",e),0<t.length&&a.text()!=t&&!i){if(h.opts.trackChangesEnabled){var s=m(a.get(0).outerHTML);s.insertBefore(a.parent());var o=h.track_changes.wrapLinkInTracking(s,h.track_changes.getPendingChanges().length-1),p=h.track_changes.wrapInDelete(o);a.parent().append(p)}for(var c=a.get(0);1===c.childNodes.length&&c.childNodes[0].nodeType==Node.ELEMENT_NODE;)c=c.childNodes[0];m(c).text(t)}for(var f in i||a.prepend(y.START_MARKER).append(y.END_MARKER),n)n[f]?a.attr(f,n[f]):a.removeAttr(f);i||h.selection.restore()}else{i?(i.wrap('<a href="'.concat(e,'"></a>')),h.image.hasCaption()&&i.parent().append(i.parents(".fr-img-caption").find(".fr-inner"))):(h.format.remove("a"),h.selection.isCollapsed()?(t=0===t.length?r:t,h.html.insert('<a href="'.concat(e,'">').concat(y.START_MARKER).concat(t.replace(/&/g,"&amp;").replace(/</,"&lt;",">","&gt;")).concat(y.END_MARKER,"</a>")),h.selection.restore()):0<t.length&&t!=h.selection.text().replace(/\n/g,"")?(h.selection.remove(),h.html.insert('<a href="'.concat(e,'">').concat(y.START_MARKER).concat(t.replace(/&/g,"&amp;")).concat(y.END_MARKER,"</a>")),h.selection.restore()):(!function g(){if(!h.selection.isCollapsed()){h.selection.save();for(var e=h.$el.find(".fr-marker").addClass("fr-unprocessed").toArray();e.length;){var t=m(e.pop());t.removeClass("fr-unprocessed");var n=h.node.deepestParent(t.get(0));if(n){for(var i=t.get(0),r="",a="";i=i.parentNode,h.node.isBlock(i)||(r+=h.node.closeTagString(i),a=h.node.openTagString(i)+a),i!=n;);var l=h.node.openTagString(t.get(0))+t.html()+h.node.closeTagString(t.get(0));t.replaceWith('<span id="fr-break"></span>');var s=n.outerHTML;s=(s=s.replace(/<span id="fr-break"><\/span>/g,r+l+a)).replace(a+r,""),n.outerHTML=s}e=h.$el.find(".fr-marker.fr-unprocessed").toArray()}h.html.cleanEmptyTags(),h.selection.restore()}}(),h.format.apply("a",{href:e})));for(var d=b(),u=0;u<d.length;u++)(a=m(d[u])).attr(n),a.removeAttr("_moz_dirty");1==d.length&&h.$wp&&!i&&(m(d[0]).prepend(y.START_MARKER).append(y.END_MARKER),h.selection.restore())}if(i){var k=h.popups.get("link.insert");k&&k.find("input:focus").blur(),h.image.edit(i)}else E()}function c(){a();var e=v();if(e){var t=h.popups.get("link.insert");t||(t=s()),h.popups.isVisible("link.insert")||(h.popups.refresh("link.insert"),h.selection.save(),h.helpers.isMobile()&&(h.events.disableBlur(),h.$el.blur(),h.events.enableBlur())),h.popups.setContainer("link.insert",h.$sc);var n=(h.image?h.image.get():null)||m(e),i=n.offset().left+n.outerWidth()/2,r=n.offset().top+n.outerHeight();h.popups.show("link.insert",i,r,n.outerHeight(),!0)}}function f(){var e=h.image?h.image.getEl():null;if(e){var t=h.popups.get("link.insert"),n=e.outerWidth()/2;h.image.hasCaption()&&(e=e.find(".fr-img-wrap"),m(e)&&m(e).find("img")&&(n=m(e).find("img").outerWidth()/2)),t||(t=s()),o(),h.popups.setContainer("link.insert",h.$sc);var i=e.offset().left+n,r=e.offset().top+e.outerHeight(),a=e.outerHeight();h.opts.iframe&&h.image.hasCaption()&&m(e)&&m(e).find("img")&&(a=m(e).find("img").outerHeight()),h.popups.show("link.insert",i,r,a,!0)}}return{_init:function e(){h.events.on("keyup",function(e){e.which!=y.KEYCODE.ESC&&E(e)}),h.events.on("window.mouseup",E),h.events.$on(h.$el,"click","a",function(e){h.edit.isDisabled()&&e.preventDefault()}),h.helpers.isMobile()&&h.events.$on(h.$doc,"selectionchange",E),s(!0),"A"==h.el.tagName&&h.$el.addClass("fr-view"),h.events.on("toolbar.esc",function(){if(h.popups.isVisible("link.edit"))return h.events.disableBlur(),h.events.focus(),!1},!0)},remove:function i(){var e=v(),t=h.image?h.image.get():null;if(!1===h.events.trigger("link.beforeRemove",[e]))return!1;if(t&&e)if(h.image.hasCaption()){t.addClass("img-link-caption"),m(e).replaceWith(m(e).html());var n=document.querySelectorAll("img.img-link-caption");h.image.edit(m(n[0])),m(n[0]).removeClass("img-link-caption")}else t.unwrap(),h.image.edit(t);else e&&(h.selection.save(),m(e).replaceWith(m(e).html()),h.selection.restore(),a())},showInsertPopup:function d(){var e=h.$tb.find('.fr-command[data-cmd="insertLink"]'),t=h.popups.get("link.insert");if(t||(t=s()),!t.hasClass("fr-active"))if(h.popups.refresh("link.insert"),h.popups.setContainer("link.insert",h.$tb||h.$sc),e.isVisible()){var n=h.button.getPosition(e),i=n.left,r=n.top;h.popups.show("link.insert",i,r,e.outerHeight())}else h.position.forSelection(t),h.popups.show("link.insert")},usePredefined:function u(e){var t,n,i=h.opts.linkList[e],r=h.popups.get("link.insert"),a=r.find('input.fr-link-attr[type="text"]'),l=r.find('input.fr-link-attr[type="checkbox"]');for(i.rel&&(r.rel=i.rel),n=0;n<a.length;n++)i[(t=m(a[n])).attr("name")]?(t.val(i[t.attr("name")]),t.toggleClass("fr-not-empty",!0)):"text"!=t.attr("name")&&t.val("");for(n=0;n<l.length;n++)(t=m(l[n])).attr("checked",t.data("checked")==i[t.attr("name")]);h.accessibility.focusPopup(r)},insertCallback:function k(){var e,t,n=h.popups.get("link.insert"),i=n.find('input.fr-link-attr[type="text"]'),r=n.find('input.fr-link-attr[type="checkbox"]'),a=(i.filter('[name="href"]').val()||"").trim(),l=h.opts.linkText?i.filter('[name="text"]').val():"",s={};for(t=0;t<i.length;t++)e=m(i[t]),["href","text"].indexOf(e.attr("name"))<0&&(s[e.attr("name")]=e.val());for(t=0;t<r.length;t++)(e=m(r[t])).is(":checked")?s[e.attr("name")]=e.data("checked"):s[e.attr("name")]=e.data("unchecked")||null;n.rel&&(s.rel=n.rel);var o=h.helpers.scrollTop();p(a,l,s),m(h.o_win).scrollTop(o)},insert:p,update:c,get:v,allSelected:b,back:function t(){h.image&&h.image.get()?h.image.back():(h.events.disableBlur(),h.selection.restore(),h.events.enableBlur(),v()&&h.$wp?(h.selection.restore(),a(),E()):"A"==h.el.tagName?(h.$el.focus(),E()):(h.popups.hide("link.insert"),h.toolbar.showInline()))},imageLink:f,applyStyle:function g(e,t,n){void 0===n&&(n=h.opts.linkMultipleStyles),void 0===t&&(t=h.opts.linkStyles);var i=v();if(!i)return!1;if(!n){var r=Object.keys(t);r.splice(r.indexOf(e),1),m(i).removeClass(r.join(" "))}m(i).toggleClass(e),E()}}},y.DefineIcon("insertLink",{NAME:"link",SVG_KEY:"insertLink"}),y.RegisterShortcut(y.KEYCODE.K,"insertLink",null,"K"),y.RegisterCommand("insertLink",{title:"Insert Link",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("link.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("link.insert")):this.link.showInsertPopup()},plugin:"link"}),y.DefineIcon("linkOpen",{NAME:"external-link",FA5NAME:"external-link-alt",SVG_KEY:"openLink"}),y.RegisterCommand("linkOpen",{title:"Open Link",undo:!1,refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},callback:function(){var e=this.link.get();e&&(-1!==e.href.indexOf("mailto:")?this.o_win.open(e.href).close():(e.target||(e.target="_self"),this.browser.msie||this.browser.edge?this.o_win.open(e.href,e.target):this.o_win.open(e.href,e.target,"noopener")),this.popups.hide("link.edit"))},plugin:"link"}),y.DefineIcon("linkEdit",{NAME:"edit",SVG_KEY:"edit"}),y.RegisterCommand("linkEdit",{title:"Edit Link",undo:!1,refreshAfterCallback:!1,popup:!0,callback:function(){this.link.update()},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"}),y.DefineIcon("linkRemove",{NAME:"unlink",SVG_KEY:"unlink"}),y.RegisterCommand("linkRemove",{title:"Unlink",callback:function(){this.link.remove()},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"}),y.DefineIcon("linkBack",{NAME:"arrow-left",SVG_KEY:"back"}),y.RegisterCommand("linkBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.link.back()},refresh:function(e){var t=this.link.get()&&this.doc.hasFocus();(this.image?this.image.get():null)||t||this.opts.toolbarInline?(e.removeClass("fr-hidden"),e.next(".fr-separator").removeClass("fr-hidden")):(e.addClass("fr-hidden"),e.next(".fr-separator").addClass("fr-hidden"))},plugin:"link"}),y.DefineIcon("linkList",{NAME:"search",SVG_KEY:"search"}),y.RegisterCommand("linkList",{title:"Choose Link",type:"dropdown",focus:!1,undo:!1,refreshAfterCallback:!1,html:function(){for(var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.linkList,n=0;n<t.length;n++)e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="linkList" data-param1="'.concat(n,'">').concat(t[n].displayText||t[n].text,"</a></li>");return e+="</ul>"},callback:function(e,t){this.link.usePredefined(t)},plugin:"link"}),y.RegisterCommand("linkInsert",{focus:!1,refreshAfterCallback:!1,callback:function(){this.link.insertCallback()},refresh:function(e){this.link.get()?e.text(this.language.translate("Update")):e.text(this.language.translate("Insert"))},plugin:"link"}),y.DefineIcon("imageLink",{NAME:"link",SVG_KEY:"insertLink"}),y.RegisterCommand("imageLink",{title:"Insert Link",undo:!1,focus:!1,popup:!0,callback:function(){this.link.imageLink()},refresh:function(e){var t;this.link.get()?((t=e.prev()).hasClass("fr-separator")&&t.removeClass("fr-hidden"),e.addClass("fr-hidden")):((t=e.prev()).hasClass("fr-separator")&&t.addClass("fr-hidden"),e.removeClass("fr-hidden"))},plugin:"link"}),y.DefineIcon("linkStyle",{NAME:"magic",SVG_KEY:"linkStyles"}),y.RegisterCommand("linkStyle",{title:"Style",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.linkStyles;for(var n in t)t.hasOwnProperty(n)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="linkStyle" data-param1="'.concat(n,'">').concat(this.language.translate(t[n]),"</a></li>"));return e+="</ul>"},callback:function(e,t){this.link.applyStyle(t)},refreshOnShow:function(e,t){var n=this.$,i=this.link.get();if(i){var r=n(i);t.find(".fr-command").each(function(){var e=n(this).data("param1"),t=r.hasClass(e);n(this).toggleClass("fr-active",t).attr("aria-selected",t)})}},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"})});
7
+ !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(y){"use strict";y=y&&y.hasOwnProperty("default")?y["default"]:y,Object.assign(y.POPUP_TEMPLATES,{"link.edit":"[_BUTTONS_]","link.insert":"[_BUTTONS_][_INPUT_LAYER_]"}),Object.assign(y.DEFAULTS,{linkEditButtons:["linkOpen","linkStyle","linkEdit","linkRemove"],linkInsertButtons:["linkBack","|","linkList"],linkAttributes:{},linkAutoPrefix:"http://",linkStyles:{"fr-green":"Green","fr-strong":"Thick"},linkMultipleStyles:!0,linkConvertEmailAddress:!0,linkAlwaysBlank:!1,linkAlwaysNoFollow:!1,linkNoOpener:!0,linkNoReferrer:!0,linkList:[{text:"Froala",href:"https://froala.com",target:"_blank"},{text:"Google",href:"https://google.com",target:"_blank"},{displayText:"Facebook",href:"https://facebook.com"}],linkText:!0}),y.PLUGINS.link=function(h){var m=h.$;function v(){var e=h.image?h.image.get():null;if(e||!h.$wp)return"A"==h.el.tagName?h.el:e&&e.get(0).parentNode&&"A"==e.get(0).parentNode.tagName?e.get(0).parentNode:void 0;var t=h.selection.ranges(0).commonAncestorContainer;try{t&&(t.contains&&t.contains(h.el)||!h.el.contains(t)||h.el==t)&&(t=null)}catch(l){t=null}if(t&&"A"===t.tagName)return t;var n,i,r=h.selection.element(),a=h.selection.endElement();"A"==r.tagName||h.node.isElement(r)||(r=h.opts.iframe&&null!==(n=h.markdown)&&void 0!==n&&n.isEnabled?null:m(r).parentsUntil(h.$el,"a").first().get(0));"A"==a.tagName||h.node.isElement(a)||(a=h.opts.iframe&&null!==(i=h.markdown)&&void 0!==i&&i.isEnabled?null:m(a).parentsUntil(h.$el,"a").first().get(0));try{a&&(a.contains&&a.contains(h.el)||!h.el.contains(a)||h.el==a)&&(a=null)}catch(l){a=null}try{r&&(r.contains&&r.contains(h.el)||!h.el.contains(r)||h.el==r)&&(r=null)}catch(l){r=null}return a&&a==r&&"A"==a.tagName?(h.browser.msie||h.helpers.isMobile())&&(h.selection.info(r).atEnd||h.selection.info(r).atStart)?null:r:null}function b(){var e,t,n,i,r=h.image?h.image.get():null,a=[];if(r)"A"==r.get(0).parentNode.tagName&&a.push(r.get(0).parentNode);else if(h.win.getSelection){var l=h.win.getSelection();if(l.getRangeAt&&l.rangeCount){i=h.doc.createRange();for(var s=0;s<l.rangeCount;++s)if((t=(e=l.getRangeAt(s)).commonAncestorContainer)&&1!=t.nodeType&&(t=t.parentNode),t&&"a"==t.nodeName.toLowerCase())a.push(t);else{n=t.getElementsByTagName("a");for(var o=0;o<n.length;++o)i.selectNodeContents(n[o]),i.compareBoundaryPoints(e.END_TO_START,e)<1&&-1<i.compareBoundaryPoints(e.START_TO_END,e)&&a.push(n[o])}}}else if(h.doc.selection&&"Control"!=h.doc.selection.type)if("a"==(t=(e=h.doc.selection.createRange()).parentElement()).nodeName.toLowerCase())a.push(t);else{n=t.getElementsByTagName("a"),i=h.doc.body.createTextRange();for(var p=0;p<n.length;++p)i.moveToElementText(n[p]),-1<i.compareEndPoints("StartToEnd",e)&&i.compareEndPoints("EndToStart",e)<1&&a.push(n[p])}return a}function E(r){if(h.core.hasFocus()||h.opts.iframe&&(!document.hasFocus||document.hasFocus())){if(a(),r&&"keyup"===r.type&&(r.altKey||r.which==y.KEYCODE.ALT))return!0;setTimeout(function(){if(!r||r&&(1==r.which||"mouseup"!=r.type)){var e=v(),t=h.image?h.image.get():null;if(e&&!t){if(h.image){var n=h.node.contents(e);if(1==n.length&&"IMG"==n[0].tagName){var i=h.selection.ranges(0);return 0===i.startOffset&&0===i.endOffset?m(e).before(y.INVISIBLE_SPACE+y.MARKERS):m(e).after(y.INVISIBLE_SPACE+y.MARKERS),h.selection.restore(),!1}}r&&r.stopPropagation(),l(e)}}},h.helpers.isIOS()?100:0)}}function l(e){var t=h.popups.get("link.edit");t||(t=function a(){var e="";1<=h.opts.linkEditButtons.length&&("A"==h.el.tagName&&0<=h.opts.linkEditButtons.indexOf("linkRemove")&&h.opts.linkEditButtons.splice(h.opts.linkEditButtons.indexOf("linkRemove"),1),e='<div class="fr-buttons">'.concat(h.button.buildList(h.opts.linkEditButtons),"</div>"));var t={buttons:e},n=h.popups.create("link.edit",t);h.$wp&&h.events.$on(h.$wp,"scroll.link-edit",function(){v()&&h.popups.isVisible("link.edit")&&l(v())});return n}());var n=m(e);h.popups.isVisible("link.edit")||h.popups.refresh("link.edit"),h.popups.setContainer("link.edit",h.$sc);var i=n.offset().left+n.outerWidth()/2,r=n.offset().top+n.outerHeight();h.popups.show("link.edit",i,r,n.outerHeight(),!0)}function a(){h.popups.hide("link.edit")}function o(){var e=h.popups.get("link.insert"),t=v();if(t){var n,i,r=m(t),a=e.find('input.fr-link-attr[type="text"]'),l=e.find('input.fr-link-attr[type="checkbox"]');for(n=0;n<a.length;n++)(i=m(a[n])).val(r.attr(i.attr("name")||""));for(l.attr("checked",!1),n=0;n<l.length;n++)i=m(l[n]),r.attr(i.attr("name"))==i.data("checked")&&i.attr("checked",!0);e.find('input.fr-link-attr[type="text"][name="text"]').val(r.text())}else e.find('input.fr-link-attr[type="text"]').val(""),e.find('input.fr-link-attr[type="checkbox"]').attr("checked",!1),e.find('input.fr-link-attr[type="text"][name="text"]').val(h.selection.text());e.find("input.fr-link-attr").trigger("change"),(h.image?h.image.get():null)?e.find('.fr-link-attr[name="text"]').parent().hide():e.find('.fr-link-attr[name="text"]').parent().show()}function s(e){if(e)return h.popups.onRefresh("link.insert",o),!0;var t="";1<=h.opts.linkInsertButtons.length&&(t='<div class="fr-buttons fr-tabs">'.concat(h.button.buildList(h.opts.linkInsertButtons),"</div>"));var n="",i=0;for(var r in n='<div class="fr-link-insert-layer fr-layer fr-active" id="fr-link-insert-layer-'.concat(h.id,'">'),n+='<div class="fr-input-line"><input id="fr-link-insert-layer-url-'.concat(h.id,'" name="href" type="text" class="fr-link-attr" placeholder="').concat(h.language.translate("URL"),'" tabIndex="').concat(++i,'"></div>'),h.opts.linkText&&(n+='<div class="fr-input-line"><input id="fr-link-insert-layer-text-'.concat(h.id,'" name="text" type="text" class="fr-link-attr" placeholder="').concat(h.language.translate("Text"),'" tabIndex="').concat(++i,'"></div>')),h.opts.linkAttributes)if(h.opts.linkAttributes.hasOwnProperty(r)){var a=h.opts.linkAttributes[r];n+='<div class="fr-input-line"><input name="'.concat(r,'" type="text" class="fr-link-attr" placeholder="').concat(h.language.translate(a),'" tabIndex="').concat(++i,'"></div>')}h.opts.linkAlwaysBlank||(n+='<div class="fr-checkbox-line"><span class="fr-checkbox"><input name="target" class="fr-link-attr" data-checked="_blank" type="checkbox" id="fr-link-target-'.concat(h.id,'" tabIndex="').concat(++i,'"><span>').concat('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10" height="10" viewBox="0 0 32 32"><path d="M27 4l-15 15-7-7-5 5 12 12 20-20z" fill="#FFF"></path></svg>','</span></span><label id="fr-label-target-').concat(h.id,'">').concat(h.language.translate("Open in new tab"),"</label></div>"));var l={buttons:t,input_layer:n+='<div class="fr-action-buttons"><button class="fr-command fr-submit" role="button" data-cmd="linkInsert" href="#" tabIndex="'.concat(++i,'" type="button">').concat(h.language.translate("Insert"),"</button></div></div>")},s=h.popups.create("link.insert",l);return h.$wp&&h.events.$on(h.$wp,"scroll.link-insert",function(){(h.image?h.image.get():null)&&h.popups.isVisible("link.insert")&&f(),h.popups.isVisible("link.insert")&&c()}),s}function p(e,t,n){if(h.opts.trackChangesEnabled){if(h.edit.on(),h.events.focus(!0),h.undo.saveStep(),h.markers.insert(),h.html.wrap(),!h.$el.find(".fr-marker").length)return void h.popups.hide("link.insert");h.markers.remove()}if(void 0===n&&(n={}),!1===h.events.trigger("link.beforeInsert",[e,t,n]))return!1;var i=h.image?h.image.get():null;i||"A"==h.el.tagName?"A"==h.el.tagName&&h.$el.focus():(h.selection.restore(),h.popups.hide("link.insert"));var r=e;h.opts.linkConvertEmailAddress&&h.helpers.isEmail(e)&&!/^mailto:.*/i.test(e)&&(e="mailto:".concat(e));if(""===h.opts.linkAutoPrefix||new RegExp("^("+y.LinkProtocols.join("|")+"):.","i").test(e)||/^data:image.*/i.test(e)||/^(https?:|ftps?:|file:|)\/\//i.test(e)||/^([A-Za-z]:(\\){1,2}|[A-Za-z]:((\\){1,2}[^\\]+)+)(\\)?$/i.test(e)||["/","{","[","#","(",".",'"',"\\"].indexOf((e||"")[0])<0&&(e=h.opts.linkAutoPrefix+e),e=h.helpers.sanitizeURL(e),h.opts.linkAlwaysBlank&&(n.target="_blank"),h.opts.linkAlwaysNoFollow&&(n.rel="nofollow"),h.helpers.isEmail(r)&&(n.target=null,n.rel=null),"_blank"==n.target?(h.opts.linkNoOpener&&(n.rel?n.rel+=" noopener":n.rel="noopener"),h.opts.linkNoReferrer&&(n.rel?n.rel+=" noreferrer":n.rel="noreferrer")):null==n.target&&(n.rel?n.rel=n.rel.replace(/noopener/,"").replace(/noreferrer/,""):n.rel=null),t=t||"",e===h.opts.linkAutoPrefix)return h.popups.get("link.insert").find('input[name="href"]').addClass("fr-error"),h.events.trigger("link.bad",[r]),!1;var a,l=v();if(l){if((a=m(l)).attr("href",e),0<t.length&&a.text()!=t&&!i){if(h.opts.trackChangesEnabled){var s=m(a.get(0).outerHTML);s.insertBefore(a.parent());var o=h.track_changes.wrapLinkInTracking(s,h.track_changes.getPendingChanges().length-1),p=h.track_changes.wrapInDelete(o);a.parent().append(p)}for(var c=a.get(0);1===c.childNodes.length&&c.childNodes[0].nodeType==Node.ELEMENT_NODE;)c=c.childNodes[0];m(c).text(t)}for(var f in i||a.prepend(y.START_MARKER).append(y.END_MARKER),n)n[f]?a.attr(f,n[f]):a.removeAttr(f);i||h.selection.restore()}else{i?(i.wrap('<a href="'.concat(e,'"></a>')),h.image.hasCaption()&&i.parent().append(i.parents(".fr-img-caption").find(".fr-inner"))):(h.format.remove("a"),h.selection.isCollapsed()?(t=0===t.length?r:t,h.html.insert('<a href="'.concat(e,'">').concat(y.START_MARKER).concat(t.replace(/&/g,"&amp;").replace(/</,"&lt;",">","&gt;")).concat(y.END_MARKER,"</a>")),h.selection.restore()):0<t.length&&t!=h.selection.text().replace(/\n/g,"")?(h.selection.remove(),h.html.insert('<a href="'.concat(e,'">').concat(y.START_MARKER).concat(t.replace(/&/g,"&amp;")).concat(y.END_MARKER,"</a>")),h.selection.restore()):(!function g(){if(!h.selection.isCollapsed()){h.selection.save();for(var e=h.$el.find(".fr-marker").addClass("fr-unprocessed").toArray();e.length;){var t=m(e.pop());t.removeClass("fr-unprocessed");var n=h.node.deepestParent(t.get(0));if(n){for(var i=t.get(0),r="",a="";i=i.parentNode,h.node.isBlock(i)||(r+=h.node.closeTagString(i),a=h.node.openTagString(i)+a),i!=n;);var l=h.node.openTagString(t.get(0))+t.html()+h.node.closeTagString(t.get(0));t.replaceWith('<span id="fr-break"></span>');var s=n.outerHTML;s=(s=s.replace(/<span id="fr-break"><\/span>/g,r+l+a)).replace(a+r,""),n.outerHTML=s}e=h.$el.find(".fr-marker.fr-unprocessed").toArray()}h.html.cleanEmptyTags(),h.selection.restore()}}(),h.format.apply("a",{href:e})));for(var d=b(),u=0;u<d.length;u++)(a=m(d[u])).attr(n),a.removeAttr("_moz_dirty");1==d.length&&h.$wp&&!i&&(m(d[0]).prepend(y.START_MARKER).append(y.END_MARKER),h.selection.restore())}if(i){var k=h.popups.get("link.insert");k&&k.find("input:focus").blur(),h.image.edit(i)}else E()}function c(){a();var e=v();if(e){var t=h.popups.get("link.insert");t||(t=s()),h.popups.isVisible("link.insert")||(h.popups.refresh("link.insert"),h.selection.save(),h.helpers.isMobile()&&(h.events.disableBlur(),h.$el.blur(),h.events.enableBlur())),h.popups.setContainer("link.insert",h.$sc);var n=(h.image?h.image.get():null)||m(e),i=n.offset().left+n.outerWidth()/2,r=n.offset().top+n.outerHeight();h.popups.show("link.insert",i,r,n.outerHeight(),!0)}}function f(){var e=h.image?h.image.getEl():null;if(e){var t=h.popups.get("link.insert"),n=e.outerWidth()/2;h.image.hasCaption()&&(e=e.find(".fr-img-wrap"),m(e)&&m(e).find("img")&&(n=m(e).find("img").outerWidth()/2)),t||(t=s()),o(),h.popups.setContainer("link.insert",h.$sc);var i=e.offset().left+n,r=e.offset().top+e.outerHeight(),a=e.outerHeight();h.opts.iframe&&h.image.hasCaption()&&m(e)&&m(e).find("img")&&(a=m(e).find("img").outerHeight()),h.popups.show("link.insert",i,r,a,!0)}}return{_init:function e(){h.events.on("keyup",function(e){e.which!=y.KEYCODE.ESC&&E(e)}),h.events.on("window.mouseup",E),h.events.$on(h.$el,"click","a",function(e){h.edit.isDisabled()&&e.preventDefault()}),h.helpers.isMobile()&&h.events.$on(h.$doc,"selectionchange",E),s(!0),"A"==h.el.tagName&&h.$el.addClass("fr-view"),h.events.on("toolbar.esc",function(){if(h.popups.isVisible("link.edit"))return h.events.disableBlur(),h.events.focus(),!1},!0)},remove:function i(){var e=v(),t=h.image?h.image.get():null;if(!1===h.events.trigger("link.beforeRemove",[e]))return!1;if(t&&e)if(h.image.hasCaption()){t.addClass("img-link-caption"),m(e).replaceWith(m(e).html());var n=document.querySelectorAll("img.img-link-caption");h.image.edit(m(n[0])),m(n[0]).removeClass("img-link-caption")}else t.unwrap(),h.image.edit(t);else e&&(h.selection.save(),m(e).replaceWith(m(e).html()),h.selection.restore(),a())},showInsertPopup:function d(){var e=h.$tb.find('.fr-command[data-cmd="insertLink"]'),t=h.popups.get("link.insert");if(t||(t=s()),!t.hasClass("fr-active"))if(h.popups.refresh("link.insert"),h.popups.setContainer("link.insert",h.$tb||h.$sc),e.isVisible()){var n=h.button.getPosition(e),i=n.left,r=n.top;h.popups.show("link.insert",i,r,e.outerHeight())}else h.position.forSelection(t),h.popups.show("link.insert")},usePredefined:function u(e){var t,n,i=h.opts.linkList[e],r=h.popups.get("link.insert"),a=r.find('input.fr-link-attr[type="text"]'),l=r.find('input.fr-link-attr[type="checkbox"]');for(i.rel&&(r.rel=i.rel),n=0;n<a.length;n++)i[(t=m(a[n])).attr("name")]?(t.val(i[t.attr("name")]),t.toggleClass("fr-not-empty",!0)):"text"!=t.attr("name")&&t.val("");for(n=0;n<l.length;n++)(t=m(l[n])).attr("checked",t.data("checked")==i[t.attr("name")]);h.accessibility.focusPopup(r)},insertCallback:function k(){var e,t,n=h.popups.get("link.insert"),i=n.find('input.fr-link-attr[type="text"]'),r=n.find('input.fr-link-attr[type="checkbox"]'),a=(i.filter('[name="href"]').val()||"").trim(),l=h.opts.linkText?i.filter('[name="text"]').val():"",s={};for(t=0;t<i.length;t++)e=m(i[t]),["href","text"].indexOf(e.attr("name"))<0&&(s[e.attr("name")]=e.val());for(t=0;t<r.length;t++)(e=m(r[t])).is(":checked")?s[e.attr("name")]=e.data("checked"):s[e.attr("name")]=e.data("unchecked")||null;n.rel&&(s.rel=n.rel);var o=h.helpers.scrollTop();p(a,l,s),m(h.o_win).scrollTop(o)},insert:p,update:c,get:v,allSelected:b,back:function t(){h.image&&h.image.get()?h.image.back():(h.events.disableBlur(),h.selection.restore(),h.events.enableBlur(),v()&&h.$wp?(h.selection.restore(),a(),E()):"A"==h.el.tagName?(h.$el.focus(),E()):(h.popups.hide("link.insert"),h.toolbar.showInline()))},imageLink:f,applyStyle:function g(e,t,n){void 0===n&&(n=h.opts.linkMultipleStyles),void 0===t&&(t=h.opts.linkStyles);var i=v();if(!i)return!1;if(!n){var r=Object.keys(t);r.splice(r.indexOf(e),1),m(i).removeClass(r.join(" "))}m(i).toggleClass(e),E()}}},y.DefineIcon("insertLink",{NAME:"link",SVG_KEY:"insertLink"}),y.RegisterShortcut(y.KEYCODE.K,"insertLink",null,"K"),y.RegisterCommand("insertLink",{title:"Insert Link",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("link.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("link.insert")):this.link.showInsertPopup()},plugin:"link"}),y.DefineIcon("linkOpen",{NAME:"external-link",FA5NAME:"external-link-alt",SVG_KEY:"openLink"}),y.RegisterCommand("linkOpen",{title:"Open Link",undo:!1,refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},callback:function(){var e=this.link.get();e&&(-1!==e.href.indexOf("mailto:")?this.o_win.open(e.href).close():(e.target||(e.target="_self"),this.browser.msie||this.browser.edge?this.o_win.open(e.href,e.target):this.o_win.open(e.href,e.target,"noopener")),this.popups.hide("link.edit"))},plugin:"link"}),y.DefineIcon("linkEdit",{NAME:"edit",SVG_KEY:"edit"}),y.RegisterCommand("linkEdit",{title:"Edit Link",undo:!1,refreshAfterCallback:!1,popup:!0,callback:function(){this.link.update()},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"}),y.DefineIcon("linkRemove",{NAME:"unlink",SVG_KEY:"unlink"}),y.RegisterCommand("linkRemove",{title:"Unlink",callback:function(){this.link.remove()},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"}),y.DefineIcon("linkBack",{NAME:"arrow-left",SVG_KEY:"back"}),y.RegisterCommand("linkBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.link.back()},refresh:function(e){var t=this.link.get()&&this.doc.hasFocus();(this.image?this.image.get():null)||t||this.opts.toolbarInline?(e.removeClass("fr-hidden"),e.next(".fr-separator").removeClass("fr-hidden")):(e.addClass("fr-hidden"),e.next(".fr-separator").addClass("fr-hidden"))},plugin:"link"}),y.DefineIcon("linkList",{NAME:"search",SVG_KEY:"search"}),y.RegisterCommand("linkList",{title:"Choose Link",type:"dropdown",focus:!1,undo:!1,refreshAfterCallback:!1,html:function(){for(var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.linkList,n=0;n<t.length;n++)e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="linkList" data-param1="'.concat(n,'">').concat(t[n].displayText||t[n].text,"</a></li>");return e+="</ul>"},callback:function(e,t){this.link.usePredefined(t)},plugin:"link"}),y.RegisterCommand("linkInsert",{focus:!1,refreshAfterCallback:!1,callback:function(){this.link.insertCallback()},refresh:function(e){this.link.get()?e.text(this.language.translate("Update")):e.text(this.language.translate("Insert"))},plugin:"link"}),y.DefineIcon("imageLink",{NAME:"link",SVG_KEY:"insertLink"}),y.RegisterCommand("imageLink",{title:"Insert Link",undo:!1,focus:!1,popup:!0,callback:function(){this.link.imageLink()},refresh:function(e){var t;this.link.get()?((t=e.prev()).hasClass("fr-separator")&&t.removeClass("fr-hidden"),e.addClass("fr-hidden")):((t=e.prev()).hasClass("fr-separator")&&t.addClass("fr-hidden"),e.removeClass("fr-hidden"))},plugin:"link"}),y.DefineIcon("linkStyle",{NAME:"magic",SVG_KEY:"linkStyles"}),y.RegisterCommand("linkStyle",{title:"Style",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.linkStyles;for(var n in t)t.hasOwnProperty(n)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="linkStyle" data-param1="'.concat(n,'">').concat(this.language.translate(t[n]),"</a></li>"));return e+="</ul>"},callback:function(e,t){this.link.applyStyle(t)},refreshOnShow:function(e,t){var n=this.$,i=this.link.get();if(i){var r=n(i);t.find(".fr-command").each(function(){var e=n(this).data("param1"),t=r.hasClass(e);n(this).toggleClass("fr-active",t).attr("aria-selected",t)})}},refresh:function(e){this.link.get()?e.removeClass("fr-hidden"):e.addClass("fr-hidden")},plugin:"link"})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v4.1.0 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.1.2 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2023 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v4.1.0 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.1.2 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2023 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v4.1.0 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.1.2 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2023 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v4.1.0 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.1.2 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2023 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v4.1.0 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.1.2 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2023 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v4.1.0 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.1.2 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2023 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v4.1.0 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.1.2 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2023 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v4.1.0 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.1.2 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2023 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v4.1.0 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.1.2 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2023 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v4.1.0 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.1.2 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2023 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v4.1.0 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.1.2 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2023 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v4.1.0 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.1.2 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2023 Froala Labs
5
5
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.1.0 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.1.2 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2023 Froala Labs
5
5
  */
6
6
 
7
- !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(r){"use strict";(r=r&&r.hasOwnProperty("default")?r["default"]:r).URLRegEx="(^| |\\u00A0)(".concat(r.LinkRegEx,"|([a-z0-9+-_.]{1,}@[a-z0-9+-_.]{1,}\\.[a-z0-9+-_]{1,}))$"),r.PLUGINS.url=function(f){var s=f.$,o=null;function t(e,t,n){for(var r="";n.length&&"."==n[n.length-1];)r+=".",n=n.substring(0,n.length-1);var a=n;if(f.opts.linkConvertEmailAddress)f.helpers.isEmail(a)&&!/^mailto:.*/i.test(a)&&(a="mailto:".concat(a));else if(f.helpers.isEmail(a))return t+n;return/^((http|https|ftp|ftps|mailto|tel|sms|notes|data)\:)/i.test(a)||(a="//".concat(a)),(t||"")+"<a".concat(f.opts.linkAlwaysBlank?' target="_blank"':"").concat(o?' rel="'.concat(o,'"'):"",' data-fr-linked="true" href="').concat(a,'">').concat(n.replace(/&amp;/g,"&").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"</a>").concat(r)}var p=function p(){return new RegExp(r.URLRegEx,"gi")};function u(e){return f.opts.linkAlwaysNoFollow&&(o="nofollow"),f.opts.linkAlwaysBlank&&(f.opts.linkNoOpener&&(o?o+=" noopener":o="noopener"),f.opts.linkNoReferrer&&(o?o+=" noreferrer":o="noreferrer")),e.replace(p(),t)}function c(e){var t=e.split(" ");return t[t.length-1]}function n(){var e=f.selection.ranges(0),t=e.startContainer;if(t.nodeType!==Node.TEXT_NODE)return!1;if(!t||e.startOffset!==(t.textContent||"").length){f.markers.insert();var n=f.$el.find(".fr-marker"),r=t.textContent.match(/(^| |\u00A0)(((([a-z\u0080-\u009f\u00a1-\uffff0-9-_\.]{1,})(\.(com|net|org|edu|mil|gov|co|biz|info|me|dev)))|((ftp|http|https):\/\/[a-z\u0080-\u009f\u00a1-\uffff0-9-_\.]{1,})|(www\.[a-z\u0080-\u009f\u00a1-\uffff0-9-_\.]{1,}\.[a-z0-9-]{2,24})|((ftp|http|https):\/\/[\u0021-\uffff]{1,}@[a-z\u0080-\u009f\u00a1-\uffff0-9-_\.]{1,}))((:[0-9]{1,5})|)(((\/|\?|#)[a-z\u00a1-\uffff0-9@?\|!^=%&amp;\/~+#-\'*-_{}]*)|())|([a-z0-9+-_.]{1,}@[a-z0-9+-_.]{1,}\.[a-z0-9+-_]{1,}))$/gi);if(n.remove(),!r)return!1}if(function l(e){return!!e&&("A"===e.tagName||!(!e.parentNode||e.parentNode==f.el)&&l(e.parentNode))}(t))return!1;if(p().test(c(t.textContent))){s(t).before(u(t.textContent));var a=s(t.parentNode).find("a[data-fr-linked]");a.removeAttr("data-fr-linked"),t.parentNode.removeChild(t),f.events.trigger("url.linked",[a.get(0)])}else if(t.textContent.split(" ").length<=2&&t.previousSibling&&"A"===t.previousSibling.tagName){var o=t.previousSibling.innerText+t.textContent;if(p().test(c(o))){var i=(new DOMParser).parseFromString(u(o),"text/html").body.childNodes;t.parentNode.replaceChild(i[0],t.previousSibling),i.length&&s(t).before(i[0]),t.parentNode.removeChild(t)}}}return{_init:function e(){f.events.on("keypress",function(e){!f.selection.isCollapsed()||")"!=e.key&&"("!=e.key||n()},!0),f.events.on("keydown",function(e){var t=e.which;!f.selection.isCollapsed()||t!=r.KEYCODE.ENTER&&t!=r.KEYCODE.SPACE||n()},!0),f.events.on("paste.beforeCleanup",function(e){if(f.helpers.isURL(e)&&!f.$el[0].getAttribute("plainpaste")){var t=null;return f.opts.linkAlwaysBlank&&(f.opts.linkNoOpener&&(t?t+=" noopener":t="noopener"),f.opts.linkNoReferrer&&(t?t+=" noreferrer":t="noreferrer")),"<a".concat(f.opts.linkAlwaysBlank?' target="_blank"':"").concat(t?' rel="'.concat(t,'"'):"",' href="').concat(e,'" >').concat(e,"</a>")}if(f.$el[0].getAttribute("plainpaste"))return function n(e){if("string"==typeof e)return e.replace(/(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])/gim,u).replace(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/gim,u)}(e)})}}}});
7
+ !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(r){"use strict";(r=r&&r.hasOwnProperty("default")?r["default"]:r).URLRegEx="(^| |\\u00A0)(".concat(r.LinkRegEx,"|([a-z0-9+-_.]{1,}@[a-z0-9+-_.]{1,}\\.[a-z0-9+-_]{1,}))$"),r.PLUGINS.url=function(u){var c=u.$,o=null;function t(e,t,n){for(var r="";n.length&&"."==n[n.length-1];)r+=".",n=n.substring(0,n.length-1);var a=n;if(u.opts.linkConvertEmailAddress)u.helpers.isEmail(a)&&!/^mailto:.*/i.test(a)&&(a="mailto:".concat(a));else if(u.helpers.isEmail(a))return t+n;return/^((http|https|ftp|ftps|mailto|tel|sms|notes|data)\:)/i.test(a)||(a="//".concat(a)),(t||"")+"<a".concat(u.opts.linkAlwaysBlank?' target="_blank"':"").concat(o?' rel="'.concat(o,'"'):"",' data-fr-linked="true" href="').concat(a,'">').concat(n.replace(/&amp;/g,"&").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"</a>").concat(r)}var d=function d(){return new RegExp(r.URLRegEx,"gi")};function g(e){return u.opts.linkAlwaysNoFollow&&(o="nofollow"),u.opts.linkAlwaysBlank&&(u.opts.linkNoOpener&&(o?o+=" noopener":o="noopener"),u.opts.linkNoReferrer&&(o?o+=" noreferrer":o="noreferrer")),e.replace(d(),t)}function h(e){var t=e.split(" ");return t[t.length-1]}function n(){var e=u.selection.ranges(0),t=e.startContainer;if(t.nodeType!==Node.TEXT_NODE)return!1;if(!t||e.startOffset!==(t.textContent||"").length){u.markers.insert();var n=u.$el.find(".fr-marker"),r=t.textContent.match(/(^| |\u00A0)(((([a-z\u0080-\u009f\u00a1-\uffff0-9-_\.]{1,})(\.(com|net|org|edu|mil|gov|co|biz|info|me|dev)))|((ftp|http|https):\/\/[a-z\u0080-\u009f\u00a1-\uffff0-9-_\.]{1,})|(www\.[a-z\u0080-\u009f\u00a1-\uffff0-9-_\.]{1,}\.[a-z0-9-]{2,24})|((ftp|http|https):\/\/[\u0021-\uffff]{1,}@[a-z\u0080-\u009f\u00a1-\uffff0-9-_\.]{1,}))((:[0-9]{1,5})|)(((\/|\?|#)[a-z\u00a1-\uffff0-9@?\|!^=%&amp;\/~+#-\'*-_{}]*)|())|([a-z0-9+-_.]{1,}@[a-z0-9+-_.]{1,}\.[a-z0-9+-_]{1,}))$/gi);if(n.remove(),!r)return!1}if(function p(e){return!!e&&("A"===e.tagName||!(!e.parentNode||e.parentNode==u.el)&&p(e.parentNode))}(t))return!1;if(d().test(h(t.textContent))){var a,o=t.textContent.length;if(0<o&&","===t.textContent.charAt(o-1)){c(t).before(g(t.textContent.substring(0,o-1))),(a=c(t.parentNode).find("a[data-fr-linked]")).removeAttr("data-fr-linked"),t.textContent=",";var i=u.win.getSelection().getRangeAt(0);i.setStart(t,1),i.setEnd(t,1)}else c(t).before(g(t.textContent)),(a=c(t.parentNode).find("a[data-fr-linked]")).removeAttr("data-fr-linked"),t.parentNode.removeChild(t);u.events.trigger("url.linked",[a.get(0)])}else if(t.textContent.split(" ").length<=2&&t.previousSibling&&"A"===t.previousSibling.tagName){var l=t.previousSibling.innerText+t.textContent,f=t.textContent.length;if(d().test(h(l))&&","!==t.textContent.charAt(f-1)){var s=(new DOMParser).parseFromString(g(l),"text/html").body.childNodes;t.parentNode.replaceChild(s[0],t.previousSibling),s.length&&c(t).before(s[0]),t.parentNode.removeChild(t)}}}return{_init:function e(){u.events.on("keypress",function(e){!u.selection.isCollapsed()||")"!=e.key&&"("!=e.key||n()},!0),u.events.on("keydown",function(e){var t=e.which;!u.selection.isCollapsed()||t!=r.KEYCODE.ENTER&&t!=r.KEYCODE.SPACE||n()},!0),u.events.on("paste.beforeCleanup",function(e){if(u.helpers.isURL(e)&&!u.$el[0].getAttribute("plainpaste")){var t=null;return u.opts.linkAlwaysBlank&&(u.opts.linkNoOpener&&(t?t+=" noopener":t="noopener"),u.opts.linkNoReferrer&&(t?t+=" noreferrer":t="noreferrer")),"<a".concat(u.opts.linkAlwaysBlank?' target="_blank"':"").concat(t?' rel="'.concat(t,'"'):"",' href="').concat(e,'" >').concat(e,"</a>")}if(u.$el[0].getAttribute("plainpaste"))return function n(e){if("string"==typeof e)return(e=e.replace(/&amp;/g,"&")).replace(/(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])/gim,g).replace(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/gim,g)}(e)})}}}});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v4.1.0 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.1.2 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2023 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v4.1.0 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.1.2 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2023 Froala Labs
5
5
  */