View File Name : tinymce.min.js
').css(_e({},r)).appendTo(i)[0];return f.set({caret:o,element:t,before:e}),e&&Ya(o).addClass("mce-visual-caret-before"),c=Ar.setInterval(function(){u()?Ya("div.mce-visual-caret",i).toggleClass("mce-visual-caret-hidden"):Ya("div.mce-visual-caret",i).addClass("mce-visual-caret-hidden")},500),(n=t.ownerDocument.createRange()).setStart(l,0),n.setEnd(l,0),n},hide:s,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){f.on(function(e){var t=$s(i,e.element,e.before);Ya(e.caret).css(_e({},t))})},destroy:function(){return Ar.clearInterval(c)}}}function Ks(){return xc.isIE()||xc.isEdge()||xc.isFirefox()}function Xs(e){return Ec(e)||cn(e)&&Ks()}function Ys(e,t){for(var n;n=e(t);)if(!Dc(n))return n;return null}function Gs(e,t,n,r,o){var i=new Dr(e,r),a=kc(e)||Dc(e);if(t<0){if(a&&n(e=Ys(i.prev.bind(i),!0)))return e;for(;e=Ys(i.prev.bind(i),o);)if(n(e))return e}if(0
=a.data.length-1)return 1===e&&(r=i(a))?Bc(r):n;if(Ao(a)&&u<=1)return-1===e&&(r=o(a))?Pc(r):n;if(u===a.data.length)return(r=i(a))?Bc(r):n;if(0===u)return(r=o(a))?Pc(r):n}return n}function rc(e,t){return ve.from(Zs(e?0:-1,t)).filter(kc)}function oc(e,t,n){var r=nc(e,t,n);return-1===e?cs.fromRangeStart(r):cs.fromRangeEnd(r)}function ic(e){return ve.from(e.getNode()).map(Et.fromDom)}function ac(e,t){for(;t=e(t);)if(t.isVisible())return t;return t}function uc(e,t){var n=Qs(e,t);return!(n||!Kn(e.getNode()))||n}cs.fromRangeStart=function(e){return cs(e.startContainer,e.startOffset)},cs.fromRangeEnd=function(e){return cs(e.endContainer,e.endOffset)},cs.after=function(e){return cs(e.parentNode,as(e)+1)},cs.before=function(e){return cs(e.parentNode,as(e))},cs.isAbove=function(e,t){return dn(Q(t.getClientRects()),Z(e.getClientRects()),Ou).getOr(!1)},cs.isBelow=function(e,t){return dn(Z(t.getClientRects()),Q(e.getClientRects()),Bu).getOr(!1)},cs.isAtStart=function(e){return!!e&&e.isAtStart()},cs.isAtEnd=function(e){return!!e&&e.isAtEnd()},cs.isTextPosition=function(e){return!!e&&Vn(e.container())},cs.isElementPosition=function(e){return!1===cs.isTextPosition(e)};var sc,cc,lc=Vn,fc=sn,dc=eu.nodeIndex,mc=function(e){var t=e.parentNode;return fc(t)?mc(t):t},gc=function(e){return e?me(e.childNodes,function(e,t){return fc(t)&&"BR"!==t.nodeName?e=e.concat(gc(t)):e.push(t),e},[]):[]},pc=Gn,hc=R(xs,u,!0),vc=eu.DOM,bc=Hn,yc=Vn,Cc=function(e){bc(e)&&Mr(e)&&(Fr(e)?e.removeAttribute("data-mce-caret"):Us(e)),yc(e)&&(Hs(e),0===e.data.length&&Us(e))},xc=dt().browser,wc=Gn,Sc=Qn,Nc=Jn,Ec=function(e){return wc(e)||Sc(e)},kc=Gn,_c=Qn,Ac=an("display","block table table-cell table-caption list-item"),Rc=Mr,Dc=Lr,Tc=Hn,Oc=Vr,Bc=R(ec,!0),Pc=R(ec,!1);function Lc(e,t){return e.hasChildNodes()&&t'),t}function Kc(e,t,n){return!1===t.hasChildNodes()&&qc(e,t)&&(o=n,i=(r=t).ownerDocument.createTextNode(So),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),1);var r,o,i}function Xc(e,t,n,r){var o,i,a,u,s=n[t?"start":"end"],c=e.getRoot();if(s){for(a=s[0],i=c,o=s.length-1;1<=o;o--){if(u=i.childNodes,Kc(c,i,r))return 1;if(s[o]>u.length-1)return Kc(c,i,r)||function(t){return of(i).fold(D,function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0})}(r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return 1}function Yc(e){return Vn(e)&&0=t.data.length&&e.splice(0,1);var n=e[e.length-1];return 0===a&&0L(s)?(_=I(k*N),k=I(_/N)):(k=I(_/N),_=I(k*N))),m(h,k,_),t=b.startPos.x+u,n=b.startPos.y+s,T.setStyles(v,{left:t=0u.childNodes.length-1&&(f=!1),$n(u)&&(u=i,s=0),u===i){if(f&&(d=u.childNodes[0d.bottom&&Zt(n.element,!0===r)}function Qf(e,t,n){return $f(e,Gf,t,n)}function Zf(e,t,n){return Kf(e,t,Gf,n)}function ed(e,t,n){return $f(e,Jf,t,n)}function td(e,t,n){return Kf(e,t,Jf,n)}function nd(e,t,n){(e.inline?Qf:ed)(e,t,n)}function rd(e){var t=Pn(e).dom;return e.dom===t.activeElement}function od(e){return void 0===e&&(e=Et.fromDom(document)),ve.from(e.dom.activeElement).map(Et.fromDom)}function id(e,t){var n=An(t)?Ml(t).length:Tn(t).length+1;return n\ufeff'),qt(s.element,c),qf(c,function(){return In(c)}));Wf(e,i,t,l,r),l.cleanup()},Od=function(e,t,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;t(Et.fromDom(r),Et.fromDom(i));var u=e.dom.createRng();u.setStart(r,o),u.setEnd(i,a),e.selection.setRng(n)},Bd=ir([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Pd=(Bd.before,Bd.on,Bd.after,function(e){return e.fold(u,u,u)}),Ld=ir([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Id={domRange:Ld.domRange,relative:Ld.relative,exact:Ld.exact,exactFromRange:function(e){return Ld.exact(e.start,e.soffset,e.finish,e.foffset)},getWin:function(e){return Tt(e.match({domRange:function(e){return Et.fromDom(e.startContainer)},relative:function(e,t){return Pd(e)},exact:function(e,t,n,r){return e}}))},range:function(e,t,n,r){return{start:e,soffset:t,finish:n,foffset:r}}},Md=dt().browser,Fd={isEditorUIElement:function(e){var t=e.className.toString();return-1!==t.indexOf("tox-")||-1!==t.indexOf("mce-")}},Ud=eu.DOM,zd=function(e){return e.editorManager.setActive(e)},Hd={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},jd=(Vd.create=function(e,t){var n=new Vd(e,Hd[e]||1);return t&&ne(t,function(e,t){n.attr(t,e)}),n},Vd.prototype.replace=function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},Vd.prototype.attr=function(e,t){var n,r=this;if("string"!=typeof e)return null!=e&&ne(e,function(e,t){r.attr(t,e)}),r;if(n=r.attributes){if(void 0===t)return n.map[e];if(null===t){if(e in n.map){delete n.map[e];for(var o=n.length;o--;)if(n[o].name===e)return n.splice(o,1),r}return r}if(e in n.map){for(o=n.length;o--;)if(n[o].name===e){n[o].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,r}},Vd.prototype.clone=function(){var e,t=new Vd(this.name,this.type);if(e=this.attributes){var n=[];n.map={};for(var r=0,o=e.length;r":" />",n&&s&&l[e]&&0"),s&&l[e]&&0")},comment:function(e){u.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?u.push("",e," ",f(t),"?>"):u.push("",e,"?>"),s&&u.push("\n")},doctype:function(e){u.push("",s?"\n":"")},reset:function(){u.length=0},getContent:function(){return u.join("").replace(/\n$/,"")}}}function rm(t,g){void 0===g&&(g=oo());var p=nm(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f=t.validate,d={3:function(e){p.text(e.value,e.raw)},8:function(e){p.comment(e.value)},7:function(e){p.pi(e.name,e.value)},10:function(e){p.doctype(e.value)},4:function(e){p.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}};p.reset();var m=function(e){var t=d[e.type];if(t)t(e);else{var n=e.name,r=e.shortEnded,o=e.attributes;if(f&&o&&1'))}function vm(n){Ut(n).each(function(t){Bt(t).each(function(e){go(n)&&Pr(t)&&go(e)&&In(t)})})}function bm(e,t){return o=D,Ve(r=t,n=e)?function(e,t){for(var n=y(t)?t:D,r=e.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=Et.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(n,function(e){return o(e)||je(e,r)}).slice(0,-1):[];var n,r,o}function ym(e,t){return[e].concat(bm(e,t))}function Cm(e,t,n){return ef(e,t,n,dm)}function xm(e,t){return M(ym(Et.fromDom(t.container()),e),go)}function wm(e,n,r){return Cm(e,n.dom,r).forall(function(t){return xm(n,r).fold(function(){return!1===Qs(t,r,n.dom)},function(e){return!1===Qs(t,r,n.dom)&&Ve(e,Et.fromDom(t.container()))})})}function Sm(t,n,r){return xm(n,r).fold(function(){return Cm(t,n.dom,r).forall(function(e){return!1===Qs(e,r,n.dom)})},function(e){return Cm(t,e.dom,r).isNone()})}function Nm(e){return ic(e).exists(Pr)}function Em(e,t,n){var r=Q(U(ym(Et.fromDom(n.container()),t),go)).getOr(t);return Zl(e,r.dom,n).filter(Nm)}function km(e,t){return ic(t).exists(Pr)||Em(!0,e,t).isSome()}function _m(e,t){return ve.from(t.getNode(!0)).map(Et.fromDom).exists(Pr)||Em(!1,e,t).isSome()}function Am(e){return cs.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()}function Rm(e,t){return Q(U(ym(Et.fromDom(t.container()),e),go)).getOr(e)}function Dm(e,t){return Am(t)?Gg(t):Gg(t)||nf(Rm(e,t).dom,t).exists(Gg)}function Tm(e,t){return Am(t)?Yg(t):Yg(t)||tf(Rm(e,t).dom,t).exists(Yg)}function Om(e){return ic(e).bind(function(e){return hr(e,_n)}).exists(function(e){return T(["pre","pre-wrap"],wn(e,"white-space"))})}function Bm(e,t){return!Om(t)&&(ip(e,t)||up(e,t)||_m(e,t)||Dm(e,t))}function Pm(e,t){return!Om(t)&&(ap(e,t)||sp(e,t)||km(e,t)||Tm(e,t))}function Lm(e,t){return Bm(e,t)||Pm(e,(r=(n=t).container(),o=n.offset(),Vn(r)&&o=e.data.length&&Pm(o,cs(e,e.data.length)),u=0===t&&Bm(o,cs(e,0)),e.replaceData(t,n,(c=u,l=a,L(s=i,function(e,t){return Zc(t)||sf(t)?e.previousCharIsSpace||""===e.str&&c||e.str.length===s.length-1&&l?{previousCharIsSpace:!1,str:e.str+wo}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:""}).str)))}function Hm(e,t){var n=e.data.slice(t);zm(e,t,n.length-Qe(n).length)}function jm(e,t){var n=e.data.slice(0,t),r=n.length-Ze(n).length;zm(e,t-r,r)}function Vm(e,t,n,r){void 0===r&&(r=!0);var o=Ze(e.data).length,i=r?e:t,a=r?t:e;return r?i.appendData(a.data):i.insertData(0,a.data),In(Et.fromDom(a)),n&&Hm(i,o),i}function qm(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===cs.isTextPosition(n)&&o===r.parentNode&&i>cs.before(r).offset()?cs(t.container(),t.offset()-1):t;var n,r,o,i}function $m(e){return Vr(e.previousSibling)?ve.some((t=e.previousSibling,Vn(t)?cs(t,t.data.length):cs.after(t))):e.previousSibling?of(e.previousSibling):ve.none();var t}function Wm(e){return Vr(e.nextSibling)?ve.some((t=e.nextSibling,Vn(t)?cs(t,0):cs.before(t))):e.nextSibling?rf(e.nextSibling):ve.none();var t}function Km(r,o){return $m(o).orThunk(function(){return Wm(o)}).orThunk(function(){return e=r,n=cs.before((t=o).previousSibling||t.parentNode),nf(e,n).fold(function(){return tf(e,cs.after(t))},ve.some);var e,t,n})}function Xm(n,r){return Wm(r).orThunk(function(){return $m(r)}).orThunk(function(){return tf(e=n,cs.after(t=r)).fold(function(){return nf(e,cs.before(t))},ve.some);var e,t})}function Ym(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})}function Gm(e,t){return t&&Ee(e.schema.getBlockElements(),kt(t))}function Jm(e){if(Kr(e)){var t=Et.fromHtml('
');return Xt(e),Ln(e,t),ve.some(cs.before(t.dom))}return ve.none()}function Qm(t,n,e,r){void 0===r&&(r=!0);var o,i,a,u,s,c,l,f,d,m,g,p,h,v,b=(p=n,h=t.getBody(),v=e.dom,(p?Xm:Km)(h,v).map(R(qm,v))),y=pr(e,R(Gm,t),(o=t.getBody(),function(e){return e.dom===o})),C=(u=b,i=a=e,s=Ee(t.schema.getTextInlineElements(),kt(i)),m=Bt(a).filter(An),g=Pt(a).filter(An),In(a),l=g,f=u,d=function(e,t,n){var r=e.dom,o=t.dom,i=r.data.length;return Vm(r,o,s),n.container()===o?cs(r,i):n},((c=m).isSome()&&l.isSome()&&f.isSome()?ve.some(d(c.getOrDie(),l.getOrDie(),f.getOrDie())):ve.none()).orThunk(function(){return s&&(m.each(function(e){return jm(e.dom,e.dom.length)}),g.each(function(e){return Hm(e.dom,0)})),u}));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):y.bind(Jm).fold(function(){r&&Ym(t,n,C)},function(e){r&&Ym(t,n,ve.some(e))})}function Zm(e){return yu(e,"td,th")}function eg(e,t){return{start:e,end:t}}function tg(e,t){return yr(Et.fromDom(e),"td,th",t)}function ng(e){return!je(e.start,e.end)}function rg(e,n){return Tl(e.start,n).bind(function(t){return Tl(e.end,n).bind(function(e){return je(t,e)?ve.some(t):ve.none()})})}function og(e){return function(t){return rg(t,e).map(function(e){return{rng:t,table:e,cells:Zm(e)}})}}function ig(e,t,n,r){if(n.collapsed||!e.forall(ng))return ve.none();if(t.isSameTable){var o=e.bind(og(r));return ve.some({start:o,end:o})}var i,a,u=tg(n.startContainer,r),s=tg(n.endContainer,r),c=u.bind((a=r,function(t){return Tl(t,a).bind(function(e){return Z(Zm(e)).map(function(e){return eg(t,e)})})})).bind(og(r)),l=s.bind((i=r,function(t){return Tl(t,i).bind(function(e){return Q(Zm(e)).map(function(e){return eg(e,t)})})})).bind(og(r));return ve.some({start:c,end:l})}function ag(e,t){return z(e,function(e){return je(e,t)})}function ug(n){return dn(ag(n.cells,n.rng.start),ag(n.cells,n.rng.end),function(e,t){return n.cells.slice(e,t+1)})}function sg(e,t){var n=t.startTable,r=t.endTable,o=e.cloneRange();return n.each(function(e){return o.setStartAfter(e.dom)}),r.each(function(e){return o.setEndBefore(e.dom)}),o}function cg(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b=(n=e,function(e){return je(n,e)}),y=dn(tg((r=t).startContainer,o=b),tg(r.endContainer,o),eg),C=(l=b,f=x((c=t).startContainer),d=x(c.endContainer),m=f.isSome(),g=d.isSome(),p=dn(f,d,je).getOr(!1),{startTable:f,endTable:d,isStartInTable:m,isEndInTable:g,isSameTable:p,isMultiTable:!p&&m&&g});function x(e){return Tl(Et.fromDom(e),l)}return h=t,v=b,y.exists(function(e){return!ng(t=e)&&rg(t,v).exists(function(e){var t=e.dom.rows;return 1===t.length&&1===t[0].cells.length})&&Ol(e.start,h);var t})?y.map(function(e){return fp.singleCellTable(t,e.start)}):C.isMultiTable?ig(y,u=C,s=t,b).bind(function(e){var t=e.start,n=e.end,r=t.bind(ug).getOr([]),o=n.bind(ug).getOr([]);if(0)?$/," "):i.replace(/ (
)?$/," "));var c=e.parser,l=n.merge,f=rm({validate:e.getParam("validate")},e.schema),d='',m=e.fire("BeforeSetContent",{content:t,format:"html",selection:!0,paste:n.paste});if(m.isDefaultPrevented())e.fire("SetContent",{content:m.content,format:"html",selection:!0,paste:n.paste});else{t=m.content,-1===(t=n.preserve_zwsp?t:Eo(t)).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);var g,p,h=(g=u.getRng()).startContainer||(g.parentElement?g.parentElement():null),v=e.getBody();h===v&&u.isCollapsed()&&s.isBlock(v.firstChild)&&((p=v.firstChild)&&!e.schema.getShortEndedElements()[p.nodeName])&&s.isEmpty(v.firstChild)&&((g=s.createRng()).setStart(v.firstChild,0),g.setEnd(v.firstChild,0),u.setRng(g)),u.isCollapsed()||function(e){var t=e.dom,n=Cg(e.selection.getRng());e.selection.setRng(n);var r,o=t.getParent(n.startContainer,hp),i=n;null!==(r=o)&&r===t.getParent(i.endContainer,hp)&&Ol(Et.fromDom(r),i)?mp(e,n,Et.fromDom(o)):e.getDoc().execCommand("Delete",!1,null)}(e);var b,y,C,x,w,S,N,E,k,_,A,R,D,T,O={context:(I=u.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},B=c.parse(t,O);if(!0===n.paste&&xg(e.schema,B)&&Sg(s,I))return g=Eg(f,s,u.getRng(),B),u.setRng(g),void e.fire("SetContent",m);if(function(){for(var e=B;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(),"mce_marker"===(L=B.lastChild).attr("id"))for(var P=L,L=L.prev;L;L=L.walk(!0))if(3===L.type||!s.isBlock(L.name)){e.schema.isValidChild(L.parent.name,"span")&&L.parent.insert(P,L,"br"===L.name);break}if(e._selectionOverrides.showBlockCaretContainer(I),O.invalid){e.selection.setContent(d);var I=u.getNode(),M=e.getBody();for(9===I.nodeType?I=L=M:L=I;L!==M;)L=(I=L).parentNode;t=I===M?M.innerHTML:s.getOuterHTML(I),t=f.serialize(c.parse(t.replace(//i,function(){return f.serialize(B)}))),I===M?s.setHTML(M,t):s.setOuterHTML(I,t)}else b=e,y=t=f.serialize(B),"all"===(C=I).getAttribute("data-mce-bogus")?C.parentNode.insertBefore(b.dom.createFragment(y),C):(x=C.firstChild,w=C.lastChild,!x||x===w&&"BR"===x.nodeName?b.dom.setHTML(C,y):b.selection.setContent(y));N=l,_=(S=e).schema.getTextInlineElements(),A=S.dom,N&&(E=S.getBody(),k=tm(A),Nt.each(A.select("*[data-mce-fragment]"),function(e){if(V(_[e.nodeName.toLowerCase()])&&j(lm(A,e),function(e){return!cm.has(e)}))for(var t=e.parentNode;V(t)&&t!==E&&!function(r,o,i){function a(e){var t=r.getStyle(o,e),n=r.getStyle(i,e);return Be(t)&&Be(n)&&t!==n}var e=lm(r,o),u=lm(r,i);return F(e,function(t){function e(e){return F(e,function(e){return e===t})}if(e(u)||!e(Xg))return a(t);var n=U(u,function(t){return F(Xg,function(e){return Ge(t,e)})});return F(n,a)})}(A,e,t);t=t.parentNode)if(k.compare(t,e)){A.remove(e,!0);break}})),function(n,e){var t,r=n.dom,o=n.selection;if(e){o.scrollIntoView(e);var i=bf(n.getBody(),e);if("false"===r.getContentEditable(i))return r.remove(e),o.select(i);var a,u=r.createRng(),s=e.previousSibling;Vn(s)?(u.setStart(s,s.nodeValue.length),xt.ie||(a=e.nextSibling,Vn(a)&&(s.appendData(a.data),a.parentNode.removeChild(a)))):(u.setStartBefore(e),u.setEndBefore(e));var c=r.getParent(e,r.isBlock);r.remove(e),c&&r.isEmpty(c)&&(n.$(c).empty(),u.setStart(c,0),u.setEnd(c,0),hp(c)||c.getAttribute("data-mce-fragment")||!(t=function(e){var t=cs.fromRangeStart(e);if(t=Mc(n.getBody()).next(t))return t.toRange()}(u))?r.add(c,r.create("br",{"data-mce-bogus":"1"})):(u=t,r.remove(c))),o.setRng(u)}}(e,s.get("mce_marker")),R=e.getBody(),Nt.each(R.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),D=s,T=u.getStart(),ve.from(D.getParent(T,"td,th")).map(Et.fromDom).each(vm),e.fire("SetContent",m),e.addVisual()}}function _g(e){return e instanceof jd}function Ag(e,t,n){var r;e.dom.setHTML(e.getBody(),t),!0!==n&&Cd(r=e)&&rf(r.getBody()).each(function(e){var t=e.getNode(),n=cn(t)?rf(t).getOr(e):e;r.selection.setRng(n.toRange())})}function Rg(u,s,e){var t,n=(t=s,_e(_e({format:"html"},e),{set:!0,content:_g(t)?"":t})),c=e.no_events?n:u.fire("BeforeSetContent",n);return _g(s)||(s=c.content),ve.from(u.getBody()).fold(J(s),function(e){return _g(s)?function(e,t,n,r){var o,i,u,a;o=e.parser.getNodeFilters(),i=e.parser.getAttributeFilters(),u=n,a=function(e,n){var t,r,o={},i={},a=[];for(t in u.firstChild&&vp(u.firstChild,function(t){Y(e,function(e){e.name===t.name&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})}),Y(n,function(e){"string"==typeof t.attr(e.name)&&(i[e.name]?i[e.name].nodes.push(t):i[e.name]={filter:e,nodes:[t]})})}),o)Ee(o,t)&&a.push(o[t]);for(r in i)Ee(i,r)&&a.push(i[r]);return a}(o,i),Y(a,function(t){Y(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})});var s=rm({validate:e.validate},e.schema).serialize(n);return r.content=Eo(Co(Et.fromDom(t))?s:Nt.trim(s)),Ag(e,r.content,r.no_selection),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=Eo(r=s)).length||/^\s+$/.test(r)?(i='
',"TABLE"===n.nodeName?r=""+i+" |
":/^(UL|OL)$/.test(n.nodeName)&&(r=""+i+""),r=(a=ks(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),a.toLowerCase())?(r=i,t.dom.createHTML(a,_s(t),r)):r||'
',Ag(t,r,o.no_selection),t.fire("SetContent",o)):("raw"!==o.format&&(r=rm({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=Co(Et.fromDom(n))?r:Nt.trim(r),Ag(t,o.content,o.no_selection),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})}function Dg(e){return y(e)?e:D}function Tg(i,e,t){var n=e(i),a=Dg(t);return n.orThunk(function(){return a(i)?ve.none():function(e){for(var t=i.dom,n=Dg(a);t.parentNode;){var t=t.parentNode,r=Et.fromDom(t),o=e(r);if(o.isSome())return o;if(n(r))break}return ve.none()}(e)})}function Og(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o=o.nodeValue.length&&(o=new Dr(o,e.getBody()).next()||o),Vn(o)&&!n&&0===i&&new Dr(o,e.getBody()).prev()||o}function Bp(e,t){var n=t?"firstChild":"lastChild";if(/^(TR|TH|TD)$/.test(e.nodeName)&&e[n]){var r=e[n];return"TR"===e.nodeName&&r[n]||r}return e}function Pp(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o}function Lp(e,t,n,r,o){var i=Et.fromDom(t),a=Et.fromDom(e.create(r,o));return Kt(a,(n?It:Lt)(i)),n?(qt(i,a),Wt(a,i)):($t(i,a),Ln(a,i)),a.dom}function Ip(e,t,n,r){var o=rl(t,n,r);return K(o)||"BR"===o.nodeName||e.isBlock(o)}function Mp(e,r,o,t,i){var n,a,u=e.dom,s=u,c=t;if(!(pl(a=r)&&Rh(c,a.inline)||ml(a)&&Rh(c,a.block)||gl(a)&&(Hn(c)&&s.is(c,a.selector))||r.links&&"A"===t.nodeName))return kh.keep();var l,f,d,m,g,p,h,v,b=t;if(pl(r)&&"all"===r.remove&&S(r.preserve_attributes)){var y=U(u.getAttribs(b),function(e){return T(r.preserve_attributes,e.name.toLowerCase())});if(u.removeAllAttribs(b),Y(y,function(e){return u.setAttrib(b,e.name,e.value)}),0e?t.cells.length:e},0)}function Gp(e,t){for(var n=e.rows,r=0;rc){for(var l=0;l]*>( | |\\s|\xa0|
|)<\\/"+u+">[\r\n]*|
[\r\n]*)$"),a.replace(s,"")),T(["text","tree"],l.format)||Co(Et.fromDom(r))?l.content=f:l.content=Nt.trim(f),(l.no_events?l:t.fire("GetContent",l)).content;var t,n,r,o,i,a,u,s,c,l,f});var d,m,g},setContent:function(e,t){return Rg(c,e,t)},insertContent:function(e,t){return kg(c,e,t)},addVisual:function(e){var i,t=e,a=(i=c).dom,n=V(t)?t:i.getBody();b(i.hasVisual)&&(i.hasVisual=i.getParam("visual",!0,"boolean")),Y(a.select("table,a",n),function(e){switch(e.nodeName){case"TABLE":var t=i.getParam("visual_table_class","mce-item-table","string"),n=a.getAttrib(e,"border");n&&"0"!==n||!i.hasVisual?a.removeClass(e,t):a.addClass(e,t);break;case"A":var r,o;a.getAttrib(e,"href")||(r=a.getAttrib(e,"name")||e.id,o=i.getParam("visual_anchor_class","mce-item-anchor","string"),r&&i.hasVisual?a.addClass(e,o):a.removeClass(e,o))}}),i.fire("VisualAid",{element:t,hasVisual:i.hasVisual})}},selection:{getContent:function(e,t){return function(e,t,n){var r,o=(r=t,_e(_e({},n=void 0===n?{}:n),{format:r,get:!0,selection:!0})),i=e.fire("BeforeGetContent",o);if(i.isDefaultPrevented())return e.fire("GetContent",i),i.content;if("text"===i.format)return m=e,ve.from(m.selection.getRng()).map(function(e){var t=ve.from(m.dom.getParent(e.commonAncestorContainer,m.dom.isBlock)),n=m.getBody(),r=t.map(function(e){return e.nodeName}).getOr("div").toLowerCase(),o=xt.browser.isIE()&&"pre"!==r,i=m.dom.add(n,r,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),a=oh(i,o),u=Eo(i.textContent);if(m.dom.remove(i),rh(u,0)||rh(u,u.length-1)){var s=oh(t.getOr(n),o),c=s.indexOf(a);return-1===c?a:(rh(s,c-1)?" ":"")+a+(rh(s,c+a.length)?" ":"")}return a}).getOr("");i.getInner=!0;var a,u,s,c,l,f,d,m,g=(u=i,s=(a=e).selection.getRng(),c=a.dom.create("body"),l=a.selection.getSel(),f=Ed(a,Al(l)),(d=u.contextual?nh(Et.fromDom(a.getBody()),f).dom:s.cloneContents())&&c.appendChild(d),a.selection.serializer.serialize(c,u));return"tree"===i.format?g:(i.content=e.selection.isCollapsed()?"":g,e.fire("GetContent",i),i.content)}(c,e,t)}},raw:{getModel:function(){return ve.none()}}}}function hh(e){return Ee(e.plugins,"rtc")}function vh(e){var u=e;return ue(e.plugins,"rtc").bind(function(e){return ve.from(e.setup)}).fold(function(){return u.rtcInstance=ph(e),ve.none()},function(e){var t,n;return u.rtcInstance=(t=J(null),n=J(""),{undoManager:{beforeChange:te,add:t,undo:t,redo:t,clear:te,reset:te,hasUndo:D,hasRedo:D,transact:t,ignore:te,extra:te},formatter:{match:D,matchAll:J([]),matchNode:J(void 0),canApply:D,closest:n,apply:te,remove:te,toggle:te,formatChanged:J({unbind:te})},editor:{getContent:n,setContent:n,insertContent:te,addVisual:te},selection:{getContent:n},raw:{getModel:J(ve.none())}}),ve.some(function(){return e().then(function(e){return u.rtcInstance=(i=e.undoManager,a=e.formatter,n=e.editor,r=e.selection,t=e.raw,{undoManager:{beforeChange:i.beforeChange,add:i.add,undo:i.undo,redo:i.redo,clear:i.clear,reset:i.reset,hasUndo:i.hasUndo,hasRedo:i.hasRedo,transact:function(e,t,n){return i.transact(n)},ignore:function(e,t){return i.ignore(t)},extra:function(e,t,n,r){return i.extra(n,r)}},formatter:{match:function(e,t,n,r){return a.match(e,o(t),r)},matchAll:a.matchAll,matchNode:a.matchNode,canApply:function(e){return a.canApply(e)},closest:function(e){return a.closest(e)},apply:function(e,t,n){return a.apply(e,o(t))},remove:function(e,t,n,r){return a.remove(e,o(t))},toggle:function(e,t,n){return a.toggle(e,o(t))},formatChanged:function(e,t,n,r,o){return a.formatChanged(t,n,r,o)}},editor:{getContent:function(e,t){return n.getContent(e)},setContent:function(e,t){return n.setContent(e,t)},insertContent:function(e,t){return n.insertContent(e)},addVisual:n.addVisual},selection:{getContent:function(e,t){return r.getContent(t)}},raw:{getModel:function(){return ve.some(t.getRawModel())}}}),e.rtc.isRemote;function o(e){return h(e)?e:{}}var i,a,n,r,t})})})}function bh(e){return e.rtcInstance||ph(e)}function yh(e){var t=e.rtcInstance;if(t)return t;throw new Error("Failed to get RTC instance not yet initialized.")}function Ch(e){return 0===e.dom.length?(In(e),ve.none()):ve.some(e)}function xh(e,t,u,s){e.bind(function(a){return(s?jm:Hm)(a.dom,s?a.dom.length:0),t.filter(An).map(function(e){var t=u,n=s,r=a.dom,o=e.dom,i=(n?r:o).length;n?(Vm(r,o,!1,!n),t.setStart(o,i)):(Vm(o,r,!1,!n),t.setEnd(o,i))})}).orThunk(function(){var e=s;return t.filter(function(e){return Hl.isBookmarkNode(e.dom)}).bind(e?Pt:Bt).or(t).filter(An).map(function(e){var n,r=s;Ot(n=e).each(function(e){var t=n.dom;r&&Bm(e,cs(t,0))?Hm(t,0):!r&&Pm(e,cs(t,t.length))&&jm(t,t.length)})})})}function wh(e,t,n){var r,o=(r=t,_e(_e({format:"html"},n=void 0===n?{}:n),{set:!0,selection:!0,content:r})),i=o;if(!o.no_events){var a=e.fire("BeforeSetContent",o);if(a.isDefaultPrevented())return void e.fire("SetContent",a);i=a}i.content=function(e,t){if("raw"===t.format)return t.content;var n=e.selection.getRng(),r=e.dom.getParent(n.commonAncestorContainer,e.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=e.parser.parse(t.content,_e(_e({isRootContent:!0,forced_root_block:!1},o),t));return rm({validate:e.validate},e.schema).serialize(i)}(e,i);var u=e.selection.getRng();!function(e,t){var n=ve.from(t.firstChild).map(Et.fromDom),r=ve.from(t.lastChild).map(Et.fromDom);e.deleteContents(),e.insertNode(t);var o=n.bind(Bt).filter(An).bind(Ch),i=r.bind(Pt).filter(An).bind(Ch);xh(o,n,e,!0),xh(i,r,e,!1),e.collapse(!1)}(u,u.createContextualFragment(i.content)),e.selection.setRng(u),nd(e,u),i.no_events||e.fire("SetContent",i)}function Sh(e,t,n){var r;e&&Ee(e,t)&&(0===(r=U(e[t],function(e){return e!==n})).length?delete e[t]:e[t]=r)}Kg=function(e){var t,n=e.selection.getRng(),r=on(["pre"]);n.collapsed||(t=e.selection.getSelectedBlocks(),Np(Sp(Sp(t,r),function(e){return r(e.previousSibling)&&-1!==de(t,e.previousSibling)}),function(e){var t,n=e.previousSibling;Ya(t=e).remove(),Ya(n).append("
").append(t.childNodes)}))},wp["pre"]||(wp.pre=[]),wp.pre.push(Kg);var Nh=Nt.each,Eh=function(e,t,n){Nh(e.childNodes,function(e){Ep(e)&&(t(e)&&n(e),e.hasChildNodes()&&Eh(e,t,n))})},kh=ir([{keep:[]},{rename:["name"]},{removed:[]}]),_h=/^(src|href|style)$/,Ah=Nt.each,Rh=ul,Dh=Nt.each,Th=Nt.each,Oh=function(S,N,E,r){function k(n,e){var t;y((e=void 0===e?A:e).onformat)&&e.onformat(n,e,E,r),Th(e.styles,function(e,t){u.setStyle(n,t,al(e,E))}),!e.styles||(t=u.getAttrib(n,"style"))&&u.setAttrib(n,"data-mce-style",t),Th(e.attributes,function(e,t){u.setAttrib(n,t,al(e,E))}),Th(e.classes,function(e){e=al(e,E),u.hasClass(n,e)||u.addClass(n,e)})}function g(e,t){var n=!1;return Th(e,function(e){return!!gl(e)&&(V(e.collapsed)&&e.collapsed!==a||!u.is(t,e.selector)||Vc(t)?void 0:(k(t,e),!(n=!0)))}),n}function o(x,e,l){var w=[],f=!0,d=A.inline||A.block,m=function(e){if(X(e)){var t=u.create(e);return k(t),t}return null}(d);_l(x,e,function(e){var s,c=function(e){var t=!1,n=f,r=e.nodeName.toLowerCase(),o=e.parentNode,i=o.nodeName.toLowerCase();if(Hn(e)&&x.getContentEditable(e)&&(n=f,f="true"===x.getContentEditable(e),t=!0),Kn(e)&&!function(e,t,n,r){if(e.getParam("format_empty_lines",!1,"boolean")&&pl(t)){var o=no(e.schema),i=(a=Et.fromDom(n),s=function(e){return Vc(e.dom)},((c=(u=a).dom).parentNode?kr(Et.fromDom(c.parentNode),function(e){return!je(u,e)&&s(e)}):ve.none()).isSome());return se(o,r)&&Kr(Et.fromDom(n.parentNode),!1)&&!i}var a,u,s,c}(S,A,e,i))return s=null,void(ml(A)&&x.remove(e));if(ml(A)&&A.wrapper&&yp(S,e,N,E))s=null;else{if(f&&!t&&ml(A)&&!A.wrapper&&ol(S,r)&&il(S,i,d)){var a=x.rename(e,d);return k(a),w.push(a),void(s=null)}if(gl(A)){var u=g(_,e);if(!u&&V(o)&&hl(A)&&(u=g(_,o)),!pl(A)||u)return void(s=null)}!f||t||!il(S,d,r)||!il(S,i,d)||!l&&Vn(e)&&No(e.data)||Vc(e)||pl(A)&&x.isBlock(e)?(s=null,Y(xe(e.childNodes),c),t&&(f=n),s=null):(s||(s=x.clone(m,!1),e.parentNode.insertBefore(s,e),w.push(s)),s.appendChild(e))}};Y(e,c)}),!0===A.links&&Y(w,function(e){var t=function(e){"A"===e.nodeName&&k(e,A),Y(xe(e.childNodes),t)};t(e)}),Y(w,function(e){var n,t,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y=(n=0,Y(e.childNodes,function(e){var t;V(t=e)&&Vn(t)&&0===t.length||Qc(e)||n++}),n);function C(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=ll(m,e.parentNode),m.getStyle(e,"color")&&t?m.setStyle(e,"text-decoration",t):m.getStyle(e,"text-decoration")===t&&m.setStyle(e,"text-decoration",null))}!(1t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){V(e)?(s.inline?Zf:td)(s,e,t):nd(s,p(),t)},placeCaretAt:function(e,t){return h(Ef(e,t,s.getDoc()))},getBoundingClientRect:function(){var e=p();return e.collapsed?cs.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){u=l=f=null,y.destroy()}},b=Hl(v),y=Sf(v,s);function C(t,e){return M(e,function(e){return o.is(e,t)})}function x(e){return o.getParents(e,null,o.getRoot())}return v.bookmarkManager=b,v.controlSelection=y,v}function Uh(e,t){var n,r,a,u,o=ao();t.convert_fonts_to_spans&&(r=e,a=o,u=Nt.explode(t.font_size_legacy_values),r.addNodeFilter("font",function(e){Y(e,function(e){var t,n=a.parse(e.attr("style")),r=e.attr("color"),o=e.attr("face"),i=e.attr("size");r&&(n.color=r),o&&(n["font-family"]=o),i&&(n["font-size"]=u[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",a.serialize(n)),t=e,Y(["color","face","size"],function(e){t.attr(e,null)})})})),n=o,e.addNodeFilter("strike",function(e){Y(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})}function zh(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return{type:t=r?r[1]:t,data:n[1]}}function Hh(e,t){var n;try{n=atob(t)}catch(e){return ve.none()}for(var r=new Uint8Array(n.length),o=0;o=u.length)for(n=0,r=a.length;n=u.length||a[n]!==u[n]){o=n+1;break}if(a.length=a.length||a[n]!==u[n]){o=n+1;break}if(1===o)return t;for(n=0,r=a.length-(o-1);n]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,i=e.getShortEndedElements(),a=1,u=n;0!==a;)for(r.lastIndex=u;;){var s=r.exec(t);if(null===s)return u;if("!"===s[1]){u=Ge(s[2],"--")?sv(t,!1,s.index+"!--".length):sv(t,!0,s.index+1);break}o.lastIndex=r.lastIndex;var c=o.exec(t);if(!l(c)&&c.index===r.lastIndex){"/"===s[1]?--a:Ee(i,s[2])||(a+=1),u=r.lastIndex+c[0].length;break}}return u}function iv(q,$){void 0===$&&($=oo()),q=q||{};var W=uv(),K=W.createElement("form");function n(s,e){void 0===e&&(e="html");for(var t,i,n,c,r,o,a,l,u,f,d,m,g,p,h,v,b,y,C,x=s.html,w=0,S=[],N=0,E=Zo.decode,k=Nt.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),_="html"===e?0:1,A=function(e){for(var t,n=S.length;n--&&S[n].name!==e;);if(0<=n){for(t=S.length-1;n<=t;t--)(e=S[t]).valid&&Q(e.name);S.length=n}},R=function(e,t){return G($h(e,s),t)},D=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),q.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),X($h(e,s)))},T=function(e,t){var n=e||"",r=!Ge(n,"--"),o=sv(x,r,t);return e=x.substr(t,o-t),D(r?n+e:e),o+1},O=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^'\">]+(?:\"[^\"]*\"|'[^']*'))*[^\"'>]*(?:\"[^\">]*|'[^'>]*)?|\\s*|\\/)>))","g"),B=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,P=$.getShortEndedElements(),L=q.self_closing_elements||$.getSelfClosingElements(),I=$.getBoolAttrs(),M=q.validate,F=q.remove_internals,U=q.fix_self_closing,z=$.getSpecialElements(),H=x+">";t=O.exec(H);){var j=t[0];if(wx.length){R(E(x.substr(t.index))),w=t.index+j.length;continue}u=(i=":"===(i=i.toLowerCase()).charAt(0)?i.substr(1):i)in P,U&&L[i]&&0.*/.test(r.substr(u)))){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(t){var i=r.indexOf(">",n);return-1!==i?i:r.length}var a=/--!?>/g;a.lastIndex=n;var u,s=a.exec(e);return s?s.index+s[0].length:r.length};function cv(A,R){void 0===R&&(R=oo());var D={},T=[],O={},B={};(A=A||{}).validate=!("validate"in A)||A.validate,A.root_name=A.root_name||"body";function P(e){var t=e.name;t in D&&((r=O[t])?r.push(e):O[t]=[e]);for(var n=T.length;n--;){var r,o=T[n].name;o in e.attributes.map&&((r=B[o])?r.push(e):B[o]=[e])}return e}var e={schema:R,addAttributeFilter:function(e,n){Rv(Dv(e),function(e){for(var t=0;t)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")},r=e.length;r--;){var o,i=e[r],a=i.firstChild?i.firstChild.value:"";"script"===t?((o=i.attr("type"))&&i.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0")):"xhtml"===s.element_format&&0)\s*/g,"$1"),Nt.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=Nt.map(e.split(/(?:~\+|~|\+)/),fb),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[],f=l.length?(l[0].name||(l[0].name=c),c=e.selector,lb(l,n)):lb([c],n),d=Ay.select(c,f)[0]||f.firstChild;return _y(e.styles,function(e,t){var n=a(e);n&&Ay.setStyle(d,t,n)}),_y(e.attributes,function(e,t){var n=a(e);n&&Ay.setAttrib(d,t,n)}),_y(e.classes,function(e){var t=a(e);Ay.hasClass(d,t)||Ay.addClass(d,t)}),n.fire("PreviewFormats"),Ay.setStyles(f,{position:"absolute",left:-65535}),n.getBody().appendChild(f),r=Ay.getStyle(n.getBody(),"fontSize",!0),r=/px$/.test(r)?parseInt(r,10):0,_y(i.split(" "),function(e){var t=Ay.getStyle(d,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=Ay.getStyle(n.getBody(),e,!0),"#ffffff"===Ay.toHex(t).toLowerCase())||"color"===e&&"#000000"===Ay.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===r)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*r+"px"}"border"===e&&t&&(o+="padding:0 2px;"),o+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),Ay.remove(f),o}function mb(c){var e,r,t,n,o,i,a=(n={},(o=function(e,t){e&&(X(e)?(Y(t=!S(t)?[t]:t,function(e){b(e.deep)&&(e.deep=!gl(e)),b(e.split)&&(e.split=!gl(e)||pl(e)),b(e.remove)&&gl(e)&&!pl(e)&&(e.remove="none"),gl(e)&&pl(e)&&(e.mixed=!0,e.block_expand=!0),X(e.classes)&&(e.classes=e.classes.split(/\s+/))}),n[e]=t):ne(e,function(e,t){o(t,e)}))})((r=(e=c).dom,t={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",defaultBlock:"p",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(e,t,n){return Hn(e)&&e.hasAttribute("href")},onformat:function(n,e,t){Nt.each(t,function(e,t){r.setAttrib(n,t,e)})}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":function(e){var t;return null!==(t=null==e?void 0:e.customValue)&&void 0!==t?t:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]},Nt.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),function(e){t[e]={block:e,remove:"all"}}),t)),o(e.getParam("formats")),{get:function(e){return V(e)?n[e]:n},has:function(e){return Ee(n,e)},register:o,unregister:function(e){return e&&n[e]&&delete n[e],n}}),l=au(null);return function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])}(c),(i=c).on("mouseup keydown",function(e){var t=i,n=e.keyCode,r=t.selection,o=t.getBody();Hg(t,null,!1),8!==n&&46!==n||!r.isCollapsed()||r.getStart().innerHTML!==Cp||Hg(t,qc(o,r.getStart())),37!==n&&39!==n||Hg(t,qc(o,r.getStart()))}),{get:a.get,has:a.has,register:a.register,unregister:a.unregister,apply:function(e,t,n){var r=e,o=t,i=n;yh(c).formatter.apply(r,o,i)},remove:function(e,t,n,r){var o=e,i=t,a=n,u=r;yh(c).formatter.remove(o,i,a,u)},toggle:function(e,t,n){var r=e,o=t,i=n;yh(c).formatter.toggle(r,o,i)},match:function(e,t,n,r){return o=e,i=t,a=n,u=r,yh(c).formatter.match(o,i,a,u);var o,i,a,u},closest:function(e){return t=e,yh(c).formatter.closest(t);var t},matchAll:function(e,t){return n=e,r=t,yh(c).formatter.matchAll(n,r);var n,r},matchNode:function(e,t,n,r){return o=e,i=t,a=n,u=r,yh(c).formatter.matchNode(o,i,a,u);var o,i,a,u},canApply:function(e){return t=e,yh(c).formatter.canApply(t);var t},formatChanged:function(e,t,n,r){return o=l,i=e,a=t,u=n,s=r,yh(c).formatter.formatChanged(o,i,a,u,s);var o,i,a,u,s},getCssText:R(db,c)}}function gb(e){switch(e.toLowerCase()){case"undo":case"redo":case"mcerepaint":case"mcefocus":return 1;default:return}}function pb(s){var e,n,r,o,i,c=du(),l=au(0),f=au(0),d={data:[],typing:!1,beforeChange:function(){var e=l,t=c;yh(s).undoManager.beforeChange(e,t)},add:function(e,t){return n=d,r=f,o=l,i=c,a=e,u=t,yh(s).undoManager.add(n,r,o,i,a,u);var n,r,o,i,a,u},undo:function(){return e=d,t=l,n=f,yh(s).undoManager.undo(e,t,n);var e,t,n},redo:function(){return e=f,t=d.data,yh(s).undoManager.redo(e,t);var e,t},clear:function(){var e=d,t=f;yh(s).undoManager.clear(e,t)},reset:function(){var e=d;yh(s).undoManager.reset(e)},hasUndo:function(){return e=d,t=f,yh(s).undoManager.hasUndo(e,t);var e,t},hasRedo:function(){return e=d,t=f,yh(s).undoManager.hasRedo(e,t);var e,t},transact:function(e){return t=d,n=l,r=e,yh(s).undoManager.transact(t,n,r);var t,n,r},ignore:function(e){var t=l,n=e;yh(s).undoManager.ignore(t,n)},extra:function(e,t){var n=d,r=f,o=e,i=t;yh(s).undoManager.extra(n,r,o,i)}};return hh(s)||(r=d,o=l,i=au(!1),(n=s).on("init",function(){r.add()}),n.on("BeforeExecCommand",function(e){gb(e.command)||(gh(r,o),r.beforeChange())}),n.on("ExecCommand",function(e){gb(e.command)||a(e)}),n.on("ObjectResizeStart cut",function(){r.beforeChange()}),n.on("SaveContent ObjectResized blur",a),n.on("dragend",a),n.on("keyup",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),n.nodeChanged()),46!==t&&8!==t||n.nodeChanged(),i.get()&&r.typing&&!1===fh(uh(n),r.data[0])&&(!1===n.isDirty()&&(n.setDirty(!0),n.fire("change",{level:r.data[0],lastLevel:null})),n.fire("TypingUndo"),i.set(!1),n.nodeChanged()))}),n.on("keydown",function(e){var t,n=e.keyCode;e.isDefaultPrevented()||(33<=n&&n<=36||37<=n&&n<=40||45===n?r.typing&&a(e):(t=e.ctrlKey&&!e.altKey||e.metaKey,!(n<16||20t}}function o0(t){return function(e){return e.line===t}}function i0(e,t){return Math.abs(e.left-t)}function a0(e,t){return Math.abs(e.right-t)}function u0(e,t){return e>=t.left&&e<=t.right}function s0(e,t){return e>=t.top&&e<=t.bottom}function c0(e,o,i){return void 0===i&&(i=w),me(e,function(e,t){if(u0(o,t))return i(t)?t:e;if(u0(o,e))return i(e)?e:t;var n=Math.min(i0(e,o),a0(e,o)),r=Math.min(i0(t,o),a0(t,o));return r===n&&se(t,"node")&&ZC(t.node)||r'),o=i,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse()))}function $0(t,e){return n=t,r=e?sc.Forwards:sc.Backwards,o=n.selection.getRng(),g0(n,r,o,rp,op,i1).orThunk(function(){return q0(n,r,o),ve.none()}).exists(function(e){return d0(t,e),!0});var n,r,o}function W0(t,e){return r=e?1:-1,o=(n=t).selection.getRng(),p0(n,r,o,function(e){return rp(e)||tp(e)},function(e){return op(e)||np(e)},i1).orThunk(function(){return q0(n,r,o),ve.none()}).exists(function(e){return d0(t,e),!0});var n,r,o}function K0(e,t){return h0(e,t,t?op:rp)}function X0(e){return T(["figcaption"],kt(e))}function Y0(e){var t=document.createRange();return t.setStartBefore(e.dom),t.setEndBefore(e.dom),t}function G0(e,t,n){(n?Ln:Wt)(e,t)}function J0(h,v){var b=Et.fromDom(h.getBody()),y=cs.fromRangeStart(h.selection.getRng()),C=ks(h),x=_s(h),e=y,t=R(je,b);return hr(Et.fromDom(e.container()),go,t).filter(X0).exists(function(){if(d=b,m=y,v?(p=d.dom,Zy(p,m).breakAt.isNone()):(g=d.dom,Qy(g,m).breakAt.isNone())){var e=(t=b,r=x,o=v,""===(n=C)?(l=o,G0(t,f=Et.fromTag("br"),l),Y0(f)):(i=t,a=o,u=r,s=Et.fromTag(n),c=Et.fromTag("br"),hn(s,u),Ln(s,c),G0(i,s,a),Y0(c)));return h.selection.setRng(e),!0}var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p;return!1})}function Q0(e,t){return!!e.selection.isCollapsed()&&J0(e,t)}function Z0(e){for(var t=[],n=1;n'}function yC(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t}function CC(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)}function xC(e,t,n){return!1===Vn(t)?n:e?1===n&&t.data.charAt(n-1)===So?0:n:n===t.data.length-1&&t.data.charAt(n)===So?t.data.length:n}function wC(e,t){for(var n,r=e.getRoot(),o=t;o!==r&&"false"!==e.getContentEditable(o);)"true"===e.getContentEditable(o)&&(n=o),o=o.parentNode;return o!==r?n:r}function SC(e,t){var n=ks(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&function(e,o,t){var i=e.dom;ve.from(t.style).map(i.parseStyle).each(function(e){var t=Nn(Et.fromDom(o)),n=_e(_e({},t),e);i.setStyles(o,n)}),dn(ve.from(t.class).map(function(e){return e.split(/\s+/)}),ve.from(o.className).map(function(e){return U(e.split(/\s+/),function(e){return""!==e})}),function(t,e){var n=U(e,function(e){return!T(t,e)}),r=Ae(Ae([],t,!0),n,!0);i.setAttrib(o,"class",r.join(" "))});var n=["style","class"],r=ae(t,function(e,t){return!T(n,t)});i.setAttribs(o,r)}(e,t,_s(e))}function NC(a,e){function t(e){var t,n=m,r=l.getTextInlineElements(),o=e||"TABLE"===C||"HR"===C?c.create(e||p):b.cloneNode(!1),i=o;if(!1===a.getParam("keep_styles",!0))c.setAttrib(o,"style",null),c.setAttrib(o,"class",null);else for(;r[n.nodeName]&&(Vc(n)||Qc(n)||(t=n.cloneNode(!1),c.setAttrib(t,"id",""),o.hasChildNodes()?t.appendChild(o.firstChild):i=t,o.appendChild(t))),(n=n.parentNode)&&n!==F;);return SC(a,o),bC(i),o}function n(e){var t,n,r=xC(e,m,g);if(!Vn(m)||!(e?0m.childNodes.length-1,m=m.childNodes[Math.min(g,m.childNodes.length-1)]||m,g=s&&Vn(m)?m.nodeValue.length:0);var b,y,C,x,w,S,p,N,E,k,_,A,R,D,T,O,B,P,L,I,M,F=wC(c,m);F&&((p&&!h||!p&&h)&&(m=function(e,t,n,r){var o,i,a,u,s,c,l=p||"P",f=e.dom,d=wC(f,n),m=f.getParent(n,f.isBlock);if(!m||!CC(f,m)){if(s=((m=m||d)===e.getBody()||(c=m)&&/^(TD|TH|CAPTION)$/.test(c.nodeName)?m:m.parentNode).nodeName.toLowerCase(),!m.hasChildNodes())return SC(e,o=f.create(l)),m.appendChild(o),t.setStart(o,0),t.setEnd(o,0),o;for(a=n;a.parentNode!==m;)a=a.parentNode;for(;a&&!f.isBlock(a);)a=(i=a).previousSibling;if(i&&e.schema.isValidChild(s,l.toLowerCase())){for(SC(e,o=f.create(l)),i.parentNode.insertBefore(o,i),a=i;a&&!f.isBlock(a);)u=a.nextSibling,o.appendChild(a),a=u;t.setStart(n,r),t.setEnd(n,r)}}return n}(a,d,m,g)),y=(b=c.getParent(m,c.isBlock))?c.getParent(b.parentNode,c.isBlock):null,C=b?b.nodeName.toUpperCase():"","LI"!==(x=y?y.nodeName.toUpperCase():"")||v||(y=(b=y).parentNode,C=x),/^(LI|DT|DD)$/.test(C)&&c.isEmpty(b)?(E=t,k=y,_=b,A=p,I=(N=a).dom,M=N.selection.getRng(),k!==N.getBody()&&(D=(A=pC(R=k)&&pC(R.parentNode)?"LI":A)?E(A):I.create("BR"),vC(k,_,!0)&&vC(k,_,!1)?gC(k,"LI")?(T=hC(k),I.insertAfter(D,T),(null===(L=(P=k).parentNode)||void 0===L?void 0:L.firstChild)===P?I.remove(T):I.remove(k)):I.replace(D,k):(vC(k,_,!0)?gC(k,"LI")?(I.insertAfter(D,hC(k)),D.appendChild(I.doc.createTextNode(" ")),D.appendChild(k)):k.parentNode.insertBefore(D,k):vC(k,_,!1)?I.insertAfter(D,hC(k)):(k=hC(k),(O=M.cloneRange()).setStartAfter(_),O.setEndAfter(k),B=O.extractContents(),"LI"===A&&(B.firstChild&&"LI"===B.firstChild.nodeName)?(D=B.firstChild,I.insertAfter(B,k)):(I.insertAfter(B,k),I.insertAfter(D,k))),I.remove(_)),dC(N,D))):p&&b===a.getBody()||(p=p||"P",Lr(b)?(u=Hr(b),c.isEmpty(b)&&bC(b),SC(a,u),dC(a,u)):n()?r():n(!0)?(u=b.parentNode.insertBefore(t(),b),dC(a,yC(b,"HR")?u:b)):((S=(w=d).cloneRange()).setStart(w.startContainer,xC(!0,w.startContainer,w.startOffset)),S.setEnd(w.endContainer,xC(!1,w.endContainer,w.endOffset)),(o=S.cloneRange()).setEndAfter(b),i=o.extractContents(),Y(qu(Et.fromDom(i),An),function(e){var t=e.dom;t.nodeValue=Eo(t.nodeValue)}),function(e){for(;Vn(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(i),u=i.firstChild,c.insertAfter(i,b),function(e,t){var n,r,o=u,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;Hn(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(n=i.length;n--;)!(o=i[n]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(r=o)&&"A"===r.nodeName&&e.isEmpty(r)&&e.remove(o)}}(c,f),function(e,t){t.normalize();var n=t.lastChild;n&&!/^(left|right)$/gi.test(e.getStyle(n,"float",!0))||e.add(t,"br")}(c,b),c.isEmpty(b)&&bC(b),u.normalize(),c.isEmpty(u)?(c.remove(u),r()):(SC(a,u),dC(a,u))),c.setAttrib(u,"id",""),a.fire("NewBlock",{newBlock:u})))}function EC(e,t,n){var r=e.dom.createRng();n?(r.setStartBefore(t),r.setEndBefore(t)):(r.setStartAfter(t),r.setEndAfter(t)),e.selection.setRng(r),nd(e,r)}function kC(e,t){var n=Et.fromTag("br");qt(Et.fromDom(t),n),e.undoManager.add()}function _C(e,t){l1(e.getBody(),t)||$t(Et.fromDom(t),Et.fromTag("br"));var n=Et.fromTag("br");$t(Et.fromDom(t),n),EC(e,n.dom,!1),e.undoManager.add()}function AC(e){return e&&"A"===e.nodeName&&"href"in e}function RC(e){return e.fold(D,AC,AC,D)}function DC(e,t){t.fold(te,R(kC,e),R(_C,e),te)}function TC(e,t){var n,r,o,i=(r=R(bb,n=e),o=cs.fromRangeStart(n.selection.getRng()),gy(r,n.getBody(),o).filter(RC));i.isSome()?i.each(R(DC,e)):function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();Of(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u,s=a.startOffset,c=a.startContainer;1===c.nodeType&&c.hasChildNodes()&&(u=s>c.childNodes.length-1,c=c.childNodes[Math.min(s,c.childNodes.length-1)]||c,s=u&&3===c.nodeType?c.nodeValue.length:0);var l=i.getParent(c,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!t||!t.ctrlKey);"LI"!==d||m||(l=f),c&&3===c.nodeType&&s>=c.nodeValue.length&&!function(e){for(var t,n=new Dr(c,l),r=e.getNonEmptyElements();t=n.next();)if(r[t.nodeName.toLowerCase()]||0t}),s1=R(iC,Qy),c1=R(iC,Zy),l1=function(e,t){return n=cs.after(t),!!Kn(n.getNode())||tf(e,cs.after(t)).map(function(e){return Kn(e.getNode())}).getOr(!1);var n},f1=ir([{br:[]},{block:[]},{none:[]}]),d1=dt().browser,m1=dt(),g1=R(KC,wo),p1=R(KC," "),h1=(v1.prototype.nodeChanged=function(e){var t,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(t=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(t,r)||(t=r),n=[],this.editor.dom.getParent(t,function(e){return e===r||void n.push(e)}),(e=e||{}).element=t,e.parents=n,this.editor.fire("NodeChange",e))},v1.prototype.isSameElementPath=function(e){var t,n=this.editor.$(e).parentsUntil(this.editor.getBody()).add(e);if(n.length===this.lastPath.length){for(t=n.length;0<=t&&n[t]===this.lastPath[t];t--);if(-1===t)return this.lastPath=n,!0}return this.lastPath=n,!1},v1);function v1(r){var o;this.lastPath=[],this.editor=r;var t=this;"onselectionchange"in r.getDoc()||r.on("NodeChange click mouseup keyup focus",function(e){var t=r.selection.getRng(),n={startContainer:t.startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset};"nodechange"!==e.type&&kf(n,o)||r.fire("SelectionChange"),o=n}),r.on("contextmenu",function(){r.fire("SelectionChange")}),r.on("SelectionChange",function(){var e=r.selection.getStart(!0);!e||!xt.range&&r.selection.isCollapsed()||Pl(r)&&!t.isSameElementPath(e)&&r.dom.isChildOf(e,r.getBody())&&r.nodeChanged({selectionChange:!0})}),r.on("mouseup",function(e){!e.isDefaultPrevented()&&Pl(r)&&("IMG"===r.selection.getNode().nodeName?Ar.setEditorTimeout(r,function(){r.nodeChanged()}):r.nodeChanged())})}function b1(e){return Hn(e)&&po(Et.fromDom(e))}function y1(e){var t=e.getBoundingClientRect(),n=e.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:t.top+o.pageYOffset-r.clientTop,left:t.left+o.pageXOffset-r.clientLeft}}function C1(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function x1(e,S){var N=Ar.throttle(function(e,t){S._selectionOverrides.hideFakeCaret(),S.selection.placeCaretAt(e,t)},0);return S.on("remove",N.stop),function(w){return e.on(function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C,x=Math.max(Math.abs(w.screenX-e.screenX),Math.abs(w.screenY-e.screenY));if(!e.dragging&&10 ').attr("id",w)).appendTo(l.getBody());var i=y.createRng();t===n&&xt.ie?(o.empty().append('