wysiwyg-rails 4.2.1 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) 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 +18 -24
  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 +2 -2
  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 +2 -2
  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 +2 -2
  55. data/app/assets/javascripts/plugins/filestack.min.js +7 -0
  56. data/app/assets/javascripts/plugins/font_family.min.js +1 -1
  57. data/app/assets/javascripts/plugins/font_size.min.js +1 -1
  58. data/app/assets/javascripts/plugins/forms.min.js +1 -1
  59. data/app/assets/javascripts/plugins/fullscreen.min.js +1 -1
  60. data/app/assets/javascripts/plugins/help.min.js +1 -1
  61. data/app/assets/javascripts/plugins/image.min.js +2 -2
  62. data/app/assets/javascripts/plugins/image_manager.min.js +1 -1
  63. data/app/assets/javascripts/plugins/inline_class.min.js +1 -1
  64. data/app/assets/javascripts/plugins/inline_style.min.js +1 -1
  65. data/app/assets/javascripts/plugins/line_breaker.min.js +1 -1
  66. data/app/assets/javascripts/plugins/line_height.min.js +1 -1
  67. data/app/assets/javascripts/plugins/link.min.js +1 -1
  68. data/app/assets/javascripts/plugins/lists.min.js +1 -1
  69. data/app/assets/javascripts/plugins/markdown.min.js +1 -1
  70. data/app/assets/javascripts/plugins/paragraph_format.min.js +1 -1
  71. data/app/assets/javascripts/plugins/paragraph_style.min.js +1 -1
  72. data/app/assets/javascripts/plugins/print.min.js +1 -1
  73. data/app/assets/javascripts/plugins/quick_insert.min.js +1 -1
  74. data/app/assets/javascripts/plugins/quote.min.js +1 -1
  75. data/app/assets/javascripts/plugins/save.min.js +1 -1
  76. data/app/assets/javascripts/plugins/special_characters.min.js +1 -1
  77. data/app/assets/javascripts/plugins/table.min.js +2 -2
  78. data/app/assets/javascripts/plugins/track_changes.min.js +2 -2
  79. data/app/assets/javascripts/plugins/trim_video.min.js +1 -1
  80. data/app/assets/javascripts/plugins/url.min.js +1 -1
  81. data/app/assets/javascripts/plugins/video.min.js +2 -2
  82. data/app/assets/javascripts/plugins/word_counter.min.js +1 -1
  83. data/app/assets/javascripts/plugins/word_paste.min.js +2 -2
  84. data/app/assets/javascripts/plugins.pkgd.min.js +2 -2
  85. data/app/assets/javascripts/third_party/embedly.min.js +1 -1
  86. data/app/assets/javascripts/third_party/font_awesome.min.js +1 -1
  87. data/app/assets/javascripts/third_party/image_tui.min.js +1 -1
  88. data/app/assets/javascripts/third_party/showdown.min.js +1 -1
  89. data/app/assets/javascripts/third_party/spell_checker.min.js +1 -1
  90. data/app/assets/stylesheets/froala_editor.css +1 -1
  91. data/app/assets/stylesheets/froala_editor.min.css +1 -1
  92. data/app/assets/stylesheets/froala_editor.pkgd.css +37 -1
  93. data/app/assets/stylesheets/froala_editor.pkgd.min.css +2 -2
  94. data/app/assets/stylesheets/froala_style.css +1 -1
  95. data/app/assets/stylesheets/froala_style.min.css +1 -1
  96. data/app/assets/stylesheets/plugins/char_counter.css +1 -1
  97. data/app/assets/stylesheets/plugins/char_counter.min.css +1 -1
  98. data/app/assets/stylesheets/plugins/code_view.css +1 -1
  99. data/app/assets/stylesheets/plugins/code_view.min.css +1 -1
  100. data/app/assets/stylesheets/plugins/colors.css +1 -1
  101. data/app/assets/stylesheets/plugins/colors.min.css +1 -1
  102. data/app/assets/stylesheets/plugins/draggable.css +1 -1
  103. data/app/assets/stylesheets/plugins/draggable.min.css +1 -1
  104. data/app/assets/stylesheets/plugins/emoticons.css +1 -1
  105. data/app/assets/stylesheets/plugins/emoticons.min.css +1 -1
  106. data/app/assets/stylesheets/plugins/file.css +1 -1
  107. data/app/assets/stylesheets/plugins/file.min.css +1 -1
  108. data/app/assets/stylesheets/plugins/files_manager.css +1 -1
  109. data/app/assets/stylesheets/plugins/files_manager.min.css +1 -1
  110. data/app/assets/stylesheets/plugins/filestack.css +41 -0
  111. data/app/assets/stylesheets/plugins/filestack.min.css +7 -0
  112. data/app/assets/stylesheets/plugins/fullscreen.css +1 -1
  113. data/app/assets/stylesheets/plugins/fullscreen.min.css +1 -1
  114. data/app/assets/stylesheets/plugins/help.css +1 -1
  115. data/app/assets/stylesheets/plugins/help.min.css +1 -1
  116. data/app/assets/stylesheets/plugins/image.css +1 -1
  117. data/app/assets/stylesheets/plugins/image.min.css +1 -1
  118. data/app/assets/stylesheets/plugins/image_manager.css +1 -1
  119. data/app/assets/stylesheets/plugins/image_manager.min.css +1 -1
  120. data/app/assets/stylesheets/plugins/line_breaker.css +1 -1
  121. data/app/assets/stylesheets/plugins/line_breaker.min.css +1 -1
  122. data/app/assets/stylesheets/plugins/markdown.css +1 -1
  123. data/app/assets/stylesheets/plugins/markdown.min.css +1 -1
  124. data/app/assets/stylesheets/plugins/quick_insert.css +1 -1
  125. data/app/assets/stylesheets/plugins/quick_insert.min.css +1 -1
  126. data/app/assets/stylesheets/plugins/special_characters.css +1 -1
  127. data/app/assets/stylesheets/plugins/special_characters.min.css +1 -1
  128. data/app/assets/stylesheets/plugins/table.css +1 -1
  129. data/app/assets/stylesheets/plugins/table.min.css +1 -1
  130. data/app/assets/stylesheets/plugins/trim_video.css +1 -1
  131. data/app/assets/stylesheets/plugins/trim_video.min.css +1 -1
  132. data/app/assets/stylesheets/plugins/video.css +1 -1
  133. data/app/assets/stylesheets/plugins/video.min.css +1 -1
  134. data/app/assets/stylesheets/plugins.pkgd.css +37 -1
  135. data/app/assets/stylesheets/plugins.pkgd.min.css +2 -2
  136. data/app/assets/stylesheets/themes/dark.css +3 -1
  137. data/app/assets/stylesheets/themes/dark.min.css +2 -2
  138. data/app/assets/stylesheets/themes/gray.css +3 -1
  139. data/app/assets/stylesheets/themes/gray.min.css +2 -2
  140. data/app/assets/stylesheets/themes/royal.css +3 -1
  141. data/app/assets/stylesheets/themes/royal.min.css +2 -2
  142. data/app/assets/stylesheets/third_party/embedly.css +1 -1
  143. data/app/assets/stylesheets/third_party/embedly.min.css +1 -1
  144. data/app/assets/stylesheets/third_party/font_awesome.css +1 -1
  145. data/app/assets/stylesheets/third_party/font_awesome.min.css +1 -1
  146. data/app/assets/stylesheets/third_party/image_tui.css +1 -1
  147. data/app/assets/stylesheets/third_party/image_tui.min.css +1 -1
  148. data/app/assets/stylesheets/third_party/spell_checker.css +1 -1
  149. data/app/assets/stylesheets/third_party/spell_checker.min.css +1 -1
  150. data/lib/wysiwyg-rails/version.rb +1 -1
  151. metadata +5 -2
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.2.1 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.3.0 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2024 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(ye){"use strict";function Re(e){return function t(e){if(Array.isArray(e))return r(e)}(e)||function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function l(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return r(e,t)}(e)||function n(){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 r(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,l=new Array(t);a<t;a++)l[a]=e[a];return l}ye=ye&&ye.hasOwnProperty("default")?ye["default"]:ye,Object.assign(ye.POPUP_TEMPLATES,{"table.insert":"[_BUTTONS_][_ROWS_COLUMNS_]","table.edit":"[_BUTTONS_]","table.colors":"[_BUTTONS_][_COLORS_][_CUSTOM_COLOR_]"}),Object.assign(ye.DEFAULTS,{tableInsertMaxSize:10,tableEditButtons:["tableHeader","tableFooter","tableRemove","tableRows","tableColumns","tableStyle","-","tableCells","tableCellBackground","tableCellVerticalAlign","tableCellHorizontalAlign","tableCellStyle"],tableInsertButtons:["tableBack","|"],tableResizer:!0,tableDefaultWidth:"100%",tableResizerOffset:5,tableResizingLimit:30,tableColorsButtons:["tableBack","|"],tableColors:["#61BD6D","#1ABC9C","#54ACD2","#2C82C9","#9365B8","#475577","#CCCCCC","#41A85F","#00A885","#3D8EB9","#2969B0","#553982","#28324E","#000000","#F7DA64","#FBA026","#EB6B56","#E25041","#A38F84","#EFEFEF","#FFFFFF","#FAC51C","#F37934","#D14841","#B8312F","#7C706B","#D1D5D8","REMOVE"],tableColorsStep:7,tableCellStyles:{"fr-highlighted":"Highlighted","fr-thick":"Thick"},tableStyles:{"fr-dashed-borders":"Dashed Borders","fr-alternate-rows":"Alternate Rows"},tableCellMultipleStyles:!0,tableMultipleStyles:!0,tableInsertHelper:!0,keepTextFormatOnTable:!1,tableInsertHelperOffset:15}),ye.PLUGINS.table=function(A){var O,f,n,r,l,o,y,T=A.$;function g(){var e=x();if(e){var t=A.popups.get("table.edit");if(t||(t=p()),t){A.popups.setContainer("table.edit",A.$sc);var a=I(e),l=a.left+(a.right-a.left)/2,n=a.bottom;A.popups.show("table.edit",l,n,a.bottom-a.top,!0),A.edit.isDisabled()&&(A.$el.removeClass("fr-no-selection"),A.edit.on(),A.button.bulkRefresh(),A.selection.setAtEnd(A.$el.find(".fr-selected-cell").last().get(0)),A.selection.restore())}}}function s(){var e=x();if(e){var t=A.popups.get("table.colors");t||(t=function o(){var e="";0<A.opts.tableColorsButtons.length&&(e='<div class="fr-buttons fr-tabs">'.concat(A.button.buildList(A.opts.tableColorsButtons),"</div>"));var t="";A.opts.colorsHEXInput&&(t='<div class="fr-color-hex-layer fr-table-colors-hex-layer fr-active fr-layer" id="fr-table-colors-hex-layer-'.concat(A.id,'"><div class="fr-input-line"><input maxlength="7" id="fr-table-colors-hex-layer-text-').concat(A.id,'" type="text" placeholder="').concat(A.language.translate("HEX Color"),'" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="tableCellBackgroundCustomColor" tabIndex="2" role="button">').concat(A.language.translate("OK"),"</button></div></div>"));var a={buttons:e,colors:function n(){for(var e='<div class="fr-color-set fr-table-colors">',t=0;t<A.opts.tableColors.length;t++)0!==t&&t%A.opts.tableColorsStep==0&&(e+="<br>"),"REMOVE"!=A.opts.tableColors[t]?e+='<span class="fr-command" style="background: '.concat(A.opts.tableColors[t],';" tabIndex="-1" role="button" data-cmd="tableCellBackgroundColor" data-param1="').concat(A.opts.tableColors[t],'"><span class="fr-sr-only">').concat(A.language.translate("Color")," ").concat(A.opts.tableColors[t],"&nbsp;&nbsp;&nbsp;</span></span>"):e+='<span class="fr-command" data-cmd="tableCellBackgroundColor" tabIndex="-1" role="button" data-param1="REMOVE" title="'.concat(A.language.translate("Clear Formatting"),'">').concat(A.icon.create("tableColorRemove"),'<span class="fr-sr-only">').concat(A.language.translate("Clear Formatting"),"</span></span>");return e+="</div>"}(),custom_color:t},l=A.popups.create("table.colors",a);return A.events.$on(A.$wp,"scroll.table-colors",function(){A.popups.isVisible("table.colors")&&s()}),function r(u){A.events.on("popup.tab",function(e){var t=T(e.currentTarget);if(!A.popups.isVisible("table.colors")||!t.is("span"))return!0;var a=e.which,l=!0;if(ye.KEYCODE.TAB==a){var n=u.find(".fr-buttons");l=!A.accessibility.focusToolbar(n,!!e.shiftKey)}else if(ye.KEYCODE.ARROW_UP==a||ye.KEYCODE.ARROW_DOWN==a||ye.KEYCODE.ARROW_LEFT==a||ye.KEYCODE.ARROW_RIGHT==a){var r=t.parent().find("span.fr-command"),o=r.index(t),s=A.opts.colorsStep,i=Math.floor(r.length/s),f=o%s,c=Math.floor(o/s),d=c*s+f,p=i*s;ye.KEYCODE.ARROW_UP==a?d=((d-s)%p+p)%p:ye.KEYCODE.ARROW_DOWN==a?d=(d+s)%p:ye.KEYCODE.ARROW_LEFT==a?d=((d-1)%p+p)%p:ye.KEYCODE.ARROW_RIGHT==a&&(d=(d+1)%p);var h=T(r.get(d));A.events.disableBlur(),h.focus(),l=!1}else ye.KEYCODE.ENTER==a&&(A.button.exec(t),l=!1);return!1===l&&(e.preventDefault(),e.stopPropagation()),l},!0)}(l),l}()),A.popups.setContainer("table.colors",A.$sc);var a=I(e),l=(a.left+a.right)/2,n=a.bottom;!function r(){var e=A.popups.get("table.colors"),t=A.$el.find(".fr-selected-cell").first(),a=A.helpers.RGBToHex(t.css("background-color")),l=e.find(".fr-table-colors-hex-layer input");e.find(".fr-selected-color").removeClass("fr-selected-color fr-active-item"),e.find('span[data-param1="'.concat(a,'"]')).addClass("fr-selected-color fr-active-item"),l.val(a).trigger("change")}(),A.popups.show("table.colors",l,n,a.bottom-a.top,!0)}}function i(){0===te().length&&A.toolbar.enable()}function c(e){if(e)return A.popups.onHide("table.insert",function(){A.popups.get("table.insert").find('.fr-table-size .fr-select-table-size > span[data-row="1"][data-col="1"]').trigger("mouseover")}),!0;var t="";0<A.opts.tableInsertButtons.length&&(t='<div class="fr-buttons fr-tabs">'.concat(A.button.buildList(A.opts.tableInsertButtons),"</div>"));var a={buttons:t,rows_columns:function r(){for(var e='<div class="fr-table-size"><div class="fr-table-size-info">1 &times; 1</div><div class="fr-select-table-size">',t=1;t<=A.opts.tableInsertMaxSize;t++){for(var a=1;a<=A.opts.tableInsertMaxSize;a++){var l="inline-block";2<t&&!A.helpers.isMobile()&&(l="none");var n="fr-table-cell ";1==t&&1==a&&(n+=" hover"),e+='<span class="fr-command '.concat(n,'" tabIndex="-1" data-cmd="tableInsert" data-row="').concat(t,'" data-col="').concat(a,'" data-param1="').concat(t,'" data-param2="').concat(a,'" style="display: ').concat(l,';" role="button"><span></span><span class="fr-sr-only">').concat(t," &times; ").concat(a,"&nbsp;&nbsp;&nbsp;</span></span>")}e+='<div class="new-line"></div>'}return e+="</div></div>"}()},l=A.popups.create("table.insert",a);return A.events.$on(l,"mouseover",".fr-table-size .fr-select-table-size .fr-table-cell",function(e){d(T(e.currentTarget))},!0),function n(e){A.events.$on(e,"focus","[tabIndex]",function(e){var t=T(e.currentTarget);d(t)}),A.events.on("popup.tab",function(e){var t=T(e.currentTarget);if(!A.popups.isVisible("table.insert")||!t.is("span, a"))return!0;var a,l=e.which;if(ye.KEYCODE.ARROW_UP==l||ye.KEYCODE.ARROW_DOWN==l||ye.KEYCODE.ARROW_LEFT==l||ye.KEYCODE.ARROW_RIGHT==l){if(t.is("span.fr-table-cell")){var n=t.parent().find("span.fr-table-cell"),r=n.index(t),o=A.opts.tableInsertMaxSize,s=r%o,i=Math.floor(r/o);ye.KEYCODE.ARROW_UP==l?i=Math.max(0,i-1):ye.KEYCODE.ARROW_DOWN==l?i=Math.min(A.opts.tableInsertMaxSize-1,i+1):ye.KEYCODE.ARROW_LEFT==l?s=Math.max(0,s-1):ye.KEYCODE.ARROW_RIGHT==l&&(s=Math.min(A.opts.tableInsertMaxSize-1,s+1));var f=i*o+s,c=T(n.get(f));d(c),A.events.disableBlur(),c.focus(),a=!1}}else ye.KEYCODE.ENTER==l&&(A.button.exec(t),a=!1);return!1===a&&(e.preventDefault(),e.stopPropagation()),a},!0)}(l),l}function d(e){var t=e.data("row");null!==t&&(t=parseInt(t));var a=e.data("col");null!==a&&(a=parseInt(a));var l=e.parent();l.siblings(".fr-table-size-info").html("".concat(t," &times; ").concat(a)),l.find("> span").removeClass("hover fr-active-item");for(var n=1;n<=A.opts.tableInsertMaxSize;n++)for(var r=0;r<=A.opts.tableInsertMaxSize;r++){var o=l.find('> span[data-row="'.concat(n,'"][data-col="').concat(r,'"]'));n<=t&&r<=a?o.addClass("hover"):n<=t+1||n<=2&&!A.helpers.isMobile()?o.css("display","inline-block"):2<n&&!A.helpers.isMobile()&&o.css("display","none")}e.addClass("fr-active-item")}function p(e){if(e)return A.popups.onHide("table.edit",i),!0;if(0<A.opts.tableEditButtons.length){var t={buttons:'<div class="fr-buttons">'.concat(A.button.buildList(A.opts.tableEditButtons),"</div>")},a=A.popups.create("table.edit",t);return A.events.$on(A.$wp,"scroll.table-edit",function(){A.popups.isVisible("table.edit")&&g()}),a}return!1}function b(e){var t={startTag:"",closeTag:""};return A.opts.keepTextFormatOnTable&&(t=h(function s(e){var t=new Set,a=e.textContent,l=0,n=[e.firstChild];for(;0<n.length;){var r=n.pop();if(r&&(t.has(r)||(0===l&&a!==r.textContent&&(a=r.textContent,l++),t.add(r)),r.hasChildNodes()))for(var o=0;o<r.childNodes.length;){if(3===r.childNodes[o].nodeType)return Re(t);if(r.childNodes[o].textContent){if(0===l&&r.childNodes[o].textContent!==a){a=r.childNodes[o].textContent,n.push(r.childNodes[o]),l++;break}r.childNodes[o].textContent===a&&n.push(r.childNodes[o])}o++}}return Re(t)}(e).reverse())),{startTag:t.startTag,closeTag:t.closeTag}}function h(e){var t="",a="",l=["br","#text","#comment","font"];if(0<e.length)for(var n=e.length-1;0<=n;n--){var r=e[n],o=A.node.isBlock(r),s=l.indexOf(r.nodeName.toLowerCase());if(!o&&s<0){var i=r.style,f="";if(i&&i.length){for(var c=0;c<i.length;c++)f+=i[c]+": "+i[i[c]].replace(/"/gi,"")+"; ";f=f.trim()}t+=f?"<"+r.nodeName.toLowerCase()+' style="'+f+'">':"<"+r.nodeName.toLowerCase()+">",a="</"+r.nodeName.toLowerCase()+">"+a}}return{startTag:t,closeTag:a}}function u(){if(0<te().length){var e=ae();A.selection.setBefore(e.get(0))||A.selection.setAfter(e.get(0)),A.selection.restore(),A.popups.hide("table.edit"),A.opts.trackChangesEnabled?(A.track_changes.removedTable(e),N()):e.remove(),A.toolbar.enable()}}function m(e){var t=ae();if(0<t.length){if(0<A.$el.find("thead .fr-selected-cell").length&&"above"==e||0<A.$el.find("tfoot td.fr-selected-cell").length&&"below"==e)return;var a,l,n,r=x(),o=M(r);if(null==o)return;l="above"==e?o.min_i:o.max_i;var s="<tr>";for(a=0;a<r[l].length;a++)if("below"==e&&l<r.length-1&&r[l][a]==r[l+1][a]||"above"==e&&0<l&&r[l][a]==r[l-1][a]){if(0===a||0<a&&r[l][a]!=r[l][a-1]){var i=T(r[l][a]);i.attr("rowspan",parseInt(i.attr("rowspan"),10)+1)}}else{var f=T(r[l][a]);if("TH"==f.attr("tagName").toUpperCase())s+='<th style="'+f.attr("style")+'" ><br></th>';else{var c=b(r[l][a]);s+='<td style="'+f.attr("style")+'" >'+c.startTag+"<br>"+c.closeTag+"</td>"}}s+="</tr>",n=0<A.$el.find("thead .fr-selected-cell").length&&"below"==e||0<A.$el.find("tfoot td.fr-selected-cell").length&&"above"==e?T(t.find("tbody").not(t.find("> table tbody"))):T(t.find("tr").not(t.find("> table tr")).get(l)),"below"==e?"TBODY"==n.attr("tagName")?n.prepend(s):n[0].parentNode&&n[0].insertAdjacentHTML("afterend",s):"above"==e&&("TBODY"==n.attr("tagName")?n.append(s):n.before(s),A.popups.isVisible("table.edit")&&g())}}function v(e,t,a){var l,n,r,o,s,i=0,f=x(a);if(e<(t=Math.min(t,f[0].length-1)))for(n=e;n<=t;n++)if(!(e<n&&f[0][n]==f[0][n-1])&&1<(o=Math.min(parseInt(f[0][n].getAttribute("colspan"),10)||1,t-e+1))&&f[0][n]==f[0][n+1])for(i=o-1,l=1;l<f.length;l++)if(f[l][n]!=f[l-1][n]){for(r=n;r<n+o;r++)if(f[l][r]!==undefined)if(1<(s=parseInt(f[l][r].getAttribute("colspan"),10)||1)&&f[l][r]==f[l][r+1])r+=i=Math.min(i,s-1);else if(!(i=Math.max(0,i-1)))break;if(!i)break}i&&C(f,i,"colspan",0,f.length-1,e,t)}function w(e,t,a){var l,n,r,o,s,i=0,f=x(a);if(e<(t=Math.min(t,f.length-1)))for(l=e;l<=t;l++)if(!(e<l&&f[l][0]==f[l-1][0])&&f[l][0]!==undefined&&1<(o=Math.min(parseInt(f[l][0].getAttribute("rowspan"),10)||1,t-e+1))&&f[l][0]==f[l+1][0])for(i=o-1,n=1;n<f[0].length;n++)if(f[l][n]!=f[l][n-1]){for(r=l;r<l+o;r++)if(f[r][n]!==undefined)if(1<(s=parseInt(f[r][n].getAttribute("rowspan"),10)||1)&&f[r][n]==f[r+1][n])r+=i=Math.min(i,s-1);else if(!(i=Math.max(0,i-1)))break;if(!i)break}i&&C(f,i,"rowspan",e,t,0,f[0].length-1)}function C(e,t,a,l,n,r,o){var s,i,f;for(s=l;s<=n;s++)for(i=r;i<=o;i++)l<s&&e[s][i]==e[s-1][i]||r<i&&e[s][i]==e[s][i-1]||e[s][i]!==undefined&&1<(f=parseInt(e[s][i].getAttribute(a),10)||1)&&(1<f-t?e[s][i].setAttribute(a,f-t):e[s][i].removeAttribute(a))}function E(e,t,a,l,n){w(e,t,n),v(a,l,n)}function t(e){var t=A.$el.find(".fr-selected-cell");"REMOVE"!=e?t.css("background-color",A.helpers.HEXtoRGB(e)):t.css("background-color",""),g()}function R(e){e.style.removeProperty("border"),e.style.removeProperty("border-top"),e.style.removeProperty("border-bottom"),e.style.removeProperty("border-left"),e.style.removeProperty("border-right")}function x(e){var f=[];if(null==(e=e||null)&&0<te().length&&(e=ae()),e){if(!e.find("tr").html().match(/xl[0-9]+/gi))for(var t=e.find("tr:empty"),a=t.length-1;0<=a;a--)T(t[a]).remove();e.find("tr").not(e.find("> table tr")).each(function(s,e){var t=T(e),i=0;t.find("> th, > td").each(function(e,t){for(var a=T(t),l=parseInt(a.attr("colspan"),10)||1,n=parseInt(a.attr("rowspan"),10)||1,r=s;r<s+n;r++)for(var o=i;o<i+l;o++)f[r]||(f[r]=[]),f[r][o]?i++:f[r][o]=t;i+=l})})}return f}function $(e,t){for(var a=0;a<t.length;a++)for(var l=0;l<t[a].length;l++)if(t[a][l]==e)return{row:a,col:l}}function D(e,t,a){for(var l=e+1,n=t+1;l<a.length;){if(a[l][t]!=a[e][t]){l--;break}l++}for(l==a.length&&l--;n<a[e].length;){if(a[e][n]!=a[e][t]){n--;break}n++}return n==a[e].length&&n--,{row:l,col:n}}function _(){A.el.querySelector(".fr-cell-fixed")&&A.el.querySelector(".fr-cell-fixed").classList.remove("fr-cell-fixed"),A.el.querySelector(".fr-cell-handler")&&A.el.querySelector(".fr-cell-handler").classList.remove("fr-cell-handler")}function N(){var e=A.$el.find(".fr-selected-cell");0<e.length&&e.each(function(){var e=T(this);e.removeClass("fr-selected-cell"),""===e.attr("class")&&e.removeAttr("class")}),_()}function S(){A.events.disableBlur(),A.selection.clear(),A.$el.addClass("fr-no-selection"),A.$el.blur(),A.events.enableBlur()}function M(e){var t=A.$el.find(".fr-selected-cell");if(0<t.length){var a,l=e.length,n=0,r=e[0].length,o=0;for(a=0;a<t.length;a++){var s=$(t[a],e),i=D(s.row,s.col,e);l=Math.min(s.row,l),n=Math.max(i.row,n),r=Math.min(s.col,r),o=Math.max(i.col,o)}return{min_i:l,max_i:n,min_j:r,max_j:o}}return null}function I(e){var t=M(e);if(null!=t){var a=T(e[t.min_i][t.min_j]),l=T(e[t.min_i][t.max_j]),n=T(e[t.max_i][t.min_j]);return{left:a.length&&a.offset().left,right:l.length&&l.offset().left+l.outerWidth(),top:a.length&&a.offset().top,bottom:n.length&&n.offset().top+n.outerHeight()}}}function k(e,t){if(T(e).is(t))N(),T(e).addClass("fr-selected-cell");else{S(),A.edit.off();var a=x(),l=$(e,a),n=$(t,a);if(!l||!n)return;var r=function h(e,t,a,l,n){var r,o,s,i,f=e,c=t,d=a,p=l;for(r=f;r<=c;r++)(1<(parseInt(T(n[r][d]).attr("rowspan"),10)||1)||1<(parseInt(T(n[r][d]).attr("colspan"),10)||1))&&(i=D((s=$(n[r][d],n)).row,s.col,n),f=Math.min(s.row,f),c=Math.max(i.row,c),d=Math.min(s.col,d),p=Math.max(i.col,p)),(1<(parseInt(T(n[r][p]).attr("rowspan"),10)||1)||1<(parseInt(T(n[r][p]).attr("colspan"),10)||1))&&(i=D((s=$(n[r][p],n)).row,s.col,n),f=Math.min(s.row,f),c=Math.max(i.row,c),d=Math.min(s.col,d),p=Math.max(i.col,p));for(o=d;o<=p;o++)(1<(parseInt(T(n[f][o]).attr("rowspan"),10)||1)||1<(parseInt(T(n[f][o]).attr("colspan"),10)||1))&&(i=D((s=$(n[f][o],n)).row,s.col,n),f=Math.min(s.row,f),c=Math.max(i.row,c),d=Math.min(s.col,d),p=Math.max(i.col,p)),(1<(parseInt(T(n[c][o]).attr("rowspan"),10)||1)||1<(parseInt(T(n[c][o]).attr("colspan"),10)||1))&&(i=D((s=$(n[c][o],n)).row,s.col,n),f=Math.min(s.row,f),c=Math.max(i.row,c),d=Math.min(s.col,d),p=Math.max(i.col,p));return f==e&&c==t&&d==a&&p==l?{min_i:e,max_i:t,min_j:a,max_j:l}:h(f,c,d,p,n)}(Math.min(l.row,n.row),Math.max(l.row,n.row),Math.min(l.col,n.col),Math.max(l.col,n.col),a);N(),e.classList.add("fr-cell-fixed"),t.classList.add("fr-cell-handler");for(var o=r.min_i;o<=r.max_i;o++)for(var s=r.min_j;s<=r.max_j;s++)T(e).closest("table").is(T(a[o][s]).closest("table"))&&T(a[o][s]).addClass("fr-selected-cell")}}function K(e){var t=null,a=T(e.target);return"TD"==e.target.tagName||"TH"==e.target.tagName?t=e.target:0<a.closest("th",a.closest("thead")[0]).length?t=a.closest("th",a.closest("thead")[0]).get(0):0<a.closest("td",a.closest("tr")[0]).length&&(t=a.closest("td",a.closest("tr")[0]).get(0)),-1===A.$el.html.toString().search(t)?null:t}function B(){N(),A.popups.hide("table.edit")}function e(e){var t=K(e);if("false"==T(t).parents("[contenteditable]").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;if(0<te().length&&!t&&B(),!A.edit.isDisabled()||A.popups.isVisible("table.edit"))if(1!=e.which||1==e.which&&A.helpers.isMac()&&e.ctrlKey)(3==e.which||1==e.which&&A.helpers.isMac()&&e.ctrlKey)&&t&&B();else if(r=!0,t){0<te().length&&!e.shiftKey&&B(),e.stopPropagation(),A.events.trigger("image.hideResizer"),A.events.trigger("video.hideResizer"),n=!0;var a=t.tagName.toLowerCase();e.shiftKey&&0<A.$el.find("".concat(a,".fr-selected-cell")).length?T(A.$el.find("".concat(a,".fr-selected-cell")).closest("table")).is(T(t).closest("table"))?k(l,t):S():((A.keys.ctrlKey(e)||e.shiftKey)&&"TD"===e.currentTarget.tagName&&(1<te().length||0===T(t).find(A.selection.element()).length&&!T(t).is(A.selection.element()))&&S(),l=t,0<A.opts.tableEditButtons.length&&k(l,l))}}function a(e){if(!A.edit.isDisabled()&&A.popups.areVisible())return!0;var t=K(e);if(1===te().length&&null===t&&(A.toolbar.enable(),N()),(1===te().length&&t&&"TD"!==t.tagName&&"TH"!==t.tagName||!n&&!A.$tb.is(e.target)&&!A.$tb.is(T(e.target).closest(".fr-toolbar")))&&(A.toolbar.enable(),N()),("BODY"===e.target.tagName||"HTML"===e.target.tagName)&&!t&&0<te().length&&A.toolbar.enable(),!(1!=e.which||1==e.which&&A.helpers.isMac()&&e.ctrlKey)){if(r=!1,n)n=!1,K(e)||1!=te().length?0<te().length?A.selection.isCollapsed()?(g(),A.toolbar.enable()):(N(),A.edit.on()):te().length||(A.$el.removeClass("fr-no-selection"),A.edit.on()):N();if(y){y=!1,O.removeClass("fr-moving"),A.$el.removeClass("fr-no-selection"),A.edit.on();var a=parseFloat(O.css("left"))+A.opts.tableResizerOffset+A.$wp.offset().left;A.opts.iframe&&(a-=A.$iframe.offset().left),O.data("release-position",a),O.removeData("max-left"),O.removeData("max-right"),function R(){var e=O.data("origin"),t=O.data("release-position");if(e!==t){var a=O.data("first"),l=O.data("second"),n=O.data("table"),r=n.outerWidth();if(A.undo.canDo()||A.undo.saveStep(),null!=a&&null!=l){var o,s,i,f=x(n),c=[],d=[],p=[],h=[];for(o=0;o<f.length;o++)s=T(f[o][a]),i=T(f[o][l]),c[o]=s.outerWidth(),p[o]=i.outerWidth(),d[o]=c[o]/r*100,h[o]=p[o]/r*100;for(o=0;o<f.length;o++)if(s=T(f[o][a]),i=T(f[o][l]),f[o][a]!=f[o][l]){var u=(d[o]*(c[o]+t-e)/c[o]).toFixed(4);s.css("width",u+"%"),i.css("width",(d[o]+h[o]-u).toFixed(4)+"%")}}else{var g,b=n.parent(),m=parseFloat(b.css("padding-left")),v=parseFloat(b.css("padding-right")),w=m+v,C=r/(b.width()-w)*100,E=(parseInt(n.css("margin-left"),10)||0)/b.width()*100,y=(parseInt(n.css("margin-right"),10)||0)/b.width()*100;"rtl"==A.opts.direction&&0===l||"rtl"!=A.opts.direction&&0!==l?(g=(r+t-e)/r*C,n.css("margin-right","calc(100% - ".concat(Math.round(g).toFixed(4),"% - ").concat(Math.round(E).toFixed(4),"%)"))):("rtl"==A.opts.direction&&0!==l||"rtl"!=A.opts.direction&&0===l)&&(g=(r-t+e)/r*C,n.css("margin-left","calc(100% - ".concat(Math.round(g).toFixed(4),"% - ").concat(Math.round(y).toFixed(4),"%)"))),n.css("width","".concat(Math.round(g).toFixed(4),"%"))}A.selection.restore(),A.undo.saveStep(),A.events.trigger("table.resized",[n.get(0)])}O.removeData("origin"),O.removeData("release-position"),O.removeData("first"),O.removeData("second"),O.removeData("table")}(),W()}}}function F(e){if((!(T(e.currentTarget).is(T(e.originalEvent.relatedTarget))||e.currentTarget.contains(e.originalEvent.relatedTarget)||e.originalEvent.relatedTarget&&e.originalEvent.relatedTarget.contains(e.currentTarget))||e.currentTarget.querySelector("input, textarea"))&&(A.events.$on(T("input, textarea"),"click",le),!0===n&&0<A.opts.tableEditButtons.length)){if(T(e.currentTarget).closest("table").is(ae())){if("TBODY"===e.currentTarget.parentElement.parentElement.tagName&&"TD"==e.currentTarget.tagName&&0===A.$el.find("th.fr-selected-cell").length&&0===A.$el.find("tfoot td.fr-selected-cell").length)return void k(l,e.currentTarget);if("TFOOT"===e.currentTarget.parentElement.parentElement.tagName&&"TD"==e.currentTarget.tagName&&0===A.$el.find("tbody td.fr-selected-cell").length)return void k(l,e.currentTarget);if("TH"==e.currentTarget.tagName&&0===A.$el.find("td.fr-selected-cell").length)return void k(l,e.currentTarget)}"TD"!==e.currentTarget.tagName&&"TH"!==e.currentTarget.tagName&&S()}}function Y(e,t,a,l){for(var n,r=t;r!=A.el&&"TD"!=r.tagName&&"TH"!=r.tagName&&("up"==l?n=r.previousElementSibling:"down"==l&&(n=r.nextElementSibling),!n);)r=r.parentNode;"TD"==r.tagName||"TH"==r.tagName?function o(e,t){for(var a=e;a&&"TABLE"!=a.tagName&&a.parentNode!=A.el;)a=a.parentNode;if(a&&"TABLE"==a.tagName){var l=x(T(a));"up"==t?z($(e,l),a,l):"down"==t&&L($(e,l),a,l)}}(r,l):n&&("up"==l&&A.selection.setAtEnd(n),"down"==l&&A.selection.setAtStart(n))}function z(e,t,a){0<T(".tribute-container").length&&"none"!=T(".tribute-container").css("display")||(0<e.row?A.selection.setAtEnd(a[e.row-1][e.col]):Y(0,t,0,"up"))}function L(e,t,a){if(!(0<T(".tribute-container").length&&"none"!=T(".tribute-container").css("display"))){var l=parseInt(a[e.row][e.col].getAttribute("rowspan"),10)||1;e.row<a.length-l?A.selection.setAtStart(a[e.row+l][e.col]):Y(0,t,0,"down")}}function W(){O&&(O.find("div").css("opacity",0),O.css("top",0),O.css("left",0),O.css("height",0),O.find("div").css("height",0),O.hide())}function H(){f&&f.removeClass("fr-visible").css("left","-9999px")}function P(e,t){var a,l=T(t);l&&(a=l.closest("table"));var n=a.parent();if(t&&"TD"!=t.tagName&&"TH"!=t.tagName&&(0<l.closest("td").length?t=l.closest("td"):0<l.closest("th").length&&(t=l.closest("th"))),!t||"TD"!=t.tagName&&"TH"!=t.tagName)O&&l.get(0)!=O.get(0)&&l.parent().get(0)!=O.get(0)&&A.core.sameInstance(O)&&W();else{if(l=T(t),0===A.$el.find(l).length)return!1;var r=l.offset().left-1,o=r+l.outerWidth();if(Math.abs(e.pageX-r)<=A.opts.tableResizerOffset||Math.abs(o-e.pageX)<=A.opts.tableResizerOffset){var s,i,f,c,d,p=x(a),h=$(t,p),u=D(h.row,h.col,p),g=a.offset().top,b=a.outerHeight()-1;"rtl"!=A.opts.direction?e.pageX-r<=A.opts.tableResizerOffset?(f=r,0<h.col?(c=r-U(h.col-1,p)+A.opts.tableResizingLimit,d=r+U(h.col,p)-A.opts.tableResizingLimit,s=h.col-1,i=h.col):(s=null,i=0,c=a.offset().left-1-parseInt(a.css("margin-left"),10),d=a.offset().left-1+a.width()-p[0].length*A.opts.tableResizingLimit)):o-e.pageX<=A.opts.tableResizerOffset&&(f=o,u.col<p[u.row].length&&p[u.row][u.col+1]?(c=o-U(u.col,p)+A.opts.tableResizingLimit,d=o+U(u.col+1,p)-A.opts.tableResizingLimit,s=u.col,i=u.col+1):(s=u.col,i=null,c=a.offset().left-1+p[0].length*A.opts.tableResizingLimit,d=n.offset().left-1+n.width()+parseFloat(n.css("padding-left")))):o-e.pageX<=A.opts.tableResizerOffset?(f=o,0<h.col?(c=o-U(h.col,p)+A.opts.tableResizingLimit,d=o+U(h.col-1,p)-A.opts.tableResizingLimit,s=h.col,i=h.col-1):(s=null,i=0,c=a.offset().left+p[0].length*A.opts.tableResizingLimit,d=n.offset().left-1+n.width()+parseFloat(n.css("padding-left")))):e.pageX-r<=A.opts.tableResizerOffset&&(f=r,u.col<p[u.row].length&&p[u.row][u.col+1]?(c=r-U(u.col+1,p)+A.opts.tableResizingLimit,d=r+U(u.col,p)-A.opts.tableResizingLimit,s=u.col+1,i=u.col):(s=u.col,i=null,c=n.offset().left+parseFloat(n.css("padding-left")),d=a.offset().left-1+a.width()-p[0].length*A.opts.tableResizingLimit)),O||function E(){A.shared.$table_resizer||(A.shared.$table_resizer=T(document.createElement("div")).attr("class","fr-table-resizer").html("<div></div>")),O=A.shared.$table_resizer,A.events.$on(O,"mousedown",function(e){return!A.core.sameInstance(O)||(0<te().length&&B(),1==e.which?(A.selection.save(),y=!0,O.addClass("fr-moving"),S(),A.edit.off(),O.find("div").css("opacity",1),!1):void 0)}),A.events.$on(O,"mousemove",function(e){if(!A.core.sameInstance(O))return!0;y&&(A.opts.iframe&&(e.pageX-=A.$iframe.offset().left),J(e))}),A.events.on("shared.destroy",function(){O.html("").removeData().remove(),O=null},!0),A.events.on("destroy",function(){A.$el.find(".fr-selected-cell").removeClass("fr-selected-cell"),T("body").first().append(O.hide())},!0)}(),O.data("table",a),O.data("first",s),O.data("second",i),O.data("instance",A),A.$wp.append(O);var m=f-A.win.pageXOffset-A.opts.tableResizerOffset-A.$wp.offset().left,v=g-A.$wp.offset().top+A.$wp.scrollTop();if(A.opts.iframe){var w=A.helpers.getPX(A.$wp.find(".fr-iframe").css("padding-top")),C=A.helpers.getPX(A.$wp.find(".fr-iframe").css("padding-left"));m+=A.$iframe.offset().left+C,v+=A.$iframe.offset().top+w,c+=A.$iframe.offset().left,d+=A.$iframe.offset().left}O.data("max-left",c),O.data("max-right",d),O.data("origin",f-A.win.pageXOffset),O.css("top",v),O.css("left",m),O.css("height",b),O.find("div").css("height",b),O.css("padding-left",A.opts.tableResizerOffset),O.css("padding-right",A.opts.tableResizerOffset),O.show()}else A.core.sameInstance(O)&&W()}}function V(e,t){if(A.$box.find(".fr-line-breaker").isVisible())return!1;f||Q(),A.$box.append(f),f.data("instance",A);var a,l=T(t).find("tr").first(),n=e.pageX,r=0,o=0;if(A.opts.iframe){var s=A.helpers.getPX(A.$wp.find(".fr-iframe").css("padding-top")),i=A.helpers.getPX(A.$wp.find(".fr-iframe").css("padding-left"));r+=A.$iframe.offset().left-A.helpers.scrollLeft()+i,o+=A.$iframe.offset().top-A.helpers.scrollTop()+s}l.find("th, td").each(function(){var e=T(this);return e.offset().left<=n&&n<e.offset().left+e.outerWidth()/2?(a=parseInt(f.find("a").css("width"),10),f.css("top",o+e.offset().top-A.$box.offset().top-a-5),f.css("left",r+e.offset().left-A.$box.offset().left-a/2),f.data("selected-cell",e),f.data("position","before"),f.addClass("fr-visible"),!1):e.offset().left+e.outerWidth()/2<=n&&n<e.offset().left+e.outerWidth()?(a=parseInt(f.find("a").css("width"),10),f.css("top",o+e.offset().top-A.$box.offset().top-a-5),f.css("left",r+e.offset().left-A.$box.offset().left+e.outerWidth()-a/2),f.data("selected-cell",e),f.data("position","after"),f.addClass("fr-visible"),!1):void 0})}function j(e,t){if(A.$box.find(".fr-line-breaker").isVisible())return!1;f||Q(),A.$box.append(f),f.data("instance",A);var a,l=T(t),n=e.pageY,r=0,o=0;if(A.opts.iframe){var s=A.helpers.getPX(A.$wp.find(".fr-iframe").css("padding-top")),i=A.helpers.getPX(A.$wp.find(".fr-iframe").css("padding-left"));r+=A.$iframe.offset().left-A.helpers.scrollLeft()+i,o+=A.$iframe.offset().top-A.helpers.scrollTop()+s}l.find("tr").each(function(){var e=T(this);a=parseInt(f.find("a").css("width"),10);var t=r+e.offset().left-A.$box.offset().left;return t=0!==A.$box.offset().left?t-a-5:t+a-5,e.offset().top<=n&&n<e.offset().top+e.outerHeight()/2?(f.css("top",o+e.offset().top-A.$box.offset().top-a/2),f.css("left",t),f.data("selected-cell",e.find("td").first()),f.data("position","above"),f.addClass("fr-visible"),!1):e.offset().top+e.outerHeight()/2<=n&&n<e.offset().top+e.outerHeight()?(f.css("top",o+e.offset().top-A.$box.offset().top+e.outerHeight()-a/2),f.css("left",t),f.data("selected-cell",e.find("td").first()),f.data("position","below"),f.addClass("fr-visible"),!1):void 0})}function G(e){o=null;var t=A.doc.elementFromPoint(e.pageX-A.win.pageXOffset,e.pageY-A.win.pageYOffset);A.opts.tableResizer&&(!A.popups.areVisible()||A.popups.areVisible()&&A.popups.isVisible("table.edit"))&&P(e,t),!A.opts.tableInsertHelper||A.popups.areVisible()||A.$tb.hasClass("fr-inline")&&A.$tb.isVisible()||function r(e,t){if(0===te().length){var a,l,n;if(t&&("HTML"==t.tagName||"BODY"==t.tagName||A.node.isElement(t)))for(a=1;a<=A.opts.tableInsertHelperOffset;a++){if(l=A.doc.elementFromPoint(e.pageX-A.win.pageXOffset,e.pageY-A.win.pageYOffset+a),T(l).hasClass("fr-tooltip"))return!0;if(l&&("TH"==l.tagName||"TD"==l.tagName||"TABLE"==l.tagName)&&(T(l).parents(".fr-wrapper").length||A.opts.iframe)&&"false"!=T(l).closest("table").attr("contenteditable"))return V(e,T(l).closest("table")),!0;if(n=A.doc.elementFromPoint(e.pageX-A.win.pageXOffset+a,e.pageY-A.win.pageYOffset),T(n).hasClass("fr-tooltip"))return!0;if(n&&("TH"==n.tagName||"TD"==n.tagName||"TABLE"==n.tagName)&&(T(n).parents(".fr-wrapper").length||A.opts.iframe)&&"false"!=T(n).closest("table").attr("contenteditable"))return j(e,T(n).closest("table")),!0}A.core.sameInstance(f)&&H()}}(e,t)}function X(){if(y){var e=O.data("table").offset().top-A.win.pageYOffset;if(A.opts.iframe){var t=A.helpers.getPX(A.$wp.find(".fr-iframe").css("padding-top"));e+=A.$iframe.offset().top-A.helpers.scrollTop()+t}O.css("top",e)}}function U(e,t){var a,l=T(t[0][e]).outerWidth();for(a=1;a<t.length;a++)l=Math.min(l,T(t[a][e]).outerWidth());return l}function q(e,t,a){var l,n=0;for(l=e;l<=t;l++)n+=U(l,a);return n}function J(e){if(1<te().length&&r&&S(),!1===r&&!1===n&&!1===y)o&&clearTimeout(o),A.edit.isDisabled()&&!A.popups.isVisible("table.edit")||(o=setTimeout(G,30,e));else if(y){var t=e.pageX-A.win.pageXOffset;A.opts.iframe&&(t+=A.$iframe.offset().left);var a=O.data("max-left"),l=O.data("max-right");a<=t&&t<=l?O.css("left",t-A.opts.tableResizerOffset-A.$wp.offset().left):t<a&&parseFloat(O.css("left"),10)>a-A.opts.tableResizerOffset?O.css("left",a-A.opts.tableResizerOffset-A.$wp.offset().left):l<t&&parseFloat(O.css("left"),10)<l-A.opts.tableResizerOffset&&O.css("left",l-A.opts.tableResizerOffset-A.$wp.offset().left)}else r&&H()}function Z(e){A.node.isEmpty(e.get(0))?A.opts.keepTextFormatOnTable&&A.browser.mozilla?e.append(ye.MARKERS):e.prepend(ye.MARKERS):e.prepend(ye.START_MARKER).append(ye.END_MARKER)}function Q(){A.shared.$ti_helper||(A.shared.$ti_helper=T(document.createElement("div")).attr("class","fr-insert-helper").html('<a class="fr-floating-btn" role="button" tabIndex="-1" title="'.concat(A.language.translate("Insert"),'"><svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="M22,16.75 L16.75,16.75 L16.75,22 L15.25,22.000 L15.25,16.75 L10,16.75 L10,15.25 L15.25,15.25 L15.25,10 L16.75,10 L16.75,15.25 L22,15.25 L22,16.75 Z"/></svg></a>')),A.events.bindClick(A.shared.$ti_helper,"a",function(){var e=f.data("selected-cell"),t=f.data("position"),a=f.data("instance")||A;"before"==t?(A.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertColumn(t),e.removeClass("fr-selected-cell"),A.undo.saveStep()):"after"==t?(A.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertColumn(t),e.removeClass("fr-selected-cell"),A.undo.saveStep()):"above"==t?(A.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertRow(t),e.removeClass("fr-selected-cell"),A.undo.saveStep()):"below"==t&&(A.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertRow(t),e.removeClass("fr-selected-cell"),A.undo.saveStep()),H()}),A.events.on("shared.destroy",function(){A.shared.$ti_helper.html("").removeData().remove(),A.shared.$ti_helper=null},!0),A.events.$on(A.shared.$ti_helper,"mousemove",function(e){e.stopPropagation()},!0),A.events.$on(T(A.o_win),"scroll",function(){H()},!0),A.events.$on(A.$wp,"scroll",function(){H()},!0)),f=A.shared.$ti_helper,A.events.on("destroy",function(){f=null}),A.tooltip.bind(A.$box,".fr-insert-helper > a.fr-floating-btn")}function ee(){l=null,clearTimeout(o)}function te(){return A.el.querySelectorAll(".fr-selected-cell")}function ae(){var e=te();if(e.length){for(var t=e[0];t&&"TABLE"!=t.tagName&&t.parentNode!=A.el;)t=t.parentNode;return t&&"TABLE"==t.tagName?T(t):T([])}return T([])}function le(){n=!1}return{_init:function ne(){if(!A.$wp)return!1;if(A.helpers.isMobile()&&(A.events.$on(A.$el,"mousedown",e),A.events.$on(A.$win,"mouseup",a)),!A.helpers.isMobile()){y=n=r=!1,A.events.$on(A.$el,"mousedown",e),A.popups.onShow("image.edit",function(){N(),n=r=!1}),A.popups.onShow("link.edit",function(){N(),n=r=!1}),A.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&N()}),A.events.$on(A.$el,"mouseover","th, td",F),A.events.$on(A.$win,"mouseup",a),A.opts.iframe&&A.events.$on(T(A.o_win),"mouseup",a),A.events.$on(A.$win,"mousemove",J),A.events.$on(T(A.o_win),"scroll",X),A.events.on("contentChanged",function(){0<te().length&&(g(),A.$el.find("img").on("load.selected-cells",function(){T(this).off("load.selected-cells"),0<te().length&&g()}))}),A.events.$on(T(A.o_win),"resize",function(){N()}),A.events.on("toolbar.esc",function(){if(0<te().length)return A.events.disableBlur(),A.events.focus(),!1},!0),A.events.$on(T(A.o_win),"keydown",function(){r&&n&&(n=r=!1,A.$el.removeClass("fr-no-selection"),A.edit.on(),A.selection.setAtEnd(A.$el.find(".fr-selected-cell").last().get(0)),A.selection.restore(),N())}),A.events.$on(A.$el,"keydown",function(e){e.shiftKey?!1===function o(e){var t=te();if(null!=t&&0<t.length){var a,l=x(),n=e.which,r=$(1==t.length?a=t[0]:(a=A.el.querySelector(".fr-cell-fixed"),A.el.querySelector(".fr-cell-handler")),l);if(ye.KEYCODE.ARROW_RIGHT==n){if(r.col<l[0].length-1)return k(a,l[r.row][r.col+1]),!1}else if(ye.KEYCODE.ARROW_DOWN==n){if(r.row<l.length-1)return k(a,l[r.row+1][r.col]),!1}else if(ye.KEYCODE.ARROW_LEFT==n){if(0<r.col)return k(a,l[r.row][r.col-1]),!1}else if(ye.KEYCODE.ARROW_UP==n&&0<r.row)return k(a,l[r.row-1][r.col]),!1}}(e)&&setTimeout(function(){g()},0):function s(e){var t=e.which,a=A.selection.blocks();if(a.length&&("P"!==(a=a[0]).tagName&&"DIV"!==a.tagName||(a=a.parentNode),"TD"==a.tagName||"TH"==a.tagName)){for(var l=a;l&&"TABLE"!=l.tagName&&l.parentNode!=A.el;)l=l.parentNode;if(l&&"TABLE"==l.tagName&&(ye.KEYCODE.ARROW_LEFT==t||ye.KEYCODE.ARROW_UP==t||ye.KEYCODE.ARROW_RIGHT==t||ye.KEYCODE.ARROW_DOWN==t)&&(0<te().length&&B(),A.browser.webkit&&(ye.KEYCODE.ARROW_UP==t||ye.KEYCODE.ARROW_DOWN==t))){var n=A.selection.ranges(0).startContainer;if(n.nodeType==Node.TEXT_NODE&&(ye.KEYCODE.ARROW_UP==t&&(n.previousSibling&&"BR"!==n.previousSibling.tagName||n.previousSibling&&"BR"===n.previousSibling.tagName&&n.previousSibling.previousSibling)||ye.KEYCODE.ARROW_DOWN==t&&(n.nextSibling&&"BR"!==n.nextSibling.tagName||n.nextSibling&&"BR"===n.nextSibling.tagName&&n.nextSibling.nextSibling)))return;e.preventDefault(),e.stopPropagation();var r=x(T(l)),o=$(a,r);return ye.KEYCODE.ARROW_UP==t?z(o,l,r):ye.KEYCODE.ARROW_DOWN==t&&L(o,l,r),A.selection.restore(),!1}}}(e)}),A.events.on("keydown",function(e){if(!1===function l(e){if(e.which==ye.KEYCODE.TAB){var t;if(0<te().length)t=A.$el.find(".fr-selected-cell").last();else{var a=A.selection.element();"TD"==a.tagName||"TH"==a.tagName?t=T(a):a!=A.el&&(0<T(a).parentsUntil(A.$el,"td").length?t=T(a).parents("td").first():0<T(a).parentsUntil(A.$el,"th").length&&(t=T(a).parents("th").first()))}if(t)return e.preventDefault(),!!(0===A.selection.get().focusOffset&&0<T(A.selection.element()).parentsUntil(A.$el,"ol, ul").length&&(0<T(A.selection.element()).closest("li").prev().length||T(A.selection.element()).is("li")&&0<T(A.selection.element()).prev().length))||(B(),e.shiftKey?0<t.prev().length?Z(t.prev()):0<t.closest("tr").length&&0<t.closest("tr").prev().length?Z(t.closest("tr").prev().find("td").last()):0<t.closest("tbody").length&&0<t.closest("table").find("thead tr").length&&Z(t.closest("table").find("thead tr th").last()):0<t.next().length?Z(t.next()):0<t.closest("tr").length&&0<t.closest("tr").next().length?Z(t.closest("tr").next().find("td").first()):0<t.closest("thead").length&&0<t.closest("table").find("tbody tr").length?Z(t.closest("table").find("tbody tr td").first()):(t.addClass("fr-selected-cell"),m("below"),N(),Z(t.closest("tr").next().find("td").first())),A.selection.restore(),!1)}}(e))return!1;var t=te();if(0<t.length){if(0<t.length&&A.keys.ctrlKey(e)&&e.which==ye.KEYCODE.A)return N(),A.popups.isVisible("table.edit")&&A.popups.hide("table.edit"),t=[],!0;if(e.which==ye.KEYCODE.ESC&&A.popups.isVisible("table.edit"))return N(),A.popups.hide("table.edit"),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),!(t=[]);if(1<t.length&&(e.which==ye.KEYCODE.BACKSPACE||e.which==ye.KEYCODE.DELETE)){A.undo.saveStep();for(var a=0;a<t.length;a++)T(t[a]).html("<br>"),a==t.length-1&&T(t[a]).prepend(ye.MARKERS);return A.selection.restore(),A.undo.saveStep(),!(t=[])}if(1<t.length&&e.which!=ye.KEYCODE.F10&&!A.keys.isBrowserAction(e))return e.preventDefault(),!(t=[])}else if(!(t=[])===function n(e){if(e.altKey&&e.which==ye.KEYCODE.SPACE){var t,a=A.selection.element();if("TD"==a.tagName||"TH"==a.tagName?t=a:0<T(a).closest("td").length?t=T(a).closest("td").get(0):0<T(a).closest("th").length&&(t=T(a).closest("th").get(0)),t)return e.preventDefault(),k(t,t),g(),!1}}(e))return!1},!0);var t=[];A.events.on("html.beforeGet",function(){t=te();for(var e=0;e<t.length;e++)t[e].className=(t[e].className||"").replace(/fr-selected-cell/g,"")}),A.events.on("html.afterGet",function(){for(var e=0;e<t.length;e++)t[e].className=(t[e].className?t[e].className.trim()+" ":"")+"fr-selected-cell";t=[]}),c(!0),p(!0)}A.events.on("destroy",ee)},insert:function re(e,t){var a,l,n=function f(){var e={startTag:"",closeTag:""};if(A.opts.keepTextFormatOnTable){var t=T(A.selection.element().firstChild).parentsUntil(A.$el);e=h(t)}return{startTag:e.startTag,closeTag:e.closeTag}}(),r="<table "+(A.opts.tableDefaultWidth?'style="width: '+A.opts.tableDefaultWidth+';" ':"")+'class="fr-inserted-table"><tbody>',o=100/t;for(a=0;a<e;a++){for(r+="<tr>",l=0;l<t;l++)r+="<td"+(A.opts.tableDefaultWidth?' style="width: '+o.toFixed(4)+'%;"':"")+">"+n.startTag,0===a&&0===l&&(r+=ye.MARKERS),r+="<br>"+n.closeTag+"</td>";r+="</tr>"}if(r+="</tbody></table>",A.opts.trackChangesEnabled){A.edit.on(),A.events.focus(!0),A.selection.restore(),A.undo.saveStep(),A.markers.insert(),A.html.wrap();var s=A.$el.find(".fr-marker");A.node.isLastSibling(s)&&s.parent().hasClass("fr-deletable")&&s.insertAfter(s.parent()),s.replaceWith(r),A.selection.clear()}else A.html.insert(r);A.selection.restore();var i=A.$el.find(".fr-inserted-table");i.removeClass("fr-inserted-table"),A.events.trigger("table.inserted",[i.get(0)])},remove:u,insertRow:m,deleteRow:function oe(){var e=ae();if(0<e.length){var t,a,l,n=x(),r=M(n);if(null==r)return;if(0===r.min_i&&r.max_i==n.length-1)u();else{for(t=r.max_i;t>=r.min_i;t--){for(l=T(e.find("tr").not(e.find("> table tr")).get(t)),a=0;a<n[t].length;a++)if(0===a||n[t][a]!=n[t][a-1]){var o=T(n[t][a]);if(1<parseInt(o.attr("rowspan"),10)){var s=parseInt(o.attr("rowspan"),10)-1;1==s?o.removeAttr("rowspan"):o.attr("rowspan",s)}if(t<n.length-1&&n[t][a]==n[t+1][a]&&(0===t||n[t][a]!=n[t-1][a])){for(var i=n[t][a],f=a;0<f&&n[t][f]==n[t][f-1];)f--;0===f?T(e.find("tr").not(e.find("> table tr")).get(t+1)).prepend(i):T(n[t+1][f-1])[0].parentNode&&T(n[t+1][f-1])[0].insertAdjacentElement("afterend",i)}}var c=l.parent();l.remove(),0===c.find("tr").length&&c.remove(),n=x(e)}E(0,n.length-1,0,n[0].length-1,e),0<r.min_i?A.selection.setAtEnd(n[r.min_i-1][0]):A.selection.setAtEnd(n[0][0]),A.selection.restore(),A.popups.hide("table.edit")}}},insertColumn:function se(c){var e=ae();if(0<e.length){var d,p=x(),t=M(p);d="before"==c?t.min_j:t.max_j;var a,h=100/p[0].length,u=100/(p[0].length+1);e.find("th, td").each(function(){(a=T(this)).data("old-width",a.outerWidth()/e.outerWidth()*100)}),e.find("tr").not(e.find("> table tr")).each(function(e){for(var t,a=T(this),l=0,n=0;l-1<d;){if(!(t=a.find("> th, > td").get(n))){t=null;break}t==p[e][l]?(l+=parseInt(T(t).attr("colspan"),10)||1,n++):(l+=parseInt(T(p[e][l]).attr("colspan"),10)||1,"after"==c&&(t=0===n?-1:a.find("> th, > td").get(n-1)))}var r=T(t);if("after"==c&&d<l-1||"before"==c&&0<d&&p[e][d]==p[e][d-1]){if(0===e||0<e&&p[e][d]!=p[e-1][d]){var o=parseInt(r.attr("colspan"),10)+1;r.attr("colspan",o),r.css("width",(r.data("old-width")*u/h+u).toFixed(4)+"%"),r.removeData("old-width")}}else{var s,i=(r.get(0)||"").tagName;if(0<a.find("th").length&&"TH"===i)s='<th style="width: '.concat(u.toFixed(4),'%;"><br></th>');else{var f=b(p[e][d]);s='<td style="'.concat(r.attr("style"),"; width: ").concat(u.toFixed(4),'%;">')+f.startTag+"<br>"+f.closeTag+"</td>"}T(s).append("<br>"),T(s).css("width","".concat(u.toFixed(4),"%")),-1==t?a.prepend(s):null==t?a.append(s):"before"==c?r.before(s):"after"==c&&r.after(s)}}),e.find("th, td").each(function(){(a=T(this)).data("old-width")&&(a.css("width",(a.data("old-width")*u/h).toFixed(4)+"%"),a.removeData("old-width"))}),A.popups.isVisible("table.edit")&&g()}},deleteColumn:function ie(){var e=ae();if(0<e.length){var t,a,l,n=x(),r=M(n);if(null==r)return;if(0===r.min_j&&r.max_j==n[0].length-1)u();else{var o=0;for(t=0;t<n.length;t++)for(a=0;a<n[0].length;a++)(l=T(n[t][a])).hasClass("fr-selected-cell")||(l.data("old-width",l.outerWidth()/e.outerWidth()*100),(a<r.min_j||a>r.max_j)&&(o+=l.outerWidth()/e.outerWidth()*100));for(o/=n.length,a=r.max_j;a>=r.min_j;a--)for(t=0;t<n.length;t++)if(0===t||n[t][a]!=n[t-1][a])if(l=T(n[t][a]),1<(parseInt(l.attr("colspan"),10)||1)){var s=parseInt(l.attr("colspan"),10)-1;1==s?l.removeAttr("colspan"):l.attr("colspan",s),l.css("width",(100*(l.data("old-width")-U(a,n))/o).toFixed(4)+"%"),l.removeData("old-width")}else{var i=T(l.parent().get(0));l.remove(),0===i.find("> th, > td").length&&(0===i.prev().length||0===i.next().length||i.prev().find("> th[rowspan], > td[rowspan]").length<i.prev().find("> th, > td").length)&&i.remove()}E(0,n.length-1,0,n[0].length-1,e),0<r.min_j?A.selection.setAtEnd(n[r.min_i][r.min_j-1]):A.selection.setAtEnd(n[r.min_i][0]),A.selection.restore(),A.popups.hide("table.edit"),e.find("th, td").each(function(){(l=T(this)).data("old-width")&&(l.css("width",(100*l.data("old-width")/o).toFixed(4)+"%"),l.removeData("old-width"))})}}},mergeCells:function fe(){if(1<te().length&&(0===A.$el.find("th.fr-selected-cell").length||0===A.$el.find("td.fr-selected-cell").length)){_();var e,t,a=M(x());if(null==a)return;var l=A.$el.find(".fr-selected-cell"),n=T(l[0]),r=n.parent().find(".fr-selected-cell"),o=n.closest("table"),s=n.html(),i=0;for(e=0;e<r.length;e++)i+=T(r[e]).outerWidth();for(n.css("width",Math.min(100,i/o.outerWidth()*100).toFixed(4)+"%"),a.min_j<a.max_j&&n.attr("colspan",a.max_j-a.min_j+1),a.min_i<a.max_i&&n.attr("rowspan",a.max_i-a.min_i+1),e=1;e<l.length;e++)"<br>"!=(t=T(l[e])).html()&&""!==t.html()&&(s+="<br>".concat(t.html())),t.remove();n.html(s),A.selection.setAtEnd(n.get(0)),A.selection.restore(),A.toolbar.enable(),w(a.min_i,a.max_i,o);var f=o.find("tr:empty");for(e=f.length-1;0<=e;e--)T(f[e]).remove();v(a.min_j,a.max_j,o),g()}},splitCellVertically:function ce(){if(1==te().length){var e=A.$el.find(".fr-selected-cell"),t=parseInt(e.attr("colspan"),10)||1,a=e.parent().outerWidth(),l=e.outerWidth(),n=e.clone().html("<br>"),r=x(),o=$(e.get(0),r);if(1<t){var s=Math.ceil(t/2);l=q(o.col,o.col+s-1,r)/a*100;var i=q(o.col+s,o.col+t-1,r)/a*100;1<s?e.attr("colspan",s):e.removeAttr("colspan"),1<t-s?n.attr("colspan",t-s):n.removeAttr("colspan"),e.css("width",l.toFixed(4)+"%"),n.css("width",i.toFixed(4)+"%")}else{var f;for(f=0;f<r.length;f++)if(0===f||r[f][o.col]!=r[f-1][o.col]){var c=T(r[f][o.col]);if(!c.is(e)){var d=(parseInt(c.attr("colspan"),10)||1)+1;c.attr("colspan",d)}}l=l/a*100/2,e.css("width","".concat(l.toFixed(4),"%")),n.css("width","".concat(l.toFixed(4),"%"))}e[0].parentNode&&e[0].insertAdjacentElement("afterend",n[0]),N(),A.popups.hide("table.edit")}},splitCellHorizontally:function de(){if(1==te().length){var e=A.$el.find(".fr-selected-cell"),t=e.parent(),a=e.closest("table"),l=parseInt(e.attr("rowspan"),10),n=x(),r=$(e.get(0),n),o=e.clone().html("<br>");if(1<l){var s=Math.ceil(l/2);1<s?e.attr("rowspan",s):e.removeAttr("rowspan"),1<l-s?o.attr("rowspan",l-s):o.removeAttr("rowspan");for(var i=r.row+s,f=0===r.col?r.col:r.col-1;0<=f&&(n[i][f]==n[i][f-1]||0<i&&n[i][f]==n[i-1][f]);)f--;-1==f?T(a.find("tr").not(a.find("> table tr")).get(i)).prepend(o):T(n[i][f])[0].parentNode&&T(n[i][f])[0].insertAdjacentElement("afterend",o[0])}else{var c,d=T(document.createElement("tr")).append(o);for(c=0;c<n[0].length;c++)if(0===c||n[r.row][c]!=n[r.row][c-1]){var p=T(n[r.row][c]);p.is(e)||p.attr("rowspan",(parseInt(p.attr("rowspan"),10)||1)+1)}t[0].parentNode&&t[0].insertAdjacentElement("afterend",d[0])}N(),A.popups.hide("table.edit")}},addHeader:function pe(){var e=ae();if(0<e.length&&0===e.find("> th").length){var t,a="<thead><tr>",l=0;for(l=e.find("tr").first().find("> th").length,e.find("tr").first().find("> td").each(function(){var e=T(this);l+=parseInt(e.attr("colspan"),10)||1}),t=0;t<l;t++)a+="<th><br></th>";a+="</tr></thead>",e.prepend(a),g()}},addFooter:function he(){var e=ae();if(0<e.length&&0===e.find("tfoot").length){var t,a="<tfoot><tr>",l=0,n="> td";for(0<e.find("thead").length&&(n="> th"),e.find("tr").first().find(n).each(function(){var e=T(this);l+=parseInt(e.attr("colspan"),10)||1}),t=0;t<l;t++)a+="<td><br></td>";a+="</tr></tfoot>",e.append(a),g()}},removeHeader:function ue(){var e=ae(),t=e.find("> thead");if(0<(t=T(t)).length)if(0===e.find("tbody tr").length)u();else if(t.remove(),0<te().length)g();else{A.popups.hide("table.edit");var a=e.find("tbody tr").first().find("td").first().get(0);a&&(A.selection.setAtEnd(a),A.selection.restore())}},removeFooter:function ge(){var e=ae(),t=e.find("tfoot");if(0<t.length)if(0===e.find("tbody tr").length)u();else if(t.remove(),0<te().length)g();else{A.popups.hide("table.edit");var a=e.find("tbody tr").first().find("td").first().get(0);a&&(A.selection.setAtEnd(a),A.selection.restore())}},setBackground:t,showInsertPopup:function be(){var e=A.$tb.find('.fr-command[data-cmd="insertTable"]'),t=A.popups.get("table.insert");if(t||(t=c()),!t.hasClass("fr-active")){A.popups.refresh("table.insert"),A.popups.setContainer("table.insert",A.$tb);var a=A.button.getPosition(e),l=a.left,n=a.top;A.popups.show("table.insert",l,n,e.outerHeight())}},showEditPopup:g,showColorsPopup:s,back:function me(){0<te().length?g():(A.popups.hide("table.insert"),A.toolbar.showInline())},verticalAlign:function ve(e){A.$el.find(".fr-selected-cell").css("vertical-align",e)},horizontalAlign:function we(e){A.$el.find(".fr-selected-cell").css("text-align",e)},applyStyle:function Ce(e,t,a,l){if(0<t.length){if(A.opts.useClasses||("TABLE"===t.get(0).tagName?function r(e,t){var a=e.childNodes;if(0<a.length)for(var l=0;l<a.length;l++)"TD"===a[l].tagName?"fr-dashed-borders"===t||"fr-highlighted"===t||"fr-thick"===t?R(a[l]):"fr-alternate-rows"===t&&a[l].style.removeProperty("background-color"):r(a[l],t)}(t.get(0),e):R(t.get(0))),!a){var n=Object.keys(l);n.splice(n.indexOf(e),1),t.removeClass(n.join(" "))}t.toggleClass(e)}},selectedTable:ae,selectedCells:te,customColor:function Ee(){var e=A.popups.get("table.colors").find(".fr-table-colors-hex-layer input");e.length&&t(e.val())},selectCells:k}},ye.DefineIcon("insertTable",{NAME:"table",SVG_KEY:"insertTable"}),ye.RegisterCommand("insertTable",{title:"Insert Table",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("table.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("table.insert")):this.table.showInsertPopup()},plugin:"table"}),ye.RegisterCommand("tableInsert",{callback:function(e,t,a){this.table.insert(t,a),this.popups.hide("table.insert")}}),ye.DefineIcon("tableHeader",{NAME:"header",FA5NAME:"heading",SVG_KEY:"tableHeader"}),ye.RegisterCommand("tableHeader",{title:"Table Header",focus:!1,toggle:!0,callback:function(){this.popups.get("table.edit").find('.fr-command[data-cmd="tableHeader"]').hasClass("fr-active")?this.table.removeHeader():this.table.addHeader()},refresh:function(e){var t=this.table.selectedTable();0<t.length&&(0===t.find("> thead").length?e.removeClass("fr-active").attr("aria-pressed",!1):e.addClass("fr-active").attr("aria-pressed",!0))}}),ye.DefineIcon("tableFooter",{NAME:"table",FA5NAME:"table",SVG_KEY:"tableFooter"}),ye.RegisterCommand("tableFooter",{title:"Table Footer",focus:!1,toggle:!0,callback:function(){this.popups.get("table.edit").find('.fr-command[data-cmd="tableFooter"]').hasClass("fr-active")?this.table.removeFooter():this.table.addFooter()},refresh:function(e){var t=this.table.selectedTable();0<t.length&&(0===t.find("tfoot").length?e.removeClass("fr-active").attr("aria-pressed",!1):e.addClass("fr-active").attr("aria-pressed",!0))}}),ye.DefineIcon("tableRows",{NAME:"bars",SVG_KEY:"row"}),ye.RegisterCommand("tableRows",{type:"dropdown",focus:!1,title:"Row",options:{above:"Insert row above",below:"Insert row below","delete":"Delete row"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ye.COMMANDS.tableRows.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableRows" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.language.translate(t[a])+"</a></li>");return e+="</ul>"},callback:function(e,t){"above"==t||"below"==t?this.table.insertRow(t):this.table.deleteRow()}}),ye.DefineIcon("tableColumns",{NAME:"bars fa-rotate-90",SVG_KEY:"columns"}),ye.RegisterCommand("tableColumns",{type:"dropdown",focus:!1,title:"Column",options:{before:"Insert column before",after:"Insert column after","delete":"Delete column"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ye.COMMANDS.tableColumns.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableColumns" data-param1="'.concat(a,'" title="').concat(this.language.translate(t[a]),'">').concat(this.language.translate(t[a]),"</a></li>"));return e+="</ul>"},callback:function(e,t){"before"==t||"after"==t?this.table.insertColumn(t):this.table.deleteColumn()}}),ye.DefineIcon("tableCells",{NAME:"square-o",FA5NAME:"square",SVG_KEY:"cellOptions"}),ye.RegisterCommand("tableCells",{type:"dropdown",focus:!1,title:"Cell",options:{merge:"Merge cells","vertical-split":"Vertical split","horizontal-split":"Horizontal split"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ye.COMMANDS.tableCells.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableCells" data-param1="'.concat(a,'" title="').concat(this.language.translate(t[a]),'">').concat(this.language.translate(t[a]),"</a></li>"));return e+="</ul>"},callback:function(e,t){"merge"==t?this.table.mergeCells():"vertical-split"==t?this.table.splitCellVertically():this.table.splitCellHorizontally()},refreshOnShow:function(e,t){1<this.$el.find(".fr-selected-cell").length?(t.find('a[data-param1="vertical-split"]').addClass("fr-disabled").attr("aria-disabled",!0),t.find('a[data-param1="horizontal-split"]').addClass("fr-disabled").attr("aria-disabled",!0),t.find('a[data-param1="merge"]').removeClass("fr-disabled").attr("aria-disabled",!1)):(t.find('a[data-param1="merge"]').addClass("fr-disabled").attr("aria-disabled",!0),t.find('a[data-param1="vertical-split"]').removeClass("fr-disabled").attr("aria-disabled",!1),t.find('a[data-param1="horizontal-split"]').removeClass("fr-disabled").attr("aria-disabled",!1))}}),ye.DefineIcon("tableRemove",{NAME:"trash",SVG_KEY:"removeTable"}),ye.RegisterCommand("tableRemove",{title:"Remove Table",focus:!1,callback:function(){this.table.remove()}}),ye.DefineIcon("tableStyle",{NAME:"paint-brush",SVG_KEY:"tableStyle"}),ye.RegisterCommand("tableStyle",{title:"Table Style",type:"dropdown",focus:!1,html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.tableStyles;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableStyle" data-param1="'.concat(a,'" title="').concat(this.language.translate(t[a]),'">').concat(this.language.translate(t[a]),"</a></li>"));return e+="</ul>"},callback:function(e,t){this.table.applyStyle(t,this.$el.find(".fr-selected-cell").closest("table"),this.opts.tableMultipleStyles,this.opts.tableStyles)},refreshOnShow:function(e,t){var a=this.$,l=this.$el.find(".fr-selected-cell").closest("table");l&&t.find(".fr-command").each(function(){var e=a(this).data("param1"),t=l.hasClass(e);a(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),ye.DefineIcon("tableCellBackground",{NAME:"tint",SVG_KEY:"cellBackground"}),ye.RegisterCommand("tableCellBackground",{title:"Cell Background",focus:!1,popup:!0,callback:function(){this.table.showColorsPopup()}}),ye.RegisterCommand("tableCellBackgroundColor",{undo:!0,focus:!1,callback:function(e,t){this.table.setBackground(t)}}),ye.DefineIcon("tableBack",{NAME:"arrow-left",SVG_KEY:"back"}),ye.RegisterCommand("tableBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.table.back()},refresh:function(e){0!==this.table.selectedCells().length||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"))}}),ye.DefineIcon("tableCellVerticalAlign",{NAME:"arrows-v",FA5NAME:"arrows-alt-v",SVG_KEY:"verticalAlignMiddle"}),ye.RegisterCommand("tableCellVerticalAlign",{type:"dropdown",focus:!1,title:"Vertical Align",options:{Top:"Align Top",Middle:"Align Middle",Bottom:"Align Bottom"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ye.COMMANDS.tableCellVerticalAlign.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableCellVerticalAlign" data-param1="'.concat(a.toLowerCase(),'" title="').concat(this.language.translate(t[a]),'">').concat(this.language.translate(a),"</a></li>"));return e+="</ul>"},callback:function(e,t){this.table.verticalAlign(t)},refreshOnShow:function(e,t){t.find('.fr-command[data-param1="'+this.$el.find(".fr-selected-cell").css("vertical-align")+'"]').addClass("fr-active").attr("aria-selected",!0)}}),ye.DefineIcon("tableCellHorizontalAlign",{NAME:"align-left",SVG_KEY:"alignLeft"}),ye.DefineIcon("align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),ye.DefineIcon("align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),ye.DefineIcon("align-center",{NAME:"align-center",SVG_KEY:"alignCenter"}),ye.DefineIcon("align-justify",{NAME:"align-justify",SVG_KEY:"alignJustify"}),ye.RegisterCommand("tableCellHorizontalAlign",{type:"dropdown",focus:!1,title:"Horizontal Align",options:{left:"Align Left",center:"Align Center",right:"Align Right",justify:"Align Justify"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ye.COMMANDS.tableCellHorizontalAlign.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="tableCellHorizontalAlign" data-param1="'.concat(a,'" title="').concat(this.language.translate(t[a]),'">').concat(this.icon.create("align-".concat(a)),'<span class="fr-sr-only">').concat(this.language.translate(t[a]),"</span></a></li>"));return e+="</ul>"},callback:function(e,t){this.table.horizontalAlign(t)},refresh:function(e){var t=this.table.selectedCells(),a=this.$;t.length&&e.find("> *").first().replaceWith(this.icon.create("align-".concat(this.helpers.getAlignment(a(t[0])))))},refreshOnShow:function(e,t){t.find('.fr-command[data-param1="'+this.helpers.getAlignment(this.$el.find(".fr-selected-cell").first())+'"]').addClass("fr-active").attr("aria-selected",!0)}}),ye.DefineIcon("tableCellStyle",{NAME:"magic",SVG_KEY:"cellStyle"}),ye.RegisterCommand("tableCellStyle",{title:"Cell Style",type:"dropdown",focus:!1,html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.tableCellStyles;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableCellStyle" data-param1="'.concat(a,'" title="').concat(this.language.translate(t[a]),'">').concat(this.language.translate(t[a]),"</a></li>"));return e+="</ul>"},callback:function(e,t){this.table.applyStyle(t,this.$el.find(".fr-selected-cell"),this.opts.tableCellMultipleStyles,this.opts.tableCellStyles)},refreshOnShow:function(e,t){var a=this.$,l=this.$el.find(".fr-selected-cell").first();l&&t.find(".fr-command").each(function(){var e=a(this).data("param1"),t=l.hasClass(e);a(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),ye.RegisterCommand("tableCellBackgroundCustomColor",{title:"OK",undo:!0,callback:function(){this.table.customColor()}}),ye.DefineIcon("tableColorRemove",{NAME:"eraser",SVG_KEY:"remove"})});
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(ye){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,l=Array(t);a<t;a++)l[a]=e[a];return l}function Re(e){return function t(e){if(Array.isArray(e))return r(e)}(e)||function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function l(e,t){if(e){if("string"==typeof e)return r(e,t);var a={}.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?r(e,t):void 0}}(e)||function n(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}ye=ye&&ye.hasOwnProperty("default")?ye["default"]:ye,Object.assign(ye.POPUP_TEMPLATES,{"table.insert":"[_BUTTONS_][_ROWS_COLUMNS_]","table.edit":"[_BUTTONS_]","table.colors":"[_BUTTONS_][_COLORS_][_CUSTOM_COLOR_]"}),Object.assign(ye.DEFAULTS,{tableInsertMaxSize:10,tableEditButtons:["tableHeader","tableFooter","tableRemove","tableRows","tableColumns","tableStyle","-","tableCells","tableCellBackground","tableCellVerticalAlign","tableCellHorizontalAlign","tableCellStyle"],tableInsertButtons:["tableBack","|"],tableResizer:!0,tableDefaultWidth:"100%",tableResizerOffset:5,tableResizingLimit:30,tableColorsButtons:["tableBack","|"],tableColors:["#61BD6D","#1ABC9C","#54ACD2","#2C82C9","#9365B8","#475577","#CCCCCC","#41A85F","#00A885","#3D8EB9","#2969B0","#553982","#28324E","#000000","#F7DA64","#FBA026","#EB6B56","#E25041","#A38F84","#EFEFEF","#FFFFFF","#FAC51C","#F37934","#D14841","#B8312F","#7C706B","#D1D5D8","REMOVE"],tableColorsStep:7,tableCellStyles:{"fr-highlighted":"Highlighted","fr-thick":"Thick"},tableStyles:{"fr-dashed-borders":"Dashed Borders","fr-alternate-rows":"Alternate Rows"},tableCellMultipleStyles:!0,tableMultipleStyles:!0,tableInsertHelper:!0,keepTextFormatOnTable:!1,tableInsertHelperOffset:15}),ye.PLUGINS.table=function(A){var O,f,n,r,l,o,y,T=A.$;function g(){var e=x();if(e){var t=A.popups.get("table.edit");if(t||(t=p()),t){A.popups.setContainer("table.edit",A.$sc);var a=I(e),l=a.left+(a.right-a.left)/2,n=a.bottom;A.popups.show("table.edit",l,n,a.bottom-a.top,!0),A.edit.isDisabled()&&(A.$el.removeClass("fr-no-selection"),A.edit.on(),A.button.bulkRefresh(),A.selection.setAtEnd(A.$el.find(".fr-selected-cell").last().get(0)),A.selection.restore())}}}function s(){var e=x();if(e){var t=A.popups.get("table.colors");t||(t=function o(){var e="";0<A.opts.tableColorsButtons.length&&(e='<div class="fr-buttons fr-tabs">'.concat(A.button.buildList(A.opts.tableColorsButtons),"</div>"));var t="";A.opts.colorsHEXInput&&(t='<div class="fr-color-hex-layer fr-table-colors-hex-layer fr-active fr-layer" id="fr-table-colors-hex-layer-'.concat(A.id,'"><div class="fr-input-line"><input maxlength="7" id="fr-table-colors-hex-layer-text-').concat(A.id,'" type="text" placeholder="').concat(A.language.translate("HEX Color"),'" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="tableCellBackgroundCustomColor" tabIndex="2" role="button">').concat(A.language.translate("OK"),"</button></div></div>"));var a={buttons:e,colors:function n(){for(var e='<div class="fr-color-set fr-table-colors">',t=0;t<A.opts.tableColors.length;t++)0!==t&&t%A.opts.tableColorsStep==0&&(e+="<br>"),"REMOVE"!=A.opts.tableColors[t]?e+='<span class="fr-command" style="background: '.concat(A.opts.tableColors[t],';" tabIndex="-1" role="button" data-cmd="tableCellBackgroundColor" data-param1="').concat(A.opts.tableColors[t],'"><span class="fr-sr-only">').concat(A.language.translate("Color")," ").concat(A.opts.tableColors[t],"&nbsp;&nbsp;&nbsp;</span></span>"):e+='<span class="fr-command" data-cmd="tableCellBackgroundColor" tabIndex="-1" role="button" data-param1="REMOVE" title="'.concat(A.language.translate("Clear Formatting"),'">').concat(A.icon.create("tableColorRemove"),'<span class="fr-sr-only">').concat(A.language.translate("Clear Formatting"),"</span></span>");return e+="</div>"}(),custom_color:t},l=A.popups.create("table.colors",a);return A.events.$on(A.$wp,"scroll.table-colors",function(){A.popups.isVisible("table.colors")&&s()}),function r(u){A.events.on("popup.tab",function(e){var t=T(e.currentTarget);if(!A.popups.isVisible("table.colors")||!t.is("span"))return!0;var a=e.which,l=!0;if(ye.KEYCODE.TAB==a){var n=u.find(".fr-buttons");l=!A.accessibility.focusToolbar(n,!!e.shiftKey)}else if(ye.KEYCODE.ARROW_UP==a||ye.KEYCODE.ARROW_DOWN==a||ye.KEYCODE.ARROW_LEFT==a||ye.KEYCODE.ARROW_RIGHT==a){var r=t.parent().find("span.fr-command"),o=r.index(t),s=A.opts.colorsStep,i=Math.floor(r.length/s),f=o%s,c=Math.floor(o/s),d=c*s+f,p=i*s;ye.KEYCODE.ARROW_UP==a?d=((d-s)%p+p)%p:ye.KEYCODE.ARROW_DOWN==a?d=(d+s)%p:ye.KEYCODE.ARROW_LEFT==a?d=((d-1)%p+p)%p:ye.KEYCODE.ARROW_RIGHT==a&&(d=(d+1)%p);var h=T(r.get(d));A.events.disableBlur(),h.focus(),l=!1}else ye.KEYCODE.ENTER==a&&(A.button.exec(t),l=!1);return!1===l&&(e.preventDefault(),e.stopPropagation()),l},!0)}(l),l}()),A.popups.setContainer("table.colors",A.$sc);var a=I(e),l=(a.left+a.right)/2,n=a.bottom;!function r(){var e=A.popups.get("table.colors"),t=A.$el.find(".fr-selected-cell").first(),a=A.helpers.RGBToHex(t.css("background-color")),l=e.find(".fr-table-colors-hex-layer input");e.find(".fr-selected-color").removeClass("fr-selected-color fr-active-item"),e.find('span[data-param1="'.concat(a,'"]')).addClass("fr-selected-color fr-active-item"),l.val(a).trigger("change")}(),A.popups.show("table.colors",l,n,a.bottom-a.top,!0)}}function i(){0===te().length&&A.toolbar.enable()}function c(e){if(e)return A.popups.onHide("table.insert",function(){A.popups.get("table.insert").find('.fr-table-size .fr-select-table-size > span[data-row="1"][data-col="1"]').trigger("mouseover")}),!0;var t="";0<A.opts.tableInsertButtons.length&&(t='<div class="fr-buttons fr-tabs">'.concat(A.button.buildList(A.opts.tableInsertButtons),"</div>"));var a={buttons:t,rows_columns:function r(){for(var e='<div class="fr-table-size"><div class="fr-table-size-info">1 &times; 1</div><div class="fr-select-table-size">',t=1;t<=A.opts.tableInsertMaxSize;t++){for(var a=1;a<=A.opts.tableInsertMaxSize;a++){var l="inline-block";2<t&&!A.helpers.isMobile()&&(l="none");var n="fr-table-cell ";1==t&&1==a&&(n+=" hover"),e+='<span class="fr-command '.concat(n,'" tabIndex="-1" data-cmd="tableInsert" data-row="').concat(t,'" data-col="').concat(a,'" data-param1="').concat(t,'" data-param2="').concat(a,'" style="display: ').concat(l,';" role="button"><span></span><span class="fr-sr-only">').concat(t," &times; ").concat(a,"&nbsp;&nbsp;&nbsp;</span></span>")}e+='<div class="new-line"></div>'}return e+="</div></div>"}()},l=A.popups.create("table.insert",a);return A.events.$on(l,"mouseover",".fr-table-size .fr-select-table-size .fr-table-cell",function(e){d(T(e.currentTarget))},!0),function n(e){A.events.$on(e,"focus","[tabIndex]",function(e){var t=T(e.currentTarget);d(t)}),A.events.on("popup.tab",function(e){var t=T(e.currentTarget);if(!A.popups.isVisible("table.insert")||!t.is("span, a"))return!0;var a,l=e.which;if(ye.KEYCODE.ARROW_UP==l||ye.KEYCODE.ARROW_DOWN==l||ye.KEYCODE.ARROW_LEFT==l||ye.KEYCODE.ARROW_RIGHT==l){if(t.is("span.fr-table-cell")){var n=t.parent().find("span.fr-table-cell"),r=n.index(t),o=A.opts.tableInsertMaxSize,s=r%o,i=Math.floor(r/o);ye.KEYCODE.ARROW_UP==l?i=Math.max(0,i-1):ye.KEYCODE.ARROW_DOWN==l?i=Math.min(A.opts.tableInsertMaxSize-1,i+1):ye.KEYCODE.ARROW_LEFT==l?s=Math.max(0,s-1):ye.KEYCODE.ARROW_RIGHT==l&&(s=Math.min(A.opts.tableInsertMaxSize-1,s+1));var f=i*o+s,c=T(n.get(f));d(c),A.events.disableBlur(),c.focus(),a=!1}}else ye.KEYCODE.ENTER==l&&(A.button.exec(t),a=!1);return!1===a&&(e.preventDefault(),e.stopPropagation()),a},!0)}(l),l}function d(e){var t=e.data("row");null!==t&&(t=parseInt(t));var a=e.data("col");null!==a&&(a=parseInt(a));var l=e.parent();l.siblings(".fr-table-size-info").html("".concat(t," &times; ").concat(a)),l.find("> span").removeClass("hover fr-active-item");for(var n=1;n<=A.opts.tableInsertMaxSize;n++)for(var r=0;r<=A.opts.tableInsertMaxSize;r++){var o=l.find('> span[data-row="'.concat(n,'"][data-col="').concat(r,'"]'));n<=t&&r<=a?o.addClass("hover"):n<=t+1||n<=2&&!A.helpers.isMobile()?o.css("display","inline-block"):2<n&&!A.helpers.isMobile()&&o.css("display","none")}e.addClass("fr-active-item")}function p(e){if(e)return A.popups.onHide("table.edit",i),!0;if(0<A.opts.tableEditButtons.length){var t={buttons:'<div class="fr-buttons">'.concat(A.button.buildList(A.opts.tableEditButtons),"</div>")},a=A.popups.create("table.edit",t);return A.events.$on(A.$wp,"scroll.table-edit",function(){A.popups.isVisible("table.edit")&&g()}),a}return!1}function b(e){var t={startTag:"",closeTag:""};return A.opts.keepTextFormatOnTable&&(t=h(function s(e){var t=new Set,a=e.textContent,l=0,n=[e.firstChild];for(;0<n.length;){var r=n.pop();if(r&&(t.has(r)||(0===l&&a!==r.textContent&&(a=r.textContent,l++),t.add(r)),r.hasChildNodes()))for(var o=0;o<r.childNodes.length;){if(3===r.childNodes[o].nodeType)return Re(t);if(r.childNodes[o].textContent){if(0===l&&r.childNodes[o].textContent!==a){a=r.childNodes[o].textContent,n.push(r.childNodes[o]),l++;break}r.childNodes[o].textContent===a&&n.push(r.childNodes[o])}o++}}return Re(t)}(e).reverse())),{startTag:t.startTag,closeTag:t.closeTag}}function h(e){var t="",a="",l=["br","#text","#comment","font"];if(0<e.length)for(var n=e.length-1;0<=n;n--){var r=e[n],o=A.node.isBlock(r),s=l.indexOf(r.nodeName.toLowerCase());if(!o&&s<0){var i=r.style,f="";if(i&&i.length){for(var c=0;c<i.length;c++)f+=i[c]+": "+i[i[c]].replace(/"/gi,"")+"; ";f=f.trim()}t+=f?"<"+r.nodeName.toLowerCase()+' style="'+f+'">':"<"+r.nodeName.toLowerCase()+">",a="</"+r.nodeName.toLowerCase()+">"+a}}return{startTag:t,closeTag:a}}function u(){if(0<te().length){var e=ae();A.selection.setBefore(e.get(0))||A.selection.setAfter(e.get(0)),A.selection.restore(),A.popups.hide("table.edit"),A.opts.trackChangesEnabled?(A.track_changes.removedTable(e),N()):e.remove(),A.toolbar.enable()}}function m(e){var t=ae();if(0<t.length){if(0<A.$el.find("thead .fr-selected-cell").length&&"above"==e||0<A.$el.find("tfoot td.fr-selected-cell").length&&"below"==e)return;var a,l,n,r=x(),o=M(r);if(null==o)return;l="above"==e?o.min_i:o.max_i;var s="<tr>";for(a=0;a<r[l].length;a++)if("below"==e&&l<r.length-1&&r[l][a]==r[l+1][a]||"above"==e&&0<l&&r[l][a]==r[l-1][a]){if(0===a||0<a&&r[l][a]!=r[l][a-1]){var i=T(r[l][a]);i.attr("rowspan",parseInt(i.attr("rowspan"),10)+1)}}else{var f=T(r[l][a]);if("TH"==f.attr("tagName").toUpperCase())s+='<th style="'+f.attr("style")+'" ><br></th>';else{var c=b(r[l][a]);s+='<td style="'+f.attr("style")+'" >'+c.startTag+"<br>"+c.closeTag+"</td>"}}s+="</tr>",n=0<A.$el.find("thead .fr-selected-cell").length&&"below"==e||0<A.$el.find("tfoot td.fr-selected-cell").length&&"above"==e?T(t.find("tbody").not(t.find("> table tbody"))):T(t.find("tr").not(t.find("> table tr")).get(l)),"below"==e?"TBODY"==n.attr("tagName")?n.prepend(s):n[0].parentNode&&n[0].insertAdjacentHTML("afterend",s):"above"==e&&("TBODY"==n.attr("tagName")?n.append(s):n.before(s),A.popups.isVisible("table.edit")&&g())}}function v(e,t,a){var l,n,r,o,s,i=0,f=x(a);if(e<(t=Math.min(t,f[0].length-1)))for(n=e;n<=t;n++)if(!(e<n&&f[0][n]==f[0][n-1])&&1<(o=Math.min(parseInt(f[0][n].getAttribute("colspan"),10)||1,t-e+1))&&f[0][n]==f[0][n+1])for(i=o-1,l=1;l<f.length;l++)if(f[l][n]!=f[l-1][n]){for(r=n;r<n+o;r++)if(f[l][r]!==undefined)if(1<(s=parseInt(f[l][r].getAttribute("colspan"),10)||1)&&f[l][r]==f[l][r+1])r+=i=Math.min(i,s-1);else if(!(i=Math.max(0,i-1)))break;if(!i)break}i&&C(f,i,"colspan",0,f.length-1,e,t)}function w(e,t,a){var l,n,r,o,s,i=0,f=x(a);if(e<(t=Math.min(t,f.length-1)))for(l=e;l<=t;l++)if(!(e<l&&f[l][0]==f[l-1][0])&&f[l][0]!==undefined&&1<(o=Math.min(parseInt(f[l][0].getAttribute("rowspan"),10)||1,t-e+1))&&f[l][0]==f[l+1][0])for(i=o-1,n=1;n<f[0].length;n++)if(f[l][n]!=f[l][n-1]){for(r=l;r<l+o;r++)if(f[r][n]!==undefined)if(1<(s=parseInt(f[r][n].getAttribute("rowspan"),10)||1)&&f[r][n]==f[r+1][n])r+=i=Math.min(i,s-1);else if(!(i=Math.max(0,i-1)))break;if(!i)break}i&&C(f,i,"rowspan",e,t,0,f[0].length-1)}function C(e,t,a,l,n,r,o){var s,i,f;for(s=l;s<=n;s++)for(i=r;i<=o;i++)l<s&&e[s][i]==e[s-1][i]||r<i&&e[s][i]==e[s][i-1]||e[s][i]!==undefined&&1<(f=parseInt(e[s][i].getAttribute(a),10)||1)&&(1<f-t?e[s][i].setAttribute(a,f-t):e[s][i].removeAttribute(a))}function E(e,t,a,l,n){w(e,t,n),v(a,l,n)}function t(e){var t=A.$el.find(".fr-selected-cell");"REMOVE"!=e?t.css("background-color",A.helpers.HEXtoRGB(e)):t.css("background-color",""),g()}function R(e){e.style.removeProperty("border"),e.style.removeProperty("border-top"),e.style.removeProperty("border-bottom"),e.style.removeProperty("border-left"),e.style.removeProperty("border-right")}function x(e){var f=[];if(null==(e=e||null)&&0<te().length&&(e=ae()),e){if(!e.find("tr").html().match(/xl[0-9]+/gi))for(var t=e.find("tr:empty"),a=t.length-1;0<=a;a--)T(t[a]).remove();e.find("tr").not(e.find("> table tr")).each(function(s,e){var t=T(e),i=0;t.find("> th, > td").each(function(e,t){for(var a=T(t),l=parseInt(a.attr("colspan"),10)||1,n=parseInt(a.attr("rowspan"),10)||1,r=s;r<s+n;r++)for(var o=i;o<i+l;o++)f[r]||(f[r]=[]),f[r][o]?i++:f[r][o]=t;i+=l})})}return f}function $(e,t){for(var a=0;a<t.length;a++)for(var l=0;l<t[a].length;l++)if(t[a][l]==e)return{row:a,col:l}}function D(e,t,a){for(var l=e+1,n=t+1;l<a.length;){if(a[l][t]!=a[e][t]){l--;break}l++}for(l==a.length&&l--;n<a[e].length;){if(a[e][n]!=a[e][t]){n--;break}n++}return n==a[e].length&&n--,{row:l,col:n}}function _(){A.el.querySelector(".fr-cell-fixed")&&A.el.querySelector(".fr-cell-fixed").classList.remove("fr-cell-fixed"),A.el.querySelector(".fr-cell-handler")&&A.el.querySelector(".fr-cell-handler").classList.remove("fr-cell-handler")}function N(){var e=A.$el.find(".fr-selected-cell");0<e.length&&e.each(function(){var e=T(this);e.removeClass("fr-selected-cell"),""===e.attr("class")&&e.removeAttr("class")}),_()}function S(){A.events.disableBlur(),A.selection.clear(),A.$el.addClass("fr-no-selection"),A.$el.blur(),A.events.enableBlur()}function M(e){var t=A.$el.find(".fr-selected-cell");if(0<t.length){var a,l=e.length,n=0,r=e[0].length,o=0;for(a=0;a<t.length;a++){var s=$(t[a],e),i=D(s.row,s.col,e);l=Math.min(s.row,l),n=Math.max(i.row,n),r=Math.min(s.col,r),o=Math.max(i.col,o)}return{min_i:l,max_i:n,min_j:r,max_j:o}}return null}function I(e){var t=M(e);if(null!=t){var a=T(e[t.min_i][t.min_j]),l=T(e[t.min_i][t.max_j]),n=T(e[t.max_i][t.min_j]);return{left:a.length&&a.offset().left,right:l.length&&l.offset().left+l.outerWidth(),top:a.length&&a.offset().top,bottom:n.length&&n.offset().top+n.outerHeight()}}}function k(e,t){if(T(e).is(t))N(),T(e).addClass("fr-selected-cell");else{S(),A.edit.off();var a=x(),l=$(e,a),n=$(t,a);if(!l||!n)return;var r=function h(e,t,a,l,n){var r,o,s,i,f=e,c=t,d=a,p=l;for(r=f;r<=c;r++)(1<(parseInt(T(n[r][d]).attr("rowspan"),10)||1)||1<(parseInt(T(n[r][d]).attr("colspan"),10)||1))&&(i=D((s=$(n[r][d],n)).row,s.col,n),f=Math.min(s.row,f),c=Math.max(i.row,c),d=Math.min(s.col,d),p=Math.max(i.col,p)),(1<(parseInt(T(n[r][p]).attr("rowspan"),10)||1)||1<(parseInt(T(n[r][p]).attr("colspan"),10)||1))&&(i=D((s=$(n[r][p],n)).row,s.col,n),f=Math.min(s.row,f),c=Math.max(i.row,c),d=Math.min(s.col,d),p=Math.max(i.col,p));for(o=d;o<=p;o++)(1<(parseInt(T(n[f][o]).attr("rowspan"),10)||1)||1<(parseInt(T(n[f][o]).attr("colspan"),10)||1))&&(i=D((s=$(n[f][o],n)).row,s.col,n),f=Math.min(s.row,f),c=Math.max(i.row,c),d=Math.min(s.col,d),p=Math.max(i.col,p)),(1<(parseInt(T(n[c][o]).attr("rowspan"),10)||1)||1<(parseInt(T(n[c][o]).attr("colspan"),10)||1))&&(i=D((s=$(n[c][o],n)).row,s.col,n),f=Math.min(s.row,f),c=Math.max(i.row,c),d=Math.min(s.col,d),p=Math.max(i.col,p));return f==e&&c==t&&d==a&&p==l?{min_i:e,max_i:t,min_j:a,max_j:l}:h(f,c,d,p,n)}(Math.min(l.row,n.row),Math.max(l.row,n.row),Math.min(l.col,n.col),Math.max(l.col,n.col),a);N(),e.classList.add("fr-cell-fixed"),t.classList.add("fr-cell-handler");for(var o=r.min_i;o<=r.max_i;o++)for(var s=r.min_j;s<=r.max_j;s++)T(e).closest("table").is(T(a[o][s]).closest("table"))&&T(a[o][s]).addClass("fr-selected-cell")}}function K(e){var t=null,a=T(e.target);return"TD"==e.target.tagName||"TH"==e.target.tagName?t=e.target:0<a.closest("th",a.closest("thead")[0]).length?t=a.closest("th",a.closest("thead")[0]).get(0):0<a.closest("td",a.closest("tr")[0]).length&&(t=a.closest("td",a.closest("tr")[0]).get(0)),-1===A.$el.html.toString().search(t)?null:t}function B(){N(),A.popups.hide("table.edit")}function e(e){var t=K(e);if("false"==T(t).parents("[contenteditable]").not(".fr-element").not(".fr-img-caption").not("body").first().attr("contenteditable"))return!0;if(0<te().length&&!t&&B(),!A.edit.isDisabled()||A.popups.isVisible("table.edit"))if(1!=e.which||1==e.which&&A.helpers.isMac()&&e.ctrlKey)(3==e.which||1==e.which&&A.helpers.isMac()&&e.ctrlKey)&&t&&B();else if(r=!0,t){0<te().length&&!e.shiftKey&&B(),e.stopPropagation(),A.events.trigger("image.hideResizer"),A.events.trigger("video.hideResizer"),n=!0;var a=t.tagName.toLowerCase();e.shiftKey&&0<A.$el.find("".concat(a,".fr-selected-cell")).length?T(A.$el.find("".concat(a,".fr-selected-cell")).closest("table")).is(T(t).closest("table"))?k(l,t):S():((A.keys.ctrlKey(e)||e.shiftKey)&&"TD"===e.currentTarget.tagName&&(1<te().length||0===T(t).find(A.selection.element()).length&&!T(t).is(A.selection.element()))&&S(),l=t,0<A.opts.tableEditButtons.length&&k(l,l))}}function a(e){if(!A.edit.isDisabled()&&A.popups.areVisible())return!0;var t=K(e);if(1===te().length&&null===t&&(A.toolbar.enable(),N()),(1===te().length&&t&&"TD"!==t.tagName&&"TH"!==t.tagName||!n&&!A.$tb.is(e.target)&&!A.$tb.is(T(e.target).closest(".fr-toolbar")))&&(A.toolbar.enable(),N()),("BODY"===e.target.tagName||"HTML"===e.target.tagName)&&!t&&0<te().length&&A.toolbar.enable(),!(1!=e.which||1==e.which&&A.helpers.isMac()&&e.ctrlKey)){if(r=!1,n)n=!1,K(e)||1!=te().length?0<te().length?A.selection.isCollapsed()?(g(),A.toolbar.enable()):(N(),A.edit.on()):te().length||(A.$el.removeClass("fr-no-selection"),A.edit.on()):N();if(y){y=!1,O.removeClass("fr-moving"),A.$el.removeClass("fr-no-selection"),A.edit.on();var a=parseFloat(O.css("left"))+A.opts.tableResizerOffset+A.$wp.offset().left;A.opts.iframe&&(a-=A.$iframe.offset().left),O.data("release-position",a),O.removeData("max-left"),O.removeData("max-right"),function R(){var e=O.data("origin"),t=O.data("release-position");if(e!==t){var a=O.data("first"),l=O.data("second"),n=O.data("table"),r=n.outerWidth();if(A.undo.canDo()||A.undo.saveStep(),null!=a&&null!=l){var o,s,i,f=x(n),c=[],d=[],p=[],h=[];for(o=0;o<f.length;o++)s=T(f[o][a]),i=T(f[o][l]),c[o]=s.outerWidth(),p[o]=i.outerWidth(),d[o]=c[o]/r*100,h[o]=p[o]/r*100;for(o=0;o<f.length;o++)if(s=T(f[o][a]),i=T(f[o][l]),f[o][a]!=f[o][l]){var u=(d[o]*(c[o]+t-e)/c[o]).toFixed(4);s.css("width",u+"%"),i.css("width",(d[o]+h[o]-u).toFixed(4)+"%")}}else{var g,b=n.parent(),m=parseFloat(b.css("padding-left")),v=parseFloat(b.css("padding-right")),w=m+v,C=r/(b.width()-w)*100,E=(parseInt(n.css("margin-left"),10)||0)/b.width()*100,y=(parseInt(n.css("margin-right"),10)||0)/b.width()*100;"rtl"==A.opts.direction&&0===l||"rtl"!=A.opts.direction&&0!==l?(g=(r+t-e)/r*C,n.css("margin-right","calc(100% - ".concat(Math.round(g).toFixed(4),"% - ").concat(Math.round(E).toFixed(4),"%)"))):("rtl"==A.opts.direction&&0!==l||"rtl"!=A.opts.direction&&0===l)&&(g=(r-t+e)/r*C,n.css("margin-left","calc(100% - ".concat(Math.round(g).toFixed(4),"% - ").concat(Math.round(y).toFixed(4),"%)"))),n.css("width","".concat(Math.round(g).toFixed(4),"%"))}A.selection.restore(),A.undo.saveStep(),A.events.trigger("table.resized",[n.get(0)])}O.removeData("origin"),O.removeData("release-position"),O.removeData("first"),O.removeData("second"),O.removeData("table")}(),W()}}}function F(e){if((!(T(e.currentTarget).is(T(e.originalEvent.relatedTarget))||e.currentTarget.contains(e.originalEvent.relatedTarget)||e.originalEvent.relatedTarget&&e.originalEvent.relatedTarget.contains(e.currentTarget))||e.currentTarget.querySelector("input, textarea"))&&(A.events.$on(T("input, textarea"),"click",le),!0===n&&0<A.opts.tableEditButtons.length)){if(T(e.currentTarget).closest("table").is(ae())){if("TBODY"===e.currentTarget.parentElement.parentElement.tagName&&"TD"==e.currentTarget.tagName&&0===A.$el.find("th.fr-selected-cell").length&&0===A.$el.find("tfoot td.fr-selected-cell").length)return void k(l,e.currentTarget);if("TFOOT"===e.currentTarget.parentElement.parentElement.tagName&&"TD"==e.currentTarget.tagName&&0===A.$el.find("tbody td.fr-selected-cell").length)return void k(l,e.currentTarget);if("TH"==e.currentTarget.tagName&&0===A.$el.find("td.fr-selected-cell").length)return void k(l,e.currentTarget)}"TD"!==e.currentTarget.tagName&&"TH"!==e.currentTarget.tagName&&S()}}function Y(e,t,a,l){for(var n,r=t;r!=A.el&&"TD"!=r.tagName&&"TH"!=r.tagName&&("up"==l?n=r.previousElementSibling:"down"==l&&(n=r.nextElementSibling),!n);)r=r.parentNode;"TD"==r.tagName||"TH"==r.tagName?function o(e,t){for(var a=e;a&&"TABLE"!=a.tagName&&a.parentNode!=A.el;)a=a.parentNode;if(a&&"TABLE"==a.tagName){var l=x(T(a));"up"==t?z($(e,l),a,l):"down"==t&&L($(e,l),a,l)}}(r,l):n&&("up"==l&&A.selection.setAtEnd(n),"down"==l&&A.selection.setAtStart(n))}function z(e,t,a){0<T(".tribute-container").length&&"none"!=T(".tribute-container").css("display")||(0<e.row?A.selection.setAtEnd(a[e.row-1][e.col]):Y(0,t,0,"up"))}function L(e,t,a){if(!(0<T(".tribute-container").length&&"none"!=T(".tribute-container").css("display"))){var l=parseInt(a[e.row][e.col].getAttribute("rowspan"),10)||1;e.row<a.length-l?A.selection.setAtStart(a[e.row+l][e.col]):Y(0,t,0,"down")}}function W(){O&&(O.find("div").css("opacity",0),O.css("top",0),O.css("left",0),O.css("height",0),O.find("div").css("height",0),O.hide())}function H(){f&&f.removeClass("fr-visible").css("left","-9999px")}function P(e,t){var a,l=T(t);l&&(a=l.closest("table"));var n=a.parent();if(t&&"TD"!=t.tagName&&"TH"!=t.tagName&&(0<l.closest("td").length?t=l.closest("td"):0<l.closest("th").length&&(t=l.closest("th"))),!t||"TD"!=t.tagName&&"TH"!=t.tagName)O&&l.get(0)!=O.get(0)&&l.parent().get(0)!=O.get(0)&&A.core.sameInstance(O)&&W();else{if(l=T(t),0===A.$el.find(l).length)return!1;var r=l.offset().left-1,o=r+l.outerWidth();if(Math.abs(e.pageX-r)<=A.opts.tableResizerOffset||Math.abs(o-e.pageX)<=A.opts.tableResizerOffset){var s,i,f,c,d,p=x(a),h=$(t,p),u=D(h.row,h.col,p),g=a.offset().top,b=a.outerHeight()-1;"rtl"!=A.opts.direction?e.pageX-r<=A.opts.tableResizerOffset?(f=r,0<h.col?(c=r-U(h.col-1,p)+A.opts.tableResizingLimit,d=r+U(h.col,p)-A.opts.tableResizingLimit,s=h.col-1,i=h.col):(s=null,i=0,c=a.offset().left-1-parseInt(a.css("margin-left"),10),d=a.offset().left-1+a.width()-p[0].length*A.opts.tableResizingLimit)):o-e.pageX<=A.opts.tableResizerOffset&&(f=o,u.col<p[u.row].length&&p[u.row][u.col+1]?(c=o-U(u.col,p)+A.opts.tableResizingLimit,d=o+U(u.col+1,p)-A.opts.tableResizingLimit,s=u.col,i=u.col+1):(s=u.col,i=null,c=a.offset().left-1+p[0].length*A.opts.tableResizingLimit,d=n.offset().left-1+n.width()+parseFloat(n.css("padding-left")))):o-e.pageX<=A.opts.tableResizerOffset?(f=o,0<h.col?(c=o-U(h.col,p)+A.opts.tableResizingLimit,d=o+U(h.col-1,p)-A.opts.tableResizingLimit,s=h.col,i=h.col-1):(s=null,i=0,c=a.offset().left+p[0].length*A.opts.tableResizingLimit,d=n.offset().left-1+n.width()+parseFloat(n.css("padding-left")))):e.pageX-r<=A.opts.tableResizerOffset&&(f=r,u.col<p[u.row].length&&p[u.row][u.col+1]?(c=r-U(u.col+1,p)+A.opts.tableResizingLimit,d=r+U(u.col,p)-A.opts.tableResizingLimit,s=u.col+1,i=u.col):(s=u.col,i=null,c=n.offset().left+parseFloat(n.css("padding-left")),d=a.offset().left-1+a.width()-p[0].length*A.opts.tableResizingLimit)),O||function E(){A.shared.$table_resizer||(A.shared.$table_resizer=T(document.createElement("div")).attr("class","fr-table-resizer").html("<div></div>")),O=A.shared.$table_resizer,A.events.$on(O,"mousedown",function(e){return!A.core.sameInstance(O)||(0<te().length&&B(),1==e.which?(A.selection.save(),y=!0,O.addClass("fr-moving"),S(),A.edit.off(),O.find("div").css("opacity",1),!1):void 0)}),A.events.$on(O,"mousemove",function(e){if(!A.core.sameInstance(O))return!0;y&&(A.opts.iframe&&(e.pageX-=A.$iframe.offset().left),J(e))}),A.events.on("shared.destroy",function(){O.html("").removeData().remove(),O=null},!0),A.events.on("destroy",function(){A.$el.find(".fr-selected-cell").removeClass("fr-selected-cell"),T("body").first().append(O.hide())},!0)}(),O.data("table",a),O.data("first",s),O.data("second",i),O.data("instance",A),A.$wp.append(O);var m=f-A.win.pageXOffset-A.opts.tableResizerOffset-A.$wp.offset().left,v=g-A.$wp.offset().top+A.$wp.scrollTop();if(A.opts.iframe){var w=A.helpers.getPX(A.$wp.find(".fr-iframe").css("padding-top")),C=A.helpers.getPX(A.$wp.find(".fr-iframe").css("padding-left"));m+=A.$iframe.offset().left+C,v+=A.$iframe.offset().top+w,c+=A.$iframe.offset().left,d+=A.$iframe.offset().left}O.data("max-left",c),O.data("max-right",d),O.data("origin",f-A.win.pageXOffset),O.css("top",v),O.css("left",m),O.css("height",b),O.find("div").css("height",b),O.css("padding-left",A.opts.tableResizerOffset),O.css("padding-right",A.opts.tableResizerOffset),O.show()}else A.core.sameInstance(O)&&W()}}function V(e,t){if(A.$box.find(".fr-line-breaker").isVisible())return!1;f||Q(),A.$box.append(f),f.data("instance",A);var a,l=T(t).find("tr").first(),n=e.pageX,r=0,o=0;if(A.opts.iframe){var s=A.helpers.getPX(A.$wp.find(".fr-iframe").css("padding-top")),i=A.helpers.getPX(A.$wp.find(".fr-iframe").css("padding-left"));r+=A.$iframe.offset().left-A.helpers.scrollLeft()+i,o+=A.$iframe.offset().top-A.helpers.scrollTop()+s}l.find("th, td").each(function(){var e=T(this);return e.offset().left<=n&&n<e.offset().left+e.outerWidth()/2?(a=parseInt(f.find("a").css("width"),10),f.css("top",o+e.offset().top-A.$box.offset().top-a-5),f.css("left",r+e.offset().left-A.$box.offset().left-a/2),f.data("selected-cell",e),f.data("position","before"),f.addClass("fr-visible"),!1):e.offset().left+e.outerWidth()/2<=n&&n<e.offset().left+e.outerWidth()?(a=parseInt(f.find("a").css("width"),10),f.css("top",o+e.offset().top-A.$box.offset().top-a-5),f.css("left",r+e.offset().left-A.$box.offset().left+e.outerWidth()-a/2),f.data("selected-cell",e),f.data("position","after"),f.addClass("fr-visible"),!1):void 0})}function j(e,t){if(A.$box.find(".fr-line-breaker").isVisible())return!1;f||Q(),A.$box.append(f),f.data("instance",A);var a,l=T(t),n=e.pageY,r=0,o=0;if(A.opts.iframe){var s=A.helpers.getPX(A.$wp.find(".fr-iframe").css("padding-top")),i=A.helpers.getPX(A.$wp.find(".fr-iframe").css("padding-left"));r+=A.$iframe.offset().left-A.helpers.scrollLeft()+i,o+=A.$iframe.offset().top-A.helpers.scrollTop()+s}l.find("tr").each(function(){var e=T(this);a=parseInt(f.find("a").css("width"),10);var t=r+e.offset().left-A.$box.offset().left;return t=0!==A.$box.offset().left?t-a-5:t+a-5,e.offset().top<=n&&n<e.offset().top+e.outerHeight()/2?(f.css("top",o+e.offset().top-A.$box.offset().top-a/2),f.css("left",t),f.data("selected-cell",e.find("td").first()),f.data("position","above"),f.addClass("fr-visible"),!1):e.offset().top+e.outerHeight()/2<=n&&n<e.offset().top+e.outerHeight()?(f.css("top",o+e.offset().top-A.$box.offset().top+e.outerHeight()-a/2),f.css("left",t),f.data("selected-cell",e.find("td").first()),f.data("position","below"),f.addClass("fr-visible"),!1):void 0})}function G(e){o=null;var t=A.doc.elementFromPoint(e.pageX-A.win.pageXOffset,e.pageY-A.win.pageYOffset);A.opts.tableResizer&&(!A.popups.areVisible()||A.popups.areVisible()&&A.popups.isVisible("table.edit"))&&P(e,t),!A.opts.tableInsertHelper||A.popups.areVisible()||A.$tb.hasClass("fr-inline")&&A.$tb.isVisible()||function r(e,t){if(0===te().length){var a,l,n;if(t&&("HTML"==t.tagName||"BODY"==t.tagName||A.node.isElement(t)))for(a=1;a<=A.opts.tableInsertHelperOffset;a++){if(l=A.doc.elementFromPoint(e.pageX-A.win.pageXOffset,e.pageY-A.win.pageYOffset+a),T(l).hasClass("fr-tooltip"))return!0;if(l&&("TH"==l.tagName||"TD"==l.tagName||"TABLE"==l.tagName)&&(T(l).parents(".fr-wrapper").length||A.opts.iframe)&&"false"!=T(l).closest("table").attr("contenteditable"))return V(e,T(l).closest("table")),!0;if(n=A.doc.elementFromPoint(e.pageX-A.win.pageXOffset+a,e.pageY-A.win.pageYOffset),T(n).hasClass("fr-tooltip"))return!0;if(n&&("TH"==n.tagName||"TD"==n.tagName||"TABLE"==n.tagName)&&(T(n).parents(".fr-wrapper").length||A.opts.iframe)&&"false"!=T(n).closest("table").attr("contenteditable"))return j(e,T(n).closest("table")),!0}A.core.sameInstance(f)&&H()}}(e,t)}function X(){if(y){var e=O.data("table").offset().top-A.win.pageYOffset;if(A.opts.iframe){var t=A.helpers.getPX(A.$wp.find(".fr-iframe").css("padding-top"));e+=A.$iframe.offset().top-A.helpers.scrollTop()+t}O.css("top",e)}}function U(e,t){var a,l=T(t[0][e]).outerWidth();for(a=1;a<t.length;a++)l=Math.min(l,T(t[a][e]).outerWidth());return l}function q(e,t,a){var l,n=0;for(l=e;l<=t;l++)n+=U(l,a);return n}function J(e){if(1<te().length&&r&&S(),!1===r&&!1===n&&!1===y)o&&clearTimeout(o),A.edit.isDisabled()&&!A.popups.isVisible("table.edit")||(o=setTimeout(G,30,e));else if(y){var t=e.pageX-A.win.pageXOffset;A.opts.iframe&&(t+=A.$iframe.offset().left);var a=O.data("max-left"),l=O.data("max-right");a<=t&&t<=l?O.css("left",t-A.opts.tableResizerOffset-A.$wp.offset().left):t<a&&parseFloat(O.css("left"),10)>a-A.opts.tableResizerOffset?O.css("left",a-A.opts.tableResizerOffset-A.$wp.offset().left):l<t&&parseFloat(O.css("left"),10)<l-A.opts.tableResizerOffset&&O.css("left",l-A.opts.tableResizerOffset-A.$wp.offset().left)}else r&&H()}function Z(e){A.node.isEmpty(e.get(0))?A.opts.keepTextFormatOnTable&&A.browser.mozilla?e.append(ye.MARKERS):e.prepend(ye.MARKERS):e.prepend(ye.START_MARKER).append(ye.END_MARKER)}function Q(){A.shared.$ti_helper||(A.shared.$ti_helper=T(document.createElement("div")).attr("class","fr-insert-helper").html('<a class="fr-floating-btn" role="button" tabIndex="-1" title="'.concat(A.language.translate("Insert"),'"><svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="M22,16.75 L16.75,16.75 L16.75,22 L15.25,22.000 L15.25,16.75 L10,16.75 L10,15.25 L15.25,15.25 L15.25,10 L16.75,10 L16.75,15.25 L22,15.25 L22,16.75 Z"/></svg></a>')),A.events.bindClick(A.shared.$ti_helper,"a",function(){var e=f.data("selected-cell"),t=f.data("position"),a=f.data("instance")||A;"before"==t?(A.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertColumn(t),e.removeClass("fr-selected-cell"),A.undo.saveStep()):"after"==t?(A.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertColumn(t),e.removeClass("fr-selected-cell"),A.undo.saveStep()):"above"==t?(A.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertRow(t),e.removeClass("fr-selected-cell"),A.undo.saveStep()):"below"==t&&(A.undo.saveStep(),e.addClass("fr-selected-cell"),a.table.insertRow(t),e.removeClass("fr-selected-cell"),A.undo.saveStep()),H()}),A.events.on("shared.destroy",function(){A.shared.$ti_helper.html("").removeData().remove(),A.shared.$ti_helper=null},!0),A.events.$on(A.shared.$ti_helper,"mousemove",function(e){e.stopPropagation()},!0),A.events.$on(T(A.o_win),"scroll",function(){H()},!0),A.events.$on(A.$wp,"scroll",function(){H()},!0)),f=A.shared.$ti_helper,A.events.on("destroy",function(){f=null}),A.tooltip.bind(A.$box,".fr-insert-helper > a.fr-floating-btn")}function ee(){l=null,clearTimeout(o)}function te(){return A.el.querySelectorAll(".fr-selected-cell")}function ae(){var e=te();if(e.length){for(var t=e[0];t&&"TABLE"!=t.tagName&&t.parentNode!=A.el;)t=t.parentNode;return t&&"TABLE"==t.tagName?T(t):T([])}return T([])}function le(){n=!1}return{_init:function ne(){if(!A.$wp)return!1;if(A.helpers.isMobile()&&(A.events.$on(A.$el,"mousedown",e),A.events.$on(A.$win,"mouseup",a)),!A.helpers.isMobile()){y=n=r=!1,A.events.$on(A.$el,"mousedown",e),A.popups.onShow("image.edit",function(){N(),n=r=!1}),A.popups.onShow("link.edit",function(){N(),n=r=!1}),A.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&N()}),A.events.$on(A.$el,"mouseover","th, td",F),A.events.$on(A.$win,"mouseup",a),A.opts.iframe&&A.events.$on(T(A.o_win),"mouseup",a),A.events.$on(A.$win,"mousemove",J),A.events.$on(T(A.o_win),"scroll",X),A.events.on("contentChanged",function(){0<te().length&&(g(),A.$el.find("img").on("load.selected-cells",function(){T(this).off("load.selected-cells"),0<te().length&&g()}))}),A.events.$on(T(A.o_win),"resize",function(){N()}),A.events.on("toolbar.esc",function(){if(0<te().length)return A.events.disableBlur(),A.events.focus(),!1},!0),A.events.$on(T(A.o_win),"keydown",function(){r&&n&&(n=r=!1,A.$el.removeClass("fr-no-selection"),A.edit.on(),A.selection.setAtEnd(A.$el.find(".fr-selected-cell").last().get(0)),A.selection.restore(),N())}),A.events.$on(A.$el,"keydown",function(e){e.shiftKey?!1===function o(e){var t=te();if(null!=t&&0<t.length){var a,l=x(),n=e.which,r=$(1==t.length?a=t[0]:(a=A.el.querySelector(".fr-cell-fixed"),A.el.querySelector(".fr-cell-handler")),l);if(ye.KEYCODE.ARROW_RIGHT==n){if(r.col<l[0].length-1)return k(a,l[r.row][r.col+1]),!1}else if(ye.KEYCODE.ARROW_DOWN==n){if(r.row<l.length-1)return k(a,l[r.row+1][r.col]),!1}else if(ye.KEYCODE.ARROW_LEFT==n){if(0<r.col)return k(a,l[r.row][r.col-1]),!1}else if(ye.KEYCODE.ARROW_UP==n&&0<r.row)return k(a,l[r.row-1][r.col]),!1}}(e)&&setTimeout(function(){g()},0):function s(e){var t=e.which,a=A.selection.blocks();if(a.length&&("P"!==(a=a[0]).tagName&&"DIV"!==a.tagName||(a=a.parentNode),"TD"==a.tagName||"TH"==a.tagName)){for(var l=a;l&&"TABLE"!=l.tagName&&l.parentNode!=A.el;)l=l.parentNode;if(l&&"TABLE"==l.tagName&&(ye.KEYCODE.ARROW_LEFT==t||ye.KEYCODE.ARROW_UP==t||ye.KEYCODE.ARROW_RIGHT==t||ye.KEYCODE.ARROW_DOWN==t)&&(0<te().length&&B(),A.browser.webkit&&(ye.KEYCODE.ARROW_UP==t||ye.KEYCODE.ARROW_DOWN==t))){var n=A.selection.ranges(0).startContainer;if(n.nodeType==Node.TEXT_NODE&&(ye.KEYCODE.ARROW_UP==t&&(n.previousSibling&&"BR"!==n.previousSibling.tagName||n.previousSibling&&"BR"===n.previousSibling.tagName&&n.previousSibling.previousSibling)||ye.KEYCODE.ARROW_DOWN==t&&(n.nextSibling&&"BR"!==n.nextSibling.tagName||n.nextSibling&&"BR"===n.nextSibling.tagName&&n.nextSibling.nextSibling)))return;e.preventDefault(),e.stopPropagation();var r=x(T(l)),o=$(a,r);return ye.KEYCODE.ARROW_UP==t?z(o,l,r):ye.KEYCODE.ARROW_DOWN==t&&L(o,l,r),A.selection.restore(),!1}}}(e)}),A.events.on("keydown",function(e){if(!1===function l(e){if(e.which==ye.KEYCODE.TAB){var t;if(0<te().length)t=A.$el.find(".fr-selected-cell").last();else{var a=A.selection.element();"TD"==a.tagName||"TH"==a.tagName?t=T(a):a!=A.el&&(0<T(a).parentsUntil(A.$el,"td").length?t=T(a).parents("td").first():0<T(a).parentsUntil(A.$el,"th").length&&(t=T(a).parents("th").first()))}if(t)return e.preventDefault(),!!(0===A.selection.get().focusOffset&&0<T(A.selection.element()).parentsUntil(A.$el,"ol, ul").length&&(0<T(A.selection.element()).closest("li").prev().length||T(A.selection.element()).is("li")&&0<T(A.selection.element()).prev().length))||(B(),e.shiftKey?0<t.prev().length?Z(t.prev()):0<t.closest("tr").length&&0<t.closest("tr").prev().length?Z(t.closest("tr").prev().find("td").last()):0<t.closest("tbody").length&&0<t.closest("table").find("thead tr").length&&Z(t.closest("table").find("thead tr th").last()):0<t.next().length?Z(t.next()):0<t.closest("tr").length&&0<t.closest("tr").next().length?Z(t.closest("tr").next().find("td").first()):0<t.closest("thead").length&&0<t.closest("table").find("tbody tr").length?Z(t.closest("table").find("tbody tr td").first()):(t.addClass("fr-selected-cell"),m("below"),N(),Z(t.closest("tr").next().find("td").first())),A.selection.restore(),!1)}}(e))return!1;var t=te();if(0<t.length){if(0<t.length&&A.keys.ctrlKey(e)&&e.which==ye.KEYCODE.A)return N(),A.popups.isVisible("table.edit")&&A.popups.hide("table.edit"),t=[],!0;if(e.which==ye.KEYCODE.ESC&&A.popups.isVisible("table.edit"))return N(),A.popups.hide("table.edit"),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),!(t=[]);if(1<t.length&&(e.which==ye.KEYCODE.BACKSPACE||e.which==ye.KEYCODE.DELETE)){A.undo.saveStep();for(var a=0;a<t.length;a++)T(t[a]).html("<br>"),a==t.length-1&&T(t[a]).prepend(ye.MARKERS);return A.selection.restore(),A.undo.saveStep(),!(t=[])}if(1<t.length&&e.which!=ye.KEYCODE.F10&&!A.keys.isBrowserAction(e))return e.preventDefault(),!(t=[])}else if(!(t=[])===function n(e){if(e.altKey&&e.which==ye.KEYCODE.SPACE){var t,a=A.selection.element();if("TD"==a.tagName||"TH"==a.tagName?t=a:0<T(a).closest("td").length?t=T(a).closest("td").get(0):0<T(a).closest("th").length&&(t=T(a).closest("th").get(0)),t)return e.preventDefault(),k(t,t),g(),!1}}(e))return!1},!0);var t=[];A.events.on("html.beforeGet",function(){t=te();for(var e=0;e<t.length;e++)t[e].className=(t[e].className||"").replace(/fr-selected-cell/g,"")}),A.events.on("html.afterGet",function(){for(var e=0;e<t.length;e++)t[e].className=(t[e].className?t[e].className.trim()+" ":"")+"fr-selected-cell";t=[]}),c(!0),p(!0)}A.events.on("destroy",ee)},insert:function re(e,t){var a,l,n=function f(){var e={startTag:"",closeTag:""};if(A.opts.keepTextFormatOnTable){var t=T(A.selection.element().firstChild).parentsUntil(A.$el);e=h(t)}return{startTag:e.startTag,closeTag:e.closeTag}}(),r="<table "+(A.opts.tableDefaultWidth?'style="width: '+A.opts.tableDefaultWidth+';" ':"")+'class="fr-inserted-table"><tbody>',o=100/t;for(a=0;a<e;a++){for(r+="<tr>",l=0;l<t;l++)r+="<td"+(A.opts.tableDefaultWidth?' style="width: '+o.toFixed(4)+'%;"':"")+">"+n.startTag,0===a&&0===l&&(r+=ye.MARKERS),r+="<br>"+n.closeTag+"</td>";r+="</tr>"}if(r+="</tbody></table>",A.opts.trackChangesEnabled){A.edit.on(),A.events.focus(!0),A.selection.restore(),A.undo.saveStep(),A.markers.insert(),A.html.wrap();var s=A.$el.find(".fr-marker");A.node.isLastSibling(s)&&s.parent().hasClass("fr-deletable")&&s.insertAfter(s.parent()),s.replaceWith(r),A.selection.clear()}else A.html.insert(r);A.selection.restore();var i=A.$el.find(".fr-inserted-table");i.removeClass("fr-inserted-table"),A.events.trigger("table.inserted",[i.get(0)])},remove:u,insertRow:m,deleteRow:function oe(){var e=ae();if(0<e.length){var t,a,l,n=x(),r=M(n);if(null==r)return;if(0===r.min_i&&r.max_i==n.length-1)u();else{for(t=r.max_i;t>=r.min_i;t--){for(l=T(e.find("tr").not(e.find("> table tr")).get(t)),a=0;a<n[t].length;a++)if(0===a||n[t][a]!=n[t][a-1]){var o=T(n[t][a]);if(1<parseInt(o.attr("rowspan"),10)){var s=parseInt(o.attr("rowspan"),10)-1;1==s?o.removeAttr("rowspan"):o.attr("rowspan",s)}if(t<n.length-1&&n[t][a]==n[t+1][a]&&(0===t||n[t][a]!=n[t-1][a])){for(var i=n[t][a],f=a;0<f&&n[t][f]==n[t][f-1];)f--;0===f?T(e.find("tr").not(e.find("> table tr")).get(t+1)).prepend(i):T(n[t+1][f-1])[0].parentNode&&T(n[t+1][f-1])[0].insertAdjacentElement("afterend",i)}}var c=l.parent();l.remove(),0===c.find("tr").length&&c.remove(),n=x(e)}E(0,n.length-1,0,n[0].length-1,e),0<r.min_i?A.selection.setAtEnd(n[r.min_i-1][0]):A.selection.setAtEnd(n[0][0]),A.selection.restore(),A.popups.hide("table.edit")}}},insertColumn:function se(c){var e=ae();if(0<e.length){var d,p=x(),t=M(p);d="before"==c?t.min_j:t.max_j;var a,h=100/p[0].length,u=100/(p[0].length+1);e.find("th, td").each(function(){(a=T(this)).data("old-width",a.outerWidth()/e.outerWidth()*100)}),e.find("tr").not(e.find("> table tr")).each(function(e){for(var t,a=T(this),l=0,n=0;l-1<d;){if(!(t=a.find("> th, > td").get(n))){t=null;break}t==p[e][l]?(l+=parseInt(T(t).attr("colspan"),10)||1,n++):(l+=parseInt(T(p[e][l]).attr("colspan"),10)||1,"after"==c&&(t=0===n?-1:a.find("> th, > td").get(n-1)))}var r=T(t);if("after"==c&&d<l-1||"before"==c&&0<d&&p[e][d]==p[e][d-1]){if(0===e||0<e&&p[e][d]!=p[e-1][d]){var o=parseInt(r.attr("colspan"),10)+1;r.attr("colspan",o),r.css("width",(r.data("old-width")*u/h+u).toFixed(4)+"%"),r.removeData("old-width")}}else{var s,i=(r.get(0)||"").tagName;if(0<a.find("th").length&&"TH"===i)s='<th style="width: '.concat(u.toFixed(4),'%;"><br></th>');else{var f=b(p[e][d]);s='<td style="'.concat(r.attr("style"),"; width: ").concat(u.toFixed(4),'%;">')+f.startTag+"<br>"+f.closeTag+"</td>"}T(s).append("<br>"),T(s).css("width","".concat(u.toFixed(4),"%")),-1==t?a.prepend(s):null==t?a.append(s):"before"==c?r.before(s):"after"==c&&r.after(s)}}),e.find("th, td").each(function(){(a=T(this)).data("old-width")&&(a.css("width",(a.data("old-width")*u/h).toFixed(4)+"%"),a.removeData("old-width"))}),A.popups.isVisible("table.edit")&&g()}},deleteColumn:function ie(){var e=ae();if(0<e.length){var t,a,l,n=x(),r=M(n);if(null==r)return;if(0===r.min_j&&r.max_j==n[0].length-1)u();else{var o=0;for(t=0;t<n.length;t++)for(a=0;a<n[0].length;a++)(l=T(n[t][a])).hasClass("fr-selected-cell")||(l.data("old-width",l.outerWidth()/e.outerWidth()*100),(a<r.min_j||a>r.max_j)&&(o+=l.outerWidth()/e.outerWidth()*100));for(o/=n.length,a=r.max_j;a>=r.min_j;a--)for(t=0;t<n.length;t++)if(0===t||n[t][a]!=n[t-1][a])if(l=T(n[t][a]),1<(parseInt(l.attr("colspan"),10)||1)){var s=parseInt(l.attr("colspan"),10)-1;1==s?l.removeAttr("colspan"):l.attr("colspan",s),l.css("width",(100*(l.data("old-width")-U(a,n))/o).toFixed(4)+"%"),l.removeData("old-width")}else{var i=T(l.parent().get(0));l.remove(),0===i.find("> th, > td").length&&(0===i.prev().length||0===i.next().length||i.prev().find("> th[rowspan], > td[rowspan]").length<i.prev().find("> th, > td").length)&&i.remove()}E(0,n.length-1,0,n[0].length-1,e),0<r.min_j?A.selection.setAtEnd(n[r.min_i][r.min_j-1]):A.selection.setAtEnd(n[r.min_i][0]),A.selection.restore(),A.popups.hide("table.edit"),e.find("th, td").each(function(){(l=T(this)).data("old-width")&&(l.css("width",(100*l.data("old-width")/o).toFixed(4)+"%"),l.removeData("old-width"))})}}},mergeCells:function fe(){if(1<te().length&&(0===A.$el.find("th.fr-selected-cell").length||0===A.$el.find("td.fr-selected-cell").length)){_();var e,t,a=M(x());if(null==a)return;var l=A.$el.find(".fr-selected-cell"),n=T(l[0]),r=n.parent().find(".fr-selected-cell"),o=n.closest("table"),s=n.html(),i=0;for(e=0;e<r.length;e++)i+=T(r[e]).outerWidth();for(n.css("width",Math.min(100,i/o.outerWidth()*100).toFixed(4)+"%"),a.min_j<a.max_j&&n.attr("colspan",a.max_j-a.min_j+1),a.min_i<a.max_i&&n.attr("rowspan",a.max_i-a.min_i+1),e=1;e<l.length;e++)"<br>"!=(t=T(l[e])).html()&&""!==t.html()&&(s+="<br>".concat(t.html())),t.remove();n.html(s),A.selection.setAtEnd(n.get(0)),A.selection.restore(),A.toolbar.enable(),w(a.min_i,a.max_i,o);var f=o.find("tr:empty");for(e=f.length-1;0<=e;e--)T(f[e]).remove();v(a.min_j,a.max_j,o),g()}},splitCellVertically:function ce(){if(1==te().length){var e=A.$el.find(".fr-selected-cell"),t=parseInt(e.attr("colspan"),10)||1,a=e.parent().outerWidth(),l=e.outerWidth(),n=e.clone().html("<br>"),r=x(),o=$(e.get(0),r);if(1<t){var s=Math.ceil(t/2);l=q(o.col,o.col+s-1,r)/a*100;var i=q(o.col+s,o.col+t-1,r)/a*100;1<s?e.attr("colspan",s):e.removeAttr("colspan"),1<t-s?n.attr("colspan",t-s):n.removeAttr("colspan"),e.css("width",l.toFixed(4)+"%"),n.css("width",i.toFixed(4)+"%")}else{var f;for(f=0;f<r.length;f++)if(0===f||r[f][o.col]!=r[f-1][o.col]){var c=T(r[f][o.col]);if(!c.is(e)){var d=(parseInt(c.attr("colspan"),10)||1)+1;c.attr("colspan",d)}}l=l/a*100/2,e.css("width","".concat(l.toFixed(4),"%")),n.css("width","".concat(l.toFixed(4),"%"))}e[0].parentNode&&e[0].insertAdjacentElement("afterend",n[0]),N(),A.popups.hide("table.edit")}},splitCellHorizontally:function de(){if(1==te().length){var e=A.$el.find(".fr-selected-cell"),t=e.parent(),a=e.closest("table"),l=parseInt(e.attr("rowspan"),10),n=x(),r=$(e.get(0),n),o=e.clone().html("<br>");if(1<l){var s=Math.ceil(l/2);1<s?e.attr("rowspan",s):e.removeAttr("rowspan"),1<l-s?o.attr("rowspan",l-s):o.removeAttr("rowspan");for(var i=r.row+s,f=0===r.col?r.col:r.col-1;0<=f&&(n[i][f]==n[i][f-1]||0<i&&n[i][f]==n[i-1][f]);)f--;-1==f?T(a.find("tr").not(a.find("> table tr")).get(i)).prepend(o):T(n[i][f])[0].parentNode&&T(n[i][f])[0].insertAdjacentElement("afterend",o[0])}else{var c,d=T(document.createElement("tr")).append(o);for(c=0;c<n[0].length;c++)if(0===c||n[r.row][c]!=n[r.row][c-1]){var p=T(n[r.row][c]);p.is(e)||p.attr("rowspan",(parseInt(p.attr("rowspan"),10)||1)+1)}t[0].parentNode&&t[0].insertAdjacentElement("afterend",d[0])}N(),A.popups.hide("table.edit")}},addHeader:function pe(){var e=ae();if(0<e.length&&0===e.find("> th").length){var t,a="<thead><tr>",l=0;for(l=e.find("tr").first().find("> th").length,e.find("tr").first().find("> td").each(function(){var e=T(this);l+=parseInt(e.attr("colspan"),10)||1}),t=0;t<l;t++)a+="<th><br></th>";a+="</tr></thead>",e.prepend(a),g()}},addFooter:function he(){var e=ae();if(0<e.length&&0===e.find("tfoot").length){var t,a="<tfoot><tr>",l=0,n="> td";for(0<e.find("thead").length&&(n="> th"),e.find("tr").first().find(n).each(function(){var e=T(this);l+=parseInt(e.attr("colspan"),10)||1}),t=0;t<l;t++)a+="<td><br></td>";a+="</tr></tfoot>",e.append(a),g()}},removeHeader:function ue(){var e=ae(),t=e.find("> thead");if(0<(t=T(t)).length)if(0===e.find("tbody tr").length)u();else if(t.remove(),0<te().length)g();else{A.popups.hide("table.edit");var a=e.find("tbody tr").first().find("td").first().get(0);a&&(A.selection.setAtEnd(a),A.selection.restore())}},removeFooter:function ge(){var e=ae(),t=e.find("tfoot");if(0<t.length)if(0===e.find("tbody tr").length)u();else if(t.remove(),0<te().length)g();else{A.popups.hide("table.edit");var a=e.find("tbody tr").first().find("td").first().get(0);a&&(A.selection.setAtEnd(a),A.selection.restore())}},setBackground:t,showInsertPopup:function be(){var e=A.$tb.find('.fr-command[data-cmd="insertTable"]'),t=A.popups.get("table.insert");if(t||(t=c()),!t.hasClass("fr-active")){A.popups.refresh("table.insert"),A.popups.setContainer("table.insert",A.$tb);var a=A.button.getPosition(e),l=a.left,n=a.top;A.popups.show("table.insert",l,n,e.outerHeight())}},showEditPopup:g,showColorsPopup:s,back:function me(){0<te().length?g():(A.popups.hide("table.insert"),A.toolbar.showInline())},verticalAlign:function ve(e){A.$el.find(".fr-selected-cell").css("vertical-align",e)},horizontalAlign:function we(e){A.$el.find(".fr-selected-cell").css("text-align",e)},applyStyle:function Ce(e,t,a,l){if(0<t.length){if(A.opts.useClasses||("TABLE"===t.get(0).tagName?function r(e,t){var a=e.childNodes;if(0<a.length)for(var l=0;l<a.length;l++)"TD"===a[l].tagName?"fr-dashed-borders"===t||"fr-highlighted"===t||"fr-thick"===t?R(a[l]):"fr-alternate-rows"===t&&a[l].style.removeProperty("background-color"):r(a[l],t)}(t.get(0),e):R(t.get(0))),!a){var n=Object.keys(l);n.splice(n.indexOf(e),1),t.removeClass(n.join(" "))}t.toggleClass(e)}},selectedTable:ae,selectedCells:te,customColor:function Ee(){var e=A.popups.get("table.colors").find(".fr-table-colors-hex-layer input");e.length&&t(e.val())},selectCells:k}},ye.DefineIcon("insertTable",{NAME:"table",SVG_KEY:"insertTable"}),ye.RegisterCommand("insertTable",{title:"Insert Table",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("table.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("table.insert")):this.table.showInsertPopup()},plugin:"table"}),ye.RegisterCommand("tableInsert",{callback:function(e,t,a){this.table.insert(t,a),this.popups.hide("table.insert")}}),ye.DefineIcon("tableHeader",{NAME:"header",FA5NAME:"heading",SVG_KEY:"tableHeader"}),ye.RegisterCommand("tableHeader",{title:"Table Header",focus:!1,toggle:!0,callback:function(){this.popups.get("table.edit").find('.fr-command[data-cmd="tableHeader"]').hasClass("fr-active")?this.table.removeHeader():this.table.addHeader()},refresh:function(e){var t=this.table.selectedTable();0<t.length&&(0===t.find("> thead").length?e.removeClass("fr-active").attr("aria-pressed",!1):e.addClass("fr-active").attr("aria-pressed",!0))}}),ye.DefineIcon("tableFooter",{NAME:"table",FA5NAME:"table",SVG_KEY:"tableFooter"}),ye.RegisterCommand("tableFooter",{title:"Table Footer",focus:!1,toggle:!0,callback:function(){this.popups.get("table.edit").find('.fr-command[data-cmd="tableFooter"]').hasClass("fr-active")?this.table.removeFooter():this.table.addFooter()},refresh:function(e){var t=this.table.selectedTable();0<t.length&&(0===t.find("tfoot").length?e.removeClass("fr-active").attr("aria-pressed",!1):e.addClass("fr-active").attr("aria-pressed",!0))}}),ye.DefineIcon("tableRows",{NAME:"bars",SVG_KEY:"row"}),ye.RegisterCommand("tableRows",{type:"dropdown",focus:!1,title:"Row",options:{above:"Insert row above",below:"Insert row below","delete":"Delete row"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ye.COMMANDS.tableRows.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableRows" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.language.translate(t[a])+"</a></li>");return e+="</ul>"},callback:function(e,t){"above"==t||"below"==t?this.table.insertRow(t):this.table.deleteRow()}}),ye.DefineIcon("tableColumns",{NAME:"bars fa-rotate-90",SVG_KEY:"columns"}),ye.RegisterCommand("tableColumns",{type:"dropdown",focus:!1,title:"Column",options:{before:"Insert column before",after:"Insert column after","delete":"Delete column"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ye.COMMANDS.tableColumns.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableColumns" data-param1="'.concat(a,'" title="').concat(this.language.translate(t[a]),'">').concat(this.language.translate(t[a]),"</a></li>"));return e+="</ul>"},callback:function(e,t){"before"==t||"after"==t?this.table.insertColumn(t):this.table.deleteColumn()}}),ye.DefineIcon("tableCells",{NAME:"square-o",FA5NAME:"square",SVG_KEY:"cellOptions"}),ye.RegisterCommand("tableCells",{type:"dropdown",focus:!1,title:"Cell",options:{merge:"Merge cells","vertical-split":"Vertical split","horizontal-split":"Horizontal split"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ye.COMMANDS.tableCells.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableCells" data-param1="'.concat(a,'" title="').concat(this.language.translate(t[a]),'">').concat(this.language.translate(t[a]),"</a></li>"));return e+="</ul>"},callback:function(e,t){"merge"==t?this.table.mergeCells():"vertical-split"==t?this.table.splitCellVertically():this.table.splitCellHorizontally()},refreshOnShow:function(e,t){1<this.$el.find(".fr-selected-cell").length?(t.find('a[data-param1="vertical-split"]').addClass("fr-disabled").attr("aria-disabled",!0),t.find('a[data-param1="horizontal-split"]').addClass("fr-disabled").attr("aria-disabled",!0),t.find('a[data-param1="merge"]').removeClass("fr-disabled").attr("aria-disabled",!1)):(t.find('a[data-param1="merge"]').addClass("fr-disabled").attr("aria-disabled",!0),t.find('a[data-param1="vertical-split"]').removeClass("fr-disabled").attr("aria-disabled",!1),t.find('a[data-param1="horizontal-split"]').removeClass("fr-disabled").attr("aria-disabled",!1))}}),ye.DefineIcon("tableRemove",{NAME:"trash",SVG_KEY:"removeTable"}),ye.RegisterCommand("tableRemove",{title:"Remove Table",focus:!1,callback:function(){this.table.remove()}}),ye.DefineIcon("tableStyle",{NAME:"paint-brush",SVG_KEY:"tableStyle"}),ye.RegisterCommand("tableStyle",{title:"Table Style",type:"dropdown",focus:!1,html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.tableStyles;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableStyle" data-param1="'.concat(a,'" title="').concat(this.language.translate(t[a]),'">').concat(this.language.translate(t[a]),"</a></li>"));return e+="</ul>"},callback:function(e,t){this.table.applyStyle(t,this.$el.find(".fr-selected-cell").closest("table"),this.opts.tableMultipleStyles,this.opts.tableStyles)},refreshOnShow:function(e,t){var a=this.$,l=this.$el.find(".fr-selected-cell").closest("table");l&&t.find(".fr-command").each(function(){var e=a(this).data("param1"),t=l.hasClass(e);a(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),ye.DefineIcon("tableCellBackground",{NAME:"tint",SVG_KEY:"cellBackground"}),ye.RegisterCommand("tableCellBackground",{title:"Cell Background",focus:!1,popup:!0,callback:function(){this.table.showColorsPopup()}}),ye.RegisterCommand("tableCellBackgroundColor",{undo:!0,focus:!1,callback:function(e,t){this.table.setBackground(t)}}),ye.DefineIcon("tableBack",{NAME:"arrow-left",SVG_KEY:"back"}),ye.RegisterCommand("tableBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.table.back()},refresh:function(e){0!==this.table.selectedCells().length||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"))}}),ye.DefineIcon("tableCellVerticalAlign",{NAME:"arrows-v",FA5NAME:"arrows-alt-v",SVG_KEY:"verticalAlignMiddle"}),ye.RegisterCommand("tableCellVerticalAlign",{type:"dropdown",focus:!1,title:"Vertical Align",options:{Top:"Align Top",Middle:"Align Middle",Bottom:"Align Bottom"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ye.COMMANDS.tableCellVerticalAlign.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableCellVerticalAlign" data-param1="'.concat(a.toLowerCase(),'" title="').concat(this.language.translate(t[a]),'">').concat(this.language.translate(a),"</a></li>"));return e+="</ul>"},callback:function(e,t){this.table.verticalAlign(t)},refreshOnShow:function(e,t){t.find('.fr-command[data-param1="'+this.$el.find(".fr-selected-cell").css("vertical-align")+'"]').addClass("fr-active").attr("aria-selected",!0)}}),ye.DefineIcon("tableCellHorizontalAlign",{NAME:"align-left",SVG_KEY:"alignLeft"}),ye.DefineIcon("align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),ye.DefineIcon("align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),ye.DefineIcon("align-center",{NAME:"align-center",SVG_KEY:"alignCenter"}),ye.DefineIcon("align-justify",{NAME:"align-justify",SVG_KEY:"alignJustify"}),ye.RegisterCommand("tableCellHorizontalAlign",{type:"dropdown",focus:!1,title:"Horizontal Align",options:{left:"Align Left",center:"Align Center",right:"Align Right",justify:"Align Justify"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ye.COMMANDS.tableCellHorizontalAlign.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="tableCellHorizontalAlign" data-param1="'.concat(a,'" title="').concat(this.language.translate(t[a]),'">').concat(this.icon.create("align-".concat(a)),'<span class="fr-sr-only">').concat(this.language.translate(t[a]),"</span></a></li>"));return e+="</ul>"},callback:function(e,t){this.table.horizontalAlign(t)},refresh:function(e){var t=this.table.selectedCells(),a=this.$;t.length&&e.find("> *").first().replaceWith(this.icon.create("align-".concat(this.helpers.getAlignment(a(t[0])))))},refreshOnShow:function(e,t){t.find('.fr-command[data-param1="'+this.helpers.getAlignment(this.$el.find(".fr-selected-cell").first())+'"]').addClass("fr-active").attr("aria-selected",!0)}}),ye.DefineIcon("tableCellStyle",{NAME:"magic",SVG_KEY:"cellStyle"}),ye.RegisterCommand("tableCellStyle",{title:"Cell Style",type:"dropdown",focus:!1,html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.tableCellStyles;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="tableCellStyle" data-param1="'.concat(a,'" title="').concat(this.language.translate(t[a]),'">').concat(this.language.translate(t[a]),"</a></li>"));return e+="</ul>"},callback:function(e,t){this.table.applyStyle(t,this.$el.find(".fr-selected-cell"),this.opts.tableCellMultipleStyles,this.opts.tableCellStyles)},refreshOnShow:function(e,t){var a=this.$,l=this.$el.find(".fr-selected-cell").first();l&&t.find(".fr-command").each(function(){var e=a(this).data("param1"),t=l.hasClass(e);a(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),ye.RegisterCommand("tableCellBackgroundCustomColor",{title:"OK",undo:!0,callback:function(){this.table.customColor()}}),ye.DefineIcon("tableColorRemove",{NAME:"eraser",SVG_KEY:"remove"})});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.2.1 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.3.0 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2024 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(U){"use strict";function j(e){return function t(e){if(Array.isArray(e))return i(e)}(e)||function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function n(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return i(e,t)}(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 i(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}U=U&&U.hasOwnProperty("default")?U["default"]:U,Object.assign(U.DEFAULTS,{trackChangesEnabled:!1,showChangesEnabled:!1}),U.PLUGINS.track_changes=function(M){var _=M.$;_.fn.isAfter=function(e){var t=_(this),a=t.parents(),n=e.parents(),r=t;for(var i in a){var s=e;if(a.hasOwnProperty(i)){var l=_(a[i]);for(var o in n)if(n.hasOwnProperty(o)){var c=_(n[o]);if(l[0]===c[0]){var d=r.index();return s.index()<d}s=c}r=l}}return!1};var s,r,i=[],I="",T="",w="",L="",C=[],l=[],S=null,R=[],d=!1;function o(){return i.pop()}function N(e){var t=!(!e||8!=e.keyCode),a=e&&13==e.keyCode,n=!(!e||46!=e.keyCode);if(M.opts.trackChangesEnabled){M.selection.restore(),e&&e.composing&&(M.selection.save(),M.selection.ranges()[0].collapse(!1));var r=M.selection.ranges(0).startContainer,i=_(r).parentsUntil(M.$el,"[data-tracking=true]");if(_(r).data("tracking")&&t){M.markers.insert();var s=M.$el.find(".fr-marker");return s[0].previousSibling&&"IMG"===s[0].previousSibling.tagName||M.selection.clear(),void _(s).remove()}if(!i.length||"TD"==r.tagName||a){if(M.selection.isCollapsed()){M.markers.insert();var l=M.$el.find(".fr-marker");if(e&&e.composing&&(l=_(l[1])),!l.length)return;var o="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),c=M.opts.showChangesEnabled?'class="fr-highlight-change"':"";if(t||n){if(t){if(!l[0].previousSibling||l[0].previousSibling.nodeType!==Node.ELEMENT_NODE||!l[0].previousSibling.lastChild||l[0].previousSibling.lastChild.nodeType!==Node.ELEMENT_NODE||"IMG"!==l[0].previousSibling.lastChild.tagName){for(;_(l[0].previousSibling).data("tracking");)l.insertBefore(l.prev());_(l[0].previousSibling).find("[data-tracking=true]").length&&l.insertBefore(_(l[0].previousSibling).find("[data-tracking=true]").eq(0))}}else if(_(r).data("tracking")){if(!r.nextSibling)return void(l[0].nextSibling&&"IMG"===l[0].nextSibling.tagName&&l[0].nextSibling.remove());l.insertBefore(r.nextSibling),$(l)}else $(l);var d=l[0]&&l[0].previousSibling?l[0].previousSibling.nodeValue:"",g=d&&d.slice(0,-(e.selectionLength?e.selectionLength:1));n&&(l[0].nextSibling&&"SPAN"!==l[0].nextSibling.tagName&&null===l[0].nextSibling.nodeValue&&l[0].nextSibling.firstChild&&l[0].nextSibling.firstChild.before(l[0]),g=(d=l[0].nextSibling?l[0].nextSibling.nodeValue:" ")&&d.slice(1)),n&&l[0].nextSibling&&"isPasted"===l[0].nextSibling.id?g=(d=l[0].nextSibling?l[0].nextSibling.textContent:" ")&&d.slice(1):t&&l[0].previousSibling&&"isPasted"===l[0].previousSibling.id&&(g=(d=l[0].previousSibling?l[0].previousSibling.textContent:" ")&&d.slice(0,-(e.selectionLength?e.selectionLength:1)));var h,f=_('<span data-tracking="true" data-track-id="'.concat(o,'" ').concat(c,"></span>")),p=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" '.concat(M.helpers.isIOS()?"":'contenteditable="false"',"></span>"));M.opts.showChangesEnabled||(M.helpers.isMobile()?p.addClass("fr-track-hide-mobile"):p.addClass("fr-track-hide"));var u=!1,k=!1;if(t)try{var m=l[0]&&l[0].previousSibling;if(l[0]&&l[0].previousElementSibling&&"I"===l[0].previousElementSibling.tagName&&!d&&(h=l[0].previousElementSibling),m&&3===m.nodeType&&"SPAN"!==m.parentNode.tagName&&m.previousSibling&&"SPAN"===m.previousSibling.tagName&&" "===m.nodeValue&&0<_(m.previousSibling).find(".fr-emoticon").length?h=m.previousSibling:m&&"SPAN"===m.parentNode.tagName&&0<_(m.parentNode).find(".fr-emoticon").length?(h=m.parentNode,u=!0):m&&("SPAN"===m.tagName&&"isPasted"!==m.id||"HR"===m.tagName)?h=m:_(l).parent().prev().is("hr")?(h=_(l).parent().prev().get(0),u=k=!0):m&&"IMG"===m.tagName&&(h=m,_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),M.helpers.isMobile()&&l[0]&&!h&&!d&&!g)return;u?(_(l[0].parentNode).after(f),k?_(l).parent().remove():_(l).remove()):l[0]?e.composing?_(l).after(f):_(l).before(f):_(L).before(f)}catch(e){L&&_(L).before(f)}else if(n){var b=l[0].nextSibling;l[0].nextElementSibling&&"I"===l[0].nextElementSibling.tagName&&!l[0].nextSibling.nodeValue?h=l[0].nextElementSibling:b&&3===b.nodeType&&"SPAN"!==b.parentNode.tagName&&b.nextSibling&&"SPAN"===b.nextSibling.tagName&&" "===b.nodeValue&&0<_(b.nextSibling).find(".fr-emoticon").length?h=b.nextSibling:b&&"SPAN"===b.parentNode.tagName&&0<_(b.parentNode).find(".fr-emoticon").length?(h=b.parentNode,u=!0):b&&"SPAN"===b.tagName&&l[0].nextSibling&&"isPasted"!==l[0].nextSibling.id?h=b:b&&"IMG"===b.tagName&&(h=b,_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),u?(_(l[0].parentNode).before(f),_(l).remove()):_(l).after(f)}if(e.composing?R.push({span:f,"delete":p}):(M.helpers.isIOS()&&R.push({"delete":p}),_(f).prepend(p)),!h&&(h=d&&d.replace(g,""),M.helpers.isMobile()&&I&&!e.composing)){var v=M.selection.get().focusNode,C=M.selection.get().focusOffset,S=1;T&&v&&T.isSameNode(v)&&(S=w-C),h=I.replace(/\u00a0/g," ").replace(d.replace(/\u00a0/g," "),"").slice(0,S)}if(h&&(u?(_(p).append(_(_(h).get(0).outerHTML)),M.markers.insert()):_(p).append(h)),h&&0==h.length)return;M.browser.msie&&t&&(_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),t&&(g||""===g)&&l[0].previousSibling?l[0].previousSibling.nodeValue=g:n&&(_(f).append("".concat(U.MARKERS)),l[0].nextSibling.nodeValue=g)}else{var N=U.INVISIBLE_SPACE;if(e&&M.helpers.isMobile()&&((N=l[0]&&l[0].previousSibling&&l[0].previousSibling.nodeValue?l[0].previousSibling.nodeValue.slice(-1):U.INVISIBLE_SPACE)&&l[0]&&l[0].previousSibling&&l[0].previousSibling.nodeValue?l[0].previousSibling.nodeValue=l[0].previousSibling.nodeValue.slice(0,-1):!l[0]||l[0].previousSibling||l[0].nextSibling||N!==U.INVISIBLE_SPACE||(N=M.selection.get().focusNode.nodeValue.slice(w,M.selection.get().focusOffset),M.selection.get().focusNode.nodeValue=M.selection.get().focusNode.nodeValue.slice(M.selection.get().focusOffset))),a){if(l.parent().parent().is("li"))return;var E=_("<p></p>");return void(0<l.closest("p").length&&(l.closest("p").after(E),E.append(l),M.markers.remove(),setTimeout(function(){E.prev().text()!==String.fromCharCode(8203)&&""!==E.prev().text()||E.prev().remove(),M.selection.setAfter(E[0])},1)))}l[0].previousSibling&&"BR"===l[0].previousSibling.tagName&&l[0].previousSibling.remove(),l.replaceWith('<span data-tracking="true" data-track-id="'.concat(o,'" ').concat(c,">").concat(N+U.MARKERS,"</span>"))}M.selection.restore(),M.track_changes.pushChange(o)}else{M.selection.save();var y=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),x=M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0);if(_(y).parent().hasClass("fr-emoticon")&&_(y).parent().before(y),_(y).isAfter(_(x))){var A=y;y=x,x=A}P(y,x,e&&e.deletion),M.selection.restore()}M.helpers.isMobile()&&I&&M.markers.remove()}}}function $(e){if(_(e[0].nextSibling).data("tracking")){for(;_(e[0].nextSibling).data("tracking")&&(!(0<_(e[0].previousElementSibling).find("[data-tracking-deleted=true]").length&&0<_(e[0].nextElementSibling).find("[data-tracking-deleted=true]").length)||_(e[0].previousSibling).data("tracking"));)_(e).insertAfter(e.next());e.insertBefore(e[0].previousSibling)}}function P(e,t){var a=2<arguments.length&&arguments[2]!==undefined&&arguments[2];if(e&&(!e.isSameNode(t)||!_(e).hasClass("fr-marker"))){for(;e.nodeType===Node.COMMENT_NODE;)e=e.nextSibling;if(_(e).parent().is("table")&&0!==_(e).parent().next().text().length&&P(_(e).parent().next()[0],t,a),"TD"!==e.tagName||1!==e.childNodes.length||"BR"!==e.childNodes[0].tagName){if(M.node.isBlock(e)&&"HR"!==e.tagName)return M.node.hasClass(e.firstChild,"fr-marker")?P(e.firstChild.nextSibling,t,a):P(e.firstChild,t,a),!1;if("BR"===e.tagName&&"TD"===e.parentElement.tagName){var n=e.parentElement.nextElementSibling;_(e).remove(),P(n,t)}var r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",s=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),l=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" '.concat(M.helpers.isIOS()?"":'contenteditable="false"',"></span>"));M.opts.showChangesEnabled||(M.helpers.isMobile()?l.addClass("fr-track-hide-mobile"):l.addClass("fr-track-hide"));var o=e;for(_(e).before(s),M.track_changes.pushChange(r);o&&_(o).hasClass("fr-marker");)o=o.nextSibling;for(var c=!1;o&&!c&&!_(o).hasClass("fr-marker")&&!_(o).is("[data-track-id]")&&0===_(o).find("fr-marker").length&&"UL"!==o.tagName&&"OL"!==o.tagName;){var d=o;if("IMG"===o.tagName&&_(o).data("tracking-img","true"),M.node.isBlock(o)&&"HR"!==e.tagName)return P(o.firstChild,t,a),!1;if(o)for(var g=o.childNodes,h=0;h<g.length;h++)if(g[h].className&&"fr-marker"===g[h].className){c=!0,P(o.firstChild,t,a);break}c||(o=o.nextSibling,_(l).append(d))}if(!o||"UL"!==o.tagName&&"OL"!==o.tagName||P(o,t,a),a?R.push({span:s,"delete":l}):(M.helpers.isIOS()&&R.push({"delete":l}),_(s).prepend(l)),M.browser.msie?_(s).prepend("".concat(U.INVISIBLE_SPACE+U.MARKERS)):_(s).prepend("".concat(U.INVISIBLE_SPACE)),_(s).append("".concat(U.INVISIBLE_SPACE+U.MARKERS)),!o&&!e.isSameNode(t)){for(var f=s.get(0).parentNode;f&&!f.nextSibling&&!M.node.isElement(f);)f=f.parentNode;if(f){var p=f.nextSibling;p&&(M.node.isBlock(p)?"HR"===p.tagName?P(p.nextSibling,t,a):(M.browser.mozilla&&"LI"===f.tagName&&"SPAN"===f.lastChild.tagName&&_(f.lastChild).hasClass("fr-marker")&&f.lastChild.remove(),P(p.firstChild,t,a)):P(p,t,a))}}}}}function E(e){if(M.opts.trackChangesEnabled){M.selection.restore();var t=M.selection.ranges(0).startContainer,a=_(t).parentsUntil(M.$el,"[data-tracking=true]");if(_(t).data("tracking"))return;if(!a.length&&!M.selection.isCollapsed()&&"quote"!=e){M.selection.save(),f(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0));var n=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),r=n.parentNode;if(r&&"A"===r.tagName&&r.firstChild&&"SPAN"===r.firstChild.tagName&&2<r.firstChild.childNodes.length&&"STRONG"===r.firstChild.childNodes[3].tagName)_(r.firstChild.childNodes[3].firstChild).before(n);else{for(var i=n.previousSibling.firstChild;i&&"SPAN"!==i.tagName;)i=i.nextSibling;_(i).after(n)}M.selection.restore()}}}function f(e,t,a){if(e&&!("<br>"===_(e).html()&&_(e).parent().is("td")||(_(e).parent().is("table")&&0!==_(e).parent().next().text().length&&f(_(e).parent().next()[0],t,a),_(e).is("br")&&_(e).parent().length&&_(e).parent().is("td")&&0===_(e).parent().text().length))){for(a||(a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),M.track_changes.pushChange(a));e.nodeType===Node.COMMENT_NODE;)e=e.nextSibling;if(M.node.isBlock(e)&&"HR"!==e.tagName)return M.node.hasClass(e.firstChild,"fr-marker")?f(e.firstChild.nextSibling,t,a):f(e.firstChild,t,a),!1;var n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false" style="display:none"></span>'),s=e;for(_(e).before(r);s&&_(s).hasClass("fr-marker");)s=s.nextSibling;for(var l=!1;s&&!l&&!_(s).hasClass("fr-marker")&&0===_(s).find("fr-marker").length&&"UL"!==s.tagName&&"OL"!==s.tagName;){var o=s;if(M.node.isBlock(s)&&"HR"!==e.tagName)return f(s.firstChild,t,a),!1;if(s)for(var c=s.childNodes,d=0;d<c.length;d++)if(c[d].className&&"fr-marker"===c[d].className){l=!0,f(s.firstChild,t,a);break}l||(s=s.nextSibling,_(i).append(o.cloneNode(!0)),_(r).append(o))}if(!s||"UL"!==s.tagName&&"OL"!==s.tagName||f(s,t,a),_(s).hasClass("fr-marker")&&_(r).append(s),_(r).prepend(i),_(r).prepend("".concat(U.INVISIBLE_SPACE)),_(r).append("".concat(U.INVISIBLE_SPACE)),!s&&!e.isSameNode(t)){for(var g=r.get(0).parentNode;g&&!g.nextSibling&&!M.node.isElement(g);)g=g.parentNode;if(g){var h=g.nextSibling;h&&(M.node.isBlock(h)?"HR"===h.tagName?f(h.nextSibling,t,a):f(h.firstChild,t,a):f(h,t,a))}}}}function c(e,t,a){var n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||i.addClass("fr-track-hide"),i.append(t.get(0).innerHTML),r.append(i);var s=e.get(0).innerHTML;e.html(""),e.append(r),r.append(s)}function g(){if(M.events.trigger("image.hideResizer"),M.events.trigger("video.hideResizer"),M.html.cleanEmptyTags(!0),M.helpers.isMobile())for(var e=M.$el.find("img[data-tracking-img]"),t=0;t<e.length;t++){var a=_(e.get(t));a.parent()&&a.parent().data("tracking")||a.removeData("tracking-img")}}function e(){M.$el.find("li").each(function(){0===this.innerText.replace(/\u200B/g,"").length&&this.remove()})}function t(){var e=o();if(e){var t,a=M.$el.find("[data-track-id=".concat(e,"]"));if(a.length){var n=a.parent("a");if(n.length){var r=_(n.get(0).outerHTML).text();1===[].filter.call(r,function(e){return 8203!==e.charCodeAt(0)}).length&&(t=n)}for(var i=0;i<a.length;i++){var s=a.get(i),l=_(a).data("tracking-deleted")?_(a):_(s).find("[data-tracking-deleted=true]");l.length&&(l.get(0).remove?l.get(0).remove():l.get(0).parentNode.removeChild(l.get(0))),s.hasAttribute("style")?(_(s).removeData("tracking"),_(s).removeData("track-id"),_(s).removeClass("fr-highlight-change")):(M.selection.save(),0<_(s).find("IFRAME").length?(_(s).removeData("tracking"),_(s).removeData("track-id"),_(s).removeClass("fr-highlight-change")):s.outerHTML=s.innerHTML,M.selection.restore())}}t&&t.remove()}g()}function a(){var e=o();if(e){var t=M.$el.find("[data-track-id=".concat(e,"]"));if(t.length){M.selection.save();for(var a=t.length-1;0<=a;a--){var n=_(t).data("tracking-deleted")?_(t):_(t.get(a)).find("[data-tracking-deleted=true]");if(n.length)if(0<_(t).find("IFRAME").length)_(t).removeData("tracking"),_(t).removeData("track-id"),_(t).removeClass("fr-highlight-change"),_(t).removeClass("fr-tracking-deleted"),_(t).removeData("tracking-deleted"),_(t).removeAttr("contenteditable");else n.parent("[data-tracking=true]").data("track-id")==e?(_(t.get(a)).find("[data-tracking-deleted=true]").remove(),t.get(a).outerHTML=n.get(0).innerHTML):t.get(a).remove?t.get(a).remove():t.get(a).parentNode.removeChild(t.get(a));else t.get(a).remove?t.get(a).remove():t.get(a).parentNode.removeChild(t.get(a))}M.selection.restore()}}g()}return M.events.on("keydown",function(e){var t;if(!M.opts.trackChangesEnabled)return!0;if(s=null===(t=M.selection.get())||void 0===t||null===(t=t.focusNode)||void 0===t?void 0:t.nodeValue,M.helpers.isAndroid()){var a,n,r=M.selection.get();I=null==r||null===(a=r.focusNode)||void 0===a?void 0:a.nodeValue,T=null==r?void 0:r.focusNode,L=null===(n=T)||void 0===n?void 0:n.nextSibling,w=null==r?void 0:r.focusOffset}else if(function i(e){return(!M.keys.ctrlKey(e)||e.which!==U.KEYCODE.Z&&e.which!==U.KEYCODE.C)&&(48<=e.keyCode&&e.keyCode<=57||65<=e.keyCode&&e.keyCode<=90||97<=e.keyCode&&e.keyCode<=122||186<=e.keyCode&&e.keyCode<=222||13===e.keyCode||8===e.keyCode||32===e.keyCode||46===e.keyCode||96<=e.keyCode&&e.keyCode<=111)}(e))if(!M.keys.ctrlKey(e)||"b"!==e.key&&"i"!==e.key&&"u"!==e.key){if(M.keys.ctrlKey(e)&&"a"===e.key||M.keys.ctrlKey(e)&&"s"===e.key||M.keys.ctrlKey(e)&&"x"===e.key)return;N(e)}else E()},!0),M.events.on("cut",function(e){if(!M.opts.trackChangesEnabled)return!0;for(var t=M.selection.get().getRangeAt(0).cloneContents(),a="",n="",r=0;r<t.childNodes.length;r++){var i=t.childNodes[r],s=i.outerHTML,l=i.textContent;i.nodeType===Node.TEXT_NODE&&(l=s=i.textContent.replace(/\u200B/g,"")),a+=s,n+=l}M.paste.saveCopiedText(a,n,!0),N(e)},!0),M.events.on("keyup",function(e){if(!M.opts.trackChangesEnabled)return!0;var t;if(M.helpers.isMobile())if(r=null===(t=M.selection.get())||void 0===t||null===(t=t.focusNode)||void 0===t?void 0:t.nodeValue,d){for(var a=0;a<R.length;a++)M.opts.showChangesEnabled&&_(R[a].span).empty(),_(R[a].span).prepend(R[a]["delete"]);d=!(R=[])}else if(M.helpers.isIOS()){for(var n=0;n<R.length;n++)r&&1===r.length&&s&&1==s.length?(_(R[n]["delete"]).attr("contenteditable","true"),_(R[n]["delete"]).addClass("fr-ios-mobile-disable-select")):_(R[n]["delete"]).attr("contenteditable","false");R=[]}else{if(46===e.keyCode)return!0;N(e)}},!0),M.events.on("beforeinput",function(e){var t=e.originalEvent,a=!1;if(!M.opts.trackChangesEnabled)return!0;if(M.helpers.isAndroid()){var n=M.selection.get(),r=M.selection.ranges(0),i=r.startContainer,s=r.endContainer,l=_(i).parentsUntil(M.$el,"[data-tracking=true]"),o=_(s).parentsUntil(M.$el,"[data-tracking=true]");if("insertCompositionText"===t.inputType)if(""===t.data)a=!0;else if(n.toString().length>t.data.length){if(0<l.length||0<o.length)return d=!0,e.preventDefault(),!1;a=!0,e.composing=!0}if("insertText"!==t.inputType||M.selection.isCollapsed()||(a=!0),a||"deleteContentBackward"===t.inputType){var c;if(d=!0,i.lastChild&&!n.toString()&&null!==(c=i.lastChild.children)&&void 0!==c&&null!==(c=c.item(0))&&void 0!==c&&c.hasAttribute("contenteditable"))return;e.keyCode=8,e.deletion=!0,N(e)}}},!0),M.events.on("paste.before",function(e){M.opts.trackChangesEnabled&&M.helpers.isMobile()&&N(e)},!0),M.events.on("paste.after",function(e){if(M.opts.trackChangesEnabled){M.markers.insert();for(var t=M.$el.find(".fr-marker"),a=t.parent().data("tracking")?t.parent():t.parent().find("[data-tracking=true]"),n=a.children().eq(0).is("ul"),r=t.next();r.is("br");)(r=r.next()).prev().remove(),r.next().is("br")&&r.next().remove();if(r.is("ul")){var i=r.find("li");i.find("[data-tracking=true]").addClass("fr-highlight-change");var s=i[0].innerHTML;if(i.html(""),i.insertAfter(t.closest("li")),0==r.parent().find("[data-tracking=true]").length)return void i.append(s);if(r.remove(),a.data("tracking")){var l=a[0].innerHTML;0<l.trim().length&&a.parent().append(l),i.append(a),a.html(s)}else if(!n)return a.insertBefore(a.closest("ul")),void a.next().remove();M.markers.remove(),i.next().length&&i.next().is("li")&&""==i.next().text().trim()&&i.next().remove();var o=i.prev().children().eq(0);o.is("br")&&o.remove()}}},!0),M.events.on("image.inserted",function(e){M.helpers.isMobile()&&M.opts.trackChangesEnabled&&e.data("tracking-img",!0)}),M.events.on("image.removed",function(e){if(M.helpers.isMobile()&&M.opts.trackChangesEnabled&&!e.data("tracking-img")&&!e.parent().data("tracking")){var t=M.selection.ranges(0).startContainer,a=_(t).parentsUntil(M.$el,"[data-tracking=true]");M.markers.insert();var n=M.$el.find(".fr-marker"),r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",s=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),l=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||l.addClass("fr-track-hide"),e.data("tracking-img",!0),_(t).data("tracking")||a.length?(_(n).replaceWith(l),_(l).append(e),M.markers.remove()):(_(n).replaceWith(s),_(s).prepend(l),_(l).append(e),M.markers.remove(),M.track_changes.pushChange(r))}}),M.events.on("commands.before",function(t){if(!M.opts.trackChangesEnabled)return!0;var e=["applytextColor","bold","italic","underline","strikeThrough","subscript","superscript","fontFamily","fontSize","textColor","applybackgroundColor","inlineClass","inlineStyle","alignLeft","alignCenter","formatOLSimple","alignRight","alignJustify","formatOL","formatUL","paragraphFormat","paragraphStyle","lineHeight","outdent","indent","quote"];if(["change","applyAll","applyLast","removeLast","showChanges","trackChanges","moreTrackChanges","undo","redo","fullscreen","print","getPDF","spellChecker","selectAll","html","help"].filter(function(e){return e===t}).length||e.filter(function(e){return e===t}).length){if(e.filter(function(e){return e===t}).length&&"paragraphFormat"!==t&&"paragraphStyle"!==t&&"lineHeight"!==t)E(t);else if("paragraphFormat"===t||"paragraphStyle"===t||"lineHeight"===t){M.selection.save();for(var a=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(n,"></span>")),s=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false" style="display:none"></span>'),l=a.parentNode.cloneNode(!0),o=l.childNodes,c=0;c<o.length;)o[c].className&&"fr-marker"===o[c].className?o[c].remove():c++;_(s).append(l),_(i).append(s),_(a.parentNode).after(_("<p></p>")),_(a.parentNode.nextSibling).append(i),i=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(n,"></span>")),_(a.parentNode.nextSibling).after(_("<p></p>")),_(a.parentNode.nextSibling.nextSibling).append(i),i.append(a.parentNode),M.track_changes.pushChange(r),M.selection.restore()}}else{if(U.COMMANDS[t]&&(U.COMMANDS[t].hasOwnProperty("type")&&"dropdown"===U.COMMANDS[t].type||U.COMMANDS[t].more_btn||U.COMMANDS[t].popup)){if("insertImage"!=t&&"insertFile"!=t)return}else if("clearFormatting"===t){if(M.opts.trackChangesEnabled){S=M.selection.blocks();for(var d=[],g=0,h=0;h<S.length;h++){g=h<g?g:h;var f=_(S[h]);if(f.is("li"))f.siblings("li").each(function(e,t){_(t).find("li").length&&(d.push({index:g,item:t}),g+=1)});C[h]=_("<span>".concat(f.get(0).innerHTML,"</span>"))}for(var p=0,u=d;p<u.length;p++){var k=u[p],m=k.index,b=k.item,v=_(_(b).get(0).outerHTML);v.find("ul").remove(),v.find("ol").remove(),C=[].concat(j(C.slice(0,m+1)),[_("<span>".concat(v.get(0).innerHTML,"</span>"))],j(C.slice(m+1))),S=[].concat(j(S.slice(0,m+1)),[b],j(S.slice(m+1)))}}return}N()}},!0),M.events.on("commands.after",function(e){if(!M.opts.trackChangesEnabled)return!0;if(0<=["undo","redo"].indexOf(e))!function r(){var e=M.$el.find("[data-tracking=true]");i.splice(0,i.length);for(var t=0;t<e.length;t++){var a=_(e.get(t)).data("track-id");i[a.slice(a.lastIndexOf("-")+1)]=a}}();else if("clearFormatting"==e&&M.opts.trackChangesEnabled){var t="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length);for(var a in S){var n=_(S[a]);C[a]&&(c(n,C[a],t),C[a]=null,l[a]=null)}M.track_changes.pushChange(t),C=[],S=null}},!0),M.events.on("quickInsert.commands.before",function(e){M.opts.trackChangesEnabled&&N(e)}),{toggleTracking:function n(){M.opts.trackChangesEnabled&&-1<M.html.get(!0,!0).indexOf("data-tracking")||M.opts.trackChangesEnabled&&0<M.$el.find("[data-tracking=true]").length?alert("Your editor has pending changes. Please resolve them before turning off Track Changes in the toolbar."):(M.commands.moreTrackChanges(),M.opts.trackChangesEnabled=!M.opts.trackChangesEnabled,M.opts.trackChangesEnabled||(M.opts.showChangesEnabled=!1))},pushChange:function h(e){i.push(e)},insertChangeAt:function p(e,t){i=[].concat(j(i.slice(0,e)),[t],j(i.slice(e)))},popChange:o,getPendingChanges:function u(){return i},showChanges:function k(){if(M.opts.showChangesEnabled=!M.opts.showChangesEnabled,function r(e,t){for(var a=0;a<e.length;a++)t?(_(e.get(a)).removeClass("fr-track-hide"),_(e.get(a)).removeClass("fr-track-hide-mobile")):M.helpers.isMobile()?_(e.get(a)).addClass("fr-track-hide-mobile"):_(e.get(a)).addClass("fr-track-hide")}(M.$el.find(".fr-tracking-deleted"),M.opts.showChangesEnabled),M.opts.showChangesEnabled)for(var e=M.$el.find("[data-tracking=true]").not(".fr-highlight-change"),t=0;t<e.length;t++)_(e.get(t)).addClass("fr-highlight-change");else for(var a=M.$el.find(".fr-highlight-change"),n=0;n<a.length;n++)_(a.get(n)).removeClass("fr-highlight-change")},acceptAllChanges:function m(){for(;0!=M.track_changes.getPendingChanges().length;)t();i=[],e(),M.$el.find("li").each(function(){!_(this).children()[0]||"OL"!==_(this).children()[0].tagName&&"UL"!==_(this).children()[0].tagName||e()})},rejectAllChanges:function b(){for(;0!=M.track_changes.getPendingChanges().length;)a();i=[]},acceptSingleChange:t,rejectSingleChange:a,refresh:function v(e){var t=M.$el.find("[data-tracking=true]");e.toggleClass("fr-disabled",!i.length),e.toggleClass("fr-active",i.length).attr("aria-pressed",i.length),0<!t.length&&(e.removeClass("fr-active"),e.addClass("fr-disabled"));var a=M.$tb.find('.fr-command[data-cmd="markdown"]');a&&M.opts.trackChangesEnabled?a.addClass("fr-disabled"):a&&!_(".fr-active.fr-popup").length&&a.removeClass("fr-disabled");var n=M.$tb.find('.fr-command[data-cmd="showChanges"]');n&&M.opts.trackChangesEnabled&&n.removeClass("fr-disabled")},replaceSpecialItem:function y(e){M.selection.setBefore(e.get(0)),M.selection.setAfter(e.get(0)),f(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0))},removeSpecialItem:function x(e){M.selection.setBefore(e.get(0)),M.selection.setAfter(e.get(0)),P(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0))},removedTable:function A(e){var t=!1;if(e.find("[data-tracking=true]").each(function(){0<this.innerText.replace(/\u200B/g,"").length&&(t=!0)}),t)alert("Your table has pending changes. Please resolve them before remove table.");else{var r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",a=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),n=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');e.before(a),e.find("tr").find("> td").each(function(){var e=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),t=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>'),a=_(this),n=a[0].innerText;_(t)[0].innerText=n,a[0].innerText="",e.prepend(t),a.prepend(e)}),n.append(e),a.append(n),M.track_changes.pushChange(r)}},addQuote:function O(e){var t="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),a=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",n=_('<div data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,"></div>")),r=_('<div data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,"></div>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||i.addClass("fr-track-hide"),e.before(r),e.before(n);var s=e.get(0).innerHTML;i.append(s),n.append(i),r.append(e),r.find('[data-tracking="true"]').each(function(e,t){_(t).children().eq(0).insertBefore(_(t)),_(t).remove()}),M.track_changes.pushChange(t)},removeQuote:function D(e,t){if(!(0<t)){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<div data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></div>")),i=_('<div data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></div>")),s=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||s.addClass("fr-track-hide"),e.before(i),e.before(r);var l=e.find("blockQuote").eq(0).html();l||(l=e.html()),s.append(e),r.append(s),i.append(l),i.find('[data-tracking="true"]').each(function(e,t){_(t).children().eq(0).insertBefore(_(t)),_(t).remove()}),M.track_changes.pushChange(a)}},wrapInTracking:function V(e,t){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>"));t&&r.addClass(t);var i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');return M.opts.showChangesEnabled||i.addClass("fr-track-hide"),e.before(r),r.append(e),M.track_changes.pushChange(a),r},wrapInDelete:function B(e){var t=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');return M.opts.showChangesEnabled||(M.helpers.isMobile()?t.addClass("fr-track-hide-mobile"):t.addClass("fr-track-hide")),t.append(e),t},wrapLinkInTracking:function H(e,t){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>"));return e.before(r),r.append(e),M.track_changes.insertChangeAt(t-1,a),r},pasteInEmptyEdior:function K(e){var t=M.$el.find(".fr-highlight-change");_(t)[0].style.display="block",_(t)[0].innerHTML=e},pasteInEdior:function G(e){var t=M.$el.find(".fr-marker");_(t)[0].outerHTML=e,M.markers.remove()}}},U.DefineIcon("trackChanges",{NAME:"enable-tracking",SVG_KEY:"trackChanges"}),U.DefineIcon("showChanges",{NAME:"show-changes",SVG_KEY:"showTrackChanges"}),U.DefineIcon("applyAll",{NAME:"apply-all",SVG_KEY:"acceptAllChanges"}),U.DefineIcon("removeAll",{NAME:"remove-all",SVG_KEY:"rejectAllChanges"}),U.DefineIcon("applyLast",{NAME:"apply-last",SVG_KEY:"acceptSingleChange"}),U.DefineIcon("removeLast",{NAME:"remove-last",SVG_KEY:"rejectSingleChange"}),U.RegisterCommand("trackChanges",{type:"button",title:"Enable Track Changes",plugin:"track_changes",showOnMobile:!0,callback:function(){this.track_changes.toggleTracking()},refreshAfterCallback:!0,forcedRefresh:!0,refresh:function(e){if(e&&this.$tb){var t=this.$tb.find('.fr-more-toolbar[data-name="'.concat(e.attr("id"),'"]')),a=0!==t.length&&t.hasClass("fr-expanded");(this.opts.trackChangesEnabled&&this.opts.toolbarContainer&&!a||!this.opts.trackChangesEnabled&&this.opts.toolbarContainer&&a)&&(this.$tb.find('.fr-more-toolbar[data-name="'.concat(e.attr("id"),'"]')).toggleClass("fr-expanded"),this.$box.toggleClass("fr-toolbar-open"),this.$tb.toggleClass("fr-toolbar-open"),e.toggleClass("fr-open")),e.toggleClass("fr-active",this.opts.trackChangesEnabled).attr("aria-pressed",this.opts.trackChangesEnabled)}}}),U.RegisterCommand("showChanges",{type:"button",icon:"showChanges",title:"Show Changes",plugin:"track_changes",undo:!1,focus:!1,accessibilityFocus:!0,forcedRefresh:!0,refreshAfterCallback:!0,toggle:!0,callback:function(){this.track_changes.showChanges()},refresh:function(e){e.toggleClass("fr-active",this.opts.showChangesEnabled).attr("aria-pressed",this.opts.showChangesEnabled)}}),U.RegisterCommand("applyAll",{type:"button",icon:"applyAll",title:"Accept All Changes",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.acceptAllChanges()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),U.RegisterCommand("removeAll",{type:"button",icon:"removeAll",title:"Reject All Changes",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.rejectAllChanges()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),U.RegisterCommand("applyLast",{type:"button",icon:"applyLast",title:"Accept Single Change",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.acceptSingleChange()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),U.RegisterCommand("removeLast",{type:"button",icon:"removeLast",title:"Reject Single Change",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.rejectSingleChange()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(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(U){"use strict";function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=Array(t);a<t;a++)n[a]=e[a];return n}function F(e){return function t(e){if(Array.isArray(e))return i(e)}(e)||function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function n(e,t){if(e){if("string"==typeof e)return i(e,t);var a={}.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?i(e,t):void 0}}(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.")}()}U=U&&U.hasOwnProperty("default")?U["default"]:U,Object.assign(U.DEFAULTS,{trackChangesEnabled:!1,showChangesEnabled:!1}),U.PLUGINS.track_changes=function(M){var _=M.$;_.fn.isAfter=function(e){var t=_(this),a=t.parents(),n=e.parents(),r=t;for(var i in a){var s=e;if(a.hasOwnProperty(i)){var l=_(a[i]);for(var o in n)if(n.hasOwnProperty(o)){var c=_(n[o]);if(l[0]===c[0]){var d=r.index();return s.index()<d}s=c}r=l}}return!1};var s,r,l=[],I="",w="",T="",L="",C=[],i=[],S=null,P=[],d=!1;function o(){return l.pop()}function N(e){var t=!(!e||8!=e.keyCode),a=e&&13==e.keyCode,n=!(!e||46!=e.keyCode);if(M.opts.trackChangesEnabled){M.selection.restore(),e&&e.composing&&(M.selection.save(),M.selection.ranges()[0].collapse(!1));var r=M.selection.ranges(0).startContainer,i=_(r).parentsUntil(M.$el,"[data-tracking=true]");if(_(r).data("tracking")&&t){M.markers.insert();var s=M.$el.find(".fr-marker");return s[0].previousSibling&&"IMG"===s[0].previousSibling.tagName||M.selection.clear(),void _(s).remove()}if(!i.length||"TD"==r.tagName||a){if(M.selection.isCollapsed()){M.markers.insert();var l=M.$el.find(".fr-marker");if(e&&e.composing&&(l=_(l[1])),!l.length)return;var o="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),c=M.opts.showChangesEnabled?'class="fr-highlight-change"':"";if(t||n){if(t){if(!l[0].previousSibling||l[0].previousSibling.nodeType!==Node.ELEMENT_NODE||!l[0].previousSibling.lastChild||l[0].previousSibling.lastChild.nodeType!==Node.ELEMENT_NODE||"IMG"!==l[0].previousSibling.lastChild.tagName){for(;_(l[0].previousSibling).data("tracking");)l.insertBefore(l.prev());_(l[0].previousSibling).find("[data-tracking=true]").length&&l.insertBefore(_(l[0].previousSibling).find("[data-tracking=true]").eq(0))}}else if(_(r).data("tracking")){if(!r.nextSibling)return void(l[0].nextSibling&&"IMG"===l[0].nextSibling.tagName&&l[0].nextSibling.remove());l.insertBefore(r.nextSibling),R(l)}else R(l);var d=l[0]&&l[0].previousSibling?l[0].previousSibling.nodeValue:"",g=d&&d.slice(0,-(e.selectionLength?e.selectionLength:1));n&&(l[0].nextSibling&&"SPAN"!==l[0].nextSibling.tagName&&null===l[0].nextSibling.nodeValue&&l[0].nextSibling.firstChild&&l[0].nextSibling.firstChild.before(l[0]),g=(d=l[0].nextSibling?l[0].nextSibling.nodeValue:" ")&&d.slice(1)),n&&l[0].nextSibling&&"isPasted"===l[0].nextSibling.id?g=(d=l[0].nextSibling?l[0].nextSibling.textContent:" ")&&d.slice(1):t&&l[0].previousSibling&&"isPasted"===l[0].previousSibling.id&&(g=(d=l[0].previousSibling?l[0].previousSibling.textContent:" ")&&d.slice(0,-(e.selectionLength?e.selectionLength:1)));var h,f=_('<span data-tracking="true" data-track-id="'.concat(o,'" ').concat(c,"></span>")),p=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" '.concat(M.helpers.isIOS()?"":'contenteditable="false"',"></span>"));M.opts.showChangesEnabled||(M.helpers.isMobile()?p.addClass("fr-track-hide-mobile"):p.addClass("fr-track-hide"));var u=!1,k=!1;if(t)try{var m=l[0]&&l[0].previousSibling;if(l[0]&&l[0].previousElementSibling&&"I"===l[0].previousElementSibling.tagName&&!d&&(h=l[0].previousElementSibling),m&&3===m.nodeType&&"SPAN"!==m.parentNode.tagName&&m.previousSibling&&"SPAN"===m.previousSibling.tagName&&" "===m.nodeValue&&0<_(m.previousSibling).find(".fr-emoticon").length?h=m.previousSibling:m&&"SPAN"===m.parentNode.tagName&&0<_(m.parentNode).find(".fr-emoticon").length?(h=m.parentNode,u=!0):m&&("SPAN"===m.tagName&&"isPasted"!==m.id||"HR"===m.tagName)?h=m:_(l).parent().prev().is("hr")?(h=_(l).parent().prev().get(0),u=k=!0):m&&"IMG"===m.tagName&&(h=m,_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),M.helpers.isMobile()&&l[0]&&!h&&!d&&!g)return;u?(_(l[0].parentNode).after(f),k?_(l).parent().remove():_(l).remove()):l[0]?e.composing?_(l).after(f):_(l).before(f):_(L).before(f)}catch(e){L&&_(L).before(f)}else if(n){var b=l[0].nextSibling;l[0].nextElementSibling&&"I"===l[0].nextElementSibling.tagName&&!l[0].nextSibling.nodeValue?h=l[0].nextElementSibling:b&&3===b.nodeType&&"SPAN"!==b.parentNode.tagName&&b.nextSibling&&"SPAN"===b.nextSibling.tagName&&" "===b.nodeValue&&0<_(b.nextSibling).find(".fr-emoticon").length?h=b.nextSibling:b&&"SPAN"===b.parentNode.tagName&&0<_(b.parentNode).find(".fr-emoticon").length?(h=b.parentNode,u=!0):b&&"SPAN"===b.tagName&&l[0].nextSibling&&"isPasted"!==l[0].nextSibling.id?h=b:b&&"IMG"===b.tagName&&(h=b,_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),u?(_(l[0].parentNode).before(f),_(l).remove()):_(l).after(f)}if(e.composing?P.push({span:f,"delete":p}):(M.helpers.isIOS()&&P.push({"delete":p}),_(f).prepend(p)),!h&&(h=d&&d.replace(g,""),M.helpers.isMobile()&&I&&!e.composing)){var v=M.selection.get().focusNode,C=M.selection.get().focusOffset,S=1;w&&v&&w.isSameNode(v)&&(S=T-C),h=I.replace(/\u00a0/g," ").replace(d.replace(/\u00a0/g," "),"").slice(0,S)}if(h&&(u?(_(p).append(_(_(h).get(0).outerHTML)),M.markers.insert()):_(p).append(h)),h&&0==h.length)return;M.browser.msie&&t&&(_(f).prepend("".concat(U.MARKERS)),_(f).append("".concat(U.MARKERS))),t&&(g||""===g)&&l[0].previousSibling?l[0].previousSibling.nodeValue=g:n&&(_(f).append("".concat(U.MARKERS)),l[0].nextSibling.nodeValue=g)}else{var N=U.INVISIBLE_SPACE;if(e&&M.helpers.isMobile()&&((N=l[0]&&l[0].previousSibling&&l[0].previousSibling.nodeValue?l[0].previousSibling.nodeValue.slice(-1):U.INVISIBLE_SPACE)&&l[0]&&l[0].previousSibling&&l[0].previousSibling.nodeValue?l[0].previousSibling.nodeValue=l[0].previousSibling.nodeValue.slice(0,-1):!l[0]||l[0].previousSibling||l[0].nextSibling||N!==U.INVISIBLE_SPACE||(N=M.selection.get().focusNode.nodeValue.slice(T,M.selection.get().focusOffset),M.selection.get().focusNode.nodeValue=M.selection.get().focusNode.nodeValue.slice(M.selection.get().focusOffset))),a){if(l.parent().parent().is("li"))return;var E=_("<p></p>");return void(0<l.closest("p").length&&(l.closest("p").after(E),E.append(l),M.markers.remove(),setTimeout(function(){E.prev().text()!==String.fromCharCode(8203)&&""!==E.prev().text()||E.prev().remove(),M.selection.setAfter(E[0])},1)))}l[0].previousSibling&&"BR"===l[0].previousSibling.tagName&&l[0].previousSibling.remove(),l.replaceWith('<span data-tracking="true" data-track-id="'.concat(o,'" ').concat(c,">").concat(N+U.MARKERS,"</span>"))}M.selection.restore(),M.track_changes.pushChange(o)}else{M.selection.save();var y=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),x=M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0);if(_(y).parent().hasClass("fr-emoticon")&&_(y).parent().before(y),_(y).isAfter(_(x))){var A=y;y=x,x=A}$(y,x,e&&e.deletion),M.selection.restore()}M.helpers.isMobile()&&I&&M.markers.remove()}}}function R(e){if(_(e[0].nextSibling).data("tracking")){for(;_(e[0].nextSibling).data("tracking")&&(!(0<_(e[0].previousElementSibling).find("[data-tracking-deleted=true]").length&&0<_(e[0].nextElementSibling).find("[data-tracking-deleted=true]").length)||_(e[0].previousSibling).data("tracking"));)_(e).insertAfter(e.next());e.insertBefore(e[0].previousSibling)}}function $(e,t){var a=2<arguments.length&&arguments[2]!==undefined&&arguments[2];if(e&&(!e.isSameNode(t)||!_(e).hasClass("fr-marker"))){for(;e.nodeType===Node.COMMENT_NODE;)e=e.nextSibling;if(_(e).parent().is("table")&&0!==_(e).parent().next().text().length&&$(_(e).parent().next()[0],t,a),"TD"!==e.tagName||1!==e.childNodes.length||"BR"!==e.childNodes[0].tagName){if(M.node.isBlock(e)&&"HR"!==e.tagName)return M.node.hasClass(e.firstChild,"fr-marker")?$(e.firstChild.nextSibling,t,a):$(e.firstChild,t,a),!1;if("BR"===e.tagName&&"TD"===e.parentElement.tagName){var n=e.parentElement.nextElementSibling;_(e).remove(),$(n,t)}var r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",s=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),l=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" '.concat(M.helpers.isIOS()?"":'contenteditable="false"',"></span>"));M.opts.showChangesEnabled||(M.helpers.isMobile()?l.addClass("fr-track-hide-mobile"):l.addClass("fr-track-hide"));var o=e;for(_(e).before(s),M.track_changes.pushChange(r);o&&_(o).hasClass("fr-marker");)o=o.nextSibling;for(var c=!1;o&&!c&&!_(o).hasClass("fr-marker")&&!_(o).is("[data-track-id]")&&0===_(o).find("fr-marker").length&&"UL"!==o.tagName&&"OL"!==o.tagName;){var d=o;if("IMG"===o.tagName&&_(o).data("tracking-img","true"),M.node.isBlock(o)&&"HR"!==e.tagName)return $(o.firstChild,t,a),!1;if(o)for(var g=o.childNodes,h=0;h<g.length;h++)if(g[h].className&&"fr-marker"===g[h].className){c=!0,$(o.firstChild,t,a);break}c||(o=o.nextSibling,_(l).append(d))}if(!o||"UL"!==o.tagName&&"OL"!==o.tagName||$(o,t,a),a?P.push({span:s,"delete":l}):(M.helpers.isIOS()&&P.push({"delete":l}),_(s).prepend(l)),M.browser.msie?_(s).prepend("".concat(U.INVISIBLE_SPACE+U.MARKERS)):_(s).prepend("".concat(U.INVISIBLE_SPACE)),_(s).append("".concat(U.INVISIBLE_SPACE+U.MARKERS)),!o&&!e.isSameNode(t)){for(var f=s.get(0).parentNode;f&&!f.nextSibling&&!M.node.isElement(f);)f=f.parentNode;if(f){var p=f.nextSibling;p&&(M.node.isBlock(p)?"HR"===p.tagName?$(p.nextSibling,t,a):(M.browser.mozilla&&"LI"===f.tagName&&"SPAN"===f.lastChild.tagName&&_(f.lastChild).hasClass("fr-marker")&&f.lastChild.remove(),$(p.firstChild,t,a)):$(p,t,a))}}}}}function E(e){if(M.opts.trackChangesEnabled){M.selection.restore();var t=M.selection.ranges(0).startContainer,a=_(t).parentsUntil(M.$el,"[data-tracking=true]");if(_(t).data("tracking"))return;if(!a.length&&!M.selection.isCollapsed()&&"quote"!=e){M.selection.save(),f(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0));var n=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),r=n.parentNode;if(r&&"A"===r.tagName&&r.firstChild&&"SPAN"===r.firstChild.tagName&&2<r.firstChild.childNodes.length&&"STRONG"===r.firstChild.childNodes[3].tagName)_(r.firstChild.childNodes[3].firstChild).before(n);else{for(var i=n.previousSibling.firstChild;i&&"SPAN"!==i.tagName;)i=i.nextSibling;_(i).after(n)}M.selection.restore()}}}function f(e,t,a){if(e&&!("<br>"===_(e).html()&&_(e).parent().is("td")||(_(e).parent().is("table")&&0!==_(e).parent().next().text().length&&f(_(e).parent().next()[0],t,a),_(e).is("br")&&_(e).parent().length&&_(e).parent().is("td")&&0===_(e).parent().text().length))){for(a||(a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),M.track_changes.pushChange(a));e.nodeType===Node.COMMENT_NODE;)e=e.nextSibling;if(M.node.isBlock(e)&&"HR"!==e.tagName)return M.node.hasClass(e.firstChild,"fr-marker")?f(e.firstChild.nextSibling,t,a):f(e.firstChild,t,a),!1;var n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false" style="display:none"></span>'),s=e;for(_(e).before(r);s&&_(s).hasClass("fr-marker");)s=s.nextSibling;for(var l=!1;s&&!l&&!_(s).hasClass("fr-marker")&&0===_(s).find("fr-marker").length&&"UL"!==s.tagName&&"OL"!==s.tagName;){var o=s;if(M.node.isBlock(s)&&"HR"!==e.tagName)return f(s.firstChild,t,a),!1;if(s)for(var c=s.childNodes,d=0;d<c.length;d++)if(c[d].className&&"fr-marker"===c[d].className){l=!0,f(s.firstChild,t,a);break}l||(s=s.nextSibling,_(i).append(o.cloneNode(!0)),_(r).append(o))}if(!s||"UL"!==s.tagName&&"OL"!==s.tagName||f(s,t,a),_(s).hasClass("fr-marker")&&_(r).append(s),_(r).prepend(i),_(r).prepend("".concat(U.INVISIBLE_SPACE)),_(r).append("".concat(U.INVISIBLE_SPACE)),!s&&!e.isSameNode(t)){for(var g=r.get(0).parentNode;g&&!g.nextSibling&&!M.node.isElement(g);)g=g.parentNode;if(g){var h=g.nextSibling;h&&(M.node.isBlock(h)?"HR"===h.tagName?f(h.nextSibling,t,a):f(h.firstChild,t,a):f(h,t,a))}}}}function c(e,t,a){var n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||i.addClass("fr-track-hide"),i.append(t.get(0).innerHTML),r.append(i);var s=e.get(0).innerHTML;e.html(""),e.append(r),r.append(s)}function g(){if(M.events.trigger("image.hideResizer"),M.events.trigger("video.hideResizer"),M.html.cleanEmptyTags(!0),M.helpers.isMobile())for(var e=M.$el.find("img[data-tracking-img]"),t=0;t<e.length;t++){var a=_(e.get(t));a.parent()&&a.parent().data("tracking")||a.removeData("tracking-img")}}function e(){M.$el.find("li").each(function(){0===this.innerText.replace(/\u200B/g,"").length&&this.remove()})}function t(){var e=o();if(e){var t,a=M.$el.find("[data-track-id=".concat(e,"]"));if(a.length){var n=a.parent("a");if(n.length){var r=_(n.get(0).outerHTML).text();1===[].filter.call(r,function(e){return 8203!==e.charCodeAt(0)}).length&&(t=n)}for(var i=0;i<a.length;i++){var s=a.get(i),l=_(a).data("tracking-deleted")?_(a):_(s).find("[data-tracking-deleted=true]");l.length&&(l.get(0).remove?l.get(0).remove():l.get(0).parentNode.removeChild(l.get(0))),s.hasAttribute("style")?(_(s).removeData("tracking"),_(s).removeData("track-id"),_(s).removeClass("fr-highlight-change")):(M.selection.save(),0<_(s).find("IFRAME").length?(_(s).removeData("tracking"),_(s).removeData("track-id"),_(s).removeClass("fr-highlight-change")):s.outerHTML=s.innerHTML,M.selection.restore())}}t&&t.remove()}g()}function a(){var e=o();if(e){var t=M.$el.find("[data-track-id=".concat(e,"]"));if(t.length){M.selection.save();for(var a=t.length-1;0<=a;a--){var n=_(t).data("tracking-deleted")?_(t):_(t.get(a)).find("[data-tracking-deleted=true]");if(n.length)if(0<_(t).find("IFRAME").length)_(t).removeData("tracking"),_(t).removeData("track-id"),_(t).removeClass("fr-highlight-change"),_(t).removeClass("fr-tracking-deleted"),_(t).removeData("tracking-deleted"),_(t).removeAttr("contenteditable");else n.parent("[data-tracking=true]").data("track-id")==e?(_(t.get(a)).find("[data-tracking-deleted=true]").remove(),t.get(a).outerHTML=n.get(0).innerHTML):t.get(a).remove?t.get(a).remove():t.get(a).parentNode.removeChild(t.get(a));else t.get(a).remove?t.get(a).remove():t.get(a).parentNode.removeChild(t.get(a))}M.selection.restore()}}g()}return M.events.on("keydown",function(e){var t;if(!M.opts.trackChangesEnabled)return!0;if(s=null===(t=M.selection.get())||void 0===t||null===(t=t.focusNode)||void 0===t?void 0:t.nodeValue,M.helpers.isAndroid()){var a,n,r=M.selection.get();I=null==r||null===(a=r.focusNode)||void 0===a?void 0:a.nodeValue,w=null==r?void 0:r.focusNode,L=null===(n=w)||void 0===n?void 0:n.nextSibling,T=null==r?void 0:r.focusOffset}else if(function i(e){return(!M.keys.ctrlKey(e)||e.which!==U.KEYCODE.Z&&e.which!==U.KEYCODE.C)&&(48<=e.keyCode&&e.keyCode<=57||65<=e.keyCode&&e.keyCode<=90||97<=e.keyCode&&e.keyCode<=122||186<=e.keyCode&&e.keyCode<=222||13===e.keyCode||8===e.keyCode||32===e.keyCode||46===e.keyCode||96<=e.keyCode&&e.keyCode<=111)}(e))if(!M.keys.ctrlKey(e)||"b"!==e.key&&"i"!==e.key&&"u"!==e.key){if(M.keys.ctrlKey(e)&&"a"===e.key||M.keys.ctrlKey(e)&&"s"===e.key||M.keys.ctrlKey(e)&&"x"===e.key)return;N(e)}else E()},!0),M.events.on("cut",function(e){if(!M.opts.trackChangesEnabled)return!0;for(var t=M.selection.get().getRangeAt(0).cloneContents(),a="",n="",r=0;r<t.childNodes.length;r++){var i=t.childNodes[r],s=i.outerHTML,l=i.textContent;i.nodeType===Node.TEXT_NODE&&(l=s=i.textContent.replace(/\u200B/g,"")),a+=s,n+=l}M.paste.saveCopiedText(a,n,!0),N(e)},!0),M.events.on("keyup",function(e){if(!M.opts.trackChangesEnabled)return!0;var t;if(M.helpers.isMobile())if(r=null===(t=M.selection.get())||void 0===t||null===(t=t.focusNode)||void 0===t?void 0:t.nodeValue,d){for(var a=0;a<P.length;a++)M.opts.showChangesEnabled&&_(P[a].span).empty(),_(P[a].span).prepend(P[a]["delete"]);d=!(P=[])}else if(M.helpers.isIOS()){for(var n=0;n<P.length;n++)r&&1===r.length&&s&&1==s.length?(_(P[n]["delete"]).attr("contenteditable","true"),_(P[n]["delete"]).addClass("fr-ios-mobile-disable-select")):_(P[n]["delete"]).attr("contenteditable","false");P=[]}else{if(46===e.keyCode)return!0;N(e)}},!0),M.events.on("beforeinput",function(e){var t=e.originalEvent,a=!1;if(!M.opts.trackChangesEnabled)return!0;if(M.helpers.isAndroid()){var n=M.selection.get(),r=M.selection.ranges(0),i=r.startContainer,s=r.endContainer,l=_(i).parentsUntil(M.$el,"[data-tracking=true]"),o=_(s).parentsUntil(M.$el,"[data-tracking=true]");if("insertCompositionText"===t.inputType)if(""===t.data)a=!0;else if(n.toString().length>t.data.length){if(0<l.length||0<o.length)return d=!0,e.preventDefault(),!1;a=!0,e.composing=!0}if("insertText"!==t.inputType||M.selection.isCollapsed()||(a=!0),a||"deleteContentBackward"===t.inputType){var c;if(d=!0,i.lastChild&&!n.toString()&&null!==(c=i.lastChild.children)&&void 0!==c&&null!==(c=c.item(0))&&void 0!==c&&c.hasAttribute("contenteditable"))return;e.keyCode=8,e.deletion=!0,N(e)}}},!0),M.events.on("paste.before",function(e){M.opts.trackChangesEnabled&&M.helpers.isMobile()&&N(e)},!0),M.events.on("paste.after",function(e){if(M.opts.trackChangesEnabled){M.markers.insert();for(var t=M.$el.find(".fr-marker"),a=t.next();a.is("br");){var n=a.next();a.remove(),a=n}if(a.is("ul")||a.is("ol")){var r=t.closest("ul, ol"),i=a.children("li");i.find("[data-tracking=true]").add(i.closest("[data-tracking=true]")).addClass("fr-highlight-change");var s=0<a.closest("li").next().length?a.closest("li").next():function o(e){return e.append('<li data-temp-li="true"></li>').find("li").last()}(r);i.each(function(){var e=_(this),t="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),a=M.opts.showChangesEnabled?'class="fr-highlight-change"':"";_('<li><span data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,">").concat(e.html(),"</span></li>")).insertBefore(s),M.track_changes.pushChange(t)});var l=r.find("li[data-temp-li=true");0<l.length&&l.remove(),a.remove()}M.markers.remove()}},!0),M.events.on("image.inserted",function(e){M.helpers.isMobile()&&M.opts.trackChangesEnabled&&e.data("tracking-img",!0)}),M.events.on("image.removed",function(e){if(M.helpers.isMobile()&&M.opts.trackChangesEnabled&&!e.data("tracking-img")&&!e.parent().data("tracking")){var t=M.selection.ranges(0).startContainer,a=_(t).parentsUntil(M.$el,"[data-tracking=true]");M.markers.insert();var n=M.$el.find(".fr-marker"),r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",s=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),l=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||l.addClass("fr-track-hide"),e.data("tracking-img",!0),_(t).data("tracking")||a.length?(_(n).replaceWith(l),_(l).append(e),M.markers.remove()):(_(n).replaceWith(s),_(s).prepend(l),_(l).append(e),M.markers.remove(),M.track_changes.pushChange(r))}}),M.events.on("commands.before",function(t){if(!M.opts.trackChangesEnabled)return!0;var e=["applytextColor","bold","italic","underline","strikeThrough","subscript","superscript","fontFamily","fontSize","textColor","applybackgroundColor","inlineClass","inlineStyle","alignLeft","alignCenter","formatOLSimple","alignRight","alignJustify","formatOL","formatUL","paragraphFormat","paragraphStyle","lineHeight","outdent","indent","quote"];if(["change","applyAll","applyLast","removeLast","showChanges","trackChanges","moreTrackChanges","undo","redo","fullscreen","print","getPDF","spellChecker","selectAll","html","help"].filter(function(e){return e===t}).length||e.filter(function(e){return e===t}).length){if(e.filter(function(e){return e===t}).length&&"paragraphFormat"!==t&&"paragraphStyle"!==t&&"lineHeight"!==t)E(t);else if("paragraphFormat"===t||"paragraphStyle"===t||"lineHeight"===t){M.selection.save();for(var a=M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(n,"></span>")),s=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false" style="display:none"></span>'),l=a.parentNode.cloneNode(!0),o=l.childNodes,c=0;c<o.length;)o[c].className&&"fr-marker"===o[c].className?o[c].remove():c++;_(s).append(l),_(i).append(s),_(a.parentNode).after(_("<p></p>")),_(a.parentNode.nextSibling).append(i),i=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(n,"></span>")),_(a.parentNode.nextSibling).after(_("<p></p>")),_(a.parentNode.nextSibling.nextSibling).append(i),i.append(a.parentNode),M.track_changes.pushChange(r),M.selection.restore()}}else{if(U.COMMANDS[t]&&(U.COMMANDS[t].hasOwnProperty("type")&&"dropdown"===U.COMMANDS[t].type||U.COMMANDS[t].more_btn||U.COMMANDS[t].popup)){if("insertImage"!=t&&"insertFile"!=t)return}else if("clearFormatting"===t){if(M.opts.trackChangesEnabled){S=M.selection.blocks();for(var d=[],g=0,h=0;h<S.length;h++){g=h<g?g:h;var f=_(S[h]);if(f.is("li"))f.siblings("li").each(function(e,t){_(t).find("li").length&&(d.push({index:g,item:t}),g+=1)});C[h]=_("<span>".concat(f.get(0).innerHTML,"</span>"))}for(var p=0,u=d;p<u.length;p++){var k=u[p],m=k.index,b=k.item,v=_(_(b).get(0).outerHTML);v.find("ul").remove(),v.find("ol").remove(),C=[].concat(F(C.slice(0,m+1)),[_("<span>".concat(v.get(0).innerHTML,"</span>"))],F(C.slice(m+1))),S=[].concat(F(S.slice(0,m+1)),[b],F(S.slice(m+1)))}}return}N()}},!0),M.events.on("commands.after",function(e){if(!M.opts.trackChangesEnabled)return!0;if(0<=["undo","redo"].indexOf(e))!function r(){var e=M.$el.find("[data-tracking=true]");l.splice(0,l.length);for(var t=0;t<e.length;t++){var a=_(e.get(t)).data("track-id");l[a.slice(a.lastIndexOf("-")+1)]=a}}();else if("clearFormatting"==e&&M.opts.trackChangesEnabled){var t="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length);for(var a in S){var n=_(S[a]);C[a]&&(c(n,C[a],t),C[a]=null,i[a]=null)}M.track_changes.pushChange(t),C=[],S=null}},!0),M.events.on("quickInsert.commands.before",function(e){M.opts.trackChangesEnabled&&N(e)}),{toggleTracking:function n(){M.opts.trackChangesEnabled&&-1<M.html.get(!0,!0).indexOf("data-tracking")||M.opts.trackChangesEnabled&&0<M.$el.find("[data-tracking=true]").length?alert("Your editor has pending changes. Please resolve them before turning off Track Changes in the toolbar."):(M.commands.moreTrackChanges(),M.opts.trackChangesEnabled=!M.opts.trackChangesEnabled,M.opts.trackChangesEnabled||(M.opts.showChangesEnabled=!1))},pushChange:function h(e){l.push(e)},insertChangeAt:function p(e,t){l=[].concat(F(l.slice(0,e)),[t],F(l.slice(e)))},popChange:o,getPendingChanges:function u(){return l},showChanges:function k(){if(M.opts.showChangesEnabled=!M.opts.showChangesEnabled,function r(e,t){for(var a=0;a<e.length;a++)t?(_(e.get(a)).removeClass("fr-track-hide"),_(e.get(a)).removeClass("fr-track-hide-mobile")):M.helpers.isMobile()?_(e.get(a)).addClass("fr-track-hide-mobile"):_(e.get(a)).addClass("fr-track-hide")}(M.$el.find(".fr-tracking-deleted"),M.opts.showChangesEnabled),M.opts.showChangesEnabled)for(var e=M.$el.find("[data-tracking=true]").not(".fr-highlight-change"),t=0;t<e.length;t++)_(e.get(t)).addClass("fr-highlight-change");else for(var a=M.$el.find(".fr-highlight-change"),n=0;n<a.length;n++)_(a.get(n)).removeClass("fr-highlight-change")},acceptAllChanges:function m(){for(;0!=M.track_changes.getPendingChanges().length;)t();l=[],e(),M.$el.find("li").each(function(){!_(this).children()[0]||"OL"!==_(this).children()[0].tagName&&"UL"!==_(this).children()[0].tagName||e()})},rejectAllChanges:function b(){for(;0!=M.track_changes.getPendingChanges().length;)a();l=[]},acceptSingleChange:t,rejectSingleChange:a,refresh:function v(e){var t,a,n=M.$el.find("[data-tracking=true]");e.toggleClass("fr-disabled",!l.length),e.toggleClass("fr-active",l.length).attr("aria-pressed",l.length),0<!n.length&&(e.removeClass("fr-active"),e.addClass("fr-disabled"));var r=null===(t=M.$tb)||void 0===t?void 0:t.find('.fr-command[data-cmd="markdown"]');r&&M.opts.trackChangesEnabled?r.addClass("fr-disabled"):r&&!_(".fr-active.fr-popup").length&&r.removeClass("fr-disabled");var i=null===(a=M.$tb)||void 0===a?void 0:a.find('.fr-command[data-cmd="showChanges"]');i&&M.opts.trackChangesEnabled&&i.removeClass("fr-disabled")},replaceSpecialItem:function y(e){M.selection.setBefore(e.get(0)),M.selection.setAfter(e.get(0)),f(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0))},removeSpecialItem:function x(e){M.selection.setBefore(e.get(0)),M.selection.setAfter(e.get(0)),$(M.$el.find('.fr-marker[data-type="true"]').length&&M.$el.find('.fr-marker[data-type="true"]').get(0),M.$el.find('.fr-marker[data-type="false"]').length&&M.$el.find('.fr-marker[data-type="false"]').get(0))},removedTable:function A(e){var t=!1;if(e.find("[data-tracking=true]").each(function(){0<this.innerText.replace(/\u200B/g,"").length&&(t=!0)}),t)alert("Your table has pending changes. Please resolve them before remove table.");else{var r="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),i=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",a=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),n=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');e.before(a),e.find("tr").find("> td").each(function(){var e=_('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),t=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>'),a=_(this),n=a[0].innerText;_(t)[0].innerText=n,a[0].innerText="",e.prepend(t),a.prepend(e)}),n.append(e),a.append(n),M.track_changes.pushChange(r)}},addQuote:function O(e){var t="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),a=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",n=_('<div data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,"></div>")),r=_('<div data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,"></div>")),i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||i.addClass("fr-track-hide"),e.before(r),e.before(n);var s=e.get(0).innerHTML;i.append(s),n.append(i),r.append(e),r.find('[data-tracking="true"]').each(function(e,t){_(t).children().eq(0).insertBefore(_(t)),_(t).remove()}),M.track_changes.pushChange(t)},removeQuote:function D(e,t){if(!(0<t)){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<div data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></div>")),i=_('<div data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></div>")),s=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');M.opts.showChangesEnabled||s.addClass("fr-track-hide"),e.before(i),e.before(r);var l=e.find("blockQuote").eq(0).html();l||(l=e.html()),s.append(e),r.append(s),i.append(l),i.find('[data-tracking="true"]').each(function(e,t){_(t).children().eq(0).insertBefore(_(t)),_(t).remove()}),M.track_changes.pushChange(a)}},wrapInTracking:function V(e,t){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>"));t&&r.addClass(t);var i=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');return M.opts.showChangesEnabled||i.addClass("fr-track-hide"),e.before(r),r.append(e),M.track_changes.pushChange(a),r},wrapInDelete:function B(e){var t=_('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');return M.opts.showChangesEnabled||(M.helpers.isMobile()?t.addClass("fr-track-hide-mobile"):t.addClass("fr-track-hide")),t.append(e),t},wrapLinkInTracking:function H(e,t){var a="pending-".concat(M.id,"-").concat(M.track_changes.getPendingChanges().length),n=M.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=_('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>"));return e.before(r),r.append(e),M.track_changes.insertChangeAt(t-1,a),r},pasteInEmptyEdior:function K(e){var t=M.$el.find(".fr-highlight-change");_(t)[0].style.display="block",_(t)[0].innerHTML=e},pasteInEdior:function G(e){var t=M.$el.find(".fr-marker");_(t)[0].outerHTML=e,M.markers.remove()}}},U.DefineIcon("trackChanges",{NAME:"enable-tracking",SVG_KEY:"trackChanges"}),U.DefineIcon("showChanges",{NAME:"show-changes",SVG_KEY:"showTrackChanges"}),U.DefineIcon("applyAll",{NAME:"apply-all",SVG_KEY:"acceptAllChanges"}),U.DefineIcon("removeAll",{NAME:"remove-all",SVG_KEY:"rejectAllChanges"}),U.DefineIcon("applyLast",{NAME:"apply-last",SVG_KEY:"acceptSingleChange"}),U.DefineIcon("removeLast",{NAME:"remove-last",SVG_KEY:"rejectSingleChange"}),U.RegisterCommand("trackChanges",{type:"button",title:"Enable Track Changes",plugin:"track_changes",showOnMobile:!0,callback:function(){this.track_changes.toggleTracking()},refreshAfterCallback:!0,forcedRefresh:!0,refresh:function(e){if(e&&this.$tb){var t=this.$tb.find('.fr-more-toolbar[data-name="'.concat(e.attr("id"),'"]')),a=0!==t.length&&t.hasClass("fr-expanded");(this.opts.trackChangesEnabled&&this.opts.toolbarContainer&&!a||!this.opts.trackChangesEnabled&&this.opts.toolbarContainer&&a)&&(this.$tb.find('.fr-more-toolbar[data-name="'.concat(e.attr("id"),'"]')).toggleClass("fr-expanded"),this.$box.toggleClass("fr-toolbar-open"),this.$tb.toggleClass("fr-toolbar-open"),e.toggleClass("fr-open")),e.toggleClass("fr-active",this.opts.trackChangesEnabled).attr("aria-pressed",this.opts.trackChangesEnabled)}}}),U.RegisterCommand("showChanges",{type:"button",icon:"showChanges",title:"Show Changes",plugin:"track_changes",undo:!1,focus:!1,accessibilityFocus:!0,forcedRefresh:!0,refreshAfterCallback:!0,toggle:!0,callback:function(){this.track_changes.showChanges()},refresh:function(e){e.toggleClass("fr-active",this.opts.showChangesEnabled).attr("aria-pressed",this.opts.showChangesEnabled)}}),U.RegisterCommand("applyAll",{type:"button",icon:"applyAll",title:"Accept All Changes",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.acceptAllChanges()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),U.RegisterCommand("removeAll",{type:"button",icon:"removeAll",title:"Reject All Changes",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.rejectAllChanges()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),U.RegisterCommand("applyLast",{type:"button",icon:"applyLast",title:"Accept Single Change",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.acceptSingleChange()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),U.RegisterCommand("removeLast",{type:"button",icon:"removeLast",title:"Reject Single Change",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.rejectSingleChange()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v4.2.1 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.3.0 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2024 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v4.2.1 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v4.3.0 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2024 Froala Labs
5
5
  */