wysiwyg-rails 4.7.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/froala_editor.min.js +3 -3
  3. data/app/assets/javascripts/froala_editor.pkgd.min.js +3 -3
  4. data/app/assets/javascripts/languages/ar.js +24 -8
  5. data/app/assets/javascripts/languages/bs.js +24 -8
  6. data/app/assets/javascripts/languages/cs.js +24 -8
  7. data/app/assets/javascripts/languages/da.js +24 -8
  8. data/app/assets/javascripts/languages/de.js +23 -8
  9. data/app/assets/javascripts/languages/el.js +24 -8
  10. data/app/assets/javascripts/languages/en_ca.js +24 -8
  11. data/app/assets/javascripts/languages/en_gb.js +24 -8
  12. data/app/assets/javascripts/languages/es.js +24 -8
  13. data/app/assets/javascripts/languages/et.js +24 -8
  14. data/app/assets/javascripts/languages/fa.js +24 -8
  15. data/app/assets/javascripts/languages/fi.js +24 -8
  16. data/app/assets/javascripts/languages/fr.js +26 -9
  17. data/app/assets/javascripts/languages/he.js +18 -12
  18. data/app/assets/javascripts/languages/hr.js +24 -8
  19. data/app/assets/javascripts/languages/hu.js +24 -8
  20. data/app/assets/javascripts/languages/id.js +24 -8
  21. data/app/assets/javascripts/languages/it.js +24 -8
  22. data/app/assets/javascripts/languages/ja.js +24 -8
  23. data/app/assets/javascripts/languages/ko.js +24 -8
  24. data/app/assets/javascripts/languages/ku.js +24 -8
  25. data/app/assets/javascripts/languages/me.js +24 -8
  26. data/app/assets/javascripts/languages/nb.js +24 -8
  27. data/app/assets/javascripts/languages/nl.js +24 -8
  28. data/app/assets/javascripts/languages/pl.js +24 -8
  29. data/app/assets/javascripts/languages/pt_br.js +24 -8
  30. data/app/assets/javascripts/languages/pt_pt.js +24 -8
  31. data/app/assets/javascripts/languages/ro.js +24 -8
  32. data/app/assets/javascripts/languages/ru.js +24 -8
  33. data/app/assets/javascripts/languages/sk.js +24 -8
  34. data/app/assets/javascripts/languages/sl.js +23 -8
  35. data/app/assets/javascripts/languages/sr.js +24 -8
  36. data/app/assets/javascripts/languages/sv.js +24 -8
  37. data/app/assets/javascripts/languages/th.js +24 -8
  38. data/app/assets/javascripts/languages/tr.js +24 -8
  39. data/app/assets/javascripts/languages/uk.js +24 -8
  40. data/app/assets/javascripts/languages/vi.js +23 -8
  41. data/app/assets/javascripts/languages/zh_cn.js +10 -12
  42. data/app/assets/javascripts/languages/zh_tw.js +24 -8
  43. data/app/assets/javascripts/plugins/align.min.js +3 -3
  44. data/app/assets/javascripts/plugins/char_counter.min.js +3 -3
  45. data/app/assets/javascripts/plugins/code_beautifier.min.js +3 -3
  46. data/app/assets/javascripts/plugins/code_snippet.min.js +7 -0
  47. data/app/assets/javascripts/plugins/code_view.min.js +3 -3
  48. data/app/assets/javascripts/plugins/colors.min.js +3 -3
  49. data/app/assets/javascripts/plugins/cryptojs.min.js +3 -3
  50. data/app/assets/javascripts/plugins/draggable.min.js +3 -3
  51. data/app/assets/javascripts/plugins/edit_in_popup.min.js +3 -3
  52. data/app/assets/javascripts/plugins/emoticons.min.js +3 -3
  53. data/app/assets/javascripts/plugins/entities.min.js +3 -3
  54. data/app/assets/javascripts/plugins/export_to_word.min.js +3 -3
  55. data/app/assets/javascripts/plugins/file.min.js +3 -3
  56. data/app/assets/javascripts/plugins/files_manager.min.js +3 -3
  57. data/app/assets/javascripts/plugins/filestack.min.js +3 -3
  58. data/app/assets/javascripts/plugins/find_and_replace.min.js +3 -3
  59. data/app/assets/javascripts/plugins/font_family.min.js +3 -3
  60. data/app/assets/javascripts/plugins/font_size.min.js +3 -3
  61. data/app/assets/javascripts/plugins/forms.min.js +3 -3
  62. data/app/assets/javascripts/plugins/fullscreen.min.js +3 -3
  63. data/app/assets/javascripts/plugins/help.min.js +3 -3
  64. data/app/assets/javascripts/plugins/image.min.js +3 -3
  65. data/app/assets/javascripts/plugins/image_manager.min.js +3 -3
  66. data/app/assets/javascripts/plugins/import_from_word.min.js +7 -0
  67. data/app/assets/javascripts/plugins/inline_class.min.js +3 -3
  68. data/app/assets/javascripts/plugins/inline_style.min.js +3 -3
  69. data/app/assets/javascripts/plugins/line_breaker.min.js +3 -3
  70. data/app/assets/javascripts/plugins/line_height.min.js +3 -3
  71. data/app/assets/javascripts/plugins/link.min.js +3 -3
  72. data/app/assets/javascripts/plugins/link_to_anchor.min.js +3 -3
  73. data/app/assets/javascripts/plugins/lists.min.js +3 -3
  74. data/app/assets/javascripts/plugins/markdown.min.js +3 -3
  75. data/app/assets/javascripts/plugins/page_break.min.js +3 -3
  76. data/app/assets/javascripts/plugins/paragraph_format.min.js +3 -3
  77. data/app/assets/javascripts/plugins/paragraph_style.min.js +3 -3
  78. data/app/assets/javascripts/plugins/print.min.js +3 -3
  79. data/app/assets/javascripts/plugins/quick_insert.min.js +3 -3
  80. data/app/assets/javascripts/plugins/quote.min.js +3 -3
  81. data/app/assets/javascripts/plugins/save.min.js +3 -3
  82. data/app/assets/javascripts/plugins/special_characters.min.js +3 -3
  83. data/app/assets/javascripts/plugins/table.min.js +3 -3
  84. data/app/assets/javascripts/plugins/track_changes.min.js +3 -3
  85. data/app/assets/javascripts/plugins/trim_video.min.js +3 -3
  86. data/app/assets/javascripts/plugins/url.min.js +3 -3
  87. data/app/assets/javascripts/plugins/video.min.js +3 -3
  88. data/app/assets/javascripts/plugins/word_counter.min.js +3 -3
  89. data/app/assets/javascripts/plugins/word_paste.min.js +3 -3
  90. data/app/assets/javascripts/plugins.pkgd.min.js +3 -3
  91. data/app/assets/javascripts/third_party/embedly.min.js +3 -3
  92. data/app/assets/javascripts/third_party/font_awesome.min.js +3 -3
  93. data/app/assets/javascripts/third_party/image_tui.min.js +3 -3
  94. data/app/assets/javascripts/third_party/showdown.min.js +3 -3
  95. data/app/assets/javascripts/third_party/spell_checker.min.js +3 -3
  96. data/app/assets/stylesheets/froala_editor.css +2 -2
  97. data/app/assets/stylesheets/froala_editor.min.css +2 -2
  98. data/app/assets/stylesheets/froala_editor.pkgd.css +111 -4
  99. data/app/assets/stylesheets/froala_editor.pkgd.min.css +3 -3
  100. data/app/assets/stylesheets/froala_style.css +2 -2
  101. data/app/assets/stylesheets/froala_style.min.css +2 -2
  102. data/app/assets/stylesheets/plugins/char_counter.css +2 -2
  103. data/app/assets/stylesheets/plugins/char_counter.min.css +2 -2
  104. data/app/assets/stylesheets/plugins/code_snippet.css +111 -0
  105. data/app/assets/stylesheets/plugins/code_snippet.min.css +7 -0
  106. data/app/assets/stylesheets/plugins/code_view.css +2 -2
  107. data/app/assets/stylesheets/plugins/code_view.min.css +2 -2
  108. data/app/assets/stylesheets/plugins/colors.css +2 -2
  109. data/app/assets/stylesheets/plugins/colors.min.css +2 -2
  110. data/app/assets/stylesheets/plugins/draggable.css +2 -2
  111. data/app/assets/stylesheets/plugins/draggable.min.css +2 -2
  112. data/app/assets/stylesheets/plugins/emoticons.css +2 -2
  113. data/app/assets/stylesheets/plugins/emoticons.min.css +2 -2
  114. data/app/assets/stylesheets/plugins/file.css +2 -2
  115. data/app/assets/stylesheets/plugins/file.min.css +2 -2
  116. data/app/assets/stylesheets/plugins/files_manager.css +2 -2
  117. data/app/assets/stylesheets/plugins/files_manager.min.css +2 -2
  118. data/app/assets/stylesheets/plugins/filestack.css +2 -2
  119. data/app/assets/stylesheets/plugins/filestack.min.css +2 -2
  120. data/app/assets/stylesheets/plugins/find_and_replace.css +2 -2
  121. data/app/assets/stylesheets/plugins/find_and_replace.min.css +2 -2
  122. data/app/assets/stylesheets/plugins/fullscreen.css +2 -2
  123. data/app/assets/stylesheets/plugins/fullscreen.min.css +2 -2
  124. data/app/assets/stylesheets/plugins/help.css +2 -2
  125. data/app/assets/stylesheets/plugins/help.min.css +2 -2
  126. data/app/assets/stylesheets/plugins/image.css +2 -2
  127. data/app/assets/stylesheets/plugins/image.min.css +2 -2
  128. data/app/assets/stylesheets/plugins/image_manager.css +2 -2
  129. data/app/assets/stylesheets/plugins/image_manager.min.css +2 -2
  130. data/app/assets/stylesheets/plugins/line_breaker.css +2 -2
  131. data/app/assets/stylesheets/plugins/line_breaker.min.css +2 -2
  132. data/app/assets/stylesheets/plugins/link_to_anchor.css +2 -2
  133. data/app/assets/stylesheets/plugins/link_to_anchor.min.css +2 -2
  134. data/app/assets/stylesheets/plugins/markdown.css +2 -2
  135. data/app/assets/stylesheets/plugins/markdown.min.css +2 -2
  136. data/app/assets/stylesheets/plugins/page_break.css +3 -3
  137. data/app/assets/stylesheets/plugins/page_break.min.css +3 -3
  138. data/app/assets/stylesheets/plugins/quick_insert.css +2 -2
  139. data/app/assets/stylesheets/plugins/quick_insert.min.css +2 -2
  140. data/app/assets/stylesheets/plugins/special_characters.css +2 -2
  141. data/app/assets/stylesheets/plugins/special_characters.min.css +2 -2
  142. data/app/assets/stylesheets/plugins/table.css +4 -3
  143. data/app/assets/stylesheets/plugins/table.min.css +3 -3
  144. data/app/assets/stylesheets/plugins/trim_video.css +2 -2
  145. data/app/assets/stylesheets/plugins/trim_video.min.css +2 -2
  146. data/app/assets/stylesheets/plugins/video.css +2 -2
  147. data/app/assets/stylesheets/plugins/video.min.css +2 -2
  148. data/app/assets/stylesheets/plugins.pkgd.css +111 -4
  149. data/app/assets/stylesheets/plugins.pkgd.min.css +3 -3
  150. data/app/assets/stylesheets/themes/dark.css +28 -2
  151. data/app/assets/stylesheets/themes/dark.min.css +3 -3
  152. data/app/assets/stylesheets/themes/gray.css +28 -2
  153. data/app/assets/stylesheets/themes/gray.min.css +3 -3
  154. data/app/assets/stylesheets/themes/royal.css +28 -2
  155. data/app/assets/stylesheets/themes/royal.min.css +3 -3
  156. data/app/assets/stylesheets/third_party/embedly.css +2 -2
  157. data/app/assets/stylesheets/third_party/embedly.min.css +2 -2
  158. data/app/assets/stylesheets/third_party/font_awesome.css +2 -2
  159. data/app/assets/stylesheets/third_party/font_awesome.min.css +2 -2
  160. data/app/assets/stylesheets/third_party/image_tui.css +2 -2
  161. data/app/assets/stylesheets/third_party/image_tui.min.css +2 -2
  162. data/app/assets/stylesheets/third_party/spell_checker.css +2 -2
  163. data/app/assets/stylesheets/third_party/spell_checker.min.css +2 -2
  164. data/lib/wysiwyg-rails/version.rb +1 -1
  165. metadata +6 -2
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.7.1 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v5.0.0 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
- * Copyright 2014-2025 Froala Labs
4
+ * Copyright 2014-2026 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(i){"use strict";(i=i&&i.hasOwnProperty("default")?i["default"]:i).PLUGINS.align=function(y){var v=y.$;return{apply:function b(n){var e,t,i=y.selection.ranges(0),l=i.commonAncestorContainer,a=l.nodeType===Node.TEXT_NODE?y.selection.element():l,r=v(a).closest("table.fr-selection-handle-selected"),o=v(a).parents("TD, TH"),s=!y.selection.isCollapsed(),c="TD"===a.tagName||"TH"===a.tagName,g=s&&c,f=g&&(null===(e=a.textContent)||void 0===e?void 0:e.trim())===(null===(t=i.toString())||void 0===t?void 0:t.trim()),h=y.table&&y.table.selectedCells(),u=c||h&&0<h.length||o.length&&y.el.contains(o.get(0))&&"BR"===a.tagName;if(v(a).parents(".fr-img-caption").length)v(a).css("text-align",n);else if(r.length&&y.el.contains(r[0]))r.find("td").css("text-align",n);else if(u&&!g||f)if(h&&h.length)h.forEach(function(e){var t=v(e);t.css("text-align",n),t.children().css("text-align","")});else{var d=["TD","TH"].includes(a.tagName)?v(a):o;d.css("text-align",n),d.children().css("text-align","")}else{y.selection.save(),h&&h.length||y.html.wrap(!0,!0,!0,!0),y.selection.restore();for(var p=y.selection.blocks(),m=0;m<p.length;m++)v(p[m]).css("text-align",n).removeClass("fr-temp-div"),""===v(p[m]).attr("class")&&v(p[m]).removeAttr("class"),""===v(p[m]).attr("style")&&v(p[m]).removeAttr("style");y.selection.save(),y.html.unwrap(),y.selection.restore()}},refresh:function i(e){var t=y.selection.blocks();if(t.length){var n=y.helpers.getAlignment(v(t[0]));e.find("> *").first().replaceWith(y.icon.create("align-".concat(n)))}},refreshOnShow:function l(e,t){var n=y.selection.blocks();if(n.length){var i=y.helpers.getAlignment(v(n[0]));t.find('a.fr-command[data-param1="'.concat(i,'"]')).addClass("fr-active").attr("aria-selected",!0)}},refreshForToolbar:function a(e){var t=y.selection.blocks();if(t.length){var n=y.helpers.getAlignment(v(t[0]));n=n.charAt(0).toUpperCase()+n.slice(1),"align".concat(n)===e.attr("data-cmd")&&e.addClass("fr-active")}}}},i.DefineIcon("align",{NAME:"align-left",SVG_KEY:"alignLeft"}),i.DefineIcon("align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),i.DefineIcon("align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),i.DefineIcon("align-center",{NAME:"align-center",SVG_KEY:"alignCenter"}),i.DefineIcon("align-justify",{NAME:"align-justify",SVG_KEY:"alignJustify"}),i.RegisterCommand("align",{type:"dropdown",title:"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=i.COMMANDS.align.options;for(var n in t)t.hasOwnProperty(n)&&(e+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="align"data-param1="\n '.concat(n,'" title="').concat(this.language.translate(t[n]),'">').concat(this.icon.create("align-".concat(n)),'<span class="fr-sr-only">\n ').concat(this.language.translate(t[n]),"</span></a></li>"));return e+="</ul>"},callback:function(e,t){this.align.apply(t)},refresh:function(e){this.align.refresh(e)},refreshOnShow:function(e,t){this.align.refreshOnShow(e,t)},plugin:"align"}),i.RegisterCommand("alignLeft",{type:"button",icon:"align-left",title:"Align Left",callback:function(){this.align.apply("left")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),i.RegisterCommand("alignRight",{type:"button",icon:"align-right",title:"Align Right",callback:function(){this.align.apply("right")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),i.RegisterCommand("alignCenter",{type:"button",icon:"align-center",title:"Align Center",callback:function(){this.align.apply("center")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),i.RegisterCommand("alignJustify",{type:"button",icon:"align-justify",title:"Align Justify",callback:function(){this.align.apply("justify")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"})});
7
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(("undefined"!=typeof globalThis?globalThis:e||self).FroalaEditor)}(this,function(i){"use strict";i.PLUGINS.align=function(g){var f=g.$;return{apply:function(t){var e=g.selection.ranges(0),n=(n=e.commonAncestorContainer).nodeType===Node.TEXT_NODE?g.selection.element():n,i=f(n).closest("table.fr-selection-handle-selected"),l=f(n).parents("TD, TH"),a=!g.selection.isCollapsed(),r="TD"===n.tagName||"TH"===n.tagName,e=(a=a&&r)&&(null==(o=n.textContent)?void 0:o.trim())===(null==(o=e.toString())?void 0:o.trim()),o=g.table&&g.table.selectedCells(),r=r||o&&0<o.length||l.length&&g.el.contains(l.get(0))&&"BR"===n.tagName;if(f(n).parents(".fr-img-caption").length)f(n).css("text-align",t);else if(i.length&&g.el.contains(i[0]))i.find("td").css("text-align",t);else if(r&&!a||e)o&&o.length?o.forEach(function(e){e=f(e);e.css("text-align",t),e.children().css("text-align","")}):((i=["TD","TH"].includes(n.tagName)?f(n):l).css("text-align",t),i.children().css("text-align",""));else{g.selection.save(),o&&o.length||g.html.wrap(!0,!0,!0,!0),g.selection.restore();for(var s=g.helpers.selectionBlocks([".fr-code-snippet"]),c=0;c<s.length;c++)f(s[c]).css("text-align",t).removeClass("fr-temp-div"),""===f(s[c]).attr("class")&&f(s[c]).removeAttr("class"),""===f(s[c]).attr("style")&&f(s[c]).removeAttr("style");g.selection.save(),g.html.unwrap(),g.selection.restore()}},refresh:function(e){var t=g.selection.blocks();t.length&&(t=g.helpers.getAlignment(f(t[0])),e.find("> *").first().replaceWith(g.icon.create("align-".concat(t))))},refreshOnShow:function(e,t){var n=g.selection.blocks();n.length&&(n=g.helpers.getAlignment(f(n[0])),t.find('a.fr-command[data-param1="'.concat(n,'"]')).addClass("fr-active").attr("aria-selected",!0))},refreshForToolbar:function(e){var t=g.selection.blocks();t.length&&(t=(t=g.helpers.getAlignment(f(t[0]))).charAt(0).toUpperCase()+t.slice(1),"align".concat(t)===e.attr("data-cmd"))&&e.addClass("fr-active")}}},i.DefineIcon("align",{NAME:"align-left",SVG_KEY:"alignLeft"}),i.DefineIcon("align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),i.DefineIcon("align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),i.DefineIcon("align-center",{NAME:"align-center",SVG_KEY:"alignCenter"}),i.DefineIcon("align-justify",{NAME:"align-justify",SVG_KEY:"alignJustify"}),i.RegisterCommand("align",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"Align Center",right:"Align Right",justify:"Align Justify"},html:function(){var e,t='<ul class="fr-dropdown-list" role="presentation">',n=i.COMMANDS.align.options;for(e in n)n.hasOwnProperty(e)&&(t+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="align"data-param1="\n '.concat(e,'" title="').concat(this.language.translate(n[e]),'">').concat(this.icon.create("align-".concat(e)),'<span class="fr-sr-only">\n ').concat(this.language.translate(n[e]),"</span></a></li>"));return t+="</ul>"},callback:function(e,t){this.align.apply(t)},refresh:function(e){this.align.refresh(e)},refreshOnShow:function(e,t){this.align.refreshOnShow(e,t)},plugin:"align"}),i.RegisterCommand("alignLeft",{type:"button",icon:"align-left",title:"Align Left",callback:function(){this.align.apply("left")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),i.RegisterCommand("alignRight",{type:"button",icon:"align-right",title:"Align Right",callback:function(){this.align.apply("right")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),i.RegisterCommand("alignCenter",{type:"button",icon:"align-center",title:"Align Center",callback:function(){this.align.apply("center")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),i.RegisterCommand("alignJustify",{type:"button",icon:"align-justify",title:"Align Justify",callback:function(){this.align.apply("justify")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"})});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.7.1 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v5.0.0 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
- * Copyright 2014-2025 Froala Labs
4
+ * Copyright 2014-2026 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(d){"use strict";d=d&&d.hasOwnProperty("default")?d["default"]:d,Object.assign(d.DEFAULTS,{charCounterMax:-1,charCounterCount:!0}),d.PLUGINS.charCounter=function(s){var n,r=s.$,u=function u(){var e=s.opts.iframe&&s.markdown&&s.markdown.isEnabled()?s.$el.text()||"":s.el.textContent||"",t=s.$el.find(".fr-page-break"),n=(t.text()||"").length;return e.replace(/\u200B/g,"").length-n*t.length};function e(e){var t=s.opts.charCounterMax;if(t<0)return!0;var n=u();if("keydown"===e.type){if(n<t)return!0;var r=e.which;if(!s.keys.ctrlKey(e)&&s.keys.isCharacter(r)||r===d.KEYCODE.IME)return e.preventDefault(),e.stopPropagation(),s.events.trigger("charCounter.exceeded"),!1}var o=e.originalEvent&&e.originalEvent.inputType||"";if(/delete|historyUndo|historyRedo/.test(o))return!0;if("beforeinput"===e.type){var a=e.data||e.originalEvent&&e.originalEvent.data||e.originalEvent&&e.originalEvent.dataTransfer&&e.originalEvent.dataTransfer.getData("text")||"",i=n-s.win.getSelection().toString().length+a.length;if(t-n<=0||t<i)return e.preventDefault(),e.stopPropagation(),s.events.trigger("charCounter.exceeded"),!1}return"input"===e.type&&t<n&&(s.selection.save(),function c(e,t){var n,r="",o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),a=!0;for(;(n=o.nextNode())&&r.length<t;){var i=t-r.length;if(n.textContent.length>i){n.textContent=n.textContent.slice(0,i),a=!1;break}r+=n.textContent}a&&(n=o.previousNode());for(;n=o.nextNode();)n.textContent=""}(s.el,t),s.selection.restore()),!0}function t(e){return s.opts.charCounterMax<0?e:r("<div>").html(e).text().length+u()<=s.opts.charCounterMax?e:(s.events.trigger("charCounter.exceeded"),"")}function o(e,t,n){return s.opts.charCounterMax<0||(e.includes('<span class="fr-emoticon')||e.includes('<i class="fa ')?!(u()>=s.opts.charCounterMax)||(s.events.trigger("charCounter.exceeded"),!1):r("<div>").html(e).text().length+u()<=s.opts.charCounterMax||(s.events.trigger("charCounter.exceeded"),!1))}function a(){if(s.opts.charCounterCount){var e=u()+(0<s.opts.charCounterMax?"/"+s.opts.charCounterMax:"");n.text("".concat(s.language.translate("Characters")," : ").concat(e)),s.opts.toolbarBottom&&n.css("margin-bottom",s.$tb.outerHeight(!0));var t=s.$wp.get(0).offsetWidth-s.$wp.get(0).clientWidth;0<=t&&("rtl"==s.opts.direction?n.css("margin-left",t):n.css("margin-right",t))}}return{_init:function i(){return!!s.$wp&&!!s.opts.charCounterCount&&((n=r(document.createElement("span")).attr("class","fr-counter")).css("bottom",s.$wp.css("border-bottom-width")),s.$second_tb?s.$second_tb.append(n):s.$wp.append(n),s.events.on("keydown beforeinput input",e,!0),s.events.on("paste.afterCleanup",t),s.events.on("keyup contentChanged input",function(){s.events.trigger("charCounter.update")}),s.events.on("html.beforeInsert",o),s.events.on("charCounter.update",a),s.events.trigger("charCounter.update"),void s.events.on("destroy",function(){r(s.o_win).off("resize.char".concat(s.id)),n.removeData().remove(),n=null}))},count:u}}});
7
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(("undefined"!=typeof globalThis?globalThis:e||self).FroalaEditor)}(this,function(f){"use strict";Object.assign(f.DEFAULTS,{charCounterMax:-1,charCounterCount:!0}),f.PLUGINS.charCounter=function(l){var t,d,r=l.$;function e(e){var t=l.opts.charCounterMax;if(!(t<0)){var n=d();if("keydown"===e.type){if(n<t)return!0;var r=e.which;if(!l.keys.ctrlKey(e)&&l.keys.isCharacter(r)||r===f.KEYCODE.IME)return e.preventDefault(),e.stopPropagation(),l.events.trigger("charCounter.exceeded"),!1}r=e.originalEvent&&e.originalEvent.inputType||"";if(!/delete|historyUndo|historyRedo/.test(r)){if("beforeinput"===e.type){r=e.data||e.originalEvent&&e.originalEvent.data||e.originalEvent&&e.originalEvent.dataTransfer&&e.originalEvent.dataTransfer.getData("text")||"",r=n-l.win.getSelection().toString().length+r.length;if(t-n<=0||t<r)return e.preventDefault(),e.stopPropagation(),l.events.trigger("charCounter.exceeded"),!1}if("input"===e.type&&t<n){l.selection.save();for(var o,r=l.el,a=t,i="",s=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,!1),c=!0;(o=s.nextNode())&&i.length<a;){var u=a-i.length;if(o.textContent.length>u){o.textContent=o.textContent.slice(0,u),c=!1;break}i+=o.textContent}for(c&&(o=s.previousNode());o=s.nextNode();)o.textContent="";l.selection.restore()}}}return!0}function n(e){return l.opts.charCounterMax<0||r("<div>").html(e).text().length+d()<=l.opts.charCounterMax?e:(l.events.trigger("charCounter.exceeded"),"")}function o(e,t,n){return l.opts.charCounterMax<0||(e.includes('<span class="fr-emoticon')||e.includes('<i class="fa ')?!(d()>=l.opts.charCounterMax&&(l.events.trigger("charCounter.exceeded"),1)):r("<div>").html(e).text().length+d()<=l.opts.charCounterMax||(l.events.trigger("charCounter.exceeded"),!1))}function a(){var e;l.opts.charCounterCount&&(e=d()+(0<l.opts.charCounterMax?"/"+l.opts.charCounterMax:""),t.text("".concat(l.language.translate("Characters")," : ").concat(e)),l.opts.toolbarBottom&&t.css("margin-bottom",l.$tb.outerHeight(!0)),0<=(e=l.$wp.get(0).offsetWidth-l.$wp.get(0).clientWidth))&&("rtl"==l.opts.direction?t.css("margin-left",e):t.css("margin-right",e))}return{_init:function(){return!!l.$wp&&!!l.opts.charCounterCount&&((t=r(document.createElement("span")).attr("class","fr-counter")).css("bottom",l.$wp.css("border-bottom-width")),(l.$second_tb||l.$wp).append(t),l.events.on("keydown beforeinput input",e,!0),l.events.on("paste.afterCleanup",n),l.events.on("keyup contentChanged input",function(){l.events.trigger("charCounter.update")}),l.events.on("html.beforeInsert",o),l.events.on("charCounter.update",a),l.events.trigger("charCounter.update"),void l.events.on("destroy",function(){r(l.o_win).off("resize.char".concat(l.id)),t.removeData().remove(),t=null}))},count:d=function d(){var e=l.opts.iframe&&l.markdown&&l.markdown.isEnabled()?l.$el.text()||"":l.el.textContent||"",t=l.$el.find(".fr-page-break"),n=(t.text()||"").length;return e.replace(/\u200B/g,"").length-n*t.length}}}});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.7.1 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v5.0.0 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
- * Copyright 2014-2025 Froala Labs
4
+ * Copyright 2014-2026 Froala Labs
5
5
  */
