tiny-markdown-editor 0.2.21 → 0.2.23

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.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TinyMDE={})}(this,(function(e){"use strict";function t(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function r(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?n(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function s(){s=function(e,t){return new n(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function n(e,r,s){var o=RegExp(e,r);return t.set(o,s||t.get(e)),i(o,n.prototype)}function r(e,n){var r=t.get(n);return Object.keys(r).reduce((function(t,n){var i=r[n];if("number"==typeof i)t[n]=e[i];else{for(var s=0;void 0===e[i[s]]&&s+1<i.length;)s++;t[n]=e[i[s]]}return t}),Object.create(null))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)}(n,RegExp),n.prototype.exec=function(t){var n=e.exec.call(this,t);if(n){n.groups=r(n,this);var i=n.indices;i&&(i.groups=r(i,this))}return n},n.prototype[Symbol.replace]=function(n,i){if("string"==typeof i){var s=t.get(this);return e[Symbol.replace].call(this,n,i.replace(/\$<([^>]+)(>|$)/g,(function(e,t,n){if(""===n)return e;var r=s[t];return Array.isArray(r)?"$"+r.join("$"):"number"==typeof r?"$"+r:""})))}if("function"==typeof i){var o=this;return e[Symbol.replace].call(this,n,(function(){var e=arguments;return"object"!=typeof e[e.length-1]&&(e=[].slice.call(e)).push(r(e,o)),i.apply(this,e)}))}return e[Symbol.replace].call(this,n,i)},s.apply(this,arguments)}var o,u,a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l={};function c(){if(u)return o;u=1;var e=function(e){return e&&e.Math===Math&&e};return o=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof a&&a)||e("object"==typeof o&&o)||function(){return this}()||Function("return this")()}var p,h,f,g,d,m,y,v,T={};function M(){return h?p:(h=1,p=function(e){try{return!!e()}catch(e){return!0}})}function D(){if(g)return f;g=1;var e=M();return f=!e((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function F(){if(m)return d;m=1;var e=M();return d=!e((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))}function b(){if(v)return y;v=1;var e=F(),t=Function.prototype.call;return y=e?t.bind(t):function(){return t.apply(t,arguments)},y}var E,C,k,w,x,S,A,$,L,O,I,P,B,N,_,H,R,j,G,U,z,V,q,Z,K,Y,W,X,J,Q,ee,te,ne,re,ie,se,oe,ue,ae,le,ce,pe={};function he(){return k?C:(k=1,C=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function fe(){if(x)return w;x=1;var e=F(),t=Function.prototype,n=t.call,r=e&&t.bind.bind(n,n);return w=e?r:function(e){return function(){return n.apply(e,arguments)}},w}function ge(){if(A)return S;A=1;var e=fe(),t=e({}.toString),n=e("".slice);return S=function(e){return n(t(e),8,-1)}}function de(){return I?O:(I=1,O=function(e){return null==e})}function me(){if(B)return P;B=1;var e=de(),t=TypeError;return P=function(n){if(e(n))throw new t("Can't call method on "+n);return n}}function ye(){if(_)return N;_=1;var e=function(){if(L)return $;L=1;var e=fe(),t=M(),n=ge(),r=Object,i=e("".split);return $=t((function(){return!r("z").propertyIsEnumerable(0)}))?function(e){return"String"===n(e)?i(e,""):r(e)}:r}(),t=me();return N=function(n){return e(t(n))}}function ve(){if(R)return H;R=1;var e="object"==typeof document&&document.all;return H=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(e){return"function"==typeof e}}function Te(){if(G)return j;G=1;var e=ve();return j=function(t){return"object"==typeof t?null!==t:e(t)}}function Me(){if(z)return U;z=1;var e=c(),t=ve();return U=function(n,r){return arguments.length<2?(i=e[n],t(i)?i:void 0):e[n]&&e[n][r];var i},U}function De(){if(q)return V;q=1;var e=fe();return V=e({}.isPrototypeOf)}function Fe(){if(W)return Y;W=1;var e,t,n=c(),r=function(){if(K)return Z;K=1;var e=c().navigator,t=e&&e.userAgent;return Z=t?String(t):""}(),i=n.process,s=n.Deno,o=i&&i.versions||s&&s.version,u=o&&o.v8;return u&&(t=(e=u.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&r&&(!(e=r.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=r.match(/Chrome\/(\d+)/))&&(t=+e[1]),Y=t}function be(){if(J)return X;J=1;var e=Fe(),t=M(),n=c().String;return X=!!Object.getOwnPropertySymbols&&!t((function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}))}function Ee(){if(ee)return Q;ee=1;var e=be();return Q=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function Ce(){if(ne)return te;ne=1;var e=Me(),t=ve(),n=De(),r=Ee(),i=Object;return te=r?function(e){return"symbol"==typeof e}:function(r){var s=e("Symbol");return t(s)&&n(s.prototype,i(r))}}function ke(){if(ie)return re;ie=1;var e=String;return re=function(t){try{return e(t)}catch(e){return"Object"}}}function we(){if(oe)return se;oe=1;var e=ve(),t=ke(),n=TypeError;return se=function(r){if(e(r))return r;throw new n(t(r)+" is not a function")}}function xe(){if(ae)return ue;ae=1;var e=we(),t=de();return ue=function(n,r){var i=n[r];return t(i)?void 0:e(i)}}function Se(){if(ce)return le;ce=1;var e=b(),t=ve(),n=Te(),r=TypeError;return le=function(i,s){var o,u;if("string"===s&&t(o=i.toString)&&!n(u=e(o,i)))return u;if(t(o=i.valueOf)&&!n(u=e(o,i)))return u;if("string"!==s&&t(o=i.toString)&&!n(u=e(o,i)))return u;throw new r("Can't convert object to primitive value")}}var Ae,$e,Le,Oe,Ie,Pe,Be,Ne,_e,He,Re,je,Ge,Ue,ze,Ve,qe,Ze,Ke,Ye,We,Xe,Je,Qe,et={exports:{}};function tt(){return $e?Ae:($e=1,Ae=!1)}function nt(){if(Oe)return Le;Oe=1;var e=c(),t=Object.defineProperty;return Le=function(n,r){try{t(e,n,{value:r,configurable:!0,writable:!0})}catch(t){e[n]=r}return r}}function rt(){if(Ie)return et.exports;Ie=1;var e=tt(),t=c(),n=nt(),r="__core-js_shared__",i=et.exports=t[r]||n(r,{});return(i.versions||(i.versions=[])).push({version:"3.42.0",mode:e?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"}),et.exports}function it(){if(Be)return Pe;Be=1;var e=rt();return Pe=function(t,n){return e[t]||(e[t]=n||{})}}function st(){if(_e)return Ne;_e=1;var e=me(),t=Object;return Ne=function(n){return t(e(n))}}function ot(){if(Re)return He;Re=1;var e=fe(),t=st(),n=e({}.hasOwnProperty);return He=Object.hasOwn||function(e,r){return n(t(e),r)}}function ut(){if(Ge)return je;Ge=1;var e=fe(),t=0,n=Math.random(),r=e(1..toString);return je=function(e){return"Symbol("+(void 0===e?"":e)+")_"+r(++t+n,36)}}function at(){if(ze)return Ue;ze=1;var e=c(),t=it(),n=ot(),r=ut(),i=be(),s=Ee(),o=e.Symbol,u=t("wks"),a=s?o.for||o:o&&o.withoutSetter||r;return Ue=function(e){return n(u,e)||(u[e]=i&&n(o,e)?o[e]:a("Symbol."+e)),u[e]}}function lt(){if(qe)return Ve;qe=1;var e=b(),t=Te(),n=Ce(),r=xe(),i=Se(),s=at(),o=TypeError,u=s("toPrimitive");return Ve=function(s,a){if(!t(s)||n(s))return s;var l,c=r(s,u);if(c){if(void 0===a&&(a="default"),l=e(c,s,a),!t(l)||n(l))return l;throw new o("Can't convert object to primitive value")}return void 0===a&&(a="number"),i(s,a)}}function ct(){if(Ke)return Ze;Ke=1;var e=lt(),t=Ce();return Ze=function(n){var r=e(n,"string");return t(r)?r:r+""}}function pt(){if(We)return Ye;We=1;var e=c(),t=Te(),n=e.document,r=t(n)&&t(n.createElement);return Ye=function(e){return r?n.createElement(e):{}}}function ht(){if(Je)return Xe;Je=1;var e=D(),t=M(),n=pt();return Xe=!e&&!t((function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a}))}function ft(){if(Qe)return T;Qe=1;var e=D(),t=b(),n=function(){if(E)return pe;E=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return pe.f=n?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,pe}(),r=he(),i=ye(),s=ct(),o=ot(),u=ht(),a=Object.getOwnPropertyDescriptor;return T.f=e?a:function(e,l){if(e=i(e),l=s(l),u)try{return a(e,l)}catch(e){}if(o(e,l))return r(!t(n.f,e,l),e[l])},T}var gt,dt,mt,yt,vt,Tt,Mt,Dt={};function Ft(){if(dt)return gt;dt=1;var e=D(),t=M();return gt=e&&t((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))}function bt(){if(yt)return mt;yt=1;var e=Te(),t=String,n=TypeError;return mt=function(r){if(e(r))return r;throw new n(t(r)+" is not an object")}}function Et(){if(vt)return Dt;vt=1;var e=D(),t=ht(),n=Ft(),r=bt(),i=ct(),s=TypeError,o=Object.defineProperty,u=Object.getOwnPropertyDescriptor,a="enumerable",l="configurable",c="writable";return Dt.f=e?n?function(e,t,n){if(r(e),t=i(t),r(n),"function"==typeof e&&"prototype"===t&&"value"in n&&c in n&&!n[c]){var s=u(e,t);s&&s[c]&&(e[t]=n.value,n={configurable:l in n?n[l]:s[l],enumerable:a in n?n[a]:s[a],writable:!1})}return o(e,t,n)}:o:function(e,n,u){if(r(e),n=i(n),r(u),t)try{return o(e,n,u)}catch(e){}if("get"in u||"set"in u)throw new s("Accessors not supported");return"value"in u&&(e[n]=u.value),e},Dt}function Ct(){if(Mt)return Tt;Mt=1;var e=D(),t=Et(),n=he();return Tt=e?function(e,r,i){return t.f(e,r,n(1,i))}:function(e,t,n){return e[t]=n,e}}var kt,wt,xt,St,At,$t,Lt,Ot,It,Pt,Bt,Nt,_t,Ht,Rt,jt={exports:{}};function Gt(){if(wt)return kt;wt=1;var e=D(),t=ot(),n=Function.prototype,r=e&&Object.getOwnPropertyDescriptor,i=t(n,"name"),s=i&&"something"===function(){}.name,o=i&&(!e||e&&r(n,"name").configurable);return kt={EXISTS:i,PROPER:s,CONFIGURABLE:o}}function Ut(){if(St)return xt;St=1;var e=fe(),t=ve(),n=rt(),r=e(Function.toString);return t(n.inspectSource)||(n.inspectSource=function(e){return r(e)}),xt=n.inspectSource}function zt(){if(Ot)return Lt;Ot=1;var e=it(),t=ut(),n=e("keys");return Lt=function(e){return n[e]||(n[e]=t(e))}}function Vt(){return Pt?It:(Pt=1,It={})}function qt(){if(Nt)return Bt;Nt=1;var e,t,n,r=function(){if($t)return At;$t=1;var e=c(),t=ve(),n=e.WeakMap;return At=t(n)&&/native code/.test(String(n))}(),i=c(),s=Te(),o=Ct(),u=ot(),a=rt(),l=zt(),p=Vt(),h="Object already initialized",f=i.TypeError,g=i.WeakMap;if(r||a.state){var d=a.state||(a.state=new g);d.get=d.get,d.has=d.has,d.set=d.set,e=function(e,t){if(d.has(e))throw new f(h);return t.facade=e,d.set(e,t),t},t=function(e){return d.get(e)||{}},n=function(e){return d.has(e)}}else{var m=l("state");p[m]=!0,e=function(e,t){if(u(e,m))throw new f(h);return t.facade=e,o(e,m,t),t},t=function(e){return u(e,m)?e[m]:{}},n=function(e){return u(e,m)}}return Bt={set:e,get:t,has:n,enforce:function(r){return n(r)?t(r):e(r,{})},getterFor:function(e){return function(n){var r;if(!s(n)||(r=t(n)).type!==e)throw new f("Incompatible receiver, "+e+" required");return r}}}}function Zt(){if(_t)return jt.exports;_t=1;var e=fe(),t=M(),n=ve(),r=ot(),i=D(),s=Gt().CONFIGURABLE,o=Ut(),u=qt(),a=u.enforce,l=u.get,c=String,p=Object.defineProperty,h=e("".slice),f=e("".replace),g=e([].join),d=i&&!t((function(){return 8!==p((function(){}),"length",{value:8}).length})),m=String(String).split("String"),y=jt.exports=function(e,t,n){"Symbol("===h(c(t),0,7)&&(t="["+f(c(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!r(e,"name")||s&&e.name!==t)&&(i?p(e,"name",{value:t,configurable:!0}):e.name=t),d&&n&&r(n,"arity")&&e.length!==n.arity&&p(e,"length",{value:n.arity});try{n&&r(n,"constructor")&&n.constructor?i&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var o=a(e);return r(o,"source")||(o.source=g(m,"string"==typeof t?t:"")),e};return Function.prototype.toString=y((function(){return n(this)&&l(this).source||o(this)}),"toString"),jt.exports}function Kt(){if(Rt)return Ht;Rt=1;var e=ve(),t=Et(),n=Zt(),r=nt();return Ht=function(i,s,o,u){u||(u={});var a=u.enumerable,l=void 0!==u.name?u.name:s;if(e(o)&&n(o,l,u),u.global)a?i[s]=o:r(s,o);else{try{u.unsafe?i[s]&&(a=!0):delete i[s]}catch(e){}a?i[s]=o:t.f(i,s,{value:o,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return i}}var Yt,Wt,Xt,Jt,Qt,en,tn,nn,rn,sn,on,un,an,ln,cn,pn,hn,fn={};function gn(){if(Jt)return Xt;Jt=1;var e=function(){if(Wt)return Yt;Wt=1;var e=Math.ceil,t=Math.floor;return Yt=Math.trunc||function(n){var r=+n;return(r>0?t:e)(r)}}();return Xt=function(t){var n=+t;return n!=n||0===n?0:e(n)}}function dn(){if(en)return Qt;en=1;var e=gn(),t=Math.max,n=Math.min;return Qt=function(r,i){var s=e(r);return s<0?t(s+i,0):n(s,i)}}function mn(){if(nn)return tn;nn=1;var e=gn(),t=Math.min;return tn=function(n){var r=e(n);return r>0?t(r,9007199254740991):0}}function yn(){if(sn)return rn;sn=1;var e=mn();return rn=function(t){return e(t.length)}}function vn(){if(ln)return an;ln=1;var e=fe(),t=ot(),n=ye(),r=function(){if(un)return on;un=1;var e=ye(),t=dn(),n=yn(),r=function(r){return function(i,s,o){var u=e(i),a=n(u);if(0===a)return!r&&-1;var l,c=t(o,a);if(r&&s!=s){for(;a>c;)if((l=u[c++])!=l)return!0}else for(;a>c;c++)if((r||c in u)&&u[c]===s)return r||c||0;return!r&&-1}};return on={includes:r(!0),indexOf:r(!1)}}().indexOf,i=Vt(),s=e([].push);return an=function(e,o){var u,a=n(e),l=0,c=[];for(u in a)!t(i,u)&&t(a,u)&&s(c,u);for(;o.length>l;)t(a,u=o[l++])&&(~r(c,u)||s(c,u));return c}}function Tn(){return pn?cn:(pn=1,cn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}function Mn(){if(hn)return fn;hn=1;var e=vn(),t=Tn().concat("length","prototype");return fn.f=Object.getOwnPropertyNames||function(n){return e(n,t)},fn}var Dn,Fn,bn,En,Cn,kn,wn,xn,Sn,An,$n,Ln,On,In,Pn,Bn,Nn,_n,Hn,Rn={};function jn(){if(bn)return Fn;bn=1;var e=Me(),t=fe(),n=Mn(),r=(Dn||(Dn=1,Rn.f=Object.getOwnPropertySymbols),Rn),i=bt(),s=t([].concat);return Fn=e("Reflect","ownKeys")||function(e){var t=n.f(i(e)),o=r.f;return o?s(t,o(e)):t}}function Gn(){if(Cn)return En;Cn=1;var e=ot(),t=jn(),n=ft(),r=Et();return En=function(i,s,o){for(var u=t(s),a=r.f,l=n.f,c=0;c<u.length;c++){var p=u[c];e(i,p)||o&&e(o,p)||a(i,p,l(s,p))}}}function Un(){if(wn)return kn;wn=1;var e=M(),t=ve(),n=/#|\.prototype\./,r=function(n,r){var a=s[i(n)];return a===u||a!==o&&(t(r)?e(r):!!r)},i=r.normalize=function(e){return String(e).replace(n,".").toLowerCase()},s=r.data={},o=r.NATIVE="N",u=r.POLYFILL="P";return kn=r}function zn(){if(Sn)return xn;Sn=1;var e=c(),t=ft().f,n=Ct(),r=Kt(),i=nt(),s=Gn(),o=Un();return xn=function(u,a){var l,c,p,h,f,g=u.target,d=u.global,m=u.stat;if(l=d?e:m?e[g]||i(g,{}):e[g]&&e[g].prototype)for(c in a){if(h=a[c],p=u.dontCallGetSet?(f=t(l,c))&&f.value:l[c],!o(d?c:g+(m?".":"#")+c,u.forced)&&void 0!==p){if(typeof h==typeof p)continue;s(h,p)}(u.sham||p&&p.sham)&&n(h,"sham",!0),r(l,c,h,u)}}}function Vn(){if(On)return Ln;On=1;var e=function(){if($n)return An;$n=1;var e={};return e[at()("toStringTag")]="z",An="[object z]"===String(e)}(),t=ve(),n=ge(),r=at()("toStringTag"),i=Object,s="Arguments"===n(function(){return arguments}());return Ln=e?n:function(e){var o,u,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(u=function(e,t){try{return e[t]}catch(e){}}(o=i(e),r))?u:s?n(o):"Object"===(a=n(o))&&t(o.callee)?"Arguments":a}}function qn(){if(Pn)return In;Pn=1;var e=Vn(),t=String;return In=function(n){if("Symbol"===e(n))throw new TypeError("Cannot convert a Symbol value to a string");return t(n)}}function Zn(){if(Nn)return Bn;Nn=1;var e=bt();return Bn=function(){var t=e(this),n="";return t.hasIndices&&(n+="d"),t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.dotAll&&(n+="s"),t.unicode&&(n+="u"),t.unicodeSets&&(n+="v"),t.sticky&&(n+="y"),n}}function Kn(){if(Hn)return _n;Hn=1;var e=M(),t=c().RegExp,n=e((function(){var e=t("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),r=n||e((function(){return!t("a","y").sticky})),i=n||e((function(){var e=t("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));return _n={BROKEN_CARET:i,MISSED_STICKY:r,UNSUPPORTED_Y:n}}var Yn,Wn,Xn,Jn,Qn,er,tr,nr,rr,ir,sr,or,ur,ar,lr={};function cr(){if(Wn)return Yn;Wn=1;var e=vn(),t=Tn();return Yn=Object.keys||function(n){return e(n,t)}}function pr(){if(Qn)return Jn;Qn=1;var e=Me();return Jn=e("document","documentElement")}function hr(){if(tr)return er;tr=1;var e,t=bt(),n=function(){if(Xn)return lr;Xn=1;var e=D(),t=Ft(),n=Et(),r=bt(),i=ye(),s=cr();return lr.f=e&&!t?Object.defineProperties:function(e,t){r(e);for(var o,u=i(t),a=s(t),l=a.length,c=0;l>c;)n.f(e,o=a[c++],u[o]);return e},lr}(),r=Tn(),i=Vt(),s=pr(),o=pt(),u=zt(),a="prototype",l="script",c=u("IE_PROTO"),p=function(){},h=function(e){return"<"+l+">"+e+"</"+l+">"},f=function(e){e.write(h("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{e=new ActiveXObject("htmlfile")}catch(e){}var t,n,i;g="undefined"!=typeof document?document.domain&&e?f(e):(n=o("iframe"),i="java"+l+":",n.style.display="none",s.appendChild(n),n.src=String(i),(t=n.contentWindow.document).open(),t.write(h("document.F=Object")),t.close(),t.F):f(e);for(var u=r.length;u--;)delete g[a][r[u]];return g()};return i[c]=!0,er=Object.create||function(e,r){var i;return null!==e?(p[a]=t(e),i=new p,p[a]=null,i[c]=e):i=g(),void 0===r?i:n.f(i,r)}}function fr(){if(rr)return nr;rr=1;var e=M(),t=c().RegExp;return nr=e((function(){var e=t(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))}function gr(){if(sr)return ir;sr=1;var e=M(),t=c().RegExp;return ir=e((function(){var e=t("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))}function dr(){if(ur)return or;ur=1;var e,t,n=b(),r=fe(),i=qn(),s=Zn(),o=Kn(),u=it(),a=hr(),l=qt().get,c=fr(),p=gr(),h=u("native-string-replace",String.prototype.replace),f=RegExp.prototype.exec,g=f,d=r("".charAt),m=r("".indexOf),y=r("".replace),v=r("".slice),T=(t=/b*/g,n(f,e=/a/,"a"),n(f,t,"a"),0!==e.lastIndex||0!==t.lastIndex),M=o.BROKEN_CARET,D=void 0!==/()??/.exec("")[1];return(T||D||M||c||p)&&(g=function(e){var t,r,o,u,c,p,F,b=this,E=l(b),C=i(e),k=E.raw;if(k)return k.lastIndex=b.lastIndex,t=n(g,k,C),b.lastIndex=k.lastIndex,t;var w=E.groups,x=M&&b.sticky,S=n(s,b),A=b.source,$=0,L=C;if(x&&(S=y(S,"y",""),-1===m(S,"g")&&(S+="g"),L=v(C,b.lastIndex),b.lastIndex>0&&(!b.multiline||b.multiline&&"\n"!==d(C,b.lastIndex-1))&&(A="(?: "+A+")",L=" "+L,$++),r=new RegExp("^(?:"+A+")",S)),D&&(r=new RegExp("^"+A+"$(?!\\s)",S)),T&&(o=b.lastIndex),u=n(f,x?r:b,L),x?u?(u.input=v(u.input,$),u[0]=v(u[0],$),u.index=b.lastIndex,b.lastIndex+=u[0].length):b.lastIndex=0:T&&u&&(b.lastIndex=b.global?u.index+u[0].length:o),D&&u&&u.length>1&&n(h,u[0],r,(function(){for(c=1;c<arguments.length-2;c++)void 0===arguments[c]&&(u[c]=void 0)})),u&&w)for(u.groups=p=a(null),c=0;c<w.length;c++)p[(F=w[c])[0]]=u[F[1]];return u}),or=g}function mr(){if(ar)return l;ar=1;var e=zn(),t=dr();return e({target:"RegExp",proto:!0,forced:/./.exec!==t},{exec:t}),l}mr();var yr,vr,Tr,Mr,Dr,Fr,br,Er,Cr,kr,wr,xr,Sr,Ar={};function $r(){if(Er)return br;Er=1;var e=function(){if(Fr)return Dr;Fr=1;var e=fe(),t=gn(),n=qn(),r=me(),i=e("".charAt),s=e("".charCodeAt),o=e("".slice),u=function(e){return function(u,a){var l,c,p=n(r(u)),h=t(a),f=p.length;return h<0||h>=f?e?"":void 0:(l=s(p,h))<55296||l>56319||h+1===f||(c=s(p,h+1))<56320||c>57343?e?i(p,h):l:e?o(p,h,h+2):c-56320+(l-55296<<10)+65536}};return Dr={codeAt:u(!1),charAt:u(!0)}}().charAt;return br=function(t,n,r){return n+(r?e(t,n).length:1)}}function Lr(){if(kr)return Cr;kr=1;var e=fe(),t=st(),n=Math.floor,r=e("".charAt),i=e("".replace),s=e("".slice),o=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;return Cr=function(e,a,l,c,p,h){var f=l+e.length,g=c.length,d=u;return void 0!==p&&(p=t(p),d=o),i(h,d,(function(t,i){var o;switch(r(i,0)){case"$":return"$";case"&":return e;case"`":return s(a,0,l);case"'":return s(a,f);case"<":o=p[s(i,1,-1)];break;default:var u=+i;if(0===u)return t;if(u>g){var h=n(u/10);return 0===h?t:h<=g?void 0===c[h-1]?r(i,1):c[h-1]+r(i,1):t}o=c[u-1]}return void 0===o?"":o}))}}!function(){if(Sr)return Ar;Sr=1;var e=function(){if(vr)return yr;vr=1;var e=F(),t=Function.prototype,n=t.apply,r=t.call;return yr="object"==typeof Reflect&&Reflect.apply||(e?r.bind(n):function(){return r.apply(n,arguments)}),yr}(),t=b(),n=fe(),r=function(){if(Mr)return Tr;Mr=1,mr();var e=b(),t=Kt(),n=dr(),r=M(),i=at(),s=Ct(),o=i("species"),u=RegExp.prototype;return Tr=function(a,l,c,p){var h=i(a),f=!r((function(){var e={};return e[h]=function(){return 7},7!==""[a](e)})),g=f&&!r((function(){var e=!1,t=/a/;return"split"===a&&((t={}).constructor={},t.constructor[o]=function(){return t},t.flags="",t[h]=/./[h]),t.exec=function(){return e=!0,null},t[h](""),!e}));if(!f||!g||c){var d=/./[h],m=l(h,""[a],(function(t,r,i,s,o){var a=r.exec;return a===n||a===u.exec?f&&!o?{done:!0,value:e(d,r,i,s)}:{done:!0,value:e(t,i,r,s)}:{done:!1}}));t(String.prototype,a,m[0]),t(u,h,m[1])}p&&s(u[h],"sham",!0)}}(),i=M(),s=bt(),o=ve(),u=Te(),a=gn(),l=mn(),c=qn(),p=me(),h=$r(),f=xe(),g=Lr(),d=function(){if(xr)return wr;xr=1;var e=b(),t=bt(),n=ve(),r=ge(),i=dr(),s=TypeError;return wr=function(o,u){var a=o.exec;if(n(a)){var l=e(a,o,u);return null!==l&&t(l),l}if("RegExp"===r(o))return e(i,o,u);throw new s("RegExp#exec called on incompatible receiver")}}(),m=at()("replace"),y=Math.max,v=Math.min,T=n([].concat),D=n([].push),E=n("".indexOf),C=n("".slice),k="$0"==="a".replace(/./,"$0"),w=!!/./[m]&&""===/./[m]("a","$0");r("replace",(function(n,r,i){var M=w?"$":"$0";return[function(e,n){var i=p(this),s=u(e)?f(e,m):void 0;return s?t(s,e,i,n):t(r,c(i),e,n)},function(t,n){var u=s(this),p=c(t);if("string"==typeof n&&-1===E(n,M)&&-1===E(n,"$<")){var f=i(r,u,p,n);if(f.done)return f.value}var m=o(n);m||(n=c(n));var F,b=u.global;b&&(F=u.unicode,u.lastIndex=0);for(var k,w=[];null!==(k=d(u,p))&&(D(w,k),b);){""===c(k[0])&&(u.lastIndex=h(p,l(u.lastIndex),F))}for(var x,S="",A=0,$=0;$<w.length;$++){for(var L,O=c((k=w[$])[0]),I=y(v(a(k.index),p.length),0),P=[],B=1;B<k.length;B++)D(P,void 0===(x=k[B])?x:String(x));var N=k.groups;if(m){var _=T([O],P,I,p);void 0!==N&&D(_,N),L=c(e(n,void 0,_))}else L=g(O,p,I,P,N,n);I>=A&&(S+=C(p,A,I)+L,A=I+O.length)}return S+C(p,A)}]}),!!i((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!k||w)}();var Or,Ir,Pr,Br,Nr,_r,Hr,Rr={};function jr(){return Ir?Or:(Ir=1,Or="\t\n\v\f\r                 \u2028\u2029\ufeff")}!function(){if(Hr)return Rr;Hr=1;var e=zn(),t=function(){if(Br)return Pr;Br=1;var e=fe(),t=me(),n=qn(),r=jr(),i=e("".replace),s=RegExp("^["+r+"]+"),o=RegExp("(^|[^"+r+"])["+r+"]+$"),u=function(e){return function(r){var u=n(t(r));return 1&e&&(u=i(u,s,"")),2&e&&(u=i(u,o,"$1")),u}};return Pr={start:u(1),end:u(2),trim:u(3)}}().trim,n=function(){if(_r)return Nr;_r=1;var e=Gt().PROPER,t=M(),n=jr();return Nr=function(r){return t((function(){return!!n[r]()||"​…᠎"!=="​…᠎"[r]()||e&&n[r].name!==r}))}}();e({target:"String",proto:!0,forced:n("trim")},{trim:function(){return t(this)}})}();var Gr,Ur,zr,Vr,qr,Zr,Kr,Yr,Wr,Xr,Jr,Qr,ei,ti,ni,ri,ii,si,oi,ui,ai,li,ci,pi,hi,fi,gi,di,mi,yi,vi,Ti,Mi,Di={};function Fi(){if(Zr)return qr;Zr=1;var e=at(),t=hr(),n=Et().f,r=e("unscopables"),i=Array.prototype;return void 0===i[r]&&n(i,r,{configurable:!0,value:t(null)}),qr=function(e){i[r][e]=!0}}function bi(){return Yr?Kr:(Yr=1,Kr={})}function Ei(){if(Qr)return Jr;Qr=1;var e=ot(),t=ve(),n=st(),r=zt(),i=function(){if(Xr)return Wr;Xr=1;var e=M();return Wr=!e((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))}(),s=r("IE_PROTO"),o=Object,u=o.prototype;return Jr=i?o.getPrototypeOf:function(r){var i=n(r);if(e(i,s))return i[s];var a=i.constructor;return t(a)&&i instanceof a?a.prototype:i instanceof o?u:null}}function Ci(){if(ti)return ei;ti=1;var e,t,n,r=M(),i=ve(),s=Te(),o=hr(),u=Ei(),a=Kt(),l=at(),c=tt(),p=l("iterator"),h=!1;return[].keys&&("next"in(n=[].keys())?(t=u(u(n)))!==Object.prototype&&(e=t):h=!0),!s(e)||r((function(){var t={};return e[p].call(t)!==t}))?e={}:c&&(e=o(e)),i(e[p])||a(e,p,(function(){return this})),ei={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:h}}function ki(){if(ri)return ni;ri=1;var e=Et().f,t=ot(),n=at()("toStringTag");return ni=function(r,i,s){r&&!s&&(r=r.prototype),r&&!t(r,n)&&e(r,n,{configurable:!0,value:i})}}function wi(){if(li)return ai;li=1;var e=Te();return ai=function(t){return e(t)||null===t}}function xi(){if(pi)return ci;pi=1;var e=wi(),t=String,n=TypeError;return ci=function(r){if(e(r))return r;throw new n("Can't set "+t(r)+" as a prototype")}}function Si(){if(fi)return hi;fi=1;var e=function(){if(ui)return oi;ui=1;var e=fe(),t=we();return oi=function(n,r,i){try{return e(t(Object.getOwnPropertyDescriptor(n,r)[i]))}catch(e){}}}(),t=Te(),n=me(),r=xi();return hi=Object.setPrototypeOf||("__proto__"in{}?function(){var i,s=!1,o={};try{(i=e(Object.prototype,"__proto__","set"))(o,[]),s=o instanceof Array}catch(e){}return function(e,o){return n(e),r(o),t(e)?(s?i(e,o):e.__proto__=o,e):e}}():void 0)}function Ai(){if(di)return gi;di=1;var e=zn(),t=b(),n=tt(),r=Gt(),i=ve(),s=function(){if(si)return ii;si=1;var e=Ci().IteratorPrototype,t=hr(),n=he(),r=ki(),i=bi(),s=function(){return this};return ii=function(o,u,a,l){var c=u+" Iterator";return o.prototype=t(e,{next:n(+!l,a)}),r(o,c,!1,!0),i[c]=s,o}}(),o=Ei(),u=Si(),a=ki(),l=Ct(),c=Kt(),p=at(),h=bi(),f=Ci(),g=r.PROPER,d=r.CONFIGURABLE,m=f.IteratorPrototype,y=f.BUGGY_SAFARI_ITERATORS,v=p("iterator"),T="keys",M="values",D="entries",F=function(){return this};return gi=function(r,p,f,b,E,C,k){s(f,p,b);var w,x,S,A=function(e){if(e===E&&P)return P;if(!y&&e&&e in O)return O[e];switch(e){case T:case M:case D:return function(){return new f(this,e)}}return function(){return new f(this)}},$=p+" Iterator",L=!1,O=r.prototype,I=O[v]||O["@@iterator"]||E&&O[E],P=!y&&I||A(E),B="Array"===p&&O.entries||I;if(B&&(w=o(B.call(new r)))!==Object.prototype&&w.next&&(n||o(w)===m||(u?u(w,m):i(w[v])||c(w,v,F)),a(w,$,!0,!0),n&&(h[$]=F)),g&&E===M&&I&&I.name!==M&&(!n&&d?l(O,"name",M):(L=!0,P=function(){return t(I,this)})),E)if(x={values:A(M),keys:C?P:A(T),entries:A(D)},k)for(S in x)(y||L||!(S in O))&&c(O,S,x[S]);else e({target:p,proto:!0,forced:y||L},x);return n&&!k||O[v]===P||c(O,v,P,{name:E}),h[p]=P,x}}function $i(){return yi?mi:(yi=1,mi=function(e,t){return{value:e,done:t}})}!function(){if(Mi)return Di;Mi=1;var e=c(),t=Ur?Gr:(Ur=1,Gr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}),n=function(){if(Vr)return zr;Vr=1;var e=pt()("span").classList,t=e&&e.constructor&&e.constructor.prototype;return zr=t===Object.prototype?void 0:t}(),r=function(){if(Ti)return vi;Ti=1;var e=ye(),t=Fi(),n=bi(),r=qt(),i=Et().f,s=Ai(),o=$i(),u=tt(),a=D(),l="Array Iterator",c=r.set,p=r.getterFor(l);vi=s(Array,"Array",(function(t,n){c(this,{type:l,target:e(t),index:0,kind:n})}),(function(){var e=p(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,o(void 0,!0);switch(e.kind){case"keys":return o(n,!1);case"values":return o(t[n],!1)}return o([n,t[n]],!1)}),"values");var h=n.Arguments=n.Array;if(t("keys"),t("values"),t("entries"),!u&&a&&"values"!==h.name)try{i(h,"name",{value:"values"})}catch(e){}return vi}(),i=Ct(),s=ki(),o=at()("iterator"),u=r.values,a=function(e,n){if(e){if(e[o]!==u)try{i(e,o,u)}catch(t){e[o]=u}if(s(e,n,!0),t[n])for(var a in r)if(e[a]!==r[a])try{i(e,a,r[a])}catch(t){e[a]=r[a]}}};for(var l in t)a(e[l]&&e[l].prototype,l);a(n,"DOMTokenList")}();var Li,Oi,Ii,Pi,Bi,Ni,_i,Hi,Ri,ji,Gi,Ui,zi,Vi={};function qi(){if(Oi)return Li;Oi=1;var e=ve(),t=Te(),n=Si();return Li=function(r,i,s){var o,u;return n&&e(o=i.constructor)&&o!==s&&t(u=o.prototype)&&u!==s.prototype&&n(r,u),r}}function Zi(){if(Hi)return _i;Hi=1;var e=Et().f;return _i=function(t,n,r){r in t||e(t,r,{configurable:!0,get:function(){return n[r]},set:function(e){n[r]=e}})}}function Ki(){if(ji)return Ri;ji=1;var e=Zt(),t=Et();return Ri=function(n,r,i){return i.get&&e(i.get,r,{getter:!0}),i.set&&e(i.set,r,{setter:!0}),t.f(n,r,i)}}function Yi(){if(Ui)return Gi;Ui=1;var e=Me(),t=Ki(),n=at(),r=D(),i=n("species");return Gi=function(n){var s=e(n);r&&s&&!s[i]&&t(s,i,{configurable:!0,get:function(){return this}})}}!function(){if(zi)return Vi;zi=1;var e=D(),t=c(),n=fe(),r=Un(),i=qi(),s=Ct(),o=hr(),u=Mn().f,a=De(),l=function(){if(Pi)return Ii;Pi=1;var e=Te(),t=ge(),n=at()("match");return Ii=function(r){var i;return e(r)&&(void 0!==(i=r[n])?!!i:"RegExp"===t(r))}}(),p=qn(),h=function(){if(Ni)return Bi;Ni=1;var e=b(),t=ot(),n=De(),r=Zn(),i=RegExp.prototype;return Bi=function(s){var o=s.flags;return void 0!==o||"flags"in i||t(s,"flags")||!n(i,s)?o:e(r,s)}}(),f=Kn(),g=Zi(),d=Kt(),m=M(),y=ot(),v=qt().enforce,T=Yi(),F=at(),E=fr(),C=gr(),k=F("match"),w=t.RegExp,x=w.prototype,S=t.SyntaxError,A=n(x.exec),$=n("".charAt),L=n("".replace),O=n("".indexOf),I=n("".slice),P=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,B=/a/g,N=/a/g,_=new w(B)!==B,H=f.MISSED_STICKY,R=f.UNSUPPORTED_Y,j=e&&(!_||H||E||C||m((function(){return N[k]=!1,w(B)!==B||w(N)===N||"/a/i"!==String(w(B,"i"))})));if(r("RegExp",j)){for(var G=function(e,t){var n,r,u,c,f,g,d=a(x,this),m=l(e),T=void 0===t,M=[],D=e;if(!d&&m&&T&&e.constructor===G)return e;if((m||a(x,e))&&(e=e.source,T&&(t=h(D))),e=void 0===e?"":p(e),t=void 0===t?"":p(t),D=e,E&&"dotAll"in B&&(r=!!t&&O(t,"s")>-1)&&(t=L(t,/s/g,"")),n=t,H&&"sticky"in B&&(u=!!t&&O(t,"y")>-1)&&R&&(t=L(t,/y/g,"")),C&&(c=function(e){for(var t,n=e.length,r=0,i="",s=[],u=o(null),a=!1,l=!1,c=0,p="";r<=n;r++){if("\\"===(t=$(e,r)))t+=$(e,++r);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:if(i+=t,"?:"===I(e,r+1,r+3))continue;A(P,I(e,r+1))&&(r+=2,l=!0),c++;continue;case">"===t&&l:if(""===p||y(u,p))throw new S("Invalid capture group name");u[p]=!0,s[s.length]=[p,c],l=!1,p="";continue}l?p+=t:i+=t}return[i,s]}(e),e=c[0],M=c[1]),f=i(w(e,t),d?this:x,G),(r||u||M.length)&&(g=v(f),r&&(g.dotAll=!0,g.raw=G(function(e){for(var t,n=e.length,r=0,i="",s=!1;r<=n;r++)"\\"!==(t=$(e,r))?s||"."!==t?("["===t?s=!0:"]"===t&&(s=!1),i+=t):i+="[\\s\\S]":i+=t+$(e,++r);return i}(e),n)),u&&(g.sticky=!0),M.length&&(g.groups=M)),e!==D)try{s(f,"source",""===D?"(?:)":D)}catch(e){}return f},U=u(w),z=0;U.length>z;)g(G,w,U[z++]);x.constructor=G,G.prototype=x,d(t,"RegExp",G,{constructor:!0})}T("RegExp")}();var Wi,Xi={};!function(){if(Wi)return Xi;Wi=1;var e=c(),t=D(),n=Ki(),r=Zn(),i=M(),s=e.RegExp,o=s.prototype;t&&i((function(){var e=!0;try{s(".","d")}catch(t){e=!1}var t={},n="",r=e?"dgimsy":"gimsy",i=function(e,r){Object.defineProperty(t,e,{get:function(){return n+=r,!0}})},u={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var a in e&&(u.hasIndices="d"),u)i(a,u[a]);return Object.getOwnPropertyDescriptor(o,"flags").get.call(t)!==r||n!==r}))&&n(o,"flags",{configurable:!0,get:r})}();const Ji={ASCIIPunctuation:/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~\\]/,NotTriggerChar:/[^`_*[\]()<>!~]/,Scheme:/[A-Za-z][A-Za-z0-9+.-]{1,31}/,Email:/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*/,HTMLOpenTag:/<HTMLTagName(?:HTMLAttribute)*\s*\/?>/,HTMLCloseTag:/<\/HTMLTagName\s*>/,HTMLTagName:/[A-Za-z][A-Za-z0-9-]*/,HTMLComment:/<!--(?:[^>-]|(?:[^>-](?:[^-]|-[^-])*[^-]))-->/,HTMLPI:/<\?(?:|.|(?:[^?]|\?[^>])*)\?>/,HTMLDeclaration:/<![A-Z]+\s[^>]*>/,HTMLCDATA:/<!\[CDATA\[.*?\]\]>/,HTMLAttribute:/\s+[A-Za-z_:][A-Za-z0-9_.:-]*(?:HTMLAttValue)?/,HTMLAttValue:/\s*=\s*(?:(?:'[^']*')|(?:"[^"]*")|(?:[^\s"'=<>`]+))/,KnownTag:/address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul/},Qi=new RegExp(/^(?:[!"#$%&'()*+,\-./:;<=>?@[\]\\^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B])/),es=new RegExp(/(?:[!"#$%&'()*+,\-./:;<=>?@[\]\\^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B])$/),ts={TMH1:{regexp:/^( {0,3}#\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH1">$1</span>$$2<span class="TMMark TMMark_TMH1">$3</span>'},TMH2:{regexp:/^( {0,3}##\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH2">$1</span>$$2<span class="TMMark TMMark_TMH2">$3</span>'},TMH3:{regexp:/^( {0,3}###\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH3">$1</span>$$2<span class="TMMark TMMark_TMH3">$3</span>'},TMH4:{regexp:/^( {0,3}####\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH4">$1</span>$$2<span class="TMMark TMMark_TMH4">$3</span>'},TMH5:{regexp:/^( {0,3}#####\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH5">$1</span>$$2<span class="TMMark TMMark_TMH5">$3</span>'},TMH6:{regexp:/^( {0,3}######\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH6">$1</span>$$2<span class="TMMark TMMark_TMH6">$3</span>'},TMBlockquote:{regexp:/^( {0,3}>[ ]?)(.*)$/,replacement:'<span class="TMMark TMMark_TMBlockquote">$1</span>$$2'},TMCodeFenceBacktickOpen:{regexp:s(/^( {0,3}(````*)\s*)([^`]*?)(\s*)$/,{seq:2}),replacement:'<span class="TMMark TMMark_TMCodeFenceBacktick">$1</span><span class="TMInfoString">$3</span>$4'},TMCodeFenceTildeOpen:{regexp:s(/^( {0,3}(~~~~*)\s*)(.*?)(\s*)$/,{seq:2}),replacement:'<span class="TMMark TMMark_TMCodeFenceTilde">$1</span><span class="TMInfoString">$3</span>$4'},TMCodeFenceBacktickClose:{regexp:s(/^( {0,3}(````*))(\s*)$/,{seq:2}),replacement:'<span class="TMMark TMMark_TMCodeFenceBacktick">$1</span>$3'},TMCodeFenceTildeClose:{regexp:s(/^( {0,3}(~~~~*))(\s*)$/,{seq:2}),replacement:'<span class="TMMark TMMark_TMCodeFenceTilde">$1</span>$3'},TMBlankLine:{regexp:/^([ \t]*)$/,replacement:"$0"},TMSetextH1Marker:{regexp:/^ {0,3}=+\s*$/,replacement:'<span class="TMMark TMMark_TMSetextH1Marker">$0</span>'},TMSetextH2Marker:{regexp:/^ {0,3}-+\s*$/,replacement:'<span class="TMMark TMMark_TMSetextH1Marker">$0</span>'},TMHR:{regexp:/^( {0,3}(\*[ \t]*\*[ \t]*\*[ \t*]*)|(-[ \t]*-[ \t]*-[ \t-]*)|(_[ \t]*_[ \t]*_[ \t_]*))$/,replacement:'<span class="TMMark TMMark_TMHR">$0</span>'},TMUL:{regexp:/^( {0,3}[+*-] {1,4})(.*)$/,replacement:'<span class="TMMark TMMark_TMUL">$1</span>$$2'},TMOL:{regexp:/^( {0,3}\d{1,9}[.)] {1,4})(.*)$/,replacement:'<span class="TMMark TMMark_TMOL">$1</span>$$2'},TMIndentedCode:{regexp:/^( {4}|\t)(.*)$/,replacement:'<span class="TMMark TMMark_TMIndentedCode">$1</span>$2'},TMLinkReferenceDefinition:{regexp:/^( {0,3}\[\s*)([^\s\]](?:[^\]]|\\\])*?)(\s*\]:\s*)((?:[^\s<>]+)|(?:<(?:[^<>\\]|\\.)*>))?(\s*)((?:\((?:[^()\\]|\\.)*\))|(?:"(?:[^"\\]|\\.)*")|(?:'(?:[^'\\]|\\.)*'))?(\s*)$/,replacement:'<span class="TMMark TMMark_TMLinkReferenceDefinition">$1</span><span class="TMLinkLabel TMLinkLabel_Definition">$2</span><span class="TMMark TMMark_TMLinkReferenceDefinition">$3</span><span class="TMLinkDestination">$4</span>$5<span class="TMLinkTitle">$6</span>$7',labelPlaceholder:2}},ns=[{start:/^ {0,3}<(?:script|pre|style)(?:\s|>|$)/i,end:/(?:<\/script>|<\/pre>|<\/style>)/i,paraInterrupt:!0},{start:/^ {0,3}<!--/,end:/-->/,paraInterrupt:!0},{start:/^ {0,3}<\?/,end:/\?>/,paraInterrupt:!0},{start:/^ {0,3}<![A-Z]/,end:/>/,paraInterrupt:!0},{start:/^ {0,3}<!\[CDATA\[/,end:/\]\]>/,paraInterrupt:!0},{start:/^ {0,3}(?:<|<\/)(?:KnownTag)(?:\s|>|\/>|$)/i,end:!1,paraInterrupt:!0},{start:/^ {0,3}(?:HTMLOpenTag|HTMLCloseTag)\s*$/,end:!1,paraInterrupt:!1}],rs={escape:{regexp:/^\\(ASCIIPunctuation)/,replacement:'<span class="TMMark TMMark_TMEscape">\\</span>$1'},code:{regexp:/^(`+)((?:[^`])|(?:[^`].*?[^`]))(\1)/,replacement:'<span class="TMMark TMMark_TMCode">$1</span><code class="TMCode">$2</code><span class="TMMark TMMark_TMCode">$3</span>'},autolink:{regexp:/^<((?:Scheme:[^\s<>]*)|(?:Email))>/,replacement:'<span class="TMMark TMMark_TMAutolink">&lt;</span><span class="TMAutolink">$1</span><span class="TMMark TMMark_TMAutolink">&gt;</span>'},html:{regexp:/^((?:HTMLOpenTag)|(?:HTMLCloseTag)|(?:HTMLComment)|(?:HTMLPI)|(?:HTMLDeclaration)|(?:HTMLCDATA))/,replacement:'<span class="TMHTML">$1</span>'},linkOpen:{regexp:/^\[/,replacement:""},imageOpen:{regexp:/^!\[/,replacement:""},linkLabel:{regexp:/^(\[\s*)([^\]]*?)(\s*\])/,replacement:"",labelPlaceholder:2},default:{regexp:/^(.|(?:NotTriggerChar+))/,replacement:"$1"}},is=new RegExp(Object.keys(Ji).join("|")),ss=[...Object.keys(rs)];for(let e of ss){let t=rs[e].regexp.source;for(;t.match(is);)t=t.replace(is,(e=>Ji[e].source));rs[e].regexp=new RegExp(t,rs[e].regexp.flags)}for(let e of ns){let t=e.start.source;for(;t.match(is);)t=t.replace(is,(e=>Ji[e].source));e.start=new RegExp(t,e.start.flags)}function os(e){return(e||"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const us={bold:{type:"inline",className:"TMStrong",set:{pre:"**",post:"**"},unset:{prePattern:/(?:\*\*|__)$/,postPattern:/^(?:\*\*|__)/}},italic:{type:"inline",className:"TMEm",set:{pre:"*",post:"*"},unset:{prePattern:/(?:\*|_)$/,postPattern:/^(?:\*|_)/}},code:{type:"inline",className:"TMCode",set:{pre:"`",post:"`"},unset:{prePattern:/`+$/,postPattern:/^`+/}},strikethrough:{type:"inline",className:"TMStrikethrough",set:{pre:"~~",post:"~~"},unset:{prePattern:/~~$/,postPattern:/^~~/}},h1:{type:"line",className:"TMH1",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"# $2"},unset:{pattern:/^( {0,3}#\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h2:{type:"line",className:"TMH2",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"## $2"},unset:{pattern:/^( {0,3}##\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h3:{type:"line",className:"TMH3",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"### $2"},unset:{pattern:/^( {0,3}###\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h4:{type:"line",className:"TMH4",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"#### $2"},unset:{pattern:/^( {0,3}####\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h5:{type:"line",className:"TMH5",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"##### $2"},unset:{pattern:/^( {0,3}#####\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h6:{type:"line",className:"TMH6",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"###### $2"},unset:{pattern:/^( {0,3}######\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},ul:{type:"line",className:"TMUL",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"- $2"},unset:{pattern:/^( {0,3}[+*-] {1,4})(.*)$/,replacement:"$2"}},ol:{type:"line",className:"TMOL",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"$#. $2"},unset:{pattern:/^( {0,3}\d{1,9}[.)] {1,4})(.*)$/,replacement:"$2"}},blockquote:{type:"line",className:"TMBlockquote",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"> $2"},unset:{pattern:/^( {0,3}>[ ]?)(.*)$/,replacement:"$2"}}};e.Editor=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t;this.e=null,this.textarea=null,this.lines=[],this.lineElements=[],this.lineTypes=[],this.lineCaptures=[],this.lineReplacements=[],this.linkLabels=[],this.lineDirty=[],this.lastCommandState=null,this.customInlineGrammar={},this.mergedInlineGrammar=rs,this.hasFocus=!0,this.lastSelection=null,this.listeners={change:[],selection:[],drop:[]},this.undoStack=[],this.redoStack=[],this.isRestoringHistory=!1,this.maxHistory=100,this.e=null,this.textarea=null,this.lines=[],this.lineElements=[],this.lineTypes=[],this.lineCaptures=[],this.lineReplacements=[],this.linkLabels=[],this.lineDirty=[],this.lastCommandState=null,this.hasFocus=!0,this.lastSelection=null,this.customInlineGrammar=e.customInlineGrammar||{},this.mergedInlineGrammar=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=r({},rs);for(const[n,i]of Object.entries(e)){const e=r({},i);let s=i.regexp.source;const o=new RegExp(Object.keys(Ji).join("|"));for(;s.match(o);)s=s.replace(o,(e=>Ji[e].source));e.regexp=new RegExp(s,i.regexp.flags),t[n]=e}return t}(this.customInlineGrammar),this.listeners={change:[],selection:[],drop:[]};let n=null;"string"==typeof e.element?n=document.getElementById(e.element):e.element&&(n=e.element),"string"==typeof e.textarea?this.textarea=document.getElementById(e.textarea):e.textarea&&(this.textarea=e.textarea),this.textarea&&(n||(n=this.textarea)),n||(n=document.getElementsByTagName("body")[0]),n&&"TEXTAREA"===n.tagName&&(this.textarea=n,n=this.textarea.parentNode),this.textarea&&(this.textarea.style.display="none"),this.placeholder=void 0!==e.placeholder?e.placeholder:(null===(t=this.textarea)||void 0===t?void 0:t.placeholder)||void 0,this.undoStack=[],this.redoStack=[],this.isRestoringHistory=!1,this.maxHistory=100,this.createEditorElement(n,e),this.setContent("string"==typeof e.content?e.content:this.textarea?this.textarea.value:"# Hello TinyMDE!\nEdit **here**"),this.e.addEventListener("keydown",(e=>this.handleUndoRedoKey(e)))}get canUndo(){return this.undoStack.length>=2}get canRedo(){return this.redoStack.length>0}pushHistory(){this.isRestoringHistory||(this.pushCurrentState(),this.redoStack=[])}pushCurrentState(){this.undoStack.push({content:this.getContent(),selection:this.getSelection(),anchor:this.getSelection(!0)}),this.undoStack.length>this.maxHistory&&this.undoStack.shift()}undo(){if(this.undoStack.length<2)return;this.isRestoringHistory=!0,this.pushCurrentState();const e=this.undoStack.pop();this.redoStack.push(e);const t=this.undoStack[this.undoStack.length-1];this.setContent(t.content),t.selection&&this.setSelection(t.selection,t.anchor),this.undoStack.pop(),this.isRestoringHistory=!1}redo(){if(!this.redoStack.length)return;this.isRestoringHistory=!0,this.pushCurrentState();const e=this.redoStack.pop();this.setContent(e.content),e.selection&&this.setSelection(e.selection,e.anchor),this.isRestoringHistory=!1}handleUndoRedoKey(e){(/Mac|iPod|iPhone|iPad/.test(navigator.platform)?e.metaKey:e.ctrlKey)&&!e.altKey&&("z"===e.key||"Z"===e.key?(e.shiftKey?this.redo():this.undo(),e.preventDefault()):"y"!==e.key&&"Y"!==e.key||(this.redo(),e.preventDefault()))}createEditorElement(e,t){t&&void 0!==t.editor?"string"==typeof t.editor?this.e=document.getElementById(t.editor):this.e=t.editor:this.e=document.createElement("div"),this.e.classList.add("TinyMDE"),this.e.contentEditable="true",this.e.style.whiteSpace="pre-wrap",this.e.style.webkitUserModify="read-write-plaintext-only",this.placeholder&&this.e.setAttribute("data-placeholder",this.placeholder),void 0===t.editor&&(this.textarea&&this.textarea.parentNode===e&&this.textarea.nextSibling?e.insertBefore(this.e,this.textarea.nextSibling):e.appendChild(this.e)),this.e.addEventListener("input",(e=>this.handleInputEvent(e))),this.e.addEventListener("beforeinput",(e=>this.handleBeforeInputEvent(e))),this.e.addEventListener("compositionend",(e=>this.handleInputEvent(e))),document.addEventListener("selectionchange",(e=>{this.hasFocus&&this.handleSelectionChangeEvent(e)})),this.e.addEventListener("blur",(()=>this.hasFocus=!1)),this.e.addEventListener("focus",(()=>this.hasFocus=!0)),this.e.addEventListener("paste",(e=>this.handlePaste(e))),this.e.addEventListener("drop",(e=>this.handleDrop(e))),this.lineElements=this.e.childNodes}setContent(e){for(;this.e.firstChild;)this.e.removeChild(this.e.firstChild);this.lines=e.split(/(?:\r\n|\r|\n)/),this.lineDirty=[];for(let e=0;e<this.lines.length;e++){let e=document.createElement("div");this.e.appendChild(e),this.lineDirty.push(!0)}this.lineTypes=new Array(this.lines.length),this.updateFormatting(),this.updatePlaceholder(),this.fireChange(),this.isRestoringHistory||this.pushHistory()}getContent(){return this.lines.join("\n")}updatePlaceholder(){this.placeholder&&this.e&&(""===this.getContent()?this.e.classList.add("TinyMDE_empty"):this.e.classList.remove("TinyMDE_empty"))}updateFormatting(){this.updateLineTypes(),this.updateLinkLabels(),this.applyLineTypes()}updateLinkLabels(){this.linkLabels=[];for(let e=0;e<this.lines.length;e++)"TMLinkReferenceDefinition"===this.lineTypes[e]&&this.linkLabels.push(this.lineCaptures[e][ts.TMLinkReferenceDefinition.labelPlaceholder])}replace(e,t){return e.replace(/(\${1,2})([0-9])/g,((e,n,r)=>"$"===n?os(t[parseInt(r)]):'<span class="TMInlineFormatted">'.concat(this.processInlineStyles(t[parseInt(r)]),"</span>")))}applyLineTypes(){for(let e=0;e<this.lines.length;e++){if(this.lineDirty[e]){let t=this.replace(this.lineReplacements[e],this.lineCaptures[e]);this.lineElements[e].className=this.lineTypes[e],this.lineElements[e].removeAttribute("style"),this.lineElements[e].innerHTML=""===t?"<br />":t}this.lineElements[e].dataset.lineNum=e.toString()}}updateLineTypes(){let e=!1,t=0,n=!1;for(let r=0;r<this.lines.length;r++){let i="TMPara",s=[this.lines[r]],o="$$0";if("TMCodeFenceBacktickOpen"===e){let n=ts.TMCodeFenceBacktickClose.regexp.exec(this.lines[r]);n&&n.groups.seq.length>=t?(i="TMCodeFenceBacktickClose",o=ts.TMCodeFenceBacktickClose.replacement,s=n,e=!1):(i="TMFencedCodeBacktick",o='<span class="TMFencedCode">$0<br /></span>',s=[this.lines[r]])}else if("TMCodeFenceTildeOpen"===e){let n=ts.TMCodeFenceTildeClose.regexp.exec(this.lines[r]);n&&n.groups.seq.length>=t?(i="TMCodeFenceTildeClose",o=ts.TMCodeFenceTildeClose.replacement,s=n,e=!1):(i="TMFencedCodeTilde",o='<span class="TMFencedCode">$0<br /></span>',s=[this.lines[r]])}if("TMPara"===i&&!1===n)for(let e of ns)if(this.lines[r].match(e.start)&&(e.paraInterrupt||0===r||"TMPara"!==this.lineTypes[r-1]&&"TMUL"!==this.lineTypes[r-1]&&"TMOL"!==this.lineTypes[r-1]&&"TMBlockquote"!==this.lineTypes[r-1])){n=e;break}if(!1!==n&&(i="TMHTMLBlock",o='<span class="TMHTMLContent">$0<br /></span>',s=[this.lines[r]],n.end?this.lines[r].match(n.end)&&(n=!1):(r===this.lines.length-1||this.lines[r+1].match(ts.TMBlankLine.regexp))&&(n=!1)),"TMPara"===i)for(let e in ts)if(ts[e].regexp){let t=ts[e].regexp.exec(this.lines[r]);if(t){i=e,o=ts[e].replacement,s=t;break}}if("TMCodeFenceBacktickOpen"!==i&&"TMCodeFenceTildeOpen"!==i||(e=i,t=s.groups.seq.length),"TMIndentedCode"!==i&&"TMLinkReferenceDefinition"!==i||!(r>0)||"TMPara"!==this.lineTypes[r-1]&&"TMUL"!==this.lineTypes[r-1]&&"TMOL"!==this.lineTypes[r-1]&&"TMBlockquote"!==this.lineTypes[r-1]||(i="TMPara",s=[this.lines[r]],o="$$0"),"TMSetextH2Marker"===i){let e=ts.TMUL.regexp.exec(this.lines[r]);e&&(i="TMUL",o=ts.TMUL.replacement,s=e)}if("TMSetextH1Marker"===i||"TMSetextH2Marker"===i)if(0===r||"TMPara"!==this.lineTypes[r-1]){let e=ts.TMHR.regexp.exec(this.lines[r]);e?(i="TMHR",s=e,o=ts.TMHR.replacement):(i="TMPara",s=[this.lines[r]],o="$$0")}else{let e=r-1;const t="TMSetextH1Marker"===i?"TMSetextH1":"TMSetextH2";do{this.lineTypes[e]!==t&&(this.lineTypes[e]=t,this.lineDirty[e]=!0),this.lineReplacements[e]="$$0",this.lineCaptures[e]=[this.lines[e]],e--}while(e>=0&&"TMPara"===this.lineTypes[e])}this.lineTypes[r]!==i&&(this.lineTypes[r]=i,this.lineDirty[r]=!0),this.lineReplacements[r]=o,this.lineCaptures[r]=s}}getSelection(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var t,n;const r=window.getSelection();let i=e?r.anchorNode:r.focusNode;if(!i)return null;let s=e?r.anchorOffset:r.focusOffset;if(i===this.e)return s<this.lines.length?{row:s,col:0}:{row:s-1,col:this.lines[s-1].length};let o=this.computeColumn(i,s);if(null===o)return null;let u=i;for(;u.parentElement!==this.e;)u=u.parentElement;let a=0;if(u.previousSibling){const e=null===(t=u.dataset)||void 0===t?void 0:t.lineNum,r=null===(n=u.previousSibling.dataset)||void 0===n?void 0:n.lineNum;if(e&&r){const t=parseInt(e);if(t===parseInt(r)+1)a=t;else for(;u.previousSibling;)a++,u=u.previousSibling}}return{row:a,col:o}}setSelection(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return;let{node:n,offset:r}=this.computeNodeAndOffset(e.row,e.col,!!t&&(t.row===e.row&&t.col>e.col)),i=null,s=null;if(t&&(t.row!==e.row||t.col!==e.col)){let{node:n,offset:r}=this.computeNodeAndOffset(t.row,t.col,e.row===t.row&&e.col>t.col);i=n,s=r}window.getSelection().setBaseAndExtent(n,r,i||n,i?s:r)}restoreLastSelection(){return!(!this.lastSelection||!this.lastSelection.focus)&&(this.setSelection(this.lastSelection.focus,this.lastSelection.anchor),!0)}paste(e){let t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;r||(r=this.getSelection(!0)),i||(i=this.getSelection(!1)),i||(i={row:this.lines.length-1,col:this.lines[this.lines.length-1].length}),r||(r=i),r.row<i.row||r.row===i.row&&r.col<=i.col?(t=r,n=i):(t=i,n=r);let s=e.split(/(?:\r\n|\r|\n)/),o=this.lines[t.row].substr(0,t.col),u=this.lines[n.row].substr(n.col);s[0]=o.concat(s[0]);let a=s[s.length-1].length;s[s.length-1]=s[s.length-1].concat(u),this.spliceLines(t.row,1+n.row-t.row,s),i.row=t.row+s.length-1,i.col=a,this.updateFormatting(),this.setSelection(i),this.fireChange()}wrapSelection(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(this.isRestoringHistory||this.pushHistory(),n||(n=this.getSelection(!1)),r||(r=this.getSelection(!0)),!n||!r||n.row!==r.row)return;this.lineDirty[n.row]=!0;const i=n.col<r.col?n.col:r.col,s=n.col<r.col?r.col:n.col,o=this.lines[n.row].substr(0,i).concat(e),u=s===i?"":this.lines[n.row].substr(i,s-i),a=t.concat(this.lines[n.row].substr(s));this.lines[n.row]=o.concat(u,a),r.col=o.length,n.col=r.col+u.length,this.updateFormatting(),this.setSelection(n,r)}addEventListener(e,t){e.match(/^(?:change|input)$/i)&&this.listeners.change.push(t),e.match(/^(?:selection|selectionchange)$/i)&&this.listeners.selection.push(t),e.match(/^(?:drop)$/i)&&this.listeners.drop.push(t)}fireChange(){if(this.updatePlaceholder(),!this.textarea&&!this.listeners.change.length)return;const e=this.getContent();this.textarea&&(this.textarea.value=e);for(let t of this.listeners.change)t({content:e,linesDirty:[...this.lineDirty]})}handleBeforeInputEvent(e){const t=e;if("insertParagraph"!==t.inputType&&"insertLineBreak"!==t.inputType)return;this.isRestoringHistory||this.pushHistory(),e.preventDefault(),this.clearDirtyFlag();const n=this.getSelection(),r=this.getSelection(!0);if(n&&r){if(n.row!==r.row){const e=n.row<r.row?n:r,t=n.row<r.row?r:n;this.lines[e.row]=this.lines[e.row].substring(0,e.col),this.lines[t.row]=this.lines[t.row].substring(t.col),this.spliceLines(e.row+1,t.row-e.row-1),n.row=e.row+1,n.col=0}else{let e=!1;switch(this.lineTypes[n.row]){case"TMUL":e="TMUL";break;case"TMOL":e="TMOL";break;case"TMIndentedCode":e="TMIndentedCode"}const t=this.lines[n.row].substring(0,n.col<=r.col?n.col:r.col),i=this.lines[n.row].substring(n.col<=r.col?r.col:n.col);if(this.spliceLines(n.row,1,[t,i]),n.row+=1,n.col=0,e){let t=ts[e].regexp.exec(this.lines[n.row-1]);t&&(t[2]?("TMOL"===e&&(t[1]=t[1].replace(/\d{1,9}/,(e=>(parseInt(e)+1).toString()))),this.lines[n.row]="".concat(t[1]).concat(this.lines[n.row]),this.lineDirty[n.row]=!0,n.col=t[1].length):(this.lines[n.row-1]="",this.lineDirty[n.row-1]=!0))}}this.updateFormatting(),this.setSelection(n),n&&n.row<this.lineElements.length&&this.lineElements[n.row].scrollIntoView({block:"nearest",inline:"nearest"}),this.fireChange()}}handleInputEvent(e){const t=e;if("insertCompositionText"===t.inputType)return;this.isRestoringHistory||this.pushHistory();let n=this.getSelection();("insertParagraph"!==t.inputType&&"insertLineBreak"!==t.inputType||!n)&&(this.e.firstChild?this.fixNodeHierarchy():this.e.innerHTML='<div class="TMBlankLine"><br></div>',this.updateLineContentsAndFormatting(),n&&this.setSelection(n),this.fireChange())}handleSelectionChangeEvent(e){this.fireSelection()}handlePaste(e){this.isRestoringHistory||this.pushHistory(),e.preventDefault();let t=e.clipboardData.getData("text/plain");this.paste(t)}handleDrop(e){e.preventDefault(),this.fireDrop(e.dataTransfer)}processInlineStyles(e){let t="",n=[],r=0,i=e;e:for(;i;){for(let e of["escape","code","autolink","html"])if(this.mergedInlineGrammar[e]){let n=this.mergedInlineGrammar[e].regexp.exec(i);if(n){i=i.substr(n[0].length),r+=n[0].length,t+=this.mergedInlineGrammar[e].replacement.replace(/\$([1-9])/g,((e,t)=>os(n[t])));continue e}}for(let e in this.customInlineGrammar)if("escape"!==e&&"code"!==e&&"autolink"!==e&&"html"!==e&&"linkOpen"!==e&&"imageOpen"!==e&&"linkLabel"!==e&&"default"!==e){let n=this.mergedInlineGrammar[e].regexp.exec(i);if(n){i=i.substr(n[0].length),r+=n[0].length,t+=this.mergedInlineGrammar[e].replacement.replace(/\$([1-9])/g,((e,t)=>os(n[t])));continue e}}let s=i.match(this.mergedInlineGrammar.linkOpen.regexp),o=i.match(this.mergedInlineGrammar.imageOpen.regexp);if(o||s){let e=this.parseLinkOrImage(i,!!o);if(e){t="".concat(t).concat(e.output),i=i.substr(e.charCount),r+=e.charCount;continue e}}let u=/(^\*+)|(^_+)/.exec(i);if(u){let s=u[0].length;const o=u[0],a=u[0][0];i=i.substr(u[0].length);const l=r>0?e.substr(0,r):" ",c=r+u[0].length<e.length?i:" ",p=c.match(Qi),h=l.match(es),f=c.match(/^\s/),g=l.match(/\s$/);let d=!(f||p&&!g&&!h),m=!(g||h&&!f&&!p);if("_"===a&&d&&m&&(d=!!h,m=!!p),m){let e=n.length-1;for(;s&&e>=0;)if(n[e].delimiter===a){for(;e<n.length-1;){const e=n.pop();t="".concat(e.output).concat(e.delimString.substr(0,e.count)).concat(t)}if(s>=2&&n[e].count>=2?(t='<span class="TMMark">'.concat(a).concat(a,'</span><strong class="TMStrong">').concat(t,'</strong><span class="TMMark">').concat(a).concat(a,"</span>"),s-=2,n[e].count-=2):(t='<span class="TMMark">'.concat(a,'</span><em class="TMEm">').concat(t,'</em><span class="TMMark">').concat(a,"</span>"),s-=1,n[e].count-=1),0===n[e].count){let r=n.pop();t="".concat(r.output).concat(t),e--}}else e--}s&&d&&(n.push({delimiter:a,delimString:o,count:s,output:t}),t="",s=0),s&&(t="".concat(t).concat(o.substr(0,s))),r+=u[0].length}else if(u=/^~~/.exec(i),u){let e=!1,s=n.length-1;for(;!e&&s>=0;)if("~"===n[s].delimiter){for(;s<n.length-1;){const e=n.pop();t="".concat(e.output).concat(e.delimString.substr(0,e.count)).concat(t)}t='<span class="TMMark">~~</span><del class="TMStrikethrough">'.concat(t,'</del><span class="TMMark">~~</span>');let r=n.pop();t="".concat(r.output).concat(t),e=!0}else s--;e||(n.push({delimiter:"~",delimString:"~~",count:2,output:t}),t=""),r+=u[0].length,i=i.substr(u[0].length)}else{if(u=this.mergedInlineGrammar.default.regexp.exec(i),!u)throw"Infinite loop!";i=i.substr(u[0].length),r+=u[0].length,t+=this.mergedInlineGrammar.default.replacement.replace(/\$([1-9])/g,((e,t)=>os(u[t])))}}for(;n.length;){const e=n.pop();t="".concat(e.output).concat(e.delimString.substr(0,e.count)).concat(t)}return t}computeColumn(e,t){let n,r=e;for(;r&&r.parentNode!==this.e;)r=r.parentNode;if(null===r)return null;for(e.nodeType===Node.TEXT_NODE||0===t?(n=t,r=e):t>0?(r=e.childNodes[t-1],n=r.textContent.length):(n=0,r=e);r.parentNode!==this.e;)r.previousSibling?(r=r.previousSibling,n+=r.textContent.length):r=r.parentNode;return n}computeNodeAndOffset(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e>=this.lineElements.length&&(e=this.lineElements.length-1,t=this.lines[e].length),t>this.lines[e].length&&(t=this.lines[e].length);const r=this.lineElements[e];let i=r.firstChild,s=!1,o={node:r.firstChild?r.firstChild:r,offset:0};for(;i!==r;){if(!s&&i.nodeType===Node.TEXT_NODE)if(i.nodeValue.length>=t){if(!n||i.nodeValue.length!==t)return{node:i,offset:t};o={node:i,offset:t},t=0}else t-=i.nodeValue.length;!s&&i.firstChild?i=i.firstChild:i.nextSibling?(s=!1,i=i.nextSibling):(s=!0,i=i.parentNode)}return o}updateLineContentsAndFormatting(){this.clearDirtyFlag(),this.updateLineContents(),this.updateFormatting()}clearDirtyFlag(){this.lineDirty=new Array(this.lines.length);for(let e=0;e<this.lineDirty.length;e++)this.lineDirty[e]=!1}updateLineContents(){let e=this.e.childElementCount-this.lines.length;if(e){let t=0;for(;t<=this.lines.length&&t<=this.lineElements.length&&this.lineElements[t]&&this.lines[t]===this.lineElements[t].textContent&&this.lineTypes[t]===this.lineElements[t].className;)t++;let n=-1;for(;-n<this.lines.length&&-n<this.lineElements.length&&this.lines[this.lines.length+n]===this.lineElements[this.lineElements.length+n].textContent&&this.lineTypes[this.lines.length+n]===this.lineElements[this.lineElements.length+n].className;)n--;let r=this.lines.length+n+1-t;r<-e&&(r=-e),r<0&&(r=0);let i=[];for(let n=0;n<r+e;n++)i.push(this.lineElements[t+n].textContent||"");this.spliceLines(t,r,i,!1)}else for(let e=0;e<this.lineElements.length;e++){let t=this.lineElements[e],n=t.textContent||"";this.lines[e]===n&&this.lineTypes[e]===t.className||(this.lines[e]=n,this.lineTypes[e]=t.className,this.lineDirty[e]=!0)}}spliceLines(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(r)for(let n=0;n<t;n++)this.e.removeChild(this.e.childNodes[e]);let i=[],s=[];for(let t=0;t<n.length;t++)i.push(""),s.push(!0),r&&(this.e.childNodes[e]?this.e.insertBefore(document.createElement("div"),this.e.childNodes[e]):this.e.appendChild(document.createElement("div")));this.lines.splice(e,t,...n),this.lineTypes.splice(e,t,...i),this.lineDirty.splice(e,t,...s)}fixNodeHierarchy(){const e=Array.from(this.e.childNodes),t=function(e){const t=e.parentElement,n=e.nextSibling;t.removeChild(e);for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];i.forEach((e=>n?t.insertBefore(e,n):t.appendChild(e)))};e.forEach((e=>{if(e.nodeType!==Node.ELEMENT_NODE||"DIV"!==e.tagName){const n=document.createElement("div");t(e,n),n.appendChild(e)}else if(0===e.childNodes.length)e.appendChild(document.createElement("br"));else{const n=Array.from(e.childNodes);if(n.some((e=>e.nodeType===Node.ELEMENT_NODE&&"DIV"===e.tagName)))return t(e,...n)}}))}parseLinkOrImage(e,t){let n=t?2:1,r=e.substr(0,n),i=t?"TMImage":"TMLink",s=n,o=1,u=!1,a=!1,l=[],c=[];e:for(;s<e.length&&!1===u;){let r=e.substr(s);for(let e of["escape","code","autolink","html"]){let t=this.mergedInlineGrammar[e].regexp.exec(r);if(t){s+=t[0].length;continue e}}if(r.match(this.mergedInlineGrammar.imageOpen.regexp))o++,s+=2;else if(r.match(this.mergedInlineGrammar.linkOpen.regexp)){if(o++,!t&&this.parseLinkOrImage(r,!1))return!1;s+=1}else r.match(/^\]/)&&(o--,0===o)?(u=e.substr(n,s-n),s++):s++}if(!1===u)return!1;let p=s<e.length?e.substr(s,1):"";if("["===p){let t=e.substr(s),n=this.mergedInlineGrammar.linkLabel.regexp.exec(t);if(!n)return!1;s+=n[0].length,l.push(n[1],n[2],n[3]),a=n[this.mergedInlineGrammar.linkLabel.labelPlaceholder]?n[this.mergedInlineGrammar.linkLabel.labelPlaceholder]:u.trim()}else if("("!==p)a=u.trim();else{s++;let t=1;for(;s<e.length&&t>0;){let n=e.substr(s),r=/^\s+/.exec(n);if(r){switch(c.length){case 0:case 1:c.push(r[0]);break;case 2:if(c[0].match(/</))c[1]=c[1].concat(r[0]);else{if(1!==t)return!1;c.push(""),c.push(r[0])}break;case 3:c.push(r[0]);break;case 4:return!1;case 5:c.push("");case 6:c[5]=c[5].concat(r[0]);break;case 7:c[6]=c[6].concat(r[0]);break;default:return!1}s+=r[0].length}else if(r=this.mergedInlineGrammar.escape.regexp.exec(n),r){switch(c.length){case 0:c.push("");case 1:c.push(r[0]);break;case 2:c[1]=c[1].concat(r[0]);break;case 3:case 4:return!1;case 5:c.push("");case 6:c[5]=c[5].concat(r[0]);break;default:return!1}s+=r[0].length}else if(c.length<2&&n.match(/^</))0===c.length&&c.push(""),c[0]=c[0].concat("<"),s++;else if(1!==c.length&&2!==c.length||!n.match(/^>/))if(r=/^["']/.exec(n),!r||0!==c.length&&1!==c.length&&4!==c.length)if(!r||5!==c.length&&6!==c.length||c[4]!==r[0])if(n.match(/^\(/)){switch(c.length){case 0:c.push("");case 1:c.push("");case 2:c[1]=c[1].concat("("),c[0].match(/<$/)||t++;break;case 3:c.push("");case 4:c.push("(");break;case 5:c.push("");case 6:if("("===c[4])return!1;c[5]=c[5].concat("(");break;default:return!1}s++}else if(n.match(/^\)/)){if(c.length<=2){for(;c.length<2;)c.push("");c[0].match(/<$/)||t--,t>0&&(c[1]=c[1].concat(")"))}else 5===c.length||6===c.length?"("===c[4]?(5===c.length&&c.push(""),c.push(")")):5===c.length?c.push(")"):c[5]=c[5].concat(")"):t--;if(0===t)for(;c.length<7;)c.push("");s++}else{if(r=/^./.exec(n),!r)throw"Infinite loop";switch(c.length){case 0:c.push("");case 1:c.push(r[0]);break;case 2:c[1]=c[1].concat(r[0]);break;case 3:case 4:return!1;case 5:c.push("");case 6:c[5]=c[5].concat(r[0]);break;default:return!1}s+=r[0].length}else 5===c.length&&c.push(""),c.push(r[0]),s++;else{for(;c.length<4;)c.push("");c.push(r[0]),s++}else 1===c.length&&c.push(""),c.push(">"),s++}if(t>0)return!1}if(!1!==a){let e=!1;for(let t of this.linkLabels)if(t===a){e=!0;break}let t=e?"TMLinkLabel TMLinkLabel_Valid":"TMLinkLabel TMLinkLabel_Invalid",n='<span class="TMMark TMMark_'.concat(i,'">').concat(r,'</span><span class="').concat(i," ").concat(l.length<3||!l[1]?t:"",'">').concat(this.processInlineStyles(u),'</span><span class="TMMark TMMark_').concat(i,'">]</span>');return l.length>=3&&(n=n.concat('<span class="TMMark TMMark_'.concat(i,'">').concat(l[0],"</span>"),'<span class="'.concat(t,'">').concat(l[1],"</span>"),'<span class="TMMark TMMark_'.concat(i,'">').concat(l[2],"</span>"))),{output:n,charCount:s}}if(c.length>0){for(;c.length<7;)c.push("");return{output:'<span class="TMMark TMMark_'.concat(i,'">').concat(r,'</span><span class="').concat(i,'">').concat(this.processInlineStyles(u),'</span><span class="TMMark TMMark_').concat(i,'">](').concat(c[0],'</span><span class="').concat(i,'Destination">').concat(os(c[1]),'</span><span class="TMMark TMMark_').concat(i,'">').concat(c[2]).concat(c[3]).concat(c[4],'</span><span class="').concat(i,'Title">').concat(os(c[5]),'</span><span class="TMMark TMMark_').concat(i,'">').concat(c[6],")</span>"),charCount:s}}return!1}computeCommonAncestor(e,t){if(!e||!t)return null;if(e===t)return e;const n=e=>{let t=[];for(;e;)t.unshift(e),e=e.parentNode;return t},r=n(e),i=n(t);if(r[0]!==i[0])return null;let s;for(s=0;r[s]===i[s];s++);return r[s-1]}computeEnclosingMarkupNode(e,t,n){let r=null;if(!e)return null;if(t){if(e.row!==t.row)return null;const n=window.getSelection();if(!n)return null;r=this.computeCommonAncestor(n.focusNode,n.anchorNode)}else{const e=window.getSelection();if(!e||!e.focusNode)return null;r=e.focusNode}if(!r)return null;for(;r!==this.e;){if(r.classList&&r.classList.contains(n))return r;r=r.parentNode}return null}getCommandState(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i={};if(n||(n=this.getSelection(!1)),r||(r=this.getSelection(!0)),!n){for(let e in us)i[e]=null;return i}r||(r=n),r.row<n.row||r.row===n.row&&r.col<n.col?(e=r,t=n):(e=n,t=r),t.row>e.row&&0===t.col&&(t.row--,t.col=this.lines[t.row].length);for(let s in us)if("inline"===us[s].type&&(n&&n.row===r.row&&this.isInlineFormattingAllowed()?i[s]=!!this.computeEnclosingMarkupNode(n,r,us[s].className)||n.col===r.col&&!!this.lines[n.row].substr(0,n.col).match(us[s].unset.prePattern)&&!!this.lines[n.row].substr(n.col).match(us[s].unset.postPattern):i[s]=null),"line"===us[s].type)if(n){let n=this.lineTypes[e.row]===us[s].className;for(let r=e.row;r<=t.row;r++)if(this.lineTypes[r]===us[s].className!==n){n=null;break}i[s]=n}else i[s]=null;return i}setCommandState(e,t){if(this.isRestoringHistory||this.pushHistory(),"inline"===us[e].type){let t=this.getSelection(!0),n=this.getSelection(!1);if(t||(t=n),!t)return;if(t.row!==n.row)return;if(!this.isInlineFormattingAllowed())return;let r=this.computeEnclosingMarkupNode(n,t,us[e].className);if(this.clearDirtyFlag(),r){this.lineDirty[n.row]=!0;const i=this.computeColumn(r,0),s=r.textContent.length,o=this.lines[n.row].substr(0,i).replace(us[e].unset.prePattern,""),u=this.lines[n.row].substr(i,s),a=this.lines[n.row].substr(i+s).replace(us[e].unset.postPattern,"");this.lines[n.row]=o.concat(u,a),t.col=o.length,n.col=t.col+s,this.updateFormatting(),this.setSelection(n,t),this.fireChange()}else if(n.col===t.col&&this.lines[n.row].substr(0,n.col).match(us[e].unset.prePattern)&&this.lines[n.row].substr(n.col).match(us[e].unset.postPattern)){this.lineDirty[n.row]=!0;const r=this.lines[n.row].substr(0,n.col).replace(us[e].unset.prePattern,""),i=this.lines[n.row].substr(n.col).replace(us[e].unset.postPattern,"");this.lines[n.row]=r.concat(i),n.col=t.col=r.length,this.updateFormatting(),this.setSelection(n,t),this.fireChange()}else{let{startCol:r,endCol:i}=n.col<t.col?{startCol:n.col,endCol:t.col}:{startCol:t.col,endCol:n.col},o=this.lines[n.row].substr(r,i-r).match(s(/^(\s*).*\S(\s*)$/,{leading:1,trailing:2}));o&&(r+=o.groups.leading.length,i-=o.groups.trailing.length),n.col=r,t.col=i,this.wrapSelection(us[e].set.pre,us[e].set.post,n,t),this.fireChange()}}else if("line"===us[e].type){let n=this.getSelection(!0),r=this.getSelection(!1);if(n||(n=r),!r)return;this.clearDirtyFlag();let i=n.row>r.row?r:n,s=n.row>r.row?n:r;s.row>i.row&&0===s.col&&s.row--;for(let n=i.row;n<=s.row;n++)t&&this.lineTypes[n]!==us[e].className&&(this.lines[n]=this.lines[n].replace(us[e].set.pattern,us[e].set.replacement.replace("$#",(n-i.row+1).toString())),this.lineDirty[n]=!0),t||this.lineTypes[n]!==us[e].className||(this.lines[n]=this.lines[n].replace(us[e].unset.pattern,us[e].unset.replacement),this.lineDirty[n]=!0);this.updateFormatting(),this.setSelection({row:s.row,col:this.lines[s.row].length},{row:i.row,col:0}),this.fireChange()}}isInlineFormattingAllowed(){const e=window.getSelection();if(!e||!e.focusNode||!e.anchorNode)return!1;if(e.isCollapsed&&3===e.focusNode.nodeType&&e.focusOffset===e.focusNode.nodeValue.length){let t;for(t=e.focusNode;t&&null===t.nextSibling;t=t.parentNode);if(t&&t.nextSibling&&t.nextSibling.classList&&t.nextSibling.classList.contains("TMInlineFormatted"))return!0}let t=this.computeCommonAncestor(e.focusNode,e.anchorNode);if(!t)return!1;for(;t&&t!==this.e;){if(t.classList&&(t.classList.contains("TMInlineFormatted")||t.classList.contains("TMBlankLine")))return!0;t=t.parentNode}return!1}toggleCommandState(e){this.lastCommandState||(this.lastCommandState=this.getCommandState()),this.setCommandState(e,!this.lastCommandState[e])}fireDrop(e){for(let t of this.listeners.drop)t({dataTransfer:e})}fireSelection(){let e=this.getSelection(!1),t=this.getSelection(!0);if(this.lastSelection={focus:e,anchor:t},this.listeners.selection&&this.listeners.selection.length){let n=this.getCommandState(e,t);this.lastCommandState?Object.assign(this.lastCommandState,n):this.lastCommandState=Object.assign({},n);for(let n of this.listeners.selection)n({focus:e,anchor:t,commandState:this.lastCommandState})}}}}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TinyMDE={})}(this,(function(e){"use strict";function t(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function r(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?n(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function s(){s=function(e,t){return new n(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function n(e,r,s){var o=RegExp(e,r);return t.set(o,s||t.get(e)),i(o,n.prototype)}function r(e,n){var r=t.get(n);return Object.keys(r).reduce((function(t,n){var i=r[n];if("number"==typeof i)t[n]=e[i];else{for(var s=0;void 0===e[i[s]]&&s+1<i.length;)s++;t[n]=e[i[s]]}return t}),Object.create(null))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)}(n,RegExp),n.prototype.exec=function(t){var n=e.exec.call(this,t);if(n){n.groups=r(n,this);var i=n.indices;i&&(i.groups=r(i,this))}return n},n.prototype[Symbol.replace]=function(n,i){if("string"==typeof i){var s=t.get(this);return e[Symbol.replace].call(this,n,i.replace(/\$<([^>]+)(>|$)/g,(function(e,t,n){if(""===n)return e;var r=s[t];return Array.isArray(r)?"$"+r.join("$"):"number"==typeof r?"$"+r:""})))}if("function"==typeof i){var o=this;return e[Symbol.replace].call(this,n,(function(){var e=arguments;return"object"!=typeof e[e.length-1]&&(e=[].slice.call(e)).push(r(e,o)),i.apply(this,e)}))}return e[Symbol.replace].call(this,n,i)},s.apply(this,arguments)}var o,u,a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l={};function c(){if(u)return o;u=1;var e=function(e){return e&&e.Math===Math&&e};return o=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof a&&a)||e("object"==typeof o&&o)||function(){return this}()||Function("return this")()}var p,h,f,g,d,m,y,v,T={};function M(){return h?p:(h=1,p=function(e){try{return!!e()}catch(e){return!0}})}function D(){if(g)return f;g=1;var e=M();return f=!e((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function F(){if(m)return d;m=1;var e=M();return d=!e((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))}function b(){if(v)return y;v=1;var e=F(),t=Function.prototype.call;return y=e?t.bind(t):function(){return t.apply(t,arguments)},y}var E,C,w,k,S,x,A,$,L,O,I,B,P,N,_,H,R,j,G,U,z,V,q,Z,K,Y,W,X,J,Q,ee,te,ne,re,ie,se,oe,ue,ae,le,ce,pe={};function he(){return w?C:(w=1,C=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function fe(){if(S)return k;S=1;var e=F(),t=Function.prototype,n=t.call,r=e&&t.bind.bind(n,n);return k=e?r:function(e){return function(){return n.apply(e,arguments)}},k}function ge(){if(A)return x;A=1;var e=fe(),t=e({}.toString),n=e("".slice);return x=function(e){return n(t(e),8,-1)}}function de(){return I?O:(I=1,O=function(e){return null==e})}function me(){if(P)return B;P=1;var e=de(),t=TypeError;return B=function(n){if(e(n))throw new t("Can't call method on "+n);return n}}function ye(){if(_)return N;_=1;var e=function(){if(L)return $;L=1;var e=fe(),t=M(),n=ge(),r=Object,i=e("".split);return $=t((function(){return!r("z").propertyIsEnumerable(0)}))?function(e){return"String"===n(e)?i(e,""):r(e)}:r}(),t=me();return N=function(n){return e(t(n))}}function ve(){if(R)return H;R=1;var e="object"==typeof document&&document.all;return H=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(e){return"function"==typeof e}}function Te(){if(G)return j;G=1;var e=ve();return j=function(t){return"object"==typeof t?null!==t:e(t)}}function Me(){if(z)return U;z=1;var e=c(),t=ve();return U=function(n,r){return arguments.length<2?(i=e[n],t(i)?i:void 0):e[n]&&e[n][r];var i},U}function De(){if(q)return V;q=1;var e=fe();return V=e({}.isPrototypeOf)}function Fe(){if(W)return Y;W=1;var e,t,n=c(),r=function(){if(K)return Z;K=1;var e=c().navigator,t=e&&e.userAgent;return Z=t?String(t):""}(),i=n.process,s=n.Deno,o=i&&i.versions||s&&s.version,u=o&&o.v8;return u&&(t=(e=u.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&r&&(!(e=r.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=r.match(/Chrome\/(\d+)/))&&(t=+e[1]),Y=t}function be(){if(J)return X;J=1;var e=Fe(),t=M(),n=c().String;return X=!!Object.getOwnPropertySymbols&&!t((function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}))}function Ee(){if(ee)return Q;ee=1;var e=be();return Q=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function Ce(){if(ne)return te;ne=1;var e=Me(),t=ve(),n=De(),r=Ee(),i=Object;return te=r?function(e){return"symbol"==typeof e}:function(r){var s=e("Symbol");return t(s)&&n(s.prototype,i(r))}}function we(){if(ie)return re;ie=1;var e=String;return re=function(t){try{return e(t)}catch(e){return"Object"}}}function ke(){if(oe)return se;oe=1;var e=ve(),t=we(),n=TypeError;return se=function(r){if(e(r))return r;throw new n(t(r)+" is not a function")}}function Se(){if(ae)return ue;ae=1;var e=ke(),t=de();return ue=function(n,r){var i=n[r];return t(i)?void 0:e(i)}}function xe(){if(ce)return le;ce=1;var e=b(),t=ve(),n=Te(),r=TypeError;return le=function(i,s){var o,u;if("string"===s&&t(o=i.toString)&&!n(u=e(o,i)))return u;if(t(o=i.valueOf)&&!n(u=e(o,i)))return u;if("string"!==s&&t(o=i.toString)&&!n(u=e(o,i)))return u;throw new r("Can't convert object to primitive value")}}var Ae,$e,Le,Oe,Ie,Be,Pe,Ne,_e,He,Re,je,Ge,Ue,ze,Ve,qe,Ze,Ke,Ye,We,Xe,Je,Qe,et={exports:{}};function tt(){return $e?Ae:($e=1,Ae=!1)}function nt(){if(Oe)return Le;Oe=1;var e=c(),t=Object.defineProperty;return Le=function(n,r){try{t(e,n,{value:r,configurable:!0,writable:!0})}catch(t){e[n]=r}return r}}function rt(){if(Ie)return et.exports;Ie=1;var e=tt(),t=c(),n=nt(),r="__core-js_shared__",i=et.exports=t[r]||n(r,{});return(i.versions||(i.versions=[])).push({version:"3.42.0",mode:e?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"}),et.exports}function it(){if(Pe)return Be;Pe=1;var e=rt();return Be=function(t,n){return e[t]||(e[t]=n||{})}}function st(){if(_e)return Ne;_e=1;var e=me(),t=Object;return Ne=function(n){return t(e(n))}}function ot(){if(Re)return He;Re=1;var e=fe(),t=st(),n=e({}.hasOwnProperty);return He=Object.hasOwn||function(e,r){return n(t(e),r)}}function ut(){if(Ge)return je;Ge=1;var e=fe(),t=0,n=Math.random(),r=e(1..toString);return je=function(e){return"Symbol("+(void 0===e?"":e)+")_"+r(++t+n,36)}}function at(){if(ze)return Ue;ze=1;var e=c(),t=it(),n=ot(),r=ut(),i=be(),s=Ee(),o=e.Symbol,u=t("wks"),a=s?o.for||o:o&&o.withoutSetter||r;return Ue=function(e){return n(u,e)||(u[e]=i&&n(o,e)?o[e]:a("Symbol."+e)),u[e]}}function lt(){if(qe)return Ve;qe=1;var e=b(),t=Te(),n=Ce(),r=Se(),i=xe(),s=at(),o=TypeError,u=s("toPrimitive");return Ve=function(s,a){if(!t(s)||n(s))return s;var l,c=r(s,u);if(c){if(void 0===a&&(a="default"),l=e(c,s,a),!t(l)||n(l))return l;throw new o("Can't convert object to primitive value")}return void 0===a&&(a="number"),i(s,a)}}function ct(){if(Ke)return Ze;Ke=1;var e=lt(),t=Ce();return Ze=function(n){var r=e(n,"string");return t(r)?r:r+""}}function pt(){if(We)return Ye;We=1;var e=c(),t=Te(),n=e.document,r=t(n)&&t(n.createElement);return Ye=function(e){return r?n.createElement(e):{}}}function ht(){if(Je)return Xe;Je=1;var e=D(),t=M(),n=pt();return Xe=!e&&!t((function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a}))}function ft(){if(Qe)return T;Qe=1;var e=D(),t=b(),n=function(){if(E)return pe;E=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return pe.f=n?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,pe}(),r=he(),i=ye(),s=ct(),o=ot(),u=ht(),a=Object.getOwnPropertyDescriptor;return T.f=e?a:function(e,l){if(e=i(e),l=s(l),u)try{return a(e,l)}catch(e){}if(o(e,l))return r(!t(n.f,e,l),e[l])},T}var gt,dt,mt,yt,vt,Tt,Mt,Dt={};function Ft(){if(dt)return gt;dt=1;var e=D(),t=M();return gt=e&&t((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))}function bt(){if(yt)return mt;yt=1;var e=Te(),t=String,n=TypeError;return mt=function(r){if(e(r))return r;throw new n(t(r)+" is not an object")}}function Et(){if(vt)return Dt;vt=1;var e=D(),t=ht(),n=Ft(),r=bt(),i=ct(),s=TypeError,o=Object.defineProperty,u=Object.getOwnPropertyDescriptor,a="enumerable",l="configurable",c="writable";return Dt.f=e?n?function(e,t,n){if(r(e),t=i(t),r(n),"function"==typeof e&&"prototype"===t&&"value"in n&&c in n&&!n[c]){var s=u(e,t);s&&s[c]&&(e[t]=n.value,n={configurable:l in n?n[l]:s[l],enumerable:a in n?n[a]:s[a],writable:!1})}return o(e,t,n)}:o:function(e,n,u){if(r(e),n=i(n),r(u),t)try{return o(e,n,u)}catch(e){}if("get"in u||"set"in u)throw new s("Accessors not supported");return"value"in u&&(e[n]=u.value),e},Dt}function Ct(){if(Mt)return Tt;Mt=1;var e=D(),t=Et(),n=he();return Tt=e?function(e,r,i){return t.f(e,r,n(1,i))}:function(e,t,n){return e[t]=n,e}}var wt,kt,St,xt,At,$t,Lt,Ot,It,Bt,Pt,Nt,_t,Ht,Rt,jt={exports:{}};function Gt(){if(kt)return wt;kt=1;var e=D(),t=ot(),n=Function.prototype,r=e&&Object.getOwnPropertyDescriptor,i=t(n,"name"),s=i&&"something"===function(){}.name,o=i&&(!e||e&&r(n,"name").configurable);return wt={EXISTS:i,PROPER:s,CONFIGURABLE:o}}function Ut(){if(xt)return St;xt=1;var e=fe(),t=ve(),n=rt(),r=e(Function.toString);return t(n.inspectSource)||(n.inspectSource=function(e){return r(e)}),St=n.inspectSource}function zt(){if(Ot)return Lt;Ot=1;var e=it(),t=ut(),n=e("keys");return Lt=function(e){return n[e]||(n[e]=t(e))}}function Vt(){return Bt?It:(Bt=1,It={})}function qt(){if(Nt)return Pt;Nt=1;var e,t,n,r=function(){if($t)return At;$t=1;var e=c(),t=ve(),n=e.WeakMap;return At=t(n)&&/native code/.test(String(n))}(),i=c(),s=Te(),o=Ct(),u=ot(),a=rt(),l=zt(),p=Vt(),h="Object already initialized",f=i.TypeError,g=i.WeakMap;if(r||a.state){var d=a.state||(a.state=new g);d.get=d.get,d.has=d.has,d.set=d.set,e=function(e,t){if(d.has(e))throw new f(h);return t.facade=e,d.set(e,t),t},t=function(e){return d.get(e)||{}},n=function(e){return d.has(e)}}else{var m=l("state");p[m]=!0,e=function(e,t){if(u(e,m))throw new f(h);return t.facade=e,o(e,m,t),t},t=function(e){return u(e,m)?e[m]:{}},n=function(e){return u(e,m)}}return Pt={set:e,get:t,has:n,enforce:function(r){return n(r)?t(r):e(r,{})},getterFor:function(e){return function(n){var r;if(!s(n)||(r=t(n)).type!==e)throw new f("Incompatible receiver, "+e+" required");return r}}}}function Zt(){if(_t)return jt.exports;_t=1;var e=fe(),t=M(),n=ve(),r=ot(),i=D(),s=Gt().CONFIGURABLE,o=Ut(),u=qt(),a=u.enforce,l=u.get,c=String,p=Object.defineProperty,h=e("".slice),f=e("".replace),g=e([].join),d=i&&!t((function(){return 8!==p((function(){}),"length",{value:8}).length})),m=String(String).split("String"),y=jt.exports=function(e,t,n){"Symbol("===h(c(t),0,7)&&(t="["+f(c(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!r(e,"name")||s&&e.name!==t)&&(i?p(e,"name",{value:t,configurable:!0}):e.name=t),d&&n&&r(n,"arity")&&e.length!==n.arity&&p(e,"length",{value:n.arity});try{n&&r(n,"constructor")&&n.constructor?i&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var o=a(e);return r(o,"source")||(o.source=g(m,"string"==typeof t?t:"")),e};return Function.prototype.toString=y((function(){return n(this)&&l(this).source||o(this)}),"toString"),jt.exports}function Kt(){if(Rt)return Ht;Rt=1;var e=ve(),t=Et(),n=Zt(),r=nt();return Ht=function(i,s,o,u){u||(u={});var a=u.enumerable,l=void 0!==u.name?u.name:s;if(e(o)&&n(o,l,u),u.global)a?i[s]=o:r(s,o);else{try{u.unsafe?i[s]&&(a=!0):delete i[s]}catch(e){}a?i[s]=o:t.f(i,s,{value:o,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return i}}var Yt,Wt,Xt,Jt,Qt,en,tn,nn,rn,sn,on,un,an,ln,cn,pn,hn,fn={};function gn(){if(Jt)return Xt;Jt=1;var e=function(){if(Wt)return Yt;Wt=1;var e=Math.ceil,t=Math.floor;return Yt=Math.trunc||function(n){var r=+n;return(r>0?t:e)(r)}}();return Xt=function(t){var n=+t;return n!=n||0===n?0:e(n)}}function dn(){if(en)return Qt;en=1;var e=gn(),t=Math.max,n=Math.min;return Qt=function(r,i){var s=e(r);return s<0?t(s+i,0):n(s,i)}}function mn(){if(nn)return tn;nn=1;var e=gn(),t=Math.min;return tn=function(n){var r=e(n);return r>0?t(r,9007199254740991):0}}function yn(){if(sn)return rn;sn=1;var e=mn();return rn=function(t){return e(t.length)}}function vn(){if(ln)return an;ln=1;var e=fe(),t=ot(),n=ye(),r=function(){if(un)return on;un=1;var e=ye(),t=dn(),n=yn(),r=function(r){return function(i,s,o){var u=e(i),a=n(u);if(0===a)return!r&&-1;var l,c=t(o,a);if(r&&s!=s){for(;a>c;)if((l=u[c++])!=l)return!0}else for(;a>c;c++)if((r||c in u)&&u[c]===s)return r||c||0;return!r&&-1}};return on={includes:r(!0),indexOf:r(!1)}}().indexOf,i=Vt(),s=e([].push);return an=function(e,o){var u,a=n(e),l=0,c=[];for(u in a)!t(i,u)&&t(a,u)&&s(c,u);for(;o.length>l;)t(a,u=o[l++])&&(~r(c,u)||s(c,u));return c}}function Tn(){return pn?cn:(pn=1,cn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}function Mn(){if(hn)return fn;hn=1;var e=vn(),t=Tn().concat("length","prototype");return fn.f=Object.getOwnPropertyNames||function(n){return e(n,t)},fn}var Dn,Fn,bn,En,Cn,wn,kn,Sn,xn,An,$n,Ln,On,In,Bn,Pn,Nn,_n,Hn,Rn={};function jn(){if(bn)return Fn;bn=1;var e=Me(),t=fe(),n=Mn(),r=(Dn||(Dn=1,Rn.f=Object.getOwnPropertySymbols),Rn),i=bt(),s=t([].concat);return Fn=e("Reflect","ownKeys")||function(e){var t=n.f(i(e)),o=r.f;return o?s(t,o(e)):t}}function Gn(){if(Cn)return En;Cn=1;var e=ot(),t=jn(),n=ft(),r=Et();return En=function(i,s,o){for(var u=t(s),a=r.f,l=n.f,c=0;c<u.length;c++){var p=u[c];e(i,p)||o&&e(o,p)||a(i,p,l(s,p))}}}function Un(){if(kn)return wn;kn=1;var e=M(),t=ve(),n=/#|\.prototype\./,r=function(n,r){var a=s[i(n)];return a===u||a!==o&&(t(r)?e(r):!!r)},i=r.normalize=function(e){return String(e).replace(n,".").toLowerCase()},s=r.data={},o=r.NATIVE="N",u=r.POLYFILL="P";return wn=r}function zn(){if(xn)return Sn;xn=1;var e=c(),t=ft().f,n=Ct(),r=Kt(),i=nt(),s=Gn(),o=Un();return Sn=function(u,a){var l,c,p,h,f,g=u.target,d=u.global,m=u.stat;if(l=d?e:m?e[g]||i(g,{}):e[g]&&e[g].prototype)for(c in a){if(h=a[c],p=u.dontCallGetSet?(f=t(l,c))&&f.value:l[c],!o(d?c:g+(m?".":"#")+c,u.forced)&&void 0!==p){if(typeof h==typeof p)continue;s(h,p)}(u.sham||p&&p.sham)&&n(h,"sham",!0),r(l,c,h,u)}}}function Vn(){if(On)return Ln;On=1;var e=function(){if($n)return An;$n=1;var e={};return e[at()("toStringTag")]="z",An="[object z]"===String(e)}(),t=ve(),n=ge(),r=at()("toStringTag"),i=Object,s="Arguments"===n(function(){return arguments}());return Ln=e?n:function(e){var o,u,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(u=function(e,t){try{return e[t]}catch(e){}}(o=i(e),r))?u:s?n(o):"Object"===(a=n(o))&&t(o.callee)?"Arguments":a}}function qn(){if(Bn)return In;Bn=1;var e=Vn(),t=String;return In=function(n){if("Symbol"===e(n))throw new TypeError("Cannot convert a Symbol value to a string");return t(n)}}function Zn(){if(Nn)return Pn;Nn=1;var e=bt();return Pn=function(){var t=e(this),n="";return t.hasIndices&&(n+="d"),t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.dotAll&&(n+="s"),t.unicode&&(n+="u"),t.unicodeSets&&(n+="v"),t.sticky&&(n+="y"),n}}function Kn(){if(Hn)return _n;Hn=1;var e=M(),t=c().RegExp,n=e((function(){var e=t("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),r=n||e((function(){return!t("a","y").sticky})),i=n||e((function(){var e=t("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));return _n={BROKEN_CARET:i,MISSED_STICKY:r,UNSUPPORTED_Y:n}}var Yn,Wn,Xn,Jn,Qn,er,tr,nr,rr,ir,sr,or,ur,ar,lr={};function cr(){if(Wn)return Yn;Wn=1;var e=vn(),t=Tn();return Yn=Object.keys||function(n){return e(n,t)}}function pr(){if(Qn)return Jn;Qn=1;var e=Me();return Jn=e("document","documentElement")}function hr(){if(tr)return er;tr=1;var e,t=bt(),n=function(){if(Xn)return lr;Xn=1;var e=D(),t=Ft(),n=Et(),r=bt(),i=ye(),s=cr();return lr.f=e&&!t?Object.defineProperties:function(e,t){r(e);for(var o,u=i(t),a=s(t),l=a.length,c=0;l>c;)n.f(e,o=a[c++],u[o]);return e},lr}(),r=Tn(),i=Vt(),s=pr(),o=pt(),u=zt(),a="prototype",l="script",c=u("IE_PROTO"),p=function(){},h=function(e){return"<"+l+">"+e+"</"+l+">"},f=function(e){e.write(h("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{e=new ActiveXObject("htmlfile")}catch(e){}var t,n,i;g="undefined"!=typeof document?document.domain&&e?f(e):(n=o("iframe"),i="java"+l+":",n.style.display="none",s.appendChild(n),n.src=String(i),(t=n.contentWindow.document).open(),t.write(h("document.F=Object")),t.close(),t.F):f(e);for(var u=r.length;u--;)delete g[a][r[u]];return g()};return i[c]=!0,er=Object.create||function(e,r){var i;return null!==e?(p[a]=t(e),i=new p,p[a]=null,i[c]=e):i=g(),void 0===r?i:n.f(i,r)}}function fr(){if(rr)return nr;rr=1;var e=M(),t=c().RegExp;return nr=e((function(){var e=t(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))}function gr(){if(sr)return ir;sr=1;var e=M(),t=c().RegExp;return ir=e((function(){var e=t("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))}function dr(){if(ur)return or;ur=1;var e,t,n=b(),r=fe(),i=qn(),s=Zn(),o=Kn(),u=it(),a=hr(),l=qt().get,c=fr(),p=gr(),h=u("native-string-replace",String.prototype.replace),f=RegExp.prototype.exec,g=f,d=r("".charAt),m=r("".indexOf),y=r("".replace),v=r("".slice),T=(t=/b*/g,n(f,e=/a/,"a"),n(f,t,"a"),0!==e.lastIndex||0!==t.lastIndex),M=o.BROKEN_CARET,D=void 0!==/()??/.exec("")[1];return(T||D||M||c||p)&&(g=function(e){var t,r,o,u,c,p,F,b=this,E=l(b),C=i(e),w=E.raw;if(w)return w.lastIndex=b.lastIndex,t=n(g,w,C),b.lastIndex=w.lastIndex,t;var k=E.groups,S=M&&b.sticky,x=n(s,b),A=b.source,$=0,L=C;if(S&&(x=y(x,"y",""),-1===m(x,"g")&&(x+="g"),L=v(C,b.lastIndex),b.lastIndex>0&&(!b.multiline||b.multiline&&"\n"!==d(C,b.lastIndex-1))&&(A="(?: "+A+")",L=" "+L,$++),r=new RegExp("^(?:"+A+")",x)),D&&(r=new RegExp("^"+A+"$(?!\\s)",x)),T&&(o=b.lastIndex),u=n(f,S?r:b,L),S?u?(u.input=v(u.input,$),u[0]=v(u[0],$),u.index=b.lastIndex,b.lastIndex+=u[0].length):b.lastIndex=0:T&&u&&(b.lastIndex=b.global?u.index+u[0].length:o),D&&u&&u.length>1&&n(h,u[0],r,(function(){for(c=1;c<arguments.length-2;c++)void 0===arguments[c]&&(u[c]=void 0)})),u&&k)for(u.groups=p=a(null),c=0;c<k.length;c++)p[(F=k[c])[0]]=u[F[1]];return u}),or=g}function mr(){if(ar)return l;ar=1;var e=zn(),t=dr();return e({target:"RegExp",proto:!0,forced:/./.exec!==t},{exec:t}),l}mr();var yr,vr,Tr,Mr,Dr,Fr,br,Er,Cr,wr,kr,Sr,xr,Ar={};function $r(){if(Er)return br;Er=1;var e=function(){if(Fr)return Dr;Fr=1;var e=fe(),t=gn(),n=qn(),r=me(),i=e("".charAt),s=e("".charCodeAt),o=e("".slice),u=function(e){return function(u,a){var l,c,p=n(r(u)),h=t(a),f=p.length;return h<0||h>=f?e?"":void 0:(l=s(p,h))<55296||l>56319||h+1===f||(c=s(p,h+1))<56320||c>57343?e?i(p,h):l:e?o(p,h,h+2):c-56320+(l-55296<<10)+65536}};return Dr={codeAt:u(!1),charAt:u(!0)}}().charAt;return br=function(t,n,r){return n+(r?e(t,n).length:1)}}function Lr(){if(wr)return Cr;wr=1;var e=fe(),t=st(),n=Math.floor,r=e("".charAt),i=e("".replace),s=e("".slice),o=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;return Cr=function(e,a,l,c,p,h){var f=l+e.length,g=c.length,d=u;return void 0!==p&&(p=t(p),d=o),i(h,d,(function(t,i){var o;switch(r(i,0)){case"$":return"$";case"&":return e;case"`":return s(a,0,l);case"'":return s(a,f);case"<":o=p[s(i,1,-1)];break;default:var u=+i;if(0===u)return t;if(u>g){var h=n(u/10);return 0===h?t:h<=g?void 0===c[h-1]?r(i,1):c[h-1]+r(i,1):t}o=c[u-1]}return void 0===o?"":o}))}}!function(){if(xr)return Ar;xr=1;var e=function(){if(vr)return yr;vr=1;var e=F(),t=Function.prototype,n=t.apply,r=t.call;return yr="object"==typeof Reflect&&Reflect.apply||(e?r.bind(n):function(){return r.apply(n,arguments)}),yr}(),t=b(),n=fe(),r=function(){if(Mr)return Tr;Mr=1,mr();var e=b(),t=Kt(),n=dr(),r=M(),i=at(),s=Ct(),o=i("species"),u=RegExp.prototype;return Tr=function(a,l,c,p){var h=i(a),f=!r((function(){var e={};return e[h]=function(){return 7},7!==""[a](e)})),g=f&&!r((function(){var e=!1,t=/a/;return"split"===a&&((t={}).constructor={},t.constructor[o]=function(){return t},t.flags="",t[h]=/./[h]),t.exec=function(){return e=!0,null},t[h](""),!e}));if(!f||!g||c){var d=/./[h],m=l(h,""[a],(function(t,r,i,s,o){var a=r.exec;return a===n||a===u.exec?f&&!o?{done:!0,value:e(d,r,i,s)}:{done:!0,value:e(t,i,r,s)}:{done:!1}}));t(String.prototype,a,m[0]),t(u,h,m[1])}p&&s(u[h],"sham",!0)}}(),i=M(),s=bt(),o=ve(),u=Te(),a=gn(),l=mn(),c=qn(),p=me(),h=$r(),f=Se(),g=Lr(),d=function(){if(Sr)return kr;Sr=1;var e=b(),t=bt(),n=ve(),r=ge(),i=dr(),s=TypeError;return kr=function(o,u){var a=o.exec;if(n(a)){var l=e(a,o,u);return null!==l&&t(l),l}if("RegExp"===r(o))return e(i,o,u);throw new s("RegExp#exec called on incompatible receiver")}}(),m=at()("replace"),y=Math.max,v=Math.min,T=n([].concat),D=n([].push),E=n("".indexOf),C=n("".slice),w="$0"==="a".replace(/./,"$0"),k=!!/./[m]&&""===/./[m]("a","$0");r("replace",(function(n,r,i){var M=k?"$":"$0";return[function(e,n){var i=p(this),s=u(e)?f(e,m):void 0;return s?t(s,e,i,n):t(r,c(i),e,n)},function(t,n){var u=s(this),p=c(t);if("string"==typeof n&&-1===E(n,M)&&-1===E(n,"$<")){var f=i(r,u,p,n);if(f.done)return f.value}var m=o(n);m||(n=c(n));var F,b=u.global;b&&(F=u.unicode,u.lastIndex=0);for(var w,k=[];null!==(w=d(u,p))&&(D(k,w),b);){""===c(w[0])&&(u.lastIndex=h(p,l(u.lastIndex),F))}for(var S,x="",A=0,$=0;$<k.length;$++){for(var L,O=c((w=k[$])[0]),I=y(v(a(w.index),p.length),0),B=[],P=1;P<w.length;P++)D(B,void 0===(S=w[P])?S:String(S));var N=w.groups;if(m){var _=T([O],B,I,p);void 0!==N&&D(_,N),L=c(e(n,void 0,_))}else L=g(O,p,I,B,N,n);I>=A&&(x+=C(p,A,I)+L,A=I+O.length)}return x+C(p,A)}]}),!!i((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!w||k)}();var Or,Ir,Br,Pr,Nr,_r,Hr,Rr={};function jr(){return Ir?Or:(Ir=1,Or="\t\n\v\f\r                 \u2028\u2029\ufeff")}!function(){if(Hr)return Rr;Hr=1;var e=zn(),t=function(){if(Pr)return Br;Pr=1;var e=fe(),t=me(),n=qn(),r=jr(),i=e("".replace),s=RegExp("^["+r+"]+"),o=RegExp("(^|[^"+r+"])["+r+"]+$"),u=function(e){return function(r){var u=n(t(r));return 1&e&&(u=i(u,s,"")),2&e&&(u=i(u,o,"$1")),u}};return Br={start:u(1),end:u(2),trim:u(3)}}().trim,n=function(){if(_r)return Nr;_r=1;var e=Gt().PROPER,t=M(),n=jr();return Nr=function(r){return t((function(){return!!n[r]()||"​…᠎"!=="​…᠎"[r]()||e&&n[r].name!==r}))}}();e({target:"String",proto:!0,forced:n("trim")},{trim:function(){return t(this)}})}();var Gr,Ur,zr,Vr,qr,Zr,Kr,Yr,Wr,Xr,Jr,Qr,ei,ti,ni,ri,ii,si,oi,ui,ai,li,ci,pi,hi,fi,gi,di,mi,yi,vi,Ti,Mi,Di={};function Fi(){if(Zr)return qr;Zr=1;var e=at(),t=hr(),n=Et().f,r=e("unscopables"),i=Array.prototype;return void 0===i[r]&&n(i,r,{configurable:!0,value:t(null)}),qr=function(e){i[r][e]=!0}}function bi(){return Yr?Kr:(Yr=1,Kr={})}function Ei(){if(Qr)return Jr;Qr=1;var e=ot(),t=ve(),n=st(),r=zt(),i=function(){if(Xr)return Wr;Xr=1;var e=M();return Wr=!e((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))}(),s=r("IE_PROTO"),o=Object,u=o.prototype;return Jr=i?o.getPrototypeOf:function(r){var i=n(r);if(e(i,s))return i[s];var a=i.constructor;return t(a)&&i instanceof a?a.prototype:i instanceof o?u:null}}function Ci(){if(ti)return ei;ti=1;var e,t,n,r=M(),i=ve(),s=Te(),o=hr(),u=Ei(),a=Kt(),l=at(),c=tt(),p=l("iterator"),h=!1;return[].keys&&("next"in(n=[].keys())?(t=u(u(n)))!==Object.prototype&&(e=t):h=!0),!s(e)||r((function(){var t={};return e[p].call(t)!==t}))?e={}:c&&(e=o(e)),i(e[p])||a(e,p,(function(){return this})),ei={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:h}}function wi(){if(ri)return ni;ri=1;var e=Et().f,t=ot(),n=at()("toStringTag");return ni=function(r,i,s){r&&!s&&(r=r.prototype),r&&!t(r,n)&&e(r,n,{configurable:!0,value:i})}}function ki(){if(li)return ai;li=1;var e=Te();return ai=function(t){return e(t)||null===t}}function Si(){if(pi)return ci;pi=1;var e=ki(),t=String,n=TypeError;return ci=function(r){if(e(r))return r;throw new n("Can't set "+t(r)+" as a prototype")}}function xi(){if(fi)return hi;fi=1;var e=function(){if(ui)return oi;ui=1;var e=fe(),t=ke();return oi=function(n,r,i){try{return e(t(Object.getOwnPropertyDescriptor(n,r)[i]))}catch(e){}}}(),t=Te(),n=me(),r=Si();return hi=Object.setPrototypeOf||("__proto__"in{}?function(){var i,s=!1,o={};try{(i=e(Object.prototype,"__proto__","set"))(o,[]),s=o instanceof Array}catch(e){}return function(e,o){return n(e),r(o),t(e)?(s?i(e,o):e.__proto__=o,e):e}}():void 0)}function Ai(){if(di)return gi;di=1;var e=zn(),t=b(),n=tt(),r=Gt(),i=ve(),s=function(){if(si)return ii;si=1;var e=Ci().IteratorPrototype,t=hr(),n=he(),r=wi(),i=bi(),s=function(){return this};return ii=function(o,u,a,l){var c=u+" Iterator";return o.prototype=t(e,{next:n(+!l,a)}),r(o,c,!1,!0),i[c]=s,o}}(),o=Ei(),u=xi(),a=wi(),l=Ct(),c=Kt(),p=at(),h=bi(),f=Ci(),g=r.PROPER,d=r.CONFIGURABLE,m=f.IteratorPrototype,y=f.BUGGY_SAFARI_ITERATORS,v=p("iterator"),T="keys",M="values",D="entries",F=function(){return this};return gi=function(r,p,f,b,E,C,w){s(f,p,b);var k,S,x,A=function(e){if(e===E&&B)return B;if(!y&&e&&e in O)return O[e];switch(e){case T:case M:case D:return function(){return new f(this,e)}}return function(){return new f(this)}},$=p+" Iterator",L=!1,O=r.prototype,I=O[v]||O["@@iterator"]||E&&O[E],B=!y&&I||A(E),P="Array"===p&&O.entries||I;if(P&&(k=o(P.call(new r)))!==Object.prototype&&k.next&&(n||o(k)===m||(u?u(k,m):i(k[v])||c(k,v,F)),a(k,$,!0,!0),n&&(h[$]=F)),g&&E===M&&I&&I.name!==M&&(!n&&d?l(O,"name",M):(L=!0,B=function(){return t(I,this)})),E)if(S={values:A(M),keys:C?B:A(T),entries:A(D)},w)for(x in S)(y||L||!(x in O))&&c(O,x,S[x]);else e({target:p,proto:!0,forced:y||L},S);return n&&!w||O[v]===B||c(O,v,B,{name:E}),h[p]=B,S}}function $i(){return yi?mi:(yi=1,mi=function(e,t){return{value:e,done:t}})}!function(){if(Mi)return Di;Mi=1;var e=c(),t=Ur?Gr:(Ur=1,Gr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}),n=function(){if(Vr)return zr;Vr=1;var e=pt()("span").classList,t=e&&e.constructor&&e.constructor.prototype;return zr=t===Object.prototype?void 0:t}(),r=function(){if(Ti)return vi;Ti=1;var e=ye(),t=Fi(),n=bi(),r=qt(),i=Et().f,s=Ai(),o=$i(),u=tt(),a=D(),l="Array Iterator",c=r.set,p=r.getterFor(l);vi=s(Array,"Array",(function(t,n){c(this,{type:l,target:e(t),index:0,kind:n})}),(function(){var e=p(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,o(void 0,!0);switch(e.kind){case"keys":return o(n,!1);case"values":return o(t[n],!1)}return o([n,t[n]],!1)}),"values");var h=n.Arguments=n.Array;if(t("keys"),t("values"),t("entries"),!u&&a&&"values"!==h.name)try{i(h,"name",{value:"values"})}catch(e){}return vi}(),i=Ct(),s=wi(),o=at()("iterator"),u=r.values,a=function(e,n){if(e){if(e[o]!==u)try{i(e,o,u)}catch(t){e[o]=u}if(s(e,n,!0),t[n])for(var a in r)if(e[a]!==r[a])try{i(e,a,r[a])}catch(t){e[a]=r[a]}}};for(var l in t)a(e[l]&&e[l].prototype,l);a(n,"DOMTokenList")}();var Li,Oi,Ii,Bi,Pi,Ni,_i,Hi,Ri,ji,Gi,Ui,zi,Vi={};function qi(){if(Oi)return Li;Oi=1;var e=ve(),t=Te(),n=xi();return Li=function(r,i,s){var o,u;return n&&e(o=i.constructor)&&o!==s&&t(u=o.prototype)&&u!==s.prototype&&n(r,u),r}}function Zi(){if(Hi)return _i;Hi=1;var e=Et().f;return _i=function(t,n,r){r in t||e(t,r,{configurable:!0,get:function(){return n[r]},set:function(e){n[r]=e}})}}function Ki(){if(ji)return Ri;ji=1;var e=Zt(),t=Et();return Ri=function(n,r,i){return i.get&&e(i.get,r,{getter:!0}),i.set&&e(i.set,r,{setter:!0}),t.f(n,r,i)}}function Yi(){if(Ui)return Gi;Ui=1;var e=Me(),t=Ki(),n=at(),r=D(),i=n("species");return Gi=function(n){var s=e(n);r&&s&&!s[i]&&t(s,i,{configurable:!0,get:function(){return this}})}}!function(){if(zi)return Vi;zi=1;var e=D(),t=c(),n=fe(),r=Un(),i=qi(),s=Ct(),o=hr(),u=Mn().f,a=De(),l=function(){if(Bi)return Ii;Bi=1;var e=Te(),t=ge(),n=at()("match");return Ii=function(r){var i;return e(r)&&(void 0!==(i=r[n])?!!i:"RegExp"===t(r))}}(),p=qn(),h=function(){if(Ni)return Pi;Ni=1;var e=b(),t=ot(),n=De(),r=Zn(),i=RegExp.prototype;return Pi=function(s){var o=s.flags;return void 0!==o||"flags"in i||t(s,"flags")||!n(i,s)?o:e(r,s)}}(),f=Kn(),g=Zi(),d=Kt(),m=M(),y=ot(),v=qt().enforce,T=Yi(),F=at(),E=fr(),C=gr(),w=F("match"),k=t.RegExp,S=k.prototype,x=t.SyntaxError,A=n(S.exec),$=n("".charAt),L=n("".replace),O=n("".indexOf),I=n("".slice),B=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,P=/a/g,N=/a/g,_=new k(P)!==P,H=f.MISSED_STICKY,R=f.UNSUPPORTED_Y,j=e&&(!_||H||E||C||m((function(){return N[w]=!1,k(P)!==P||k(N)===N||"/a/i"!==String(k(P,"i"))})));if(r("RegExp",j)){for(var G=function(e,t){var n,r,u,c,f,g,d=a(S,this),m=l(e),T=void 0===t,M=[],D=e;if(!d&&m&&T&&e.constructor===G)return e;if((m||a(S,e))&&(e=e.source,T&&(t=h(D))),e=void 0===e?"":p(e),t=void 0===t?"":p(t),D=e,E&&"dotAll"in P&&(r=!!t&&O(t,"s")>-1)&&(t=L(t,/s/g,"")),n=t,H&&"sticky"in P&&(u=!!t&&O(t,"y")>-1)&&R&&(t=L(t,/y/g,"")),C&&(c=function(e){for(var t,n=e.length,r=0,i="",s=[],u=o(null),a=!1,l=!1,c=0,p="";r<=n;r++){if("\\"===(t=$(e,r)))t+=$(e,++r);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:if(i+=t,"?:"===I(e,r+1,r+3))continue;A(B,I(e,r+1))&&(r+=2,l=!0),c++;continue;case">"===t&&l:if(""===p||y(u,p))throw new x("Invalid capture group name");u[p]=!0,s[s.length]=[p,c],l=!1,p="";continue}l?p+=t:i+=t}return[i,s]}(e),e=c[0],M=c[1]),f=i(k(e,t),d?this:S,G),(r||u||M.length)&&(g=v(f),r&&(g.dotAll=!0,g.raw=G(function(e){for(var t,n=e.length,r=0,i="",s=!1;r<=n;r++)"\\"!==(t=$(e,r))?s||"."!==t?("["===t?s=!0:"]"===t&&(s=!1),i+=t):i+="[\\s\\S]":i+=t+$(e,++r);return i}(e),n)),u&&(g.sticky=!0),M.length&&(g.groups=M)),e!==D)try{s(f,"source",""===D?"(?:)":D)}catch(e){}return f},U=u(k),z=0;U.length>z;)g(G,k,U[z++]);S.constructor=G,G.prototype=S,d(t,"RegExp",G,{constructor:!0})}T("RegExp")}();var Wi,Xi={};!function(){if(Wi)return Xi;Wi=1;var e=c(),t=D(),n=Ki(),r=Zn(),i=M(),s=e.RegExp,o=s.prototype;t&&i((function(){var e=!0;try{s(".","d")}catch(t){e=!1}var t={},n="",r=e?"dgimsy":"gimsy",i=function(e,r){Object.defineProperty(t,e,{get:function(){return n+=r,!0}})},u={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var a in e&&(u.hasIndices="d"),u)i(a,u[a]);return Object.getOwnPropertyDescriptor(o,"flags").get.call(t)!==r||n!==r}))&&n(o,"flags",{configurable:!0,get:r})}();const Ji={ASCIIPunctuation:/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~\\]/,NotTriggerChar:/[^`_*[\]()<>!~]/,Scheme:/[A-Za-z][A-Za-z0-9+.-]{1,31}/,Email:/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*/,HTMLOpenTag:/<HTMLTagName(?:HTMLAttribute)*\s*\/?>/,HTMLCloseTag:/<\/HTMLTagName\s*>/,HTMLTagName:/[A-Za-z][A-Za-z0-9-]*/,HTMLComment:/<!--(?:[^>-]|(?:[^>-](?:[^-]|-[^-])*[^-]))-->/,HTMLPI:/<\?(?:|.|(?:[^?]|\?[^>])*)\?>/,HTMLDeclaration:/<![A-Z]+\s[^>]*>/,HTMLCDATA:/<!\[CDATA\[.*?\]\]>/,HTMLAttribute:/\s+[A-Za-z_:][A-Za-z0-9_.:-]*(?:HTMLAttValue)?/,HTMLAttValue:/\s*=\s*(?:(?:'[^']*')|(?:"[^"]*")|(?:[^\s"'=<>`]+))/,KnownTag:/address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul/},Qi=new RegExp(/^(?:[!"#$%&'()*+,\-./:;<=>?@[\]\\^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B])/),es=new RegExp(/(?:[!"#$%&'()*+,\-./:;<=>?@[\]\\^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B])$/),ts={TMH1:{regexp:/^( {0,3}#\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH1">$1</span>$$2<span class="TMMark TMMark_TMH1">$3</span>'},TMH2:{regexp:/^( {0,3}##\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH2">$1</span>$$2<span class="TMMark TMMark_TMH2">$3</span>'},TMH3:{regexp:/^( {0,3}###\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH3">$1</span>$$2<span class="TMMark TMMark_TMH3">$3</span>'},TMH4:{regexp:/^( {0,3}####\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH4">$1</span>$$2<span class="TMMark TMMark_TMH4">$3</span>'},TMH5:{regexp:/^( {0,3}#####\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH5">$1</span>$$2<span class="TMMark TMMark_TMH5">$3</span>'},TMH6:{regexp:/^( {0,3}######\s)(.*?)((?:\s+#+\s*)?)$/,replacement:'<span class="TMMark TMMark_TMH6">$1</span>$$2<span class="TMMark TMMark_TMH6">$3</span>'},TMBlockquote:{regexp:/^( {0,3}>[ ]?)(.*)$/,replacement:'<span class="TMMark TMMark_TMBlockquote">$1</span>$$2'},TMCodeFenceBacktickOpen:{regexp:s(/^( {0,3}(````*)\s*)([^`]*?)(\s*)$/,{seq:2}),replacement:'<span class="TMMark TMMark_TMCodeFenceBacktick">$1</span><span class="TMInfoString">$3</span>$4'},TMCodeFenceTildeOpen:{regexp:s(/^( {0,3}(~~~~*)\s*)(.*?)(\s*)$/,{seq:2}),replacement:'<span class="TMMark TMMark_TMCodeFenceTilde">$1</span><span class="TMInfoString">$3</span>$4'},TMCodeFenceBacktickClose:{regexp:s(/^( {0,3}(````*))(\s*)$/,{seq:2}),replacement:'<span class="TMMark TMMark_TMCodeFenceBacktick">$1</span>$3'},TMCodeFenceTildeClose:{regexp:s(/^( {0,3}(~~~~*))(\s*)$/,{seq:2}),replacement:'<span class="TMMark TMMark_TMCodeFenceTilde">$1</span>$3'},TMBlankLine:{regexp:/^([ \t]*)$/,replacement:"$0"},TMSetextH1Marker:{regexp:/^ {0,3}=+\s*$/,replacement:'<span class="TMMark TMMark_TMSetextH1Marker">$0</span>'},TMSetextH2Marker:{regexp:/^ {0,3}-+\s*$/,replacement:'<span class="TMMark TMMark_TMSetextH1Marker">$0</span>'},TMHR:{regexp:/^( {0,3}(\*[ \t]*\*[ \t]*\*[ \t*]*)|(-[ \t]*-[ \t]*-[ \t-]*)|(_[ \t]*_[ \t]*_[ \t_]*))$/,replacement:'<span class="TMMark TMMark_TMHR">$0</span>'},TMUL:{regexp:/^( {0,3}[+*-] {1,4})(.*)$/,replacement:'<span class="TMMark TMMark_TMUL">$1</span>$$2'},TMOL:{regexp:/^( {0,3}\d{1,9}[.)] {1,4})(.*)$/,replacement:'<span class="TMMark TMMark_TMOL">$1</span>$$2'},TMIndentedCode:{regexp:/^( {4}|\t)(.*)$/,replacement:'<span class="TMMark TMMark_TMIndentedCode">$1</span>$2'},TMLinkReferenceDefinition:{regexp:/^( {0,3}\[\s*)([^\s\]](?:[^\]]|\\\])*?)(\s*\]:\s*)((?:[^\s<>]+)|(?:<(?:[^<>\\]|\\.)*>))?(\s*)((?:\((?:[^()\\]|\\.)*\))|(?:"(?:[^"\\]|\\.)*")|(?:'(?:[^'\\]|\\.)*'))?(\s*)$/,replacement:'<span class="TMMark TMMark_TMLinkReferenceDefinition">$1</span><span class="TMLinkLabel TMLinkLabel_Definition">$2</span><span class="TMMark TMMark_TMLinkReferenceDefinition">$3</span><span class="TMLinkDestination">$4</span>$5<span class="TMLinkTitle">$6</span>$7',labelPlaceholder:2}},ns=[{start:/^ {0,3}<(?:script|pre|style)(?:\s|>|$)/i,end:/(?:<\/script>|<\/pre>|<\/style>)/i,paraInterrupt:!0},{start:/^ {0,3}<!--/,end:/-->/,paraInterrupt:!0},{start:/^ {0,3}<\?/,end:/\?>/,paraInterrupt:!0},{start:/^ {0,3}<![A-Z]/,end:/>/,paraInterrupt:!0},{start:/^ {0,3}<!\[CDATA\[/,end:/\]\]>/,paraInterrupt:!0},{start:/^ {0,3}(?:<|<\/)(?:KnownTag)(?:\s|>|\/>|$)/i,end:!1,paraInterrupt:!0},{start:/^ {0,3}(?:HTMLOpenTag|HTMLCloseTag)\s*$/,end:!1,paraInterrupt:!1}],rs={escape:{regexp:/^\\(ASCIIPunctuation)/,replacement:'<span class="TMMark TMMark_TMEscape">\\</span>$1'},code:{regexp:/^(`+)((?:[^`])|(?:[^`].*?[^`]))(\1)/,replacement:'<span class="TMMark TMMark_TMCode">$1</span><code class="TMCode">$2</code><span class="TMMark TMMark_TMCode">$3</span>'},autolink:{regexp:/^<((?:Scheme:[^\s<>]*)|(?:Email))>/,replacement:'<span class="TMMark TMMark_TMAutolink">&lt;</span><span class="TMAutolink">$1</span><span class="TMMark TMMark_TMAutolink">&gt;</span>'},html:{regexp:/^((?:HTMLOpenTag)|(?:HTMLCloseTag)|(?:HTMLComment)|(?:HTMLPI)|(?:HTMLDeclaration)|(?:HTMLCDATA))/,replacement:'<span class="TMHTML">$1</span>'},linkOpen:{regexp:/^\[/,replacement:""},imageOpen:{regexp:/^!\[/,replacement:""},linkLabel:{regexp:/^(\[\s*)([^\]]*?)(\s*\])/,replacement:"",labelPlaceholder:2},default:{regexp:/^(.|(?:NotTriggerChar+))/,replacement:"$1"}},is=new RegExp(Object.keys(Ji).join("|")),ss=[...Object.keys(rs)];for(let e of ss){let t=rs[e].regexp.source;for(;t.match(is);)t=t.replace(is,(e=>Ji[e].source));rs[e].regexp=new RegExp(t,rs[e].regexp.flags)}for(let e of ns){let t=e.start.source;for(;t.match(is);)t=t.replace(is,(e=>Ji[e].source));e.start=new RegExp(t,e.start.flags)}function os(e){return(e||"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const us={bold:{type:"inline",className:"TMStrong",set:{pre:"**",post:"**"},unset:{prePattern:/(?:\*\*|__)$/,postPattern:/^(?:\*\*|__)/}},italic:{type:"inline",className:"TMEm",set:{pre:"*",post:"*"},unset:{prePattern:/(?:\*|_)$/,postPattern:/^(?:\*|_)/}},code:{type:"inline",className:"TMCode",set:{pre:"`",post:"`"},unset:{prePattern:/`+$/,postPattern:/^`+/}},strikethrough:{type:"inline",className:"TMStrikethrough",set:{pre:"~~",post:"~~"},unset:{prePattern:/~~$/,postPattern:/^~~/}},h1:{type:"line",className:"TMH1",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"# $2"},unset:{pattern:/^( {0,3}#\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h2:{type:"line",className:"TMH2",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"## $2"},unset:{pattern:/^( {0,3}##\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h3:{type:"line",className:"TMH3",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"### $2"},unset:{pattern:/^( {0,3}###\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h4:{type:"line",className:"TMH4",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"#### $2"},unset:{pattern:/^( {0,3}####\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h5:{type:"line",className:"TMH5",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"##### $2"},unset:{pattern:/^( {0,3}#####\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},h6:{type:"line",className:"TMH6",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"###### $2"},unset:{pattern:/^( {0,3}######\s+)(.*?)((?:\s+#+\s*)?)$/,replacement:"$2"}},ul:{type:"line",className:"TMUL",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"- $2"},unset:{pattern:/^( {0,3}[+*-] {1,4})(.*)$/,replacement:"$2"}},ol:{type:"line",className:"TMOL",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"$#. $2"},unset:{pattern:/^( {0,3}\d{1,9}[.)] {1,4})(.*)$/,replacement:"$2"}},blockquote:{type:"line",className:"TMBlockquote",set:{pattern:/^( {0,3}(?:(?:#+|[0-9]{1,9}[).]|[>\-*+])\s+)?)(.*)$/,replacement:"> $2"},unset:{pattern:/^( {0,3}>[ ]?)(.*)$/,replacement:"$2"}}};e.Editor=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t;this.e=null,this.textarea=null,this.lines=[],this.lineElements=[],this.lineTypes=[],this.lineCaptures=[],this.lineReplacements=[],this.linkLabels=[],this.lineDirty=[],this.lastCommandState=null,this.customInlineGrammar={},this.mergedInlineGrammar=rs,this.hasFocus=!0,this.lastSelection=null,this.listeners={change:[],selection:[],drop:[]},this.undoStack=[],this.redoStack=[],this.isRestoringHistory=!1,this.maxHistory=100,this.e=null,this.textarea=null,this.lines=[],this.lineElements=[],this.lineTypes=[],this.lineCaptures=[],this.lineReplacements=[],this.linkLabels=[],this.lineDirty=[],this.lastCommandState=null,this.hasFocus=!0,this.lastSelection=null,this.customInlineGrammar=e.customInlineGrammar||{},this.mergedInlineGrammar=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=r({},rs);for(const[n,i]of Object.entries(e)){const e=r({},i);let s=i.regexp.source;const o=new RegExp(Object.keys(Ji).join("|"));for(;s.match(o);)s=s.replace(o,(e=>Ji[e].source));e.regexp=new RegExp(s,i.regexp.flags),t[n]=e}return t}(this.customInlineGrammar),this.listeners={change:[],selection:[],drop:[]};let n=null;"string"==typeof e.element?n=document.getElementById(e.element):e.element&&(n=e.element),"string"==typeof e.textarea?this.textarea=document.getElementById(e.textarea):e.textarea&&(this.textarea=e.textarea),this.textarea&&(n||(n=this.textarea)),n||(n=document.getElementsByTagName("body")[0]),n&&"TEXTAREA"===n.tagName&&(this.textarea=n,n=this.textarea.parentNode),this.textarea&&(this.textarea.style.display="none"),this.placeholder=void 0!==e.placeholder?e.placeholder:(null===(t=this.textarea)||void 0===t?void 0:t.placeholder)||void 0,this.undoStack=[],this.redoStack=[],this.isRestoringHistory=!1,this.maxHistory=100,this.createEditorElement(n,e),this.setContent("string"==typeof e.content?e.content:this.textarea?this.textarea.value:"# Hello TinyMDE!\nEdit **here**"),this.e.addEventListener("keydown",(e=>this.handleUndoRedoKey(e)))}get canUndo(){return this.undoStack.length>=2}get canRedo(){return this.redoStack.length>0}pushHistory(){this.isRestoringHistory||(this.pushCurrentState(),this.redoStack=[])}pushCurrentState(){this.undoStack.push({content:this.getContent(),selection:this.getSelection(),anchor:this.getSelection(!0)}),this.undoStack.length>this.maxHistory&&this.undoStack.shift()}undo(){if(this.undoStack.length<2)return;this.isRestoringHistory=!0,this.pushCurrentState();const e=this.undoStack.pop();this.redoStack.push(e);const t=this.undoStack[this.undoStack.length-1];this.setContent(t.content),t.selection&&this.setSelection(t.selection,t.anchor),this.undoStack.pop(),this.isRestoringHistory=!1}redo(){if(!this.redoStack.length)return;this.isRestoringHistory=!0,this.pushCurrentState();const e=this.redoStack.pop();this.setContent(e.content),e.selection&&this.setSelection(e.selection,e.anchor),this.isRestoringHistory=!1}handleUndoRedoKey(e){(/Mac|iPod|iPhone|iPad/.test(navigator.platform)?e.metaKey:e.ctrlKey)&&!e.altKey&&("z"===e.key||"Z"===e.key?(e.shiftKey?this.redo():this.undo(),e.preventDefault()):"y"!==e.key&&"Y"!==e.key||(this.redo(),e.preventDefault()))}createEditorElement(e,t){t&&void 0!==t.editor?"string"==typeof t.editor?this.e=document.getElementById(t.editor):this.e=t.editor:this.e=document.createElement("div"),this.e.classList.add("TinyMDE"),this.e.contentEditable="true",this.e.style.whiteSpace="pre-wrap",this.e.style.webkitUserModify="read-write-plaintext-only",this.placeholder&&this.e.setAttribute("data-placeholder",this.placeholder),void 0===t.editor&&(this.textarea&&this.textarea.parentNode===e&&this.textarea.nextSibling?e.insertBefore(this.e,this.textarea.nextSibling):e.appendChild(this.e)),this.e.addEventListener("input",(e=>this.handleInputEvent(e))),this.e.addEventListener("beforeinput",(e=>this.handleBeforeInputEvent(e))),this.e.addEventListener("compositionend",(e=>this.handleInputEvent(e))),document.addEventListener("selectionchange",(e=>{this.hasFocus&&this.handleSelectionChangeEvent(e)})),this.e.addEventListener("blur",(()=>this.hasFocus=!1)),this.e.addEventListener("focus",(()=>this.hasFocus=!0)),this.e.addEventListener("paste",(e=>this.handlePaste(e))),this.e.addEventListener("drop",(e=>this.handleDrop(e))),this.lineElements=this.e.childNodes}setContent(e){for(;this.e.firstChild;)this.e.removeChild(this.e.firstChild);this.lines=e.split(/(?:\r\n|\r|\n)/),this.lineDirty=[];for(let e=0;e<this.lines.length;e++){let e=document.createElement("div");this.e.appendChild(e),this.lineDirty.push(!0)}this.lineTypes=new Array(this.lines.length),this.updateFormatting(),this.updatePlaceholder(),this.fireChange(),this.isRestoringHistory||this.pushHistory()}getContent(){return this.lines.join("\n")}updatePlaceholder(){this.placeholder&&this.e&&(""===this.getContent()?this.e.classList.add("TinyMDE_empty"):this.e.classList.remove("TinyMDE_empty"))}updateFormatting(){this.updateLineTypes(),this.updateLinkLabels(),this.applyLineTypes()}updateLinkLabels(){this.linkLabels=[];for(let e=0;e<this.lines.length;e++)"TMLinkReferenceDefinition"===this.lineTypes[e]&&this.linkLabels.push(this.lineCaptures[e][ts.TMLinkReferenceDefinition.labelPlaceholder])}replace(e,t){return e.replace(/(\${1,2})([0-9])/g,((e,n,r)=>"$"===n?os(t[parseInt(r)]):'<span class="TMInlineFormatted">'.concat(this.processInlineStyles(t[parseInt(r)]),"</span>")))}applyLineTypes(){for(let e=0;e<this.lines.length;e++){if(this.lineDirty[e]){let t=this.replace(this.lineReplacements[e],this.lineCaptures[e]);this.lineElements[e].className=this.lineTypes[e],this.lineElements[e].removeAttribute("style"),this.lineElements[e].innerHTML=""===t?"<br />":t}this.lineElements[e].dataset.lineNum=e.toString()}}updateLineTypes(){let e=!1,t=0,n=!1;for(let r=0;r<this.lines.length;r++){let i="TMPara",s=[this.lines[r]],o="$$0";if("TMCodeFenceBacktickOpen"===e){let n=ts.TMCodeFenceBacktickClose.regexp.exec(this.lines[r]);n&&n.groups.seq.length>=t?(i="TMCodeFenceBacktickClose",o=ts.TMCodeFenceBacktickClose.replacement,s=n,e=!1):(i="TMFencedCodeBacktick",o='<span class="TMFencedCode">$0<br /></span>',s=[this.lines[r]])}else if("TMCodeFenceTildeOpen"===e){let n=ts.TMCodeFenceTildeClose.regexp.exec(this.lines[r]);n&&n.groups.seq.length>=t?(i="TMCodeFenceTildeClose",o=ts.TMCodeFenceTildeClose.replacement,s=n,e=!1):(i="TMFencedCodeTilde",o='<span class="TMFencedCode">$0<br /></span>',s=[this.lines[r]])}if("TMPara"===i&&!1===n)for(let e of ns)if(this.lines[r].match(e.start)&&(e.paraInterrupt||0===r||"TMPara"!==this.lineTypes[r-1]&&"TMUL"!==this.lineTypes[r-1]&&"TMOL"!==this.lineTypes[r-1]&&"TMBlockquote"!==this.lineTypes[r-1])){n=e;break}if(!1!==n&&(i="TMHTMLBlock",o='<span class="TMHTMLContent">$0<br /></span>',s=[this.lines[r]],n.end?this.lines[r].match(n.end)&&(n=!1):(r===this.lines.length-1||this.lines[r+1].match(ts.TMBlankLine.regexp))&&(n=!1)),"TMPara"===i)for(let e in ts)if(ts[e].regexp){let t=ts[e].regexp.exec(this.lines[r]);if(t){i=e,o=ts[e].replacement,s=t;break}}if("TMCodeFenceBacktickOpen"!==i&&"TMCodeFenceTildeOpen"!==i||(e=i,t=s.groups.seq.length),"TMIndentedCode"!==i&&"TMLinkReferenceDefinition"!==i||!(r>0)||"TMPara"!==this.lineTypes[r-1]&&"TMUL"!==this.lineTypes[r-1]&&"TMOL"!==this.lineTypes[r-1]&&"TMBlockquote"!==this.lineTypes[r-1]||(i="TMPara",s=[this.lines[r]],o="$$0"),"TMSetextH2Marker"===i){let e=ts.TMUL.regexp.exec(this.lines[r]);e&&(i="TMUL",o=ts.TMUL.replacement,s=e)}if("TMSetextH1Marker"===i||"TMSetextH2Marker"===i)if(0===r||"TMPara"!==this.lineTypes[r-1]){let e=ts.TMHR.regexp.exec(this.lines[r]);e?(i="TMHR",s=e,o=ts.TMHR.replacement):(i="TMPara",s=[this.lines[r]],o="$$0")}else{let e=r-1;const t="TMSetextH1Marker"===i?"TMSetextH1":"TMSetextH2";do{this.lineTypes[e]!==t&&(this.lineTypes[e]=t,this.lineDirty[e]=!0),this.lineReplacements[e]="$$0",this.lineCaptures[e]=[this.lines[e]],e--}while(e>=0&&"TMPara"===this.lineTypes[e])}this.lineTypes[r]!==i&&(this.lineTypes[r]=i,this.lineDirty[r]=!0),this.lineReplacements[r]=o,this.lineCaptures[r]=s}}getSelection(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var t,n;const r=window.getSelection();let i=e?r.anchorNode:r.focusNode;if(!i)return null;let s=e?r.anchorOffset:r.focusOffset;if(i===this.e)return s<this.lines.length?{row:s,col:0}:{row:s-1,col:this.lines[s-1].length};let o=this.computeColumn(i,s);if(null===o)return null;let u=i;for(;u.parentElement!==this.e;)u=u.parentElement;let a=0;if(u.previousSibling){const e=null===(t=u.dataset)||void 0===t?void 0:t.lineNum,r=null===(n=u.previousSibling.dataset)||void 0===n?void 0:n.lineNum;if(e&&r){const t=parseInt(e);if(t===parseInt(r)+1)a=t;else for(;u.previousSibling;)a++,u=u.previousSibling}}return{row:a,col:o}}setSelection(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return;let{node:n,offset:r}=this.computeNodeAndOffset(e.row,e.col,!!t&&(t.row===e.row&&t.col>e.col)),i=null,s=null;if(t&&(t.row!==e.row||t.col!==e.col)){let{node:n,offset:r}=this.computeNodeAndOffset(t.row,t.col,e.row===t.row&&e.col>t.col);i=n,s=r}window.getSelection().setBaseAndExtent(n,r,i||n,i?s:r)}restoreLastSelection(){return!(!this.lastSelection||!this.lastSelection.focus)&&(this.setSelection(this.lastSelection.focus,this.lastSelection.anchor),!0)}paste(e){let t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;r||(r=this.getSelection(!0)),i||(i=this.getSelection(!1)),i||(i={row:this.lines.length-1,col:this.lines[this.lines.length-1].length}),r||(r=i),r.row<i.row||r.row===i.row&&r.col<=i.col?(t=r,n=i):(t=i,n=r);let s=e.split(/(?:\r\n|\r|\n)/),o=this.lines[t.row].substr(0,t.col),u=this.lines[n.row].substr(n.col);s[0]=o.concat(s[0]);let a=s[s.length-1].length;s[s.length-1]=s[s.length-1].concat(u),this.spliceLines(t.row,1+n.row-t.row,s),i.row=t.row+s.length-1,i.col=a,this.updateFormatting(),this.setSelection(i),this.fireChange()}wrapSelection(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(this.isRestoringHistory||this.pushHistory(),n||(n=this.getSelection(!1)),r||(r=this.getSelection(!0)),!n||!r||n.row!==r.row)return;this.lineDirty[n.row]=!0;const i=n.col<r.col?n.col:r.col,s=n.col<r.col?r.col:n.col,o=this.lines[n.row].substr(0,i).concat(e),u=s===i?"":this.lines[n.row].substr(i,s-i),a=t.concat(this.lines[n.row].substr(s));this.lines[n.row]=o.concat(u,a),r.col=o.length,n.col=r.col+u.length,this.updateFormatting(),this.setSelection(n,r)}addEventListener(e,t){e.match(/^(?:change|input)$/i)&&this.listeners.change.push(t),e.match(/^(?:selection|selectionchange)$/i)&&this.listeners.selection.push(t),e.match(/^(?:drop)$/i)&&this.listeners.drop.push(t)}fireChange(){if(this.updatePlaceholder(),!this.textarea&&!this.listeners.change.length)return;const e=this.getContent();this.textarea&&(this.textarea.value=e);for(let t of this.listeners.change)t({content:e,linesDirty:[...this.lineDirty]})}handleBeforeInputEvent(e){const t=e;if("deleteContentBackward"===t.inputType||"deleteContentForward"===t.inputType){const n=this.getSelection(),r=this.getSelection(!0);if(!n||!r)return;const i="deleteContentBackward"===t.inputType;if(n.row===r.row&&n.col===r.col){if(i&&0===n.col&&n.row>0){e.preventDefault(),this.isRestoringHistory||this.pushHistory(),this.clearDirtyFlag();const t=this.lines[n.row-1].length;return this.lines[n.row-1]=this.lines[n.row-1]+this.lines[n.row],this.lineDirty[n.row-1]=!0,this.spliceLines(n.row,1),this.updateFormatting(),this.setSelection({row:n.row-1,col:t}),void this.fireChange()}if(!i&&n.col===this.lines[n.row].length&&n.row<this.lines.length-1){e.preventDefault(),this.isRestoringHistory||this.pushHistory(),this.clearDirtyFlag();const t=this.lines[n.row].length;return this.lines[n.row]=this.lines[n.row]+this.lines[n.row+1],this.lineDirty[n.row]=!0,this.spliceLines(n.row+1,1),this.updateFormatting(),this.setSelection({row:n.row,col:t}),void this.fireChange()}}return}if("insertParagraph"!==t.inputType&&"insertLineBreak"!==t.inputType)return;this.isRestoringHistory||this.pushHistory(),e.preventDefault(),this.clearDirtyFlag();const n=this.getSelection(),r=this.getSelection(!0);if(n&&r){if(n.row!==r.row){const e=n.row<r.row?n:r,t=n.row<r.row?r:n;this.lines[e.row]=this.lines[e.row].substring(0,e.col),this.lines[t.row]=this.lines[t.row].substring(t.col),this.spliceLines(e.row+1,t.row-e.row-1),n.row=e.row+1,n.col=0}else{let e=!1;switch(this.lineTypes[n.row]){case"TMUL":e="TMUL";break;case"TMOL":e="TMOL";break;case"TMIndentedCode":e="TMIndentedCode"}const t=this.lines[n.row].substring(0,n.col<=r.col?n.col:r.col),i=this.lines[n.row].substring(n.col<=r.col?r.col:n.col);if(this.spliceLines(n.row,1,[t,i]),n.row+=1,n.col=0,e){let t=ts[e].regexp.exec(this.lines[n.row-1]);t&&(t[2]?("TMOL"===e&&(t[1]=t[1].replace(/\d{1,9}/,(e=>(parseInt(e)+1).toString()))),this.lines[n.row]="".concat(t[1]).concat(this.lines[n.row]),this.lineDirty[n.row]=!0,n.col=t[1].length):(this.lines[n.row-1]="",this.lineDirty[n.row-1]=!0))}}this.updateFormatting(),this.setSelection(n),n&&n.row<this.lineElements.length&&this.lineElements[n.row].scrollIntoView({block:"nearest",inline:"nearest"}),this.fireChange()}}handleInputEvent(e){const t=e;if("insertCompositionText"===t.inputType)return;this.isRestoringHistory||this.pushHistory();let n=this.getSelection();("insertParagraph"!==t.inputType&&"insertLineBreak"!==t.inputType||!n)&&(this.e.firstChild?this.fixNodeHierarchy():this.e.innerHTML='<div class="TMBlankLine"><br></div>',this.updateLineContentsAndFormatting(),n&&this.setSelection(n),this.fireChange())}handleSelectionChangeEvent(e){this.fireSelection()}handlePaste(e){this.isRestoringHistory||this.pushHistory(),e.preventDefault();let t=e.clipboardData.getData("text/plain");this.paste(t)}handleDrop(e){e.preventDefault(),this.fireDrop(e.dataTransfer)}processInlineStyles(e){let t="",n=[],r=0,i=e;e:for(;i;){for(let e of["escape","code","autolink","html"])if(this.mergedInlineGrammar[e]){let n=this.mergedInlineGrammar[e].regexp.exec(i);if(n){i=i.substr(n[0].length),r+=n[0].length,t+=this.mergedInlineGrammar[e].replacement.replace(/\$([1-9])/g,((e,t)=>os(n[t])));continue e}}for(let e in this.customInlineGrammar)if("escape"!==e&&"code"!==e&&"autolink"!==e&&"html"!==e&&"linkOpen"!==e&&"imageOpen"!==e&&"linkLabel"!==e&&"default"!==e){let n=this.mergedInlineGrammar[e].regexp.exec(i);if(n){i=i.substr(n[0].length),r+=n[0].length,t+=this.mergedInlineGrammar[e].replacement.replace(/\$([1-9])/g,((e,t)=>os(n[t])));continue e}}let s=i.match(this.mergedInlineGrammar.linkOpen.regexp),o=i.match(this.mergedInlineGrammar.imageOpen.regexp);if(o||s){let e=this.parseLinkOrImage(i,!!o);if(e){t="".concat(t).concat(e.output),i=i.substr(e.charCount),r+=e.charCount;continue e}}let u=/(^\*+)|(^_+)/.exec(i);if(u){let s=u[0].length;const o=u[0],a=u[0][0];i=i.substr(u[0].length);const l=r>0?e.substr(0,r):" ",c=r+u[0].length<e.length?i:" ",p=c.match(Qi),h=l.match(es),f=c.match(/^\s/),g=l.match(/\s$/);let d=!(f||p&&!g&&!h),m=!(g||h&&!f&&!p);if("_"===a&&d&&m&&(d=!!h,m=!!p),m){let e=n.length-1;for(;s&&e>=0;)if(n[e].delimiter===a){for(;e<n.length-1;){const e=n.pop();t="".concat(e.output).concat(e.delimString.substr(0,e.count)).concat(t)}if(s>=2&&n[e].count>=2?(t='<span class="TMMark">'.concat(a).concat(a,'</span><strong class="TMStrong">').concat(t,'</strong><span class="TMMark">').concat(a).concat(a,"</span>"),s-=2,n[e].count-=2):(t='<span class="TMMark">'.concat(a,'</span><em class="TMEm">').concat(t,'</em><span class="TMMark">').concat(a,"</span>"),s-=1,n[e].count-=1),0===n[e].count){let r=n.pop();t="".concat(r.output).concat(t),e--}}else e--}s&&d&&(n.push({delimiter:a,delimString:o,count:s,output:t}),t="",s=0),s&&(t="".concat(t).concat(o.substr(0,s))),r+=u[0].length}else if(u=/^~~/.exec(i),u){let e=!1,s=n.length-1;for(;!e&&s>=0;)if("~"===n[s].delimiter){for(;s<n.length-1;){const e=n.pop();t="".concat(e.output).concat(e.delimString.substr(0,e.count)).concat(t)}t='<span class="TMMark">~~</span><del class="TMStrikethrough">'.concat(t,'</del><span class="TMMark">~~</span>');let r=n.pop();t="".concat(r.output).concat(t),e=!0}else s--;e||(n.push({delimiter:"~",delimString:"~~",count:2,output:t}),t=""),r+=u[0].length,i=i.substr(u[0].length)}else{if(u=this.mergedInlineGrammar.default.regexp.exec(i),!u)throw"Infinite loop!";i=i.substr(u[0].length),r+=u[0].length,t+=this.mergedInlineGrammar.default.replacement.replace(/\$([1-9])/g,((e,t)=>os(u[t])))}}for(;n.length;){const e=n.pop();t="".concat(e.output).concat(e.delimString.substr(0,e.count)).concat(t)}return t}computeColumn(e,t){let n,r=e;for(;r&&r.parentNode!==this.e;)r=r.parentNode;if(null===r)return null;for(e.nodeType===Node.TEXT_NODE||0===t?(n=t,r=e):t>0?(r=e.childNodes[t-1],n=r.textContent.length):(n=0,r=e);r.parentNode!==this.e;)r.previousSibling?(r=r.previousSibling,n+=r.textContent.length):r=r.parentNode;return n}computeNodeAndOffset(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e>=this.lineElements.length&&(e=this.lineElements.length-1,t=this.lines[e].length),t>this.lines[e].length&&(t=this.lines[e].length);const r=this.lineElements[e];let i=r.firstChild,s=!1,o={node:r.firstChild?r.firstChild:r,offset:0};for(;i!==r;){if(!s&&i.nodeType===Node.TEXT_NODE)if(i.nodeValue.length>=t){if(!n||i.nodeValue.length!==t)return{node:i,offset:t};o={node:i,offset:t},t=0}else t-=i.nodeValue.length;!s&&i.firstChild?i=i.firstChild:i.nextSibling?(s=!1,i=i.nextSibling):(s=!0,i=i.parentNode)}return o}updateLineContentsAndFormatting(){this.clearDirtyFlag(),this.updateLineContents(),this.updateFormatting()}clearDirtyFlag(){this.lineDirty=new Array(this.lines.length);for(let e=0;e<this.lineDirty.length;e++)this.lineDirty[e]=!1}updateLineContents(){let e=this.e.childElementCount-this.lines.length;if(e){let t=0;for(;t<=this.lines.length&&t<=this.lineElements.length&&this.lineElements[t]&&this.lines[t]===this.lineElements[t].textContent&&this.lineTypes[t]===this.lineElements[t].className;)t++;let n=-1;for(;-n<this.lines.length&&-n<this.lineElements.length&&this.lines[this.lines.length+n]===this.lineElements[this.lineElements.length+n].textContent&&this.lineTypes[this.lines.length+n]===this.lineElements[this.lineElements.length+n].className;)n--;let r=this.lines.length+n+1-t;r<-e&&(r=-e),r<0&&(r=0);let i=[];for(let n=0;n<r+e;n++)i.push(this.lineElements[t+n].textContent||"");this.spliceLines(t,r,i,!1)}else for(let e=0;e<this.lineElements.length;e++){let t=this.lineElements[e],n=t.textContent||"";this.lines[e]===n&&this.lineTypes[e]===t.className||(this.lines[e]=n,this.lineTypes[e]=t.className,this.lineDirty[e]=!0)}}spliceLines(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(r)for(let n=0;n<t;n++)this.e.removeChild(this.e.childNodes[e]);let i=[],s=[];for(let t=0;t<n.length;t++)i.push(""),s.push(!0),r&&(this.e.childNodes[e]?this.e.insertBefore(document.createElement("div"),this.e.childNodes[e]):this.e.appendChild(document.createElement("div")));this.lines.splice(e,t,...n),this.lineTypes.splice(e,t,...i),this.lineDirty.splice(e,t,...s)}fixNodeHierarchy(){const e=Array.from(this.e.childNodes),t=function(e){const t=e.parentElement,n=e.nextSibling;t.removeChild(e);for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];i.forEach((e=>n?t.insertBefore(e,n):t.appendChild(e)))};e.forEach((e=>{if(e.nodeType!==Node.ELEMENT_NODE||"DIV"!==e.tagName){const n=document.createElement("div");t(e,n),n.appendChild(e)}else if(0===e.childNodes.length)e.appendChild(document.createElement("br"));else{const n=Array.from(e.childNodes);if(n.some((e=>e.nodeType===Node.ELEMENT_NODE&&"DIV"===e.tagName)))return t(e,...n)}}))}parseLinkOrImage(e,t){let n=t?2:1,r=e.substr(0,n),i=t?"TMImage":"TMLink",s=n,o=1,u=!1,a=!1,l=[],c=[];e:for(;s<e.length&&!1===u;){let r=e.substr(s);for(let e of["escape","code","autolink","html"]){let t=this.mergedInlineGrammar[e].regexp.exec(r);if(t){s+=t[0].length;continue e}}if(r.match(this.mergedInlineGrammar.imageOpen.regexp))o++,s+=2;else if(r.match(this.mergedInlineGrammar.linkOpen.regexp)){if(o++,!t&&this.parseLinkOrImage(r,!1))return!1;s+=1}else r.match(/^\]/)&&(o--,0===o)?(u=e.substr(n,s-n),s++):s++}if(!1===u)return!1;let p=s<e.length?e.substr(s,1):"";if("["===p){let t=e.substr(s),n=this.mergedInlineGrammar.linkLabel.regexp.exec(t);if(!n)return!1;s+=n[0].length,l.push(n[1],n[2],n[3]),a=n[this.mergedInlineGrammar.linkLabel.labelPlaceholder]?n[this.mergedInlineGrammar.linkLabel.labelPlaceholder]:u.trim()}else if("("!==p)a=u.trim();else{s++;let t=1;for(;s<e.length&&t>0;){let n=e.substr(s),r=/^\s+/.exec(n);if(r){switch(c.length){case 0:case 1:c.push(r[0]);break;case 2:if(c[0].match(/</))c[1]=c[1].concat(r[0]);else{if(1!==t)return!1;c.push(""),c.push(r[0])}break;case 3:c.push(r[0]);break;case 4:return!1;case 5:c.push("");case 6:c[5]=c[5].concat(r[0]);break;case 7:c[6]=c[6].concat(r[0]);break;default:return!1}s+=r[0].length}else if(r=this.mergedInlineGrammar.escape.regexp.exec(n),r){switch(c.length){case 0:c.push("");case 1:c.push(r[0]);break;case 2:c[1]=c[1].concat(r[0]);break;case 3:case 4:return!1;case 5:c.push("");case 6:c[5]=c[5].concat(r[0]);break;default:return!1}s+=r[0].length}else if(c.length<2&&n.match(/^</))0===c.length&&c.push(""),c[0]=c[0].concat("<"),s++;else if(1!==c.length&&2!==c.length||!n.match(/^>/))if(r=/^["']/.exec(n),!r||0!==c.length&&1!==c.length&&4!==c.length)if(!r||5!==c.length&&6!==c.length||c[4]!==r[0])if(n.match(/^\(/)){switch(c.length){case 0:c.push("");case 1:c.push("");case 2:c[1]=c[1].concat("("),c[0].match(/<$/)||t++;break;case 3:c.push("");case 4:c.push("(");break;case 5:c.push("");case 6:if("("===c[4])return!1;c[5]=c[5].concat("(");break;default:return!1}s++}else if(n.match(/^\)/)){if(c.length<=2){for(;c.length<2;)c.push("");c[0].match(/<$/)||t--,t>0&&(c[1]=c[1].concat(")"))}else 5===c.length||6===c.length?"("===c[4]?(5===c.length&&c.push(""),c.push(")")):5===c.length?c.push(")"):c[5]=c[5].concat(")"):t--;if(0===t)for(;c.length<7;)c.push("");s++}else{if(r=/^./.exec(n),!r)throw"Infinite loop";switch(c.length){case 0:c.push("");case 1:c.push(r[0]);break;case 2:c[1]=c[1].concat(r[0]);break;case 3:case 4:return!1;case 5:c.push("");case 6:c[5]=c[5].concat(r[0]);break;default:return!1}s+=r[0].length}else 5===c.length&&c.push(""),c.push(r[0]),s++;else{for(;c.length<4;)c.push("");c.push(r[0]),s++}else 1===c.length&&c.push(""),c.push(">"),s++}if(t>0)return!1}if(!1!==a){let e=!1;for(let t of this.linkLabels)if(t===a){e=!0;break}let t=e?"TMLinkLabel TMLinkLabel_Valid":"TMLinkLabel TMLinkLabel_Invalid",n='<span class="TMMark TMMark_'.concat(i,'">').concat(r,'</span><span class="').concat(i," ").concat(l.length<3||!l[1]?t:"",'">').concat(this.processInlineStyles(u),'</span><span class="TMMark TMMark_').concat(i,'">]</span>');return l.length>=3&&(n=n.concat('<span class="TMMark TMMark_'.concat(i,'">').concat(l[0],"</span>"),'<span class="'.concat(t,'">').concat(l[1],"</span>"),'<span class="TMMark TMMark_'.concat(i,'">').concat(l[2],"</span>"))),{output:n,charCount:s}}if(c.length>0){for(;c.length<7;)c.push("");return{output:'<span class="TMMark TMMark_'.concat(i,'">').concat(r,'</span><span class="').concat(i,'">').concat(this.processInlineStyles(u),'</span><span class="TMMark TMMark_').concat(i,'">](').concat(c[0],'</span><span class="').concat(i,'Destination">').concat(os(c[1]),'</span><span class="TMMark TMMark_').concat(i,'">').concat(c[2]).concat(c[3]).concat(c[4],'</span><span class="').concat(i,'Title">').concat(os(c[5]),'</span><span class="TMMark TMMark_').concat(i,'">').concat(c[6],")</span>"),charCount:s}}return!1}computeCommonAncestor(e,t){if(!e||!t)return null;if(e===t)return e;const n=e=>{let t=[];for(;e;)t.unshift(e),e=e.parentNode;return t},r=n(e),i=n(t);if(r[0]!==i[0])return null;let s;for(s=0;r[s]===i[s];s++);return r[s-1]}computeEnclosingMarkupNode(e,t,n){let r=null;if(!e)return null;if(t){if(e.row!==t.row)return null;const n=window.getSelection();if(!n)return null;r=this.computeCommonAncestor(n.focusNode,n.anchorNode)}else{const e=window.getSelection();if(!e||!e.focusNode)return null;r=e.focusNode}if(!r)return null;for(;r!==this.e;){if(r.classList&&r.classList.contains(n))return r;r=r.parentNode}return null}getCommandState(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i={};if(n||(n=this.getSelection(!1)),r||(r=this.getSelection(!0)),!n){for(let e in us)i[e]=null;return i}r||(r=n),r.row<n.row||r.row===n.row&&r.col<n.col?(e=r,t=n):(e=n,t=r),t.row>e.row&&0===t.col&&(t.row--,t.col=this.lines[t.row].length);for(let s in us)if("inline"===us[s].type&&(n&&n.row===r.row&&this.isInlineFormattingAllowed()?i[s]=!!this.computeEnclosingMarkupNode(n,r,us[s].className)||n.col===r.col&&!!this.lines[n.row].substr(0,n.col).match(us[s].unset.prePattern)&&!!this.lines[n.row].substr(n.col).match(us[s].unset.postPattern):i[s]=null),"line"===us[s].type)if(n){let n=this.lineTypes[e.row]===us[s].className;for(let r=e.row;r<=t.row;r++)if(this.lineTypes[r]===us[s].className!==n){n=null;break}i[s]=n}else i[s]=null;return i}setCommandState(e,t){if(this.isRestoringHistory||this.pushHistory(),"inline"===us[e].type){let t=this.getSelection(!0),n=this.getSelection(!1);if(t||(t=n),!t)return;if(t.row!==n.row)return;if(!this.isInlineFormattingAllowed())return;let r=this.computeEnclosingMarkupNode(n,t,us[e].className);if(this.clearDirtyFlag(),r){this.lineDirty[n.row]=!0;const i=this.computeColumn(r,0),s=r.textContent.length,o=this.lines[n.row].substr(0,i).replace(us[e].unset.prePattern,""),u=this.lines[n.row].substr(i,s),a=this.lines[n.row].substr(i+s).replace(us[e].unset.postPattern,"");this.lines[n.row]=o.concat(u,a),t.col=o.length,n.col=t.col+s,this.updateFormatting(),this.setSelection(n,t),this.fireChange()}else if(n.col===t.col&&this.lines[n.row].substr(0,n.col).match(us[e].unset.prePattern)&&this.lines[n.row].substr(n.col).match(us[e].unset.postPattern)){this.lineDirty[n.row]=!0;const r=this.lines[n.row].substr(0,n.col).replace(us[e].unset.prePattern,""),i=this.lines[n.row].substr(n.col).replace(us[e].unset.postPattern,"");this.lines[n.row]=r.concat(i),n.col=t.col=r.length,this.updateFormatting(),this.setSelection(n,t),this.fireChange()}else{let{startCol:r,endCol:i}=n.col<t.col?{startCol:n.col,endCol:t.col}:{startCol:t.col,endCol:n.col},o=this.lines[n.row].substr(r,i-r).match(s(/^(\s*).*\S(\s*)$/,{leading:1,trailing:2}));o&&(r+=o.groups.leading.length,i-=o.groups.trailing.length),n.col=r,t.col=i,this.wrapSelection(us[e].set.pre,us[e].set.post,n,t),this.fireChange()}}else if("line"===us[e].type){let n=this.getSelection(!0),r=this.getSelection(!1);if(n||(n=r),!r)return;this.clearDirtyFlag();let i=n.row>r.row?r:n,s=n.row>r.row?n:r;s.row>i.row&&0===s.col&&s.row--;for(let n=i.row;n<=s.row;n++)t&&this.lineTypes[n]!==us[e].className&&(this.lines[n]=this.lines[n].replace(us[e].set.pattern,us[e].set.replacement.replace("$#",(n-i.row+1).toString())),this.lineDirty[n]=!0),t||this.lineTypes[n]!==us[e].className||(this.lines[n]=this.lines[n].replace(us[e].unset.pattern,us[e].unset.replacement),this.lineDirty[n]=!0);this.updateFormatting(),this.setSelection({row:s.row,col:this.lines[s.row].length},{row:i.row,col:0}),this.fireChange()}}isInlineFormattingAllowed(){const e=window.getSelection();if(!e||!e.focusNode||!e.anchorNode)return!1;if(e.isCollapsed&&3===e.focusNode.nodeType&&e.focusOffset===e.focusNode.nodeValue.length){let t;for(t=e.focusNode;t&&null===t.nextSibling;t=t.parentNode);if(t&&t.nextSibling&&t.nextSibling.classList&&t.nextSibling.classList.contains("TMInlineFormatted"))return!0}let t=this.computeCommonAncestor(e.focusNode,e.anchorNode);if(!t)return!1;for(;t&&t!==this.e;){if(t.classList&&(t.classList.contains("TMInlineFormatted")||t.classList.contains("TMBlankLine")))return!0;t=t.parentNode}return!1}toggleCommandState(e){this.lastCommandState||(this.lastCommandState=this.getCommandState()),this.setCommandState(e,!this.lastCommandState[e])}fireDrop(e){for(let t of this.listeners.drop)t({dataTransfer:e})}fireSelection(){let e=this.getSelection(!1),t=this.getSelection(!0);if(this.lastSelection={focus:e,anchor:t},this.listeners.selection&&this.listeners.selection.length){let n=this.getCommandState(e,t);this.lastCommandState?Object.assign(this.lastCommandState,n):this.lastCommandState=Object.assign({},n);for(let n of this.listeners.selection)n({focus:e,anchor:t,commandState:this.lastCommandState})}}}}));
package/lib/TinyMDE.d.ts CHANGED
@@ -80,10 +80,15 @@ export declare class Editor {
80
80
  addEventListener<T extends EventType>(type: T, listener: T extends 'change' ? EventHandler<ChangeEvent> : T extends 'selection' ? EventHandler<SelectionEvent> : T extends 'drop' ? EventHandler<DropEvent> : never): void;
81
81
  private fireChange;
82
82
  /**
83
- * beforeinput handler, exclusively to handle insertParagraph and
84
- * insertLineBreak events. These used to be handled in the input event,
85
- * but that caused issues with Firefox where the input event would be
86
- * sometimes not be fired for these input types.
83
+ * beforeinput handler, exclusively to handle insertParagraph,
84
+ * insertLineBreak, deleteContentBackward, and deleteContentForward events.
85
+ * These used to be handled in the input event, but that caused issues with
86
+ * Firefox where the input event would be sometimes not be fired for these
87
+ * input types. deleteContentBackward/Forward are also handled here to fix a
88
+ * Firefox-specific bug (#151) where backspacing on an empty line would not
89
+ * remove it, because Firefox only removes the <br> inside the empty <div>
90
+ * rather than merging the divs, and fixNodeHierarchy() would then re-add the
91
+ * <br>, resulting in a no-op.
87
92
  * @param event The input event
88
93
  * @returns nothing
89
94
  */
package/lib/TinyMDE.js CHANGED
@@ -559,15 +559,64 @@ class Editor {
559
559
  }
560
560
  }
561
561
  /**
562
- * beforeinput handler, exclusively to handle insertParagraph and
563
- * insertLineBreak events. These used to be handled in the input event,
564
- * but that caused issues with Firefox where the input event would be
565
- * sometimes not be fired for these input types.
562
+ * beforeinput handler, exclusively to handle insertParagraph,
563
+ * insertLineBreak, deleteContentBackward, and deleteContentForward events.
564
+ * These used to be handled in the input event, but that caused issues with
565
+ * Firefox where the input event would be sometimes not be fired for these
566
+ * input types. deleteContentBackward/Forward are also handled here to fix a
567
+ * Firefox-specific bug (#151) where backspacing on an empty line would not
568
+ * remove it, because Firefox only removes the <br> inside the empty <div>
569
+ * rather than merging the divs, and fixNodeHierarchy() would then re-add the
570
+ * <br>, resulting in a no-op.
566
571
  * @param event The input event
567
572
  * @returns nothing
568
573
  */
569
574
  handleBeforeInputEvent(event) {
570
575
  const beforeInputEvent = event;
576
+ // Handle cross-line delete operations (backspace at col 0, delete at end of line)
577
+ if (beforeInputEvent.inputType === "deleteContentBackward" ||
578
+ beforeInputEvent.inputType === "deleteContentForward") {
579
+ const focus = this.getSelection();
580
+ const anchor = this.getSelection(true);
581
+ if (!focus || !anchor)
582
+ return;
583
+ const isBackspace = beforeInputEvent.inputType === "deleteContentBackward";
584
+ // Only intercept collapsed selections at line boundaries
585
+ if (focus.row === anchor.row && focus.col === anchor.col) {
586
+ if (isBackspace && focus.col === 0 && focus.row > 0) {
587
+ // Backspace at start of line: merge current line into end of previous
588
+ event.preventDefault();
589
+ if (!this.isRestoringHistory)
590
+ this.pushHistory();
591
+ this.clearDirtyFlag();
592
+ const prevLineLen = this.lines[focus.row - 1].length;
593
+ this.lines[focus.row - 1] = this.lines[focus.row - 1] + this.lines[focus.row];
594
+ this.lineDirty[focus.row - 1] = true;
595
+ this.spliceLines(focus.row, 1);
596
+ this.updateFormatting();
597
+ this.setSelection({ row: focus.row - 1, col: prevLineLen });
598
+ this.fireChange();
599
+ return;
600
+ }
601
+ if (!isBackspace && focus.col === this.lines[focus.row].length && focus.row < this.lines.length - 1) {
602
+ // Delete at end of line: merge next line into current
603
+ event.preventDefault();
604
+ if (!this.isRestoringHistory)
605
+ this.pushHistory();
606
+ this.clearDirtyFlag();
607
+ const currentLineLen = this.lines[focus.row].length;
608
+ this.lines[focus.row] = this.lines[focus.row] + this.lines[focus.row + 1];
609
+ this.lineDirty[focus.row] = true;
610
+ this.spliceLines(focus.row + 1, 1);
611
+ this.updateFormatting();
612
+ this.setSelection({ row: focus.row, col: currentLineLen });
613
+ this.fireChange();
614
+ return;
615
+ }
616
+ }
617
+ // For within-line deletes or non-collapsed selections, let the browser handle it
618
+ return;
619
+ }
571
620
  if (beforeInputEvent.inputType !== "insertParagraph" &&
572
621
  beforeInputEvent.inputType !== "insertLineBreak")
573
622
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiny-markdown-editor",
3
- "version": "0.2.21",
3
+ "version": "0.2.23",
4
4
  "description": "TinyMDE: A tiny, ultra low dependency, embeddable HTML/JavaScript Markdown editor.",
5
5
  "main": "lib/index.js",
6
6
  "files": [