UNPKG

froala-editor

Version:

The next generation Javascript WYSIWYG HTML rich text editor made by devs for devs. High performance and modern design make it easy to use for developers and loved by users.

7 lines (6 loc) 807 kB
/*! * froala_editor v5.0.1 (https://www.froala.com/wysiwyg-editor) * License https://froala.com/wysiwyg-editor/terms/ * Copyright 2014-2026 Froala Labs */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(("undefined"!=typeof globalThis?globalThis:e||self).FroalaEditor)}(this,function(ct){"use strict";function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function l(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function g(s){return function(){var e=this,o=arguments;return new Promise(function(t,n){var a=s.apply(e,o);function r(e){l(a,t,n,r,i,"next",e)}function i(e){l(a,t,n,r,i,"throw",e)}r(void 0)})}}function Te(e,t){var n,a,r,i,o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(o)return r=!(a=!0),{s:function(){o=o.call(e)},n:function(){var e=o.next();return a=e.done,e},e:function(e){r=!0,n=e},f:function(){try{a||null==o["return"]||o["return"]()}finally{if(r)throw n}}};if(Array.isArray(e)||(o=s(e))||t)return o&&(e=o),i=0,{s:t=function(){},n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(){var g,h,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function a(e,t,n,a){var r,i,o,s,l,c,d,f,p,t=t&&t.prototype instanceof v?t:v,t=Object.create(t.prototype);return b(t,"_invoke",(r=e,i=n,d=a||[],f=!1,p={p:c=0,n:0,v:g,a:u,f:u.bind(g,4),d:function(e,t){return o=e,s=0,l=g,p.n=t,m}},function(e,t,n){if(1<c)throw TypeError("Generator is already running");for(f&&1===t&&u(t,n),s=t,l=n;(h=s<2?g:l)||!f;){o||(s?s<3?(1<s&&(p.n=-1),u(s,l)):p.n=l:p.v=l);try{if(c=2,o){if(h=o[e=s?e:"next"]){if(!(h=h.call(o,l)))throw TypeError("iterator result is not an object");if(!h.done)return h;l=h.value,s<2&&(s=0)}else 1===s&&(h=o["return"])&&h.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+e+"' method"),s=1);o=g}else if((h=(f=p.n<0)?l:r.call(i,p))!==m)break}catch(h){o=g,s=1,l=h}finally{c=1}}return{value:h,done:f}}),!0),t;function u(e,t){for(s=e,l=t,h=0;!f&&c&&!n&&h<d.length;h++){var n,a=d[h],r=p.p,i=a[2];3<e?(n=i===t)&&(l=a[(s=a[4])?5:s=3],a[4]=a[5]=g):a[0]<=r&&((n=e<2&&r<a[1])?(s=0,p.v=t,p.n=a[1]):r<i&&(n=e<3||a[0]>t||i<t)&&(a[4]=e,a[5]=t,p.n=i,s=0))}if(n||1<e)return m;throw f=!0,t}}var m={};function v(){}function r(){}function i(){}h=Object.getPrototypeOf;var e=[][t]?h(h([][t]())):(b(h={},t,function(){return this}),h),o=i.prototype=v.prototype=Object.create(e);function s(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,b(e,n,"GeneratorFunction")),e.prototype=Object.create(o),e}return b(o,"constructor",r.prototype=i),b(i,"constructor",r),b(i,n,r.displayName="GeneratorFunction"),b(o),b(o,n,"Generator"),b(o,t,function(){return this}),b(o,"toString",function(){return"[object Generator]"}),(w=function(){return{w:a,m:s}})()}function b(e,t,n,a){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}(b=function(e,t,n,a){function r(t,n){b(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!a,configurable:!a,writable:!a}):e[t]=n:(r("next",0),r("throw",1),r("return",2))})(e,t,n,a)}function ke(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dt(e){return(dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){var n;if(e)return"string"==typeof e?a(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}if(ct.PLUGINS.align=function(d){var f=d.$;return{apply:function(t){var e=d.selection.ranges(0),n=(n=e.commonAncestorContainer).nodeType===Node.TEXT_NODE?d.selection.element():n,a=f(n).closest("table.fr-selection-handle-selected"),r=f(n).parents("TD, TH"),i=!d.selection.isCollapsed(),o="TD"===n.tagName||"TH"===n.tagName,e=(i=i&&o)&&(null==(s=n.textContent)?void 0:s.trim())===(null==(s=e.toString())?void 0:s.trim()),s=d.table&&d.table.selectedCells(),o=o||s&&0<s.length||r.length&&d.el.contains(r.get(0))&&"BR"===n.tagName;if(f(n).parents(".fr-img-caption").length)f(n).css("text-align",t);else if(a.length&&d.el.contains(a[0]))a.find("td").css("text-align",t);else if(o&&!i||e)s&&s.length?s.forEach(function(e){e=f(e);e.css("text-align",t),e.children().css("text-align","")}):((a=["TD","TH"].includes(n.tagName)?f(n):r).css("text-align",t),a.children().css("text-align",""));else{d.selection.save(),s&&s.length||d.html.wrap(!0,!0,!0,!0),d.selection.restore();for(var l=d.helpers.selectionBlocks([".fr-code-snippet"]),c=0;c<l.length;c++)f(l[c]).css("text-align",t).removeClass("fr-temp-div"),""===f(l[c]).attr("class")&&f(l[c]).removeAttr("class"),""===f(l[c]).attr("style")&&f(l[c]).removeAttr("style");d.selection.save(),d.html.unwrap(),d.selection.restore()}},refresh:function(e){var t=d.selection.blocks();t.length&&(t=d.helpers.getAlignment(f(t[0])),e.find("> *").first().replaceWith(d.icon.create("align-".concat(t))))},refreshOnShow:function(e,t){var n=d.selection.blocks();n.length&&(n=d.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=d.selection.blocks();t.length&&(t=(t=d.helpers.getAlignment(f(t[0]))).charAt(0).toUpperCase()+t.slice(1),"align".concat(t)===e.attr("data-cmd"))&&e.addClass("fr-active")}}},ct.DefineIcon("align",{NAME:"align-left",SVG_KEY:"alignLeft"}),ct.DefineIcon("align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),ct.DefineIcon("align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),ct.DefineIcon("align-center",{NAME:"align-center",SVG_KEY:"alignCenter"}),ct.DefineIcon("align-justify",{NAME:"align-justify",SVG_KEY:"alignJustify"}),ct.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=ct.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"}),ct.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"}),ct.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"}),ct.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"}),ct.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"}),Object.assign(ct.DEFAULTS,{charCounterMax:-1,charCounterCount:!0}),ct.PLUGINS.charCounter=function(d){var t,f,a=d.$;function e(e){var t=d.opts.charCounterMax;if(!(t<0)){var n=f();if("keydown"===e.type){if(n<t)return!0;var a=e.which;if(!d.keys.ctrlKey(e)&&d.keys.isCharacter(a)||a===ct.KEYCODE.IME)return e.preventDefault(),e.stopPropagation(),d.events.trigger("charCounter.exceeded"),!1}a=e.originalEvent&&e.originalEvent.inputType||"";if(!/delete|historyUndo|historyRedo/.test(a)){if("beforeinput"===e.type){a=e.data||e.originalEvent&&e.originalEvent.data||e.originalEvent&&e.originalEvent.dataTransfer&&e.originalEvent.dataTransfer.getData("text")||"",a=n-d.win.getSelection().toString().length+a.length;if(t-n<=0||t<a)return e.preventDefault(),e.stopPropagation(),d.events.trigger("charCounter.exceeded"),!1}if("input"===e.type&&t<n){d.selection.save();for(var r,a=d.el,i=t,o="",s=document.createTreeWalker(a,NodeFilter.SHOW_TEXT,null,!1),l=!0;(r=s.nextNode())&&o.length<i;){var c=i-o.length;if(r.textContent.length>c){r.textContent=r.textContent.slice(0,c),l=!1;break}o+=r.textContent}for(l&&(r=s.previousNode());r=s.nextNode();)r.textContent="";d.selection.restore()}}}return!0}function n(e){return d.opts.charCounterMax<0||a("<div>").html(e).text().length+f()<=d.opts.charCounterMax?e:(d.events.trigger("charCounter.exceeded"),"")}function r(e,t,n){return d.opts.charCounterMax<0||(e.includes('<span class="fr-emoticon')||e.includes('<i class="fa ')?!(f()>=d.opts.charCounterMax&&(d.events.trigger("charCounter.exceeded"),1)):a("<div>").html(e).text().length+f()<=d.opts.charCounterMax||(d.events.trigger("charCounter.exceeded"),!1))}function i(){var e;d.opts.charCounterCount&&(e=f()+(0<d.opts.charCounterMax?"/"+d.opts.charCounterMax:""),t.text("".concat(d.language.translate("Characters")," : ").concat(e)),d.opts.toolbarBottom&&t.css("margin-bottom",d.$tb.outerHeight(!0)),0<=(e=d.$wp.get(0).offsetWidth-d.$wp.get(0).clientWidth))&&("rtl"==d.opts.direction?t.css("margin-left",e):t.css("margin-right",e))}return{_init:function(){return!!d.$wp&&!!d.opts.charCounterCount&&((t=a(document.createElement("span")).attr("class","fr-counter")).css("bottom",d.$wp.css("border-bottom-width")),(d.$second_tb||d.$wp).append(t),d.events.on("keydown beforeinput input",e,!0),d.events.on("paste.afterCleanup",n),d.events.on("keyup contentChanged input",function(){d.events.trigger("charCounter.update")}),d.events.on("html.beforeInsert",r),d.events.on("charCounter.update",i),d.events.trigger("charCounter.update"),void d.events.on("destroy",function(){a(d.o_win).off("resize.char".concat(d.id)),t.removeData().remove(),t=null}))},count:f=function f(){var e=d.opts.iframe&&d.markdown&&d.markdown.isEnabled()?d.$el.text()||"":d.el.textContent||"",t=d.$el.find(".fr-page-break"),n=(t.text()||"").length;return e.replace(/\u200B/g,"").length-n*t.length}}},ct.PLUGINS.codeBeautifier=function(){var e,t,n,a,K={};function C(a,e){var n,t={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},r={"@media":!0,"@supports":!0,"@document":!0},i=(e=e||{},a=(a=a||"").replace(/\r\n|[\r\u2028\u2029]/g,"\n"),e.indent_size||4),o=e.indent_char||" ",s=e.selector_separator_newline===undefined||e.selector_separator_newline,l=e.end_with_newline!==undefined&&e.end_with_newline,c=e.newline_between_rules===undefined||e.newline_between_rules,d=e.eol||"\n",f=("string"==typeof i&&(i=parseInt(i,10)),e.indent_with_tabs&&(o="\t",i=1),d=d.replace(/\\r/,"\r").replace(/\\n/,"\n"),/^\s+$/),p=-1,u=0;function g(){return(n=a.charAt(++p))||""}function h(e){var t=p;return e&&v(),e=a.charAt(p+1)||"",p=t-1,g(),e}function m(e){for(var t=p;g();)if("\\"===n)g();else{if(-1!==e.indexOf(n))break;if("\n"===n)break}return a.substring(t,p+1)}function v(){for(;f.test(h());)g(),0}function b(e){var t=p;for(e="/"===h(),g();g();){if(!e&&"*"===n&&"/"===h()){g();break}if(e&&"\n"===n)return a.substring(t,p)}return a.substring(t,p)+n}function E(e){return a.substring(p-e.length,p).toLowerCase()===e}var y=a.match(/^[\t ]*/)[0],w=new Array(i+1).join(o),_=0,C=0;for(var A={"{":function(e){A.singleSpace(),T.push(e),A.newLine()},"}":function(e){A.newLine(),T.push(e),A.newLine()},_lastCharWhitespace:function(){return f.test(T[T.length-1])},newLine:function(e){T.length&&(e||"\n"===T[T.length-1]||A.trim(),T.push("\n"),y)&&T.push(y)},singleSpace:function(){T.length&&!A._lastCharWhitespace()&&T.push(" ")},preserveSingleSpace:function(){O&&A.singleSpace()},trim:function(){for(;A._lastCharWhitespace();)T.pop()}},T=[],k=!1,S=!1,R=!1,x="";;){var L,I=function(){var e="";for(n&&f.test(n)&&(e=n);f.test(g());)e+=n;return e}(),O=""!==I,I=-1!==I.indexOf("\n"),M=x,x=n;if(!n)break;"/"===n&&"*"===h()?(L=0===_,(I||L)&&A.newLine(),T.push(b()),A.newLine(),L&&A.newLine(!0)):"/"===n&&"/"===h()?(I||"{"===M||A.trim(),A.singleSpace(),T.push(b()),A.newLine()):"@"===n?(A.preserveSingleSpace(),T.push(n),L=void 0,L=p,I=m(I=": , {}()[]/='\""),p=L-1,g(),(M=I).match(/[ :]$/)&&(g(),M=m(": ").replace(/\s$/,""),T.push(M),A.singleSpace()),(M=M.replace(/\s$/,""))in t&&(C+=1,M in r)&&(R=!0)):"#"===n&&"{"===h()?(A.preserveSingleSpace(),T.push(m("}"))):"{"===n?"}"===h(!0)?(v(),g(),A.singleSpace(),T.push("{}"),A.newLine(),c&&0===_&&A.newLine(!0)):(_++,y+=w,A["{"](n),k=R?(R=!1,C<_):C<=_):"}"===n?(_--,y=y.slice(0,-i),A["}"](n),S=k=!1,C&&C--,c&&0===_&&A.newLine(!0)):":"===n?(v(),!k&&!R||E("&")||function(){for(var e=0,t=p+1;t<a.length;t++){var n=a.charAt(t);if("{"===n)return 1;if("("===n)e+=1;else if(")"===n){if(0===e)return;--e}else if(" "===n||"}"===n)return}}()?":"===h()?(g(),T.push("::")):T.push(":"):(S=!0,T.push(":"),A.singleSpace())):'"'===n||"'"===n?(A.preserveSingleSpace(),T.push(m(n))):" "===n?(S=!1,T.push(n),A.newLine()):"("===n?E("url")?(T.push(n),v(),g()&&(")"!==n&&'"'!==n&&"'"!==n?T.push(m(")")):p--)):(u++,A.preserveSingleSpace(),T.push(n),v()):")"===n?(T.push(n),u--):","===n?(T.push(n),v(),s&&!S&&u<1?A.newLine():A.singleSpace()):("]"!==n&&("["!==n&&"="===n?(v(),n="="):A.preserveSingleSpace()),T.push(n))}e="";return y&&(e+=y),e+=T.join("").replace(/[\r\n\t ]+$/,""),l&&(e+="\n"),e="\n"!=d?e.replace(/[\n]/g,d):e}function W(e,t){for(var n=0;n<t.length;n+=1)if(t[n]===e)return!0;return!1}function V(e){return e.replace(/^\s+|\s+$/g,"")}function A(e,t){return new r(e,t).beautify()}e=K,t="\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(t,"]")),a=new RegExp("[".concat(t," ").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","]")),e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|".concat(e.newline.source)),e.allLineBreaks=new RegExp(e.lineBreak.source,"g"),e.isIdentifierStart=function(e){return e<65?36===e||64===e:e<91||(e<97?95===e:e<123||170<=e&&n.test(String.fromCharCode(e)))},e.isIdentifierChar=function(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||170<=e&&a.test(String.fromCharCode(e))))};var F={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function r(a,e){var o,r,i,s,l,c,t,d,n,f,p,u,g,h=[],m="";function v(e,t){var n=0;return e&&(n=e.indentation_level,!o.just_added_newline())&&e.line_indent_level>n&&(n=e.line_indent_level),{mode:t,parent:e,last_text:e?e.last_text:"",last_word:e?e.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:e?e.line_indent_level:n,start_line_index:o.get_line_number(),ternary_depth:0}}for(u={TK_START_EXPR:function(){L();var e=F.Expression;if("["===s.text){if("TK_WORD"===l||")"===d.last_text)return"TK_RESERVED"===l&&W(d.last_text,i.line_starters)&&(o.space_before_token=!0),T(e),C(),A(),void(g.space_in_paren&&(o.space_before_token=!0));e=F.ArrayLiteral,!k(d.mode)||"["!==d.last_text&&(","!==d.last_text||"]"!==c&&"}"!==c)||g.keep_array_indentation||w()}else"TK_RESERVED"===l&&"for"===d.last_text?e=F.ForInitializer:"TK_RESERVED"===l&&W(d.last_text,["if","while"])&&(e=F.Conditional);" "===d.last_text||"TK_START_BLOCK"===l?w():"TK_END_EXPR"===l||"TK_START_EXPR"===l||"TK_END_BLOCK"===l||"."===d.last_text?y(s.wanted_newline):"TK_RESERVED"===l&&"("===s.text||"TK_WORD"===l||"TK_OPERATOR"===l?"TK_RESERVED"===l&&("function"===d.last_word||"typeof"===d.last_word)||"*"===d.last_text&&"function"===c?g.space_after_anon_function&&(o.space_before_token=!0):"TK_RESERVED"!==l||!W(d.last_text,i.line_starters)&&"catch"!==d.last_text||g.space_before_conditional&&(o.space_before_token=!0):o.space_before_token=!0;"("===s.text&&"TK_RESERVED"===l&&"await"===d.last_word&&(o.space_before_token=!0);"("!==s.text||"TK_EQUALS"!==l&&"TK_OPERATOR"!==l||x()||y();T(e),C(),g.space_in_paren&&(o.space_before_token=!0);A()},TK_END_EXPR:function(){for(;d.mode===F.Statement;)R();d.multiline_frame&&y("]"===s.text&&k(d.mode)&&!g.keep_array_indentation);g.space_in_paren&&("TK_START_EXPR"!==l||g.space_in_empty_paren?o.space_before_token=!0:(o.trim(),o.space_before_token=!1));("]"===s.text&&g.keep_array_indentation?(C(),R):(R(),C))();o.remove_redundant_indentation(n),d.do_while&&n.mode===F.Conditional&&(n.mode=F.Expression,d.do_block=!1,d.do_while=!1)},TK_START_BLOCK:function(){var e=O(1),t=O(2);!t||!(":"===t.text&&W(e.type,["TK_STRING","TK_WORD","TK_RESERVED"])||W(e.text,["get","set"])&&W(t.type,["TK_WORD","TK_RESERVED"]))||W(c,["class","interface"])?T(F.BlockStatement):T(F.ObjectLiteral);t=!e.comments_before.length&&"}"===e.text&&"function"===d.last_word&&"TK_END_EXPR"===l;"expand"===g.brace_style||"none"===g.brace_style&&s.wanted_newline?"TK_OPERATOR"!==l&&(t||"TK_EQUALS"===l||"TK_RESERVED"===l&&I(d.last_text)&&"else"!==d.last_text)?o.space_before_token=!0:w(!1,!0):"TK_OPERATOR"!==l&&"TK_START_EXPR"!==l?"TK_START_BLOCK"===l?w():o.space_before_token=!0:k(n.mode)&&","===d.last_text&&("}"===c?o.space_before_token=!0:w());C(),A()},TK_END_BLOCK:function(){for(;d.mode===F.Statement;)R();var e="TK_START_BLOCK"===l;"expand"===g.brace_style?e||w():e||(k(d.mode)&&g.keep_array_indentation?(g.keep_array_indentation=!1,w(),g.keep_array_indentation=!0):w());R(),C()},TK_WORD:M,TK_RESERVED:M,TK_SEMICOLON:function(){L()&&(o.space_before_token=!1);for(;d.mode===F.Statement&&!d.if_block&&!d.do_block;)R();C()},TK_STRING:function(){L()||"TK_RESERVED"===l||"TK_WORD"===l?o.space_before_token=!0:"TK_COMMA"===l||"TK_START_EXPR"===l||"TK_EQUALS"===l||"TK_OPERATOR"===l?x()||y():w();C()},TK_EQUALS:function(){L();d.declaration_statement&&(d.declaration_assignment=!0);o.space_before_token=!0,C(),o.space_before_token=!0},TK_OPERATOR:function(){L();var e,t;"TK_RESERVED"===l&&I(d.last_text)?(o.space_before_token=!0,C()):"*"===s.text&&"TK_DOT"===l?C():":"===s.text&&d.in_case?(d.case_body=!0,A(),C(),w(),d.in_case=!1):"::"===s.text?C():("TK_OPERATOR"===l&&y(),t=e=!0,W(s.text,["--","++","!","~"])||W(s.text,["-","+"])&&(W(l,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||W(d.last_text,i.line_starters)||","===d.last_text)?(t=e=!1,!s.wanted_newline||"--"!==s.text&&"++"!==s.text||w(!1,!0)," "===d.last_text&&S(d.mode)&&(e=!0),"TK_RESERVED"===l?e=!0:"TK_END_EXPR"===l?e=!("]"===d.last_text&&("--"===s.text||"++"===s.text)):"TK_OPERATOR"===l&&(e=W(s.text,["--","-","++","+"])&&W(d.last_text,["--","-","++","+"]),W(s.text,["+","-"]))&&W(d.last_text,["--","++"])&&(t=!0),d.mode!==F.BlockStatement&&d.mode!==F.Statement||"{"!==d.last_text&&" "!==d.last_text||w()):":"===s.text?0===d.ternary_depth?e=!1:--d.ternary_depth:"?"===s.text?d.ternary_depth+=1:"*"===s.text&&"TK_RESERVED"===l&&"function"===d.last_text&&(t=e=!1),o.space_before_token=o.space_before_token||e,C(),o.space_before_token=t)},TK_COMMA:function(){d.declaration_statement?(S(d.parent.mode)&&(d.declaration_assignment=!1),C(),d.declaration_assignment?w(d.declaration_assignment=!1,!0):(o.space_before_token=!0,g.comma_first&&y())):(C(),d.mode===F.ObjectLiteral||d.mode===F.Statement&&d.parent.mode===F.ObjectLiteral?(d.mode===F.Statement&&R(),w()):(o.space_before_token=!0,g.comma_first&&y()))},TK_BLOCK_COMMENT:function(){if(o.raw)o.add_raw_token(s),!s.directives||"end"!==s.directives.preserve||g.test_output_raw||(o.raw=!1);else if(s.directives)w(!1,!0),C(),"start"===s.directives.preserve&&(o.raw=!0),w(!1,!0);else if(K.newline.test(s.text)||s.wanted_newline){var e,t=function(e){e=e.replace(/\x0d/g,"");var t,n=[];t=e.indexOf("\n");for(;-1!==t;)n.push(e.substring(0,t)),e=e.substring(t+1),t=e.indexOf("\n");e.length&&n.push(e);return n}(s.text),n=!1,a=!1,r=s.whitespace_before,i=r.length;for(w(!1,!0),1<t.length&&(!function(e,t){for(var n=0;n<e.length;n++)if(V(e[n]).charAt(0)!==t)return;return 1}(t.slice(1),"*")?function(e,t){for(var n,a=0,r=e.length;a<r;a++)if((n=e[a])&&0!==n.indexOf(t))return;return 1}(t.slice(1),r)&&(a=!0):n=!0),C(t[0]),e=1;e<t.length;e++)w(!1,!0),n?C(" ".concat(t[e].replace(/^\s+/g,""))):a&&t[e].length>i?C(t[e].substring(i)):o.add_token(t[e]);w(!1,!0)}else o.space_before_token=!0,C(),o.space_before_token=!0},TK_COMMENT:function(){s.wanted_newline?w(!1,!0):o.trim(!0);o.space_before_token=!0,C(),w(!1,!0)},TK_DOT:function(){L();"TK_RESERVED"===l&&I(d.last_text)?o.space_before_token=!0:y(")"===d.last_text&&g.break_chained_methods);C()},TK_UNKNOWN:function(){C(),"\n"===s.text[s.text.length-1]&&w()},TK_EOF:function(){for(;d.mode===F.Statement;)R()}},g={},(e=e||{}).braces_on_own_line!==undefined&&(g.brace_style=e.braces_on_own_line?"expand":"collapse"),g.brace_style=e.brace_style||g.brace_style||"collapse","expand-strict"===g.brace_style&&(g.brace_style="expand"),g.indent_size=e.indent_size?parseInt(e.indent_size,10):4,g.indent_char=e.indent_char||" ",g.eol=e.eol||"\n",g.preserve_newlines=e.preserve_newlines===undefined||e.preserve_newlines,g.break_chained_methods=e.break_chained_methods!==undefined&&e.break_chained_methods,g.max_preserve_newlines=e.max_preserve_newlines===undefined?0:parseInt(e.max_preserve_newlines,10),g.space_in_paren=e.space_in_paren!==undefined&&e.space_in_paren,g.space_in_empty_paren=e.space_in_empty_paren!==undefined&&e.space_in_empty_paren,g.jslint_happy=e.jslint_happy!==undefined&&e.jslint_happy,g.space_after_anon_function=e.space_after_anon_function!==undefined&&e.space_after_anon_function,g.keep_array_indentation=e.keep_array_indentation!==undefined&&e.keep_array_indentation,g.space_before_conditional=e.space_before_conditional===undefined||e.space_before_conditional,g.unescape_strings=e.unescape_strings!==undefined&&e.unescape_strings,g.wrap_line_length=e.wrap_line_length===undefined?0:parseInt(e.wrap_line_length,10),g.e4x=e.e4x!==undefined&&e.e4x,g.end_with_newline=e.end_with_newline!==undefined&&e.end_with_newline,g.comma_first=e.comma_first!==undefined&&e.comma_first,g.test_output_raw=e.test_output_raw!==undefined&&e.test_output_raw,g.jslint_happy&&(g.space_after_anon_function=!0),e.indent_with_tabs&&(g.indent_char="\t",g.indent_size=1),g.eol=g.eol.replace(/\\r/,"\r").replace(/\\n/,"\n"),t="";0<g.indent_size;)t+=g.indent_char,--g.indent_size;var b=0;if(a&&a.length){for(;" "===a.charAt(b)||"\t"===a.charAt(b);)m+=a.charAt(b),b+=1;a=a.substring(b)}function E(e){var t=e.newlines;if(g.keep_array_indentation&&k(d.mode))for(var n=0;n<t;n+=1)w(0<n);else if(g.max_preserve_newlines&&t>g.max_preserve_newlines&&(t=g.max_preserve_newlines),g.preserve_newlines&&1<e.newlines){w();for(var a=1;a<t;a+=1)w(!0)}u[(s=e).type]()}function y(e){e=e!==undefined&&e,o.just_added_newline()||(g.preserve_newlines&&s.wanted_newline||e||g.wrap_line_length&&o.current_line.get_character_count()+s.text.length+(o.space_before_token?1:0)>=g.wrap_line_length)&&w(!1,!0)}function w(e,t){if(!t&&" "!==d.last_text&&","!==d.last_text&&"="!==d.last_text&&"TK_OPERATOR"!==l)for(;d.mode===F.Statement&&!d.if_block&&!d.do_block;)R();o.add_new_line(e)&&(d.multiline_frame=!0)}function _(){o.just_added_newline()&&(g.keep_array_indentation&&k(d.mode)&&s.wanted_newline?(o.current_line.push(s.whitespace_before),o.space_before_token=!1):o.set_indent(d.indentation_level)&&(d.line_indent_level=d.indentation_level))}function C(e){o.raw?o.add_raw_token(s):(g.comma_first&&"TK_COMMA"===l&&o.just_added_newline()&&","===o.previous_line.last()&&(o.previous_line.pop(),_(),o.add_token(","),o.space_before_token=!0),e=e||s.text,_(),o.add_token(e))}function A(){d.indentation_level+=1}function T(e){n=d?(f.push(d),d):v(null,e),d=v(n,e)}function k(e){return e===F.ArrayLiteral}function S(e){return W(e,[F.Expression,F.ForInitializer,F.Conditional])}function R(){0<f.length&&(n=d,d=f.pop(),n.mode===F.Statement)&&o.remove_redundant_indentation(n)}function x(){return d.parent.mode===F.ObjectLiteral&&d.mode===F.Statement&&(":"===d.last_text&&0===d.ternary_depth||"TK_RESERVED"===l&&W(d.last_text,["get","set"]))}function L(){return("TK_RESERVED"===l&&W(d.last_text,["const","let","const"])&&"TK_WORD"===s.type||"TK_RESERVED"===l&&"do"===d.last_text||"TK_RESERVED"===l&&"return"===d.last_text&&!s.wanted_newline||"TK_RESERVED"===l&&"else"===d.last_text&&("TK_RESERVED"!==s.type||"if"!==s.text)||"TK_END_EXPR"===l&&(n.mode===F.ForInitializer||n.mode===F.Conditional)||"TK_WORD"===l&&d.mode===F.BlockStatement&&!d.in_case&&"--"!==s.text&&"++"!==s.text&&"function"!==c&&"TK_WORD"!==s.type&&"TK_RESERVED"!==s.type||d.mode===F.ObjectLiteral&&(":"===d.last_text&&0===d.ternary_depth||"TK_RESERVED"===l&&W(d.last_text,["get","set"])))&&(T(F.Statement),A(),"TK_RESERVED"===l&&W(d.last_text,["const","let","const"])&&"TK_WORD"===s.type&&(d.declaration_statement=!0),x()||y("TK_RESERVED"===s.type&&W(s.text,["do","for","if","while"])),1)}function I(e){return W(e,["case","return","do","if","throw","else"])}function O(e){e=r+(e||0);return e<0||e>=h.length?null:h[e]}function M(){if("TK_RESERVED"===s.type&&d.mode!==F.ObjectLiteral&&W(s.text,["set","get"])&&(s.type="TK_WORD"),"TK_RESERVED"===s.type&&d.mode===F.ObjectLiteral&&":"===O(1).text&&(s.type="TK_WORD"),L()||!s.wanted_newline||S(d.mode)||"TK_OPERATOR"===l&&"--"!==d.last_text&&"++"!==d.last_text||"TK_EQUALS"===l||!g.preserve_newlines&&"TK_RESERVED"===l&&W(d.last_text,["const","let","const","set","get"])||w(),d.do_block&&!d.do_while){if("TK_RESERVED"===s.type&&"while"===s.text)return o.space_before_token=!0,C(),o.space_before_token=!0,void(d.do_while=!0);w(),d.do_block=!1}if(d.if_block)if(d.else_block||"TK_RESERVED"!==s.type||"else"!==s.text){for(;d.mode===F.Statement;)R();d.if_block=!1,d.else_block=!1}else d.else_block=!0;"TK_RESERVED"===s.type&&("case"===s.text||"default"===s.text&&d.in_case_statement)?(w(),(d.case_body||g.jslint_happy)&&(0<d.indentation_level&&(!d.parent||d.indentation_level>d.parent.indentation_level)&&--d.indentation_level,d.case_body=!1),C(),d.in_case=!0,d.in_case_statement=!0):("TK_RESERVED"===s.type&&"function"===s.text&&(!(W(d.last_text,["}"," "])||o.just_added_newline()&&!W(d.last_text,["[","{",":","=",","]))||o.just_added_blankline()||s.comments_before.length||(w(),w(!0)),"TK_RESERVED"===l||"TK_WORD"===l?"TK_RESERVED"===l&&W(d.last_text,["get","set","new","return","export","async"])||"TK_RESERVED"===l&&"default"===d.last_text&&"export"===c?o.space_before_token=!0:w():"TK_OPERATOR"===l||"="===d.last_text?o.space_before_token=!0:!d.multiline_frame&&(S(d.mode)||k(d.mode))||w()),"TK_COMMA"!==l&&"TK_START_EXPR"!==l&&"TK_EQUALS"!==l&&"TK_OPERATOR"!==l||x()||y(),"TK_RESERVED"===s.type&&W(s.text,["function","get","set"])?(C(),d.last_word=s.text):(p="NONE","TK_END_BLOCK"===l?"TK_RESERVED"!==s.type||!W(s.text,["else","catch","finally"])||"expand"===g.brace_style||"end-expand"===g.brace_style||"none"===g.brace_style&&s.wanted_newline?p="NEWLINE":(p="SPACE",o.space_before_token=!0):"TK_SEMICOLON"===l&&d.mode===F.BlockStatement?p="NEWLINE":"TK_SEMICOLON"===l&&S(d.mode)?p="SPACE":"TK_STRING"===l?p="NEWLINE":"TK_RESERVED"===l||"TK_WORD"===l||"*"===d.last_text&&"function"===c?p="SPACE":"TK_START_BLOCK"===l?p="NEWLINE":"TK_END_EXPR"===l&&(o.space_before_token=!0,p="NEWLINE"),"TK_RESERVED"===s.type&&W(s.text,i.line_starters)&&")"!==d.last_text&&(p="else"===d.last_text||"export"===d.last_text?"SPACE":"NEWLINE"),"TK_RESERVED"===s.type&&W(s.text,["else","catch","finally"])?"TK_END_BLOCK"!==l||"expand"===g.brace_style||"end-expand"===g.brace_style||"none"===g.brace_style&&s.wanted_newline?w():(o.trim(!0),"}"!==o.current_line.last()&&w(),o.space_before_token=!0):"NEWLINE"===p?"TK_RESERVED"===l&&I(d.last_text)?o.space_before_token=!0:"TK_END_EXPR"!==l?"TK_START_EXPR"===l&&"TK_RESERVED"===s.type&&W(s.text,["const","let","const"])||":"===d.last_text||("TK_RESERVED"===s.type&&"if"===s.text&&"else"===d.last_text?o.space_before_token=!0:w()):"TK_RESERVED"===s.type&&W(s.text,i.line_starters)&&")"!==d.last_text&&w():d.multiline_frame&&k(d.mode)&&","===d.last_text&&"}"===c?w():"SPACE"===p&&(o.space_before_token=!0),C(),d.last_word=s.text,"TK_RESERVED"===s.type&&"do"===s.text&&(d.do_block=!0),"TK_RESERVED"===s.type&&"if"===s.text&&(d.if_block=!0)))}l="TK_START_BLOCK",c="",(o=new P(t,m)).raw=g.test_output_raw,f=[],T(F.BlockStatement),this.beautify=function(){var e,t;for(i=new N(a,g),h=i.tokenize(),r=0;e=O();){for(var n=0;n<e.comments_before.length;n++)E(e.comments_before[n]);E(e),c=d.last_text,l=e.type,d.last_text=e.text,r+=1}return t=o.get_code(),g.end_with_newline&&(t+="\n"),t="\n"!=g.eol?t.replace(/[\n]/g,g.eol):t}}function i(t){var n=0,a=-1,r=[],i=!0;this.set_indent=function(e){n=t.baseIndentLength+e*t.indent_length,a=e},this.get_character_count=function(){return n},this.is_empty=function(){return i},this.last=function(){return this._empty?null:r[r.length-1]},this.push=function(e){r.push(e),n+=e.length,i=!1},this.pop=function(){var e=null;return i||(e=r.pop(),n-=e.length,i=0===r.length),e},this.remove_indent=function(){0<a&&(--a,n-=t.indent_length)},this.trim=function(){for(;" "===this.last();)r.pop(),--n;i=0===r.length},this.toString=function(){var e="";return this._empty||(0<=a&&(e=t.indent_cache[a]),e+=r.join("")),e}}function P(t,n){n=n||"",this.indent_cache=[n],this.baseIndentLength=n.length,this.indent_length=t.length,this.raw=!1;var a=[];this.baseIndentString=n,this.indent_string=t,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 i(this),a.push(this.current_line)},this.add_outputline(),this.get_line_number=function(){return a.length},this.add_new_line=function(e){return!(1===this.get_line_number()&&this.just_added_newline()||!e&&this.just_added_newline()||(this.raw||this.add_outputline(),0))},this.get_code=function(){return a.join("\n").replace(/[\r\n\t ]+$/,"")},this.set_indent=function(e){if(1<a.length){for(;e>=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(e),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.add_outputline();this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1},this.add_token=function(e){this.add_space_before_token(),this.current_line.push(e)},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(e){if(!e.multiline_frame&&e.mode!==F.ForInitializer&&e.mode!==F.Conditional)for(var t=e.start_line_index,n=a.length;t<n;)a[t].remove_indent(),t++},this.trim=function(e){for(e=e!==undefined&&e,this.current_line.trim(t,n);e&&1<a.length&&this.current_line.is_empty();)a.pop(),this.current_line=a[a.length-1],this.current_line.trim();this.previous_line=1<a.length?a[a.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===a.length||a[a.length-2].is_empty())}}var G=function G(e,t,n,a,r,i){this.type=e,this.text=t,this.comments_before=[],this.newlines=n||0,this.wanted_newline=0<n,this.whitespace_before=a||"",this.parent=null,this.directives=null};function N(C,A,e){var T,k,S,R,x,L,I="\n\r\t ".split(""),O=/[0-9]/,M=/[01234567]/,F=/[0123456789abcdefABCDEF]/,P="+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! ~ , : ? ^ ^= |= :: =>".split(" "),N=(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"])),D=/([\s\S]*?)((?:\*\/)|$)/g,B=/([^\n\r\u2028\u2029]*)/g,H=/\/\* beautify( \w+[:]\w+)+ \*\//g,U=/ (\w+)[:](\w+)/g,$=/([\s\S]*?)((?:\/\*\sbeautify\signore:end\s\*\/)|$)/g,z=/((<\?php|<\?=)[\s\S]*?\?>)|(<%[\s\S]*?%>)/g;function o(){var e=[];if(T=0,k="",L<=x)return["","TK_EOF"];var t=R.length?R[R.length-1]:new G("TK_START_BLOCK","{"),n=C.charAt(x);for(x+=1;W(n,I);){if(K.newline.test(n)?"\n"===n&&"\r"===C.charAt(x-2)||(T+=1,e=[]):e.push(n),L<=x)return["","TK_EOF"];n=C.charAt(x),x+=1}if(e.length&&(k=e.join("")),O.test(n)){var a=!0,r=!0,i=O;for("0"===n&&x<L&&/[Xxo]/.test(C.charAt(x))?(r=a=!1,n+=C.charAt(x),x+=1,i=/[o]/.test(C.charAt(x))?M:F):(n="",--x);x<L&&i.test(C.charAt(x));)n+=C.charAt(x),x+=1,a&&x<L&&"."===C.charAt(x)&&(n+=C.charAt(x),x+=1,a=!1),r&&x<L&&/[Ee]/.test(C.charAt(x))&&(n+=C.charAt(x),(x+=1)<L&&/[+-]/.test(C.charAt(x))&&(n+=C.charAt(x),x+=1),a=r=!1);return[n,"TK_WORD"]}if(K.isIdentifierStart(C.charCodeAt(x-1))){if(x<L)for(;K.isIdentifierChar(C.charCodeAt(x))&&(n+=C.charAt(x),(x+=1)!==L););return"TK_DOT"===t.type||"TK_RESERVED"===t.type&&W(t.text,["set","get"])||!W(n,N)?[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 o="";if("*"===C.charAt(x))return x+=1,D.lastIndex=x,_=D.exec(C),o="/*".concat(_[0]),x+=_[0].length,(y=function(e){if(!e.match(H))return null;for(var t={},n=(U.lastIndex=0,U.exec(e));n;)t[n[1]]=n[2],n=U.exec(e);return t}(o))&&"start"===y.ignore&&($.lastIndex=x,o+=(_=$.exec(C))[0],x+=_[0].length),[o=o.replace(K.lineBreak,"\n"),"TK_BLOCK_COMMENT",y];if("/"===C.charAt(x))return x+=1,B.lastIndex=x,_=B.exec(C),o="//".concat(_[0]),x+=_[0].length,[o,"TK_COMMENT"]}if("`"===n||"'"===n||'"'===n||("/"===n||A.e4x&&"<"===n&&C.slice(x-1).match(/^<([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/))&&("TK_RESERVED"===t.type&&W(t.text,["return","case","throw","else","do","typeof","yield"])||"TK_END_EXPR"===t.type&&")"===t.text&&t.parent&&"TK_RESERVED"===t.parent.type&&W(t.parent.text,["if","while","for"])||W(t.type,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){var s=n,l=!1,c=!1,d=n;if("/"===s)for(var f=!1;x<L&&(l||f||C.charAt(x)!==s)&&!K.newline.test(C.charAt(x));)d+=C.charAt(x),l?l=!1:(l="\\"===C.charAt(x),"["===C.charAt(x)?f=!0:"]"===C.charAt(x)&&(f=!1)),x+=1;else if(A.e4x&&"<"===s){var p=/<(\/?)([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/g,u=C.slice(x-1),g=p.exec(u);if(g&&0===g.index){for(var h=g[2],m=0;g;){var v=!!g[1],b=g[2],E=!!g[g.length-1]||"![CDATA["===b.slice(0,8);if(b!==h||E||(v?--m:++m),m<=0)break;g=p.exec(u)}var y=g?g.index+g[0].length:u.length,u=u.slice(0,y);return x+=y-1,[u=u.replace(K.lineBreak,"\n"),"TK_STRING"]}}else for(;x<L&&(l||C.charAt(x)!==s&&("`"===s||!K.newline.test(C.charAt(x))));)(l||"`"===s)&&K.newline.test(C.charAt(x))?("\r"===C.charAt(x)&&"\n"===C.charAt(x+1)&&(x+=1),d+="\n"):d+=C.charAt(x),l=l?("x"!==C.charAt(x)&&"u"!==C.charAt(x)||(c=!0),!1):"\\"===C.charAt(x),x+=1;if(c&&A.unescape_strings&&(d=function(e){var t,n=!1,a="",r=0,i="",o=0;for(;n||r<e.length;)if(t=e.charAt(r),r++,n){if(n=!1,"x"===t)i=e.substr(r,2),r+=2;else{if("u"!==t){a+="\\".concat(t);continue}i=e.substr(r,4),r+=4}if(!i.match(/^[0123456789abcdefABCDEF]+$/))return e;if(0<=(o=parseInt(i,16))&&o<32)a+=("x"===t?"\\x":"\\u").concat(i);else if(34===o||39===o||92===o)a+="\\".concat(String.fromCharCode(o));else{if("x"===t&&126<o&&o<=255)return e;a+=String.fromCharCode(o)}}else"\\"===t?n=!0:a+=t;return a}(d)),x<L&&C.charAt(x)===s&&(d+=s,x+=1,"/"===s))for(;x<L&&K.isIdentifierStart(C.charCodeAt(x));)d+=C.charAt(x),x+=1;return[d,"TK_STRING"]}if("#"===n){if(0===R.length&&"!"===C.charAt(x)){for(d=n;x<L&&"\n"!==n;)d+=n=C.charAt(x),x+=1;return["".concat(V(d),"\n"),"TK_UNKNOWN"]}var w="#";if(x<L&&O.test(C.charAt(x))){for(;w+=n=C.charAt(x),(x+=1)<L&&"#"!==n&&"="!==n;);return"#"!==n&&("["===C.charAt(x)&&"]"===C.charAt(x+1)?(w+="[]",x+=2):"{"===C.charAt(x)&&"}"===C.charAt(x+1)&&(w+="{}",x+=2)),[w,"TK_WORD"]}}if("<"===n&&("?"===C.charAt(x)||"%"===C.charAt(x))){z.lastIndex=x-1;var _=z.exec(C);if(_)return n=_[0],x+=n.length-1,[n=n.replace(K.lineBreak,"\n"),"TK_STRING"]}if("<"===n&&"\x3c!--"===C.substring(x-1,x+3)){for(x+=3,n="\x3c!--";!K.newline.test(C.charAt(x))&&x<L;)n+=C.charAt(x),x++;return S=!0,[n,"TK_COMMENT"]}if("-"===n&&S&&"--\x3e"===C.substring(x-1,x+2))return S=!1,x+=2,["--\x3e","TK_COMMENT"];if("."===n)return[n,"TK_DOT"];if(W(n,P)){for(;x<L&&W(n+C.charAt(x),P)&&(n+=C.charAt(x),!(L<=(x+=1))););return","===n?[n,"TK_COMMA"]:"="===n?[n,"TK_EQUALS"]:[n,"TK_OPERATOR"]}return[n,"TK_UNKNOWN"]}this.tokenize=function(){L=C.length,x=0,S=!1,R=[];for(var e,t,n,a=null,r=[],i=[];!t||"TK_EOF"!==t.type;){for(n=o(),e=new G(n[1],n[0],T,k);"TK_COMMENT"===e.type||"TK_BLOCK_COMMENT"===e.type||"TK_UNKNOWN"===e.type;)"TK_BLOCK_COMMENT"===e.type&&(e.directives=n[2]),i.push(e),n=o(),e=new G(n[1],n[0],T,k);i.length&&(e.comments_before=i,i=[]),"TK_START_BLOCK"===e.type||"TK_START_EXPR"===e.type?(e.parent=t,r.push(a),a=e):("TK_END_BLOCK"===e.type||"TK_END_EXPR"===e.type)&&a&&("]"===e.text&&"["===a.text||")"===e.text&&"("===a.text||"}"===e.text&&"{"===a.text)&&(e.parent=a.parent,a=r.pop()),R.push(e),t=e}return R}}return{run:function(e,t){function o(e){return e.replace(/\s+$/g,"")}var n,a,r,g,i,s,h,l,c,m,v,b,d,f;for((t=t||{}).wrap_line_length!==undefined&&0!==parseInt(t.wrap_line_length,10)||t.max_char===undefined||0===parseInt(t.max_char,10)||(t.wrap_line_length=t.max_char),a=t.indent_inner_html!==undefined&&t.indent_inner_html,r=t.indent_size===undefined?4:parseInt(t.indent_size,10),g=t.indent_char===undefined?" ":t.indent_char,s=t.brace_style===undefined?"collapse":t.brace_style,i=0===parseInt(t.wrap_line_length,10)?32786:parseInt(t.wrap_line_length||250,10),h=t.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"],l=t.preserve_newlines===undefined||t.preserve_newlines,c=l?isNaN(parseInt(t.max_preserve_newlines,10))?32786:parseInt(t.max_preserve_newlines,10):0,m=t.indent_handlebars!==undefined&&t.indent_handlebars,v=t.wrap_attributes===undefined?"auto":t.wrap_attributes,b=t.wrap_attributes_indent_size!==undefined&&parseInt(t.wrap_attributes_indent_size,10)||r,d=t.end_with_newline!==undefined&&t.end_with_newline,f=Array.isArray(t.extra_liners)?t.extra_liners.concat():("string"==typeof t.extra_liners?t.extra_liners:"head,body,/html").split(","),t.indent_with_tabs&&(g="\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=a,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:f,in_array:function W(e,t){for(var n=0;n<t.length;n++)if(e===t[n])return!0;return!1}},this.is_whitespace=function(e){for(;0<e.length;e++)if(!this.Utils.in_array(e.charAt(0),this.Utils.whitespace))return!1;return!0},this.traverse_whitespace=function(){var e="",e=this.input.charAt(this.pos);if(this.Utils.in_array(e,this.Utils.whitespace)){for(this.newlines=0;this.Utils.in_array(e,this.Utils.whitespace);)l&&"\n"===e&&this.newlines<=c&&(this.newlines+=1),this.pos++,e=this.input.charAt(this.pos);return!0}return!1},this.space_or_wrap=function(e){this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,e),this.print_indentation(e)):(this.line_char_count++,e.push(" "))},this.get_content=function(){for(var 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(m){var t=this.input.substr(this.pos,3);if("{{#"===t||"{{/"===t)break;if("{{!"===t)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(e){var t;return this.pos===this.input.length?["","TK_EOF"]:(t="",(e=new RegExp("</".concat(e,"\\s*>"),"igm")).lastIndex=this.pos,e=(e=e.exec(this.input))?e.index:this.input.length,this.pos<e&&(t=this.input.substring(this.pos,e),this.pos=e),t)},this.record_tag=function(e){this.tags["".concat(e,"count")]?this.tags["".concat(e,"count")]++:this.tags["".concat(e,"count")]=1,this.tags[e+this.tags["".concat(e,"count")]]=this.indent_level,this.tags[e+this.tags["".concat(e,"count")]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags["".concat(e,"count")]},this.retrieve_tag=function(e){if(this.tags["".concat(e,"count")]){for(var t=this.tags.parent;t&&e+this.tags["".concat(e,"count")]!==t;)t=this.tags["".concat(t,"parent")];t&&(this.indent_level=this.tags[e+this.tags["".concat(e,"count")]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags["".concat(e,"count")]+"parent"],delete this.tags[e+this.tags["".concat(e,"count")]],1===this.tags["".concat(e,"count")]?delete this.tags["".concat(e,"count")]:this.tags["".concat(e,"count")]--}},this.indent_to_tag=function(e){if(this.tags["".concat(e,"count")]){for(var t=this.tags.parent;t&&e+this.tags["".concat(e,"count")]!==t;)t=this.tags["".concat(t,"parent")];t&&(this.indent_level=this.tags[e+this.tags["".concat(e,"count")]])}},this.get_tag=function(e){var t,n,a="",r=[],i=!1,o=!0,s=this.pos,l=this.line_char_count;e=e!==undefined&&e;do{if(this.pos>=this.input.length)return e&&(this.pos=s,this.line_char_count=l),r.length?r.join(""):["","TK_EOF"];if(a=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(a,this.Utils.whitespace))i=!0;else{if("'"!==a&&'"'!==a||(a+=this.get_unformatted(a),i=!0),"="===a&&(i=!1),r.length&&"="!=r[r.length-1]&&">"!=a&&i){if(this.space_or_wrap(r),i=!1,!o&&"force"===v&&"/"!=a){this.print_newline(!0,r),this.print_indentation(r);for(var c=0;c<b;c++)r.push(g)}for(var d=0;d<r.length;d++)if(" "===r[d]){o=!1;break}}if(m&&"<"===n&&a+this.input.charAt(this.pos)==="{{"&&(a+=this.get_unformatted("}}"),r.length&&" "!=r[r.length-1]&&"<"!=r[r.length-1]&&(a=" ".concat(a)),i=!0),"<"!==a||n||(t=this.pos-1,n="<"),m&&!n&&2<=r.length&&"{"===r[r.length-1]&&"{"===r[r.length-2]&&(t="#"===a||"/"===a||"!"===a?this.pos-3:this.pos-2,n="{"),this.line_char_count++,r.push(a),r[1]&&("!"===r[1]||"?"===r[1]||"%"===r[1])){r=[this.get_comment(t)];break}if(m&&r[1]&&"{"===r[1]&&r[2]&&"!"===r[2]){r=[this.get_comment(t)];break}if(m&&"{"===n&&2<r.length&&"}"===r[r.length-2]&&"}"===r[r.length-1])break}}while(">"!=a);var f=r.join(""),p=-1!=f.indexOf(" ")?f.indexOf(" "):"{"===f[0]?f.indexOf("}"):f.indexOf(">"),