6
6
 
7
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],e):e(t.FroalaEditor)}(this,function(t){"use strict";(t=t&&t.hasOwnProperty("default")?t["default"]:t).PLUGINS.codeBeautifier=function(){var t,e,n,i,Q={};function y(i,t){var e={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},n={"@media":!0,"@supports":!0,"@document":!0};t=t||{},i=(i=i||"").replace(/\r\n|[\r\u2028\u2029]/g,"\n");var r=t.indent_size||4,s=t.indent_char||" ",a=t.selector_separator_newline===undefined||t.selector_separator_newline,_=t.end_with_newline!==undefined&&t.end_with_newline,o=t.newline_between_rules===undefined||t.newline_between_rules,c=t.eol?t.eol:"\n";"string"==typeof r&&(r=parseInt(r,10)),t.indent_with_tabs&&(s="\t",r=1),c=c.replace(/\\r/,"\r").replace(/\\n/,"\n");var l,h=/^\s+$/,u=-1,p=0;function d(){return(l=i.charAt(++u))||""}function f(t){var e,n=u;return t&&E(),e=i.charAt(u+1)||"",u=n-1,d(),e}function T(t){for(var e=u;d();)if("\\"===l)d();else{if(-1!==t.indexOf(l))break;if("\n"===l)break}return i.substring(e,u+1)}function E(){for(var t="";h.test(f());)d(),t+=l;return t}function g(){var t="";for(l&&h.test(l)&&(t=l);h.test(d());)t+=l;return t}function x(t){var e=u;for(t="/"===f(),d();d();){if(!t&&"*"===l&&"/"===f()){d();break}if(t&&"\n"===l)return i.substring(e,u)}return i.substring(e,u)+l}function w(t){return i.substring(u-t.length,u).toLowerCase()===t}function K(){for(var t=0,e=u+1;e<i.length;e++){var n=i.charAt(e);if("{"===n)return!0;if("("===n)t+=1;else if(")"===n){if(0===t)return!1;t-=1}else if(" "===n||"}"===n)return!1}return!1}var R=i.match(/^[\t ]*/)[0],m=new Array(r+1).join(s),b=0,v=0;for(var S,A,k,y={"{":function(t){y.singleSpace(),O.push(t),y.newLine()},"}":function(t){y.newLine(),O.push(t),y.newLine()},_lastCharWhitespace:function(){return h.test(O[O.length-1])},newLine:function(t){O.length&&(t||"\n"===O[O.length-1]||y.trim(),O.push("\n"),R&&O.push(R))},singleSpace:function(){O.length&&!y._lastCharWhitespace()&&O.push(" ")},preserveSingleSpace:function(){S&&y.singleSpace()},trim:function(){for(;y._lastCharWhitespace();)O.pop()}},O=[],N=!1,D=!1,C=!1,L="",I="";;){var V=g();S=""!==V;var P=-1!==V.indexOf("\n");if(I=L,!(L=l))break;if("/"===l&&"*"===f()){var B=0===b;(P||B)&&y.newLine(),O.push(x()),y.newLine(),B&&y.newLine(!0)}else if("/"===l&&"/"===f())P||"{"===I||y.trim(),y.singleSpace(),O.push(x()),y.newLine();else if("@"===l){y.preserveSingleSpace(),O.push(l);var j=(void 0,A=u,k=T(": , {}()[]/='\""),u=A-1,d(),k);j.match(/[ :]$/)&&(d(),j=T(": ").replace(/\s$/,""),O.push(j),y.singleSpace()),(j=j.replace(/\s$/,""))in e&&(v+=1,j in n&&(C=!0))}else"#"===l&&"{"===f()?(y.preserveSingleSpace(),O.push(T("}"))):"{"===l?"}"===f(!0)?(E(),d(),y.singleSpace(),O.push("{}"),y.newLine(),o&&0===b&&y.newLine(!0)):(b++,R+=m,y["{"](l),N=C?(C=!1,v<b):v<=b):"}"===l?(b--,R=R.slice(0,-r),y["}"](l),D=N=!1,v&&v--,o&&0===b&&y.newLine(!0)):":"===l?(E(),!N&&!C||w("&")||K()?":"===f()?(d(),O.push("::")):O.push(":"):(D=!0,O.push(":"),y.singleSpace())):'"'===l||"'"===l?(y.preserveSingleSpace(),O.push(T(l))):" "===l?(D=!1,O.push(l),y.newLine()):"("===l?w("url")?(O.push(l),E(),d()&&(")"!==l&&'"'!==l&&"'"!==l?O.push(T(")")):u--)):(p++,y.preserveSingleSpace(),O.push(l),E()):")"===l?(O.push(l),p--):","===l?(O.push(l),E(),a&&!D&&p<1?y.newLine():y.singleSpace()):("]"===l||("["===l?y.preserveSingleSpace():"="===l?(E(),l="="):y.preserveSingleSpace()),O.push(l))}var M="";return R&&(M+=R),M+=O.join("").replace(/[\r\n\t ]+$/,""),_&&(M+="\n"),"\n"!=c&&(M=M.replace(/[\n]/g,c)),M}function Y(t,e){for(var n=0;n<e.length;n+=1)if(e[n]===t)return!0;return!1}function H(t){return t.replace(/^\s+|\s+$/g,"")}function O(t,e){return new r(t,e).beautify()}t=Q,e="\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc",n=new RegExp("[".concat(e,"]")),i=new RegExp("[".concat(e," ").concat("\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u0620-\u0649\u0672-\u06d3\u06e7-\u06e8\u06fb-\u06fc\u0730-\u074a\u0800-\u0814\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0840-\u0857\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962-\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09d7\u09df-\u09e0\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5f-\u0b60\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2-\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d46-\u0d48\u0d57\u0d62-\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e34-\u0e3a\u0e40-\u0e45\u0e50-\u0e59\u0eb4-\u0eb9\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f41-\u0f47\u0f71-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1029\u1040-\u1049\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u170e-\u1710\u1720-\u1730\u1740-\u1750\u1772\u1773\u1780-\u17b2\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1920-\u192b\u1930-\u193b\u1951-\u196d\u19b0-\u19c0\u19c8-\u19c9\u19d0-\u19d9\u1a00-\u1a15\u1a20-\u1a53\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b46-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1bb0-\u1bb9\u1be6-\u1bf3\u1c00-\u1c22\u1c40-\u1c49\u1c5b-\u1c7d\u1cd0-\u1cd2\u1d00-\u1dbe\u1e01-\u1f15\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2d81-\u2d96\u2de0-\u2dff\u3021-\u3028\u3099\u309a\ua640-\ua66d\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua7f8-\ua800\ua806\ua80b\ua823-\ua827\ua880-\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8f3-\ua8f7\ua900-\ua909\ua926-\ua92d\ua930-\ua945\ua980-\ua983\ua9b3-\ua9c0\uaa00-\uaa27\uaa40-\uaa41\uaa4c-\uaa4d\uaa50-\uaa59\uaa7b\uaae0-\uaae9\uaaf2-\uaaf3\uabc0-\uabe1\uabec\uabed\uabf0-\uabf9\ufb20-\ufb28\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f","]")),t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp("\r\n|".concat(t.newline.source)),t.allLineBreaks=new RegExp(t.lineBreak.source,"g"),t.isIdentifierStart=function(t){return t<65?36===t||64===t:t<91||(t<97?95===t:t<123||170<=t&&n.test(String.fromCharCode(t)))},t.isIdentifierChar=function(t){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||170<=t&&i.test(String.fromCharCode(t))))};var Z={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function r(i,t){var c,r,s,l,a,_,o,h,u,e,n,p,d,f=[],T="";function E(t,e){var n=0;return t&&(n=t.indentation_level,!c.just_added_newline()&&t.line_indent_level>n&&(n=t.line_indent_level)),{mode:e,parent:t,last_text:t?t.last_text:"",last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,line_indent_level:t?t.line_indent_level:n,start_line_index:c.get_line_number(),ternary_depth:0}}for(p={TK_START_EXPR:function L(){O();var t=Z.Expression;if("["===l.text){if("TK_WORD"===a||")"===h.last_text)return"TK_RESERVED"===a&&Y(h.last_text,s.line_starters)&&(c.space_before_token=!0),v(t),m(),b(),void(d.space_in_paren&&(c.space_before_token=!0));t=Z.ArrayLiteral,S(h.mode)&&("["!==h.last_text&&(","!==h.last_text||"]"!==_&&"}"!==_)||d.keep_array_indentation||K())}else"TK_RESERVED"===a&&"for"===h.last_text?t=Z.ForInitializer:"TK_RESERVED"===a&&Y(h.last_text,["if","while"])&&(t=Z.Conditional);" "===h.last_text||"TK_START_BLOCK"===a?K():"TK_END_EXPR"===a||"TK_START_EXPR"===a||"TK_END_BLOCK"===a||"."===h.last_text?w(l.wanted_newline):"TK_RESERVED"===a&&"("===l.text||"TK_WORD"===a||"TK_OPERATOR"===a?"TK_RESERVED"===a&&("function"===h.last_word||"typeof"===h.last_word)||"*"===h.last_text&&"function"===_?d.space_after_anon_function&&(c.space_before_token=!0):"TK_RESERVED"!==a||!Y(h.last_text,s.line_starters)&&"catch"!==h.last_text||d.space_before_conditional&&(c.space_before_token=!0):c.space_before_token=!0;"("===l.text&&"TK_RESERVED"===a&&"await"===h.last_word&&(c.space_before_token=!0);"("===l.text&&("TK_EQUALS"!==a&&"TK_OPERATOR"!==a||y()||w());v(t),m(),d.space_in_paren&&(c.space_before_token=!0);b()},TK_END_EXPR:function I(){for(;h.mode===Z.Statement;)k();h.multiline_frame&&w("]"===l.text&&S(h.mode)&&!d.keep_array_indentation);d.space_in_paren&&("TK_START_EXPR"!==a||d.space_in_empty_paren?c.space_before_token=!0:(c.trim(),c.space_before_token=!1));"]"===l.text&&d.keep_array_indentation?(m(),k()):(k(),m());c.remove_redundant_indentation(u),h.do_while&&u.mode===Z.Conditional&&(u.mode=Z.Expression,h.do_block=!1,h.do_while=!1)},TK_START_BLOCK:function V(){var t=D(1),e=D(2);e&&(":"===e.text&&Y(t.type,["TK_STRING","TK_WORD","TK_RESERVED"])||Y(t.text,["get","set"])&&Y(e.type,["TK_WORD","TK_RESERVED"]))?Y(_,["class","interface"])?v(Z.BlockStatement):v(Z.ObjectLiteral):v(Z.BlockStatement);var n=!t.comments_before.length&&"}"===t.text&&"function"===h.last_word&&"TK_END_EXPR"===a;"expand"===d.brace_style||"none"===d.brace_style&&l.wanted_newline?"TK_OPERATOR"!==a&&(n||"TK_EQUALS"===a||"TK_RESERVED"===a&&N(h.last_text)&&"else"!==h.last_text)?c.space_before_token=!0:K(!1,!0):"TK_OPERATOR"!==a&&"TK_START_EXPR"!==a?"TK_START_BLOCK"===a?K():c.space_before_token=!0:S(u.mode)&&","===h.last_text&&("}"===_?c.space_before_token=!0:K());m(),b()},TK_END_BLOCK:function P(){for(;h.mode===Z.Statement;)k();var t="TK_START_BLOCK"===a;"expand"===d.brace_style?t||K():t||(S(h.mode)&&d.keep_array_indentation?(d.keep_array_indentation=!1,K(),d.keep_array_indentation=!0):K());k(),m()},TK_WORD:C,TK_RESERVED:C,TK_SEMICOLON:function B(){O()&&(c.space_before_token=!1);for(;h.mode===Z.Statement&&!h.if_block&&!h.do_block;)k();m()},TK_STRING:function j(){O()?c.space_before_token=!0:"TK_RESERVED"===a||"TK_WORD"===a?c.space_before_token=!0:"TK_COMMA"===a||"TK_START_EXPR"===a||"TK_EQUALS"===a||"TK_OPERATOR"===a?y()||w():K();m()},TK_EQUALS:function M(){O();h.declaration_statement&&(h.declaration_assignment=!0);c.space_before_token=!0,m(),c.space_before_token=!0},TK_OPERATOR:function U(){O();if("TK_RESERVED"===a&&N(h.last_text))return c.space_before_token=!0,void m();if("*"===l.text&&"TK_DOT"===a)return void m();if(":"===l.text&&h.in_case)return h.case_body=!0,b(),m(),K(),void(h.in_case=!1);if("::"===l.text)return void m();"TK_OPERATOR"===a&&w();var t=!0,e=!0;Y(l.text,["--","++","!","~"])||Y(l.text,["-","+"])&&(Y(a,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||Y(h.last_text,s.line_starters)||","===h.last_text)?(e=t=!1,!l.wanted_newline||"--"!==l.text&&"++"!==l.text||K(!1,!0)," "===h.last_text&&A(h.mode)&&(t=!0),"TK_RESERVED"===a?t=!0:"TK_END_EXPR"===a?t=!("]"===h.last_text&&("--"===l.text||"++"===l.text)):"TK_OPERATOR"===a&&(t=Y(l.text,["--","-","++","+"])&&Y(h.last_text,["--","-","++","+"]),Y(l.text,["+","-"])&&Y(h.last_text,["--","++"])&&(e=!0)),h.mode!==Z.BlockStatement&&h.mode!==Z.Statement||"{"!==h.last_text&&" "!==h.last_text||K()):":"===l.text?0===h.ternary_depth?t=!1:h.ternary_depth-=1:"?"===l.text?h.ternary_depth+=1:"*"===l.text&&"TK_RESERVED"===a&&"function"===h.last_text&&(e=t=!1);c.space_before_token=c.space_before_token||t,m(),c.space_before_token=e},TK_COMMA:function W(){if(h.declaration_statement)return A(h.parent.mode)&&(h.declaration_assignment=!1),m(),void(h.declaration_assignment?K(h.declaration_assignment=!1,!0):(c.space_before_token=!0,d.comma_first&&w()));m(),h.mode===Z.ObjectLiteral||h.mode===Z.Statement&&h.parent.mode===Z.ObjectLiteral?(h.mode===Z.Statement&&k(),K()):(c.space_before_token=!0,d.comma_first&&w())},TK_BLOCK_COMMENT:function z(){if(c.raw)return c.add_raw_token(l),void(l.directives&&"end"===l.directives.preserve&&(d.test_output_raw||(c.raw=!1)));if(l.directives)return K(!1,!0),m(),"start"===l.directives.preserve&&(c.raw=!0),void K(!1,!0);if(!Q.newline.test(l.text)&&!l.wanted_newline)return c.space_before_token=!0,m(),void(c.space_before_token=!0);var t,e=function a(t){var e;t=t.replace(/\x0d/g,"");var n=[];e=t.indexOf("\n");for(;-1!==e;)n.push(t.substring(0,e)),t=t.substring(e+1),e=t.indexOf("\n");t.length&&n.push(t);return n}(l.text),n=!1,i=!1,r=l.whitespace_before,s=r.length;K(!1,!0),1<e.length&&(!function _(t,e){for(var n=0;n<t.length;n++){var i=H(t[n]);if(i.charAt(0)!==e)return!1}return!0}(e.slice(1),"*")?function o(t,e){for(var n,i=0,r=t.length;i<r;i++)if((n=t[i])&&0!==n.indexOf(e))return!1;return!0}(e.slice(1),r)&&(i=!0):n=!0);for(m(e[0]),t=1;t<e.length;t++)K(!1,!0),n?m(" ".concat(e[t].replace(/^\s+/g,""))):i&&e[t].length>s?m(e[t].substring(s)):c.add_token(e[t]);K(!1,!0)},TK_COMMENT:function G(){l.wanted_newline?K(!1,!0):c.trim(!0);c.space_before_token=!0,m(),K(!1,!0)},TK_DOT:function X(){O();"TK_RESERVED"===a&&N(h.last_text)?c.space_before_token=!0:w(")"===h.last_text&&d.break_chained_methods);m()},TK_UNKNOWN:function F(){m(),"\n"===l.text[l.text.length-1]&&K()},TK_EOF:function $(){for(;h.mode===Z.Statement;)k()}},d={},(t=t||{}).braces_on_own_line!==undefined&&(d.brace_style=t.braces_on_own_line?"expand":"collapse"),d.brace_style=t.brace_style?t.brace_style:d.brace_style?d.brace_style:"collapse","expand-strict"===d.brace_style&&(d.brace_style="expand"),d.indent_size=t.indent_size?parseInt(t.indent_size,10):4,d.indent_char=t.indent_char?t.indent_char:" ",d.eol=t.eol?t.eol:"\n",d.preserve_newlines=t.preserve_newlines===undefined||t.preserve_newlines,d.break_chained_methods=t.break_chained_methods!==undefined&&t.break_chained_methods,d.max_preserve_newlines=t.max_preserve_newlines===undefined?0:parseInt(t.max_preserve_newlines,10),d.space_in_paren=t.space_in_paren!==undefined&&t.space_in_paren,d.space_in_empty_paren=t.space_in_empty_paren!==undefined&&t.space_in_empty_paren,d.jslint_happy=t.jslint_happy!==undefined&&t.jslint_happy,d.space_after_anon_function=t.space_after_anon_function!==undefined&&t.space_after_anon_function,d.keep_array_indentation=t.keep_array_indentation!==undefined&&t.keep_array_indentation,d.space_before_conditional=t.space_before_conditional===undefined||t.space_before_conditional,d.unescape_strings=t.unescape_strings!==undefined&&t.unescape_strings,d.wrap_line_length=t.wrap_line_length===undefined?0:parseInt(t.wrap_line_length,10),d.e4x=t.e4x!==undefined&&t.e4x,d.end_with_newline=t.end_with_newline!==undefined&&t.end_with_newline,d.comma_first=t.comma_first!==undefined&&t.comma_first,d.test_output_raw=t.test_output_raw!==undefined&&t.test_output_raw,d.jslint_happy&&(d.space_after_anon_function=!0),t.indent_with_tabs&&(d.indent_char="\t",d.indent_size=1),d.eol=d.eol.replace(/\\r/,"\r").replace(/\\n/,"\n"),o="";0<d.indent_size;)o+=d.indent_char,d.indent_size-=1;var g=0;if(i&&i.length){for(;" "===i.charAt(g)||"\t"===i.charAt(g);)T+=i.charAt(g),g+=1;i=i.substring(g)}function x(t){var e=t.newlines;if(d.keep_array_indentation&&S(h.mode))for(var n=0;n<e;n+=1)K(0<n);else if(d.max_preserve_newlines&&e>d.max_preserve_newlines&&(e=d.max_preserve_newlines),d.preserve_newlines&&1<t.newlines){K();for(var i=1;i<e;i+=1)K(!0)}p[(l=t).type]()}function w(t){if(t=t!==undefined&&t,!c.just_added_newline())if(d.preserve_newlines&&l.wanted_newline||t)K(!1,!0);else if(d.wrap_line_length){c.current_line.get_character_count()+l.text.length+(c.space_before_token?1:0)>=d.wrap_line_length&&K(!1,!0)}}function K(t,e){if(!e&&" "!==h.last_text&&","!==h.last_text&&"="!==h.last_text&&"TK_OPERATOR"!==a)for(;h.mode===Z.Statement&&!h.if_block&&!h.do_block;)k();c.add_new_line(t)&&(h.multiline_frame=!0)}function R(){c.just_added_newline()&&(d.keep_array_indentation&&S(h.mode)&&l.wanted_newline?(c.current_line.push(l.whitespace_before),c.space_before_token=!1):c.set_indent(h.indentation_level)&&(h.line_indent_level=h.indentation_level))}function m(t){c.raw?c.add_raw_token(l):(d.comma_first&&"TK_COMMA"===a&&c.just_added_newline()&&","===c.previous_line.last()&&(c.previous_line.pop(),R(),c.add_token(","),c.space_before_token=!0),t=t||l.text,R(),c.add_token(t))}function b(){h.indentation_level+=1}function v(t){u=h?(e.push(h),h):E(null,t),h=E(u,t)}function S(t){return t===Z.ArrayLiteral}function A(t){return Y(t,[Z.Expression,Z.ForInitializer,Z.Conditional])}function k(){0<e.length&&(u=h,h=e.pop(),u.mode===Z.Statement&&c.remove_redundant_indentation(u))}function y(){return h.parent.mode===Z.ObjectLiteral&&h.mode===Z.Statement&&(":"===h.last_text&&0===h.ternary_depth||"TK_RESERVED"===a&&Y(h.last_text,["get","set"]))}function O(){return!!("TK_RESERVED"===a&&Y(h.last_text,["const","let","const"])&&"TK_WORD"===l.type||"TK_RESERVED"===a&&"do"===h.last_text||"TK_RESERVED"===a&&"return"===h.last_text&&!l.wanted_newline||"TK_RESERVED"===a&&"else"===h.last_text&&("TK_RESERVED"!==l.type||"if"!==l.text)||"TK_END_EXPR"===a&&(u.mode===Z.ForInitializer||u.mode===Z.Conditional)||"TK_WORD"===a&&h.mode===Z.BlockStatement&&!h.in_case&&"--"!==l.text&&"++"!==l.text&&"function"!==_&&"TK_WORD"!==l.type&&"TK_RESERVED"!==l.type||h.mode===Z.ObjectLiteral&&(":"===h.last_text&&0===h.ternary_depth||"TK_RESERVED"===a&&Y(h.last_text,["get","set"])))&&(v(Z.Statement),b(),"TK_RESERVED"===a&&Y(h.last_text,["const","let","const"])&&"TK_WORD"===l.type&&(h.declaration_statement=!0),y()||w("TK_RESERVED"===l.type&&Y(l.text,["do","for","if","while"])),!0)}function N(t){return Y(t,["case","return","do","if","throw","else"])}function D(t){var e=r+(t||0);return e<0||e>=f.length?null:f[e]}function C(){("TK_RESERVED"===l.type&&h.mode!==Z.ObjectLiteral&&Y(l.text,["set","get"])&&(l.type="TK_WORD"),"TK_RESERVED"===l.type&&h.mode===Z.ObjectLiteral)&&(":"===D(1).text&&(l.type="TK_WORD"));if(O()||!l.wanted_newline||A(h.mode)||"TK_OPERATOR"===a&&"--"!==h.last_text&&"++"!==h.last_text||"TK_EQUALS"===a||!d.preserve_newlines&&"TK_RESERVED"===a&&Y(h.last_text,["const","let","const","set","get"])||K(),h.do_block&&!h.do_while){if("TK_RESERVED"===l.type&&"while"===l.text)return c.space_before_token=!0,m(),c.space_before_token=!0,void(h.do_while=!0);K(),h.do_block=!1}if(h.if_block)if(h.else_block||"TK_RESERVED"!==l.type||"else"!==l.text){for(;h.mode===Z.Statement;)k();h.if_block=!1,h.else_block=!1}else h.else_block=!0;if("TK_RESERVED"===l.type&&("case"===l.text||"default"===l.text&&h.in_case_statement))return K(),(h.case_body||d.jslint_happy)&&(!function t(){0<h.indentation_level&&(!h.parent||h.indentation_level>h.parent.indentation_level)&&(h.indentation_level-=1)}(),h.case_body=!1),m(),h.in_case=!0,void(h.in_case_statement=!0);if("TK_RESERVED"===l.type&&"function"===l.text&&((Y(h.last_text,["}"," "])||c.just_added_newline()&&!Y(h.last_text,["[","{",":","=",","]))&&(c.just_added_blankline()||l.comments_before.length||(K(),K(!0))),"TK_RESERVED"===a||"TK_WORD"===a?"TK_RESERVED"===a&&Y(h.last_text,["get","set","new","return","export","async"])?c.space_before_token=!0:"TK_RESERVED"===a&&"default"===h.last_text&&"export"===_?c.space_before_token=!0:K():"TK_OPERATOR"===a||"="===h.last_text?c.space_before_token=!0:(h.multiline_frame||!A(h.mode)&&!S(h.mode))&&K()),"TK_COMMA"!==a&&"TK_START_EXPR"!==a&&"TK_EQUALS"!==a&&"TK_OPERATOR"!==a||y()||w(),"TK_RESERVED"===l.type&&Y(l.text,["function","get","set"]))return m(),void(h.last_word=l.text);(n="NONE","TK_END_BLOCK"===a?"TK_RESERVED"===l.type&&Y(l.text,["else","catch","finally"])?"expand"===d.brace_style||"end-expand"===d.brace_style||"none"===d.brace_style&&l.wanted_newline?n="NEWLINE":(n="SPACE",c.space_before_token=!0):n="NEWLINE":"TK_SEMICOLON"===a&&h.mode===Z.BlockStatement?n="NEWLINE":"TK_SEMICOLON"===a&&A(h.mode)?n="SPACE":"TK_STRING"===a?n="NEWLINE":"TK_RESERVED"===a||"TK_WORD"===a||"*"===h.last_text&&"function"===_?n="SPACE":"TK_START_BLOCK"===a?n="NEWLINE":"TK_END_EXPR"===a&&(c.space_before_token=!0,n="NEWLINE"),"TK_RESERVED"===l.type&&Y(l.text,s.line_starters)&&")"!==h.last_text&&(n="else"===h.last_text||"export"===h.last_text?"SPACE":"NEWLINE"),"TK_RESERVED"===l.type&&Y(l.text,["else","catch","finally"]))?"TK_END_BLOCK"!==a||"expand"===d.brace_style||"end-expand"===d.brace_style||"none"===d.brace_style&&l.wanted_newline?K():(c.trim(!0),"}"!==c.current_line.last()&&K(),c.space_before_token=!0):"NEWLINE"===n?"TK_RESERVED"===a&&N(h.last_text)?c.space_before_token=!0:"TK_END_EXPR"!==a?"TK_START_EXPR"===a&&"TK_RESERVED"===l.type&&Y(l.text,["const","let","const"])||":"===h.last_text||("TK_RESERVED"===l.type&&"if"===l.text&&"else"===h.last_text?c.space_before_token=!0:K()):"TK_RESERVED"===l.type&&Y(l.text,s.line_starters)&&")"!==h.last_text&&K():h.multiline_frame&&S(h.mode)&&","===h.last_text&&"}"===_?K():"SPACE"===n&&(c.space_before_token=!0);m(),h.last_word=l.text,"TK_RESERVED"===l.type&&"do"===l.text&&(h.do_block=!0),"TK_RESERVED"===l.type&&"if"===l.text&&(h.if_block=!0)}a="TK_START_BLOCK",_="",(c=new q(o,T)).raw=d.test_output_raw,e=[],v(Z.BlockStatement),this.beautify=function(){var t,e;for(s=new tt(i,d,o),f=s.tokenize(),r=0;t=D();){for(var n=0;n<t.comments_before.length;n++)x(t.comments_before[n]);x(t),_=h.last_text,a=t.type,h.last_text=t.text,r+=1}return e=c.get_code(),d.end_with_newline&&(e+="\n"),"\n"!=d.eol&&(e=e.replace(/[\n]/g,d.eol)),e}}function s(e){var n=0,i=-1,r=[],s=!0;this.set_indent=function(t){n=e.baseIndentLength+t*e.indent_length,i=t},this.get_character_count=function(){return n},this.is_empty=function(){return s},this.last=function(){return this._empty?null:r[r.length-1]},this.push=function(t){r.push(t),n+=t.length,s=!1},this.pop=function(){var t=null;return s||(t=r.pop(),n-=t.length,s=0===r.length),t},this.remove_indent=function(){0<i&&(i-=1,n-=e.indent_length)},this.trim=function(){for(;" "===this.last();)r.pop(),n-=1;s=0===r.length},this.toString=function(){var t="";return this._empty||(0<=i&&(t=e.indent_cache[i]),t+=r.join("")),t}}function q(e,n){n=n||"",this.indent_cache=[n],this.baseIndentLength=n.length,this.indent_length=e.length,this.raw=!1;var i=[];this.baseIndentString=n,this.indent_string=e,this.previous_line=null,this.current_line=null,this.space_before_token=!1,this.add_outputline=function(){this.previous_line=this.current_line,this.current_line=new s(this),i.push(this.current_line)},this.add_outputline(),this.get_line_number=function(){return i.length},this.add_new_line=function(t){return(1!==this.get_line_number()||!this.just_added_newline())&&(!(!t&&this.just_added_newline())&&(this.raw||this.add_outputline(),!0))},this.get_code=function(){return i.join("\n").replace(/[\r\n\t ]+$/,"")},this.set_indent=function(t){if(1<i.length){for(;t>=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(t),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.add_outputline();this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1},this.add_token=function(t){this.add_space_before_token(),this.current_line.push(t)},this.add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&this.current_line.push(" "),this.space_before_token=!1},this.remove_redundant_indentation=function(t){if(!t.multiline_frame&&t.mode!==Z.ForInitializer&&t.mode!==Z.Conditional)for(var e=t.start_line_index,n=i.length;e<n;)i[e].remove_indent(),e++},this.trim=function(t){for(t=t!==undefined&&t,this.current_line.trim(e,n);t&&1<i.length&&this.current_line.is_empty();)i.pop(),this.current_line=i[i.length-1],this.current_line.trim();this.previous_line=1<i.length?i[i.length-2]:null},this.just_added_newline=function(){return this.current_line.is_empty()},this.just_added_blankline=function(){return!!this.just_added_newline()&&(1===i.length||i[i.length-2].is_empty())}}var J=function J(t,e,n,i,r,s){this.type=t,this.text=e,this.comments_before=[],this.newlines=n||0,this.wanted_newline=0<n,this.whitespace_before=i||"",this.parent=null,this.directives=null};function tt(k,y,t){var O="\n\r\t ".split(""),N=/[0-9]/,D=/[01234567]/,C=/[0123456789abcdefABCDEF]/,L="+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! ~ , : ? ^ ^= |= :: =>".split(" ");this.line_starters="continue,try,throw,return,const,let,const,if,switch,case,default,for,while,break,function,import,export".split(",");var I,V,P,B,j,M,U=this.line_starters.concat(["do","in","else","get","set","new","catch","finally","typeof","yield","async","await"]),W=/([\s\S]*?)((?:\*\/)|$)/g,z=/([^\n\r\u2028\u2029]*)/g,G=/\/\* beautify( \w+[:]\w+)+ \*\//g,X=/ (\w+)[:](\w+)/g,F=/([\s\S]*?)((?:\/\*\sbeautify\signore:end\s\*\/)|$)/g,$=/((<\?php|<\?=)[\s\S]*?\?>)|(<%[\s\S]*?%>)/g;function a(){var t,e,n=[];if(I=0,V="",M<=j)return["","TK_EOF"];e=B.length?B[B.length-1]:new J("TK_START_BLOCK","{");var i=k.charAt(j);for(j+=1;Y(i,O);){if(Q.newline.test(i)?"\n"===i&&"\r"===k.charAt(j-2)||(I+=1,n=[]):n.push(i),M<=j)return["","TK_EOF"];i=k.charAt(j),j+=1}if(n.length&&(V=n.join("")),N.test(i)){var r=!0,s=!0,a=N;for("0"===i&&j<M&&/[Xxo]/.test(k.charAt(j))?(s=r=!1,i+=k.charAt(j),j+=1,a=/[o]/.test(k.charAt(j))?D:C):(i="",j-=1);j<M&&a.test(k.charAt(j));)i+=k.charAt(j),j+=1,r&&j<M&&"."===k.charAt(j)&&(i+=k.charAt(j),j+=1,r=!1),s&&j<M&&/[Ee]/.test(k.charAt(j))&&(i+=k.charAt(j),(j+=1)<M&&/[+-]/.test(k.charAt(j))&&(i+=k.charAt(j),j+=1),r=s=!1);return[i,"TK_WORD"]}if(Q.isIdentifierStart(k.charCodeAt(j-1))){if(j<M)for(;Q.isIdentifierChar(k.charCodeAt(j))&&(i+=k.charAt(j),(j+=1)!==M););return"TK_DOT"===e.type||"TK_RESERVED"===e.type&&Y(e.text,["set","get"])||!Y(i,U)?[i,"TK_WORD"]:"in"===i?[i,"TK_OPERATOR"]:[i,"TK_RESERVED"]}if("("===i||"["===i)return[i,"TK_START_EXPR"];if(")"===i||"]"===i)return[i,"TK_END_EXPR"];if("{"===i)return[i,"TK_START_BLOCK"];if("}"===i)return[i,"TK_END_BLOCK"];if(" "===i)return[i,"TK_SEMICOLON"];if("/"===i){var _="";if("*"===k.charAt(j)){j+=1,W.lastIndex=j;var o=W.exec(k);_="/*".concat(o[0]),j+=o[0].length;var c=function S(t){if(!t.match(G))return null;var e={};X.lastIndex=0;for(var n=X.exec(t);n;)e[n[1]]=n[2],n=X.exec(t);return e}(_);return c&&"start"===c.ignore&&(F.lastIndex=j,_+=(o=F.exec(k))[0],j+=o[0].length),[_=_.replace(Q.lineBreak,"\n"),"TK_BLOCK_COMMENT",c]}if("/"===k.charAt(j)){j+=1,z.lastIndex=j;var l=z.exec(k);return _="//".concat(l[0]),j+=l[0].length,[_,"TK_COMMENT"]}}if("`"===i||"'"===i||'"'===i||("/"===i||y.e4x&&"<"===i&&k.slice(j-1).match(/^<([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/))&&("TK_RESERVED"===e.type&&Y(e.text,["return","case","throw","else","do","typeof","yield"])||"TK_END_EXPR"===e.type&&")"===e.text&&e.parent&&"TK_RESERVED"===e.parent.type&&Y(e.parent.text,["if","while","for"])||Y(e.type,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){var h=i,u=!1,p=!1;if(t=i,"/"===h)for(var d=!1;j<M&&(u||d||k.charAt(j)!==h)&&!Q.newline.test(k.charAt(j));)t+=k.charAt(j),u?u=!1:(u="\\"===k.charAt(j),"["===k.charAt(j)?d=!0:"]"===k.charAt(j)&&(d=!1)),j+=1;else if(y.e4x&&"<"===h){var f=/<(\/?)([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/g,T=k.slice(j-1),E=f.exec(T);if(E&&0===E.index){for(var g=E[2],x=0;E;){var w=!!E[1],K=E[2],R=!!E[E.length-1]||"![CDATA["===K.slice(0,8);if(K!==g||R||(w?--x:++x),x<=0)break;E=f.exec(T)}var m=E?E.index+E[0].length:T.length;return T=T.slice(0,m),j+=m-1,[T=T.replace(Q.lineBreak,"\n"),"TK_STRING"]}}else for(;j<M&&(u||k.charAt(j)!==h&&("`"===h||!Q.newline.test(k.charAt(j))));)(u||"`"===h)&&Q.newline.test(k.charAt(j))?("\r"===k.charAt(j)&&"\n"===k.charAt(j+1)&&(j+=1),t+="\n"):t+=k.charAt(j),u=u?("x"!==k.charAt(j)&&"u"!==k.charAt(j)||(p=!0),!1):"\\"===k.charAt(j),j+=1;if(p&&y.unescape_strings&&(t=function A(t){var e,n=!1,i="",r=0,s="",a=0;for(;n||r<t.length;)if(e=t.charAt(r),r++,n){if(n=!1,"x"===e)s=t.substr(r,2),r+=2;else{if("u"!==e){i+="\\".concat(e);continue}s=t.substr(r,4),r+=4}if(!s.match(/^[0123456789abcdefABCDEF]+$/))return t;if(0<=(a=parseInt(s,16))&&a<32){i+="x"===e?"\\x".concat(s):"\\u".concat(s);continue}if(34===a||39===a||92===a)i+="\\".concat(String.fromCharCode(a));else{if("x"===e&&126<a&&a<=255)return t;i+=String.fromCharCode(a)}}else"\\"===e?n=!0:i+=e;return i}(t)),j<M&&k.charAt(j)===h&&(t+=h,j+=1,"/"===h))for(;j<M&&Q.isIdentifierStart(k.charCodeAt(j));)t+=k.charAt(j),j+=1;return[t,"TK_STRING"]}if("#"===i){if(0===B.length&&"!"===k.charAt(j)){for(t=i;j<M&&"\n"!==i;)t+=i=k.charAt(j),j+=1;return["".concat(H(t),"\n"),"TK_UNKNOWN"]}var b="#";if(j<M&&N.test(k.charAt(j))){for(;b+=i=k.charAt(j),(j+=1)<M&&"#"!==i&&"="!==i;);return"#"===i||("["===k.charAt(j)&&"]"===k.charAt(j+1)?(b+="[]",j+=2):"{"===k.charAt(j)&&"}"===k.charAt(j+1)&&(b+="{}",j+=2)),[b,"TK_WORD"]}}if("<"===i&&("?"===k.charAt(j)||"%"===k.charAt(j))){$.lastIndex=j-1;var v=$.exec(k);if(v)return i=v[0],j+=i.length-1,[i=i.replace(Q.lineBreak,"\n"),"TK_STRING"]}if("<"===i&&"\x3c!--"===k.substring(j-1,j+3)){for(j+=3,i="\x3c!--";!Q.newline.test(k.charAt(j))&&j<M;)i+=k.charAt(j),j++;return P=!0,[i,"TK_COMMENT"]}if("-"===i&&P&&"--\x3e"===k.substring(j-1,j+2))return P=!1,j+=2,["--\x3e","TK_COMMENT"];if("."===i)return[i,"TK_DOT"];if(Y(i,L)){for(;j<M&&Y(i+k.charAt(j),L)&&(i+=k.charAt(j),!(M<=(j+=1))););return","===i?[i,"TK_COMMA"]:"="===i?[i,"TK_EQUALS"]:[i,"TK_OPERATOR"]}return[i,"TK_UNKNOWN"]}this.tokenize=function(){var t,e,n;M=k.length,j=0,P=!1,B=[];for(var i=null,r=[],s=[];!e||"TK_EOF"!==e.type;){for(n=a(),t=new J(n[1],n[0],I,V);"TK_COMMENT"===t.type||"TK_BLOCK_COMMENT"===t.type||"TK_UNKNOWN"===t.type;)"TK_BLOCK_COMMENT"===t.type&&(t.directives=n[2]),s.push(t),n=a(),t=new J(n[1],n[0],I,V);s.length&&(t.comments_before=s,s=[]),"TK_START_BLOCK"===t.type||"TK_START_EXPR"===t.type?(t.parent=e,r.push(i),i=t):("TK_END_BLOCK"===t.type||"TK_END_EXPR"===t.type)&&i&&("]"===t.text&&"["===i.text||")"===t.text&&"("===i.text||"}"===t.text&&"{"===i.text)&&(t.parent=i.parent,i=r.pop()),B.push(t),e=t}return B}}return{run:function N(t,e){function a(t){return t.replace(/\s+$/g,"")}var n,i,r,T,s,_,E,o,c,g,x,w,l,h;for((e=e||{}).wrap_line_length!==undefined&&0!==parseInt(e.wrap_line_length,10)||e.max_char===undefined||0===parseInt(e.max_char,10)||(e.wrap_line_length=e.max_char),i=e.indent_inner_html!==undefined&&e.indent_inner_html,r=e.indent_size===undefined?4:parseInt(e.indent_size,10),T=e.indent_char===undefined?" ":e.indent_char,_=e.brace_style===undefined?"collapse":e.brace_style,s=0===parseInt(e.wrap_line_length,10)?32786:parseInt(e.wrap_line_length||250,10),E=e.unformatted||["a","span","img","bdo","em","strong","dfn","code","samp","kbd","const","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","address","pre"],o=e.preserve_newlines===undefined||e.preserve_newlines,c=o?isNaN(parseInt(e.max_preserve_newlines,10))?32786:parseInt(e.max_preserve_newlines,10):0,g=e.indent_handlebars!==undefined&&e.indent_handlebars,x=e.wrap_attributes===undefined?"auto":e.wrap_attributes,w=e.wrap_attributes_indent_size===undefined?r:parseInt(e.wrap_attributes_indent_size,10)||r,l=e.end_with_newline!==undefined&&e.end_with_newline,h=Array.isArray(e.extra_liners)?e.extra_liners.concat():"string"==typeof e.extra_liners?e.extra_liners.split(","):"head,body,/html".split(","),e.indent_with_tabs&&(T="\t",r=1),(n=new function k(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.newlines=0,this.indent_content=i,this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,source,!doctype,basefont,base,area,hr,wbr,param,img,isindex,embed".split(","),extra_liners:h,in_array:function(t,e){for(var n=0;n<e.length;n++)if(t===e[n])return!0;return!1}},this.is_whitespace=function(t){for(;0<t.length;t++)if(!this.Utils.in_array(t.charAt(0),this.Utils.whitespace))return!1;return!0},this.traverse_whitespace=function(){var t="";if(t=this.input.charAt(this.pos),this.Utils.in_array(t,this.Utils.whitespace)){for(this.newlines=0;this.Utils.in_array(t,this.Utils.whitespace);)o&&"\n"===t&&this.newlines<=c&&(this.newlines+=1),this.pos++,t=this.input.charAt(this.pos);return!0}return!1},this.space_or_wrap=function(t){this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,t),this.print_indentation(t)):(this.line_char_count++,t.push(" "))},this.get_content=function(){for(var t="",e=[];"<"!=this.input.charAt(this.pos);){if(this.pos>=this.input.length)return e.length?e.join(""):["","TK_EOF"];if(this.traverse_whitespace())this.space_or_wrap(e);else{if(g){var n=this.input.substr(this.pos,3);if("{{#"===n||"{{/"===n)break;if("{{!"===n)return[this.get_tag(),"TK_TAG_HANDLEBARS_COMMENT"];if("{{"===this.input.substr(this.pos,2)&&"{{else}}"===this.get_tag(!0))break}t=this.input.charAt(this.pos),this.pos++,this.line_char_count++,e.push(t)}}return e.length?e.join(""):""},this.get_contents_to=function(t){if(this.pos===this.input.length)return["","TK_EOF"];var e="",n=new RegExp("</".concat(t,"\\s*>"),"igm");n.lastIndex=this.pos;var i=n.exec(this.input),r=i?i.index:this.input.length;return this.pos<r&&(e=this.input.substring(this.pos,r),this.pos=r),e},this.record_tag=function(t){this.tags["".concat(t,"count")]?this.tags["".concat(t,"count")]++:this.tags["".concat(t,"count")]=1,this.tags[t+this.tags["".concat(t,"count")]]=this.indent_level,this.tags[t+this.tags["".concat(t,"count")]+"parent"]=this.tags.parent,this.tags.parent=t+this.tags["".concat(t,"count")]},this.retrieve_tag=function(t){if(this.tags["".concat(t,"count")]){for(var e=this.tags.parent;e&&t+this.tags["".concat(t,"count")]!==e;)e=this.tags["".concat(e,"parent")];e&&(this.indent_level=this.tags[t+this.tags["".concat(t,"count")]],this.tags.parent=this.tags[e+"parent"]),delete this.tags[t+this.tags["".concat(t,"count")]+"parent"],delete this.tags[t+this.tags["".concat(t,"count")]],1===this.tags["".concat(t,"count")]?delete this.tags["".concat(t,"count")]:this.tags["".concat(t,"count")]--}},this.indent_to_tag=function(t){if(this.tags["".concat(t,"count")]){for(var e=this.tags.parent;e&&t+this.tags["".concat(t,"count")]!==e;)e=this.tags["".concat(e,"parent")];e&&(this.indent_level=this.tags[t+this.tags["".concat(t,"count")]])}},this.get_tag=function(t){var e,n,i="",r=[],s="",a=!1,_=!0,o=this.pos,c=this.line_char_count;t=t!==undefined&&t;do{if(this.pos>=this.input.length)return t&&(this.pos=o,this.line_char_count=c),r.length?r.join(""):["","TK_EOF"];if(i=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(i,this.Utils.whitespace))a=!0;else{if("'"!==i&&'"'!==i||(i+=this.get_unformatted(i),a=!0),"="===i&&(a=!1),r.length&&"="!=r[r.length-1]&&">"!=i&&a){if(this.space_or_wrap(r),a=!1,!_&&"force"===x&&"/"!=i){this.print_newline(!0,r),this.print_indentation(r);for(var l=0;l<w;l++)r.push(T)}for(var h=0;h<r.length;h++)if(" "===r[h]){_=!1;break}}if(g&&"<"===n&&i+this.input.charAt(this.pos)==="{{"&&(i+=this.get_unformatted("}}"),r.length&&" "!=r[r.length-1]&&"<"!=r[r.length-1]&&(i=" ".concat(i)),a=!0),"<"!==i||n||(e=this.pos-1,n="<"),g&&!n&&2<=r.length&&"{"===r[r.length-1]&&"{"===r[r.length-2]&&(e="#"===i||"/"===i||"!"===i?this.pos-3:this.pos-2,n="{"),this.line_char_count++,r.push(i),r[1]&&("!"===r[1]||"?"===r[1]||"%"===r[1])){r=[this.get_comment(e)];break}if(g&&r[1]&&"{"===r[1]&&r[2]&&"!"===r[2]){r=[this.get_comment(e)];break}if(g&&"{"===n&&2<r.length&&"}"===r[r.length-2]&&"}"===r[r.length-1])break}}while(">"!=i);var u,p,d=r.join("");u=-1!=d.indexOf(" ")?d.indexOf(" "):"{"===d[0]?d.indexOf("}"):d.indexOf(">"),p="<"!==d[0]&&g?"#"===d[2]?3:2:1;var f=d.substring(p,u).toLowerCase();return"/"===d.charAt(d.length-2)||this.Utils.in_array(f,this.Utils.single_token)?t||(this.tag_type="SINGLE"):g&&"{"===d[0]&&"else"===f?t||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):this.is_unformatted(f,E)?(s=this.get_unformatted("</".concat(f,">"),d),r.push(s),this.pos,this.tag_type="SINGLE"):"script"===f&&(-1===d.search("type")||-1<d.search("type")&&-1<d.search(/\b(text|application)\/(x-)?(javascript|ecmascript|jscript|livescript)/))?t||(this.record_tag(f),this.tag_type="SCRIPT"):"style"===f&&(-1===d.search("type")||-1<d.search("type")&&-1<d.search("text/css"))?t||(this.record_tag(f),this.tag_type="STYLE"):"!"===f.charAt(0)?t||(this.tag_type="SINGLE",this.traverse_whitespace()):t||("/"===f.charAt(0)?(this.retrieve_tag(f.substring(1)),this.tag_type="END"):(this.record_tag(f),"html"!=f.toLowerCase()&&(this.indent_content=!0),this.tag_type="START"),this.traverse_whitespace()&&this.space_or_wrap(r),this.Utils.in_array(f,this.Utils.extra_liners)&&(this.print_newline(!1,this.output),this.output.length&&"\n"!=this.output[this.output.length-2]&&this.print_newline(!0,this.output))),t&&(this.pos=o,this.line_char_count=c),r.join("")},this.get_comment=function(t){var e="",n=">",i=!1;this.pos=t;var r=this.input.charAt(this.pos);for(this.pos++;this.pos<=this.input.length&&((e+=r)[e.length-1]!==n[n.length-1]||-1==e.indexOf(n));)!i&&e.length<10&&(0===e.indexOf("<![if")?(n="<![endif]>",i=!0):0===e.indexOf("<![cdata[")?(n="]]>",i=!0):0===e.indexOf("<![")?(n="]>",i=!0):0===e.indexOf("\x3c!--")?(n="--\x3e",i=!0):0===e.indexOf("{{!")?(n="}}",i=!0):0===e.indexOf("<?")?(n="?>",i=!0):0===e.indexOf("<%")&&(n="%>",i=!0)),r=this.input.charAt(this.pos),this.pos++;return e},this.get_unformatted=function(t,e){if(e&&-1!=e.toLowerCase().indexOf(t))return"";var n="",i="",r=!0,s="";do{if(this.pos>=this.input.length)return i;if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace)){if(!r){this.line_char_count--;continue}if("\n"===n||"\r"===n){i+="\n",this.line_char_count=0;continue}}i+=n,(s+=n.toLowerCase()).length>t.length&&(s=s.substring(1)),this.line_char_count++,r=!0,g&&"{"===n&&i.length&&"{"===i[i.length-2]&&(i+=this.get_unformatted("}}"))}while(s!==t);return i},this.get_token=function(){var t;if("TK_TAG_SCRIPT"!==this.last_token&&"TK_TAG_STYLE"!==this.last_token)return"CONTENT"===this.current_mode?"string"!=typeof(t=this.get_content())?t:[t,"TK_CONTENT"]:"TAG"===this.current_mode?"string"!=typeof(t=this.get_tag())?t:[t,"TK_TAG_".concat(this.tag_type)]:void 0;var e=this.last_token.substr(7);return"string"!=typeof(t=this.get_contents_to(e))?t:[t,"TK_".concat(e)]},this.get_full_indent=function(t){return(t=this.indent_level+t||0)<1?"":new Array(t+1).join(this.indent_string)},this.is_unformatted=function(t,e){if(!this.Utils.in_array(t,e))return!1;if("a"!=t.toLowerCase()||!this.Utils.in_array("a",e))return!0;var n=(this.get_tag(!0)||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/);return!(n&&!this.Utils.in_array(n,e))},this.printer=function(t,e,n,i,r){this.input=t||"",this.output=[],this.indent_character=e,this.indent_string="",this.indent_size=n,this.brace_style=r,this.indent_level=0,this.wrap_line_length=i;for(var s=this.line_char_count=0;s<this.indent_size;s++)this.indent_string+=this.indent_character;this.print_newline=function(t,e){this.line_char_count=0,e&&e.length&&(t||"\n"!=e[e.length-1])&&("\n"!=e[e.length-1]&&(e[e.length-1]=a(e[e.length-1])),e.push("\n"))},this.print_indentation=function(t){for(var e=0;e<this.indent_level;e++)t.push(this.indent_string),this.line_char_count+=this.indent_string.length},this.print_token=function(t){this.is_whitespace(t)&&!this.output.length||((t||""!==t)&&this.output.length&&"\n"===this.output[this.output.length-1]&&(this.print_indentation(this.output),t=function e(t){return t.replace(/^\s+/g,"")}(t)),this.print_token_raw(t))},this.print_token_raw=function(t){0<this.newlines&&(t=a(t)),t&&""!==t&&(1<t.length&&"\n"===t[t.length-1]?(this.output.push(t.slice(0,-1)),this.print_newline(!1,this.output)):this.output.push(t));for(var e=0;e<this.newlines;e++)this.print_newline(0<e,this.output);this.newlines=0},this.indent=function(){this.indent_level++},this.unindent=function(){0<this.indent_level&&this.indent_level--}},this}).printer(t,T,r,s,_);;){var u=n.get_token();if(n.token_text=u[0],n.token_type=u[1],"TK_EOF"===n.token_type)break;switch(n.token_type){case"TK_TAG_START":n.print_newline(!1,n.output),n.print_token(n.token_text),n.indent_content&&(n.indent(),n.indent_content=!1),n.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"===n.last_token&&""===n.last_text){var p=n.token_text.match(/\w+/)[0],d=null;n.output.length&&(d=n.output[n.output.length-1].match(/(?:<|{{#)\/?\s*(\w+)/)),(null===d||d[1]!=p&&!n.Utils.in_array(d[1],E))&&n.print_newline(!1,n.output)}n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var f=n.token_text.match(/^\s*<([a-z-]+)/i);f&&n.Utils.in_array(f[1],E)||n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_ELSE":n.print_token(n.token_text),n.indent_content&&(n.indent(),n.indent_content=!1),n.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_COMMENT":case"TK_CONTENT":n.print_token(n.token_text),n.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==n.token_text){n.print_newline(!1,n.output);var K=n.token_text,R=void 0,m=1;"TK_SCRIPT"===n.token_type?R=O:"TK_STYLE"===n.token_type&&(R=y),"keep"===e.indent_scripts?m=0:"separate"===e.indent_scripts&&(m=-n.indent_level);var b=n.get_full_indent(m);if(R)K=R(K.replace(/^\s*/,b),e);else{var v=K.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(n.indent_string).length-1,S=n.get_full_indent(m-v);K=K.replace(/^\s*/,b).replace(/\r\n|\r|\n/g,"\n"+S).replace(/\s+$/,"")}K&&(n.print_token_raw(K),n.print_newline(!0,n.output))}n.current_mode="TAG";break;default:""!==n.token_text&&n.print_token(n.token_text)}n.last_token=n.token_type,n.last_text=n.token_text}var A=n.output.join("").replace(/[\r\n\t ]+$/,"");return l&&(A+="\n"),A}}}});
7
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],e):e(("undefined"!=typeof globalThis?globalThis:t||self).FroalaEditor)}(this,function(t){"use strict";t.PLUGINS.codeBeautifier=function(){var t,e,n,i,z={};function m(i,t){var n,e={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},r={"@media":!0,"@supports":!0,"@document":!0},s=(t=t||{},i=(i=i||"").replace(/\r\n|[\r\u2028\u2029]/g,"\n"),t.indent_size||4),_=t.indent_char||" ",a=t.selector_separator_newline===undefined||t.selector_separator_newline,o=t.end_with_newline!==undefined&&t.end_with_newline,c=t.newline_between_rules===undefined||t.newline_between_rules,l=t.eol||"\n",h=("string"==typeof s&&(s=parseInt(s,10)),t.indent_with_tabs&&(_="\t",s=1),l=l.replace(/\\r/,"\r").replace(/\\n/,"\n"),/^\s+$/),p=-1,u=0;function d(){return(n=i.charAt(++p))||""}function f(t){var e=p;return t&&E(),t=i.charAt(p+1)||"",p=e-1,d(),t}function T(t){for(var e=p;d();)if("\\"===n)d();else{if(-1!==t.indexOf(n))break;if("\n"===n)break}return i.substring(e,p+1)}function E(){for(;h.test(f());)d(),0}function g(t){var e=p;for(t="/"===f(),d();d();){if(!t&&"*"===n&&"/"===f()){d();break}if(t&&"\n"===n)return i.substring(e,p)}return i.substring(e,p)+n}function w(t){return i.substring(p-t.length,p).toLowerCase()===t}var x=i.match(/^[\t ]*/)[0],K=new Array(s+1).join(_),R=0,m=0;for(var b={"{":function(t){b.singleSpace(),S.push(t),b.newLine()},"}":function(t){b.newLine(),S.push(t),b.newLine()},_lastCharWhitespace:function(){return h.test(S[S.length-1])},newLine:function(t){S.length&&(t||"\n"===S[S.length-1]||b.trim(),S.push("\n"),x)&&S.push(x)},singleSpace:function(){S.length&&!b._lastCharWhitespace()&&S.push(" ")},preserveSingleSpace:function(){D&&b.singleSpace()},trim:function(){for(;b._lastCharWhitespace();)S.pop()}},S=[],A=!1,k=!1,y=!1,O="";;){var v,N=function(){var t="";for(n&&h.test(n)&&(t=n);h.test(d());)t+=n;return t}(),D=""!==N,N=-1!==N.indexOf("\n"),C=O,O=n;if(!n)break;"/"===n&&"*"===f()?(v=0===R,(N||v)&&b.newLine(),S.push(g()),b.newLine(),v&&b.newLine(!0)):"/"===n&&"/"===f()?(N||"{"===C||b.trim(),b.singleSpace(),S.push(g()),b.newLine()):"@"===n?(b.preserveSingleSpace(),S.push(n),v=void 0,v=p,N=T(N=": , {}()[]/='\""),p=v-1,d(),(C=N).match(/[ :]$/)&&(d(),C=T(": ").replace(/\s$/,""),S.push(C),b.singleSpace()),(C=C.replace(/\s$/,""))in e&&(m+=1,C in r)&&(y=!0)):"#"===n&&"{"===f()?(b.preserveSingleSpace(),S.push(T("}"))):"{"===n?"}"===f(!0)?(E(),d(),b.singleSpace(),S.push("{}"),b.newLine(),c&&0===R&&b.newLine(!0)):(R++,x+=K,b["{"](n),A=y?(y=!1,m<R):m<=R):"}"===n?(R--,x=x.slice(0,-s),b["}"](n),k=A=!1,m&&m--,c&&0===R&&b.newLine(!0)):":"===n?(E(),!A&&!y||w("&")||function(){for(var t=0,e=p+1;e<i.length;e++){var n=i.charAt(e);if("{"===n)return 1;if("("===n)t+=1;else if(")"===n){if(0===t)return;--t}else if(" "===n||"}"===n)return}}()?":"===f()?(d(),S.push("::")):S.push(":"):(k=!0,S.push(":"),b.singleSpace())):'"'===n||"'"===n?(b.preserveSingleSpace(),S.push(T(n))):" "===n?(k=!1,S.push(n),b.newLine()):"("===n?w("url")?(S.push(n),E(),d()&&(")"!==n&&'"'!==n&&"'"!==n?S.push(T(")")):p--)):(u++,b.preserveSingleSpace(),S.push(n),E()):")"===n?(S.push(n),u--):","===n?(S.push(n),E(),a&&!k&&u<1?b.newLine():b.singleSpace()):("]"!==n&&("["!==n&&"="===n?(E(),n="="):b.preserveSingleSpace()),S.push(n))}t="";return x&&(t+=x),t+=S.join("").replace(/[\r\n\t ]+$/,""),o&&(t+="\n"),t="\n"!=l?t.replace(/[\n]/g,l):t}function G(t,e){for(var n=0;n<e.length;n+=1)if(e[n]===t)return!0;return!1}function X(t){return t.replace(/^\s+|\s+$/g,"")}function b(t,e){return new r(t,e).beautify()}t=z,e="\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc",n=new RegExp("[".concat(e,"]")),i=new RegExp("[".concat(e," ").concat("\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u0620-\u0649\u0672-\u06d3\u06e7-\u06e8\u06fb-\u06fc\u0730-\u074a\u0800-\u0814\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0840-\u0857\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962-\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09d7\u09df-\u09e0\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5f-\u0b60\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2-\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d46-\u0d48\u0d57\u0d62-\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e34-\u0e3a\u0e40-\u0e45\u0e50-\u0e59\u0eb4-\u0eb9\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f41-\u0f47\u0f71-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1029\u1040-\u1049\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u170e-\u1710\u1720-\u1730\u1740-\u1750\u1772\u1773\u1780-\u17b2\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1920-\u192b\u1930-\u193b\u1951-\u196d\u19b0-\u19c0\u19c8-\u19c9\u19d0-\u19d9\u1a00-\u1a15\u1a20-\u1a53\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b46-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1bb0-\u1bb9\u1be6-\u1bf3\u1c00-\u1c22\u1c40-\u1c49\u1c5b-\u1c7d\u1cd0-\u1cd2\u1d00-\u1dbe\u1e01-\u1f15\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2d81-\u2d96\u2de0-\u2dff\u3021-\u3028\u3099\u309a\ua640-\ua66d\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua7f8-\ua800\ua806\ua80b\ua823-\ua827\ua880-\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8f3-\ua8f7\ua900-\ua909\ua926-\ua92d\ua930-\ua945\ua980-\ua983\ua9b3-\ua9c0\uaa00-\uaa27\uaa40-\uaa41\uaa4c-\uaa4d\uaa50-\uaa59\uaa7b\uaae0-\uaae9\uaaf2-\uaaf3\uabc0-\uabe1\uabec\uabed\uabf0-\uabf9\ufb20-\ufb28\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f","]")),t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp("\r\n|".concat(t.newline.source)),t.allLineBreaks=new RegExp(t.lineBreak.source,"g"),t.isIdentifierStart=function(t){return t<65?36===t||64===t:t<91||(t<97?95===t:t<123||170<=t&&n.test(String.fromCharCode(t)))},t.isIdentifierChar=function(t){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||170<=t&&i.test(String.fromCharCode(t))))};var L={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function r(i,t){var _,r,s,a,o,c,e,l,n,h,p,u,d,f=[],T="";function E(t,e){var n=0;return t&&(n=t.indentation_level,!_.just_added_newline())&&t.line_indent_level>n&&(n=t.line_indent_level),{mode:e,parent:t,last_text:t?t.last_text:"",last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,line_indent_level:t?t.line_indent_level:n,start_line_index:_.get_line_number(),ternary_depth:0}}for(u={TK_START_EXPR:function(){v();var t=L.Expression;if("["===a.text){if("TK_WORD"===o||")"===l.last_text)return"TK_RESERVED"===o&&G(l.last_text,s.line_starters)&&(_.space_before_token=!0),S(t),m(),b(),void(d.space_in_paren&&(_.space_before_token=!0));t=L.ArrayLiteral,!A(l.mode)||"["!==l.last_text&&(","!==l.last_text||"]"!==c&&"}"!==c)||d.keep_array_indentation||K()}else"TK_RESERVED"===o&&"for"===l.last_text?t=L.ForInitializer:"TK_RESERVED"===o&&G(l.last_text,["if","while"])&&(t=L.Conditional);" "===l.last_text||"TK_START_BLOCK"===o?K():"TK_END_EXPR"===o||"TK_START_EXPR"===o||"TK_END_BLOCK"===o||"."===l.last_text?x(a.wanted_newline):"TK_RESERVED"===o&&"("===a.text||"TK_WORD"===o||"TK_OPERATOR"===o?"TK_RESERVED"===o&&("function"===l.last_word||"typeof"===l.last_word)||"*"===l.last_text&&"function"===c?d.space_after_anon_function&&(_.space_before_token=!0):"TK_RESERVED"!==o||!G(l.last_text,s.line_starters)&&"catch"!==l.last_text||d.space_before_conditional&&(_.space_before_token=!0):_.space_before_token=!0;"("===a.text&&"TK_RESERVED"===o&&"await"===l.last_word&&(_.space_before_token=!0);"("!==a.text||"TK_EQUALS"!==o&&"TK_OPERATOR"!==o||O()||x();S(t),m(),d.space_in_paren&&(_.space_before_token=!0);b()},TK_END_EXPR:function(){for(;l.mode===L.Statement;)y();l.multiline_frame&&x("]"===a.text&&A(l.mode)&&!d.keep_array_indentation);d.space_in_paren&&("TK_START_EXPR"!==o||d.space_in_empty_paren?_.space_before_token=!0:(_.trim(),_.space_before_token=!1));("]"===a.text&&d.keep_array_indentation?(m(),y):(y(),m))();_.remove_redundant_indentation(n),l.do_while&&n.mode===L.Conditional&&(n.mode=L.Expression,l.do_block=!1,l.do_while=!1)},TK_START_BLOCK:function(){var t=D(1),e=D(2);!e||!(":"===e.text&&G(t.type,["TK_STRING","TK_WORD","TK_RESERVED"])||G(t.text,["get","set"])&&G(e.type,["TK_WORD","TK_RESERVED"]))||G(c,["class","interface"])?S(L.BlockStatement):S(L.ObjectLiteral);e=!t.comments_before.length&&"}"===t.text&&"function"===l.last_word&&"TK_END_EXPR"===o;"expand"===d.brace_style||"none"===d.brace_style&&a.wanted_newline?"TK_OPERATOR"!==o&&(e||"TK_EQUALS"===o||"TK_RESERVED"===o&&N(l.last_text)&&"else"!==l.last_text)?_.space_before_token=!0:K(!1,!0):"TK_OPERATOR"!==o&&"TK_START_EXPR"!==o?"TK_START_BLOCK"===o?K():_.space_before_token=!0:A(n.mode)&&","===l.last_text&&("}"===c?_.space_before_token=!0:K());m(),b()},TK_END_BLOCK:function(){for(;l.mode===L.Statement;)y();var t="TK_START_BLOCK"===o;"expand"===d.brace_style?t||K():t||(A(l.mode)&&d.keep_array_indentation?(d.keep_array_indentation=!1,K(),d.keep_array_indentation=!0):K());y(),m()},TK_WORD:C,TK_RESERVED:C,TK_SEMICOLON:function(){v()&&(_.space_before_token=!1);for(;l.mode===L.Statement&&!l.if_block&&!l.do_block;)y();m()},TK_STRING:function(){v()||"TK_RESERVED"===o||"TK_WORD"===o?_.space_before_token=!0:"TK_COMMA"===o||"TK_START_EXPR"===o||"TK_EQUALS"===o||"TK_OPERATOR"===o?O()||x():K();m()},TK_EQUALS:function(){v();l.declaration_statement&&(l.declaration_assignment=!0);_.space_before_token=!0,m(),_.space_before_token=!0},TK_OPERATOR:function(){v();var t,e;"TK_RESERVED"===o&&N(l.last_text)?(_.space_before_token=!0,m()):"*"===a.text&&"TK_DOT"===o?m():":"===a.text&&l.in_case?(l.case_body=!0,b(),m(),K(),l.in_case=!1):"::"===a.text?m():("TK_OPERATOR"===o&&x(),e=t=!0,G(a.text,["--","++","!","~"])||G(a.text,["-","+"])&&(G(o,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||G(l.last_text,s.line_starters)||","===l.last_text)?(e=t=!1,!a.wanted_newline||"--"!==a.text&&"++"!==a.text||K(!1,!0)," "===l.last_text&&k(l.mode)&&(t=!0),"TK_RESERVED"===o?t=!0:"TK_END_EXPR"===o?t=!("]"===l.last_text&&("--"===a.text||"++"===a.text)):"TK_OPERATOR"===o&&(t=G(a.text,["--","-","++","+"])&&G(l.last_text,["--","-","++","+"]),G(a.text,["+","-"]))&&G(l.last_text,["--","++"])&&(e=!0),l.mode!==L.BlockStatement&&l.mode!==L.Statement||"{"!==l.last_text&&" "!==l.last_text||K()):":"===a.text?0===l.ternary_depth?t=!1:--l.ternary_depth:"?"===a.text?l.ternary_depth+=1:"*"===a.text&&"TK_RESERVED"===o&&"function"===l.last_text&&(e=t=!1),_.space_before_token=_.space_before_token||t,m(),_.space_before_token=e)},TK_COMMA:function(){l.declaration_statement?(k(l.parent.mode)&&(l.declaration_assignment=!1),m(),l.declaration_assignment?K(l.declaration_assignment=!1,!0):(_.space_before_token=!0,d.comma_first&&x())):(m(),l.mode===L.ObjectLiteral||l.mode===L.Statement&&l.parent.mode===L.ObjectLiteral?(l.mode===L.Statement&&y(),K()):(_.space_before_token=!0,d.comma_first&&x()))},TK_BLOCK_COMMENT:function(){if(_.raw)_.add_raw_token(a),!a.directives||"end"!==a.directives.preserve||d.test_output_raw||(_.raw=!1);else if(a.directives)K(!1,!0),m(),"start"===a.directives.preserve&&(_.raw=!0),K(!1,!0);else if(z.newline.test(a.text)||a.wanted_newline){var t,e=function(t){t=t.replace(/\x0d/g,"");var e,n=[];e=t.indexOf("\n");for(;-1!==e;)n.push(t.substring(0,e)),t=t.substring(e+1),e=t.indexOf("\n");t.length&&n.push(t);return n}(a.text),n=!1,i=!1,r=a.whitespace_before,s=r.length;for(K(!1,!0),1<e.length&&(!function(t,e){for(var n=0;n<t.length;n++)if(X(t[n]).charAt(0)!==e)return;return 1}(e.slice(1),"*")?function(t,e){for(var n,i=0,r=t.length;i<r;i++)if((n=t[i])&&0!==n.indexOf(e))return;return 1}(e.slice(1),r)&&(i=!0):n=!0),m(e[0]),t=1;t<e.length;t++)K(!1,!0),n?m(" ".concat(e[t].replace(/^\s+/g,""))):i&&e[t].length>s?m(e[t].substring(s)):_.add_token(e[t]);K(!1,!0)}else _.space_before_token=!0,m(),_.space_before_token=!0},TK_COMMENT:function(){a.wanted_newline?K(!1,!0):_.trim(!0);_.space_before_token=!0,m(),K(!1,!0)},TK_DOT:function(){v();"TK_RESERVED"===o&&N(l.last_text)?_.space_before_token=!0:x(")"===l.last_text&&d.break_chained_methods);m()},TK_UNKNOWN:function(){m(),"\n"===a.text[a.text.length-1]&&K()},TK_EOF:function(){for(;l.mode===L.Statement;)y()}},d={},(t=t||{}).braces_on_own_line!==undefined&&(d.brace_style=t.braces_on_own_line?"expand":"collapse"),d.brace_style=t.brace_style||d.brace_style||"collapse","expand-strict"===d.brace_style&&(d.brace_style="expand"),d.indent_size=t.indent_size?parseInt(t.indent_size,10):4,d.indent_char=t.indent_char||" ",d.eol=t.eol||"\n",d.preserve_newlines=t.preserve_newlines===undefined||t.preserve_newlines,d.break_chained_methods=t.break_chained_methods!==undefined&&t.break_chained_methods,d.max_preserve_newlines=t.max_preserve_newlines===undefined?0:parseInt(t.max_preserve_newlines,10),d.space_in_paren=t.space_in_paren!==undefined&&t.space_in_paren,d.space_in_empty_paren=t.space_in_empty_paren!==undefined&&t.space_in_empty_paren,d.jslint_happy=t.jslint_happy!==undefined&&t.jslint_happy,d.space_after_anon_function=t.space_after_anon_function!==undefined&&t.space_after_anon_function,d.keep_array_indentation=t.keep_array_indentation!==undefined&&t.keep_array_indentation,d.space_before_conditional=t.space_before_conditional===undefined||t.space_before_conditional,d.unescape_strings=t.unescape_strings!==undefined&&t.unescape_strings,d.wrap_line_length=t.wrap_line_length===undefined?0:parseInt(t.wrap_line_length,10),d.e4x=t.e4x!==undefined&&t.e4x,d.end_with_newline=t.end_with_newline!==undefined&&t.end_with_newline,d.comma_first=t.comma_first!==undefined&&t.comma_first,d.test_output_raw=t.test_output_raw!==undefined&&t.test_output_raw,d.jslint_happy&&(d.space_after_anon_function=!0),t.indent_with_tabs&&(d.indent_char="\t",d.indent_size=1),d.eol=d.eol.replace(/\\r/,"\r").replace(/\\n/,"\n"),e="";0<d.indent_size;)e+=d.indent_char,--d.indent_size;var g=0;if(i&&i.length){for(;" "===i.charAt(g)||"\t"===i.charAt(g);)T+=i.charAt(g),g+=1;i=i.substring(g)}function w(t){var e=t.newlines;if(d.keep_array_indentation&&A(l.mode))for(var n=0;n<e;n+=1)K(0<n);else if(d.max_preserve_newlines&&e>d.max_preserve_newlines&&(e=d.max_preserve_newlines),d.preserve_newlines&&1<t.newlines){K();for(var i=1;i<e;i+=1)K(!0)}u[(a=t).type]()}function x(t){t=t!==undefined&&t,_.just_added_newline()||(d.preserve_newlines&&a.wanted_newline||t||d.wrap_line_length&&_.current_line.get_character_count()+a.text.length+(_.space_before_token?1:0)>=d.wrap_line_length)&&K(!1,!0)}function K(t,e){if(!e&&" "!==l.last_text&&","!==l.last_text&&"="!==l.last_text&&"TK_OPERATOR"!==o)for(;l.mode===L.Statement&&!l.if_block&&!l.do_block;)y();_.add_new_line(t)&&(l.multiline_frame=!0)}function R(){_.just_added_newline()&&(d.keep_array_indentation&&A(l.mode)&&a.wanted_newline?(_.current_line.push(a.whitespace_before),_.space_before_token=!1):_.set_indent(l.indentation_level)&&(l.line_indent_level=l.indentation_level))}function m(t){_.raw?_.add_raw_token(a):(d.comma_first&&"TK_COMMA"===o&&_.just_added_newline()&&","===_.previous_line.last()&&(_.previous_line.pop(),R(),_.add_token(","),_.space_before_token=!0),t=t||a.text,R(),_.add_token(t))}function b(){l.indentation_level+=1}function S(t){n=l?(h.push(l),l):E(null,t),l=E(n,t)}function A(t){return t===L.ArrayLiteral}function k(t){return G(t,[L.Expression,L.ForInitializer,L.Conditional])}function y(){0<h.length&&(n=l,l=h.pop(),n.mode===L.Statement)&&_.remove_redundant_indentation(n)}function O(){return l.parent.mode===L.ObjectLiteral&&l.mode===L.Statement&&(":"===l.last_text&&0===l.ternary_depth||"TK_RESERVED"===o&&G(l.last_text,["get","set"]))}function v(){return("TK_RESERVED"===o&&G(l.last_text,["const","let","const"])&&"TK_WORD"===a.type||"TK_RESERVED"===o&&"do"===l.last_text||"TK_RESERVED"===o&&"return"===l.last_text&&!a.wanted_newline||"TK_RESERVED"===o&&"else"===l.last_text&&("TK_RESERVED"!==a.type||"if"!==a.text)||"TK_END_EXPR"===o&&(n.mode===L.ForInitializer||n.mode===L.Conditional)||"TK_WORD"===o&&l.mode===L.BlockStatement&&!l.in_case&&"--"!==a.text&&"++"!==a.text&&"function"!==c&&"TK_WORD"!==a.type&&"TK_RESERVED"!==a.type||l.mode===L.ObjectLiteral&&(":"===l.last_text&&0===l.ternary_depth||"TK_RESERVED"===o&&G(l.last_text,["get","set"])))&&(S(L.Statement),b(),"TK_RESERVED"===o&&G(l.last_text,["const","let","const"])&&"TK_WORD"===a.type&&(l.declaration_statement=!0),O()||x("TK_RESERVED"===a.type&&G(a.text,["do","for","if","while"])),1)}function N(t){return G(t,["case","return","do","if","throw","else"])}function D(t){t=r+(t||0);return t<0||t>=f.length?null:f[t]}function C(){if("TK_RESERVED"===a.type&&l.mode!==L.ObjectLiteral&&G(a.text,["set","get"])&&(a.type="TK_WORD"),"TK_RESERVED"===a.type&&l.mode===L.ObjectLiteral&&":"===D(1).text&&(a.type="TK_WORD"),v()||!a.wanted_newline||k(l.mode)||"TK_OPERATOR"===o&&"--"!==l.last_text&&"++"!==l.last_text||"TK_EQUALS"===o||!d.preserve_newlines&&"TK_RESERVED"===o&&G(l.last_text,["const","let","const","set","get"])||K(),l.do_block&&!l.do_while){if("TK_RESERVED"===a.type&&"while"===a.text)return _.space_before_token=!0,m(),_.space_before_token=!0,void(l.do_while=!0);K(),l.do_block=!1}if(l.if_block)if(l.else_block||"TK_RESERVED"!==a.type||"else"!==a.text){for(;l.mode===L.Statement;)y();l.if_block=!1,l.else_block=!1}else l.else_block=!0;"TK_RESERVED"===a.type&&("case"===a.text||"default"===a.text&&l.in_case_statement)?(K(),(l.case_body||d.jslint_happy)&&(0<l.indentation_level&&(!l.parent||l.indentation_level>l.parent.indentation_level)&&--l.indentation_level,l.case_body=!1),m(),l.in_case=!0,l.in_case_statement=!0):("TK_RESERVED"===a.type&&"function"===a.text&&(!(G(l.last_text,["}"," "])||_.just_added_newline()&&!G(l.last_text,["[","{",":","=",","]))||_.just_added_blankline()||a.comments_before.length||(K(),K(!0)),"TK_RESERVED"===o||"TK_WORD"===o?"TK_RESERVED"===o&&G(l.last_text,["get","set","new","return","export","async"])||"TK_RESERVED"===o&&"default"===l.last_text&&"export"===c?_.space_before_token=!0:K():"TK_OPERATOR"===o||"="===l.last_text?_.space_before_token=!0:!l.multiline_frame&&(k(l.mode)||A(l.mode))||K()),"TK_COMMA"!==o&&"TK_START_EXPR"!==o&&"TK_EQUALS"!==o&&"TK_OPERATOR"!==o||O()||x(),"TK_RESERVED"===a.type&&G(a.text,["function","get","set"])?(m(),l.last_word=a.text):(p="NONE","TK_END_BLOCK"===o?"TK_RESERVED"!==a.type||!G(a.text,["else","catch","finally"])||"expand"===d.brace_style||"end-expand"===d.brace_style||"none"===d.brace_style&&a.wanted_newline?p="NEWLINE":(p="SPACE",_.space_before_token=!0):"TK_SEMICOLON"===o&&l.mode===L.BlockStatement?p="NEWLINE":"TK_SEMICOLON"===o&&k(l.mode)?p="SPACE":"TK_STRING"===o?p="NEWLINE":"TK_RESERVED"===o||"TK_WORD"===o||"*"===l.last_text&&"function"===c?p="SPACE":"TK_START_BLOCK"===o?p="NEWLINE":"TK_END_EXPR"===o&&(_.space_before_token=!0,p="NEWLINE"),"TK_RESERVED"===a.type&&G(a.text,s.line_starters)&&")"!==l.last_text&&(p="else"===l.last_text||"export"===l.last_text?"SPACE":"NEWLINE"),"TK_RESERVED"===a.type&&G(a.text,["else","catch","finally"])?"TK_END_BLOCK"!==o||"expand"===d.brace_style||"end-expand"===d.brace_style||"none"===d.brace_style&&a.wanted_newline?K():(_.trim(!0),"}"!==_.current_line.last()&&K(),_.space_before_token=!0):"NEWLINE"===p?"TK_RESERVED"===o&&N(l.last_text)?_.space_before_token=!0:"TK_END_EXPR"!==o?"TK_START_EXPR"===o&&"TK_RESERVED"===a.type&&G(a.text,["const","let","const"])||":"===l.last_text||("TK_RESERVED"===a.type&&"if"===a.text&&"else"===l.last_text?_.space_before_token=!0:K()):"TK_RESERVED"===a.type&&G(a.text,s.line_starters)&&")"!==l.last_text&&K():l.multiline_frame&&A(l.mode)&&","===l.last_text&&"}"===c?K():"SPACE"===p&&(_.space_before_token=!0),m(),l.last_word=a.text,"TK_RESERVED"===a.type&&"do"===a.text&&(l.do_block=!0),"TK_RESERVED"===a.type&&"if"===a.text&&(l.if_block=!0)))}o="TK_START_BLOCK",c="",(_=new I(e,T)).raw=d.test_output_raw,h=[],S(L.BlockStatement),this.beautify=function(){var t,e;for(s=new V(i,d),f=s.tokenize(),r=0;t=D();){for(var n=0;n<t.comments_before.length;n++)w(t.comments_before[n]);w(t),c=l.last_text,o=t.type,l.last_text=t.text,r+=1}return e=_.get_code(),d.end_with_newline&&(e+="\n"),e="\n"!=d.eol?e.replace(/[\n]/g,d.eol):e}}function s(e){var n=0,i=-1,r=[],s=!0;this.set_indent=function(t){n=e.baseIndentLength+t*e.indent_length,i=t},this.get_character_count=function(){return n},this.is_empty=function(){return s},this.last=function(){return this._empty?null:r[r.length-1]},this.push=function(t){r.push(t),n+=t.length,s=!1},this.pop=function(){var t=null;return s||(t=r.pop(),n-=t.length,s=0===r.length),t},this.remove_indent=function(){0<i&&(--i,n-=e.indent_length)},this.trim=function(){for(;" "===this.last();)r.pop(),--n;s=0===r.length},this.toString=function(){var t="";return this._empty||(0<=i&&(t=e.indent_cache[i]),t+=r.join("")),t}}function I(e,n){n=n||"",this.indent_cache=[n],this.baseIndentLength=n.length,this.indent_length=e.length,this.raw=!1;var i=[];this.baseIndentString=n,this.indent_string=e,this.previous_line=null,this.current_line=null,this.space_before_token=!1,this.add_outputline=function(){this.previous_line=this.current_line,this.current_line=new s(this),i.push(this.current_line)},this.add_outputline(),this.get_line_number=function(){return i.length},this.add_new_line=function(t){return!(1===this.get_line_number()&&this.just_added_newline()||!t&&this.just_added_newline()||(this.raw||this.add_outputline(),0))},this.get_code=function(){return i.join("\n").replace(/[\r\n\t ]+$/,"")},this.set_indent=function(t){if(1<i.length){for(;t>=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(t),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.add_outputline();this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1},this.add_token=function(t){this.add_space_before_token(),this.current_line.push(t)},this.add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&this.current_line.push(" "),this.space_before_token=!1},this.remove_redundant_indentation=function(t){if(!t.multiline_frame&&t.mode!==L.ForInitializer&&t.mode!==L.Conditional)for(var e=t.start_line_index,n=i.length;e<n;)i[e].remove_indent(),e++},this.trim=function(t){for(t=t!==undefined&&t,this.current_line.trim(e,n);t&&1<i.length&&this.current_line.is_empty();)i.pop(),this.current_line=i[i.length-1],this.current_line.trim();this.previous_line=1<i.length?i[i.length-2]:null},this.just_added_newline=function(){return this.current_line.is_empty()},this.just_added_blankline=function(){return!!this.just_added_newline()&&(1===i.length||i[i.length-2].is_empty())}}var F=function F(t,e,n,i,r,s){this.type=t,this.text=e,this.comments_before=[],this.newlines=n||0,this.wanted_newline=0<n,this.whitespace_before=i||"",this.parent=null,this.directives=null};function V(m,b,t){var S,A,k,y,O,v,N="\n\r\t ".split(""),D=/[0-9]/,C=/[01234567]/,L=/[0123456789abcdefABCDEF]/,I="+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! ~ , : ? ^ ^= |= :: =>".split(" "),V=(this.line_starters="continue,try,throw,return,const,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),this.line_starters.concat(["do","in","else","get","set","new","catch","finally","typeof","yield","async","await"])),P=/([\s\S]*?)((?:\*\/)|$)/g,B=/([^\n\r\u2028\u2029]*)/g,j=/\/\* beautify( \w+[:]\w+)+ \*\//g,M=/ (\w+)[:](\w+)/g,U=/([\s\S]*?)((?:\/\*\sbeautify\signore:end\s\*\/)|$)/g,W=/((<\?php|<\?=)[\s\S]*?\?>)|(<%[\s\S]*?%>)/g;function _(){var t=[];if(S=0,A="",v<=O)return["","TK_EOF"];var e=y.length?y[y.length-1]:new F("TK_START_BLOCK","{"),n=m.charAt(O);for(O+=1;G(n,N);){if(z.newline.test(n)?"\n"===n&&"\r"===m.charAt(O-2)||(S+=1,t=[]):t.push(n),v<=O)return["","TK_EOF"];n=m.charAt(O),O+=1}if(t.length&&(A=t.join("")),D.test(n)){var i=!0,r=!0,s=D;for("0"===n&&O<v&&/[Xxo]/.test(m.charAt(O))?(r=i=!1,n+=m.charAt(O),O+=1,s=/[o]/.test(m.charAt(O))?C:L):(n="",--O);O<v&&s.test(m.charAt(O));)n+=m.charAt(O),O+=1,i&&O<v&&"."===m.charAt(O)&&(n+=m.charAt(O),O+=1,i=!1),r&&O<v&&/[Ee]/.test(m.charAt(O))&&(n+=m.charAt(O),(O+=1)<v&&/[+-]/.test(m.charAt(O))&&(n+=m.charAt(O),O+=1),i=r=!1);return[n,"TK_WORD"]}if(z.isIdentifierStart(m.charCodeAt(O-1))){if(O<v)for(;z.isIdentifierChar(m.charCodeAt(O))&&(n+=m.charAt(O),(O+=1)!==v););return"TK_DOT"===e.type||"TK_RESERVED"===e.type&&G(e.text,["set","get"])||!G(n,V)?[n,"TK_WORD"]:"in"===n?[n,"TK_OPERATOR"]:[n,"TK_RESERVED"]}if("("===n||"["===n)return[n,"TK_START_EXPR"];if(")"===n||"]"===n)return[n,"TK_END_EXPR"];if("{"===n)return[n,"TK_START_BLOCK"];if("}"===n)return[n,"TK_END_BLOCK"];if(" "===n)return[n,"TK_SEMICOLON"];if("/"===n){var _="";if("*"===m.charAt(O))return O+=1,P.lastIndex=O,R=P.exec(m),_="/*".concat(R[0]),O+=R[0].length,(x=function(t){if(!t.match(j))return null;for(var e={},n=(M.lastIndex=0,M.exec(t));n;)e[n[1]]=n[2],n=M.exec(t);return e}(_))&&"start"===x.ignore&&(U.lastIndex=O,_+=(R=U.exec(m))[0],O+=R[0].length),[_=_.replace(z.lineBreak,"\n"),"TK_BLOCK_COMMENT",x];if("/"===m.charAt(O))return O+=1,B.lastIndex=O,R=B.exec(m),_="//".concat(R[0]),O+=R[0].length,[_,"TK_COMMENT"]}if("`"===n||"'"===n||'"'===n||("/"===n||b.e4x&&"<"===n&&m.slice(O-1).match(/^<([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/))&&("TK_RESERVED"===e.type&&G(e.text,["return","case","throw","else","do","typeof","yield"])||"TK_END_EXPR"===e.type&&")"===e.text&&e.parent&&"TK_RESERVED"===e.parent.type&&G(e.parent.text,["if","while","for"])||G(e.type,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){var a=n,o=!1,c=!1,l=n;if("/"===a)for(var h=!1;O<v&&(o||h||m.charAt(O)!==a)&&!z.newline.test(m.charAt(O));)l+=m.charAt(O),o?o=!1:(o="\\"===m.charAt(O),"["===m.charAt(O)?h=!0:"]"===m.charAt(O)&&(h=!1)),O+=1;else if(b.e4x&&"<"===a){var p=/<(\/?)([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/g,u=m.slice(O-1),d=p.exec(u);if(d&&0===d.index){for(var f=d[2],T=0;d;){var E=!!d[1],g=d[2],w=!!d[d.length-1]||"![CDATA["===g.slice(0,8);if(g!==f||w||(E?--T:++T),T<=0)break;d=p.exec(u)}var x=d?d.index+d[0].length:u.length,u=u.slice(0,x);return O+=x-1,[u=u.replace(z.lineBreak,"\n"),"TK_STRING"]}}else for(;O<v&&(o||m.charAt(O)!==a&&("`"===a||!z.newline.test(m.charAt(O))));)(o||"`"===a)&&z.newline.test(m.charAt(O))?("\r"===m.charAt(O)&&"\n"===m.charAt(O+1)&&(O+=1),l+="\n"):l+=m.charAt(O),o=o?("x"!==m.charAt(O)&&"u"!==m.charAt(O)||(c=!0),!1):"\\"===m.charAt(O),O+=1;if(c&&b.unescape_strings&&(l=function(t){var e,n=!1,i="",r=0,s="",_=0;for(;n||r<t.length;)if(e=t.charAt(r),r++,n){if(n=!1,"x"===e)s=t.substr(r,2),r+=2;else{if("u"!==e){i+="\\".concat(e);continue}s=t.substr(r,4),r+=4}if(!s.match(/^[0123456789abcdefABCDEF]+$/))return t;if(0<=(_=parseInt(s,16))&&_<32)i+=("x"===e?"\\x":"\\u").concat(s);else if(34===_||39===_||92===_)i+="\\".concat(String.fromCharCode(_));else{if("x"===e&&126<_&&_<=255)return t;i+=String.fromCharCode(_)}}else"\\"===e?n=!0:i+=e;return i}(l)),O<v&&m.charAt(O)===a&&(l+=a,O+=1,"/"===a))for(;O<v&&z.isIdentifierStart(m.charCodeAt(O));)l+=m.charAt(O),O+=1;return[l,"TK_STRING"]}if("#"===n){if(0===y.length&&"!"===m.charAt(O)){for(l=n;O<v&&"\n"!==n;)l+=n=m.charAt(O),O+=1;return["".concat(X(l),"\n"),"TK_UNKNOWN"]}var K="#";if(O<v&&D.test(m.charAt(O))){for(;K+=n=m.charAt(O),(O+=1)<v&&"#"!==n&&"="!==n;);return"#"!==n&&("["===m.charAt(O)&&"]"===m.charAt(O+1)?(K+="[]",O+=2):"{"===m.charAt(O)&&"}"===m.charAt(O+1)&&(K+="{}",O+=2)),[K,"TK_WORD"]}}if("<"===n&&("?"===m.charAt(O)||"%"===m.charAt(O))){W.lastIndex=O-1;var R=W.exec(m);if(R)return n=R[0],O+=n.length-1,[n=n.replace(z.lineBreak,"\n"),"TK_STRING"]}if("<"===n&&"\x3c!--"===m.substring(O-1,O+3)){for(O+=3,n="\x3c!--";!z.newline.test(m.charAt(O))&&O<v;)n+=m.charAt(O),O++;return k=!0,[n,"TK_COMMENT"]}if("-"===n&&k&&"--\x3e"===m.substring(O-1,O+2))return k=!1,O+=2,["--\x3e","TK_COMMENT"];if("."===n)return[n,"TK_DOT"];if(G(n,I)){for(;O<v&&G(n+m.charAt(O),I)&&(n+=m.charAt(O),!(v<=(O+=1))););return","===n?[n,"TK_COMMA"]:"="===n?[n,"TK_EQUALS"]:[n,"TK_OPERATOR"]}return[n,"TK_UNKNOWN"]}this.tokenize=function(){v=m.length,O=0,k=!1,y=[];for(var t,e,n,i=null,r=[],s=[];!e||"TK_EOF"!==e.type;){for(n=_(),t=new F(n[1],n[0],S,A);"TK_COMMENT"===t.type||"TK_BLOCK_COMMENT"===t.type||"TK_UNKNOWN"===t.type;)"TK_BLOCK_COMMENT"===t.type&&(t.directives=n[2]),s.push(t),n=_(),t=new F(n[1],n[0],S,A);s.length&&(t.comments_before=s,s=[]),"TK_START_BLOCK"===t.type||"TK_START_EXPR"===t.type?(t.parent=e,r.push(i),i=t):("TK_END_BLOCK"===t.type||"TK_END_EXPR"===t.type)&&i&&("]"===t.text&&"["===i.text||")"===t.text&&"("===i.text||"}"===t.text&&"{"===i.text)&&(t.parent=i.parent,i=r.pop()),y.push(t),e=t}return y}}return{run:function(t,e){function _(t){return t.replace(/\s+$/g,"")}var n,i,r,d,s,a,f,o,c,T,E,g,l,h;for((e=e||{}).wrap_line_length!==undefined&&0!==parseInt(e.wrap_line_length,10)||e.max_char===undefined||0===parseInt(e.max_char,10)||(e.wrap_line_length=e.max_char),i=e.indent_inner_html!==undefined&&e.indent_inner_html,r=e.indent_size===undefined?4:parseInt(e.indent_size,10),d=e.indent_char===undefined?" ":e.indent_char,a=e.brace_style===undefined?"collapse":e.brace_style,s=0===parseInt(e.wrap_line_length,10)?32786:parseInt(e.wrap_line_length||250,10),f=e.unformatted||["a","span","img","bdo","em","strong","dfn","code","samp","kbd","const","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","address","pre"],o=e.preserve_newlines===undefined||e.preserve_newlines,c=o?isNaN(parseInt(e.max_preserve_newlines,10))?32786:parseInt(e.max_preserve_newlines,10):0,T=e.indent_handlebars!==undefined&&e.indent_handlebars,E=e.wrap_attributes===undefined?"auto":e.wrap_attributes,g=e.wrap_attributes_indent_size!==undefined&&parseInt(e.wrap_attributes_indent_size,10)||r,l=e.end_with_newline!==undefined&&e.end_with_newline,h=Array.isArray(e.extra_liners)?e.extra_liners.concat():("string"==typeof e.extra_liners?e.extra_liners:"head,body,/html").split(","),e.indent_with_tabs&&(d="\t",r=1),(n=new function(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.newlines=0,this.indent_content=i,this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,source,!doctype,basefont,base,area,hr,wbr,param,img,isindex,embed".split(","),extra_liners:h,in_array:function G(t,e){for(var n=0;n<e.length;n++)if(t===e[n])return!0;return!1}},this.is_whitespace=function(t){for(;0<t.length;t++)if(!this.Utils.in_array(t.charAt(0),this.Utils.whitespace))return!1;return!0},this.traverse_whitespace=function(){var t="",t=this.input.charAt(this.pos);if(this.Utils.in_array(t,this.Utils.whitespace)){for(this.newlines=0;this.Utils.in_array(t,this.Utils.whitespace);)o&&"\n"===t&&this.newlines<=c&&(this.newlines+=1),this.pos++,t=this.input.charAt(this.pos);return!0}return!1},this.space_or_wrap=function(t){this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,t),this.print_indentation(t)):(this.line_char_count++,t.push(" "))},this.get_content=function(){for(var t=[];"<"!=this.input.charAt(this.pos);){if(this.pos>=this.input.length)return t.length?t.join(""):["","TK_EOF"];if(this.traverse_whitespace())this.space_or_wrap(t);else{if(T){var e=this.input.substr(this.pos,3);if("{{#"===e||"{{/"===e)break;if("{{!"===e)return[this.get_tag(),"TK_TAG_HANDLEBARS_COMMENT"];if("{{"===this.input.substr(this.pos,2)&&"{{else}}"===this.get_tag(!0))break}e=this.input.charAt(this.pos),this.pos++,this.line_char_count++,t.push(e)}}return t.length?t.join(""):""},this.get_contents_to=function(t){var e;return this.pos===this.input.length?["","TK_EOF"]:(e="",(t=new RegExp("</".concat(t,"\\s*>"),"igm")).lastIndex=this.pos,t=(t=t.exec(this.input))?t.index:this.input.length,this.pos<t&&(e=this.input.substring(this.pos,t),this.pos=t),e)},this.record_tag=function(t){this.tags["".concat(t,"count")]?this.tags["".concat(t,"count")]++:this.tags["".concat(t,"count")]=1,this.tags[t+this.tags["".concat(t,"count")]]=this.indent_level,this.tags[t+this.tags["".concat(t,"count")]+"parent"]=this.tags.parent,this.tags.parent=t+this.tags["".concat(t,"count")]},this.retrieve_tag=function(t){if(this.tags["".concat(t,"count")]){for(var e=this.tags.parent;e&&t+this.tags["".concat(t,"count")]!==e;)e=this.tags["".concat(e,"parent")];e&&(this.indent_level=this.tags[t+this.tags["".concat(t,"count")]],this.tags.parent=this.tags[e+"parent"]),delete this.tags[t+this.tags["".concat(t,"count")]+"parent"],delete this.tags[t+this.tags["".concat(t,"count")]],1===this.tags["".concat(t,"count")]?delete this.tags["".concat(t,"count")]:this.tags["".concat(t,"count")]--}},this.indent_to_tag=function(t){if(this.tags["".concat(t,"count")]){for(var e=this.tags.parent;e&&t+this.tags["".concat(t,"count")]!==e;)e=this.tags["".concat(e,"parent")];e&&(this.indent_level=this.tags[t+this.tags["".concat(t,"count")]])}},this.get_tag=function(t){var e,n,i="",r=[],s=!1,_=!0,a=this.pos,o=this.line_char_count;t=t!==undefined&&t;do{if(this.pos>=this.input.length)return t&&(this.pos=a,this.line_char_count=o),r.length?r.join(""):["","TK_EOF"];if(i=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(i,this.Utils.whitespace))s=!0;else{if("'"!==i&&'"'!==i||(i+=this.get_unformatted(i),s=!0),"="===i&&(s=!1),r.length&&"="!=r[r.length-1]&&">"!=i&&s){if(this.space_or_wrap(r),s=!1,!_&&"force"===E&&"/"!=i){this.print_newline(!0,r),this.print_indentation(r);for(var c=0;c<g;c++)r.push(d)}for(var l=0;l<r.length;l++)if(" "===r[l]){_=!1;break}}if(T&&"<"===n&&i+this.input.charAt(this.pos)==="{{"&&(i+=this.get_unformatted("}}"),r.length&&" "!=r[r.length-1]&&"<"!=r[r.length-1]&&(i=" ".concat(i)),s=!0),"<"!==i||n||(e=this.pos-1,n="<"),T&&!n&&2<=r.length&&"{"===r[r.length-1]&&"{"===r[r.length-2]&&(e="#"===i||"/"===i||"!"===i?this.pos-3:this.pos-2,n="{"),this.line_char_count++,r.push(i),r[1]&&("!"===r[1]||"?"===r[1]||"%"===r[1])){r=[this.get_comment(e)];break}if(T&&r[1]&&"{"===r[1]&&r[2]&&"!"===r[2]){r=[this.get_comment(e)];break}if(T&&"{"===n&&2<r.length&&"}"===r[r.length-2]&&"}"===r[r.length-1])break}}while(">"!=i);var h=r.join(""),p=-1!=h.indexOf(" ")?h.indexOf(" "):"{"===h[0]?h.indexOf("}"):h.indexOf(">"),u="<"!==h[0]&&T?"#"===h[2]?3:2:1,u=h.substring(u,p).toLowerCase();return"/"===h.charAt(h.length-2)||this.Utils.in_array(u,this.Utils.single_token)?t||(this.tag_type="SINGLE"):T&&"{"===h[0]&&"else"===u?t||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):this.is_unformatted(u,f)?(p=this.get_unformatted("</".concat(u,">"),h),r.push(p),this.pos,this.tag_type="SINGLE"):"script"===u&&(-1===h.search("type")||-1<h.search("type")&&-1<h.search(/\b(text|application)\/(x-)?(javascript|ecmascript|jscript|livescript)/))?t||(this.record_tag(u),this.tag_type="SCRIPT"):"style"===u&&(-1===h.search("type")||-1<h.search("type")&&-1<h.search("text/css"))?t||(this.record_tag(u),this.tag_type="STYLE"):"!"===u.charAt(0)?t||(this.tag_type="SINGLE",this.traverse_whitespace()):t||("/"===u.charAt(0)?(this.retrieve_tag(u.substring(1)),this.tag_type="END"):(this.record_tag(u),"html"!=u.toLowerCase()&&(this.indent_content=!0),this.tag_type="START"),this.traverse_whitespace()&&this.space_or_wrap(r),this.Utils.in_array(u,this.Utils.extra_liners)&&(this.print_newline(!1,this.output),this.output.length)&&"\n"!=this.output[this.output.length-2]&&this.print_newline(!0,this.output)),t&&(this.pos=a,this.line_char_count=o),r.join("")},this.get_comment=function(t){var e="",n=">",i=!1,r=(this.pos=t,this.input.charAt(this.pos));for(this.pos++;this.pos<=this.input.length&&((e+=r)[e.length-1]!==n[n.length-1]||-1==e.indexOf(n));)!i&&e.length<10&&(0===e.indexOf("<![if")?(n="<![endif]>",i=!0):0===e.indexOf("<![cdata[")?(n="]]>",i=!0):0===e.indexOf("<![")?(n="]>",i=!0):0===e.indexOf("\x3c!--")?(n="--\x3e",i=!0):0===e.indexOf("{{!")?(n="}}",i=!0):0===e.indexOf("<?")?(n="?>",i=!0):0===e.indexOf("<%")&&(n="%>",i=!0)),r=this.input.charAt(this.pos),this.pos++;return e},this.get_unformatted=function(t,e){if(e&&-1!=e.toLowerCase().indexOf(t))return"";var n="",i="",r=!0,s="";do{if(this.pos>=this.input.length)return i;if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace)){if(!r){this.line_char_count--;continue}if("\n"===n||"\r"===n){i+="\n",this.line_char_count=0;continue}}i+=n,(s+=n.toLowerCase()).length>t.length&&(s=s.substring(1)),this.line_char_count++,r=!0,T&&"{"===n&&i.length&&"{"===i[i.length-2]&&(i+=this.get_unformatted("}}"))}while(s!==t);return i},this.get_token=function(){var t,e;return"TK_TAG_SCRIPT"===this.last_token||"TK_TAG_STYLE"===this.last_token?(t=this.last_token.substr(7),"string"!=typeof(e=this.get_contents_to(t))?e:[e,"TK_".concat(t)]):"CONTENT"===this.current_mode?"string"!=typeof(e=this.get_content())?e:[e,"TK_CONTENT"]:"TAG"===this.current_mode?"string"!=typeof(e=this.get_tag())?e:[e,"TK_TAG_".concat(this.tag_type)]:void 0},this.get_full_indent=function(t){return(t=this.indent_level+t||0)<1?"":new Array(t+1).join(this.indent_string)},this.is_unformatted=function(t,e){return!(!this.Utils.in_array(t,e)||"a"==t.toLowerCase()&&this.Utils.in_array("a",e)&&(t=(this.get_tag(!0)||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/))&&!this.Utils.in_array(t,e))},this.printer=function(t,e,n,i,r){this.input=t||"",this.output=[],this.indent_character=e,this.indent_string="",this.indent_size=n,this.brace_style=r,this.indent_level=0,this.wrap_line_length=i;for(var s=this.line_char_count=0;s<this.indent_size;s++)this.indent_string+=this.indent_character;this.print_newline=function(t,e){this.line_char_count=0,e&&e.length&&(!t&&"\n"==e[e.length-1]||("\n"!=e[e.length-1]&&(e[e.length-1]=_(e[e.length-1])),e.push("\n")))},this.print_indentation=function(t){for(var e=0;e<this.indent_level;e++)t.push(this.indent_string),this.line_char_count+=this.indent_string.length},this.print_token=function(t){this.is_whitespace(t)&&!this.output.length||((t||""!==t)&&this.output.length&&"\n"===this.output[this.output.length-1]&&(this.print_indentation(this.output),t=t.replace(/^\s+/g,"")),this.print_token_raw(t))},this.print_token_raw=function(t){(t=0<this.newlines?_(t):t)&&""!==t&&(1<t.length&&"\n"===t[t.length-1]?(this.output.push(t.slice(0,-1)),this.print_newline(!1,this.output)):this.output.push(t));for(var e=0;e<this.newlines;e++)this.print_newline(0<e,this.output);this.newlines=0},this.indent=function(){this.indent_level++},this.unindent=function(){0<this.indent_level&&this.indent_level--}},this}).printer(t,d,r,s,a);;){var p,u,w,x,K=n.get_token();if(n.token_text=K[0],n.token_type=K[1],"TK_EOF"===n.token_type)break;switch(n.token_type){case"TK_TAG_START":n.print_newline(!1,n.output),n.print_token(n.token_text),n.indent_content&&(n.indent(),n.indent_content=!1),n.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_END":"TK_CONTENT"===n.last_token&&""===n.last_text&&(R=n.token_text.match(/\w+/)[0],(x=null)!==(x=n.output.length?n.output[n.output.length-1].match(/(?:<|{{#)\/?\s*(\w+)/):x)&&(x[1]==R||n.Utils.in_array(x[1],f))||n.print_newline(!1,n.output)),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var R=n.token_text.match(/^\s*<([a-z-]+)/i);R&&n.Utils.in_array(R[1],f)||n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_ELSE":n.print_token(n.token_text),n.indent_content&&(n.indent(),n.indent_content=!1),n.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_COMMENT":case"TK_CONTENT":n.print_token(n.token_text),n.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":""!==n.token_text&&(n.print_newline(!1,n.output),x=n.token_text,u=void 0,w=1,"TK_SCRIPT"===n.token_type?u=b:"TK_STYLE"===n.token_type&&(u=m),"keep"===e.indent_scripts?w=0:"separate"===e.indent_scripts&&(w=-n.indent_level),p=n.get_full_indent(w),x=u?u(x.replace(/^\s*/,p),e):(u=x.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(n.indent_string).length-1,w=n.get_full_indent(w-u),x.replace(/^\s*/,p).replace(/\r\n|\r|\n/g,"\n"+w).replace(/\s+$/,"")))&&(n.print_token_raw(x),n.print_newline(!0,n.output)),n.current_mode="TAG";break;default:""!==n.token_text&&n.print_token(n.token_text)}n.last_token=n.token_type,n.last_text=n.token_text}return t=n.output.join("").replace(/[\r\n\t ]+$/,""),l&&(t+="\n"),t}}}});
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * froala_editor v5.0.0 (https://www.froala.com/wysiwyg-editor)
3
+ * License https://froala.com/wysiwyg-editor/terms/
4
+ * Copyright 2014-2026 Froala Labs
5
+ */
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(("undefined"!=typeof globalThis?globalThis:e||self).FroalaEditor)}(this,function(T){"use strict";Object.assign(T.POPUP_TEMPLATES,{"codeSnippet.error":"[_CODE_SNIPPET_LAYER_]"}),Object.assign(T.DEFAULTS,{codeSnippetLanguage:{JavaScript:"javascript",TypeScript:"typescript",Python:"python",HTML:"html",CSS:"css",Java:"java","C++":"cpp",SQL:"sql",JSON:"json"},codeSnippetDefaultLanguage:"JavaScript"}),T.PLUGINS.codeSnippet=function(d){var n,o,i,r,a="code_snippet",c=d.$;function s(){var e=d.button.build("codeSnippetLang",T.COMMANDS.codeSnippetLang,!0),t='<div class="fr-buttons fr-code-snippet-header"><span>'.concat(d.language.translate("Insert Code Snippet"),"</span></div>"),e='\n <div class="fr-layer fr-active">\n <div class="fr-code-snippet-lang fr-toolbar">\n '.concat(e,'\n </div>\n <pre><code contenteditable="true" spellcheck="false" tabIndex="1"></code></pre>\n <div class="fr-float-right">\n <button class="fr-command fr-enable-accessibility fr-modal-close" tabIndex="2" aria-label="').concat(d.language.translate("Cancel"),'">').concat(d.language.translate("Cancel"),'</button>\n <button class="fr-command fr-enable-accessibility fr-modal-close submit" tabIndex="3" aria-label="').concat(d.language.translate("Insert"),'" data-cmd="submitCodeSnippetPopup">').concat(d.language.translate("Insert"),"</button>\n </div>\n </div>\n "),t=d.modals.create(a,t,e);n=t.$modal,o=t.$head,i=t.$body,n.find(".fr-modal-wrapper").addClass("fr-code-snippet-layer fr-toolbar"),d.button.bindCommands(n,!1),n.find(".fr-toolbar").data("instance",d),d.events.$on(i,"click",'.fr-command[data-cmd="codeSnippetLang"]',f),d.events.$on(i,"input","code",u,!0),d.events.$on(i,"keydown",function(e){!e.target||"CODE"!==e.target.tagName&&"PRE"!==e.target.tagName||e.stopImmediatePropagation()},!0),d.accessibility.registerToolbar(n),d.events.$on(n,"keydown",".fr-modal-close",function(e){"Enter"!==e.key&&T.KEYCODE.ENTER!==e.which||(d.modals.hide(a),e.target&&c(e.target).hasClass("submit")&&u())})}function p(){var e,t,n;if(window.Prism)return 1;d.popups.get("codeSnippet.error")||(n=d.language.translate("Ensure that all required dependent libraries are available for the plugin to work."),n='\n <div class="fr-layer fr-active fr-error-layer">\n <div class="fr-message fr-error-message"><div>'.concat(d.language.translate(n),'</div></div>\n <div class="fr-action-buttons">\n <button class="fr-trim-button fr-plugins-ok">').concat(d.language.translate("OK"),"</button>\n </div>\n </div>"),n=d.popups.create("codeSnippet.error",{code_snippet_layer:n}),d.popups.setContainer("codeSnippet.error",d.$tb),d.events.$on(n,"click",".fr-plugins-ok",function(){d.popups.hide("codeSnippet.error")})),n=d.$tb.find('.fr-command[data-cmd="codeSnippet"]'),t=(e=d.button.getPosition(n)).left,d.popups.show("codeSnippet.error",t,e.top,n.outerHeight(),!0)}function l(){var e=0<arguments.length&&arguments[0]!==undefined&&arguments[0];n||s(),p()&&(o.find(".fr-code-snippet-header span").first().text(d.language.translate(e?"Edit Code Snippet":"Insert Code Snippet")),i.find(".submit").text(d.language.translate(e?"Update":"Insert")),e||(i.find("code")[0].innerText="",i.removeData("edit-code-block")),u(),d.selection.save(),d.modals.show(a))}function f(e){var t,n,e=e.target;e&&(n=(t=i.find(".fr-btn.fr-dropdown")).next(),["BUTTON","SPAN"].includes(e.tagName)?(n.find(".fr-command.fr-active").removeClass("fr-active").attr("aria-selected",!1),n.find('.fr-command[title="'.concat(t.text(),'"]')).addClass("fr-active").attr("aria-selected",!0)):(t.find("span").text(c(e).text()),u()))}function u(){var e=i.find("code"),t=g(i.find(".fr-btn.fr-dropdown").text()),n=e[0],e=t,t=(t=window.getSelection()).rangeCount?t.getRangeAt(0):null,o=null,a=(t&&n.contains(t.startContainer)&&((a=t.cloneRange()).selectNodeContents(n),a.setEnd(t.endContainer,t.endOffset),o=a.toString().length),t=n.innerText,n.className="language-"+e,n.textContent=t||" ",window.Prism.highlightElement(n),null!==o?function(e,t){var n,o=document.createRange(),a=window.getSelection(),i=0,r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);for(;n=r.nextNode();){var d=i+n.length;if(t<=d)return o.setStart(n,t-i),o.collapse(!0),a.removeAllRanges(),a.addRange(o);i=d}}(n,o):setTimeout(function(){n.focus()},0),n.parentElement);a&&"pre"===a.nodeName.toLowerCase()&&a.hasAttribute("tabindex")&&a.removeAttribute("tabindex")}function m(o){return new Promise(function(e){var t=document.createDocumentFragment(),n=document.createElement("pre");"string"==typeof o?n.innerHTML=o:n.appendChild(o.cloneNode(!0)),t.appendChild(n),window.Prism.highlightElement(n.firstChild,!1,function(){e(t)})})}function g(t){var n=d.opts.codeSnippetLanguage,e=Object.keys(n).find(function(e){return n[e]===t});return n[t]||e&&e[0]||""}function v(e,a,i){var t;e=d.events.chainTrigger("codeSnippet.beforeInsert",e),p()&&!1!==e&&(e.trim()||(e=" "),r=r||d.button.buildList(["removeCodeSnippet","copyCodeSnippet","editCodeSnippet"]),t=g(a),m('<code class="language-'.concat(t,'">').concat(e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"),"</code>")).then(function(e){d.selection.restore(),i||d.undo.saveStep();var t,n,o="code-"+Date.now(),o=(o='\n <div class="fr-code-snippet" contenteditable="false" style="caret-color: #ECECEC;" data-code-snippet="'.concat(a,'" id="').concat(o,'">\n <div class="fr-code-header" contenteditable="false">\n <div class="fr-code-lang" contenteditable="false">').concat(a,'</div>\n <div class="fr-code-actions">\n ').concat(r,"\n </div>\n </div>\n ").concat(e.firstChild.outerHTML,"\n </div>\n ")).trim();i?i.outerHTML=o:(e=d.selection.element(),t=d.el.firstChild,n=(n=d.html.defaultTag())?"<"+n+"><br></"+n+">":"<br>",!d.core.isEmpty()&&t!=e&&t!=e.parentElement||(o=n+o),d.html.insert(o+=n,!0),d.selection.restore(),d.undo.saveStep()),d.events.trigger("codeSnippet.afterInsert",[o])}))}function e(){var e=c(this),t=e.parents(".fr-code-snippet");e.removeData("mousedown"),d.undo.saveStep(),t.replaceWith(T.MARKERS),d.selection.restore(),d.undo.saveStep(),setTimeout(function(){d.$el.focus()},0)}function t(){var e=c(this),t=e.parents(".fr-code-snippet"),n=(i||s(),i.find("code"));e.removeData("mousedown"),n.text(t.find("code").text()),i.find(".fr-btn.fr-dropdown span").text(t.find(".fr-code-lang").text()),i.data("edit-code-block",t),l(!0)}function S(){var e=c(this),t=e.parents(".fr-code-snippet").first();e.removeData("mousedown"),document.hasFocus()&&((e=t.clone(!0)).find(".fr-code-actions").remove(),t=e[0].outerHTML,e=new Blob([t],{type:"text/html"}),navigator.clipboard.write([new window.ClipboardItem({"text/html":e})]))}function b(e){var t=e.which,n=d.selection.get(),o=T.KEYCODE.BACKSPACE===t,a=T.KEYCODE.DELETE===t;if((o||a)&&!d.keys.isArrow(t)&&t!==T.KEYCODE.TAB&&t!==T.KEYCODE.ALT&&t!==T.KEYCODE.ESC){if(e.ctrlKey||e.metaKey||t===T.KEYCODE.SHIFT)return!0;var i,r=d.markers.insert();if(!r)return;if(o&&((o=r.previousSibling)&&o.nodeType===Node.ELEMENT_NODE&&c(o).hasClass("fr-code-snippet")?i=o:o&&o.nodeType===Node.TEXT_NODE&&!o.data.trim()?i=r.parentElement.previousElementSibling:n.anchorNode.nodeType===Node.ELEMENT_NODE&&(i=n.anchorNode.previousElementSibling)),(i=a&&(o=r.parentElement).lastChild.nodeType===Node.ELEMENT_NODE&&"fr-marker"===o.lastChild.className?o.nextElementSibling:i)&&"LI"===i.tagName&&(i=i.firstChild),r.remove(),i&&c(i).hasClass("fr-code-snippet"))return e.preventDefault(),e.stopPropagation(),d.undo.saveStep(),c(i).replaceWith(T.MARKERS),d.selection.restore(),d.undo.saveStep(),!1}n=d.selection.element(),a=n&&c(n).parents(".fr-code-snippet");if(a&&a.length&&t!=T.KEYCODE.F10&&!d.keys.isBrowserAction(e))return e.preventDefault(),e.stopPropagation(),!1}function h(e,t){"codeSnippetLang"===e&&(t=(e=i.find(".fr-btn.fr-dropdown")).next().find('a[data-param1="'.concat(t,'"]')).text(),e.find("span").text(t),u())}function E(e){if(e.target&&e.target.parentElement&&c(e.target.parentElement).parents(".fr-code-snippet").length)return!1}function C(){window.Prism&&d.$el.find("[data-code-snippet]").filter(function(e){return!e.className}).each(function(e,t){var n=c(t).find("code"),o=t.getAttribute("data-code-snippet");n.length&&(n.text(n[0].innerText),v(n.text(),o,t))})}function y(){d.$el.find("[data-code-snippet]").each(function(e,t){var t=c(t),n=d.doc.createElement("div");n.setAttribute("data-code-snippet-action-btn",!0),t.find(".fr-code-actions").replaceWith(n.outerHTML)})}function w(){var e=d.$el.find("[data-code-snippet-action-btn]");r=r||d.button.buildList(["removeCodeSnippet","copyCodeSnippet","editCodeSnippet"]),e.each(function(e,t){c(t).replaceWith('<div class="fr-code-actions">'.concat(r,"</div>"))})}return{_init:function(){d.events.$on(d.$el,d._mousedown,'.fr-command[data-cmd="removeCodeSnippet"]',e,!0),d.events.$on(d.$el,d._mousedown,'.fr-command[data-cmd="copyCodeSnippet"]',S,!0),d.events.$on(d.$el,d._mousedown,'.fr-command[data-cmd="editCodeSnippet"]',t,!0),d.events.on("commands.after",h),d.events.on("paste.before",E),d.events.on("html.inserted",C),d.events.on("html.beforeGet",y),d.events.on("html.afterGet",w),d.events.$on(d.$el,"beforecopy",y),d.events.on("keydown",b,!0),d.events.on("copy",function(){setTimeout(w,0)}),d.events.on("dragover drop",function(e){if(e.target&&c(e.target).closest(".fr-code-snippet").length)return e.preventDefault(),!1},!0)},insert:v,update:function(e,t,n){var o=e.find("code");e.find(".fr-code-lang").text(n),e.attr("data-code-snippet",n),o.text(t),o[0].className="language-".concat(g(n)),m(o[0]).then(function(e){o.parent().replaceWith(e)})},show:l}},T.DefineIcon("codeSnippet",{NAME:"codeSnippet",SVG_KEY:"codeSnippet",VIEWBOX:"-5 -4 26 26"}),T.RegisterCommand("codeSnippet",{title:"Code Snippet",focus:!0,undo:!0,callback:function(){this.codeSnippet.show()}}),T.DefineIcon("copyCodeSnippet",{NAME:"copy",SVG_KEY:"copy",VIEWBOX:"1 1 18 18"}),T.RegisterCommand("copyCodeSnippet",{title:"Copy",undo:!1,focus:!1,plugin:"codeSnippet"}),T.DefineIcon("editCodeSnippet",{NAME:"edit",SVG_KEY:"edit",VIEWBOX:"4 3 16 16"}),T.RegisterCommand("editCodeSnippet",{title:"Edit",undo:!1,focus:!1,plugin:"codeSnippet"}),T.DefineIcon("removeCodeSnippet",{NAME:"trash",SVG_KEY:"remove",VIEWBOX:"4 3 17 17"}),T.RegisterCommand("removeCodeSnippet",{title:"Remove",undo:!1,focus:!1,plugin:"codeSnippet"}),T.RegisterCommand("codeSnippetLang",{type:"dropdown",undo:!1,plugin:"codeSnippet",displaySelection:!0,defaultSelection:function(e){return e.opts.codeSnippetDefaultLanguage},displaySelectionWidth:250,html:function(){var e,t='<ul class="fr-dropdown-list" role="presentation">',n=this.opts.codeSnippetLanguage;for(e in n)n.hasOwnProperty(e)&&(t+='\n <li role="presentation">\n <a class="fr-command" tabIndex="-1" role="option" data-cmd="codeSnippetLang" data-param1="'.concat(n[e],'" title="').concat(e,'">').concat(e,"</a>\n </li>"));return t+="</ul>"}}),T.RegisterCommand("submitCodeSnippetPopup",{title:"Submit",undo:!1,focus:!1,plugin:"codeSnippet",callback:function(){var e=this.modals.get("code_snippet").$body,t=e.find("code"),n=e.find(".fr-btn.fr-dropdown").text(),e=e.data("edit-code-block");e?this.codeSnippet.update(e,t.text(),n):this.codeSnippet.insert(t.text(),n)}})});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.7.1 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v5.0.0 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
- * Copyright 2014-2025 Froala Labs
4
+ * Copyright 2014-2026 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(e){"use strict";e=e&&e.hasOwnProperty("default")?e["default"]:e,Object.assign(e.DEFAULTS,{codeMirror:window.CodeMirror,codeMirrorOptions:{lineNumbers:!0,tabMode:"indent",indentWithTabs:!0,lineWrapping:!0,mode:"text/html",tabSize:2},codeBeautifierOptions:{end_with_newline:!0,indent_inner_html:!0,extra_liners:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","ol","table","dl"],brace_style:"expand",indent_char:"\t",indent_size:1,wrap_line_length:0},codeViewKeepActiveButtons:["fullscreen"]}),e.PLUGINS.codeView=function(c){var d,f,h=c.$,p=function p(){return c.$box.hasClass("fr-code-view")};function g(){return f?f.getValue():d.val()}function u(){p()&&(f&&f.setSize(null,c.opts.height?c.opts.height:"auto"),c.opts.heightMin||c.opts.height?(c.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",c.opts.heightMin||c.opts.height),d.css("height",c.opts.height)):c.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",""))}var m,b=!1;function v(){p()&&c.events.trigger("blur")}function w(){p()&&b&&c.events.trigger("focus")}function r(e){d||(!function l(){d=h('<textarea class="fr-code" tabIndex="-1">'),c.$wp.append(d),d.attr("dir",c.opts.direction),c.$box.hasClass("fr-basic")||(m=h('<a data-cmd="html" title="Code View" class="fr-command fr-btn html-switch'.concat(c.helpers.isMobile()?"":" fr-desktop",'" role="button" tabIndex="-1"><i class="fa fa-code"></i></button>')),c.$box.append(m),c.events.bindClick(c.$box,"a.html-switch",function(){c.events.trigger("commands.before",["html"]),M(!1),c.events.trigger("commands.after",["html"])}));var e=function e(){return!p()};c.events.on("buttons.refresh",e),c.events.on("copy",e,!0),c.events.on("cut",e,!0),c.events.on("paste",e,!0),c.events.on("destroy",A,!0),c.events.on("html.set",function(){p()&&M(!0)}),c.events.on("codeView.update",u),c.events.on("codeView.toggle",function(){c.$box.hasClass("fr-code-view")&&M()}),c.events.on("form.submit",function(){p()&&(c.html.set(g()),c.events.trigger("contentChanged",[],!0))},!0)}(),!f&&c.opts.codeMirror?((f=c.opts.codeMirror.fromTextArea(d.get(0),c.opts.codeMirrorOptions)).on("blur",v),f.on("focus",w)):(c.events.$on(d,"keydown keyup change input",function(){c.opts.height?this.removeAttribute("rows"):(this.rows=1,0===this.value.length?this.style.height="auto":this.style.height="".concat(this.scrollHeight,"px"))}),c.events.$on(d,"blur",v),c.events.$on(d,"focus",w))),c.undo.saveStep(),c.html.cleanEmptyTags(),c.html.cleanWhiteTags(!0),c.core.hasFocus()&&(c.core.isEmpty()||(c.selection.save(),c.$el.find('.fr-marker[data-type="true"]').first().replaceWith('<span class="fr-tmp fr-sm">F</span>'),c.$el.find('.fr-marker[data-type="false"]').last().replaceWith('<span class="fr-tmp fr-em">F</span>')));var t=c.html.get(!1,!0);c.$el.find("span.fr-tmp").remove(),c.$box.toggleClass("fr-code-view",!0);var r,n,o=!1;if(c.core.hasFocus()&&(o=!0,c.events.disableBlur(),c.$el.blur()),t=(t=t.replace(/<span class="fr-tmp fr-sm">F<\/span>/,"FROALA-SM")).replace(/<span class="fr-tmp fr-em">F<\/span>/,"FROALA-EM"),c.codeBeautifier&&!t.includes("fr-embedly")&&(t=c.codeBeautifier.run(t,c.opts.codeBeautifierOptions)),f){r=t.indexOf("FROALA-SM"),(n=t.indexOf("FROALA-EM"))<r?r=n:n-=9;var s=(t=t.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).substring(0,r).length-t.substring(0,r).replace(/\n/g,"").length,i=t.substring(0,n).length-t.substring(0,n).replace(/\n/g,"").length;r=t.substring(0,r).length-t.substring(0,t.substring(0,r).lastIndexOf("\n")+1).length,n=t.substring(0,n).length-t.substring(0,t.substring(0,n).lastIndexOf("\n")+1).length,f.setSize(null,c.opts.height?c.opts.height:"auto"),c.opts.heightMin&&c.$box.find(".CodeMirror-scroll").css("min-height",c.opts.heightMin),f.setValue(t),b=!o,f.focus(),b=!0,f.setSelection({line:s,ch:r},{line:i,ch:n}),f.refresh(),f.clearHistory()}else{r=t.indexOf("FROALA-SM"),n=t.indexOf("FROALA-EM")-9,c.opts.heightMin&&d.css("min-height",c.opts.heightMin),c.opts.height&&d.css("height",c.opts.height),c.opts.heightMax&&d.css("max-height",c.opts.height||c.opts.heightMax),d.val(t.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).trigger("change");var a=h(c.o_doc).scrollTop();b=!o,d.focus(),b=!0,d.get(0).setSelectionRange(r,n),h(c.o_doc).scrollTop(a)}c.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command, .fr-btn-grp > .fr-btn-wrap > .fr-command, .fr-more-toolbar > .fr-btn-wrap > .fr-command").not(e).filter(function(){return c.opts.codeViewKeepActiveButtons.indexOf(h(this).data("cmd"))<0}).addClass("fr-disabled").attr("aria-disabled",!0),e.addClass("fr-active").attr("aria-pressed",!0),!c.helpers.isMobile()&&c.opts.toolbarInline&&c.toolbar.hide()}function M(e){void 0===e&&(e=!p());var t=c.$tb.find('.fr-command[data-cmd="html"]');e?(c.popups.hideAll(),r(t)):(c.$box.toggleClass("fr-code-view",!1),function o(e){var t=g();c.html.set(t),c.$el.blur(),c.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command, .fr-btn-grp > .fr-btn-wrap > .fr-command, .fr-more-toolbar > .fr-btn-wrap > .fr-command").not(e).removeClass("fr-disabled").attr("aria-disabled",!1),e.removeClass("fr-active").attr("aria-pressed",!1);var r=h(c.el).children().first();if(r.is("table")){var n=r.find("td").first();n.length&&c.selection.setAtStart(n[0])}else c.selection.setAtStart(c.el);c.selection.restore(),c.placeholder.refresh(),c.undo.saveStep()}(t),c.events.trigger("codeView.update"))}function A(){p()&&M(!1),f&&f.toTextArea(),d.val("").removeData().remove(),d=null,m&&(m.remove(),m=null)}return{_init:function e(){if(c.events.on("focus",function(){c.opts.toolbarContainer&&function t(){var e=c.$tb.find('.fr-command[data-cmd="html"]');p()?(c.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command").not(e).filter(function(){return c.opts.codeViewKeepActiveButtons.indexOf(h(this).data("cmd"))<0}).addClass("fr-disabled").attr("aria-disabled",!1),e.addClass("fr-active").attr("aria-pressed",!1)):(c.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command").not(e).removeClass("fr-disabled").attr("aria-disabled",!1),e.removeClass("fr-active").attr("aria-pressed",!1))}()}),!c.$wp)return!1},toggle:M,isActive:p,get:g}},e.RegisterCommand("html",{title:"Code View",undo:!1,focus:!1,forcedRefresh:!0,toggle:!0,callback:function(){this.codeView.toggle()},plugin:"codeView"}),e.DefineIcon("html",{NAME:"code",SVG_KEY:"codeView"})});
7
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(("undefined"!=typeof globalThis?globalThis:e||self).FroalaEditor)}(this,function(e){"use strict";Object.assign(e.DEFAULTS,{codeMirror:window.CodeMirror,codeMirrorOptions:{lineNumbers:!0,tabMode:"indent",indentWithTabs:!0,lineWrapping:!0,mode:"text/html",tabSize:2},codeBeautifierOptions:{end_with_newline:!0,indent_inner_html:!0,extra_liners:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","ol","table","dl"],brace_style:"expand",indent_char:"\t",indent_size:1,wrap_line_length:0},codeViewKeepActiveButtons:["fullscreen"]}),e.PLUGINS.codeView=function(l){var d,c,f,h=l.$;function p(){return c?c.getValue():d.val()}function g(){f()&&(c&&c.setSize(null,l.opts.height||"auto"),l.opts.heightMin||l.opts.height?(l.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",l.opts.heightMin||l.opts.height),d.css("height",l.opts.height)):l.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",""))}var u,m=!1;function b(){f()&&l.events.trigger("blur")}function v(){f()&&m&&l.events.trigger("focus")}function r(e){d||(d=h('<textarea class="fr-code" tabIndex="-1">'),l.$wp.append(d),d.attr("dir",l.opts.direction),l.$box.hasClass("fr-basic")||(u=h('<a data-cmd="html" title="Code View" class="fr-command fr-btn html-switch'.concat(l.helpers.isMobile()?"":" fr-desktop",'" role="button" tabIndex="-1"><i class="fa fa-code"></i></button>')),l.$box.append(u),l.events.bindClick(l.$box,"a.html-switch",function(){l.events.trigger("commands.before",["html"]),M(!1),l.events.trigger("commands.after",["html"])})),t=function t(){return!f()},l.events.on("buttons.refresh",t),l.events.on("copy",t,!0),l.events.on("cut",t,!0),l.events.on("paste",t,!0),l.events.on("destroy",w,!0),l.events.on("html.set",function(){f()&&M(!0)}),l.events.on("codeView.update",g),l.events.on("codeView.toggle",function(){l.$box.hasClass("fr-code-view")&&M()}),l.events.on("form.submit",function(){f()&&(l.html.set(p()),l.events.trigger("contentChanged",[],!0))},!0),!c&&l.opts.codeMirror?((c=l.opts.codeMirror.fromTextArea(d.get(0),l.opts.codeMirrorOptions)).on("blur",b),c.on("focus",v)):(l.events.$on(d,"keydown keyup change input",function(){l.opts.height?this.removeAttribute("rows"):(this.rows=1,0===this.value.length?this.style.height="auto":this.style.height="".concat(this.scrollHeight,"px"))}),l.events.$on(d,"blur",b),l.events.$on(d,"focus",v))),l.undo.saveStep(),l.html.cleanEmptyTags(),l.html.cleanWhiteTags(!0),l.core.hasFocus()&&!l.core.isEmpty()&&(l.selection.save(),l.$el.find('.fr-marker[data-type="true"]').first().replaceWith('<span class="fr-tmp fr-sm">F</span>'),l.$el.find('.fr-marker[data-type="false"]').last().replaceWith('<span class="fr-tmp fr-em">F</span>'));var t,r,n,o,s,i=l.html.get(!1,!0),a=(l.$el.find("span.fr-tmp").remove(),l.$box.toggleClass("fr-code-view",!0),!1);l.core.hasFocus()&&(a=!0,l.events.disableBlur(),l.$el.blur()),i=(i=i.replace(/<span class="fr-tmp fr-sm">F<\/span>/,"FROALA-SM")).replace(/<span class="fr-tmp fr-em">F<\/span>/,"FROALA-EM"),l.codeBeautifier&&!i.includes("fr-embedly")&&(i=l.codeBeautifier.run(i,l.opts.codeBeautifierOptions)),c?(n=i.indexOf("FROALA-SM"),(o=i.indexOf("FROALA-EM"))<n?n=o:o-=9,s=(i=i.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).substring(0,n).length-i.substring(0,n).replace(/\n/g,"").length,r=i.substring(0,o).length-i.substring(0,o).replace(/\n/g,"").length,n=i.substring(0,n).length-i.substring(0,i.substring(0,n).lastIndexOf("\n")+1).length,o=i.substring(0,o).length-i.substring(0,i.substring(0,o).lastIndexOf("\n")+1).length,c.setSize(null,l.opts.height||"auto"),l.opts.heightMin&&l.$box.find(".CodeMirror-scroll").css("min-height",l.opts.heightMin),c.setValue(i),m=!a,c.focus(),m=!0,c.setSelection({line:s,ch:n},{line:r,ch:o}),c.refresh(),c.clearHistory()):(n=i.indexOf("FROALA-SM"),o=i.indexOf("FROALA-EM")-9,l.opts.heightMin&&d.css("min-height",l.opts.heightMin),l.opts.height&&d.css("height",l.opts.height),l.opts.heightMax&&d.css("max-height",l.opts.height||l.opts.heightMax),d.val(i.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).trigger("change"),s=h(l.o_doc).scrollTop(),m=!a,d.focus(),m=!0,d.get(0).setSelectionRange(n,o),h(l.o_doc).scrollTop(s)),l.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command, .fr-btn-grp > .fr-btn-wrap > .fr-command, .fr-more-toolbar > .fr-btn-wrap > .fr-command").not(e).filter(function(){return l.opts.codeViewKeepActiveButtons.indexOf(h(this).data("cmd"))<0}).addClass("fr-disabled").attr("aria-disabled",!0),e.addClass("fr-active").attr("aria-pressed",!0),!l.helpers.isMobile()&&l.opts.toolbarInline&&l.toolbar.hide()}function M(e){void 0===e&&(e=!f());var t=l.$tb.find('.fr-command[data-cmd="html"]');e?(l.popups.hideAll(),r(t)):(l.$box.toggleClass("fr-code-view",!1),e=t,t=p(),l.html.set(t),l.$el.blur(),l.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command, .fr-btn-grp > .fr-btn-wrap > .fr-command, .fr-more-toolbar > .fr-btn-wrap > .fr-command").not(e).removeClass("fr-disabled").attr("aria-disabled",!1),e.removeClass("fr-active").attr("aria-pressed",!1),(t=h(l.el).children().first()).is("table")?(e=t.find("td").first()).length&&l.selection.setAtStart(e[0]):l.selection.setAtStart(l.el),l.selection.restore(),l.placeholder.refresh(),l.undo.saveStep(),l.events.trigger("codeView.update"))}function w(){f()&&M(!1),c&&c.toTextArea(),d.val("").removeData().remove(),d=null,u&&(u.remove(),u=null)}return{_init:function(){if(l.events.on("focus",function(){var e;l.opts.toolbarContainer&&(e=l.$tb.find('.fr-command[data-cmd="html"]'),(f()?(l.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command").not(e).filter(function(){return l.opts.codeViewKeepActiveButtons.indexOf(h(this).data("cmd"))<0}).addClass("fr-disabled").attr("aria-disabled",!1),e.addClass("fr-active")):(l.$tb.find(".fr-btn-grp > .fr-command, .fr-more-toolbar > .fr-command").not(e).removeClass("fr-disabled").attr("aria-disabled",!1),e.removeClass("fr-active"))).attr("aria-pressed",!1))}),!l.$wp)return!1},toggle:M,isActive:f=function f(){return l.$box.hasClass("fr-code-view")},get:p}},e.RegisterCommand("html",{title:"Code View",undo:!1,focus:!1,forcedRefresh:!0,toggle:!0,callback:function(){this.codeView.toggle()},plugin:"codeView"}),e.DefineIcon("html",{NAME:"code",SVG_KEY:"codeView"})});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v4.7.1 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v5.0.0 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
- * Copyright 2014-2025 Froala Labs
4
+ * Copyright 2014-2026 Froala Labs
5
5
  */
