o.childNodes.length-1,o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o,i=p&&vo.isText(o)?o.nodeValue.length:0),(r=gy(C,o))&&((m&&!s||!m&&s)&&(o=function(e,t,n,r,o){var i,a,s,u,c,l,f,d=t||"P",m=e.dom,p=gy(m,r);if(!(a=m.getParent(r,m.isBlock))||!my(m,a)){if(l=(a=a||p)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),hy(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(u=r;u.parentNode!==a;)u=u.parentNode;for(;u&&!m.isBlock(u);)s=u,u=u.previousSibling;if(s&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),hy(e,i),s.parentNode.insertBefore(i,s),u=s;u&&!m.isBlock(u);)c=u.nextSibling,i.appendChild(u),u=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(e,m,N,o,i)),a=C.getParent(o,C.isBlock),l=a?C.getParent(a.parentNode,C.isBlock):null,f=a?a.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||t.ctrlKey||(a=l,l=l.parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&C.isEmpty(a)?ly(e,E,l,a,m):m&&a===e.getBody()||(m=m||"P",mi.isCaretContainerBlock(a)?(u=mi.showCaretContainerBlock(a),C.isEmpty(a)&&fy(a),ty(e,u)):S()?k():S(!0)?(u=a.parentNode.insertBefore(E(),a),ty(e,dy(a,"HR")?u:a)):((n=(y=N,b=y.cloneRange(),b.setStart(y.startContainer,py(!0,y.startContainer,y.startOffset)),b.setEnd(y.endContainer,py(!1,y.endContainer,y.endOffset)),b).cloneRange()).setEndAfter(a),function(e){do{vo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild}while(e)}(c=n.extractContents()),u=c.firstChild,C.insertAfter(c,a),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;vo.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=o)&&"A"===a.nodeName&&0===Ot.trim(ii(a.innerText||a.textContent)).length&&e.remove(o);var a}}(C,w,u),g=C,(h=a).normalize(),(v=h.lastChild)&&!/^(left|right)$/gi.test(g.getStyle(v,"float",!0))||g.add(h,"br"),C.isEmpty(a)&&fy(a),u.normalize(),C.isEmpty(u)?(C.remove(u),k()):ty(e,u)),C.setAttrib(u,"id",""),e.fire("NewBlock",{newBlock:u})))},yy=function(e,t){return ry(e).filter(function(e){return t.length>0&&_r.is(Hn.fromDom(e),t)}).isSome()},by=function(e){return yy(e,Gv(e))},Cy=function(e){return yy(e,Jv(e))},xy=Qu([{br:[]},{block:[]},{none:[]}]),wy=function(e,t){return Cy(e)},Ny=function(e){return function(t,n){return""===Xv(t)===e}},Ey=function(e){return function(t,n){return iy(t)===e}},Sy=function(e){return function(t,n){return"PRE"===oy(t)===e}},ky=function(e){return function(t,n){return Kv(t)===e}},Ty=function(e,t){return by(e)},Ay=function(e,t){return t},_y=function(e){var t=Xv(e),n=ny(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},By=function(e,t){return function(n,r){return M.foldl(e,function(e,t){return e&&t(n,r)},!0)?E.some(t):E.none()}},Ry=function(e,t){return Tl([By([wy],xy.none()),By([Sy(!0),ky(!1),Ay],xy.br()),By([Sy(!0),ky(!1)],xy.block()),By([Sy(!0),ky(!0),Ay],xy.block()),By([Sy(!0),ky(!0)],xy.br()),By([Ey(!0),Ay],xy.br()),By([Ey(!0)],xy.block()),By([Ny(!0),Ay,_y],xy.block()),By([Ny(!0)],xy.br()),By([Ty],xy.br()),By([Ny(!1),Ay],xy.br()),By([_y],xy.block())],[e,t.shiftKey]).getOr(xy.none())},Dy=function(e,t){Ry(e,t).fold(function(){sd(e,t)},function(){vy(e,t)},y.noop)},Oy=function(e){e.on("keydown",function(t){var n,r,o;t.keyCode===Mp.ENTER&&(n=e,(r=t).isDefaultPrevented()||(r.preventDefault(),(o=n.undoManager).typing&&(o.typing=!1,o.add()),n.undoManager.transact(function(){!1===n.selection.isCollapsed()&&n.execCommand("Delete"),Dy(n,r)})))})},Py=function(e,t,n){return s=t,!(!Iy(n)||!vo.isText(s.container())||(r=e,i=(o=t).container(),a=o.offset(),i.insertData(a,"\xa0"),r.selection.setCursorLocation(i,a+1),0));var r,o,i,a,s},Iy=function(e){return e.fold(y.constant(!1),y.constant(!0),y.constant(!0),y.constant(!1))},Ly=function(e){return!!e.selection.isCollapsed()&&(t=e,n=y.curry(vu.isInlineTarget,t),r=ia.fromRangeStart(t.selection.getRng()),$l(n,t.getBody(),r).map(y.curry(Py,t,r)).getOr(!1));var t,n,r},My=function(e){e.on("keydown",function(t){var n,r;!1===t.isDefaultPrevented()&&(n=e,r=t,Pv([{keyCode:Mp.SPACEBAR,action:Ov(Ly,n)}],r).each(function(e){r.preventDefault()}))})},Fy=function(e){var t=of.setupSelectedState(e);Iv(e,t),zv(e,t),Oy(e),My(e)},zy=function(e){var t,n,r,o=Ot.each,i=Mp.BACKSPACE,a=Mp.DELETE,s=e.dom,u=e.selection,c=e.settings,l=e.parser,f=me.gecko,d=me.ie,m=me.webkit,p="data:text/mce-internal,",g=d?"Text":"URL",h=function(t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},v=function(e){return e.isDefaultPrevented()},y=function(){e.shortcuts.add("meta+a",null,"SelectAll")},b=function(){e.on("keydown",function(e){if(!v(e)&&e.keyCode===i&&u.isCollapsed()&&0===u.getRng().startOffset){var t=u.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},C=function(){e.inline||(e.contentStyles.push("body {min-height: 150px}"),e.on("click",function(t){var n;if("HTML"===t.target.nodeName){if(me.ie>11)return void e.getBody().focus();n=e.selection.getRng(),e.getBody().focus(),e.selection.setRng(n),e.selection.normalize(),e.nodeChanged()}}))};return e.on("keydown",function(t){var n,r,o,i,a;if(!v(t)&&t.keyCode===Mp.BACKSPACE&&(r=(n=u.getRng()).startContainer,o=n.startOffset,i=s.getRoot(),a=r,n.collapsed&&0===o)){for(;a&&a.parentNode&&a.parentNode.firstChild===a&&a.parentNode!==i;)a=a.parentNode;"BLOCKQUOTE"===a.tagName&&(e.formatter.toggle("blockquote",null,a),(n=s.createRng()).setStart(r,0),n.setEnd(r,0),u.setRng(n))}}),t=function(e){var t=s.create("body"),n=e.cloneContents();return t.appendChild(n),u.serializer.serialize(t,{format:"html"})},e.on("keydown",function(n){var r,o,u,c,l,f=n.keyCode;if(!v(n)&&(f===a||f===i)){if(r=e.selection.isCollapsed(),o=e.getBody(),r&&!s.isEmpty(o))return;if(!r&&(u=e.selection.getRng(),c=t(u),(l=s.createRng()).selectNode(e.getBody()),c!==t(l)))return;n.preventDefault(),e.setContent(""),o.firstChild&&s.isBlock(o.firstChild)?e.selection.setCursorLocation(o.firstChild,0):e.selection.setCursorLocation(o,0),e.nodeChanged()}}),me.windowsPhone||e.on("keyup focusin mouseup",function(e){Mp.modifierPressed(e)||u.normalize()},!0),m&&(e.settings.content_editable||s.bind(e.getDoc(),"mousedown mouseup",function(t){var n;if(t.target===e.getDoc().documentElement)if(n=u.getRng(),e.getBody().focus(),"mousedown"===t.type){if(mi.isCaretContainer(n.startContainer))return;u.placeCaretAt(t.clientX,t.clientY)}else u.setRng(n)}),e.on("click",function(t){var n=t.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==s.getContentEditableParent(n)&&(t.preventDefault(),e.selection.select(n),e.nodeChanged()),"A"===n.nodeName&&s.hasClass(n,"mce-item-anchor")&&(t.preventDefault(),u.select(n))}),c.forced_root_block&&e.on("init",function(){h("DefaultParagraphSeparator",c.forced_root_block)}),e.on("init",function(){e.dom.bind(e.getBody(),"submit",function(e){e.preventDefault()})}),b(),l.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}),me.iOS?(e.inline||e.on("keydown",function(){document.activeElement===document.body&&e.getWin().focus()}),C(),e.on("click",function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)}),e.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):y()),me.ie>=11&&(C(),b()),me.ie&&(y(),h("AutoUrlDetect",!1),e.on("dragstart",function(t){var n,r,o;(n=t).dataTransfer&&(e.selection.isCollapsed()&&"IMG"===n.target.tagName&&u.select(n.target),(r=e.selection.getContent()).length>0&&(o=p+escape(e.id)+","+escape(r),n.dataTransfer.setData(g,o)))}),e.on("drop",function(t){if(!v(t)){var n=(a=t).dataTransfer&&(s=a.dataTransfer.getData(g))&&s.indexOf(p)>=0?(s=s.substr(p.length).split(","),{id:unescape(s[0]),html:unescape(s[1])}):null;if(n&&n.id!==e.id){t.preventDefault();var r=Ih(t.x,t.y,e.getDoc());u.setRng(r),o=n.html,i=!0,e.queryCommandSupported("mceInsertClipboardContent")?e.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):e.execCommand("mceInsertContent",!1,o)}}var o,i,a,s})),f&&(e.on("keydown",function(t){if(!v(t)&&t.keyCode===i){if(!e.getBody().getElementsByTagName("hr").length)return;if(u.isCollapsed()&&0===u.getRng().startOffset){var n=u.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return s.remove(n),void t.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(s.remove(r),t.preventDefault())}}}),Range.prototype.getClientRects||e.on("mousedown",function(t){if(!v(t)&&"HTML"===t.target.nodeName){var n=e.getBody();n.blur(),ye.setEditorTimeout(e,function(){n.focus()})}}),n=function(){var t=s.getAttribs(u.getStart().cloneNode(!1));return function(){var n=u.getStart();n!==e.getBody()&&(s.setAttrib(n,"style",null),o(t,function(e){n.setAttributeNode(e.cloneNode(!0))}))}},r=function(){return!u.isCollapsed()&&s.getParent(u.getStart(),s.isBlock)!==s.getParent(u.getEnd(),s.isBlock)},e.on("keypress",function(t){var o;if(!v(t)&&(8===t.keyCode||46===t.keyCode)&&r())return o=n(),e.getDoc().execCommand("delete",!1,null),o(),t.preventDefault(),!1}),s.bind(e.getDoc(),"cut",function(t){var o;!v(t)&&r()&&(o=n(),ye.setEditorTimeout(e,function(){o()}))}),c.readonly||e.on("BeforeExecCommand MouseDown",function(){h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),c.object_resizing||h("enableObjectResizing",!1)}),e.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||o(s.select("a"),function(e){var t=e.parentNode,n=s.getRoot();if(t.lastChild===e){for(;t&&!s.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}s.add(t,"br",{"data-mce-bogus":1})}})}),e.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),me.mac&&e.on("keydown",function(t){!Mp.metaKeyPressed(t)||t.shiftKey||37!==t.keyCode&&39!==t.keyCode||(t.preventDefault(),e.selection.getSel().modify("move",37===t.keyCode?"backward":"forward","lineboundary"))}),b()),{refreshContentEditable:function(){},isHidden:function(){var t;return!f||e.removed?0:!(t=e.selection.getSel())||!t.rangeCount||0===t.rangeCount}}},Uy=Xo.DOM,Vy=function(e){var t;e.bindPendingEventDelegates(),e.initialized=!0,e.fire("init"),e.focus(!0),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),(t=e).settings.auto_focus&&ye.setEditorTimeout(t,function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()},100)},Hy=function(e,t){var n,r,o,i,a,s,u,c,l,f=e.settings,d=e.getElement(),m=e.getDoc();f.inline||(e.getElement().style.visibility=e.orgVisibility),t||f.content_editable||(m.open(),m.write(e.iframeHTML),m.close()),f.content_editable&&(e.on("remove",function(){var e=this.getBody();Uy.removeClass(e,"mce-content-body"),Uy.removeClass(e,"mce-edit-focus"),Uy.setAttrib(e,"contentEditable",null)}),Uy.addClass(d,"mce-content-body"),e.contentDocument=m=f.content_document||document,e.contentWindow=f.content_window||window,e.bodyElement=d,f.content_document=f.content_window=null,f.root_name=d.nodeName.toLowerCase()),(n=e.getBody()).disabled=!0,e.readonly=f.readonly,e.readonly||(e.inline&&"static"===Uy.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable=e.getParam("content_editable_state",!0)),n.disabled=!1,e.editorUpload=Jm(e),e.schema=Fo(f),e.dom=new Xo(m,{keep_values:!0,url_converter:e.convertURL,url_converter_scope:e,hex_colors:f.force_hex_style_colors,class_filter:f.class_filter,update_styles:!0,root_element:e.inline?e.getBody():null,collect:f.content_editable,schema:e.schema,onSetAttrib:function(t){e.fire("SetAttrib",t)}}),e.parser=((i=bh((o=e).settings,o.schema)).addAttributeFilter("src,href,style,tabindex",function(e,t){for(var n,r,i,a=e.length,s=o.dom;a--;)if(r=(n=e[a]).attr(t),i="data-mce-"+t,!n.attributes.map[i]){if(0===r.indexOf("data:")||0===r.indexOf("blob:"))continue;"style"===t?((r=s.serializeStyle(s.parseStyle(r),n.name)).length||(r=null),n.attr(i,r),n.attr(t,r)):"tabindex"===t?(n.attr(i,r),n.attr(t,null)):n.attr(i,o.convertURL(r,t,n.name))}}),i.addNodeFilter("script",function(e){for(var t,n,r=e.length;r--;)0!==(n=(t=e[r]).attr("type")||"no/type").indexOf("mce-")&&t.attr("type","mce-"+n)}),i.addNodeFilter("#cdata",function(e){for(var t,n=e.length;n--;)(t=e[n]).type=8,t.name="#comment",t.value="[CDATA["+t.value+"]]"}),i.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t,n=e.length,r=o.schema.getNonEmptyElements();n--;)(t=e[n]).isEmpty(r)&&0===t.getAll("br").length&&(t.append(new fh("br",1)).shortEnded=!0)}),i),e.serializer=Nh(f,e),e.selection=vv(e.dom,e.getWin(),e.serializer,e),e.formatter=Yg(e),e.undoManager=rg(e),e._nodeChangeDispatcher=new tp(e),e._selectionOverrides=Hp(e),kh(e),Fy(e),ep(e),e.fire("PreInit"),f.browser_spellcheck||f.gecko_spellcheck||(m.body.spellcheck=!1,Uy.setAttrib(n,"spellcheck","false")),e.quirks=zy(e),e.fire("PostRender"),f.directionality&&(n.dir=f.directionality),f.nowrap&&(n.style.whiteSpace="nowrap"),f.protect&&e.on("BeforeSetContent",function(e){Ot.each(f.protect,function(t){e.content=e.content.replace(t,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})})}),e.on("SetContent",function(){e.addVisual(e.getBody())}),f.padd_empty_editor&&e.on("PostProcess",function(e){e.content=e.content.replace(/^(]*>( | |\s|\u00a0| |)<\/p>[\r\n]*| [\r\n]*)$/,"")}),e.load({initial:!0,format:"html"}),e.startContent=e.getContent({format:"raw"}),e.on("compositionstart compositionend",function(t){e.composing="compositionstart"===t.type}),e.contentStyles.length>0&&(r="",Ot.each(e.contentStyles,function(e){r+=e+"\r\n"}),e.dom.addStyle(r)),(a=e,a.inline?Uy.styleSheetLoader:a.dom.styleSheetLoader).loadAll(e.contentCSS,function(t){Vy(e)},function(t){Vy(e)}),f.content_style&&(s=e,u=f.content_style,c=Hn.fromDom(s.getDoc().head),l=Hn.fromTag("style"),dr.set(l,"type","text/css"),ks.append(l,Hn.fromText(u)),ks.append(c,l))},qy=Xo.DOM,jy=function(e,t){var n,r,o,i,a,s,u,c=e.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),l=(n=e.id,r=c,o=t.height,i=Vv(e),u=Hn.fromTag("iframe"),dr.setAll(u,i),dr.setAll(u,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),br(u,{width:"100%",height:(a=o,s="number"==typeof a?a+"px":a,s||""),display:"block"}),u).dom();l.onload=function(){l.onload=null,e.fire("load")};var f,d,m,p,g=function(e,t){if(document.domain!==window.location.hostname&&me.ie&&me.ie<12){var n=Gm("mce");e[n]=function(){Hy(e)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return qy.setAttrib(t,"src",r),!0}return!1}(e,l);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=l,e.iframeHTML=(p=Hv(f=e)+"
",qv(f)!==f.documentBaseUrl&&(p+=' '),p+=' ',d=jv(f),m=$v(f),Wv(f)&&(p+=' '),p+=' '),qy.add(t.iframeContainer,l),g},$y=function(e,t){var n=jy(e,t);t.editorContainer&&(qy.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=qy.isHidden(t.editorContainer)),e.getElement().style.display="none",qy.setAttrib(e.id,"aria-hidden",!0),n||Hy(e)},Wy=Xo.DOM,Ky=function(e,t,n){var r,o,i=Im.get(n);if(r=Im.urls[n]||e.documentBaseUrl.replace(/\/$/,""),n=Ot.trim(n),i&&-1===Ot.inArray(t,n)){if(Ot.each(Im.dependencies(n),function(n){Ky(e,t,n)}),e.plugins[n])return;o=new i(e,r,e.$),e.plugins[n]=o,o.init&&(o.init(e,r),t.push(n))}},Xy=function(e){return e.replace(/^\-/,"")},Yy=function(e){return{editorContainer:e,iframeContainer:e}},Gy=function(e){var t,n,r=e.getElement();return e.inline?Yy(null):(t=r,n=Wy.create("div"),Wy.insertAfter(n,t),Yy(n))},Jy=function(e){var t,n,r,o,i,a,s,u,c,l,f,d=e.settings,m=e.getElement();return e.orgDisplay=m.style.display,tr.isString(d.theme)?(l=(o=e).settings,f=o.getElement(),i=l.width||Wy.getStyle(f,"width")||"100%",a=l.height||Wy.getStyle(f,"height")||f.offsetHeight,s=l.min_height||100,(u=/^[0-9\.]+(|px)$/i).test(""+i)&&(i=Math.max(parseInt(i,10),100)),u.test(""+a)&&(a=Math.max(parseInt(a,10),s)),c=o.theme.renderUI({targetNode:f,width:i,height:a,deltaWidth:l.delta_width,deltaHeight:l.delta_height}),l.content_editable||(a=(c.iframeHeight||a)+("number"==typeof a?c.deltaHeight||0:""))=n.length)for(r=0,o=e.length;r=n.length||e[r]!==n[r]){i=r+1;break}if(e.length=e.length||e[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=e.length-(i-1);r=0;n--)0!==t[n].length&&"."!==t[n]&&(".."!==t[n]?i>0?i--:a.push(t[n]):i++);return 0!==(o=(n=e.length-i)<=0?a.reverse().join("/"):e.slice(0,n).join("/")+"/"+a.reverse().join("/")).indexOf("/")&&(o="/"+o),r&&o.lastIndexOf("/")!==o.length-1&&(o+=r),o},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(n.protocol?t+=n.protocol+"://":t+="//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},ub.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},ub.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t};var cb=Xo.DOM,lb=Ot.extend,fb=Ot.each,db=Ot.trim,mb=Ot.resolve,pb=me.ie,gb=function(e,t,n){var r,o,i,a,s,u,c,l,f,d=this;r=d.documentBaseUrl=n.documentBaseURL,o=n.baseURI,i=d,a=e,s=r,u=n.defaultSettings,c=t,f={id:a,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:s,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:(l=i).convertURL,url_converter_scope:l,ie7_compat:!0},t=lu(ou,f,u,c),d.settings=t,ti.language=t.language||"en",ti.languageLoad=t.language_load,ti.baseURL=n.baseURL,d.id=e,d.setDirty(!1),d.plugins={},d.documentBaseURI=new ub(t.document_base_url,{base_uri:o}),d.baseURI=o,d.contentCSS=[],d.contentStyles=[],d.shortcuts=new Jd(d),d.loadedCSS={},d.editorCommands=new Od(d),d.suffix=n.suffix,d.editorManager=n,d.inline=t.inline,d.buttons={},d.menuItems={},t.cache_suffix&&(me.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(me.overrideViewPort=!1),n.fire("SetupEditor",d),d.execCallback("setup",d),d.$=Qt.overrideDefaults(function(){return{context:d.inline?d.getBody():d.getDoc(),element:d.getBody()}})};lb(gb.prototype={render:function(){nb(this)},focus:function(e){gm(this,e)},execCallback:function(e){var t,n=this.settings[e];if(n)return this.callbackLookup&&(t=this.callbackLookup[e])&&(n=t.func,t=t.scope),"string"==typeof n&&(t=(t=n.replace(/\.\w+$/,""))?mb(t):0,n=mb(n),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[e]={func:n,scope:t}),n.apply(t||this,Array.prototype.slice.call(arguments,1))},translate:function(e){if(e&&Ot.is(e,"string")){var t=this.settings.language||"en",n=this.editorManager.i18n;e=n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"})}return this.editorManager.translate(e)},getLang:function(e,t){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(t!==undefined?t:"{#"+e+"}")},getParam:function(e,t,n){return mu(this,e,t,n)},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.stateSelector&&"undefined"==typeof t.active&&(t.active=!1),t.text||t.icon||(t.icon=e),n.buttons=n.buttons,t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addSidebar:function(e,t){return rb(this,e,t)},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems,n.menuItems[e]=t},addContextToolbar:function(e,t){var n,r=this;r.contextToolbars=r.contextToolbars||[],"string"==typeof e&&(n=e,e=function(e){return r.dom.is(e,n)}),r.contextToolbars.push({id:Gm("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable=!0:(cb.show(this.getContainer()),cb.hide(this.id)),this.load(),this.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(pb&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(cb.hide(e.getContainer()),cb.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var t,n=this.getElement();return this.removed?"":n?((e=e||{}).load=!0,t=this.setContent(n.value!==undefined?n.value:n.innerHTML,e),e.element=n,e.no_events||this.fire("LoadContent",e),e.element=n=null,t):void 0},save:function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,/TEXTAREA|INPUT/i.test(o.nodeName)?o.value=t:(r.inline||(o.innerHTML=t),(n=cb.getParent(r.id,"form"))&&fb(n.elements,function(e){if(e.name===r.id)return e.value=t,!1})),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},setContent:function(e,t){var n,r,o=this,i=o.getBody();return(t=t||{}).format=t.format||"html",t.set=!0,t.content=e,t.no_events||o.fire("BeforeSetContent",t),0===(e=t.content).length||/^\s+$/.test(e)?(r=pb&&pb<11?"":' ',"TABLE"===i.nodeName?e=""+r+" ":/^(UL|OL)$/.test(i.nodeName)&&(e=""+r+" "),(n=o.settings.forced_root_block)&&o.schema.isValidChild(i.nodeName.toLowerCase(),n.toLowerCase())?(e=r,e=o.dom.createHTML(n,o.settings.forced_root_block_attrs,e)):pb||e||(e=' '),o.dom.setHTML(i,e),o.fire("SetContent",t)):("raw"!==t.format&&(e=zs({validate:o.validate},o.schema).serialize(o.parser.parse(e,{isRootContent:!0,insert:!0}))),t.content=db(e),o.dom.setHTML(i,t.content),t.no_events||o.fire("SetContent",t)),t.content},getContent:function(e){var t,n=this.getBody();if(this.removed)return"";if((e=e||{}).format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||this.fire("BeforeGetContent",e),"raw"===e.format)t=Ot.trim(om(this.serializer,n.innerHTML));else if("text"===e.format)t=n.innerText||n.textContent;else{if("tree"===e.format)return this.serializer.serialize(n,e);t=this.serializer.serialize(n,e)}return"text"!==e.format?e.content=db(t):e.content=t,e.no_events||this.fire("GetContent",e),e.content},insertContent:function(e,t){t&&(e=lb({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty")},setMode:function(e){Wd(this,e)},getContainer:function(){return this.container||(this.container=cb.get(this.editorContainer||this.id+"_parent")),this.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=cb.get(this.id)),this.targetElm},getWin:function(){var e;return this.contentWindow||(e=this.iframeElement)&&(this.contentWindow=e.contentWindow),this.contentWindow},getDoc:function(){var e;return this.contentDocument||(e=this.getWin())&&(this.contentDocument=e.document),this.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",e,n,!0,t):!r.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:r.relative_urls?this.documentBaseURI.toRelative(e):e=this.documentBaseURI.toAbsolute(e,r.remove_script_host)},addVisual:function(e){var t,n=this,r=n.settings,o=n.dom;e=e||n.getBody(),n.hasVisual===undefined&&(n.hasVisual=r.visual),fb(o.select("table,a",e),function(e){var i;switch(e.nodeName){case"TABLE":return t=r.visual_table_class||"mce-item-table",void((i=o.getAttrib(e,"border"))&&"0"!==i||!n.hasVisual?o.removeClass(e,t):o.addClass(e,t));case"A":return void(o.getAttrib(e,"href",!1)||(i=o.getAttrib(e,"name")||e.id,t=r.visual_anchor_class||"mce-item-anchor",i&&n.hasVisual?o.addClass(e,t):o.removeClass(e,t)))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;e.removed||(e.save(),e.removed=1,e.unbindAllNativeEvents(),e.hasHiddenInput&&cb.remove(e.getElement().nextSibling),e.inline||(pb&&pb<10&&e.getDoc().execCommand("SelectAll",!1,null),cb.setStyle(e.id,"display",e.orgDisplay),e.getBody().onload=null),e.fire("remove"),e.editorManager.remove(e),cb.remove(e.getContainer()),e._selectionOverrides.destroy(),e.editorUpload.destroy(),e.destroy())},destroy:function(e){var t,n=this;n.destroyed||(e||n.removed?(e||(n.editorManager.off("beforeunload",n._beforeUnload),n.theme&&n.theme.destroy&&n.theme.destroy(),n.selection.destroy(),n.dom.destroy()),(t=n.formElement)&&(t._mceOldSubmit&&(t.submit=t._mceOldSubmit,t._mceOldSubmit=null),cb.unbind(t,"submit reset",n.formEventDelegate)),n.contentAreaContainer=n.formElement=n.container=n.editorContainer=null,n.bodyElement=n.contentDocument=n.contentWindow=null,n.iframeElement=n.targetElm=null,n.selection&&(n.selection=n.selection.win=n.selection.dom=n.selection.dom.doc=null),n.destroyed=1):n.remove())},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},qd);var hb,vb,yb,bb={isEditorUIElement:function(e){return-1!==e.className.toString().indexOf("mce-")}},Cb=function(e,t){var n,r,o=Un.detect().browser;o.isIE()||o.isEdge()?(r=e).on("focusout",function(){Sd(r)}):(n=t,e.on("mouseup touchend",function(e){n.throttle()})),e.on("keyup nodechange",function(t){var n;"nodechange"===(n=t).type&&n.selectionChange||Sd(e)})},xb=function(e){var t,n,r,o=Tp(function(){Sd(e)},0);e.inline&&(t=e,n=o,r=function(){n.throttle()},Xo.DOM.bind(document,"mouseup",r),t.on("remove",function(){Xo.DOM.unbind(document,"mouseup",r)})),e.on("init",function(){Cb(e,o)}),e.on("remove",function(){o.cancel()})},wb=Xo.DOM,Nb=function(e){return bb.isEditorUIElement(e)},Eb=function(e,t){var n=e?e.settings.custom_ui_selector:"";return null!==wb.getParent(t,function(t){return Nb(t)||!!n&&e.dom.is(t,n)})},Sb=function(e,t){var n=t.editor;xb(n),n.on("focusin",function(){var t=e.focusedEditor;t!==this&&(t&&t.fire("blur",{focusedEditor:this}),e.setActive(this),e.focusedEditor=this,this.fire("focus",{blurredEditor:t}),this.focus(!0))}),n.on("focusout",function(){var t=this;ye.setEditorTimeout(t,function(){var n=e.focusedEditor;Eb(t,function(){try{return document.activeElement}catch(e){return document.body}}())||n!==t||(t.fire("blur",{focusedEditor:null}),e.focusedEditor=null)})}),hb||(hb=function(t){var n,r=e.activeEditor;n=t.target,r&&n.ownerDocument===document&&(n===document.body||Eb(r,n)||e.focusedEditor!==r||(r.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},wb.bind(document,"focusin",hb))},kb=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(wb.unbind(document,"focusin",hb),hb=null)},Tb=function(e){e.on("AddEditor",y.curry(Sb,e)),e.on("RemoveEditor",y.curry(kb,e))},Ab={},_b="en",Bb={setCode:function(e){e&&(_b=e,this.rtl=!!this.data[e]&&"rtl"===this.data[e]._dir)},getCode:function(){return _b},rtl:!1,add:function(e,t){var n=Ab[e];for(var r in n||(Ab[e]=n={}),t)n[r]=t[r];this.setCode(e)},translate:function(e){var t=Ab[_b]||{},n=function(e){return Ot.is(e,"function")?Object.prototype.toString.call(e):r(e)?"":""+e},r=function(e){return""===e||null===e||Ot.is(e,"undefined")},o=function(e){return e=n(e),Ot.hasOwn(t,e)?n(t[e]):e};if(r(e))return"";if(Ot.is(e,"object")&&Ot.hasOwn(e,"raw"))return n(e.raw);if(Ot.is(e,"array")){var i=e.slice(1);e=o(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return Ot.hasOwn(i,t)?n(i[t]):e})}return o(e).replace(/{context:\w+}$/,"")},data:Ab},Rb=Xo.DOM,Db=Ot.explode,Ob=Ot.each,Pb=Ot.extend,Ib=0,Lb=!1,Mb=[],Fb=[],zb=function(e){Ob(yb.get(),function(t){"scroll"===e.type?t.fire("ScrollWindow",e):t.fire("ResizeWindow",e)})},Ub=function(e){e!==Lb&&(e?Qt(window).on("resize scroll",zb):Qt(window).off("resize scroll",zb),Lb=e)},Vb=function(e){var t=Fb;delete Mb[e.id];for(var n=0;n0?Fb[0]:null),yb.focusedEditor===e&&(yb.focusedEditor=null),t.length!==Fb.length};Pb(yb={defaultSettings:{},$:Qt,majorVersion:"4",minorVersion:"7.5",releaseDate:"2018-01-22",editors:Mb,i18n:Bb,activeEditor:null,settings:{},setup:function(){var e,t,n,r,o="";if(t=ub.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),n=window.tinymce||window.tinyMCEPreInit)e=n.base||n.baseURL,o=n.suffix;else{for(var i=document.getElementsByTagName("script"),a=0;a0&&Ob(Db(t),function(e){var t;(t=Rb.get(e))?n.push(t):Ob(document.forms,function(t){Ob(t.elements,function(t){t.name===e&&(e="mce_editor_"+Ib++,Rb.setAttrib(t,"id",e),n.push(t))})})});break;case"textareas":case"specific_textareas":Ob(Rb.select("textarea"),function(t){e.editor_deselector&&i(t,e.editor_deselector)||e.editor_selector&&!i(t,e.editor_selector)||n.push(t)})}return n}(e)),e.types?Ob(e.types,function(n){Ot.each(t,function(t){return!Rb.is(t,n.selector)||(l(o(t),Pb({},e,n),t),!1)})}):(Ot.each(t,function(e){var t;(t=r.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(Vb(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null)}),0===(t=Ot.grep(t,function(e){return!r.get(e.id)})).length?a([]):Ob(t,function(t){var r;r=t,e.inline&&r.tagName.toLowerCase()in n?Pm("Could not initialize inline editor on invalid inline target element",t):l(o(t),e,t)}))};return r.settings=e,Rb.bind(window,"ready",s),new pe(function(e){t?e(t):a=function(t){e(t)}})},get:function(e){return 0===arguments.length?Fb.slice(0):tr.isString(e)?M.find(Fb,function(t){return t.id===e}).getOr(null):tr.isNumber(e)&&Fb[e]?Fb[e]:null},add:function(e){var t=this;return Mb[e.id]===e?e:(null===t.get(e.id)&&("length"!==e.id&&(Mb[e.id]=e),Mb.push(e),Fb.push(e)),Ub(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),vb||(vb=function(){t.fire("BeforeUnload")},Rb.bind(window,"beforeunload",vb)),e)},createEditor:function(e,t){return this.add(new gb(e,t,this))},remove:function(e){var t,n,r=this;if(e)return tr.isString(e)?(e=e.selector||e,void Ob(Rb.select(e),function(e){(n=r.get(e.id))&&r.remove(n)})):(n=e,tr.isNull(r.get(n.id))?null:(Vb(n)&&r.fire("RemoveEditor",{editor:n}),0===Fb.length&&Rb.unbind(window,"beforeunload",vb),n.remove(),Ub(Fb.length>0),n));for(t=Fb.length-1;t>=0;t--)r.remove(Fb[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new gb(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?(r.isHidden()?r.show():r.hide(),!0):(this.execCommand("mceAddEditor",0,n),!0)}return!!this.activeEditor&&this.activeEditor.execCommand(e,t,n)},triggerSave:function(){Ob(Fb,function(e){e.save()})},addI18n:function(e,t){Bb.add(e,t)},translate:function(e){return Bb.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},Fd),yb.setup();var Hb,qb=yb;function jb(e){return{walk:function(t,n){return cg.walk(e,t,n)},split:sl.split,normalize:function(t){return Jf.normalize(e,t).fold(y.constant(!1),function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})}}}(Hb=jb||(jb={})).compareRanges=qf,Hb.getCaretRangeFromPoint=Ih,Hb.getSelectedNode=Fi,Hb.getNode=zi;var $b,Wb,Kb=jb,Xb=Math.min,Yb=Math.max,Gb=Math.round,Jb=function(e,t,n){var r,o,i,a,s,u;return r=t.x,o=t.y,i=e.w,a=e.h,s=t.w,u=t.h,"b"===(n=(n||"").split(""))[0]&&(o+=u),"r"===n[1]&&(r+=s),"c"===n[0]&&(o+=Gb(u/2)),"c"===n[1]&&(r+=Gb(s/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=Gb(a/2)),"c"===n[4]&&(r-=Gb(i/2)),Qb(r,o,i,a)},Qb=function(e,t,n,r){return{x:e,y:t,w:n,h:r}},Zb={inflate:function(e,t,n){return Qb(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:Jb,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n,r,o,i;return n=Yb(e.x,t.x),r=Yb(e.y,t.y),o=Xb(e.x+e.w,t.x+t.w),i=Xb(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:Qb(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,s,u,c,l,f,d;return s=e.x,u=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=Yb(0,t.x-s),o=Yb(0,t.y-u),i=Yb(0,c-f),a=Yb(0,l-d),s+=r,u+=o,n&&(c+=r,l+=o,s-=i,u-=a),Qb(s,u,(c-=i)-s,(l-=a)-u)},create:Qb,fromClientRect:function(e){return Qb(e.left,e.top,e.width,e.height)}},eC={},tC={add:function(e,t){eC[e.toLowerCase()]=t},has:function(e){return!!eC[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=eC.hasOwnProperty(t)?eC[t]:null;if(null===n)throw new Error("Could not find module for type: "+e);return n},create:function(e,t){var n;if("string"==typeof e?(t=t||{}).type=e:e=(t=e).type,e=e.toLowerCase(),!(n=eC[e]))throw new Error("Could not find control by type: "+e);return(n=new n(t)).type=e,n}},nC=Ot.each,rC=Ot.extend,oC=function(){};oC.extend=$b=function(e){var t,n,r,o=this.prototype,i=function(){var e,t,n;if(!Wb&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},a=function(){return this},s=function(e,t){return function(){var n,r=this._super;return this._super=o[e],n=t.apply(this,arguments),this._super=r,n}};for(n in Wb=!0,t=new this,Wb=!1,e.Mixins&&(nC(e.Mixins,function(t){for(var n in t)"init"!==n&&(e[n]=t[n])}),o.Mixins&&(e.Mixins=o.Mixins.concat(e.Mixins))),e.Methods&&nC(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&nC(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){return e!==undefined?(this[n]=e,this):this[n]}}),e.Statics&&nC(e.Statics,function(e,t){i[t]=e}),e.Defaults&&o.Defaults&&(e.Defaults=rC({},o.Defaults,e.Defaults)),e)"function"==typeof(r=e[n])&&o[n]?t[n]=s(n,r):t[n]=r;return i.prototype=t,i.constructor=i,i.extend=$b,i};var iC=Math.min,aC=Math.max,sC=Math.round,uC=function(e,t){var n,r,o,i;if(t=t||'"',null===e)return"null";if("string"==(o=typeof e))return r="\bb\tt\nn\ff\rr\"\"''\\\\",t+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,o){return'"'===t&&"'"===e?e:(n=r.indexOf(o))+1?"\\"+r.charAt(n+1):(e=o.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e)})+t;if("object"===o){if(e.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(e)){for(n=0,r="[";n0?",":"")+uC(e[n],t);return r+"]"}for(i in r="{",e)e.hasOwnProperty(i)&&(r+="function"!=typeof e[i]?(r.length>1?","+t:t)+i+t+":"+uC(e[i],t):"");return r+"}"}return""+e},cC={serialize:uC,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}},lC={callbacks:{},count:0,send:function(e){var t=this,n=Xo.DOM,r=e.count!==undefined?e.count:t.count,o="tinymce_jsonp_"+r;t.callbacks[r]=function(i){n.remove(o),delete t.callbacks[r],e.callback(i)},n.add(n.doc.body,"script",{id:o,src:e.url,type:"text/javascript"}),t.count++}},fC={send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||n++>1e4?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,n>1e4?"TIMED_OUT":"GENERAL",t,e),t=null):setTimeout(r,10)};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",fC.fire("beforeInitialize",{settings:e}),t=new Mm){if(t.overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&Ot.each(e.requestheaders,function(e){t.setRequestHeader(e.key,e.value)}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=fC.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();setTimeout(r,10)}}};Ot.extend(fC,Fd);var dC=Ot.extend,mC=function(e){this.settings=dC({},e),this.count=0};mC.sendRPC=function(e){return(new mC).send(e)},mC.prototype={send:function(e){var t=e.error,n=e.success;(e=dC(this.settings,e)).success=function(r,o){void 0===(r=cC.parse(r))&&(r={error:"JSON Parse error."}),r.error?t.call(e.error_scope||e.scope,r.error,o):n.call(e.success_scope||e.scope,r.result)},e.error=function(n,r){t&&t.call(e.error_scope||e.scope,n,r)},e.data=cC.serialize({id:e.id||"c"+this.count++,method:e.method,params:e.params}),e.content_type="application/json",fC.send(e)}};var pC,gC=window.localStorage,hC=qb,vC={geom:{Rect:Zb},util:{Promise:pe,Delay:ye,Tools:Ot,VK:Mp,URI:ub,Class:oC,EventDispatcher:Id,Observable:Fd,I18n:Bb,XHR:fC,JSON:cC,JSONRequest:mC,JSONP:lC,LocalStorage:gC,Color:function(e){var t={},n=0,r=0,o=0,i=function(e){var i;return"object"==typeof e?"r"in e?(n=e.r,r=e.g,o=e.b):"v"in e&&function(e,t,i){var a,s,u,c;if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,i=parseInt(i,10)/100,t=aC(0,iC(t,1)),i=aC(0,iC(i,1)),0!==t){switch(a=e/60,u=(s=i*t)*(1-Math.abs(a%2-1)),c=i-s,Math.floor(a)){case 0:n=s,r=u,o=0;break;case 1:n=u,r=s,o=0;break;case 2:n=0,r=s,o=u;break;case 3:n=0,r=u,o=s;break;case 4:n=u,r=0,o=s;break;case 5:n=s,r=0,o=u;break;default:n=r=o=0}n=sC(255*(n+c)),r=sC(255*(r+c)),o=sC(255*(o+c))}else n=r=o=sC(255*i)}(e.h,e.s,e.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,t};return e&&i(e),t.toRgb=function(){return{r:n,g:r,b:o}},t.toHsv=function(){return e=n,t=r,i=o,s=0,(u=iC(e/=255,iC(t/=255,i/=255)))===(c=aC(e,aC(t,i)))?{h:0,s:0,v:100*(s=u)}:(a=(c-u)/c,s=c,{h:sC(60*((e===u?3:i===u?1:5)-(e===u?t-i:i===u?e-t:i-e)/(c-u))),s:sC(100*a),v:sC(100*s)});var e,t,i,a,s,u,c},t.toHex=function(){var e=function(e){return(e=parseInt(e,10).toString(16)).length>1?e:"0"+e};return"#"+e(n)+e(r)+e(o)},t.parse=i,t}},dom:{EventUtils:Te,Sizzle:lt,DomQuery:Qt,TreeWalker:to,DOMUtils:Xo,ScriptLoader:Zo,RangeUtils:Kb,Serializer:Nh,ControlSelection:Rh,BookmarkManager:Ah,Selection:vv,Event:Te.Event},html:{Styles:zo,Entities:Ao,Node:fh,Schema:Fo,SaxParser:em,DomParser:bh,Writer:Fs,Serializer:zs},ui:{Factory:tC},Env:me,AddOnManager:ti,Formatter:Yg,UndoManager:rg,EditorCommands:Od,WindowManager:km,NotificationManager:Sm,EditorObservable:qd,Shortcuts:Jd,Editor:gb,FocusManager:bb,EditorManager:qb,DOM:Xo.DOM,ScriptLoader:Zo.ScriptLoader,PluginManager:ti.PluginManager,ThemeManager:ti.ThemeManager,trim:Ot.trim,isArray:Ot.isArray,is:Ot.is,toArray:Ot.toArray,makeMap:Ot.makeMap,each:Ot.each,map:Ot.map,grep:Ot.grep,inArray:Ot.inArray,extend:Ot.extend,create:Ot.create,walk:Ot.walk,createNS:Ot.createNS,resolve:Ot.resolve,explode:Ot.explode,_addCacheSuffix:Ot._addCacheSuffix,isOpera:me.opera,isWebKit:me.webkit,isIE:me.ie,isGecko:me.gecko,isMac:me.mac};hC=Ot.extend(hC,vC),pC=hC,window.tinymce=pC,window.tinyMCE=pC}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n="[-'\\.\u2018\u2019\u2024\ufe52\uff07\uff0e]",t="[:\xb7\xb7\u05f4\u2027\ufe13\ufe55\uff1a]",r="[+*/,;;\u0589\u060c\u060d\u066c\u07f8\u2044\ufe10\ufe14\ufe50\ufe54\uff0c\uff1b]",E="[0-9\u0660-\u0669\u066b\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\uaa50-\uaa59\uabf0-\uabf9]",T="\\r",u="\\n",i="[\x0B\f\x85\u2028\u2029]",o="[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f\u109a-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b6-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u192b\u1930-\u193b\u19b0-\u19c0\u19c8\u19c9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f\u1b00-\u1b04\u1b34-\u1b44\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1baa\u1be6-\u1bf3\u1c24-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe3-\uabea\uabec\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]",c="[\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200e\u200f\u202a-\u202e\u2060-\u2064\u206a-\u206f\ufeff\ufff9-\ufffb]",a="[\u3031-\u3035\u309b\u309c\u30a0-\u30fa\u30fc-\u30ff\u31f0-\u31ff\u32d0-\u32fe\u3300-\u3357\uff66-\uff9d]",R="[=_\u203f\u2040\u2054\ufe33\ufe34\ufe4d-\ufe4f\uff3f\u2200-\u22ff<>]",f="[!-#%-*,-\\/:;?@\\[-\\]_{}\xa1\xab\xb7\xbb\xbf;\xb7\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\u0df4\u0e4f\u0e5a\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u0fd9\u0fda\u104a-\u104f\u10fb\u1361-\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\u1cd3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205e\u207d\u207e\u208d\u208e\u3008\u3009\u2768-\u2775\u27c5\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc\u29fd\u2cf9-\u2cfc\u2cfe\u2cff\u2d70\u2e00-\u2e2e\u2e30\u2e31\u3001-\u3003\u3008-\u3011\u3014-\u301f\u3030\u303d\u30a0\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\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]",A={characterIndices:{ALETTER:0,MIDNUMLET:1,MIDLETTER:2,MIDNUM:3,NUMERIC:4,CR:5,LF:6,NEWLINE:7,EXTEND:8,FORMAT:9,KATAKANA:10,EXTENDNUMLET:11,AT:12,OTHER:13},SETS:[new RegExp("[A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f3\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bc0-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u24b6-\u24e9\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005\u303b\u303c\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790\ua791\ua7a0-\ua7a9\ua7fa-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]"),new RegExp(n),new RegExp(t),new RegExp(r),new RegExp(E),new RegExp(T),new RegExp(u),new RegExp(i),new RegExp(o),new RegExp(c),new RegExp(a),new RegExp(R),new RegExp("@")],EMPTY_STRING:"",PUNCTUATION:new RegExp("^"+f+"$"),WHITESPACE:/^\s+$/},N=function(e,n,t){var r,E;if(!e)return 0;if(t=t||e,e.length!==undefined){for(r=0,E=e.length;re.length-1&&0!==n||E===L.ALETTER&&T===L.ALETTER||(r=e[n+2],E===L.ALETTER&&(T===L.MIDLETTER||T===L.MIDNUMLET||T===L.AT)&&r===L.ALETTER||(t=e[n-1],(E===L.MIDLETTER||E===L.MIDNUMLET||T===L.AT)&&T===L.ALETTER&&t===L.ALETTER||!(E!==L.NUMERIC&&E!==L.ALETTER||T!==L.NUMERIC&&T!==L.ALETTER)||(E===L.MIDNUM||E===L.MIDNUMLET)&&T===L.NUMERIC&&t===L.NUMERIC||E===L.NUMERIC&&(T===L.MIDNUM||T===L.MIDNUMLET)&&r===L.NUMERIC||E===L.EXTEND||E===L.FORMAT||t===L.EXTEND||t===L.FORMAT||T===L.EXTEND||T===L.FORMAT||E===L.CR&&T===L.LF||E!==L.NEWLINE&&E!==L.CR&&E!==L.LF&&T!==L.NEWLINE&&T!==L.CR&&T!==L.LF&&(E===L.KATAKANA&&T===L.KATAKANA||T===L.EXTENDNUMLET&&(E===L.ALETTER||E===L.NUMERIC||E===L.KATAKANA||E===L.EXTENDNUMLET)||E===L.EXTENDNUMLET&&(T===L.ALETTER||T===L.NUMERIC||T===L.KATAKANA)||E===L.AT))))},p=A.EMPTY_STRING,U=A.WHITESPACE,w=A.PUNCTUATION,h=function(e,n,t){var r=function(e,n){var t;for(t=n;t1)throw console.error("HTML does not have a single root node",n),"HTML must have a single root node";return k(t.childNodes[0])},fromTag:function(n,e){var t=(e||document).createElement(n);return k(t)},fromText:function(n,e){var t=(e||document).createTextNode(n);return k(t)},fromDom:k,fromPoint:function(n,e,t){return T.from(n.dom().elementFromPoint(e,t)).map(k)}},C=8,M=9,D=3,O=function(n){return n.dom().nodeName.toLowerCase()},A=function(n){return n.dom().nodeType},S=function(n){return function(e){return A(e)===n}},B=S(1),P=S(D),V=S(M),q={name:O,type:A,value:function(n){return n.dom().nodeValue},isElement:B,isText:P,isDocument:V,isComment:function(n){return A(n)===C||"#comment"===O(n)}},H=function(n){return''+n+" "},L=function(n,e){var t=[],r=n.dom(),o=E(r.childNodes,N.fromDom);return b(o,function(n){e(n)&&(t=t.concat([n])),t=t.concat(L(n,e))}),t},R={isMatch:function(n){return q.isText(n)&&q.value(n)!==undefined&&s.regExp.test(q.value(n))},filterDescendants:L,findParentElm:function(n,e){for(;n.parentNode;){if(n.parentNode===e)return n;n=n.parentNode}},replaceWithSpans:function(n){return n.replace(s.regExpGlobal,H)}},_=function(n,e){var t,r,o=R.filterDescendants(N.fromDom(e),R.isMatch);b(o,function(e){var o=R.replaceWithSpans(q.value(e));for(r=n.dom.create("div",null,o);t=r.lastChild;)n.dom.insertAfter(t,e.dom());n.dom.remove(e.dom())})},j=function(n,e){var t=n.dom.select(s.selector,e);b(t,function(e){n.dom.remove(e,1)})},z=_,G=j,W=function(n){var e=n.getBody(),t=n.selection.getBookmark(),r=R.findParentElm(n.selection.getNode(),e);r=r!==undefined?r:e,j(n,r),_(n,r),n.selection.moveToBookmark(t)},F=function(n,e){var t,r=n.getBody(),o=n.selection;e.set(!e.get()),c(n,e.get()),t=o.getBookmark(),!0===e.get()?z(n,r):G(n,r),o.moveToBookmark(t)},I=function(n,e){n.addCommand("mceVisualChars",function(){F(n,e)})},J=tinymce.util.Tools.resolve("tinymce.util.Delay"),K=function(n,e){var t=J.debounce(function(){W(n)},300);!1!==n.settings.forced_root_block&&n.on("keydown",function(r){!0===e.get()&&(13===r.keyCode?W(n):t())})},Q=function(n){return function(e){var t=e.control;n.on("VisualChars",function(n){t.active(n.state)})}};u.add("visualchars",function(n){var e,t=o(!1);return I(n,t),(e=n).addButton("visualchars",{active:!1,title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:Q(e)}),e.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:Q(e),selectable:!0,context:"view",prependToContext:!0}),K(n,t),i(t)})}();!function(){"use strict";var e=function(t){var n=t,o=function(){return n};return{get:o,set:function(e){n=e},clone:function(){return e(o())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e,t){e.fire("VisualBlocks",{state:t})},o=function(e){return e.getParam("visualblocks_default_state",!1)},s=function(e){return e.settings.visualblocks_content_css},i=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=i.DOM.uniqueId(),u=function(e,t){var n=c.toArray(e.getElementsByTagName("link"));if(0===c.grep(n,function(e){return e.id===l}).length){var o=i.DOM.create("link",{id:l,rel:"stylesheet",href:t});e.getElementsByTagName("head")[0].appendChild(o)}},a=function(e,t,o){var i=e.dom,c=s(e);u(e.getDoc(),c||t+"/css/visualblocks.css"),i.toggleClass(e.getBody(),"mce-visualblocks"),o.set(!o.get()),n(e,o.get())},r=function(e,t,n){e.addCommand("mceVisualBlocks",function(){a(e,t,n)})},m=function(e,t,n){e.on("PreviewFormats AfterPreviewFormats",function(t){n.get()&&e.dom.toggleClass(e.getBody(),"mce-visualblocks","afterpreviewformats"===t.type)}),e.on("init",function(){o(e)&&a(e,t,n)}),e.on("remove",function(){e.dom.removeClass(e.getBody(),"mce-visualblocks")})},f=function(e,t){return function(n){var o=n.control;o.active(t.get()),e.on("VisualBlocks",function(e){o.active(e.state)})}},d=function(e,t){e.addButton("visualblocks",{active:!1,title:"Show blocks",cmd:"mceVisualBlocks",onPostRender:f(e,t)}),e.addMenuItem("visualblocks",{text:"Show blocks",cmd:"mceVisualBlocks",onPostRender:f(e,t),selectable:!0,context:"view",prependToContext:!0})};t.add("visualblocks",function(t,n){var o=e(!1);r(t,n,o),d(t,o),m(t,n,o)})}();!function(){"use strict";var t=function(e){var n=e,r=function(){return n};return{get:r,set:function(t){n=t},clone:function(){return t(r())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){return{setPatterns:function(e){t.set(e)},getPatterns:function(){return t.get()}}},r=[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"***",end:"***",format:["bold","italic"]},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}],a=function(t){return t.textpattern_patterns!==undefined?t.textpattern_patterns:r},o=tinymce.util.Tools.resolve("tinymce.util.Delay"),i=tinymce.util.Tools.resolve("tinymce.util.VK"),s=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(t,e){for(var n=0;ne.start.length?-1:t.start.length0)return a},c=function(t,e,n){if(!1!==e.collapsed){var r=e.startContainer,a=r.data,o=!0===n?1:0;if(3===r.nodeType){var i=f(t,a,e.startOffset,o);if(i!==undefined){var s=a.lastIndexOf(i.end,e.startOffset-o),l=a.lastIndexOf(i.start,s-i.end.length);if(s=a.indexOf(i.end,l+i.start.length),-1!==l){var c=document.createRange();c.setStart(r,l),c.setEnd(r,s+i.end.length);var u=d(t,c.toString());if(!(i===undefined||u!==i||r.data.length<=i.start.length+i.end.length))return{pattern:i,startOffset:l,endOffset:s}}}}}},u=function(t,e,n){var r=t.selection.getRng(!0),a=c(e,r,n);if(a)return function(t,e,n,r){var a=l.isArray(n.pattern.format)?n.pattern.format:[n.pattern.format];if(0!==l.grep(a,function(e){var n=t.formatter.get(e);return n&&n[0].inline}).length)return t.undoManager.transact(function(){var r,o,i,s;r=e,o=n.pattern,i=n.endOffset,s=n.startOffset,(r=s>0?r.splitText(s):r).splitText(i-s+o.end.length),r.deleteData(0,o.start.length),r.deleteData(r.data.length-o.end.length,o.end.length),e=r,a.forEach(function(n){t.formatter.apply(n,{},e)})}),e}(t,r.startContainer,a)},g={patternFromRng:c,applyInlineFormatSpace:function(t,e){return u(t,e,!0)},applyInlineFormatEnter:function(t,e){return u(t,e,!1)},applyBlockFormat:function(t,e){var n,r,a,o,i,f,c,u,g,h,m;if(n=t.selection,r=t.dom,n.isCollapsed()&&(c=r.getParent(n.getStart(),"p"))){for(g=new s(c,c);i=g.next();)if(3===i.nodeType){o=i;break}if(o){if(!(u=d(e,o.data)))return;if(a=(h=n.getRng(!0)).startContainer,m=h.startOffset,o===a&&(m=Math.max(0,m-u.start.length)),l.trim(o.data).length===u.start.length)return;u.format&&(f=t.formatter.get(u.format))&&f[0].block&&(o.deleteData(0,u.start.length),t.formatter.apply(u.format,{},o),h.setStart(a,m),h.collapse(!0),n.setRng(h)),u.cmd&&t.undoManager.transact(function(){o.deleteData(0,u.start.length),t.execCommand(u.cmd)})}}}},h=function(t,e,n){for(var r=0;r'+(o?"×":"")+"
"};for((a=o(r)).push({text:h.translate("No color"),color:"transparent"}),i='"},k=function(t,e){t.style.background=e,t.setAttribute("data-mce-color",e)},x=function(t){return function(e){var o=e.control;o._color?t.execCommand("mceApplyTextcolor",o.settings.format,o._color):t.execCommand("mceRemoveTextcolor",o.settings.format)}},T=function(t,o){return function(r){var n,a=this.parent(),i=e(t,a.settings.format),u=function(e){a.hidePanel(),a.color(e),t.execCommand("mceApplyTextcolor",a.settings.format,e)};l.DOM.getParent(r.target,".mce-custom-color-btn")&&(a.hidePanel(),y(t).call(t,function(t){var e,r,n,l=a.panel.getEl().getElementsByTagName("table")[0];for(e=c.map(l.rows[l.rows.length-1].childNodes,function(t){return t.firstChild}),n=0;n0&&(r=s.create("div",null)).appendChild(l[0].cloneNode(!0)),a.each(s.select("*",r),function(t){_(t,c(e).replace(/\s+/g,"|"))&&(t.innerHTML=y(e,m(e))),_(t,o(e).replace(/\s+/g,"|"))&&(t.innerHTML=y(e,d(e))),_(t,i(e).replace(/\s+/g,"|"))&&(t.innerHTML=p)}),M(e,r),e.execCommand("mceInsertContent",!1,r.innerHTML),e.addVisual()},S=function(e){e.addCommand("mceInsertTemplate",n(P,e))},w=function(e){e.on("PreProcess",function(t){var n=e.dom,r=d(e);a.each(n.select("div",t.node),function(t){n.hasClass(t,"mceTmpl")&&(a.each(n.select("*",t),function(t){n.hasClass(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=y(e,r))}),x(e,t))})})},D=function(e,t,n){if(-1===n.indexOf("")){var r="";a.each(e.contentCSS,function(t){r+=' '});var l=e.settings.body_class||"";-1!==l.indexOf("=")&&(l=(l=e.getParam("body_class","","hash"))[e.id]||""),n=""+r+''+n+""}n=T(e,n,s(e));var c=t.find("iframe")[0].getEl().contentWindow.document;c.open(),c.write(n),c.close()},H=function(e,t){var n,l,c=[];if(t&&0!==t.length)a.each(t,function(e){c.push({selected:!c.length,text:e.title,value:{url:e.url,content:e.content,description:e.description}})}),(n=e.windowManager.open({title:"Insert template",layout:"flex",direction:"column",align:"stretch",padding:15,spacing:10,items:[{type:"form",flex:0,padding:0,items:[{type:"container",label:"Templates",items:{type:"listbox",label:"Templates",name:"template",values:c,onselect:function(t){var a=t.control.value();a.url?r.send({url:a.url,success:function(t){D(e,n,l=t)}}):(l=a.content,D(e,n,l)),n.find("#description")[0].text(t.control.value().description)}}}]},{type:"label",name:"description",label:"Description",text:"\xa0"},{type:"iframe",flex:1,border:1}],onsubmit:function(){P(e,!1,l)},minWidth:f(e),minHeight:g(e)})).find("listbox")[0].fire("select");else{var o=e.translate("No templates defined.");e.notificationManager.open({text:o,type:"info"})}},C=function(e){return function(t){H(e,t)}},A=function(e){e.addButton("template",{title:"Insert template",onclick:b(e.settings,C(e))}),e.addMenuItem("template",{text:"Template",onclick:b(e.settings,C(e)),icon:"template",context:"insert"})};e.add("template",function(e){A(e),S(e),w(e)})}();!function(){"use strict";var n,t,e,r,o,i,u,a,c,l,s,f=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=function(n){return function(){return n}},m={noop:function(){},noarg:function(n){return function(){return n()}},compose:function(n,t){return function(){return n(t.apply(null,arguments))}},constant:d,identity:function(n){return n},tripleEquals:function(n,t){return n===t},curry:function(n){for(var t=new Array(arguments.length-1),e=1;e-1},C=function(n,t){for(var e=n.length,r=new Array(e),o=0;o=0;e--)t(n[e],e,n)},T=function(n,t){for(var e=[],r=0,o=n.length;r0&&H(i);var u={};return B.each(n,function(n){u[n]=m.constant(r[n])}),B.each(t,function(n){u[n]=m.constant(Object.prototype.hasOwnProperty.call(r,n)?w.some(r[n]):w.none())}),u}}},Y=X.immutable("width","height"),$=X.immutable("rows","columns"),K=X.immutable("row","column"),J=X.immutable("x","y"),Q=X.immutable("element","rowspan","colspan"),Z=X.immutable("element","rowspan","colspan","isNew"),nn={dimensions:Y,grid:$,address:K,coords:J,extended:X.immutable("element","rowspan","colspan","row","column"),detail:Q,detailnew:Z,rowdata:X.immutable("element","cells","section"),elementnew:X.immutable("element","isNew"),rowdatanew:X.immutable("element","cells","section","isNew"),rowcells:X.immutable("cells","section"),rowdetails:X.immutable("details","section"),bounds:X.immutable("startRow","startCol","finishRow","finishCol")},tn=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:m.constant(n)}},en={fromHtml:function(n,t){var e=(t||document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||e.childNodes.length>1)throw console.error("HTML does not have a single root node",n),"HTML must have a single root node";return tn(e.childNodes[0])},fromTag:function(n,t){var e=(t||document).createElement(n);return tn(e)},fromText:function(n,t){var e=(t||document).createTextNode(n);return tn(e)},fromDom:tn,fromPoint:function(n,t,e){return w.from(n.dom().elementFromPoint(t,e)).map(tn)}},rn=8,on=9,un=1,an=3,cn=un,ln=on,sn=function(n){return n.nodeType!==cn&&n.nodeType!==ln||0===n.childElementCount},fn={all:function(n,t){var e=t===undefined?document:t.dom();return sn(e)?[]:B.map(e.querySelectorAll(n),en.fromDom)},is:function(n,t){var e=n.dom();if(e.nodeType!==cn)return!1;if(e.matches!==undefined)return e.matches(t);if(e.msMatchesSelector!==undefined)return e.msMatchesSelector(t);if(e.webkitMatchesSelector!==undefined)return e.webkitMatchesSelector(t);if(e.mozMatchesSelector!==undefined)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},one:function(n,t){var e=t===undefined?document:t.dom();return sn(e)?w.none():w.from(e.querySelector(n)).map(en.fromDom)}},dn=function(n,t){var e=[],r=function(n){return e.push(n),t(n)},o=t(n);do{o=o.bind(r)}while(o.isSome());return e},mn="undefined"!=typeof window?window:Function("return this;")(),gn=function(n,t){for(var e=t!==undefined&&null!==t?t:mn,r=0;r0&&t0?w.some(r[0]):w.none()},filterItems:$t,justCells:function(n){var t=B.map(n.all(),function(n){return n.cells()});return B.flatten(t)}},Jt=function(n){return n.style!==undefined},Qt=function(n,t,e){if(!z.isString(e))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",e,":: Element ",n),new Error("CSS value must be a string: "+e);Jt(n)&&n.style.setProperty(t,e)},Zt=function(n,t){Jt(n)&&n.style.removeProperty(t)},ne=function(n,t,e){var r=n.dom();Qt(r,t,e)},te=function(n,t){return Jt(n)?n.style.getPropertyValue(t):""},ee=function(n,t){var e=n.dom(),r=te(e,t);return w.from(r).filter(function(n){return n.length>0})},re={copy:function(n,t){var e=n.dom(),r=t.dom();Jt(e)&&Jt(r)&&(r.style.cssText=e.style.cssText)},set:ne,preserve:function(n,t){var e=Dt.get(n,"style"),r=t(n);return(e===undefined?Dt.remove:Dt.set)(n,"style",e),r},setAll:function(n,t){var e=n.dom();L.each(t,function(n,t){Qt(e,t,n)})},setOptions:function(n,t){var e=n.dom();L.each(t,function(n,t){n.fold(function(){Zt(e,t)},function(n){Qt(e,t,n)})})},remove:function(n,t){var e=n.dom();Zt(e,t),Dt.has(n,"style")&&""===Yn.trim(Dt.get(n,"style"))&&Dt.remove(n,"style")},get:function(n,t){var e=n.dom(),r=window.getComputedStyle(e).getPropertyValue(t),o=""!==r||Nt.inBody(n)?r:te(e,t);return null===o?undefined:o},getRaw:ee,getAllRaw:function(n){var t={},e=n.dom();if(Jt(e))for(var r=0;r0&&ae.before(n,t),ce(n)}},se=X.immutable("minRow","minCol","maxRow","maxCol"),fe=function(n,t){var e,r,o,i,u,a,c,l,s,f,d=function(n){return fn.is(n.element(),t)},m=Gt(n),g=Kt.generate(m),p=(r=d,o=(e=g).grid().columns(),i=e.grid().rows(),u=o,a=0,c=0,L.each(e.access(),function(n){if(r(n)){var t=n.row(),e=t+n.rowspan()-1,o=n.column(),l=o+n.colspan()-1;ta&&(a=e),oc&&(c=l)}}),se(i,u,a,c)),h="th:not("+t+"),td:not("+t+")",v=gt.filterFirstLayer(n,"th,td",function(n){return fn.is(n,h)});return B.each(v,le.remove),function(n,t,e,r){for(var o,i,u,a=t.grid().columns(),c=t.grid().rows(),l=0;le.maxRow()||fe.maxCol()||(Kt.getAt(t,l,f).filter(r).isNone()?(o=s,i=n[l].element(),u=en.fromTag("td"),ue.append(u,en.fromTag("br")),(o?ue.append:ue.prepend)(i,u)):s=!0)}(m,g,p,d),l=n,s=p,f=B.filter(gt.firstLayer(l,"tr"),function(n){return 0===n.dom().childElementCount}),B.each(f,le.remove),s.minCol()!==s.maxCol()&&s.minRow()!==s.maxRow()||B.each(gt.firstLayer(l,"th,td"),function(n){Dt.remove(n,"rowspan"),Dt.remove(n,"colspan")}),Dt.remove(l,"width"),Dt.remove(l,"height"),re.remove(l,"width"),re.remove(l,"height"),n},de=function(n,t){return en.fromDom(n.dom().cloneNode(t))},me=function(n){return de(n,!0)},ge=function(n,t){var e=en.fromTag(t),r=Dt.clone(n);return Dt.setAll(e,r),e},pe=function(n){return de(n,!1)},he=me,ve=function(n,t){var e=ge(n,t),r=dt.children(me(n));return ae.append(e,r),e},be=(u=xt.isText,a="text",c=function(n){return u(n)?w.from(n.dom().nodeValue):w.none()},l=tt.detect().browser,{get:function(n){if(!u(n))throw new Error("Can only get "+a+" value of a "+a+" node");return s(n).getOr("")},getOption:s=l.isIE()&&10===l.version.major?function(n){try{return c(n)}catch(t){return w.none()}}:c,set:function(n,t){if(!u(n))throw new Error("Can only set raw "+a+" value of a "+a+" node");n.dom().nodeValue=t}}),we={get:function(n){return be.get(n)},getOption:function(n){return be.getOption(n)},set:function(n,t){be.set(n,t)}},ye=function(n){return"img"===xt.name(n)?1:we.getOption(n).fold(function(){return dt.children(n).length},function(n){return n.length})},xe=["img","br"],Ce=ye,Se=function(n){return we.getOption(n).filter(function(n){return 0!==n.trim().length||n.indexOf("\xa0")>-1}).isSome()||B.contains(xe,xt.name(n))},Re=function(n,t){var e=function(n){for(var r=dt.children(n),o=r.length-1;o>=0;o--){var i=r[o];if(t(i))return w.some(i);var u=e(i);if(u.isSome())return u}return w.none()};return e(n)},Te={first:function(n){return Mt.descendant(n,Se)},last:function(n){return Re(n,Se)}},De=function(){var n=en.fromTag("td");return ue.append(n,en.fromTag("br")),n},Ae=function(n,t,e){var r=ve(n,t);return L.each(e,function(n,t){null===n?Dt.remove(r,t):Dt.set(r,t,n)}),r},ke=function(n){return n},Ne=function(n){return function(){return en.fromTag("tr",n.dom())}},Oe=function(n,t,e){return{row:Ne(t),cell:function(t){var r,o,i,u=dt.owner(t.element()),a=en.fromTag(xt.name(t.element()),u.dom()),c=e.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),l=c.length>0?(r=t.element(),o=a,i=c,Te.first(r).map(function(n){var t=i.join(","),e=Bt.ancestors(n,t,function(n){return ot.eq(n,r)});return B.foldr(e,function(n,t){var e=pe(t);return ue.append(n,e),e},o)}).getOr(o)):a;return ue.append(l,en.fromTag("br")),re.copy(t.element(),a),re.remove(a,"height"),1!==t.colspan()&&re.remove(t.element(),"width"),n(t.element(),a),a},replace:Ae,gap:De}},Ee=function(n){return{row:Ne(n),cell:De,replace:ke,gap:De}},Be=function(n,t){var e=(t||document).createElement("div");return e.innerHTML=n,dt.children(en.fromDom(e))},Ie=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Pe=function(){return{up:m.constant({selector:qt.ancestor,closest:qt.closest,predicate:Mt.ancestor,all:dt.parents}),down:m.constant({selector:Bt.descendants,predicate:Et.descendants}),styles:m.constant({get:re.get,getRaw:re.getRaw,set:re.set,remove:re.remove}),attrs:m.constant({get:Dt.get,set:Dt.set,remove:Dt.remove,copyTo:function(n,t){var e=Dt.clone(n);Dt.setAll(t,e)}}),insert:m.constant({before:ue.before,after:ue.after,afterAll:ae.after,append:ue.append,appendAll:ae.append,prepend:ue.prepend,wrap:ue.wrap}),remove:m.constant({unwrap:le.unwrap,remove:le.remove}),create:m.constant({nu:en.fromTag,clone:function(n){return en.fromDom(n.dom().cloneNode(!1))},text:en.fromText}),query:m.constant({comparePosition:function(n,t){return n.dom().compareDocumentPosition(t.dom())},prevSibling:dt.prevSibling,nextSibling:dt.nextSibling}),property:m.constant({children:dt.children,name:xt.name,parent:dt.parent,isText:xt.isText,isComment:xt.isComment,isElement:xt.isElement,getText:we.get,setText:we.set,isBoundary:function(n){return!!xt.isElement(n)&&("body"===xt.name(n)||B.contains(Ie,xt.name(n)))},isEmptyTag:function(n){return!!xt.isElement(n)&&B.contains(["br","img","hr","input"],xt.name(n))}}),eq:ot.eq,is:ot.is}},We=(X.immutable("left","right"),function(n,t,e,r){var o=t(n,e);return B.foldr(r,function(e,r){var o=t(n,r);return _e(n,e,o)},o)}),_e=function(n,t,e){return t.bind(function(t){return e.filter(m.curry(n.eq,t))})},Me=function(n,t,e){return e.length>0?We(n,t,(r=e)[0],r.slice(1)):w.none();var r},Le=function(n,t){return m.curry(n.eq,t)},qe=function(n,t,e,r){var o=r!==undefined?r:m.constant(!1),i=[t].concat(n.up().all(t)),u=[e].concat(n.up().all(e)),a=function(n){return B.findIndex(n,o).fold(function(){return n},function(t){return n.slice(0,t+1)})},c=a(i),l=a(u),s=B.find(c,function(t){return B.exists(l,Le(n,t))});return{firstpath:m.constant(c),secondpath:m.constant(l),shared:m.constant(s)}},ze=qe,Fe=function(n,t,e){return Me(n,t,e)},je=function(n,t,e,r){return ze(n,t,e,r)},He=Pe(),Ve=function(n,t){return Fe(He,function(t,e){return n(e)},t)},Ue=function(n,t,e){return je(He,n,t,e)},Ge=function(n,t){return t.column()>=n.startCol()&&t.column()+t.colspan()-1<=n.finishCol()&&t.row()>=n.startRow()&&t.row()+t.rowspan()-1<=n.finishRow()},Xe=function(n,t){var e=t.column(),r=t.column()+t.colspan()-1,o=t.row(),i=t.row()+t.rowspan()-1;return e<=n.finishCol()&&r>=n.startCol()&&o<=n.finishRow()&&i>=n.startRow()},Ye=function(n,t){for(var e=!0,r=m.curry(Ge,t),o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)e=e&&Kt.getAt(n,o,i).exists(r);return e?w.some(t):w.none()},$e=function(n,t,e){var r=Kt.findItem(n,t,ot.eq),o=Kt.findItem(n,e,ot.eq);return r.bind(function(n){return o.map(function(t){return e=n,r=t,nn.bounds(Math.min(e.row(),r.row()),Math.min(e.column(),r.column()),Math.max(e.row()+e.rowspan()-1,r.row()+r.rowspan()-1),Math.max(e.column()+e.colspan()-1,r.column()+r.colspan()-1));var e,r})})},Ke=$e,Je=function(n,t,e){return $e(n,t,e).bind(function(t){return Ye(n,t)})},Qe=function(n,t,e,r){return Kt.findItem(n,t,ot.eq).bind(function(t){var o=e>0?t.row()+t.rowspan()-1:t.row(),i=r>0?t.column()+t.colspan()-1:t.column();return Kt.getAt(n,o+e,i+r).map(function(n){return n.element()})})},Ze=function(n,t,e){return Ke(n,t,e).map(function(t){var e=Kt.filterItems(n,m.curry(Xe,t));return B.map(e,function(n){return n.element()})})},nr=function(n,t){return Kt.findItem(n,t,function(n,t){return ot.contains(t,n)}).bind(function(n){return n.element()})},tr=function(n){var t=Gt(n);return Kt.generate(t)},er=function(n,t,e){return Vt(n).bind(function(r){var o=tr(r);return Qe(o,n,t,e)})},rr=function(n,t,e){var r=tr(n);return Ze(r,t,e)},or=function(n,t,e,r,o){var i=tr(n),u=ot.eq(n,e)?t:nr(i,t),a=ot.eq(n,o)?r:nr(i,r);return Ze(i,u,a)},ir=function(n,t,e){var r=tr(n);return Je(r,t,e)},ur=function(n,t){return qt.ancestor(n,"table")},ar=X.immutableBag(["boxes","start","finish"],[]),cr=function(n,t,e){var r=function(n){return function(t){return e(t)||ot.eq(t,n)}};return ot.eq(n,t)?w.some(ar({boxes:w.some([n]),start:n,finish:t})):ur(n).bind(function(o){return ur(t).bind(function(i){if(ot.eq(o,i))return w.some(ar({boxes:rr(o,n,t),start:n,finish:t}));if(ot.contains(o,i)){var u=(a=Bt.ancestors(t,"td,th",r(o))).length>0?a[a.length-1]:t;return w.some(ar({boxes:or(o,n,o,t,i),start:n,finish:u}))}if(ot.contains(i,o)){var a,c=(a=Bt.ancestors(n,"td,th",r(i))).length>0?a[a.length-1]:n;return w.some(ar({boxes:or(i,n,o,t,i),start:n,finish:c}))}return Ue(n,t).shared().bind(function(u){return qt.closest(u,"table",e).bind(function(e){var u=Bt.ancestors(t,"td,th",r(e)),a=u.length>0?u[u.length-1]:t,c=Bt.ancestors(n,"td,th",r(e)),l=c.length>0?c[c.length-1]:n;return w.some(ar({boxes:or(e,n,o,t,i),start:l,finish:a}))})})})})},lr=cr,sr=function(n,t){var e=Bt.descendants(n,t);return e.length>0?w.some(e):w.none()},fr=function(n,t,e,r,o){return(i=n,u=o,B.find(i,function(n){return fn.is(n,u)})).bind(function(n){return er(n,t,e).bind(function(n){return e=r,qt.ancestor(t=n,"table").bind(function(n){return qt.descendant(n,e).bind(function(n){return cr(n,t).bind(function(n){return n.boxes().map(function(t){return{boxes:m.constant(t),start:m.constant(n.start()),finish:m.constant(n.finish())}})})})});var t,e})});var i,u},dr=function(n,t,e){return qt.descendant(n,t).bind(function(t){return qt.descendant(n,e).bind(function(n){return Ve(ur,[t,n]).map(function(e){return{first:m.constant(t),last:m.constant(n),table:m.constant(e)}})})})},mr=function(n,t){return sr(n,t)},gr=function(n,t,e){return dr(n,t,e).bind(function(t){var e=function(t){return ot.eq(n,t)},r=qt.ancestor(t.first(),"thead,tfoot,tbody,table",e),o=qt.ancestor(t.last(),"thead,tfoot,tbody,table",e);return r.bind(function(n){return o.bind(function(e){return ot.eq(n,e)?ir(t.table(),t.first(),t.last()):w.none()})})})},pr="data-mce-selected",hr="data-mce-first-selected",vr="data-mce-last-selected",br={selected:m.constant(pr),selectedSelector:m.constant("td[data-mce-selected],th[data-mce-selected]"),attributeSelector:m.constant("[data-mce-selected]"),firstSelected:m.constant(hr),firstSelectedSelector:m.constant("td[data-mce-first-selected],th[data-mce-first-selected]"),lastSelected:m.constant(vr),lastSelectedSelector:m.constant("td[data-mce-last-selected],th[data-mce-last-selected]")},wr=function(n){if(!z.isArray(n))throw new Error("cases must be an array");if(0===n.length)throw new Error("there must be at least one case");var t=[],e={};return B.each(n,function(r,o){var i=L.keys(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(e[u]!==undefined)throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!z.isArray(a))throw new Error("case arguments must be an array");t.push(u),e[u]=function(){var e=arguments.length;if(e!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+e);for(var r=new Array(e),i=0;i1?w.some({bounds:m.constant(n),cells:m.constant(t)}):w.none()})},w.none)},Rr=function(n,t){var e=Cr(n,t);return e.length>0&&B.forall(e,function(n){return Dt.has(n,"rowspan")&&parseInt(Dt.get(n,"rowspan"),10)>1||Dt.has(n,"colspan")&&parseInt(Dt.get(n,"colspan"),10)>1})?w.some(e):w.none()},Tr=Cr,Dr=function(n){return{element:m.constant(n),mergable:w.none,unmergable:w.none,selection:m.constant([n])}},Ar=X.immutable("element","clipboard","generators"),kr={noMenu:Dr,forMenu:function(n,t,e){return{element:m.constant(e),mergable:m.constant(Sr(t,n)),unmergable:m.constant(Rr(e,n)),selection:m.constant(Tr(e,n))}},notCell:function(n){return Dr(n)},paste:Ar,pasteRows:function(n,t,e,r,o){return{element:m.constant(e),mergable:w.none,unmergable:w.none,selection:m.constant(Tr(e,n)),clipboard:m.constant(r),generators:m.constant(o)}}},Nr={registerEvents:function(n,t,e,r){n.on("BeforeGetContent",function(e){!0===e.selection&&xr.cata(t.get(),m.noop,function(t){var r;e.preventDefault(),(r=t,Vt(r[0]).map(he).map(function(n){return[fe(n,br.attributeSelector())]})).each(function(t){e.content=B.map(t,function(t){return e=t,n.selection.serializer.serialize(e.dom(),{});var e}).join("")})},m.noop)}),n.on("BeforeSetContent",function(t){!0===t.selection&&!0===t.paste&&w.from(n.dom.getParent(n.selection.getStart(),"th,td")).each(function(o){var i=en.fromDom(o);Vt(i).bind(function(o){var u=B.filter(Be(t.content),function(n){return"meta"!==xt.name(n)});if(1===u.length&&"table"===xt.name(u[0])){t.preventDefault();var a=en.fromDom(n.getDoc()),c=Ee(a),l=kr.paste(i,u[0],c);e.pasteCells(o,l).each(function(t){n.selection.setRng(t),n.focus(),r.clear(o)})}})})})}},Or={render:function(n,t,e,r){var o=en.fromTag("table");re.setAll(o,{"border-collapse":"collapse",width:"100%"}),Dt.set(o,"border","1");var i=en.fromTag("tbody");ue.append(o,i);for(var u=[],a=0;ao?t-o:0}}},_r=Wr("height",function(n){return Nt.inBody(n)?n.dom().getBoundingClientRect().height:n.dom().offsetHeight}),Mr=function(n){return _r.get(n)},Lr=function(n){return _r.getOuter(n)},qr=Wr("width",function(n){return n.dom().offsetWidth}),zr=function(n){return qr.get(n)},Fr=function(n){return qr.getOuter(n)},jr=tt.detect(),Hr=function(n,t,e){return r=re.get(n,t),o=e,i=parseFloat(r),isNaN(i)?o:i;var r,o,i},Vr=function(n){return jr.browser.isIE()||jr.browser.isEdge()?(e=Hr(t=n,"padding-top",0),r=Hr(t,"padding-bottom",0),o=Hr(t,"border-top-width",0),i=Hr(t,"border-bottom-width",0),u=t.dom().getBoundingClientRect().height,"border-box"===re.get(t,"box-sizing")?u:u-e-r-(o+i)):Hr(n,"height",Mr(n));var t,e,r,o,i,u},Ur=/(\d+(\.\d+)?)(\w|%)*/,Gr=/(\d+(\.\d+)?)%/,Xr=/(\d+(\.\d+)?)px|em/,Yr=function(n,t){re.set(n,"height",t+"px")},$r=function(n,t,e,r){var o,i,u,a,c,l=parseInt(n,10);return Yn.endsWith(n,"%")&&"table"!==xt.name(t)?(i=l,u=e,a=r,c=Vt(o=t).map(function(n){var t=u(n);return Math.floor(i/100*t)}).getOr(i),a(o,c),c):l},Kr=function(n){var t,e=re.getRaw(t=n,"height").getOrThunk(function(){return Vr(t)+"px"});return e?$r(e,n,Mr,Yr):Mr(n)},Jr=function(n,t){return Dt.has(n,t)?parseInt(Dt.get(n,t),10):1},Qr=function(n){return re.getRaw(n,"width").fold(function(){return w.from(Dt.get(n,"width"))},function(n){return w.some(n)})},Zr=function(n,t){return n/t.pixelWidth()*100},no={percentageBasedSizeRegex:m.constant(Gr),pixelBasedSizeRegex:m.constant(Xr),setPixelWidth:function(n,t){re.set(n,"width",t+"px")},setPercentageWidth:function(n,t){re.set(n,"width",t+"%")},setHeight:Yr,getPixelWidth:function(n,t){return Qr(n).fold(function(){var t=zr(n);return parseInt(t,10)},function(e){return function(n,t,e){if(Xr.test(t)){var r=Xr.exec(t);return parseInt(r[1],10)}if(Gr.test(t)){var o=Gr.exec(t),i=parseFloat(o[1]);return i/100*e.pixelWidth()}var u=zr(n);return parseInt(u,10)}(n,e,t)})},getPercentageWidth:function(n,t){return Qr(n).fold(function(){var e=zr(n),r=parseInt(e,10);return Zr(r,t)},function(e){return function(n,t,e){if(Gr.test(t)){var r=Gr.exec(t);return parseFloat(r[1])}var o=zr(n),i=parseInt(o,10);return Zr(i,e)}(n,e,t)})},getGenericWidth:function(n){return Qr(n).bind(function(n){if(Ur.test(n)){var t=Ur.exec(n);return w.some({width:m.constant(t[1]),unit:m.constant(t[3])})}return w.none()})},setGenericWidth:function(n,t,e){re.set(n,"width",t+e)},getHeight:function(n){return e="rowspan",Kr(t=n)/Jr(t,e);var t,e},getRawWidth:Qr},to=function(n,t){no.getGenericWidth(n).each(function(e){var r=e.width()/2;no.setGenericWidth(n,r,e.unit()),no.setGenericWidth(t,r,e.unit())})},eo=function(n,t){var e=t||en.fromDom(document.documentElement);return Mt.ancestor(n,m.curry(ot.eq,e)).isSome()},ro=function(n){var t=n.dom();return t===t.window?n:xt.isDocument(n)?t.defaultView||t.parentWindow:null},oo=function(n,t){return{left:m.constant(n),top:m.constant(t),translate:function(e,r){return oo(n+e,t+r)}}},io=function(n,t){return n!==undefined?n:t!==undefined?t:0},uo=function(n){var t,e=n.dom(),r=e.ownerDocument,o=r.body,i=en.fromDom(r.documentElement);return o===e?oo(o.offsetLeft,o.offsetTop):eo(n,i)?(t=e.getBoundingClientRect(),oo(t.left,t.top)):oo(0,0)},ao=function(n){var t=n.dom().ownerDocument,e=t.body,r=ro(en.fromDom(t)),o=t.documentElement,i=io(r.pageYOffset,o.scrollTop),u=io(r.pageXOffset,o.scrollLeft),a=io(o.clientTop,e.clientTop),c=io(o.clientLeft,e.clientLeft);return uo(n).translate(u-c,i-a)},co=X.immutable("row","y"),lo=X.immutable("col","x"),so=function(n){return ao(n).left()+Fr(n)},fo=function(n){return ao(n).left()},mo=function(n,t){return lo(n,fo(t))},go=function(n,t){return lo(n,so(t))},po=function(n){return ao(n).top()},ho=function(n,t,e){if(0===e.length)return[];var r=B.map(e.slice(1),function(t,e){return t.map(function(t){return n(e,t)})}),o=e[e.length-1].map(function(n){return t(e.length-1,n)});return r.concat([o])},vo={delta:m.identity,positions:m.curry(ho,function(n,t){return co(n,po(t))},function(n,t){return co(n,po(t)+Lr(t))}),edge:po},bo={delta:m.identity,edge:fo,positions:m.curry(ho,mo,go)},wo={height:vo,rtl:{delta:function(n,t){return-n},edge:so,positions:m.curry(ho,go,mo)},ltr:bo},yo={ltr:wo.ltr,rtl:wo.rtl},xo=function(n){var t=function(t){return n(t).isRtl()?yo.rtl:yo.ltr};return{delta:function(n,e){return t(e).delta(n,e)},edge:function(n){return t(n).edge(n)},positions:function(n,e){return t(e).positions(n,e)}}},Co=function(n){var t=Gt(n);return Kt.generate(t).grid()},So=function(n){var t=n,e=function(){return t};return{get:e,set:function(n){t=n},clone:function(){return So(e())}}},Ro=function(n,t){return To(n,t,{validate:z.isFunction,label:"function"})},To=function(n,t,e){if(0===t.length)throw new Error("You must specify at least one required field.");return V("required",t),G(t),function(r){var o=L.keys(r);B.forall(t,function(n){return B.contains(o,n)})||j(t,o),n(t,o);var i=B.filter(t,function(n){return!e.validate(r[n],n)});return i.length>0&&U(i,e.label),r}},Do=m.noop,Ao={exactly:m.curry(Ro,function(n,t){var e=B.filter(t,function(t){return!B.contains(n,t)});e.length>0&&H(e)}),ensure:m.curry(Ro,Do),ensureWith:m.curry(To,Do)},ko=function(n){var t=Dt.has(n,"colspan")?parseInt(Dt.get(n,"colspan"),10):1,e=Dt.has(n,"rowspan")?parseInt(Dt.get(n,"rowspan"),10):1;return{element:m.constant(n),colspan:m.constant(t),rowspan:m.constant(e)}},No=Ao.exactly(["cell","row","replace","gap"]),Oo=function(n,t){No(n);var e=So(w.none()),r=t!==undefined?t:ko,o=function(t){var e,o=r(t);return e=o,n.cell(e)},i=function(n){var t=o(n);return e.get().isNone()&&e.set(w.some(t)),u=w.some({item:n,replacement:t}),t},u=w.none();return{getOrInit:function(n,t){return u.fold(function(){return i(n)},function(e){return t(n,e.item)?e.replacement:i(n)})},cursor:e.get}},Eo=function(n,t){return function(e){var r=So(w.none());No(e);var o=[],i=function(i){var u=e.replace(i,t,{scope:n});return o.push({item:i,sub:u}),r.get().isNone()&&r.set(w.some(u)),u};return{replaceOrInit:function(n,t){return(e=n,r=t,B.find(o,function(n){return r(n.item,e)})).fold(function(){return i(n)},function(e){return t(n,e.item)?e.sub:i(n)});var e,r},cursor:r.get}}},Bo=function(n){No(n);var t=So(w.none());return{combine:function(e){return t.get().isNone()&&t.set(w.some(e)),function(){var t=n.cell({element:m.constant(e),colspan:m.constant(1),rowspan:m.constant(1)});return re.remove(t,"width"),re.remove(e,"width"),t}},cursor:t.get}},Io=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Po=function(n,t){var e=n.property().name(t);return B.contains(Io,e)},Wo=function(n,t){return B.contains(["br","img","hr","input"],n.property().name(t))},_o=Po,Mo=function(n,t){var e=n.property().name(t);return B.contains(["ol","ul"],e)},Lo=Wo,qo=Pe(),zo=function(n){return _o(qo,n)},Fo=function(n){return Mo(qo,n)},jo=function(n){return Lo(qo,n)},Ho=function(n){var t,e=function(n){return"br"===xt.name(n)},r=function(n){return Te.last(n).bind(function(t){var r,o=(r=t,dt.nextSibling(r).map(function(n){return!!zo(n)||(jo(n)?"img"!==xt.name(n):void 0)}).getOr(!1));return dt.parent(t).map(function(r){return!0===o||(i=r,"li"===xt.name(i)||Mt.ancestor(i,Fo).isSome())||e(t)||zo(r)&&!ot.eq(n,r)?[]:[en.fromTag("br")];var i})}).getOr([])},o=0===(t=B.bind(n,function(n){var t,o=dt.children(n);return t=o,B.forall(t,function(n){return e(n)||xt.isText(n)&&0===we.get(n).trim().length})?[]:o.concat(r(n))})).length?[en.fromTag("br")]:t;le.empty(n[0]),ae.append(n[0],o)},Vo=function(n){return function(){for(var t=new Array(arguments.length),e=0;e0?function(t,o){var i=qt.child(n,o).getOrThunk(function(){var t=en.fromTag(o,dt.owner(n).dom());return ue.append(n,t),t});le.empty(i);var u=B.map(t,function(n){n.isNew()&&e.push(n.element());var t=n.element();return le.empty(t),B.each(n.cells(),function(n){n.isNew()&&r.push(n.element()),ri(n.element(),"colspan",n.colspan(),1),ri(n.element(),"rowspan",n.rowspan(),1),ue.append(t,n.element())}),t});ae.append(i,u)}(t,o):qt.child(n,o).bind(le.remove)},i=[],u=[],a=[];return B.each(t,function(n){switch(n.section()){case"thead":i.push(n);break;case"tbody":u.push(n);break;case"tfoot":a.push(n)}}),o(i,"thead"),o(u,"tbody"),o(a,"tfoot"),{newRows:m.constant(e),newCells:m.constant(r)}},ii=function(n){return B.map(n,function(n){var t=pe(n.element());return B.each(n.cells(),function(n){var e=he(n.element());ri(e,"colspan",n.colspan(),1),ri(e,"rowspan",n.rowspan(),1),ue.append(t,e)}),t})},ui=function(n,t){for(var e=[],r=0;r=n.length-1)return w.none();var e=n[t].fold(function(){var e=B.reverse(n.slice(0,t));return $o(e,function(n,t){return n.map(function(n){return{value:n,delta:t+1}})})},function(n){return w.some({value:n,delta:0})}),r=n[t+1].fold(function(){var e=n.slice(t+1);return $o(e,function(n,t){return n.map(function(n){return{value:n,delta:t+1}})})},function(n){return w.some({value:n,delta:1})});return e.bind(function(n){return r.map(function(t){var e=t.delta+n.delta;return Math.abs(t.value-n.value)/e})})},li=function(n,t,e){var r=n();return B.find(r,t).orThunk(function(){return w.from(r[0]).orThunk(e)}).map(function(n){return n.element()})},si=function(n){var t=n.grid(),e=ai(0,t.columns()),r=ai(0,t.rows());return B.map(e,function(t){return li(function(){return B.bind(r,function(e){return Kt.getAt(n,e,t).filter(function(n){return n.column()===t}).fold(m.constant([]),function(n){return[n]})})},function(n){return 1===n.colspan()},function(){return Kt.getAt(n,0,t)})})},fi=function(n){var t=n.grid(),e=ai(0,t.rows()),r=ai(0,t.columns());return B.map(e,function(t){return li(function(){return B.bind(r,function(e){return Kt.getAt(n,t,e).filter(function(n){return n.row()===t}).fold(m.constant([]),function(n){return[n]})})},function(n){return 1===n.rowspan()},function(){return Kt.getAt(n,t,0)})})},di=function(n,t,e,r,o){var i=en.fromTag("div");return re.setAll(i,{position:"absolute",left:t-r/2+"px",top:e+"px",height:o+"px",width:r+"px"}),Dt.setAll(i,{"data-column":n,role:"presentation"}),i},mi=function(n,t,e,r,o){var i=en.fromTag("div");return re.setAll(i,{position:"absolute",left:t+"px",top:e-o/2+"px",height:o+"px",width:r+"px"}),Dt.setAll(i,{"data-row":n,role:"presentation"}),i},gi=function(n){var t=n.replace(/\./g,"-");return{resolve:function(n){return t+"-"+n}}},pi={resolve:gi("ephox-snooker").resolve},hi=function(n,t){var e=Dt.get(n,t);return e===undefined||""===e?[]:e.split(" ")},vi=hi,bi=function(n,t,e){var r=hi(n,t).concat([e]);Dt.set(n,t,r.join(" "))},wi=function(n,t,e){var r=B.filter(hi(n,t),function(n){return n!==e});r.length>0?Dt.set(n,t,r.join(" ")):Dt.remove(n,t)},yi=function(n){return vi(n,"class")},xi=function(n,t){return bi(n,"class",t)},Ci=function(n,t){return wi(n,"class",t)},Si=yi,Ri=xi,Ti=Ci,Di=function(n,t){B.contains(yi(n),t)?Ci(n,t):xi(n,t)},Ai=function(n){return n.dom().classList!==undefined},ki=function(n,t){return Ai(n)&&n.dom().classList.contains(t)},Ni={add:function(n,t){Ai(n)?n.dom().classList.add(t):Ri(n,t)},remove:function(n,t){var e;Ai(n)?n.dom().classList.remove(t):Ti(n,t),0===(Ai(e=n)?e.dom().classList:Si(e)).length&&Dt.remove(e,"class")},toggle:function(n,t){return Ai(n)?n.dom().classList.toggle(t):Di(n,t)},toggler:function(n,t){var e,r,o,i,u,a,c=Ai(n),l=n.dom().classList;return e=function(){c?l.remove(t):Ti(n,t)},r=function(){c?l.add(t):Ri(n,t)},o=ki(n,t),i=o||!1,{on:u=function(){r(),i=!0},off:a=function(){e(),i=!1},toggle:function(){(i?a:u)()},isOn:function(){return i}}},has:ki},Oi=pi.resolve("resizer-bar"),Ei=pi.resolve("resizer-rows"),Bi=pi.resolve("resizer-cols"),Ii=function(n){var t=Bt.descendants(n.parent(),"."+Oi);B.each(t,le.remove)},Pi=function(n,t,e){var r=n.origin();B.each(t,function(t,o){t.each(function(t){var o=e(r,t);Ni.add(o,Oi),ue.append(n.parent(),o)})})},Wi=function(n,t,e,r,o,i){var u,a,c,l,s=ao(t),f=e.length>0?o.positions(e,t):[];u=n,a=f,c=s,l=Fr(t),Pi(u,a,function(n,t){var e=mi(t.row(),c.left()-n.left(),t.y()-n.top(),l,7);return Ni.add(e,Ei),e});var d,m,g,p,h=r.length>0?i.positions(r,t):[];d=n,m=h,g=s,p=Lr(t),Pi(d,m,function(n,t){var e=di(t.col(),t.x()-n.left(),g.top()-n.top(),7,p);return Ni.add(e,Bi),e})},_i=function(n,t){var e=Bt.descendants(n.parent(),"."+Oi);B.each(e,t)},Mi=function(n,t,e,r){Ii(n);var o=Gt(t),i=Kt.generate(o),u=fi(i),a=si(i);Wi(n,t,u,a,e,r)},Li=function(n){_i(n,function(n){re.set(n,"display","none")})},qi=function(n){_i(n,function(n){re.set(n,"display","block")})},zi=Ii,Fi=function(n){return Ni.has(n,Ei)},ji=function(n){return Ni.has(n,Bi)},Hi=function(n,t){return B.map(n,function(n){var e,r=(e=n.details(),$o(e,function(n){return dt.parent(n.element()).map(function(n){var t=dt.parent(n).isNone();return nn.elementnew(n,t)})}).getOrThunk(function(){return nn.elementnew(t.row(),!0)}));return nn.rowdatanew(r.element(),n.details(),n.section(),r.isNew())})},Vi=function(n,t){var e=ti(n,ot.eq);return Hi(e,t)},Ui=function(n,t){var e=B.flatten(B.map(n.all(),function(n){return n.cells()}));return B.find(e,function(n){return ot.eq(t,n.element())})},Gi=function(n,t,e,r,o){return function(i,u,a,c,l){var s=Gt(u),f=Kt.generate(s);return t(f,a).map(function(t){var e=ei(f,c,!1),r=n(e,t,ot.eq,o(c)),i=Vi(r.grid(),c);return{grid:m.constant(i),cursor:r.cursor}}).fold(function(){return w.none()},function(n){var t=oi(u,n.grid());return e(u,n.grid(),l),r(u),Mi(i,u,wo.height,l),w.some({cursor:n.cursor,newRows:t.newRows,newCells:t.newCells})})}},Xi=Vi,Yi=function(n,t){return jt(t.element()).bind(function(t){return Ui(n,t)})},$i=function(n,t){var e=B.map(t.selection(),function(t){return jt(t).bind(function(t){return Ui(n,t)})}),r=Yo(e);return r.length>0?w.some(r):w.none()},Ki=function(n,t){return jt(t.element()).bind(function(e){return Ui(n,e).map(function(n){return Xo.merge(n,{generators:t.generators,clipboard:t.clipboard})})})},Ji=function(n,t){var e=B.map(t.selection(),function(t){return jt(t).bind(function(t){return Ui(n,t)})}),r=Yo(e);return r.length>0?w.some(Xo.merge({cells:r},{generators:t.generators,clipboard:t.clipboard})):w.none()},Qi=function(n,t){return t.mergable()},Zi=function(n,t){return t.unmergable()},nu=function(n){return{is:function(t){return n===t},isValue:m.constant(!0),isError:m.constant(!1),getOr:m.constant(n),getOrThunk:m.constant(n),getOrDie:m.constant(n),or:function(t){return nu(n)},orThunk:function(t){return nu(n)},fold:function(t,e){return e(n)},map:function(t){return nu(t(n))},each:function(t){t(n)},bind:function(t){return t(n)},exists:function(t){return t(n)},forall:function(t){return t(n)},toOption:function(){return w.some(n)}}},tu=function(n){return{is:m.constant(!1),isValue:m.constant(!1),isError:m.constant(!0),getOr:m.identity,getOrThunk:function(n){return n()},getOrDie:function(){return m.die(n)()},or:function(n){return n},orThunk:function(n){return n()},fold:function(t,e){return t(n)},map:function(t){return tu(n)},each:m.noop,bind:function(t){return tu(n)},exists:m.constant(!1),forall:m.constant(!0),toOption:w.none}},eu={value:nu,error:tu},ru=function(n,t){return B.map(n,function(){return nn.elementnew(t.cell(),!0)})},ou=function(n,t,e){return n.concat(ui(t,function(t){return Qo.setCells(n[n.length-1],ru(n[n.length-1].cells(),e))}))},iu=function(n,t,e){return B.map(n,function(n){return Qo.setCells(n,n.cells().concat(ru(ai(0,t),e)))})},uu=function(n,t,e){if(n.row()>=t.length||n.column()>Qo.cellLength(t[0]))return eu.error("invalid start address out of table bounds, row: "+n.row()+", column: "+n.column());var r=t.slice(n.row()),o=r[0].cells().slice(n.column()),i=Qo.cellLength(e[0]),u=e.length;return eu.value({rowDelta:m.constant(r.length-u),colDelta:m.constant(o.length-i)})},au=function(n,t){var e=Qo.cellLength(n[0]),r=Qo.cellLength(t[0]);return{rowDelta:m.constant(0),colDelta:m.constant(e-r)}},cu=function(n,t,e){var r=t.colDelta()<0?iu:m.identity;return(t.rowDelta()<0?ou:m.identity)(r(n,Math.abs(t.colDelta()),e),Math.abs(t.rowDelta()),e)},lu=function(n,t,e,r){if(0===n.length)return n;for(var o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)Qo.mutateCell(n[o],i,nn.elementnew(r(),!1));return n},su=function(n,t,e,r){for(var o=!0,i=0;i0&&t1&&Qo.cellLength(f)>1&&(a>0&&s(Qo.getCellElement(f,a-1))||a0&&s(Qo.getCellElement(i[u-1],a))||u0&&t0&&t0})},yu=function(n,t,e,r){return B.map(n,function(n){return Qo.mapCells(n,function(n){return o=n,B.exists(t,function(n){return e(o.element(),n.element())})?nn.elementnew(r(n.element(),e),!0):n;var o})})},xu=function(n,t,e,r){return Qo.getCellElement(n[t],e)!==undefined&&t>0&&r(Qo.getCellElement(n[t-1],e),Qo.getCellElement(n[t],e))},Cu=function(n,t,e){return t>0&&e(Qo.getCellElement(n,t-1),Qo.getCellElement(n,t))},Su=function(n,t,e,r){var o=B.bind(n,function(r,o){return xu(n,o,t,e)||Cu(r,t,e)?[]:[Qo.getCell(r,t)]});return yu(n,o,e,r)},Ru=function(n,t,e,r){var o=n[t],i=B.bind(o.cells(),function(r,i){return xu(n,t,i,e)||Cu(o,i,e)?[]:[r]});return yu(n,i,e,r)},Tu=function(n){return{fold:n}},Du=function(){return Tu(function(n,t,e,r,o){return n()})},Au=function(n){return Tu(function(t,e,r,o,i){return e(n)})},ku=function(n,t){return Tu(function(e,r,o,i,u){return o(n,t)})},Nu=function(n,t,e){return Tu(function(r,o,i,u,a){return u(n,t,e)})},Ou=function(n,t){return Tu(function(e,r,o,i,u){return u(n,t)})},Eu=function(n,t,e,r){var o,i,u=n.slice(0),a=(i=t,0===(o=n).length?Du():1===o.length?Au(0):0===i?ku(0,1):i===o.length-1?Ou(i-1,i):i>0&&i=0){var o=Math.max(r.minCellWidth(),u[t]-e);return c(u.slice(0,n)).concat([e,o-u[t]]).concat(c(u.slice(t+1)))}var i=Math.max(r.minCellWidth(),u[n]+e),a=u[n]-i;return c(u.slice(0,n)).concat([i-u[n],a]).concat(c(u.slice(t+1)))},f=s;return a.fold(l,function(n){return r.singleColumnWidth(u[n],e)},f,function(n,t,e){return s(t,e)},function(n,t){if(e>=0)return c(u.slice(0,t)).concat([e]);var o=Math.max(r.minCellWidth(),u[t]+e);return c(u.slice(0,t)).concat([o-u[t]])})},Bu=function(n,t){return Dt.has(n,t)&&parseInt(Dt.get(n,t),10)>1},Iu={hasColspan:function(n){return Bu(n,"colspan")},hasRowspan:function(n){return Bu(n,"rowspan")},minWidth:m.constant(10),minHeight:m.constant(10),getInt:function(n,t){return parseInt(re.get(n,t),10)}},Pu=function(n,t,e){return re.getRaw(n,t).fold(function(){return e(n)+"px"},function(n){return n})},Wu=function(n){return Pu(n,"width",no.getPixelWidth)},_u=function(n){return Pu(n,"height",no.getHeight)},Mu=function(n,t,e,r,o){var i=si(n),u=B.map(i,function(n){return n.map(t.edge)});return B.map(i,function(n,t){return n.filter(m.not(Iu.hasColspan)).fold(function(){var n=ci(u,t);return r(n)},function(n){return e(n,o)})})},Lu=function(n){return n.map(function(n){return n+"px"}).getOr("")},qu=function(n,t,e,r){var o=fi(n),i=B.map(o,function(n){return n.map(t.edge)});return B.map(o,function(n,t){return n.filter(m.not(Iu.hasRowspan)).fold(function(){var n=ci(i,t);return r(n)},function(n){return e(n)})})},zu={getRawWidths:function(n,t){return Mu(n,t,Wu,Lu)},getPixelWidths:function(n,t,e){return Mu(n,t,no.getPixelWidth,function(n){return n.getOrThunk(e.minCellWidth)},e)},getPercentageWidths:function(n,t,e){return Mu(n,t,no.getPercentageWidth,function(n){return n.fold(function(){return e.minCellWidth()},function(n){return n/e.pixelWidth()*100})},e)},getPixelHeights:function(n,t){return qu(n,t,no.getHeight,function(n){return n.getOrThunk(Iu.minHeight)})},getRawHeights:function(n,t){return qu(n,t,_u,Lu)}},Fu=function(n,t,e){for(var r=0,o=n;o0&&r.setElementWidth(n,a)},Zu=function(n){0===Ht(n).length&&le.remove(n)},na=X.immutable("grid","cursor"),ta=function(n,t,e){return ea(n,t,e).orThunk(function(){return ea(n,0,0)})},ea=function(n,t,e){return w.from(n[t]).bind(function(n){return w.from(n.cells()[e]).bind(function(n){return w.from(n.element())})})},ra=function(n,t,e){return na(n,ea(n,t,e))},oa=function(n){return B.foldl(n,function(n,t){return B.exists(n,function(n){return n.row()===t.row()})?n:n.concat([t])},[]).sort(function(n,t){return n.row()-t.row()})},ia=function(n){return B.foldl(n,function(n,t){return B.exists(n,function(n){return n.column()===t.column()})?n:n.concat([t])},[]).sort(function(n,t){return n.column()-t.column()})},ua=function(n,t,e){var r=Xt(n,e),o=Kt.generate(r);return ei(o,t,!0)},aa=Qu,ca={insertRowBefore:Gi(function(n,t,e,r){var o=t.row(),i=t.row(),u=gu(n,i,o,e,r.getOrInit);return ra(u,i,t.column())},Yi,m.noop,m.noop,Oo),insertRowsBefore:Gi(function(n,t,e,r){var o=t[0].row(),i=t[0].row(),u=oa(t),a=B.foldl(u,function(n,t){return gu(n,i,o,e,r.getOrInit)},n);return ra(a,i,t[0].column())},$i,m.noop,m.noop,Oo),insertRowAfter:Gi(function(n,t,e,r){var o=t.row(),i=t.row()+t.rowspan(),u=gu(n,i,o,e,r.getOrInit);return ra(u,i,t.column())},Yi,m.noop,m.noop,Oo),insertRowsAfter:Gi(function(n,t,e,r){var o=oa(t),i=o[o.length-1].row(),u=o[o.length-1].row()+o[o.length-1].rowspan(),a=B.foldl(o,function(n,t){return gu(n,u,i,e,r.getOrInit)},n);return ra(a,u,t[0].column())},$i,m.noop,m.noop,Oo),insertColumnBefore:Gi(function(n,t,e,r){var o=t.column(),i=t.column(),u=pu(n,i,o,e,r.getOrInit);return ra(u,t.row(),i)},Yi,aa,m.noop,Oo),insertColumnsBefore:Gi(function(n,t,e,r){var o=ia(t),i=o[0].column(),u=o[0].column(),a=B.foldl(o,function(n,t){return pu(n,u,i,e,r.getOrInit)},n);return ra(a,t[0].row(),u)},$i,aa,m.noop,Oo),insertColumnAfter:Gi(function(n,t,e,r){var o=t.column(),i=t.column()+t.colspan(),u=pu(n,i,o,e,r.getOrInit);return ra(u,t.row(),i)},Yi,aa,m.noop,Oo),insertColumnsAfter:Gi(function(n,t,e,r){var o=t[t.length-1].column(),i=t[t.length-1].column()+t[t.length-1].colspan(),u=ia(t),a=B.foldl(u,function(n,t){return pu(n,i,o,e,r.getOrInit)},n);return ra(a,t[0].row(),i)},$i,aa,m.noop,Oo),splitCellIntoColumns:Gi(function(n,t,e,r){var o=hu(n,t.row(),t.column(),e,r.getOrInit);return ra(o,t.row(),t.column())},Yi,aa,m.noop,Oo),splitCellIntoRows:Gi(function(n,t,e,r){var o=vu(n,t.row(),t.column(),e,r.getOrInit);return ra(o,t.row(),t.column())},Yi,m.noop,m.noop,Oo),eraseColumns:Gi(function(n,t,e,r){var o=ia(t),i=wu(n,o[0].column(),o[o.length-1].column()),u=ta(i,t[0].row(),t[0].column());return na(i,u)},$i,aa,Zu,Oo),eraseRows:Gi(function(n,t,e,r){var o=oa(t),i=bu(n,o[0].row(),o[o.length-1].row()),u=ta(i,t[0].row(),t[0].column());return na(i,u)},$i,m.noop,Zu,Oo),makeColumnHeader:Gi(function(n,t,e,r){var o=Su(n,t.column(),e,r.replaceOrInit);return ra(o,t.row(),t.column())},Yi,m.noop,m.noop,Eo("row","th")),unmakeColumnHeader:Gi(function(n,t,e,r){var o=Su(n,t.column(),e,r.replaceOrInit);return ra(o,t.row(),t.column())},Yi,m.noop,m.noop,Eo(null,"td")),makeRowHeader:Gi(function(n,t,e,r){var o=Ru(n,t.row(),e,r.replaceOrInit);return ra(o,t.row(),t.column())},Yi,m.noop,m.noop,Eo("col","th")),unmakeRowHeader:Gi(function(n,t,e,r){var o=Ru(n,t.row(),e,r.replaceOrInit);return ra(o,t.row(),t.column())},Yi,m.noop,m.noop,Eo(null,"td")),mergeCells:Gi(function(n,t,e,r){var o=t.cells();Ho(o);var i=lu(n,t.bounds(),e,m.constant(o[0]));return na(i,w.from(o[0]))},Qi,m.noop,m.noop,Bo),unmergeCells:Gi(function(n,t,e,r){var o=B.foldr(t,function(n,t){return su(n,t,e,r.combine(t))},n);return na(o,w.from(t[0]))},Zi,aa,m.noop,Bo),pasteCells:Gi(function(n,t,e,r){var o,i,u,a,c=(o=t.clipboard(),i=t.generators(),u=Gt(o),a=Kt.generate(u),ei(a,i,!0)),l=nn.address(t.row(),t.column());return du(l,n,c,t.generators(),e).fold(function(){return na(n,w.some(t.element()))},function(n){var e=ta(n,t.row(),t.column());return na(n,e)})},Ki,aa,m.noop,Oo),pasteRowsBefore:Gi(function(n,t,e,r){var o=n[t.cells[0].row()],i=t.cells[0].row(),u=ua(t.clipboard(),t.generators(),o),a=mu(i,n,u,t.generators(),e),c=ta(a,t.cells[0].row(),t.cells[0].column());return na(a,c)},Ji,m.noop,m.noop,Oo),pasteRowsAfter:Gi(function(n,t,e,r){var o=n[t.cells[0].row()],i=t.cells[t.cells.length-1].row()+t.cells[t.cells.length-1].rowspan(),u=ua(t.clipboard(),t.generators(),o),a=mu(i,n,u,t.generators(),e),c=ta(a,t.cells[0].row(),t.cells[0].column());return na(a,c)},Ji,m.noop,m.noop,Oo)},la=function(n){return en.fromDom(n.getBody())},sa={getBody:la,getIsRoot:function(n){return function(t){return ot.eq(t,la(n))}},addSizeSuffix:function(n){return/^[0-9]+$/.test(n)&&(n+="px"),n},removePxSuffix:function(n){return n?n.replace(/px$/,""):""}},fa=function(n){return"rtl"===re.get(n,"direction")?"rtl":"ltr"},da={onDirection:function(n,t){return function(e){return"rtl"===fa(e)?t:n}},getDirection:fa},ma={isRtl:m.constant(!1)},ga={isRtl:m.constant(!0)},pa=function(n){return"rtl"===da.getDirection(n)?ga:ma},ha=function(n,t){var e,r=function(n){return"table"===xt.name(sa.getBody(n))};!1!==n.settings.table_clone_elements&&("string"==typeof n.settings.table_clone_elements?e=n.settings.table_clone_elements.split(/[ ,]/):Array.isArray(n.settings.table_clone_elements)&&(e=n.settings.table_clone_elements));var o=w.from(e),i=function(t,e,r,i){return function(u,a){var c=Bt.descendants(u,"td[data-mce-style],th[data-mce-style]");B.each(c,function(n){Dt.remove(n,"data-mce-style")});var l=i(),s=en.fromDom(n.getDoc()),f=xo(pa),d=Oe(r,s,o);return e(u)?t(l,u,a,d,f).bind(function(t){return B.each(t.newRows(),function(t){var e;e=t,n.fire("newrow",{node:e.dom()}),e.dom()}),B.each(t.newCells(),function(t){var e;e=t,n.fire("newcell",{node:e.dom()}),e.dom()}),t.cursor().map(function(t){var e=n.dom.createRng();return e.setStart(t.dom(),0),e.setEnd(t.dom(),0),e})}):w.none()}};return{deleteRow:i(ca.eraseRows,function(t){var e=Co(t);return!1===r(n)||e.rows()>1},m.noop,t),deleteColumn:i(ca.eraseColumns,function(t){var e=Co(t);return!1===r(n)||e.columns()>1},m.noop,t),insertRowsBefore:i(ca.insertRowsBefore,m.always,m.noop,t),insertRowsAfter:i(ca.insertRowsAfter,m.always,m.noop,t),insertColumnsBefore:i(ca.insertColumnsBefore,m.always,to,t),insertColumnsAfter:i(ca.insertColumnsAfter,m.always,to,t),mergeCells:i(ca.mergeCells,m.always,m.noop,t),unmergeCells:i(ca.unmergeCells,m.always,m.noop,t),pasteRowsBefore:i(ca.pasteRowsBefore,m.always,m.noop,t),pasteRowsAfter:i(ca.pasteRowsAfter,m.always,m.noop,t),pasteCells:i(ca.pasteCells,m.always,m.noop,t)}},va=function(n,t,e){var r=Gt(n),o=Kt.generate(r);return $i(o,t).map(function(n){var t=ei(o,e,!1).slice(n[0].row(),n[n.length-1].row()+n[n.length-1].rowspan()),r=Xi(t,e);return ii(r)})},ba=tinymce.util.Tools.resolve("tinymce.util.Tools"),wa=tinymce.util.Tools.resolve("tinymce.Env"),ya={applyAlign:function(n,t,e){e&&n.formatter.apply("align"+e,{},t)},applyVAlign:function(n,t,e){e&&n.formatter.apply("valign"+e,{},t)},unApplyAlign:function(n,t){ba.each("left center right".split(" "),function(e){n.formatter.remove("align"+e,{},t)})},unApplyVAlign:function(n,t){ba.each("top middle bottom".split(" "),function(e){n.formatter.remove("valign"+e,{},t)})},getTDTHOverallStyle:function(n,t,e){var r;return r=function(t,r){for(var o=0;o ',t.insertBefore(r,t.firstChild)),ya.unApplyAlign(n,t),o.align&&ya.applyAlign(n,t,o.align),n.focus(),n.addVisual()})},Ta=function(n,t){var e,r,o,i,u,a,c,l,s,f=n.dom,d={};!0===t?(e=f.getParent(n.selection.getStart(),"table"))&&(c=e,l=(a=n).dom,s={width:l.getStyle(c,"width")||l.getAttrib(c,"width"),height:l.getStyle(c,"height")||l.getAttrib(c,"height"),cellspacing:l.getStyle(c,"border-spacing")||l.getAttrib(c,"cellspacing"),cellpadding:l.getAttrib(c,"data-mce-cell-padding")||l.getAttrib(c,"cellpadding")||ya.getTDTHOverallStyle(a.dom,c,"padding"),border:l.getAttrib(c,"data-mce-border")||l.getAttrib(c,"border")||ya.getTDTHOverallStyle(a.dom,c,"border"),borderColor:l.getAttrib(c,"data-mce-border-color"),caption:!!l.select("caption",c)[0],"class":l.getAttrib(c,"class")},ba.each("left center right".split(" "),function(n){a.formatter.matchNode(c,"align"+n)&&(s.align=n)}),!1!==a.settings.table_advtab&&ba.extend(s,Ca.extractAdvancedStyles(l,c)),d=s):(r={label:"Cols",name:"cols"},o={label:"Rows",name:"rows"}),n.settings.table_class_list&&(d["class"]&&(d["class"]=d["class"].replace(/\s*mce\-item\-table\s*/g,"")),i={name:"class",type:"listbox",label:"Class",values:Ca.buildListItems(n.settings.table_class_list,function(t){t.value&&(t.textStyle=function(){return n.formatter.getCssText({block:"table",classes:[t.value]})})})}),u={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:!1!==n.settings.table_appearance_options?[r,o,{label:"Width",name:"width",onchange:m.curry(Ca.updateStyleField,n)},{label:"Height",name:"height",onchange:m.curry(Ca.updateStyleField,n)},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"}]:[r,o,{label:"Width",name:"width",onchange:m.curry(Ca.updateStyleField,n)},{label:"Height",name:"height",onchange:m.curry(Ca.updateStyleField,n)}]},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},i]},!1!==n.settings.table_advtab?n.windowManager.open({title:"Table properties",data:d,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},Ca.createStyleForm(n)],onsubmit:m.curry(Ra,n,e)}):n.windowManager.open({title:"Table properties",data:d,body:u,onsubmit:m.curry(Ra,n,e)})},Da=function(n,t,e){var r=n.getParent(t,"table"),o=t.parentNode,i=n.select(e,r)[0];i||(i=n.create(e),r.firstChild?"CAPTION"===r.firstChild.nodeName?n.insertAfter(i,r.firstChild):r.insertBefore(i,r.firstChild):r.appendChild(i)),i.appendChild(t),o.hasChildNodes()||n.remove(o)};function Aa(n,t,e){var r,o=n.dom;function i(n,t,e){e&&o.setAttrib(n,t,e)}Ca.updateStyleField(n,e),r=e.control.rootControl.toJSON(),n.undoManager.transact(function(){ba.each(t,function(e){var u,a,c;i(e,"scope",r.scope),i(e,"style",r.style),i(e,"class",r["class"]),u=e,a="height",(c=sa.addSizeSuffix(r.height))&&o.setStyle(u,a,c),r.type!==e.parentNode.nodeName.toLowerCase()&&Da(n.dom,e,r.type),1===t.length&&ya.unApplyAlign(n,e),r.align&&ya.applyAlign(n,e,r.align)}),n.focus()})}var ka=function(n){var t,e,r,o,i,u,a,c,l,s,f=n.dom,d=[];t=f.getParent(n.selection.getStart(),"table"),e=f.getParent(n.selection.getStart(),"td,th"),ba.each(t.rows,function(n){ba.each(n.cells,function(t){if(f.getAttrib(t,"data-mce-selected")||t===e)return d.push(n),!1})}),(r=d[0])&&(d.length>1?i={height:"",scope:"","class":"",align:"",type:r.parentNode.nodeName.toLowerCase()}:(c=r,l=(a=n).dom,(s={height:l.getStyle(c,"height")||l.getAttrib(c,"height"),scope:l.getAttrib(c,"scope"),"class":l.getAttrib(c,"class")}).type=c.parentNode.nodeName.toLowerCase(),ba.each("left center right".split(" "),function(n){a.formatter.matchNode(c,"align"+n)&&(s.align=n)}),!1!==a.settings.table_row_advtab&&ba.extend(s,Ca.extractAdvancedStyles(l,c)),i=s),n.settings.table_row_class_list&&(o={name:"class",type:"listbox",label:"Class",values:Ca.buildListItems(n.settings.table_row_class_list,function(t){t.value&&(t.textStyle=function(){return n.formatter.getCssText({block:"tr",classes:[t.value]})})})}),u={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"Header",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},o]},!1!==n.settings.table_row_advtab?n.windowManager.open({title:"Row properties",data:i,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},Ca.createStyleForm(n)],onsubmit:m.curry(Aa,n,d)}):n.windowManager.open({title:"Row properties",data:i,body:u,onsubmit:m.curry(Aa,n,d)}))},Na=function(n,t,e){var r,o=n.dom;function i(n,t,e){e&&o.setAttrib(n,t,e)}function u(n,t,e){e&&o.setStyle(n,t,e)}Ca.updateStyleField(n,e),r=e.control.rootControl.toJSON(),n.undoManager.transact(function(){ba.each(t,function(e){var a,c;i(e,"scope",r.scope),1===t.length?i(e,"style",r.style):(a=e,c=r.style,a.style.cssText+=";"+c),i(e,"class",r["class"]),u(e,"width",sa.addSizeSuffix(r.width)),u(e,"height",sa.addSizeSuffix(r.height)),r.type&&e.nodeName.toLowerCase()!==r.type&&(e=o.rename(e,r.type)),1===t.length&&(ya.unApplyAlign(n,e),ya.unApplyVAlign(n,e)),r.align&&ya.applyAlign(n,e,r.align),r.valign&&ya.applyVAlign(n,e,r.valign)}),n.focus()})},Oa=function(n){var t,e,r,o=[];if(o=n.dom.select("td[data-mce-selected],th[data-mce-selected]"),t=n.dom.getParent(n.selection.getStart(),"td,th"),!o.length&&t&&o.push(t),t=t||o[0]){var i,u,a,c;o.length>1?e={width:"",height:"",scope:"","class":"",align:"",style:"",type:t.nodeName.toLowerCase()}:(u=t,a=(i=n).dom,(c={width:a.getStyle(u,"width")||a.getAttrib(u,"width"),height:a.getStyle(u,"height")||a.getAttrib(u,"height"),scope:a.getAttrib(u,"scope"),"class":a.getAttrib(u,"class")}).type=u.nodeName.toLowerCase(),ba.each("left center right".split(" "),function(n){i.formatter.matchNode(u,"align"+n)&&(c.align=n)}),ba.each("top middle bottom".split(" "),function(n){i.formatter.matchNode(u,"valign"+n)&&(c.valign=n)}),!1!==i.settings.table_cell_advtab&&ba.extend(c,Ca.extractAdvancedStyles(a,u)),e=c),n.settings.table_cell_class_list&&(r={name:"class",type:"listbox",label:"Class",values:Ca.buildListItems(n.settings.table_cell_class_list,function(t){t.value&&(t.textStyle=function(){return n.formatter.getCssText({block:"td",classes:[t.value]})})})});var l={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width",onchange:m.curry(Ca.updateStyleField,n)},{label:"Height",name:"height",onchange:m.curry(Ca.updateStyleField,n)},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},r]};!1!==n.settings.table_cell_advtab?n.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:e,body:[{title:"General",type:"form",items:l},Ca.createStyleForm(n)],onsubmit:m.curry(Na,n,o)}):n.windowManager.open({title:"Cell properties",data:e,body:l,onsubmit:m.curry(Na,n,o)})}},Ea=ba.each,Ba=w.none(),Ia={registerCommands:function(n,t,e,r){var o=sa.getIsRoot(n),i=function(){return en.fromDom(n.dom.getParent(n.selection.getStart(),"th,td"))},u=function(n){return Vt(n,o)},a=function(t){var o=i();u(o).each(function(i){var u=kr.forMenu(r,i,o);t(i,u).each(function(t){n.selection.setRng(t),n.focus(),e.clear(i)})})},c=function(t){var e=i();return u(e).bind(function(t){var o=en.fromDom(n.getDoc()),i=kr.forMenu(r,t,e),u=Oe(m.noop,o,w.none());return va(t,i,u)})},l=function(t){Ba.each(function(o){var a=B.map(o,function(n){return he(n)}),c=i();u(c).bind(function(o){var i=en.fromDom(n.getDoc()),u=Ee(i),l=kr.pasteRows(r,o,c,a,u);t(o,l).each(function(t){n.selection.setRng(t),n.focus(),e.clear(o)})})})};Ea({mceTableSplitCells:function(){a(t.unmergeCells)},mceTableMergeCells:function(){a(t.mergeCells)},mceTableInsertRowBefore:function(){a(t.insertRowsBefore)},mceTableInsertRowAfter:function(){a(t.insertRowsAfter)},mceTableInsertColBefore:function(){a(t.insertColumnsBefore)},mceTableInsertColAfter:function(){a(t.insertColumnsAfter)},mceTableDeleteCol:function(){a(t.deleteColumn)},mceTableDeleteRow:function(){a(t.deleteRow)},mceTableCutRow:function(n){Ba=c(),a(t.deleteRow)},mceTableCopyRow:function(n){Ba=c()},mceTablePasteRowBefore:function(n){l(t.pasteRowsBefore)},mceTablePasteRowAfter:function(n){l(t.pasteRowsAfter)},mceTableDelete:function(){var t=en.fromDom(n.dom.getParent(n.selection.getStart(),"th,td"));Vt(t,o).filter(m.not(o)).each(function(t){var e=en.fromText("");ue.after(t,e),le.remove(t);var r=n.dom.createRng();r.setStart(e.dom(),0),r.setEnd(e.dom(),0),n.selection.setRng(r)})}},function(t,e){n.addCommand(e,t)}),Ea({mceInsertTable:m.curry(Ta,n),mceTableProps:m.curry(Ta,n,!0),mceTableRowProps:m.curry(ka,n),mceTableCellProps:m.curry(Oa,n)},function(t,e){n.addCommand(e,function(n,e){t(e)})})},getClipboardRows:function(){return Ba.fold(function(){},function(n){return B.map(n,function(n){return n.dom()})})},setClipboardRows:function(n){var t=B.map(n,en.fromDom);Ba=w.from(t)}},Pa=function(n){var t=w.from(n.dom().documentElement).map(en.fromDom).getOr(n);return{parent:m.constant(t),view:m.constant(n),origin:m.constant(oo(0,0))}},Wa=function(n,t){return{parent:m.constant(t),view:m.constant(n),origin:m.constant(oo(0,0))}},_a=function(n){var t=X.immutable.apply(null,n),e=[];return{bind:function(n){if(n===undefined)throw"Event bind error: undefined handler";e.push(n)},unbind:function(n){e=B.filter(e,function(t){return t!==n})},trigger:function(){var n=t.apply(null,arguments);B.each(e,function(t){t(n)})}}},Ma=function(n){return{registry:L.map(n,function(n){return{bind:n.bind,unbind:n.unbind}}),trigger:L.map(n,function(n){return n.trigger})}},La={mode:Ao.exactly(["compare","extract","mutate","sink"]),sink:Ao.exactly(["element","start","stop","destroy"]),api:Ao.exactly(["forceDrop","drop","move","delayDrop"])},qa={resolve:gi("ephox-dragster").resolve},za=function(n,t){return function(e){if(n(e)){var r,o,i,u,a,c,l,s=en.fromDom(e.target),f=function(){e.stopPropagation()},d=function(){e.preventDefault()},g=m.compose(d,f),p=(r=s,o=e.clientX,i=e.clientY,u=f,a=d,c=g,l=e,{target:m.constant(r),x:m.constant(o),y:m.constant(i),stop:u,prevent:a,kill:c,raw:m.constant(l)});t(p)}}},Fa=function(n,t,e,r,o){var i=za(e,r);return n.dom().addEventListener(t,i,o),{unbind:m.curry(ja,n,t,i,o)}},ja=function(n,t,e,r){n.dom().removeEventListener(t,e,r)},Ha=function(n,t,e,r){return Fa(n,t,e,r,!1)},Va=m.constant(!0),Ua=function(n,t,e){return Ha(n,t,Va,e)},Ga=La.mode({compare:function(n,t){return oo(t.left()-n.left(),t.top()-n.top())},extract:function(n){return w.some(oo(n.x(),n.y()))},sink:function(n,t){var e,r,o,i=(e=t,r=Xo.merge({layerClass:qa.resolve("blocker")},e),o=en.fromTag("div"),Dt.set(o,"role","presentation"),re.setAll(o,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Ni.add(o,qa.resolve("blocker")),Ni.add(o,r.layerClass),{element:function(){return o},destroy:function(){le.remove(o)}}),u=Ua(i.element(),"mousedown",n.forceDrop),a=Ua(i.element(),"mouseup",n.drop),c=Ua(i.element(),"mousemove",n.move),l=Ua(i.element(),"mouseout",n.delayDrop);return La.sink({element:i.element,start:function(n){ue.append(n,i.element())},stop:function(){le.remove(i.element())},destroy:function(){i.destroy(),a.unbind(),c.unbind(),l.unbind(),u.unbind()}})},mutate:function(n,t){n.mutate(t.left(),t.top())}}),Xa=function(){var n=w.none(),t=Ma({move:_a(["info"])});return{onEvent:function(e,r){r.extract(e).each(function(e){var o,i,u;(o=r,i=e,u=n.map(function(n){return o.compare(n,i)}),n=w.some(i),u).each(function(n){t.trigger.move(n)})})},reset:function(){n=w.none()},events:t.registry}},Ya=function(){var n={onEvent:function(n,t){},reset:m.noop},t=Xa(),e=n;return{on:function(){e.reset(),e=t},off:function(){e.reset(),e=n},isOn:function(){return e===t},onEvent:function(n,t){e.onEvent(n,t)},events:t.events}},$a=function(n,t){var e=null;return{cancel:function(){null!==e&&(clearTimeout(e),e=null)},throttle:function(){var r=arguments;null!==e&&clearTimeout(e),e=setTimeout(function(){n.apply(null,r),e=null,r=null},t)}}},Ka=function(n,t,e){var r=!1,o=Ma({start:_a([]),stop:_a([])}),i=Ya(),u=function(){l.stop(),i.isOn()&&(i.off(),o.trigger.stop())},a=$a(u,200);i.events.move.bind(function(e){t.mutate(n,e.info())});var c=function(n){return function(){var t=Array.prototype.slice.call(arguments,0);if(r)return n.apply(null,t)}},l=t.sink(La.api({forceDrop:u,drop:c(u),move:c(function(n,e){a.cancel(),i.onEvent(n,t)}),delayDrop:c(a.throttle)}),e);return{element:l.element,go:function(n){l.start(n),i.on(),o.trigger.start()},on:function(){r=!0},off:function(){r=!1},destroy:function(){l.destroy()},events:o.registry}},Ja=function(n,t){var e=t!==undefined?t:{},r=e.mode!==undefined?e.mode:Ga;return Ka(n,r,t)},Qa=function(){var n,t=Ma({drag:_a(["xDelta","yDelta","target"])}),e=w.none(),r={mutate:function(t,e){n.trigger.drag(t,e)},events:(n=Ma({drag:_a(["xDelta","yDelta"])})).registry};return r.events.drag.bind(function(n){e.each(function(e){t.trigger.drag(n.xDelta(),n.yDelta(),e)})}),{assign:function(n){e=w.some(n)},get:function(){return e},mutate:r.mutate,events:t.registry}},Za=function(n,t,e){return qt.ancestor(n,t,e).isSome()},nc=pi.resolve("resizer-bar-dragging"),tc=function(n,t){var e=wo.height,r=function(n,t,e){var r=Qa(),o=Ja(r,{}),i=w.none(),u=function(n,t){return w.from(Dt.get(n,t))};r.events.drag.bind(function(n){u(n.target(),"data-row").each(function(t){var e=Iu.getInt(n.target(),"top");re.set(n.target(),"top",e+n.yDelta()+"px")}),u(n.target(),"data-column").each(function(t){var e=Iu.getInt(n.target(),"left");re.set(n.target(),"left",e+n.xDelta()+"px")})});var a=function(n,t){return Iu.getInt(n,t)-parseInt(Dt.get(n,"data-initial-"+t),10)};o.events.stop.bind(function(){r.get().each(function(r){i.each(function(o){u(r,"data-row").each(function(n){var t=a(r,"top");Dt.remove(r,"data-initial-top"),d.trigger.adjustHeight(o,t,parseInt(n,10))}),u(r,"data-column").each(function(n){var t=a(r,"left");Dt.remove(r,"data-initial-left"),d.trigger.adjustWidth(o,t,parseInt(n,10))}),Mi(n,o,e,t)})})});var c=function(t,e){d.trigger.startAdjust(),r.assign(t),Dt.set(t,"data-initial-"+e,parseInt(re.get(t,e),10)),Ni.add(t,nc),re.set(t,"opacity","0.2"),o.go(n.parent())},l=Ua(n.parent(),"mousedown",function(n){Fi(n.target())&&c(n.target(),"top"),ji(n.target())&&c(n.target(),"left")}),s=function(t){return ot.eq(t,n.view())},f=Ua(n.view(),"mouseover",function(r){"table"===xt.name(r.target())||Za(r.target(),"table",s)?(i="table"===xt.name(r.target())?w.some(r.target()):qt.ancestor(r.target(),"table",s)).each(function(r){Mi(n,r,e,t)}):Nt.inBody(r.target())&&zi(n)}),d=Ma({adjustHeight:_a(["table","delta","row"]),adjustWidth:_a(["table","delta","column"]),startAdjust:_a([])});return{destroy:function(){l.unbind(),f.unbind(),o.destroy(),zi(n)},refresh:function(r){Mi(n,r,e,t)},on:o.on,off:o.off,hideBars:m.curry(Li,n),showBars:m.curry(qi,n),events:d.registry}}(n,t,e),o=Ma({beforeResize:_a(["table"]),afterResize:_a(["table"]),startDrag:_a([])});return r.events.adjustHeight.bind(function(n){o.trigger.beforeResize(n.table());var t=e.delta(n.delta(),n.table());Ju(n.table(),t,n.row(),e),o.trigger.afterResize(n.table())}),r.events.startAdjust.bind(function(n){o.trigger.startDrag()}),r.events.adjustWidth.bind(function(n){o.trigger.beforeResize(n.table());var e=t.delta(n.delta(),n.table());Ku(n.table(),e,n.column(),t),o.trigger.afterResize(n.table())}),{on:r.on,off:r.off,hideBars:r.hideBars,showBars:r.showBars,destroy:r.destroy,events:o.registry}},ec=function(n,t){return n.inline?Wa(sa.getBody(n),(e=en.fromTag("div"),re.setAll(e,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),ue.append(Nt.body(),e),e)):Pa(en.fromDom(n.getDoc()));var e},rc=function(n,t){n.inline&&le.remove(t.parent())},oc=function(n){var t,e,r=w.none(),o=w.none(),i=w.none(),u=/(\d+(\.\d+)?)%/,a=function(n){return"TABLE"===n.nodeName};return n.on("init",function(){var t=xo(pa),e=ec(n);if(i=w.some(e),n.settings.object_resizing&&!1!==n.settings.table_resize_bars&&(!0===n.settings.object_resizing||"table"===n.settings.object_resizing)){var u=tc(e,t);u.on(),u.events.startDrag.bind(function(t){r=w.some(n.selection.getRng())}),u.events.afterResize.bind(function(t){var e=t.table(),o=Bt.descendants(e,"td[data-mce-style],th[data-mce-style]");B.each(o,function(n){Dt.remove(n,"data-mce-style")}),r.each(function(t){n.selection.setRng(t),n.focus()}),n.undoManager.add()}),o=w.some(u)}}),n.on("ObjectResizeStart",function(r){var o;a(r.target)&&(t=r.width,o=r.target,e=n.dom.getStyle(o,"width")||n.dom.getAttrib(o,"width"))}),n.on("ObjectResized",function(r){if(a(r.target)){var o=r.target;if(u.test(e)){var i=parseFloat(u.exec(e)[1]),c=r.width*i/t;n.dom.setStyle(o,"width",c+"%")}else{var l=[];ba.each(o.rows,function(t){ba.each(t.cells,function(t){var e=n.dom.getStyle(t,"width",!0);l.push({cell:t,width:e})})}),ba.each(l,function(t){n.dom.setStyle(t.cell,"width",t.width),n.dom.setAttrib(t.cell,"width",null)})}}}),{lazyResize:function(){return o},lazyWire:function(){return i.getOr(Pa(en.fromDom(n.getBody())))},destroy:function(){o.each(function(n){n.destroy()}),i.each(function(t){rc(n,t)})}}},ic=function(n){return{fold:n}},uc=function(n){return ic(function(t,e,r,o){return t(n)})},ac=function(n){return ic(function(t,e,r,o){return e(n)})},cc=function(n,t){return ic(function(e,r,o,i){return o(n,t)})},lc=function(n){return ic(function(t,e,r,o){return o(n)})},sc=function(n,t){return Vt(n,t).bind(function(t){var e=Ht(t);return B.findIndex(e,function(t){return ot.eq(n,t)}).map(function(n){return{index:m.constant(n),all:m.constant(e)}})})},fc=function(n,t){return sc(n,t).fold(function(){return uc(n)},function(t){return t.index()+1=0?cc(n,t.all()[t.index()-1]):ac(n)})},mc=wr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),gc={before:mc.before,on:mc.on,after:mc.after,cata:function(n,t,e,r){return n.fold(t,e,r)},getStart:function(n){return n.fold(m.identity,m.identity,m.identity)}},pc=wr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),hc=X.immutable("start","soffset","finish","foffset"),vc={domRange:pc.domRange,relative:pc.relative,exact:pc.exact,exactFromRange:function(n){return pc.exact(n.start(),n.soffset(),n.finish(),n.foffset())},range:hc,getWin:function(n){var t=n.match({domRange:function(n){return en.fromDom(n.startContainer)},relative:function(n,t){return gc.getStart(n)},exact:function(n,t,e,r){return n}});return dt.defaultView(t)}},bc=function(n,t,e,r){var o=dt.owner(n).dom().createRange();return o.setStart(n.dom(),t),o.setEnd(e.dom(),r),o},wc=function(n,t,e,r){var o=bc(n,t,e,r),i=ot.eq(n,e)&&t===r;return o.collapsed&&!i},yc=function(n,t){n.selectNodeContents(t.dom())},xc=function(n){n.deleteContents()},Cc=function(n){return{left:m.constant(n.left),top:m.constant(n.top),right:m.constant(n.right),bottom:m.constant(n.bottom),width:m.constant(n.width),height:m.constant(n.height)}},Sc={create:function(n){return n.document.createRange()},replaceWith:function(n,t){xc(n),n.insertNode(t.dom())},selectNodeContents:function(n,t){var e=n.document.createRange();return yc(e,t),e},selectNodeContentsUsing:yc,relativeToNative:function(n,t,e){var r,o,i=n.document.createRange();return r=i,t.fold(function(n){r.setStartBefore(n.dom())},function(n,t){r.setStart(n.dom(),t)},function(n){r.setStartAfter(n.dom())}),o=i,e.fold(function(n){o.setEndBefore(n.dom())},function(n,t){o.setEnd(n.dom(),t)},function(n){o.setEndAfter(n.dom())}),i},exactToNative:function(n,t,e,r,o){var i=n.document.createRange();return i.setStart(t.dom(),e),i.setEnd(r.dom(),o),i},deleteContents:xc,cloneFragment:function(n){var t=n.cloneContents();return en.fromDom(t)},getFirstRect:function(n){var t=n.getClientRects(),e=t.length>0?t[0]:n.getBoundingClientRect();return e.width>0||e.height>0?w.some(e).map(Cc):w.none()},getBounds:function(n){var t=n.getBoundingClientRect();return t.width>0||t.height>0?w.some(t).map(Cc):w.none()},isWithin:function(n,t){return t.compareBoundaryPoints(n.END_TO_START,n)<1&&t.compareBoundaryPoints(n.START_TO_END,n)>-1},toString:function(n){return n.toString()}},Rc=wr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Tc=function(n,t,e){return t(en.fromDom(e.startContainer),e.startOffset,en.fromDom(e.endContainer),e.endOffset)},Dc=function(n,t){var e,r,o,i=(e=n,t.match({domRange:function(n){return{ltr:m.constant(n),rtl:w.none}},relative:function(n,t){return{ltr:yn(function(){return Sc.relativeToNative(e,n,t)}),rtl:yn(function(){return w.some(Sc.relativeToNative(e,t,n))})}},exact:function(n,t,r,o){return{ltr:yn(function(){return Sc.exactToNative(e,n,t,r,o)}),rtl:yn(function(){return w.some(Sc.exactToNative(e,r,o,n,t))})}}}));return(o=(r=i).ltr()).collapsed?r.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return Rc.rtl(en.fromDom(n.endContainer),n.endOffset,en.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return Tc(0,Rc.ltr,o)}):Tc(0,Rc.ltr,o)},Ac=(Rc.ltr,Rc.rtl,Dc),kc=function(n,t){return Dc(n,t).match({ltr:function(t,e,r,o){var i=n.document.createRange();return i.setStart(t.dom(),e),i.setEnd(r.dom(),o),i},rtl:function(t,e,r,o){var i=n.document.createRange();return i.setStart(r.dom(),o),i.setEnd(t.dom(),e),i}})},Nc=function(n,t,e){return t>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom},Oc=function(n,t,e,r,o){if(0===o)return 0;if(t===r)return o-1;for(var i=r,u=1;ua.bottom);else{if(ei)return u-1;i=c}}return 0},Ec={locate:function(n,t,e,r){var o=n.dom().createRange();o.selectNode(t.dom());var i=o.getClientRects();return $o(i,function(n){return Nc(n,e,r)?w.some(n):w.none()}).map(function(o){return i=n,a=e,c=r,l=o,s=function(n){var t=i.dom().createRange();return t.setStart(u.dom(),n),t.collapse(!0),t},f=we.get(u=t).length,d=Oc(function(n){return s(n).getBoundingClientRect()},a,c,l.right,f),s(d);var i,u,a,c,l,s,f,d})}},Bc=function(n,t,e,r){var o=n.dom().createRange(),i=dt.children(t);return $o(i,function(t){return o.selectNode(t.dom()),Nc(o.getBoundingClientRect(),e,r)?Ic(n,t,e,r):w.none()})},Ic=function(n,t,e,r){return(xt.isText(t)?Ec.locate:Bc)(n,t,e,r)},Pc=function(n,t,e,r){var o=n.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,e)),a=Math.max(i.top,Math.min(i.bottom,r));return Ic(n,t,u,a)},Wc=function(n,t){return t-n.left0){var t=n.getRangeAt(0),e=n.getRangeAt(n.rangeCount-1);return w.some(vc.range(en.fromDom(t.startContainer),t.startOffset,en.fromDom(e.endContainer),e.endOffset))}return w.none()}(n)},Qc=function(n){var t=n.getSelection();return t.rangeCount>0?Jc(t):w.none()},Zc=function(n,t,e,r,o){var i=Xc(t,e,r,o);Kc(n,i)},nl=function(n){return Qc(n).map(function(n){return vc.exact(n.start(),n.soffset(),n.finish(),n.foffset())})},tl=function(n,t,e){var r=Gc(t,e);Kc(n,r)},el=function(n){var t=vc.getWin(n).dom(),e=function(n,e,r,o){return Sc.exactToNative(t,n,e,r,o)},r=Uc(n);return Ac(t,r).match({ltr:e,rtl:e})},rl=function(n,t){var e=Sc.selectNodeContents(n,t);Yc(n,e)},ol=function(n){n.getSelection().removeAllRanges()},il=function(n,t){var e=kc(n,t);return Sc.getFirstRect(e)},ul=function(n,t,e){return Fc(n,t,e)},al=tinymce.util.Tools.resolve("tinymce.util.VK"),cl=function(n,t,e,r){return fl(n,t,fc(e),r)},ll=function(n,t,e,r){return fl(n,t,dc(e),r)},sl=function(n,t){var e=vc.exact(t,0,t,0);return el(e)},fl=function(n,t,e,r,o){return e.fold(w.none,w.none,function(n,t){return Te.first(t).map(function(n){return sl(0,n)})},function(e){return Vt(e,t).bind(function(t){var o,i=kr.noMenu(e);return n.undoManager.transact(function(){r.insertRowsAfter(t,i)}),o=Bt.descendants(t,"tr"),B.last(o).bind(function(n){return qt.descendant(n,"td,th").map(function(n){return sl(0,n)})})})})},dl=["table","li","dl"],ml={handle:function(n,t,e,r){if(n.keyCode===al.TAB){var o=sa.getBody(t),i=function(n){var t=xt.name(n);return ot.eq(n,o)||B.contains(dl,t)},u=t.selection.getRng();if(u.collapsed){var a=en.fromDom(u.startContainer);jt(a,i).each(function(o){n.preventDefault(),(n.shiftKey?ll:cl)(t,i,o,e,r).each(function(n){t.selection.setRng(n)})})}}}},gl={response:X.immutable("selection","kill")},pl=function(n){return function(t){return t===n}},hl=pl(38),vl=pl(40),bl={ltr:{isBackward:pl(37),isForward:pl(39)},rtl:{isBackward:pl(39),isForward:pl(37)},isUp:hl,isDown:vl,isNavigation:function(n){return n>=37&&n<=40}},wl=function(n,t){var e=kc(n,t);return{start:m.constant(en.fromDom(e.startContainer)),soffset:m.constant(e.startOffset),finish:m.constant(en.fromDom(e.endContainer)),foffset:m.constant(e.endOffset)}},yl=function(n,t,e,r){return{start:m.constant(gc.on(n,t)),finish:m.constant(gc.on(e,r))}},xl=(tt.detect().browser.isSafari(),function(n){var t=n!==undefined?n.dom():document,e=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return oo(e,r)}),Cl=xl,Sl=function(n,t,e){(e!==undefined?e.dom():document).defaultView.scrollBy(n,t)},Rl=function(n){return{elementFromPoint:function(t,e){return w.from(n.document.elementFromPoint(t,e)).map(en.fromDom)},getRect:function(n){return n.dom().getBoundingClientRect()},getRangedRect:function(t,e,r,o){var i=vc.exact(t,e,r,o);return il(n,i).map(function(n){return L.map(n,m.apply)})},getSelection:function(){return nl(n).map(function(t){return wl(n,t)})},fromSitus:function(t){var e=vc.relative(t.start(),t.finish());return wl(n,e)},situsFromPoint:function(t,e){return ul(n,t,e).map(function(n){return{start:m.constant(gc.on(n.start(),n.soffset())),finish:m.constant(gc.on(n.finish(),n.foffset()))}})},clearSelection:function(){ol(n)},setSelection:function(t){Zc(n,t.start(),t.soffset(),t.finish(),t.foffset())},setRelativeSelection:function(t,e){tl(n,t,e)},selectContents:function(t){rl(n,t)},getInnerHeight:function(){return n.innerHeight},getScrollY:function(){return Cl(en.fromDom(n.document)).top()},scrollBy:function(t,e){Sl(t,e,en.fromDom(n.document))}}},Tl=function(n,t,e,r,o){if(!ot.eq(e,r))return lr(e,r,t).bind(function(t){var r=t.boxes().getOr([]);return r.length>0?(o(n,r,t.start(),t.finish()),w.some(gl.response(w.some(yl(e,0,e,Ce(e))),!0))):w.none()})},Dl={sync:function(n,t,e,r,o,i,u){return ot.eq(e,o)&&r===i?w.none():qt.closest(e,"td,th",t).bind(function(e){return qt.closest(o,"td,th",t).bind(function(r){return Tl(n,t,e,r,u)})})},detect:Tl,update:function(n,t,e,r,o){return fr(r,n,t,o.firstSelectedSelector(),o.lastSelectedSelector()).map(function(n){return o.clear(e),o.selectRange(e,n.boxes(),n.start(),n.finish()),n.boxes()})}},Al=X.immutableBag(["left","top","right","bottom"],[]),kl={nu:Al,moveUp:function(n,t){return Al({left:n.left(),top:n.top()-t,right:n.right(),bottom:n.bottom()-t})},moveDown:function(n,t){return Al({left:n.left(),top:n.top()+t,right:n.right(),bottom:n.bottom()+t})},moveBottomTo:function(n,t){var e=n.bottom()-n.top();return Al({left:n.left(),top:t-e,right:n.right(),bottom:t})},moveTopTo:function(n,t){var e=n.bottom()-n.top();return Al({left:n.left(),top:t,right:n.right(),bottom:t+e})},getTop:function(n){return n.top()},getBottom:function(n){return n.bottom()},translate:function(n,t,e){return Al({left:n.left()+t,top:n.top()+e,right:n.right()+t,bottom:n.bottom()+e})},toString:function(n){return"("+n.left()+", "+n.top()+") -> ("+n.right()+", "+n.bottom()+")"}},Nl=function(n){return kl.nu({left:n.left,top:n.top,right:n.right,bottom:n.bottom})},Ol=function(n,t){return w.some(n.getRect(t))},El=function(n,t,e){return xt.isElement(t)?Ol(n,t).map(Nl):xt.isText(t)?(r=n,o=t,i=e,i>=0&&i0?r.getRangedRect(o,i-1,o,i):w.none()).map(Nl):w.none();var r,o,i},Bl=function(n,t){return xt.isElement(t)?Ol(n,t).map(Nl):xt.isText(t)?n.getRangedRect(t,0,t,Ce(t)).map(Nl):w.none()},Il=X.immutable("item","mode"),Pl=function(n,t,e,r){var o=r!==undefined?r:Wl;return n.property().parent(t).map(function(n){return Il(n,o)})},Wl=function(n,t,e,r){var o=r!==undefined?r:_l;return e.sibling(n,t).map(function(n){return Il(n,o)})},_l=function(n,t,e,r){var o=r!==undefined?r:_l,i=n.property().children(t);return e.first(i).map(function(n){return Il(n,o)})},Ml=[{current:Pl,next:Wl,fallback:w.none()},{current:Wl,next:_l,fallback:w.some(Pl)},{current:_l,next:_l,fallback:w.some(Wl)}],Ll=function(n,t,e,r,o){return o=o!==undefined?o:Ml,B.find(o,function(n){return n.current===e}).bind(function(e){return e.current(n,t,r,e.next).orThunk(function(){return e.fallback.bind(function(e){return Ll(n,t,e,r)})})})},ql={backtrack:Pl,sidestep:Wl,advance:_l,go:Ll},zl={left:function(){return{sibling:function(n,t){return n.query().prevSibling(t)},first:function(n){return n.length>0?w.some(n[n.length-1]):w.none()}}},right:function(){return{sibling:function(n,t){return n.query().nextSibling(t)},first:function(n){return n.length>0?w.some(n[0]):w.none()}}}},Fl=function(n,t,e,r,o,i){return ql.go(n,t,r,o).bind(function(t){return i(t.item())?w.none():e(t.item())?w.some(t.item()):Fl(n,t.item(),e,t.mode(),o,i)})},jl=function(n,t,e,r){return Fl(n,t,e,ql.sidestep,zl.left(),r)},Hl=function(n,t,e,r){return Fl(n,t,e,ql.sidestep,zl.right(),r)},Vl=function(n,t){return 0===n.property().children(t).length},Ul=function(n,t,e,r){return jl(n,t,e,r)},Gl=function(n,t,e,r){return Hl(n,t,e,r)},Xl={before:function(n,t,e){return Ul(n,t,m.curry(Vl,n),e)},after:function(n,t,e){return Gl(n,t,m.curry(Vl,n),e)},seekLeft:Ul,seekRight:Gl,walkers:function(){return{left:zl.left,right:zl.right}},walk:function(n,t,e,r,o){return ql.go(n,t,e,r,o)},backtrack:ql.backtrack,sidestep:ql.sidestep,advance:ql.advance},Yl=Pe(),$l={gather:function(n,t,e){return Xl.gather(Yl,n,t,e)},before:function(n,t){return Xl.before(Yl,n,t)},after:function(n,t){return Xl.after(Yl,n,t)},seekLeft:function(n,t,e){return Xl.seekLeft(Yl,n,t,e)},seekRight:function(n,t,e){return Xl.seekRight(Yl,n,t,e)},walkers:function(){return Xl.walkers()},walk:function(n,t,e,r){return Xl.walk(Yl,n,t,e,r)}},Kl=wr([{none:[]},{retry:["caret"]}]),Jl=function(n,t,e){return Mt.closest(t,zo).fold(m.constant(!1),function(t){return Bl(n,t).exists(function(n){return r=n,(t=e).left()r.right();var t,r})})},Ql={point:kl.getTop,adjuster:function(n,t,e,r,o){var i=kl.moveUp(o,5);return Math.abs(e.top()-r.top())<1?Kl.retry(i):e.bottom()o.bottom()?Kl.retry(i):e.top()===o.bottom()?Kl.retry(kl.moveDown(o,1)):Jl(n,t,o)?Kl.retry(kl.translate(i,5,0)):Kl.none()},move:kl.moveDown,gather:$l.after},ns=function(n,t,e,r,o){return 0===o?w.some(r):(c=n,l=r.left(),s=t.point(r),c.elementFromPoint(l,s).filter(function(n){return"table"===xt.name(n)}).isSome()?(u=r,a=o-1,ns(n,i=t,e,i.move(u,5),a)):n.situsFromPoint(r.left(),t.point(r)).bind(function(i){return i.start().fold(w.none,function(i,u){return Bl(n,i,u).bind(function(u){return t.adjuster(n,i,u,e,r).fold(w.none,function(r){return ns(n,t,e,r,o-1)})}).orThunk(function(){return w.some(r)})},w.none)}));var i,u,a,c,l,s},ts=function(n,t,e){var r,o,i,u=n.move(e,5),a=ns(t,n,e,u,100).getOr(u);return(r=n,o=a,i=t,r.point(o)>i.getInnerHeight()?w.some(r.point(o)-i.getInnerHeight()):r.point(o)<0?w.some(-r.point(o)):w.none()).fold(function(){return t.situsFromPoint(a.left(),n.point(a))},function(e){return t.scrollBy(0,e),t.situsFromPoint(a.left(),n.point(a)-e)})},es={tryUp:m.curry(ts,Ql),tryDown:m.curry(ts,Zl),ieTryUp:function(n,t){return n.situsFromPoint(t.left(),t.top()-5)},ieTryDown:function(n,t){return n.situsFromPoint(t.left(),t.bottom()+5)},getJumpSize:m.constant(5)},rs=wr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),os=function(n){return qt.closest(n,"tr")},is={verify:function(n,t,e,r,o,i,u){return qt.closest(r,"td,th",u).bind(function(e){return qt.closest(t,"td,th",u).map(function(t){return ot.eq(e,t)?ot.eq(r,e)&&Ce(e)===o?i(t):rs.none("in same cell"):Ve(os,[e,t]).fold(function(){return o=t,u=e,a=(r=n).getRect(o),(c=r.getRect(u)).right>a.left&&c.left1||1===r.length&&!ot.eq(t,n))&&(a.selectRange(i,r,e.start(),e.finish()),o.selectContents(n))})})})},mouseup:function(){c.each(l)}});return{mousedown:f.mousedown,mouseover:f.mouseover,mouseup:f.mouseup}},Bs=function(n,t,e,r){var o=Rl(n),i=function(){return r.clear(t),w.none()};return{keydown:function(n,u,a,c,l,s){var f=n.raw().which,d=!0===n.raw().shiftKey;return sr(t,r.selectedSelector()).fold(function(){return bl.isDown(f)&&d?m.curry(Ts,o,t,e,Ns.down,c,u,r.selectRange):bl.isUp(f)&&d?m.curry(Ts,o,t,e,Ns.up,c,u,r.selectRange):bl.isDown(f)?m.curry(Rs,o,e,Ns.down,c,u,As):bl.isUp(f)?m.curry(Rs,o,e,Ns.up,c,u,Ds):w.none},function(n){var e=function(e){return function(){return $o(e,function(e){return Dl.update(e.rows(),e.cols(),t,n,r)}).fold(function(){return dr(t,r.firstSelectedSelector(),r.lastSelectedSelector()).map(function(n){var e=bl.isDown(f)||s.isForward(f)?gc.after:gc.before;return o.setRelativeSelection(gc.on(n.first(),0),e(n.table())),r.clear(t),gl.response(w.none(),!0)})},function(n){return w.some(gl.response(w.none(),!0))})}};return bl.isDown(f)&&d?e([Os(1,0)]):bl.isUp(f)&&d?e([Os(-1,0)]):s.isBackward(f)&&d?e([Os(0,-1),Os(-1,0)]):s.isForward(f)&&d?e([Os(0,1),Os(1,0)]):bl.isNavigation(f)&&!1===d?i:w.none})()},keyup:function(n,o,i,u,a){return sr(t,r.selectedSelector()).fold(function(){var c=n.raw().which;return 0==(!0===n.raw().shiftKey)?w.none():bl.isNavigation(c)?Dl.sync(t,e,o,i,u,a,r.selectRange):w.none()},w.none)}}},Is=function(n){var t=function(t){Dt.remove(t,n.selected()),Dt.remove(t,n.firstSelected()),Dt.remove(t,n.lastSelected())},e=function(t){Dt.set(t,n.selected(),"1")},r=function(e){var r=Bt.descendants(e,n.selectedSelector());B.each(r,t)};return{clear:r,selectRange:function(t,o,i,u){r(t),B.each(o,e),Dt.set(i,n.firstSelected(),"1"),Dt.set(u,n.lastSelected(),"1")},selectedSelector:n.selectedSelector,firstSelectedSelector:n.firstSelectedSelector,lastSelectedSelector:n.lastSelectedSelector}},Ps=function(n,t){var e=X.immutableBag(["mousedown","mouseover","mouseup","keyup","keydown"],[]),r=w.none(),o=Is(br);return n.on("init",function(i){var u=n.getWin(),a=sa.getBody(n),c=sa.getIsRoot(n),l=Es(u,a,c,o),s=Bs(u,a,c,o),f=function(t,e){e.kill()&&t.kill(),e.selection().each(function(t){var e=vc.relative(t.start(),t.finish()),r=kc(u,e);n.selection.setRng(r)})},d=function(t){var e=h(t);if(e.raw().shiftKey&&bl.isNavigation(e.raw().which)){var r=n.selection.getRng(),o=en.fromDom(r.startContainer),i=en.fromDom(r.endContainer);s.keyup(e,o,r.startOffset,i,r.endOffset).each(function(n){f(e,n)})}},g=function(n){return!(Dt.has(n,"data-mce-bogus")||"br"===xt.name(n)||xt.isText(n)&&0===we.get(n).length)},p=function(e){var r,o,i=h(e);t().each(function(n){n.hideBars()}),40===e.which&&(r=en.fromDom(n.getBody()),o=function(n){return dt.prevSibling(n).bind(function(n){return g(n)?w.some(n):o(n)})},dt.lastChild(r).bind(function(n){return g(n)?w.some(n):o(n)})).each(function(t){"table"===xt.name(t)&&(n.settings.forced_root_block?n.dom.add(n.getBody(),n.settings.forced_root_block,n.settings.forced_root_block_attrs," "):n.dom.add(n.getBody(),"br"))});var u=n.selection.getRng(),a=en.fromDom(n.selection.getStart()),c=en.fromDom(u.startContainer),l=en.fromDom(u.endContainer),d=pa(a).isRtl()?bl.rtl:bl.ltr;s.keydown(i,c,u.startOffset,l,u.endOffset,d).each(function(n){f(i,n)}),t().each(function(n){n.showBars()})},h=function(n){var t=en.fromDom(n.target),e=function(){n.stopPropagation()},r=function(){n.preventDefault()},o=m.compose(r,e);return{target:m.constant(t),x:m.constant(n.x),y:m.constant(n.y),stop:e,prevent:r,kill:o,raw:m.constant(n)}},v=function(n){return 0===n.button},b=function(n){v(n)&&l.mousedown(h(n))},y=function(n){var t;((t=n).buttons===undefined||0!=(1&t.buttons))&&l.mouseover(h(n))},x=function(n){v&&l.mouseup(h(n))};n.on("mousedown",b),n.on("mouseover",y),n.on("mouseup",x),n.on("keyup",d),n.on("keydown",p),n.on("nodechange",function(){var t=n.selection,e=en.fromDom(t.getStart()),r=en.fromDom(t.getEnd()),i=Vt(e),u=Vt(r);i.bind(function(n){return u.bind(function(t){return ot.eq(n,t)?w.some(!0):w.none()})}).fold(function(){o.clear(a)},m.noop)}),r=w.some(e({mousedown:b,mouseover:y,mouseup:x,keyup:d,keydown:p}))}),{clear:o.clear,destroy:function(){r.each(function(n){})}}},Ws=function(n){return{get:function(){var t=sa.getBody(n);return mr(t,br.selectedSelector()).fold(function(){return n.selection.getStart()===undefined?xr.none():xr.single(n.selection)},function(n){return xr.multiple(n)})}}},_s=ba.each,Ms={addButtons:function(n){var t=[];function e(t){return function(){n.execCommand(t)}}_s("inserttable tableprops deletetable | cell row column".split(" "),function(e){"|"===e?t.push({text:"-"}):t.push(n.menuItems[e])}),n.addButton("table",{type:"menubutton",title:"Table",menu:t}),n.addButton("tableprops",{title:"Table properties",onclick:m.curry(Ta,n,!0),icon:"table"}),n.addButton("tabledelete",{title:"Delete table",onclick:e("mceTableDelete")}),n.addButton("tablecellprops",{title:"Cell properties",onclick:e("mceTableCellProps")}),n.addButton("tablemergecells",{title:"Merge cells",onclick:e("mceTableMergeCells")}),n.addButton("tablesplitcells",{title:"Split cell",onclick:e("mceTableSplitCells")}),n.addButton("tableinsertrowbefore",{title:"Insert row before",onclick:e("mceTableInsertRowBefore")}),n.addButton("tableinsertrowafter",{title:"Insert row after",onclick:e("mceTableInsertRowAfter")}),n.addButton("tabledeleterow",{title:"Delete row",onclick:e("mceTableDeleteRow")}),n.addButton("tablerowprops",{title:"Row properties",onclick:e("mceTableRowProps")}),n.addButton("tablecutrow",{title:"Cut row",onclick:e("mceTableCutRow")}),n.addButton("tablecopyrow",{title:"Copy row",onclick:e("mceTableCopyRow")}),n.addButton("tablepasterowbefore",{title:"Paste row before",onclick:e("mceTablePasteRowBefore")}),n.addButton("tablepasterowafter",{title:"Paste row after",onclick:e("mceTablePasteRowAfter")}),n.addButton("tableinsertcolbefore",{title:"Insert column before",onclick:e("mceTableInsertColBefore")}),n.addButton("tableinsertcolafter",{title:"Insert column after",onclick:e("mceTableInsertColAfter")}),n.addButton("tabledeletecol",{title:"Delete column",onclick:e("mceTableDeleteCol")})},addToolbars:function(n){var t=n.settings.table_toolbar;""!==t&&!1!==t&&(t||(t="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol"),n.addContextToolbar(function(t){return n.dom.is(t,"table")&&n.getBody().contains(t)},t))}},Ls={addMenuItems:function(n,t){var e=w.none(),r=[],o=[],i=[],u=[],a=function(n){n.disabled(!0)},c=function(n){n.disabled(!1)},l=function(){var n=this;r.push(n),e.fold(function(){a(n)},function(t){c(n)})},s=function(){var n=this;o.push(n),e.fold(function(){a(n)},function(t){c(n)})};n.on("init",function(){n.on("nodechange",function(l){var s=w.from(n.dom.getParent(n.selection.getStart(),"th,td"));(e=s.bind(function(n){var e=en.fromDom(n);return Vt(e).map(function(n){return kr.forMenu(t,n,e)})})).fold(function(){B.each(r,a),B.each(o,a),B.each(i,a),B.each(u,a)},function(n){B.each(r,c),B.each(o,c),B.each(i,function(t){t.disabled(n.mergable().isNone())}),B.each(u,function(t){t.disabled(n.unmergable().isNone())})})})});var f=function(n,t,e,r){var o,i,u,a,c,l=r.getEl().getElementsByTagName("table")[0],s=r.isRtl()||"tl-tr"===r.parent().rel;for(l.nextSibling.innerHTML=t+1+" x "+(e+1),s&&(t=9-t),i=0;i<10;i++)for(o=0;o<10;o++)a=l.rows[i].childNodes[o].firstChild,c=(s?o>=t:o<=t)&&i<=e,n.dom.toggleClass(a,"mce-active",c),c&&(u=a);return u.parentNode},d=!1===n.settings.table_grid?{text:"Table",icon:"table",context:"table",onclick:m.curry(Ta,n)}:{text:"Table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(t){t.aria&&(this.parent().hideAll(),t.stopImmediatePropagation(),Ta(n))},onshow:function(){f(n,0,0,this.menu.items()[0])},onhide:function(){var t=this.menu.items()[0].getEl().getElementsByTagName("a");n.dom.removeClass(t,"mce-active"),n.dom.addClass(t[0],"mce-active")},menu:[{type:"container",html:function(){var n="";n='';for(var t=0;t<10;t++){n+="";for(var e=0;e<10;e++)n+=' ';n+=" "}return n+="
",n+='1 x 1
'}(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(t){var e,r,o=t.target;"A"===o.tagName.toUpperCase()&&(e=parseInt(o.getAttribute("data-mce-x"),10),r=parseInt(o.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"===this.parent().rel)&&(e=9-e),e===this.lastX&&r===this.lastY||(f(n,e,r,t.control),this.lastX=e,this.lastY=r))},onclick:function(t){var e=this;"A"===t.target.tagName.toUpperCase()&&(t.preventDefault(),t.stopPropagation(),e.parent().cancel(),n.undoManager.transact(function(){Pr.insert(n,e.lastX+1,e.lastY+1)}),n.addVisual())}}]};function g(t){return function(){n.execCommand(t)}}var p={text:"Table properties",context:"table",onPostRender:l,onclick:m.curry(Ta,n,!0)},h={text:"Delete table",context:"table",onPostRender:l,cmd:"mceTableDelete"},v={text:"Row",context:"table",menu:[{text:"Insert row before",onclick:g("mceTableInsertRowBefore"),onPostRender:s},{text:"Insert row after",onclick:g("mceTableInsertRowAfter"),onPostRender:s},{text:"Delete row",onclick:g("mceTableDeleteRow"),onPostRender:s},{text:"Row properties",onclick:g("mceTableRowProps"),onPostRender:s},{text:"-"},{text:"Cut row",onclick:g("mceTableCutRow"),onPostRender:s},{text:"Copy row",onclick:g("mceTableCopyRow"),onPostRender:s},{text:"Paste row before",onclick:g("mceTablePasteRowBefore"),onPostRender:s},{text:"Paste row after",onclick:g("mceTablePasteRowAfter"),onPostRender:s}]},b={text:"Column",context:"table",menu:[{text:"Insert column before",onclick:g("mceTableInsertColBefore"),onPostRender:s},{text:"Insert column after",onclick:g("mceTableInsertColAfter"),onPostRender:s},{text:"Delete column",onclick:g("mceTableDeleteCol"),onPostRender:s}]},y={separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:g("mceTableCellProps"),onPostRender:s},{text:"Merge cells",onclick:g("mceTableMergeCells"),onPostRender:function(){var n=this;i.push(n),e.fold(function(){a(n)},function(t){n.disabled(t.mergable().isNone())})}},{text:"Split cell",onclick:g("mceTableSplitCells"),onPostRender:function(){var n=this;u.push(n),e.fold(function(){a(n)},function(t){n.disabled(t.unmergable().isNone())})}}]};n.addMenuItem("inserttable",d),n.addMenuItem("tableprops",p),n.addMenuItem("deletetable",h),n.addMenuItem("row",v),n.addMenuItem("column",b),n.addMenuItem("cell",y)}};f.add("table",function(n){var t=oc(n),e=Ps(n,t.lazyResize),r=ha(n,t.lazyWire),o=Ws(n);Ia.registerCommands(n,r,e,o),Nr.registerEvents(n,o,r,e),Ls.addMenuItems(n,o),Ms.addButtons(n),Ms.addToolbars(n),n.on("PreInit",function(){n.serializer.addTempAttr(br.firstSelected()),n.serializer.addTempAttr(br.lastSelected())}),!1!==n.settings.table_tab_navigation&&n.on("keydown",function(e){ml.handle(e,n,r,t.lazyWire)}),n.on("remove",function(){t.destroy(),e.destroy()}),this.insertTable=function(t,e){return Pr.insert(n,t,e)},this.setClipboardRows=Ia.setClipboardRows,this.getClipboardRows=Ia.getClipboardRows})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),n=tinymce.util.Tools.resolve("tinymce.EditorManager"),i=tinymce.util.Tools.resolve("tinymce.Env"),o=tinymce.util.Tools.resolve("tinymce.util.Delay"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=tinymce.util.Tools.resolve("tinymce.util.VK"),r={getTabFocus:function(e){return e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))}},c=t.DOM,s=function(e){e.keyCode!==u.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},a=function(e){function t(t){var s,a,y,f;if(!(t.keyCode!==u.TAB||t.ctrlKey||t.altKey||t.metaKey||t.isDefaultPrevented())&&(1===(y=l.explode(r.getTabFocus(e))).length&&(y[1]=y[0],y[0]=":prev"),a=t.shiftKey?":prev"===y[0]?m(-1):c.get(y[0]):":next"===y[1]?m(1):c.get(y[1]))){var d=n.get(a.id||a.name);a.id&&d?d.focus():o.setTimeout(function(){i.webkit||window.focus(),a.focus()},10),t.preventDefault()}function m(i){function o(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&n.get(t.id)&&-1!==e.tabIndex&&function i(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&i(e.parentNode)}(e)}if(a=c.select(":input:enabled,*[tabindex]:not(iframe)"),l.each(a,function(t,n){if(t.id===e.id)return s=n,!1}),i>0){for(f=s+1;f=0;f--)if(o(a[f]))return a[f];return null}}e.on("init",function(){e.inline&&c.setAttrib(e.getBody(),"tabIndex",null),e.on("keyup",s),i.gecko?e.on("keypress keydown",t):e.on("keydown",t)})};e.add("tabfocus",function(e){a(e)})}();!function(){"use strict";var e=function(t){var n=t,r=function(){return n};return{get:r,set:function(e){n=e},clone:function(){return e(r())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return!(!/(^|[ ,])tinymcespellchecker([, ]|$)/.test(e.settings.plugins)||!t.get("tinymcespellchecker")||("undefined"!=typeof window.console&&window.console.log&&window.console.log("Spell Checker Pro is incompatible with Spell Checker plugin! Remove 'spellchecker' from the 'plugins' option."),0))},r=function(e){return e.getParam("spellchecker_languages","English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv")},o=function(e){var t=e.getParam("language","en");return e.getParam("spellchecker_language",t)},i=function(e){return e.getParam("spellchecker_rpc_url")},c=function(e){return e.getParam("spellchecker_callback")},a=function(e){var t=new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e\xa0\u2002\u2003\u2009]+',"g");return e.getParam("spellchecker_wordchar_pattern",t)},l=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=tinymce.util.Tools.resolve("tinymce.util.URI"),u=tinymce.util.Tools.resolve("tinymce.util.XHR"),d=function(e){return e.fire("SpellcheckStart")},f=function(e){return e.fire("SpellcheckEnd")};function h(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var g,m=function(e,t){var n,r,o,i,c,a=[],l=t.dom;function s(e,t){if(!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");return{start:e.index,end:e.index+e[0].length,text:e[0],data:t}}function u(t){var n=e.getElementsByTagName("*"),r=[];t="number"==typeof t?""+t:null;for(var o=0;o=u.end?(a=g,s=u.end-f):r&&d.push(g),!r&&g.length+f>u.start&&(r=g,l=u.start-f),f+=g.length),r&&a){if(g=n({startNode:r,startNodeIndex:l,endNode:a,endNodeIndex:s,innerNodes:d,match:u.text,matchIndex:m}),f-=a.length-s,r=null,a=null,d=[],m++,!(u=t.shift()))break}else if(i[g.nodeName]&&!o[g.nodeName]||!g.firstChild){if(g.nextSibling){g=g.nextSibling;continue}}else if(!h(g)){g=g.firstChild;continue}for(;;){if(g.nextSibling){g=g.nextSibling;break}if(g.parentNode===e)break e;g=g.parentNode}}}(e,a,function(e){function t(t,n){var r=a[n];r.stencil||(r.stencil=e(r));var o=r.stencil.cloneNode(!1);return o.setAttribute("data-mce-index",n),t&&o.appendChild(l.doc.createTextNode(t)),o}return function(e){var n,r,o,i=e.startNode,c=e.endNode,a=e.matchIndex,s=l.doc;if(i===c){var u=i;o=u.parentNode,e.startNodeIndex>0&&(n=s.createTextNode(u.data.substring(0,e.startNodeIndex)),o.insertBefore(n,u));var d=t(e.match,a);return o.insertBefore(d,u),e.endNodeIndex0&&r.insertNode(t.dom.doc.createTextNode(n)),r},rangeFromMatch:m,indexOf:d}},p=function(e,t){if(!t.get()){var n=m(e.getBody(),e);t.set(n)}return t.get()},v=function(e,t,n,r,o,a,d){var f,h,g,m=c(e);(m||(f=e,h=t,g=n,function(e,t,n,r){var o={method:e,lang:g.get()},c="";o["addToDictionary"===e?"word":"text"]=t,l.each(o,function(e,t){c&&(c+="&"),c+=t+"="+encodeURIComponent(e)}),u.send({url:new s(h).toAbsolute(i(f)),type:"post",content_type:"application/x-www-form-urlencoded",data:c,success:function(e){if(e=JSON.parse(e))e.error?r(e.error):n(e);else{var t=f.translate("Server response wasn't proper JSON.");r(t)}},error:function(){var e=f.translate("The spelling service was not found: (")+i(f)+f.translate(")");r(e)}})})).call(e.plugins.spellchecker,r,o,a,d)},x=function(e,t,n){e.dom.select("span.mce-spellchecker-word").length||N(e,t,n)},N=function(e,t,n){if(p(e,n).reset(),n.set(null),t.get())return t.set(!1),f(e),!0},k=function(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t},y=function(e,t,n,r,o){var i,c;if(o.words?(c=!!o.dictionary,i=o.words):i=o,e.setProgressState(!1),function(e){for(var t in e)return!1;return!0}(i)){var l=e.translate("No misspellings found.");return e.notificationManager.open({text:l,type:"info"}),void t.set(!1)}r.set({suggestions:i,hasDictionarySupport:c}),p(e,n).find(a(e)).filter(function(e){return!!i[e.text]}).wrap(function(t){return e.dom.create("span",{"class":"mce-spellchecker-word","data-mce-bogus":1,"data-mce-word":t.text})}),t.set(!0),d(e)},S={spellcheck:function(e,t,n,r,o,i){N(e,n,r)||(e.setProgressState(!0),v(e,t,i,"spellcheck",p(e,r).text,function(t){y(e,n,r,o,t)},function(t){e.notificationManager.open({text:t,type:"error"}),e.setProgressState(!1),N(e,n,r)}),e.focus())},checkIfFinished:x,addToDictionary:function(e,t,n,r,o,i){e.setProgressState(!0),v(e,t,"addToDictionary",o,function(){e.setProgressState(!1),e.dom.remove(i,!0),x(e,n,r)},function(t){e.notificationManager.open({text:t,type:"error"}),e.setProgressState(!1)})},ignoreWord:function(e,t,n,r,o,i){e.selection.collapse(),i?l.each(e.dom.select("span.mce-spellchecker-word"),function(t){t.getAttribute("data-mce-word")===r&&e.dom.remove(t,!0)}):e.dom.remove(o,!0),x(e,t,n)},findSpansByIndex:function(e,t){var n,r=[];if((n=l.toArray(e.getBody().getElementsByTagName("span"))).length)for(var o=0;o1&&(m.type="splitbutton",m.menu=h,m.onshow=(f=e,function(e){var t=o(f);e.control.items().each(function(e){e.active(e.settings.data===t)})}),m.onselect=function(e){c.set(e.control.settings.data)}),e.addButton("spellchecker",m),e.addMenuItem("spellchecker",{text:"Spellcheck",context:"tools",onclick:g,selectable:!0,onPostRender:function(){var t=this;t.active(n.get()),e.on("SpellcheckStart SpellcheckEnd",function(){t.active(n.get())})}})},I=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),E=tinymce.util.Tools.resolve("tinymce.ui.Factory"),P=function(e,t,n,r,o){e.on("click",function(i){var c=i.target;if("mce-spellchecker-word"===c.className){i.preventDefault();var a=S.findSpansByIndex(e,S.getElmIndex(c));if(a.length>0){var s=e.dom.createRng();s.setStartBefore(a[0]),s.setEndAfter(a[a.length-1]),e.selection.setRng(s),function(e,t,n,r,o,i,c){var a=[],s=n.get().suggestions[i];l.each(s,function(t){a.push({text:t,onclick:function(){e.insertContent(e.dom.encode(t)),e.dom.remove(c),S.checkIfFinished(e,r,o)}})}),a.push({text:"-"}),n.get().hasDictionarySupport&&a.push({text:"Add to Dictionary",onclick:function(){S.addToDictionary(e,t,r,o,i,c)}}),a.push.apply(a,[{text:"Ignore",onclick:function(){S.ignoreWord(e,r,o,i,c)}},{text:"Ignore all",onclick:function(){S.ignoreWord(e,r,o,i,c,!0)}}]),(g=E.create("menu",{items:a,context:"contextmenu",onautohide:function(e){-1!==e.target.className.indexOf("spellchecker")&&e.preventDefault()},onhide:function(){g.remove(),g=null}})).renderTo(document.body);var u=I.DOM.getPos(e.getContentAreaContainer()),d=e.dom.getPos(c[0]),f=e.dom.getRoot();"BODY"===f.nodeName?(d.x-=f.ownerDocument.documentElement.scrollLeft||f.scrollLeft,d.y-=f.ownerDocument.documentElement.scrollTop||f.scrollTop):(d.x-=f.scrollLeft,d.y-=f.scrollTop),u.x+=d.x,u.y+=d.y,g.moveTo(u.x,u.y+c[0].offsetHeight)}(e,t,n,r,o,c.getAttribute("data-mce-word"),a)}}})};t.add("spellchecker",function(t,r){if(!1===n(t)){var i=e(!1),c=e(o(t)),a=e(null),l=e({});return T(t,r,i,a,c,l),P(t,r,l,i,a),b(t,r,i,a,l,c),w(t,i,l,a,r)}})}();!function(){"use strict";var e=function(t){var n=t,r=function(){return n};return{get:r,set:function(e){n=e},clone:function(){return e(r())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.Tools");function r(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var a={findAndReplaceDOMText:function(e,t,n,a,i){var o,d,c,l,s,u,f=[],p=0;function g(e,t){if(t=t||0,!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");var n=e.index;if(t>0){var r=e[t];if(!r)throw new Error("Invalid capture group");n+=e[0].indexOf(r),e[0]=r}return[n,n+e[0].length,[e[0]]]}if(c=t.ownerDocument,l=i.getBlockElements(),s=i.getWhiteSpaceElements(),u=i.getShortEndedElements(),d=function h(e){var t;if(3===e.nodeType)return e.data;if(s[e.nodeName]&&!l[e.nodeName])return"";if(t="",r(e))return"\n";if((l[e.nodeName]||u[e.nodeName])&&(t+="\n"),e=e.firstChild)do{t+=h(e)}while(e=e.nextSibling);return t}(t)){if(e.global)for(;o=e.exec(d);)f.push(g(o,a));else o=d.match(e),f.push(g(o,a));return f.length&&(p=f.length,function(e,t,n){var a,i,o,d,c=[],f=0,p=e,g=t.shift(),h=0;e:for(;;){if((l[p.nodeName]||u[p.nodeName]||r(p))&&f++,3===p.nodeType&&(!i&&p.length+f>=g[1]?(i=p,d=g[1]-f):a&&c.push(p),!a&&p.length+f>g[0]&&(a=p,o=g[0]-f),f+=p.length),a&&i){if(p=n({startNode:a,startNodeIndex:o,endNode:i,endNodeIndex:d,innerNodes:c,match:g[2],matchIndex:h}),f-=i.length-d,a=null,i=null,c=[],h++,!(g=t.shift()))break}else if(s[p.nodeName]&&!l[p.nodeName]||!p.firstChild){if(p.nextSibling){p=p.nextSibling;continue}}else if(!r(p)){p=p.firstChild;continue}for(;;){if(p.nextSibling){p=p.nextSibling;break}if(p.parentNode===e)break e;p=p.parentNode}}}(t,f,function(e){var t;if("function"!=typeof e){var n=e.nodeType?e:c.createElement(e);t=function(e,t){var r=n.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(c.createTextNode(e)),r}}else t=e;return function(e){var n,r,a,i=e.startNode,o=e.endNode,d=e.matchIndex;if(i===o){var l=i;a=l.parentNode,e.startNodeIndex>0&&(n=c.createTextNode(l.data.substring(0,e.startNodeIndex)),a.insertBefore(n,l));var s=t(e.match[0],d);return a.insertBefore(s,l),e.endNodeIndex0},p=function(e,t,r){var a,d,c,l;for(d=n.toArray(e.getBody().getElementsByTagName("span")),a=0;a0},h=function(e,t){return d(e,t.get()-1).length>0},m={done:p,find:function(e,t,n,r,i){n=(n=n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")).replace(/\s/g,"\\s"),n=i?"\\b"+n+"\\b":n;var o,d,l,s,u,f=(o=e,d=t,l=new RegExp(n,r?"g":"gi"),(u=o.dom.create("span",{"data-mce-bogus":1})).className="mce-match-marker",s=o.getBody(),p(o,d,!1),a.findAndReplaceDOMText(l,s,u,!1,o.schema));return f&&(t.set(-1),t.set(c(e,t,!0))),f},next:s,prev:u,replace:function(e,t,r,a,d){var c,p,m,v,x,b,N=t.get();for(a=!1!==a,m=e.getBody(),p=n.grep(n.toArray(m.getElementsByTagName("span")),f),c=0;ct.get()&&p[c].setAttribute("data-mce-index",x-1)}return t.set(N),a?(b=g(e,t),s(e,t)):(b=h(e,t),u(e,t)),!d&&b},hasNext:g,hasPrev:h},v=function(e,t){return{done:function(n){return m.done(e,t,n)},find:function(n,r,a){return m.find(e,t,n,r,a)},next:function(){return m.next(e,t)},prev:function(){return m.prev(e,t)},replace:function(n,r,a){return m.replace(e,t,n,r,a)}}},x=function(e,t){var r,a={};function i(){d.statusbar.find("#next").disabled(!1===m.hasNext(e,t)),d.statusbar.find("#prev").disabled(!1===m.hasPrev(e,t))}function o(){e.windowManager.alert("Could not find the specified string.",function(){d.find("#find")[0].focus()})}e.undoManager.add(),r=n.trim(e.selection.getContent({format:"text"}));var d=e.windowManager.open({layout:"flex",pack:"center",align:"center",onClose:function(){e.focus(),m.done(e,t),e.undoManager.add()},onSubmit:function(n){var r,c,l,s;return n.preventDefault(),c=d.find("#case").checked(),s=d.find("#words").checked(),(l=d.find("#find").value()).length?a.text===l&&a.caseState===c&&a.wholeWord===s?m.hasNext(e,t)?(m.next(e,t),void i()):void o():((r=m.find(e,t,l,c,s))||o(),d.statusbar.items().slice(1).disabled(0===r),i(),void(a={text:l,caseState:c,wholeWord:s})):(m.done(e,t,!1),void d.statusbar.items().slice(1).disabled(!0))},buttons:[{text:"Find",subtype:"primary",onclick:function(){d.submit()}},{text:"Replace",disabled:!0,onclick:function(){m.replace(e,t,d.find("#replace").value())||(d.statusbar.items().slice(1).disabled(!0),t.set(-1),a={})}},{text:"Replace all",disabled:!0,onclick:function(){m.replace(e,t,d.find("#replace").value(),!0,!0),d.statusbar.items().slice(1).disabled(!0),a={}}},{type:"spacer",flex:1},{text:"Prev",name:"prev",disabled:!0,onclick:function(){m.prev(e,t),i()}},{text:"Next",name:"next",disabled:!0,onclick:function(){m.next(e,t),i()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,items:[{type:"textbox",name:"find",size:40,label:"Find",value:r},{type:"textbox",name:"replace",size:40,label:"Replace with"},{type:"checkbox",name:"case",text:"Match case",label:" "},{type:"checkbox",name:"words",text:"Whole words",label:" "}]}})},b=function(e,t){e.addCommand("SearchReplace",function(){x(e,t)})},N=function(e,t){return function(){x(e,t)}},y=function(e,t){e.addMenuItem("searchreplace",{text:"Find and replace",shortcut:"Meta+F",onclick:N(e,t),separator:"before",context:"edit"}),e.addButton("searchreplace",{tooltip:"Find and replace",onclick:N(e,t)}),e.shortcuts.add("Meta+F","",N(e,t))};t.add("searchreplace",function(t){var n=e(-1);return b(t,n),y(t,n),v(t,n)})}();!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),t=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(n){return n.getParam("save_enablewhendirty",!0)},o=function(n){return!!n.getParam("save_onsavecallback")},c=function(n){return!!n.getParam("save_oncancelcallback")},i=function(n,e){n.notificationManager.open({text:n.translate(e),type:"error"})},r=function(n){var t;if(t=e.DOM.getParent(n.id,"form"),!a(n)||n.isDirty()){if(n.save(),o(n))return n.execCallback("save_onsavecallback",n),void n.nodeChanged();t?(n.setDirty(!1),t.onsubmit&&!t.onsubmit()||("function"==typeof t.submit?t.submit():i(n,"Error: Form submit field collision.")),n.nodeChanged()):i(n,"Error: No form element found.")}},l=function(n){var e=t.trim(n.startContent);c(n)?n.execCallback("save_oncancelcallback",n):(n.setContent(e),n.undoManager.clear(),n.nodeChanged())},d=function(n){n.addCommand("mceSave",function(){r(n)}),n.addCommand("mceCancel",function(){l(n)})},s=function(n){return function(e){var t=e.control;n.on("nodeChange dirty",function(){t.disabled(a(n)&&!n.isDirty())})}},u=function(n){n.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:s(n)}),n.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:s(n)}),n.addShortcut("Meta+S","","mceSave")};n.add("save",function(n){u(n),d(n)})}();!function(){"use strict";var t=function(t){t.addCommand("mcePrint",function(){t.getWin().print()})},n=function(t){t.addButton("print",{title:"Print",cmd:"mcePrint"}),t.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print"})};tinymce.util.Tools.resolve("tinymce.PluginManager").add("print",function(i){t(i),n(i),i.addShortcut("Meta+P","","mcePrint")})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),n=function(e){return parseInt(e.getParam("plugin_preview_width","650"),10)},i=function(e){return parseInt(e.getParam("plugin_preview_height","500"),10)},o=function(e){return e.getParam("content_style","")},r=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(e){var t="",n=e.dom.encode,i=o(e);t+=' ',i&&(t+='"),r.each(e.contentCSS,function(i){t+=' '});var c=e.settings.body_id||"tinymce";-1!==c.indexOf("=")&&(c=(c=e.getParam("body_id","","hash"))[e.id]||c);var a=e.settings.body_class||"";-1!==a.indexOf("=")&&(a=(a=e.getParam("body_class","","hash"))[e.id]||"");var s=e.settings.directionality?' dir="'+e.settings.directionality+'"':"";return""+t+'"+e.getContent()+'
diff --git a/src/views/profile/components/Activity.vue b/src/views/profile/components/Activity.vue
new file mode 100644
index 00000000..dd5db3a5
--- /dev/null
+++ b/src/views/profile/components/Activity.vue
@@ -0,0 +1,185 @@
+
+
+
+
+
+
Iron Man
+
Shared publicly - 7:30 PM today
+
+
+ Lorem ipsum represents a long-held tradition for designers,
+ typographers and the like. Some people hate it and argue for
+ its demise, but others ignore the hate as they create awesome
+ tools to help create filler text for everyone from bacon lovers
+ to Charlie Sheen fans.
+
+
+
+
+
+ Share
+
+
+
+
+
+ Like
+
+
+
+
+
+
+
+
Captain American
+
Sent you a message - yesterday
+
+
+ Lorem ipsum represents a long-held tradition for designers,
+ typographers and the like. Some people hate it and argue for
+ its demise, but others ignore the hate as they create awesome
+ tools to help create filler text for everyone from bacon lovers
+ to Charlie Sheen fans.
+
+
+
+
+
+ Share
+
+
+
+
+
+ Like
+
+
+
+
+
+
+
+
Spider Man
+
Posted 4 photos - 2 days ago
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/profile/components/Timeline.vue b/src/views/profile/components/Timeline.vue
new file mode 100644
index 00000000..ba90b3d2
--- /dev/null
+++ b/src/views/profile/components/Timeline.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+ {{ item.title }}
+ {{ item.content }}
+
+
+
+
+
+
+
diff --git a/src/views/profile/components/UserCard.vue b/src/views/profile/components/UserCard.vue
new file mode 100644
index 00000000..a8d27513
--- /dev/null
+++ b/src/views/profile/components/UserCard.vue
@@ -0,0 +1,134 @@
+
+
+
+ About me
+
+
+
+
+
+ Hello
+ {{ user.role }}
+
+
+
+
{{ user.name }}
+
{{ user.role | uppercaseFirst }}
+
+
+
+
+
+
+
+
+ JS in Computer Science from the University of Technology
+
+
+
+
+
+
+
+
+ Vue
+
+
+
+ JavaScript
+
+
+
+ Css
+
+
+
+ ESLint
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/profile/index.vue b/src/views/profile/index.vue
new file mode 100644
index 00000000..e54bc718
--- /dev/null
+++ b/src/views/profile/index.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vue.config.js b/vue.config.js
index 65cf4125..087a2e89 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -54,6 +54,16 @@ module.exports = {
}
},
chainWebpack(config) {
+ const cdn = {
+ // inject tinymce into index.html
+ // why use this cdn, detail see https://github.com/PanJiaChen/tinymce-all-in-one
+ js: ['https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.2/tinymce.min.js']
+ }
+ config.plugin('html')
+ .tap(args => {
+ args[0].cdn = cdn
+ return args
+ })
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test