6
6
 
7
- !function(o,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(o.FroalaEditor)}(this,function(v){"use strict";v=v&&v.hasOwnProperty("default")?v["default"]:v,Object.assign(v.POPUP_TEMPLATES,{"textColor.picker":"[_BUTTONS_][_TEXT_COLORS_][_CUSTOM_COLOR_]","backgroundColor.picker":"[_BUTTONS_][_BACKGROUND_COLORS_][_CUSTOM_COLOR_]"}),Object.assign(v.DEFAULTS,{colorsText:["#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"],colorsBackground:["#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"],colorsStep:7,colorsHEXInput:!0,colorsButtons:["colorsBack","|","-"]}),v.PLUGINS.colors=function(m){var O=m.$,s='<div class="fr-color-hex-layer fr-active fr-layer" id="fr-color-hex-layer- \n '.concat(m.id,'"><div class="fr-input-line"><input maxlength="9" id="[ID]"\n type="text" placeholder="').concat(m.language.translate("HEX Color"),'" \n tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button \n type="button" class="fr-command fr-submit" data-cmd="[COMMAND]" tabIndex="2" role="button">\n ').concat(m.language.translate("OK"),"</button></div></div>");function l(o){for(var t="text"===o?m.opts.colorsText:m.opts.colorsBackground,r='<div class="fr-color-set fr-'.concat(o,'-color fr-selected-set">'),e=0;e<t.length;e++)0!==e&&e%m.opts.colorsStep==0&&(r+="<br>"),"REMOVE"!==t[e]?r+='<span class="fr-command fr-select-color" style="background:'.concat(t[e].toUpperCase(),';" \n tabIndex="-1" aria-selected="false" role="button" data-cmd="apply').concat(o,'Color" \n data-param1="').concat(t[e].toUpperCase(),'"><span class="fr-sr-only"> ').concat(m.language.translate("Color")).concat(t[e]," \n &nbsp;&nbsp;&nbsp;</span></span>"):r+='<span class="fr-command fr-select-color" data-cmd="apply'.concat(o,'Color"\n tabIndex="-1" role="button" data-param1="REMOVE" \n title="').concat(m.language.translate("Clear Formatting"),'">').concat(m.icon.create("remove"),' \n <span class="fr-sr-only"> ').concat(m.language.translate("Clear Formatting")," </span></span>");return"".concat(r,"</div>")}function i(o){var t,r=m.popups.get("".concat(o,"Color.picker")),e=O(m.selection.element());t="background"===o?"background-color":"color";var a=r.find(".fr-".concat(o,"-color .fr-select-color"));for(a.find(".fr-selected-color").remove(),a.removeClass("fr-active-item"),a.not('[data-param1="REMOVE"]').attr("aria-selected",!1);e.get(0)!==m.el;){if("transparent"!==e.css(t)&&"rgba(0, 0, 0, 0)"!==e.css(t)){var c=r.find(".fr-".concat(o,'-color .fr-select-color[data-param1="').concat(m.helpers.RGBToHex(e.css(t)),'"]'));c.append('<span class="fr-selected-color" aria-hidden="true">\uf00c</span>'),c.addClass("fr-active-item").attr("aria-selected",!0);break}e=e.parent()}!function n(o){var t=m.popups.get("".concat(o,"Color.picker")),r=t.find(".fr-".concat(o,"-color .fr-active-item")).attr("data-param1"),e=t.find(".fr-color-hex-layer input");r||(r="");e.length&&O(e.val(r).input).trigger("change")}(o)}function e(o){"REMOVE"!==o?m.format.applyStyle("background-color",m.helpers.HEXtoRGB(o)):m.format.removeStyle("background-color"),m.popups.hide("backgroundColor.picker")}function a(o){"REMOVE"!==o?m.format.applyStyle("color",m.helpers.HEXtoRGB(o)):m.format.removeStyle("color"),m.popups.hide("textColor.picker")}return{showColorsPopup:function p(o){var t=m.$tb.find('.fr-command[data-cmd="'.concat(o,'"]')),r=m.popups.get("".concat(o,".picker"));if(r||(r=function n(o){var t="";m.opts.toolbarInline&&0<m.opts.colorsButtons.length&&(t+='<div class="fr-buttons fr-colors-buttons fr-tabs">\n '.concat(m.button.buildList(m.opts.colorsButtons),"\n </div>"));var r,e="";r="textColor"===o?(m.opts.colorsHEXInput&&(e=s.replace(/\[ID\]/g,"fr-color-hex-layer-text-".concat(m.id)).replace(/\[COMMAND\]/g,"customTextColor")),{buttons:t,text_colors:l("text"),custom_color:e}):(m.opts.colorsHEXInput&&(e=s.replace(/\[ID\]/g,"fr-color-hex-layer-background-".concat(m.id)).replace(/\[COMMAND\]/g,"customBackgroundColor")),{buttons:t,background_colors:l("background"),custom_color:e});var a=m.popups.create("".concat(o,".picker"),r);return function c(h,k){m.events.on("popup.tab",function(o){var t=O(o.currentTarget);if(!m.popups.isVisible(k)||!t.is("span, input, button"))return!0;var r,e,a=o.which,c=!0;if(v.KEYCODE.TAB===a){var n=h.find("span.fr-select-color");if(t.is(n.first())&&o.shiftKey||t.is(h.find("span.fr-submit"))&&!o.shiftKey){var s=h.find(".fr-buttons");c=!m.accessibility.focusToolbar(s,!!o.shiftKey)}if(!1!==c){var l=h.find("span.fr-select-color");l.add(h.find("input")),l.add(h.find("button.fr-submit")),r=l.index(t),r=o.shiftKey?((r-1)%l.length+l.length)%l.length:(r+1)%l.length,e=l.get(r),m.events.disableBlur(),e.focus(),c=!1}}else if(v.KEYCODE.ARROW_UP===a||v.KEYCODE.ARROW_DOWN===a||v.KEYCODE.ARROW_LEFT===a||v.KEYCODE.ARROW_RIGHT===a){if(t.is("span.fr-select-color")){var i=t.parent().find("span.fr-select-color"),p=i.index(t),u=m.opts.colorsStep,d=Math.floor(i.length/u),f=p%u,C=Math.floor(p/u),b=C*u+f,g=d*u;v.KEYCODE.ARROW_UP===a?b=((b-u)%g+g)%g:v.KEYCODE.ARROW_DOWN===a?b=(b+u)%g:v.KEYCODE.ARROW_LEFT===a?b=((b-1)%g+g)%g:v.KEYCODE.ARROW_RIGHT===a&&(b=(b+1)%g);var E=O(i.get(b));m.events.disableBlur(),E.focus(),c=!1}}else v.KEYCODE.ENTER===a&&(m.button.exec(t),c=!1);return!1===c&&(o.preventDefault(),o.stopPropagation()),c},!0)}(a,"".concat(o,".picker")),a}(o)),!r.hasClass("fr-active"))if(m.popups.setContainer("".concat(o,".picker"),m.$tb),i("textColor"===o?"text":"background"),t.isVisible()){var e=m.button.getPosition(t),a=e.left,c=e.top;m.popups.show("".concat(o,".picker"),a,c,t.outerHeight())}else m.position.forSelection(r),m.popups.show("".concat(o,".picker"))},background:e,customColor:function c(o){var t=m.popups.get("".concat(o,"Color.picker")).find(".fr-color-hex-layer input");if(t.length){var r=t.val();"background"===o?e(r):a(r)}},text:a,back:function o(){m.popups.hide("textColor.picker"),m.popups.hide("backgroundColor.picker"),m.toolbar.showInline()}}},v.DefineIcon("textColor",{NAME:"tint",SVG_KEY:"textColor"}),v.RegisterCommand("textColor",{title:"Text Color",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("textColor.picker")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("textColor.picker")):this.colors.showColorsPopup("textColor")}}),v.RegisterCommand("applytextColor",{undo:!0,callback:function(o,t){this.colors.text(t)}}),v.RegisterCommand("customTextColor",{title:"OK",undo:!0,callback:function(){this.colors.customColor("text")}}),v.DefineIcon("backgroundColor",{NAME:"paint-brush",SVG_KEY:"backgroundColor"}),v.RegisterCommand("backgroundColor",{title:"Background Color",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("backgroundColor.picker")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("backgroundColor.picker")):this.colors.showColorsPopup("backgroundColor")}}),v.RegisterCommand("applybackgroundColor",{undo:!0,callback:function(o,t){this.colors.background(t)}}),v.RegisterCommand("customBackgroundColor",{title:"OK",undo:!0,callback:function(){this.colors.customColor("background")}}),v.DefineIcon("colorsBack",{NAME:"arrow-left",SVG_KEY:"back"}),v.RegisterCommand("colorsBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.colors.back()}}),v.DefineIcon("remove",{NAME:"eraser",SVG_KEY:"remove"})});
7
+ !function(o,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(("undefined"!=typeof globalThis?globalThis:o||self).FroalaEditor)}(this,function(f){"use strict";Object.assign(f.POPUP_TEMPLATES,{"textColor.picker":"[_BUTTONS_][_TEXT_COLORS_][_CUSTOM_COLOR_]","backgroundColor.picker":"[_BUTTONS_][_BACKGROUND_COLORS_][_CUSTOM_COLOR_]"}),Object.assign(f.DEFAULTS,{colorsText:["#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"],colorsBackground:["#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"],colorsStep:7,colorsHEXInput:!0,colorsButtons:["colorsBack","|","-"]}),f.PLUGINS.colors=function(u){var d=u.$,a='<div class="fr-color-hex-layer fr-active fr-layer" id="fr-color-hex-layer- \n '.concat(u.id,'"><div class="fr-input-line"><input maxlength="9" id="[ID]"\n type="text" placeholder="').concat(u.language.translate("HEX Color"),'" \n tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button \n type="button" class="fr-command fr-submit" data-cmd="[COMMAND]" tabIndex="2" role="button">\n ').concat(u.language.translate("OK"),"</button></div></div>");function n(o){for(var t="text"===o?u.opts.colorsText:u.opts.colorsBackground,e='<div class="fr-color-set fr-'.concat(o,'-color fr-selected-set">'),r=0;r<t.length;r++)0!==r&&r%u.opts.colorsStep==0&&(e+="<br>"),"REMOVE"!==t[r]?e+='<span class="fr-command fr-select-color" style="background:'.concat(t[r].toUpperCase(),';" \n tabIndex="-1" aria-selected="false" role="button" data-cmd="apply').concat(o,'Color" \n data-param1="').concat(t[r].toUpperCase(),'"><span class="fr-sr-only"> ').concat(u.language.translate("Color")).concat(t[r]," \n &nbsp;&nbsp;&nbsp;</span></span>"):e+='<span class="fr-command fr-select-color" data-cmd="apply'.concat(o,'Color"\n tabIndex="-1" role="button" data-param1="REMOVE" \n title="').concat(u.language.translate("Clear Formatting"),'">').concat(u.icon.create("remove"),' \n <span class="fr-sr-only"> ').concat(u.language.translate("Clear Formatting")," </span></span>");return"".concat(e,"</div>")}function s(o){var t=u.popups.get("".concat(o,"Color.picker")),e=d(u.selection.element()),r="background"===o?"background-color":"color",c=t.find(".fr-".concat(o,"-color .fr-select-color"));for(c.find(".fr-selected-color").remove(),c.removeClass("fr-active-item"),c.not('[data-param1="REMOVE"]').attr("aria-selected",!1);e.get(0)!==u.el;){if("transparent"!==e.css(r)&&"rgba(0, 0, 0, 0)"!==e.css(r)){var a=t.find(".fr-".concat(o,'-color .fr-select-color[data-param1="').concat(u.helpers.RGBToHex(e.css(r)),'"]'));a.append('<span class="fr-selected-color" aria-hidden="true">\uf00c</span>'),a.addClass("fr-active-item").attr("aria-selected",!0);break}e=e.parent()}var c=o,c=(n=u.popups.get("".concat(c,"Color.picker"))).find(".fr-".concat(c,"-color .fr-active-item")).attr("data-param1"),n=n.find(".fr-color-hex-layer input");c=c||"",n.length&&d(n.val(c).input).trigger("change")}function e(o){"REMOVE"!==o?u.format.applyStyle("background-color",u.helpers.HEXtoRGB(o)):u.format.removeStyle("background-color"),u.selection.save(),u.popups.hide("backgroundColor.picker"),u.selection.restore()}function r(o){"REMOVE"!==o?u.format.applyStyle("color",u.helpers.HEXtoRGB(o)):u.format.removeStyle("color"),u.selection.save(),u.popups.hide("textColor.picker"),u.selection.restore()}return{showColorsPopup:function(o){var t,e,r=u.$tb.find('.fr-command[data-cmd="'.concat(o,'"]')),c=u.popups.get("".concat(o,".picker"));(c=c||function(o){var t="";u.opts.toolbarInline&&0<u.opts.colorsButtons.length&&(t+='<div class="fr-buttons fr-colors-buttons fr-tabs">\n '.concat(u.button.buildList(u.opts.colorsButtons),"\n </div>"));var e="";t="textColor"===o?(u.opts.colorsHEXInput&&(e=a.replace(/\[ID\]/g,"fr-color-hex-layer-text-".concat(u.id)).replace(/\[COMMAND\]/g,"customTextColor")),{buttons:t,text_colors:n("text"),custom_color:e}):(u.opts.colorsHEXInput&&(e=a.replace(/\[ID\]/g,"fr-color-hex-layer-background-".concat(u.id)).replace(/\[COMMAND\]/g,"customBackgroundColor")),{buttons:t,background_colors:n("background"),custom_color:e});e=u.popups.create("".concat(o,".picker"),t);return function(i,p){u.events.on("popup.tab",function(o){var t,e,r,c,a,n,s,l=d(o.currentTarget);return!u.popups.isVisible(p)||!l.is("span, input, button")||(t=o.which,e=!0,f.KEYCODE.TAB===t?(r=i.find("span.fr-select-color"),(l.is(r.first())&&o.shiftKey||l.is(i.find("span.fr-submit"))&&!o.shiftKey)&&(r=i.find(".fr-buttons"),e=!u.accessibility.focusToolbar(r,!!o.shiftKey)),!1!==e&&((r=i.find("span.fr-select-color")).add(i.find("input")),r.add(i.find("button.fr-submit")),a=r.index(l),a=o.shiftKey?((a-1)%r.length+r.length)%r.length:(a+1)%r.length,a=r.get(a),u.events.disableBlur(),a.focus(),e=!1)):f.KEYCODE.ARROW_UP===t||f.KEYCODE.ARROW_DOWN===t||f.KEYCODE.ARROW_LEFT===t||f.KEYCODE.ARROW_RIGHT===t?l.is("span.fr-select-color")&&(a=(r=l.parent().find("span.fr-select-color")).index(l),c=u.opts.colorsStep,s=Math.floor(r.length/c),n=a%c,a=Math.floor(a/c)*c+n,n=s*c,f.KEYCODE.ARROW_UP===t?a=((a-c)%n+n)%n:f.KEYCODE.ARROW_DOWN===t?a=(a+c)%n:f.KEYCODE.ARROW_LEFT===t?a=((a-1)%n+n)%n:f.KEYCODE.ARROW_RIGHT===t&&(a=(a+1)%n),s=d(r.get(a)),u.events.disableBlur(),s.focus(),e=!1):f.KEYCODE.ENTER===t&&(u.button.exec(l),e=!1),!1===e&&(o.preventDefault(),o.stopPropagation()),e)},!0)}(e,"".concat(o,".picker")),e}(o)).hasClass("fr-active")||(u.undo.saveStep(),u.popups.setContainer("".concat(o,".picker"),u.$tb),null!=(e=u.popups.get("".concat(t="textColor"===o?"backgroundColor":"textColor",".picker")))&&e.hasClass("fr-active")?u.popups.hide("".concat(t,".picker")):u.selection.save(),s("textColor"===o?"text":"background"),r.isVisible()?(t=(e=u.button.getPosition(r)).left,e=e.top,u.popups.show("".concat(o,".picker"),t,e,r.outerHeight())):(u.position.forSelection(c),u.popups.show("".concat(o,".picker"))))},background:e,customColor:function(o){var t=u.popups.get("".concat(o,"Color.picker")).find(".fr-color-hex-layer input");t.length&&("background"===o?e:r)(t.val())},text:r,back:function(){u.popups.hide("textColor.picker"),u.popups.hide("backgroundColor.picker"),u.toolbar.showInline()}}},f.DefineIcon("textColor",{NAME:"tint",SVG_KEY:"textColor"}),f.RegisterCommand("textColor",{title:"Text Color",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("textColor.picker")?(this.$el.find(".fr-marker").length&&this.events.disableBlur(),this.popups.hide("textColor.picker")):this.colors.showColorsPopup("textColor")}}),f.RegisterCommand("applytextColor",{undo:!0,callback:function(o,t){this.colors.text(t)}}),f.RegisterCommand("customTextColor",{title:"OK",undo:!0,callback:function(){this.colors.customColor("text")}}),f.DefineIcon("backgroundColor",{NAME:"paint-brush",SVG_KEY:"backgroundColor"}),f.RegisterCommand("backgroundColor",{title:"Background Color",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("backgroundColor.picker")?(this.$el.find(".fr-marker").length&&this.events.disableBlur(),this.popups.hide("backgroundColor.picker")):this.colors.showColorsPopup("backgroundColor")}}),f.RegisterCommand("applybackgroundColor",{undo:!0,callback:function(o,t){this.colors.background(t)}}),f.RegisterCommand("customBackgroundColor",{title:"OK",undo:!0,callback:function(){this.colors.customColor("background")}}),f.DefineIcon("colorsBack",{NAME:"arrow-left",SVG_KEY:"back"}),f.RegisterCommand("colorsBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.colors.back()}}),f.DefineIcon("remove",{NAME:"eraser",SVG_KEY:"remove"})});