All Downloads are FREE. Search and download functionalities are using the official Maven repository.

formModeler.ckeditor.ckeditor.js Maven / Gradle / Ivy

!function(){window.CKEDITOR&&window.CKEDITOR.dom||(window.CKEDITOR||(window.CKEDITOR=function(){var e={timestamp:"D6IE",version:"4.2",revision:"f74e558",rnd:Math.floor(900*Math.random())+100,_:{pending:[]},status:"unloaded",basePath:function(){var e=window.CKEDITOR_BASEPATH||"";if(!e)for(var t=document.getElementsByTagName("script"),n=0;n=0;u--)if(l[u].priority<=r)return l.splice(u+1,0,a),{removeListener:s};l.unshift(a)}return{removeListener:s}},once:function(){var e=arguments[1];return arguments[1]=function(t){return t.removeListener(),e.apply(this,arguments)},this.on.apply(this,arguments)},capture:function(){CKEDITOR.event.useCapture=1;var e=this.on.apply(this,arguments);return CKEDITOR.event.useCapture=0,e},fire:function(){var e=0,n=function(){e=1},i=0,o=function(){i=1};return function(r,a,s){var l=t(this)[r],r=e,c=i;if(e=i=0,l){var u=l.listeners;if(u.length)for(var d,u=u.slice(0),h=0;h=0&&i.listeners.splice(o,1)}},removeAllListeners:function(){var e,n=t(this);for(e in n)delete n[e]},hasListeners:function(e){return(e=t(this)[e])&&e.listeners.length>0}}}()),CKEDITOR.editor||(CKEDITOR.editor=function(){CKEDITOR._.pending.push([this,arguments]),CKEDITOR.event.call(this)},CKEDITOR.editor.prototype.fire=function(e,t){return e in{instanceReady:1,loaded:1}&&(this[e]=!0),CKEDITOR.event.prototype.fire.call(this,e,t,this)},CKEDITOR.editor.prototype.fireOnce=function(e,t){return e in{instanceReady:1,loaded:1}&&(this[e]=!0),CKEDITOR.event.prototype.fireOnce.call(this,e,t,this)},CKEDITOR.event.implementOn(CKEDITOR.editor.prototype)),CKEDITOR.env||(CKEDITOR.env=function(){var b=navigator.userAgent.toLowerCase(),c=window.opera,a={ie:eval("/*@cc_on!@*/false"),opera:!!c&&c.version,webkit:b.indexOf(" applewebkit/")>-1,air:b.indexOf(" adobeair/")>-1,mac:b.indexOf("macintosh")>-1,quirks:"BackCompat"==document.compatMode,mobile:b.indexOf("mobile")>-1,iOS:/(ipad|iphone|ipod)/.test(b),isCustomDomain:function(){if(!this.ie)return!1;var e=document.domain,t=window.location.hostname;return e!=t&&e!="["+t+"]"},secure:"https:"==location.protocol};a.gecko="Gecko"==navigator.product&&!a.webkit&&!a.opera,a.webkit&&(b.indexOf("chrome")>-1?a.chrome=!0:a.safari=!0);var e=0;if(a.ie&&(e=a.quirks||!document.documentMode?parseFloat(b.match(/msie (\d+)/)[1]):document.documentMode,a.ie9Compat=9==e,a.ie8Compat=8==e,a.ie7Compat=7==e,a.ie6Compat=7>e||a.quirks),a.gecko){var d=b.match(/rv:([\d\.]+)/);d&&(d=d[1].split("."),e=1e4*d[0]+100*(d[1]||0)+1*(d[2]||0))}return a.opera&&(e=parseFloat(c.version())),a.air&&(e=parseFloat(b.match(/ adobeair\/(\d+)/)[1])),a.webkit&&(e=parseFloat(b.match(/ applewebkit\/(\d+)/)[1])),a.version=e,a.isCompatible=a.iOS&&e>=534||!a.mobile&&(a.ie&&e>6||a.gecko&&e>=10801||a.opera&&e>=9.5||a.air&&e>=1||a.webkit&&e>=522||!1),a.hidpi=window.devicePixelRatio>=2,a.cssClass="cke_browser_"+(a.ie?"ie":a.gecko?"gecko":a.opera?"opera":a.webkit?"webkit":"unknown"),a.quirks&&(a.cssClass=a.cssClass+" cke_browser_quirks"),a.ie&&(a.cssClass=a.cssClass+(" cke_browser_ie"+(a.quirks||a.version<7?"6":a.version)),a.quirks&&(a.cssClass=a.cssClass+" cke_browser_iequirks")),a.gecko&&(10900>e?a.cssClass=a.cssClass+" cke_browser_gecko18":11e3>=e&&(a.cssClass=a.cssClass+" cke_browser_gecko19")),a.air&&(a.cssClass=a.cssClass+" cke_browser_air"),a.iOS&&(a.cssClass=a.cssClass+" cke_browser_ios"),a.hidpi&&(a.cssClass=a.cssClass+" cke_hidpi"),a}()),"unloaded"==CKEDITOR.status&&function(){CKEDITOR.event.implementOn(CKEDITOR),CKEDITOR.loadFullCore=function(){if("basic_ready"!=CKEDITOR.status)CKEDITOR.loadFullCore._load=1;else{delete CKEDITOR.loadFullCore;var e=document.createElement("script");e.type="text/javascript",e.src=CKEDITOR.basePath+"ckeditor.js",document.getElementsByTagName("head")[0].appendChild(e)}},CKEDITOR.loadFullCoreTimeout=0,CKEDITOR.add=function(e){(this._.pending||(this._.pending=[])).push(e)},function(){CKEDITOR.domReady(function(){var e=CKEDITOR.loadFullCore,t=CKEDITOR.loadFullCoreTimeout;e&&(CKEDITOR.status="basic_ready",e&&e._load?e():t&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},1e3*t))})}(),CKEDITOR.status="basic_loaded"}(),CKEDITOR.dom={},function(){var e=[],t=CKEDITOR.env.gecko?"-moz-":CKEDITOR.env.webkit?"-webkit-":CKEDITOR.env.opera?"-o-":CKEDITOR.env.ie?"-ms-":"";CKEDITOR.on("reset",function(){e=[]}),CKEDITOR.tools={arrayCompare:function(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!=t.length)return!1;for(var n=0;no;o++){var r,a=arguments[o];for(r in a)(t===!0||void 0==e[r])&&(!n||r in n)&&(e[r]=a[r])}return e},prototypedCopy:function(e){var t=function(){};return t.prototype=e,new t},copy:function(e){var t,n={};for(t in e)n[t]=e[t];return n},isArray:function(e){return!!e&&e instanceof Array},isEmpty:function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},cssVendorPrefix:function(e,n,i){return i?t+e+":"+n+";"+e+":"+n:(i={},i[e]=n,i[t+e]=n,i)},cssStyleToDomStyle:function(){var e=document.createElement("div").style,t="undefined"!=typeof e.cssFloat?"cssFloat":"undefined"!=typeof e.styleFloat?"styleFloat":"float";return function(e){return"float"==e?t:e.replace(/-./g,function(e){return e.substr(1).toUpperCase()})}}(),buildStyleHtml:function(e){for(var t,e=[].concat(e),n=[],i=0;i"+t+"":'');return n.join("")},htmlEncode:function(e){return(""+e).replace(/&/g,"&").replace(/>/g,">").replace(//g,">")},getNextNumber:function(){var e=0;return function(){return++e}}(),getNextId:function(){return"cke_"+this.getNextNumber()},override:function(e,t){var n=t(e);return n.prototype=e.prototype,n},setTimeout:function(e,t,n,i,o){return o||(o=window),n||(n=o),o.setTimeout(function(){i?e.apply(n,[].concat(i)):e.apply(n)},t||0)},trim:function(){var e=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(t){return t.replace(e,"")}}(),ltrim:function(){var e=/^[ \t\n\r]+/g;return function(t){return t.replace(e,"")}}(),rtrim:function(){var e=/[ \t\n\r]+$/g;return function(t){return t.replace(e,"")}}(),indexOf:function(e,t){if("function"==typeof t){for(var n=0,i=e.length;i>n;n++)if(t(e[n]))return n}else{if(e.indexOf)return e.indexOf(t);for(n=0,i=e.length;i>n;n++)if(e[n]===t)return n}return-1},search:function(e,t){var n=CKEDITOR.tools.indexOf(e,t);return n>=0?e[n]:null},bind:function(e,t){return function(){return e.apply(t,arguments)}},createClass:function(e){var t=e.$,n=e.base,i=e.privates||e._,o=e.proto,e=e.statics;if(!t&&(t=function(){n&&this.base.apply(this,arguments)}),i)var r=t,t=function(){var e,t=this._||(this._={});for(e in i){var n=i[e];t[e]="function"==typeof n?CKEDITOR.tools.bind(n,this):n}r.apply(this,arguments)};return n&&(t.prototype=this.prototypedCopy(n.prototype),t.prototype.constructor=t,t.base=n,t.baseProto=n.prototype,t.prototype.base=function(){this.base=n.prototype.base,n.apply(this,arguments),this.base=arguments.callee}),o&&this.extend(t.prototype,o,!0),e&&this.extend(t,e,!0),t},addFunction:function(t,n){return e.push(function(){return t.apply(n||this,arguments)})-1},removeFunction:function(t){e[t]=null},callFunction:function(t){var n=e[t];return n&&n.apply(window,Array.prototype.slice.call(arguments,1))},cssLength:function(){var e,t=/^-?\d+\.?\d*px$/;return function(n){return e=CKEDITOR.tools.trim(n+"")+"px",t.test(e)?e:n||""}}(),convertToPx:function(){var e;return function(t){return e||(e=CKEDITOR.dom.element.createFromHtml('
',CKEDITOR.document),CKEDITOR.document.getBody().append(e)),/%$/.test(t)?t:(e.setStyle("width",t),e.$.clientWidth)}}(),repeat:function(e,t){return Array(t+1).join(e)},tryThese:function(){for(var e,t=0,n=arguments.length;n>t;t++){var i=arguments[t];try{e=i();break}catch(o){}}return e},genKey:function(){return Array.prototype.slice.call(arguments).join("-")},defer:function(e){return function(){var t=arguments,n=this;window.setTimeout(function(){e.apply(n,t)},0)}},normalizeCssText:function(e,t){var n,i=[],o=CKEDITOR.tools.parseCssText(e,!0,t);for(n in o)i.push(n+":"+o[n]);return i.sort(),i.length?i.join(";")+";":""},convertRgbToHex:function(e){return e.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi,function(e,t,n,i){for(e=[t,n,i],t=0;3>t;t++)e[t]=("0"+parseInt(e[t],10).toString(16)).slice(-2);return"#"+e.join("")})},parseCssText:function(e,t,n){var i={};return n&&(n=new CKEDITOR.dom.element("span"),n.setAttribute("style",e),e=CKEDITOR.tools.convertRgbToHex(n.getAttribute("style")||"")),e&&";"!=e?(e.replace(/"/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(e,n,o){t&&(n=n.toLowerCase(),"font-family"==n&&(o=o.toLowerCase().replace(/["']/g,"").replace(/\s*,\s*/g,",")),o=CKEDITOR.tools.trim(o)),i[n]=o}),i):i},writeCssText:function(e,t){var n,i=[];for(n in e)i.push(n+":"+e[n]);return t&&i.sort(),i.join("; ")},objectCompare:function(e,t,n){var i;if(!e&&!t)return!0;if(!e||!t)return!1;for(i in e)if(e[i]!=t[i])return!1;if(!n)for(i in t)if(e[i]!=t[i])return!1;return!0},objectKeys:function(e){var t,n=[];for(t in e)n.push(t);return n},convertArrayToObject:function(e,t){var n={};1==arguments.length&&(t=!0);for(var i=0,o=e.length;o>i;++i)n[e[i]]=t;return n},fixDomain:function(){for(var e;;)try{e=window.parent.document.domain;break}catch(t){if(e=e?e.replace(/.+?(?:\.|$)/,""):document.domain,!e)break;document.domain=e}return!!e}}}(),CKEDITOR.dtd=function(){var e=CKEDITOR.tools.extend,t=function(e,t){for(var n=CKEDITOR.tools.clone(e),i=1;i=i;i++)if(t[i]!=e[i]){if(n>i)return t[i]8)&&t&&(e=t+":"+e),new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(e))},getHead:function(){var e=this.$.getElementsByTagName("head")[0];return e=e?new CKEDITOR.dom.element(e):this.getDocumentElement().append(new CKEDITOR.dom.element("head"),!0)},getBody:function(){return new CKEDITOR.dom.element(this.$.body)},getDocumentElement:function(){return new CKEDITOR.dom.element(this.$.documentElement)},getWindow:function(){return new CKEDITOR.dom.window(this.$.parentWindow||this.$.defaultView)},write:function(e){this.$.open("text/html","replace"),CKEDITOR.env.ie&&(e=e.replace(/(?:^\s*]*?>)|^/i,'$&\n")),this.$.write(e),this.$.close()}}),CKEDITOR.dom.nodeList=function(e){this.$=e},CKEDITOR.dom.nodeList.prototype={count:function(){return this.$.length},getItem:function(e){return 0>e||e>=this.$.length?null:(e=this.$[e])?new CKEDITOR.dom.node(e):null}},CKEDITOR.dom.element=function(e,t){"string"==typeof e&&(e=(t?t.$:document).createElement(e)),CKEDITOR.dom.domObject.call(this,e)},CKEDITOR.dom.element.get=function(e){return(e="string"==typeof e?document.getElementById(e)||document.getElementsByName(e)[0]:e)&&(e.$?e:new CKEDITOR.dom.element(e))},CKEDITOR.dom.element.prototype=new CKEDITOR.dom.node,CKEDITOR.dom.element.createFromHtml=function(e,t){var n=new CKEDITOR.dom.element("div",t);return n.setHtml(e),n.getFirst().remove()},CKEDITOR.dom.element.setMarker=function(e,t,n,i){var o=t.getCustomData("list_marker_id")||t.setCustomData("list_marker_id",CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),r=t.getCustomData("list_marker_names")||t.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");return e[o]=t,r[n]=1,t.setCustomData(n,i)},CKEDITOR.dom.element.clearAllMarkers=function(e){for(var t in e)CKEDITOR.dom.element.clearMarkers(e,e[t],1)},CKEDITOR.dom.element.clearMarkers=function(e,t,n){var i,o=t.getCustomData("list_marker_names"),r=t.getCustomData("list_marker_id");for(i in o)t.removeCustomData(i);t.removeCustomData("list_marker_names"),n&&(t.removeCustomData("list_marker_id"),delete e[r])},function(){function e(e){for(var n=0,i=0,o=t[e].length;o>i;i++)n+=parseInt(this.getComputedStyle(t[e][i])||0,10)||0;return n}CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_ELEMENT,addClass:function(e){var t=this.$.className;t&&(RegExp("(?:^|\\s)"+e+"(?:\\s|$)","").test(t)||(t+=" "+e)),this.$.className=t||e},removeClass:function(e){var t=this.getAttribute("class");return t&&(e=RegExp("(?:^|\\s+)"+e+"(?=\\s|$)","i"),e.test(t)&&((t=t.replace(e,"").replace(/^\s+/,""))?this.setAttribute("class",t):this.removeAttribute("class"))),this},hasClass:function(e){return RegExp("(?:^|\\s+)"+e+"(?=\\s|$)","").test(this.getAttribute("class"))},append:function(e,t){return"string"==typeof e&&(e=this.getDocument().createElement(e)),t?this.$.insertBefore(e.$,this.$.firstChild):this.$.appendChild(e.$),e},appendHtml:function(e){if(this.$.childNodes.length){var t=new CKEDITOR.dom.element("div",this.getDocument());t.setHtml(e),t.moveChildren(this)}else this.setHtml(e)},appendText:function(e){void 0!=this.$.text?this.$.text=this.$.text+e:this.append(new CKEDITOR.dom.text(e))},appendBogus:function(){for(var e=this.getLast();e&&e.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.rtrim(e.getText());)e=e.getPrevious();e&&e.is&&e.is("br")||(e=CKEDITOR.env.opera?this.getDocument().createText(""):this.getDocument().createElement("br"),CKEDITOR.env.gecko&&e.setAttribute("type","_moz"),this.append(e))},breakParent:function(e){var t=new CKEDITOR.dom.range(this.getDocument());t.setStartAfter(this),t.setEndAfter(e),e=t.extractContents(),t.insertNode(this.remove()),e.insertAfterNode(this)},contains:CKEDITOR.env.ie||CKEDITOR.env.webkit?function(e){var t=this.$;return e.type!=CKEDITOR.NODE_ELEMENT?t.contains(e.getParent().$):t!=e.$&&t.contains(e.$) }:function(e){return!!(16&this.$.compareDocumentPosition(e.$))},focus:function(){function e(){try{this.$.focus()}catch(e){}}return function(t){t?CKEDITOR.tools.setTimeout(e,100,this):e.call(this)}}(),getHtml:function(){var e=this.$.innerHTML;return CKEDITOR.env.ie?e.replace(/<\?[^>]*>/g,""):e},getOuterHtml:function(){if(this.$.outerHTML)return this.$.outerHTML.replace(/<\?[^>]*>/,"");var e=this.$.ownerDocument.createElement("div");return e.appendChild(this.$.cloneNode(!0)),e.innerHTML},getClientRect:function(){var e=CKEDITOR.tools.extend({},this.$.getBoundingClientRect());return!e.width&&(e.width=e.right-e.left),!e.height&&(e.height=e.bottom-e.top),e},setHtml:function(){var e=function(e){return this.$.innerHTML=e};return CKEDITOR.env.ie&&CKEDITOR.env.version<9?function(e){try{return this.$.innerHTML=e}catch(t){this.$.innerHTML="";var n=new CKEDITOR.dom.element("body",this.getDocument());for(n.$.innerHTML=e,n=n.getChildren();n.count();)this.append(n.getItem(0));return e}}:e}(),setText:function(e){return CKEDITOR.dom.element.prototype.setText=void 0!=this.$.innerText?function(e){return this.$.innerText=e}:function(e){return this.$.textContent=e},this.setText(e)},getAttribute:function(){var e=function(e){return this.$.getAttribute(e,2)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)?function(e){switch(e){case"class":e="className";break;case"http-equiv":e="httpEquiv";break;case"name":return this.$.name;case"tabindex":return e=this.$.getAttribute(e,2),0!==e&&0===this.$.tabIndex&&(e=null),e;case"checked":return e=this.$.attributes.getNamedItem(e),(e.specified?e.nodeValue:this.$.checked)?"checked":null;case"hspace":case"value":return this.$[e];case"style":return this.$.style.cssText;case"contenteditable":case"contentEditable":return this.$.attributes.getNamedItem("contentEditable").specified?this.$.getAttribute("contentEditable"):null}return this.$.getAttribute(e,2)}:e}(),getChildren:function(){return new CKEDITOR.dom.nodeList(this.$.childNodes)},getComputedStyle:CKEDITOR.env.ie?function(e){return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(e)]}:function(e){var t=this.getWindow().$.getComputedStyle(this.$,null);return t?t.getPropertyValue(e):""},getDtd:function(){var e=CKEDITOR.dtd[this.getName()];return this.getDtd=function(){return e},e},getElementsByTag:CKEDITOR.dom.document.prototype.getElementsByTag,getTabIndex:CKEDITOR.env.ie?function(){var e=this.$.tabIndex;return 0===e&&!CKEDITOR.dtd.$tabIndex[this.getName()]&&0!==parseInt(this.getAttribute("tabindex"),10)&&(e=-1),e}:CKEDITOR.env.webkit?function(){var e=this.$.tabIndex;return void 0==e&&(e=parseInt(this.getAttribute("tabindex"),10),isNaN(e)&&(e=-1)),e}:function(){return this.$.tabIndex},getText:function(){return this.$.textContent||this.$.innerText||""},getWindow:function(){return this.getDocument().getWindow()},getId:function(){return this.$.id||null},getNameAtt:function(){return this.$.name||null},getName:function(){var e=this.$.nodeName.toLowerCase();if(CKEDITOR.env.ie&&!(document.documentMode>8)){var t=this.$.scopeName;"HTML"!=t&&(e=t.toLowerCase()+":"+e)}return(this.getName=function(){return e})()},getValue:function(){return this.$.value},getFirst:function(e){var t=this.$.firstChild;return(t=t&&new CKEDITOR.dom.node(t))&&e&&!e(t)&&(t=t.getNext(e)),t},getLast:function(e){var t=this.$.lastChild;return(t=t&&new CKEDITOR.dom.node(t))&&e&&!e(t)&&(t=t.getPrevious(e)),t},getStyle:function(e){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(e)]},is:function(){var e=this.getName();if("object"==typeof arguments[0])return!!arguments[0][e];for(var t=0;tt;t++){var i=e.getItem(t);if((i.type!=CKEDITOR.NODE_ELEMENT||!i.data("cke-bookmark"))&&(i.type==CKEDITOR.NODE_ELEMENT&&!i.isEmptyInlineRemoveable()||i.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(i.getText())))return!1}return!0},hasAttributes:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)?function(){for(var e=this.$.attributes,t=0;t0&&(t>2||!n[e[0].nodeName]||2==t&&!n[e[1].nodeName])},hasAttribute:function(){function e(e){return e=this.$.attributes.getNamedItem(e),!(!e||!e.specified)}return CKEDITOR.env.ie&&CKEDITOR.env.version<8?function(t){return"name"==t?!!this.$.name:e.call(this,t)}:e}(),hide:function(){this.setStyle("display","none")},moveChildren:function(e,t){var n=this.$,e=e.$;if(n!=e){var i;if(t)for(;i=n.lastChild;)e.insertBefore(n.removeChild(i),e.firstChild);else for(;i=n.firstChild;)e.appendChild(n.removeChild(i))}},mergeSiblings:function(){function e(e,t,n){if(t&&t.type==CKEDITOR.NODE_ELEMENT){for(var i=[];t.data("cke-bookmark")||t.isEmptyInlineRemoveable();)if(i.push(t),t=n?t.getNext():t.getPrevious(),!t||t.type!=CKEDITOR.NODE_ELEMENT)return;if(e.isIdentical(t)){for(var o=n?e.getLast():e.getFirst();i.length;)i.shift().move(e,!n);t.moveChildren(e,!n),t.remove(),o&&o.type==CKEDITOR.NODE_ELEMENT&&o.mergeSiblings()}}}return function(t){(t===!1||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a"))&&(e(this,this.getNext(),!0),e(this,this.getPrevious()))}}(),show:function(){this.setStyles({display:"",visibility:""})},setAttribute:function(){var e=function(e,t){return this.$.setAttribute(e,t),this};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)?function(t,n){return"class"==t?this.$.className=n:"style"==t?this.$.style.cssText=n:"tabindex"==t?this.$.tabIndex=n:"checked"==t?this.$.checked=n:"contenteditable"==t?e.call(this,"contentEditable",n):e.apply(this,arguments),this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(t,n){if("src"==t&&n.match(/^http:\/\//))try{e.apply(this,arguments)}catch(i){}else e.apply(this,arguments);return this}:e}(),setAttributes:function(e){for(var t in e)this.setAttribute(t,e[t]);return this},setValue:function(e){return this.$.value=e,this},removeAttribute:function(){var e=function(e){this.$.removeAttribute(e)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)?function(e){"class"==e?e="className":"tabindex"==e?e="tabIndex":"contenteditable"==e&&(e="contentEditable"),this.$.removeAttribute(e)}:e}(),removeAttributes:function(e){if(CKEDITOR.tools.isArray(e))for(var t=0;t=100?"":"progid:DXImageTransform.Microsoft.Alpha(opacity="+e+")")):this.setStyle("opacity",e)},unselectable:function(){if(this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","none")),CKEDITOR.env.ie||CKEDITOR.env.opera){this.setAttribute("unselectable","on");for(var e,t=this.getElementsByTag("*"),n=0,i=t.count();i>n;n++)e=t.getItem(n),e.setAttribute("unselectable","on")}},getPositionedAncestor:function(){for(var e=this;"html"!=e.getName();){if("static"!=e.getComputedStyle("position"))return e;e=e.getParent()}return null},getDocumentPosition:function(e){var t=0,n=0,i=this.getDocument(),o=i.getBody(),r="BackCompat"==i.$.compatMode;if(document.documentElement.getBoundingClientRect){var a=this.$.getBoundingClientRect(),s=i.$.documentElement,l=s.clientTop||o.$.clientTop||0,c=s.clientLeft||o.$.clientLeft||0,u=!0;CKEDITOR.env.ie&&(u=i.getDocumentElement().contains(this),i=i.getBody().contains(this),u=r&&i||!r&&u),u&&(t=a.left+(!r&&s.scrollLeft||o.$.scrollLeft),t-=c,n=a.top+(!r&&s.scrollTop||o.$.scrollTop),n-=l)}else for(o=this,i=null;o&&"body"!=o.getName()&&"html"!=o.getName();){for(t+=o.$.offsetLeft-o.$.scrollLeft,n+=o.$.offsetTop-o.$.scrollTop,o.equals(this)||(t+=o.$.clientLeft||0,n+=o.$.clientTop||0);i&&!i.equals(o);)t-=i.$.scrollLeft,n-=i.$.scrollTop,i=i.getParent();i=o,o=(a=o.$.offsetParent)?new CKEDITOR.dom.element(a):null}return e&&(o=this.getWindow(),i=e.getWindow(),!o.equals(i)&&o.$.frameElement&&(e=new CKEDITOR.dom.element(o.$.frameElement).getDocumentPosition(e),t+=e.x,n+=e.y)),document.documentElement.getBoundingClientRect||!CKEDITOR.env.gecko||r||(t+=this.$.clientLeft?1:0,n+=this.$.clientTop?1:0),{x:t,y:n}},scrollIntoView:function(e){var t=this.getParent();if(t)do if((t.$.clientWidth&&t.$.clientWidthc||s>0)&&i(0,t===!0?c:t===!1?s:0>c?c:s),n&&(0>l||a>0)&&i(0>l?l:a,0)},setState:function(e,t,n){switch(t=t||"cke",e){case CKEDITOR.TRISTATE_ON:this.addClass(t+"_on"),this.removeClass(t+"_off"),this.removeClass(t+"_disabled"),n&&this.setAttribute("aria-pressed",!0),n&&this.removeAttribute("aria-disabled");break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(t+"_disabled"),this.removeClass(t+"_off"),this.removeClass(t+"_on"),n&&this.setAttribute("aria-disabled",!0),n&&this.removeAttribute("aria-pressed");break;default:this.addClass(t+"_off"),this.removeClass(t+"_on"),this.removeClass(t+"_disabled"),n&&this.removeAttribute("aria-pressed"),n&&this.removeAttribute("aria-disabled")}},getFrameDocument:function(){var e=this.$;try{e.contentWindow.document}catch(t){e.src=e.src}return e&&new CKEDITOR.dom.document(e.contentWindow.document)},copyAttributes:function(e,t){for(var n=this.$.attributes,t=t||{},i=0;i=0&&t0&&n;)n=e(n,t.shift());else n=e(n,t);return n?new CKEDITOR.dom.node(n):null}}(),getChildCount:function(){return this.$.childNodes.length},disableContextMenu:function(){this.on("contextmenu",function(e){e.data.getTarget().hasClass("cke_enable_context_menu")||e.data.preventDefault()})},getDirection:function(e){return e?this.getComputedStyle("direction")||this.getDirection()||this.getParent()&&this.getParent().getDirection(1)||this.getDocument().$.dir||"ltr":this.getStyle("direction")||this.getAttribute("dir")},data:function(e,t){return e="data-"+e,void 0===t?this.getAttribute(e):(t===!1?this.removeAttribute(e):this.setAttribute(e,t),null)},getEditor:function(){var e,t,n=CKEDITOR.instances;for(e in n)if(t=n[e],t.element.equals(this)&&t.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO)return t;return null}});var t={width:["border-left-width","border-right-width","padding-left","padding-right"],height:["border-top-width","border-bottom-width","padding-top","padding-bottom"]};CKEDITOR.dom.element.prototype.setSize=function(t,n,i){"number"==typeof n&&(!i||CKEDITOR.env.ie&&CKEDITOR.env.quirks||(n-=e.call(this,t)),this.setStyle(t,n+"px"))},CKEDITOR.dom.element.prototype.getSize=function(t,n){var i=Math.max(this.$["offset"+CKEDITOR.tools.capitalize(t)],this.$["client"+CKEDITOR.tools.capitalize(t)])||0;return n&&(i-=e.call(this,t)),i}}(),CKEDITOR.dom.documentFragment=function(e){e=e||CKEDITOR.document,this.$=e.type==CKEDITOR.NODE_DOCUMENT?e.$.createDocumentFragment():e},CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype,CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,insertAfterNode:function(e){e=e.$,e.parentNode.insertBefore(this.$,e.nextSibling)}},!0,{append:1,appendBogus:1,getFirst:1,getLast:1,getParent:1,getNext:1,getPrevious:1,appendTo:1,moveChildren:1,insertBefore:1,insertAfterNode:1,replace:1,trim:1,type:1,ltrim:1,rtrim:1,getDocument:1,getChildCount:1,getChild:1,getChildren:1}),function(){function e(e,t){var n=this.range;if(this._.end)return null;if(!this._.start){if(this._.start=1,n.collapsed)return this.end(),null;n.optimize()}var i,o=n.startContainer;i=n.endContainer;var r,a=n.startOffset,s=n.endOffset,l=this.guard,c=this.type,u=e?"getPreviousSourceNode":"getNextSourceNode";if(!e&&!this._.guardLTR){var d=i.type==CKEDITOR.NODE_ELEMENT?i:i.getParent(),h=i.type==CKEDITOR.NODE_ELEMENT?i.getChild(s):i.getNext();this._.guardLTR=function(e,t){return!(t&&d.equals(e)||h&&e.equals(h)||e.type==CKEDITOR.NODE_ELEMENT&&t&&e.equals(n.root))}}if(e&&!this._.guardRTL){var f=o.type==CKEDITOR.NODE_ELEMENT?o:o.getParent(),m=o.type==CKEDITOR.NODE_ELEMENT?a?o.getChild(a-1):null:o.getPrevious();this._.guardRTL=function(e,t){return!(t&&f.equals(e)||m&&e.equals(m)||e.type==CKEDITOR.NODE_ELEMENT&&t&&e.equals(n.root))}}var E=e?this._.guardRTL:this._.guardLTR;for(r=l?function(e,t){return E(e,t)===!1?!1:l(e,t)}:E,this.current?i=this.current[u](!1,c,r):(e?i.type==CKEDITOR.NODE_ELEMENT&&(i=s>0?i.getChild(s-1):r(i,!0)===!1?null:i.getPreviousSourceNode(!0,c,r)):(i=o,i.type!=CKEDITOR.NODE_ELEMENT||(i=i.getChild(a))||(i=r(o,!0)===!1?null:o.getNextSourceNode(!0,c,r))),i&&r(i)===!1&&(i=null));i&&!this._.end;){if(this.current=i,this.evaluator&&this.evaluator(i)===!1){if(t&&this.evaluator)return!1}else if(!t)return i;i=i[u](!1,c,r)}return this.end(),this.current=null}function t(t){for(var n,i=null;n=e.call(this,t);)i=n;return i}CKEDITOR.dom.walker=CKEDITOR.tools.createClass({$:function(e){this.range=e,this._={}},proto:{end:function(){this._.end=1},next:function(){return e.call(this)},previous:function(){return e.call(this,1)},checkForward:function(){return e.call(this,0,1)!==!1},checkBackward:function(){return e.call(this,1,1)!==!1},lastForward:function(){return t.call(this)},lastBackward:function(){return t.call(this,1)},reset:function(){delete this.current,this._={}}}});var n={block:1,"list-item":1,table:1,"table-row-group":1,"table-header-group":1,"table-footer-group":1,"table-row":1,"table-column-group":1,"table-column":1,"table-cell":1,"table-caption":1};CKEDITOR.dom.element.prototype.isBlockBoundary=function(e){return e=e?CKEDITOR.tools.extend({},CKEDITOR.dtd.$block,e||{}):CKEDITOR.dtd.$block,"none"==this.getComputedStyle("float")&&n[this.getComputedStyle("display")]||e[this.getName()]},CKEDITOR.dom.walker.blockBoundary=function(e){return function(t){return!(t.type==CKEDITOR.NODE_ELEMENT&&t.isBlockBoundary(e))}},CKEDITOR.dom.walker.listItemBoundary=function(){return this.blockBoundary({br:1})},CKEDITOR.dom.walker.bookmark=function(e,t){function n(e){return e&&e.getName&&"span"==e.getName()&&e.data("cke-bookmark")}return function(i){var o,r;return o=i&&i.type!=CKEDITOR.NODE_ELEMENT&&(r=i.getParent())&&n(r),o=e?o:o||n(i),!!(t^o)}},CKEDITOR.dom.walker.whitespaces=function(e){return function(t){var n;return t&&t.type==CKEDITOR.NODE_TEXT&&(n=!CKEDITOR.tools.trim(t.getText())||CKEDITOR.env.webkit&&"​"==t.getText()),!!(e^n)}},CKEDITOR.dom.walker.invisible=function(e){var t=CKEDITOR.dom.walker.whitespaces();return function(n){return t(n)?n=1:(n.type==CKEDITOR.NODE_TEXT&&(n=n.getParent()),n=!n.$.offsetHeight),!!(e^n)}},CKEDITOR.dom.walker.nodeType=function(e,t){return function(n){return!!(t^n.type==e)}},CKEDITOR.dom.walker.bogus=function(e){function t(e){return!o(e)&&!r(e)}return function(n){var o=CKEDITOR.env.ie?n.getText&&i.test(n.getText()):n.is&&n.is("br");return o&&(o=n.getParent(),n=n.getNext(t),o=o.isBlockBoundary()&&(!n||n.type==CKEDITOR.NODE_ELEMENT&&n.isBlockBoundary())),!!(e^o)}};var i=/^[\t\r\n ]*(?: |\xa0)$/,o=CKEDITOR.dom.walker.whitespaces(),r=CKEDITOR.dom.walker.bookmark();CKEDITOR.dom.element.prototype.getBogus=function(){var e=this;do e=e.getPreviousSourceNode();while(r(e)||o(e)||e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in CKEDITOR.dtd.$inline&&!(e.getName()in CKEDITOR.dtd.$empty));return e&&(CKEDITOR.env.ie?e.getText&&i.test(e.getText()):e.is&&e.is("br"))?e:!1}}(),CKEDITOR.dom.range=function(e){this.endOffset=this.endContainer=this.startOffset=this.startContainer=null,this.collapsed=!0;var t=e instanceof CKEDITOR.dom.document;this.document=t?e:e.getDocument(),this.root=t?e.getBody():e},function(){function e(){var e=!1,t=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.dom.walker.bookmark(!0),i=CKEDITOR.dom.walker.bogus();return function(o){return n(o)||t(o)?!0:i(o)&&!e?e=!0:o.type==CKEDITOR.NODE_TEXT&&(o.hasAscendant("pre")||CKEDITOR.tools.trim(o.getText()).length)||o.type==CKEDITOR.NODE_ELEMENT&&!o.is(r)?!1:!0}}function t(e){var t=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.dom.walker.bookmark(1);return function(i){return n(i)||t(i)?!0:!e&&a(i)||i.type==CKEDITOR.NODE_ELEMENT&&i.is(CKEDITOR.dtd.$removeEmpty)}}function n(e){return!s(e)&&!l(e)}var i=function(e){e.collapsed=e.startContainer&&e.endContainer&&e.startContainer.equals(e.endContainer)&&e.startOffset==e.endOffset},o=function(e,t,n,i){e.optimizeBookmark();var o,r,a=e.startContainer,s=e.endContainer,l=e.startOffset,c=e.endOffset;s.type==CKEDITOR.NODE_TEXT?s=s.split(c):s.getChildCount()>0&&(c>=s.getChildCount()?(s=s.append(e.document.createText("")),r=!0):s=s.getChild(c)),a.type==CKEDITOR.NODE_TEXT?(a.split(l),a.equals(s)&&(s=a.getNext())):l?l>=a.getChildCount()?(a=a.append(e.document.createText("")),o=!0):a=a.getChild(l).getPrevious():(a=a.append(e.document.createText(""),1),o=!0);var u,d,h,l=a.getParents(),c=s.getParents();for(u=0;u0&&!f.equals(s)&&(m=g.append(f.clone())),!l[n]||f.$.parentNode!=l[n].$.parentNode)for(f=f.getPrevious();f&&(!f.equals(l[n])&&!f.equals(a));)E=f.getPrevious(),2==t?g.$.insertBefore(f.$.cloneNode(!0),g.$.firstChild):(f.remove(),1==t&&g.$.insertBefore(f.$,g.$.firstChild)),f=E;g&&(g=m)}2==t?(d=e.startContainer,d.type==CKEDITOR.NODE_TEXT&&(d.$.data=d.$.data+d.$.nextSibling.data,d.$.parentNode.removeChild(d.$.nextSibling)),e=e.endContainer,e.type==CKEDITOR.NODE_TEXT&&e.$.nextSibling&&(e.$.data=e.$.data+e.$.nextSibling.data,e.$.parentNode.removeChild(e.$.nextSibling))):(d&&h&&(a.$.parentNode!=d.$.parentNode||s.$.parentNode!=h.$.parentNode)&&(t=h.getIndex(),o&&h.$.parentNode==a.$.parentNode&&t--,i&&d.type==CKEDITOR.NODE_ELEMENT?(i=CKEDITOR.dom.element.createFromHtml(' ',e.document),i.insertAfter(d),d.mergeSiblings(!1),e.moveToBookmark({startNode:i})):e.setStart(h.getParent(),t)),e.collapse(!0)),o&&a.remove(),r&&s.$.parentNode&&s.remove()},r={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1},a=CKEDITOR.dom.walker.bogus(),s=new CKEDITOR.dom.walker.whitespaces,l=new CKEDITOR.dom.walker.bookmark,c=/^[\t\r\n ]*(?: |\xa0)$/;CKEDITOR.dom.range.prototype={clone:function(){var e=new CKEDITOR.dom.range(this.root);return e.startContainer=this.startContainer,e.startOffset=this.startOffset,e.endContainer=this.endContainer,e.endOffset=this.endOffset,e.collapsed=this.collapsed,e},collapse:function(e){e?(this.endContainer=this.startContainer,this.endOffset=this.startOffset):(this.startContainer=this.endContainer,this.startOffset=this.endOffset),this.collapsed=!0},cloneContents:function(){var e=new CKEDITOR.dom.documentFragment(this.document);return this.collapsed||o(this,2,e),e},deleteContents:function(e){this.collapsed||o(this,0,null,e)},extractContents:function(e){var t=new CKEDITOR.dom.documentFragment(this.document);return this.collapsed||o(this,1,t,e),t},createBookmark:function(e){var t,n,i,o,r=this.collapsed;return t=this.document.createElement("span"),t.data("cke-bookmark",1),t.setStyle("display","none"),t.setHtml(" "),e&&(i="cke_bm_"+CKEDITOR.tools.getNextNumber(),t.setAttribute("id",i+(r?"C":"S"))),r||(n=t.clone(),n.setHtml(" "),e&&n.setAttribute("id",i+"E"),o=this.clone(),o.collapse(),o.insertNode(n)),o=this.clone(),o.collapse(!0),o.insertNode(t),n?(this.setStartAfter(t),this.setEndBefore(n)):this.moveToPosition(t,CKEDITOR.POSITION_AFTER_END),{startNode:e?i+(r?"C":"S"):t,endNode:e?i+"E":n,serializable:e,collapsed:r}},createBookmark2:function(e){var t,n,i=this.startContainer,o=this.endContainer,r=this.startOffset,a=this.endOffset,s=this.collapsed;if(!i||!o)return{start:0,end:0};if(e){for(i.type==CKEDITOR.NODE_ELEMENT&&((t=i.getChild(r))&&t.type==CKEDITOR.NODE_TEXT&&r>0&&t.getPrevious().type==CKEDITOR.NODE_TEXT&&(i=t,r=0),t&&t.type==CKEDITOR.NODE_ELEMENT&&(r=t.getIndex(1)));i.type==CKEDITOR.NODE_TEXT&&(n=i.getPrevious())&&n.type==CKEDITOR.NODE_TEXT;)i=n,r+=n.getLength();if(!s)for(o.type==CKEDITOR.NODE_ELEMENT&&((t=o.getChild(a))&&t.type==CKEDITOR.NODE_TEXT&&a>0&&t.getPrevious().type==CKEDITOR.NODE_TEXT&&(o=t,a=0),t&&t.type==CKEDITOR.NODE_ELEMENT&&(a=t.getIndex(1)));o.type==CKEDITOR.NODE_TEXT&&(n=o.getPrevious())&&n.type==CKEDITOR.NODE_TEXT;)o=n,a+=n.getLength()}return{start:i.getAddress(e),end:s?null:o.getAddress(e),startOffset:r,endOffset:a,normalized:e,collapsed:s,is2:!0}},moveToBookmark:function(e){if(e.is2){var t=this.document.getByAddress(e.start,e.normalized),n=e.startOffset,i=e.end&&this.document.getByAddress(e.end,e.normalized),e=e.endOffset;this.setStart(t,n),i?this.setEnd(i,e):this.collapse(!0)}else t=(n=e.serializable)?this.document.getById(e.startNode):e.startNode,e=n?this.document.getById(e.endNode):e.endNode,this.setStartBefore(t),t.remove(),e?(this.setEndBefore(e),e.remove()):this.collapse(!0)},getBoundaryNodes:function(){var e,t=this.startContainer,n=this.endContainer,i=this.startOffset,o=this.endOffset;if(t.type==CKEDITOR.NODE_ELEMENT)if(e=t.getChildCount(),e>i)t=t.getChild(i);else if(1>e)t=t.getPreviousSourceNode();else{for(t=t.$;t.lastChild;)t=t.lastChild;t=new CKEDITOR.dom.node(t),t=t.getNextSourceNode()||t}if(n.type==CKEDITOR.NODE_ELEMENT)if(e=n.getChildCount(),e>o)n=n.getChild(o).getPreviousSourceNode(!0);else if(1>e)n=n.getPreviousSourceNode();else{for(n=n.$;n.lastChild;)n=n.lastChild;n=new CKEDITOR.dom.node(n)}return t.getPosition(n)&CKEDITOR.POSITION_FOLLOWING&&(t=n),{startNode:t,endNode:n}},getCommonAncestor:function(e,t){var n=this.startContainer,i=this.endContainer,n=n.equals(i)?e&&n.type==CKEDITOR.NODE_ELEMENT&&this.startOffset==this.endOffset-1?n.getChild(this.startOffset):n:n.getCommonAncestor(i);return t&&!n.is?n.getParent():n},optimize:function(){var e=this.startContainer,t=this.startOffset;e.type!=CKEDITOR.NODE_ELEMENT&&(t?t>=e.getLength()&&this.setStartAfter(e):this.setStartBefore(e)),e=this.endContainer,t=this.endOffset,e.type!=CKEDITOR.NODE_ELEMENT&&(t?t>=e.getLength()&&this.setEndAfter(e):this.setEndBefore(e))},optimizeBookmark:function(){var e=this.startContainer,t=this.endContainer;e.is&&e.is("span")&&e.data("cke-bookmark")&&this.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),t&&t.is&&t.is("span")&&t.data("cke-bookmark")&&this.setEndAt(t,CKEDITOR.POSITION_AFTER_END)},trim:function(e,t){var n=this.startContainer,i=this.startOffset,o=this.collapsed;if((!e||o)&&n&&n.type==CKEDITOR.NODE_TEXT){if(i)if(i>=n.getLength())i=n.getIndex()+1,n=n.getParent();else{var r=n.split(i),i=n.getIndex()+1,n=n.getParent();this.startContainer.equals(this.endContainer)?this.setEnd(r,this.endOffset-this.startOffset):n.equals(this.endContainer)&&(this.endOffset=this.endOffset+1)}else i=n.getIndex(),n=n.getParent();if(this.setStart(n,i),o)return void this.collapse(!0)}n=this.endContainer,i=this.endOffset,t||o||!n||n.type!=CKEDITOR.NODE_TEXT||(i?(i>=n.getLength()||n.split(i),i=n.getIndex()+1):i=n.getIndex(),n=n.getParent(),this.setEnd(n,i))},enlarge:function(e,t){switch(e){case CKEDITOR.ENLARGE_INLINE:var n=1;case CKEDITOR.ENLARGE_ELEMENT:if(this.collapsed)break;var i,o,r,a,s,l,c,u=this.getCommonAncestor(),d=this.root,h=!1;for(l=this.startContainer,c=this.startOffset,l.type==CKEDITOR.NODE_TEXT?(c&&(l=!CKEDITOR.tools.trim(l.substring(0,c)).length&&l,h=!!l),l&&!(a=l.getPrevious())&&(r=l.getParent())):(c&&(a=l.getChild(c-1)||l.getLast()),a||(r=l));r||a;){if(r&&!a){if(!s&&r.equals(u)&&(s=!0),n?r.isBlockBoundary():!d.contains(r))break;h&&"inline"==r.getComputedStyle("display")||(h=!1,s?i=r:this.setStartBefore(r)),a=r.getPrevious()}for(;a;)if(l=!1,a.type==CKEDITOR.NODE_COMMENT)a=a.getPrevious();else{if(a.type==CKEDITOR.NODE_TEXT)c=a.getText(),/[^\s\ufeff]/.test(c)&&(a=null),l=/[\s\ufeff]$/.test(c);else if((a.$.offsetWidth>0||t&&a.is("br"))&&!a.data("cke-bookmark"))if(h&&CKEDITOR.dtd.$removeEmpty[a.getName()]){if(c=a.getText(),/[^\s\ufeff]/.test(c))a=null;else for(var f,m=a.$.getElementsByTagName("*"),E=0;f=m[E++];)if(!CKEDITOR.dtd.$removeEmpty[f.nodeName.toLowerCase()]){a=null;break}a&&(l=!!c.length)}else a=null;if(l&&(h?s?i=r:r&&this.setStartBefore(r):h=!0),a){if(l=a.getPrevious(),!r&&!l){r=a,a=null;break}a=l}else r=null}r&&(r=r.getParent())}for(l=this.endContainer,c=this.endOffset,r=a=null,s=h=!1,l.type==CKEDITOR.NODE_TEXT?(l=!CKEDITOR.tools.trim(l.substring(c)).length&&l,h=!(l&&l.getLength()),l&&!(a=l.getNext())&&(r=l.getParent())):(a=l.getChild(c))||(r=l);r||a;){if(r&&!a){if(!s&&r.equals(u)&&(s=!0),n?r.isBlockBoundary():!d.contains(r))break;h&&"inline"==r.getComputedStyle("display")||(h=!1,s?o=r:r&&this.setEndAfter(r)),a=r.getNext()}for(;a;){if(l=!1,a.type==CKEDITOR.NODE_TEXT)c=a.getText(),/[^\s\ufeff]/.test(c)&&(a=null),l=/^[\s\ufeff]/.test(c);else if(a.type==CKEDITOR.NODE_ELEMENT){if((a.$.offsetWidth>0||t&&a.is("br"))&&!a.data("cke-bookmark"))if(h&&CKEDITOR.dtd.$removeEmpty[a.getName()]){if(c=a.getText(),/[^\s\ufeff]/.test(c))a=null;else for(m=a.$.getElementsByTagName("*"),E=0;f=m[E++];)if(!CKEDITOR.dtd.$removeEmpty[f.nodeName.toLowerCase()]){a=null;break}a&&(l=!!c.length)}else a=null}else l=1;if(l&&h&&(s?o=r:this.setEndAfter(r)),a){if(l=a.getNext(),!r&&!l){r=a,a=null;break}a=l}else r=null}r&&(r=r.getParent())}i&&o&&(u=i.contains(o)?o:i,this.setStartBefore(u),this.setEndAfter(u));break;case CKEDITOR.ENLARGE_BLOCK_CONTENTS:case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:r=new CKEDITOR.dom.range(this.root),d=this.root,r.setStartAt(d,CKEDITOR.POSITION_AFTER_START),r.setEnd(this.startContainer,this.startOffset),r=new CKEDITOR.dom.walker(r);var g,T,p=CKEDITOR.dom.walker.blockBoundary(e==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?{br:1}:null),C=function(e){var t=p(e);return t||(g=e),t},n=function(e){var t=C(e);return!t&&e.is&&e.is("br")&&(T=e),t};if(r.guard=C,r=r.lastBackward(),g=g||d,this.setStartAt(g,!g.is("br")&&(!r&&this.checkStartOfBlock()||r&&g.contains(r))?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_AFTER_END),e==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS){r=this.clone(),r=new CKEDITOR.dom.walker(r);var I=CKEDITOR.dom.walker.whitespaces(),O=CKEDITOR.dom.walker.bookmark();if(r.evaluator=function(e){return!I(e)&&!O(e)},(r=r.previous())&&r.type==CKEDITOR.NODE_ELEMENT&&r.is("br"))break}r=this.clone(),r.collapse(),r.setEndAt(d,CKEDITOR.POSITION_BEFORE_END),r=new CKEDITOR.dom.walker(r),r.guard=e==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?n:C,g=null,r=r.lastForward(),g=g||d,this.setEndAt(g,!r&&this.checkEndOfBlock()||r&&g.contains(r)?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_BEFORE_START),T&&this.setEndAfter(T)}},shrink:function(e,t,n){if(!this.collapsed){var e=e||CKEDITOR.SHRINK_TEXT,i=this.clone(),o=this.startContainer,r=this.endContainer,a=this.startOffset,s=this.endOffset,l=1,c=1;o&&o.type==CKEDITOR.NODE_TEXT&&(a?a>=o.getLength()?i.setStartAfter(o):(i.setStartBefore(o),l=0):i.setStartBefore(o)),r&&r.type==CKEDITOR.NODE_TEXT&&(s?s>=r.getLength()?i.setEndAfter(r):(i.setEndAfter(r),c=0):i.setEndBefore(r));var i=new CKEDITOR.dom.walker(i),u=CKEDITOR.dom.walker.bookmark();i.evaluator=function(t){return t.type==(e==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var d;return i.guard=function(t,i){return u(t)?!0:e==CKEDITOR.SHRINK_ELEMENT&&t.type==CKEDITOR.NODE_TEXT||i&&t.equals(d)||n===!1&&t.type==CKEDITOR.NODE_ELEMENT&&t.isBlockBoundary()?!1:(!i&&t.type==CKEDITOR.NODE_ELEMENT&&(d=t),!0)},l&&(o=i[e==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(o,t?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_START),c&&(i.reset(),(i=i[e==CKEDITOR.SHRINK_ELEMENT?"lastBackward":"previous"]())&&this.setEndAt(i,t?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END)),!(!l&&!c)}},insertNode:function(e){this.optimizeBookmark(),this.trim(!1,!0);var t=this.startContainer,n=t.getChild(this.startOffset);n?e.insertBefore(n):t.append(e),e.getParent()&&e.getParent().equals(this.endContainer)&&this.endOffset++,this.setStartBefore(e)},moveToPosition:function(e,t){this.setStartAt(e,t),this.collapse(!0)},moveToRange:function(e){this.setStart(e.startContainer,e.startOffset),this.setEnd(e.endContainer,e.endOffset) },selectNodeContents:function(e){this.setStart(e,0),this.setEnd(e,e.type==CKEDITOR.NODE_TEXT?e.getLength():e.getChildCount())},setStart:function(e,t){e.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[e.getName()]&&(t=e.getIndex(),e=e.getParent()),this.startContainer=e,this.startOffset=t,this.endContainer||(this.endContainer=e,this.endOffset=t),i(this)},setEnd:function(e,t){e.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[e.getName()]&&(t=e.getIndex()+1,e=e.getParent()),this.endContainer=e,this.endOffset=t,this.startContainer||(this.startContainer=e,this.startOffset=t),i(this)},setStartAfter:function(e){this.setStart(e.getParent(),e.getIndex()+1)},setStartBefore:function(e){this.setStart(e.getParent(),e.getIndex())},setEndAfter:function(e){this.setEnd(e.getParent(),e.getIndex()+1)},setEndBefore:function(e){this.setEnd(e.getParent(),e.getIndex())},setStartAt:function(e,t){switch(t){case CKEDITOR.POSITION_AFTER_START:this.setStart(e,0);break;case CKEDITOR.POSITION_BEFORE_END:e.type==CKEDITOR.NODE_TEXT?this.setStart(e,e.getLength()):this.setStart(e,e.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setStartBefore(e);break;case CKEDITOR.POSITION_AFTER_END:this.setStartAfter(e)}i(this)},setEndAt:function(e,t){switch(t){case CKEDITOR.POSITION_AFTER_START:this.setEnd(e,0);break;case CKEDITOR.POSITION_BEFORE_END:e.type==CKEDITOR.NODE_TEXT?this.setEnd(e,e.getLength()):this.setEnd(e,e.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setEndBefore(e);break;case CKEDITOR.POSITION_AFTER_END:this.setEndAfter(e)}i(this)},fixBlock:function(e,t){var n=this.createBookmark(),i=this.document.createElement(t);return this.collapse(e),this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS),this.extractContents().appendTo(i),i.trim(),CKEDITOR.env.ie||i.appendBogus(),this.insertNode(i),this.moveToBookmark(n),i},splitBlock:function(e){var t=new CKEDITOR.dom.elementPath(this.startContainer,this.root),n=new CKEDITOR.dom.elementPath(this.endContainer,this.root),i=t.block,o=n.block,r=null;return t.blockLimit.equals(n.blockLimit)?("br"!=e&&(i||(i=this.fixBlock(!0,e),o=new CKEDITOR.dom.elementPath(this.endContainer,this.root).block),o||(o=this.fixBlock(!1,e))),e=i&&this.checkStartOfBlock(),t=o&&this.checkEndOfBlock(),this.deleteContents(),i&&i.equals(o)&&(t?(r=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(o,CKEDITOR.POSITION_AFTER_END),o=null):e?(r=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(i,CKEDITOR.POSITION_BEFORE_START),i=null):(o=this.splitElement(i),!CKEDITOR.env.ie&&!i.is("ul","ol")&&i.appendBogus())),{previousBlock:i,nextBlock:o,wasStartOfBlock:e,wasEndOfBlock:t,elementPath:r}):null},splitElement:function(e){if(!this.collapsed)return null;this.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);var t=this.extractContents(),n=e.clone(!1);return t.appendTo(n),n.insertAfter(e),this.moveToPosition(e,CKEDITOR.POSITION_AFTER_END),n},removeEmptyBlocksAtEnd:function(){function e(e){return function(i){return t(i)||n(i)||i.type==CKEDITOR.NODE_ELEMENT&&i.isEmptyInlineRemoveable()||e.is("table")&&i.is("caption")?!1:!0}}var t=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.dom.walker.bookmark(!1);return function(t){for(var n,i=this.createBookmark(),o=this[t?"endPath":"startPath"](),r=o.block||o.blockLimit;r&&!r.equals(o.root)&&!r.getFirst(e(r));)n=r.getParent(),this[t?"setEndAt":"setStartAt"](r,CKEDITOR.POSITION_AFTER_END),r.remove(1),r=n;this.moveToBookmark(i)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer,this.root)},endPath:function(){return new CKEDITOR.dom.elementPath(this.endContainer,this.root)},checkBoundaryOfElement:function(e,n){var i=n==CKEDITOR.START,o=this.clone();return o.collapse(i),o[i?"setStartAt":"setEndAt"](e,i?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END),o=new CKEDITOR.dom.walker(o),o.evaluator=t(i),o[i?"checkBackward":"checkForward"]()},checkStartOfBlock:function(){var t=this.startContainer,n=this.startOffset;return CKEDITOR.env.ie&&n&&t.type==CKEDITOR.NODE_TEXT&&(t=CKEDITOR.tools.ltrim(t.substring(0,n)),c.test(t)&&this.trim(0,1)),this.trim(),t=new CKEDITOR.dom.elementPath(this.startContainer,this.root),n=this.clone(),n.collapse(!0),n.setStartAt(t.block||t.blockLimit,CKEDITOR.POSITION_AFTER_START),t=new CKEDITOR.dom.walker(n),t.evaluator=e(),t.checkBackward()},checkEndOfBlock:function(){var t=this.endContainer,n=this.endOffset;return CKEDITOR.env.ie&&t.type==CKEDITOR.NODE_TEXT&&(t=CKEDITOR.tools.rtrim(t.substring(n)),c.test(t)&&this.trim(1,0)),this.trim(),t=new CKEDITOR.dom.elementPath(this.endContainer,this.root),n=this.clone(),n.collapse(!1),n.setEndAt(t.block||t.blockLimit,CKEDITOR.POSITION_BEFORE_END),t=new CKEDITOR.dom.walker(n),t.evaluator=e(),t.checkForward()},getPreviousNode:function(e,t,n){var i=this.clone();return i.collapse(1),i.setStartAt(n||this.root,CKEDITOR.POSITION_AFTER_START),n=new CKEDITOR.dom.walker(i),n.evaluator=e,n.guard=t,n.previous()},getNextNode:function(e,t,n){var i=this.clone();return i.collapse(),i.setEndAt(n||this.root,CKEDITOR.POSITION_BEFORE_END),n=new CKEDITOR.dom.walker(i),n.evaluator=e,n.guard=t,n.next()},checkReadOnly:function(){function e(e,t){for(;e;){if(e.type==CKEDITOR.NODE_ELEMENT){if("false"==e.getAttribute("contentEditable")&&!e.data("cke-editable"))return 0;if(e.is("html")||"true"==e.getAttribute("contentEditable")&&(e.contains(t)||e.equals(t)))break}e=e.getParent()}return 1}return function(){var t=this.startContainer,n=this.endContainer;return!(e(t,n)&&e(n,t))}}(),moveToElementEditablePosition:function(e,t){if(e.type==CKEDITOR.NODE_ELEMENT&&!e.isEditable(!1))return this.moveToPosition(e,t?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),!0;for(var i=0;e;){if(e.type==CKEDITOR.NODE_TEXT){t&&this.checkEndOfBlock()&&c.test(e.getText())?this.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(e,t?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),i=1;break}e.type==CKEDITOR.NODE_ELEMENT&&(e.isEditable()?(this.moveToPosition(e,t?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START),i=1):t&&e.is("br")&&this.checkEndOfBlock()&&this.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START));var o=e,r=i,a=void 0;o.type==CKEDITOR.NODE_ELEMENT&&o.isEditable(!1)&&(a=o[t?"getLast":"getFirst"](n)),!r&&!a&&(a=o[t?"getPrevious":"getNext"](n)),e=a}return!!i},moveToElementEditStart:function(e){return this.moveToElementEditablePosition(e)},moveToElementEditEnd:function(e){return this.moveToElementEditablePosition(e,!0)},getEnclosedNode:function(){var e=this.clone();if(e.optimize(),e.startContainer.type!=CKEDITOR.NODE_ELEMENT||e.endContainer.type!=CKEDITOR.NODE_ELEMENT)return null;var e=new CKEDITOR.dom.walker(e),t=CKEDITOR.dom.walker.bookmark(!1,!0),n=CKEDITOR.dom.walker.whitespaces(!0);e.evaluator=function(e){return n(e)&&t(e)};var i=e.next();return e.reset(),i&&i.equals(e.previous())?i:null},getTouchedStartNode:function(){var e=this.startContainer;return this.collapsed||e.type!=CKEDITOR.NODE_ELEMENT?e:e.getChild(this.startOffset)||e},getTouchedEndNode:function(){var e=this.endContainer;return this.collapsed||e.type!=CKEDITOR.NODE_ELEMENT?e:e.getChild(this.endOffset-1)||e},scrollIntoView:function(){var e,t,n,i=new CKEDITOR.dom.element.createFromHtml(" ",this.document),o=this.clone();o.optimize(),(n=o.startContainer.type==CKEDITOR.NODE_TEXT)?(t=o.startContainer.getText(),e=o.startContainer.split(o.startOffset),i.insertAfter(o.startContainer)):o.insertNode(i),i.scrollIntoView(),n&&(o.startContainer.setText(t),e.remove()),i.remove()}}}(),CKEDITOR.POSITION_AFTER_START=1,CKEDITOR.POSITION_BEFORE_END=2,CKEDITOR.POSITION_BEFORE_START=3,CKEDITOR.POSITION_AFTER_END=4,CKEDITOR.ENLARGE_ELEMENT=1,CKEDITOR.ENLARGE_BLOCK_CONTENTS=2,CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS=3,CKEDITOR.ENLARGE_INLINE=4,CKEDITOR.START=1,CKEDITOR.END=2,CKEDITOR.SHRINK_ELEMENT=1,CKEDITOR.SHRINK_TEXT=2,function(){function e(e){arguments.length<1||(this.range=e,this.forceBrBreak=0,this.enlargeBr=1,this.enforceRealBlocks=0,this._||(this._={}))}function t(e,t,n){for(e=e.getNextSourceNode(t,null,n);!i(e);)e=e.getNextSourceNode(t,null,n);return e}var n=/^[\r\n\t ]+$/,i=CKEDITOR.dom.walker.bookmark(!1,!0),o=CKEDITOR.dom.walker.whitespaces(!0),r=function(e){return i(e)&&o(e)};e.prototype={getNextParagraph:function(e){if(e=e||"p",!CKEDITOR.dtd[this.range.root.getName()][e])return null;var o,a,s,l,c,u;if(!this._.started){if(a=this.range.clone(),a.shrink(CKEDITOR.NODE_ELEMENT,!0),l=a.endContainer.hasAscendant("pre",!0)||a.startContainer.hasAscendant("pre",!0),a.enlarge(this.forceBrBreak&&!l||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS),!a.collapsed){l=new CKEDITOR.dom.walker(a.clone());var d=CKEDITOR.dom.walker.bookmark(!0,!0);l.evaluator=d,this._.nextNode=l.next(),l=new CKEDITOR.dom.walker(a.clone()),l.evaluator=d,l=l.previous(),this._.lastNode=l.getNextSourceNode(!0),this._.lastNode&&this._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&(d=this.range.clone(),d.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END),d.checkEndOfBlock()&&(d=new CKEDITOR.dom.elementPath(d.endContainer,d.root),this._.lastNode=(d.block||d.blockLimit).getNextSourceNode(!0))),this._.lastNode||(this._.lastNode=this._.docEndMarker=a.document.createText(""),this._.lastNode.insertAfter(l)),a=null}this._.started=1}for(d=this._.nextNode,l=this._.lastNode,this._.nextNode=null;d;){var h=0,f=d.hasAscendant("pre"),m=d.type!=CKEDITOR.NODE_ELEMENT,E=0;if(m)d.type==CKEDITOR.NODE_TEXT&&n.test(d.getText())&&(m=0);else{var g=d.getName();if(d.isBlockBoundary(this.forceBrBreak&&!f&&{br:1})){if("br"==g)m=1;else if(!a&&!d.getChildCount()&&"hr"!=g){o=d,s=d.equals(l);break}a&&(a.setEndAt(d,CKEDITOR.POSITION_BEFORE_START),"br"!=g&&(this._.nextNode=d)),h=1}else{if(d.getFirst()){a||(a=this.range.clone(),a.setStartAt(d,CKEDITOR.POSITION_BEFORE_START)),d=d.getFirst();continue}m=1}}if(m&&!a&&(a=this.range.clone(),a.setStartAt(d,CKEDITOR.POSITION_BEFORE_START)),s=(!h||m)&&d.equals(l),a&&!h)for(;!d.getNext(r)&&!s;){if(g=d.getParent(),g.isBlockBoundary(this.forceBrBreak&&!f&&{br:1})){h=1,m=0,s||g.equals(l),a.setEndAt(g,CKEDITOR.POSITION_BEFORE_END);break}d=g,m=1,s=d.equals(l),E=1}if(m&&a.setEndAt(d,CKEDITOR.POSITION_AFTER_END),d=t(d,E,l),(s=!d)||h&&a)break}if(!o){if(!a)return this._.docEndMarker&&this._.docEndMarker.remove(),this._.nextNode=null;o=new CKEDITOR.dom.elementPath(a.startContainer,a.root),d=o.blockLimit,h={div:1,th:1,td:1},o=o.block,!o&&d&&!this.enforceRealBlocks&&h[d.getName()]&&a.checkStartOfBlock()&&a.checkEndOfBlock()&&!d.equals(a.root)?o=d:!o||this.enforceRealBlocks&&"li"==o.getName()?(o=this.range.document.createElement(e),a.extractContents().appendTo(o),o.trim(),a.insertNode(o),c=u=!0):"li"!=o.getName()?a.checkStartOfBlock()&&a.checkEndOfBlock()||(o=o.clone(!1),a.extractContents().appendTo(o),o.trim(),u=a.splitBlock(),c=!u.wasStartOfBlock,u=!u.wasEndOfBlock,a.insertNode(o)):s||(this._.nextNode=o.equals(l)?null:t(a.getBoundaryNodes().endNode,1,l))}return c&&(a=o.getPrevious())&&a.type==CKEDITOR.NODE_ELEMENT&&("br"==a.getName()?a.remove():a.getLast()&&"br"==a.getLast().$.nodeName.toLowerCase()&&a.getLast().remove()),u&&(a=o.getLast())&&a.type==CKEDITOR.NODE_ELEMENT&&"br"==a.getName()&&(CKEDITOR.env.ie||a.getPrevious(i)||a.getNext(i))&&a.remove(),this._.nextNode||(this._.nextNode=s||o.equals(l)||!l?null:t(o,1,l)),o}},CKEDITOR.dom.range.prototype.createIterator=function(){return new e(this)}}(),CKEDITOR.command=function(e,t){this.uiItems=[],this.exec=function(n){return this.state!=CKEDITOR.TRISTATE_DISABLED&&this.checkAllowed()?(this.editorFocus&&e.focus(),this.fire("exec")===!1?!0:t.exec.call(this,e,n)!==!1):!1},this.refresh=function(e,n){return!this.readOnly&&e.readOnly?!0:this.context&&!n.isContextFor(this.context)?(this.disable(),!0):(this.enable(),this.fire("refresh",{editor:e,path:n})===!1?!0:t.refresh&&t.refresh.apply(this,arguments)!==!1)};var n;this.checkAllowed=function(){return"boolean"==typeof n?n:n=e.filter.checkFeature(this)},CKEDITOR.tools.extend(this,t,{modes:{wysiwyg:1},editorFocus:1,contextSensitive:!!t.context,state:CKEDITOR.TRISTATE_DISABLED}),CKEDITOR.event.call(this)},CKEDITOR.command.prototype={enable:function(){this.state==CKEDITOR.TRISTATE_DISABLED&&this.checkAllowed()&&this.setState(this.preserveState&&"undefined"!=typeof this.previousState?this.previousState:CKEDITOR.TRISTATE_OFF)},disable:function(){this.setState(CKEDITOR.TRISTATE_DISABLED)},setState:function(e){return this.state!=e&&this.checkAllowed()?(this.previousState=this.state,this.state=e,this.fire("state"),!0):!1},toggleState:function(){this.state==CKEDITOR.TRISTATE_OFF?this.setState(CKEDITOR.TRISTATE_ON):this.state==CKEDITOR.TRISTATE_ON&&this.setState(CKEDITOR.TRISTATE_OFF)}},CKEDITOR.event.implementOn(CKEDITOR.command.prototype),CKEDITOR.ENTER_P=1,CKEDITOR.ENTER_BR=2,CKEDITOR.ENTER_DIV=3,CKEDITOR.config={customConfig:"config.js",autoUpdateElement:!0,language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR,docType:"",bodyId:"",bodyClass:"",fullPage:!1,height:200,extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,width:"",baseFloatZIndex:1e4,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]},function(){function e(e,n,i,r,a){var s=n.name;if((r||"function"!=typeof e.elements||e.elements(s))&&(!e.match||e.match(n))){if(r=!a){e:if(e.nothingRequired)r=!0;else{if(a=e.requiredClasses)for(s=n.classes,r=0;ra;++a)l=n[a],r[l]||(r[l]=e(l));n=!1}else n=!1;i.allClasses=n}}}function t(e,t,n){if(!e)return!1;if(e===!0)return!0;for(var i in t)n[i]||(n[i]=e(i,t[i]));return!1}function n(e,t){if(!e)return!1;if(e===!0)return e;if("string"==typeof e)return e=D(e),"*"==e?!0:CKEDITOR.tools.convertArrayToObject(e.split(t));if(CKEDITOR.tools.isArray(e))return e.length?CKEDITOR.tools.convertArrayToObject(e):!1;var n,i={},o=0;for(n in e)i[n]=e[n],o++;return o?i:!1}function i(t){if(t._.filterFunction)return t._.filterFunction;var n=/^cke:(object|embed|param)$/,i=/^(object|embed|param)$/;return t._.filterFunction=function(o,r,a,s,d,h,f){var m,g=o.name,T=!1;if(d&&(o.name=g=g.replace(n,"$1")),a=a&&a[g]){for(l(o),g=0;gg;++g)e(a[g],o,r,!0,h);if(p)for(g=0,m=p.length;m>g;++g)e(p[g],o,r,!1,h);if(!r.valid)return s.push(o),!0;h=r.validAttributes,g=r.validStyles,a=r.validClasses,m=o.attributes;var C,I,p=o.styles,O=m["class"],D=m.style,R=[],v=[],b=/^data-cke-/,K=!1;if(delete m.style,delete m["class"],!r.allAttributes)for(C in m)h[C]||(b.test(C)?C==(I=C.replace(/^data-cke-saved-/,""))||h[I]||(delete m[C],K=!0):(delete m[C],K=!0));if(r.allStyles)D&&(m.style=D);else{for(C in p)g[C]?R.push(C+":"+p[C]):K=!0;R.length&&(m.style=R.sort().join("; "))}if(r.allClasses)O&&(m["class"]=O);else{for(C in a)a[C]&&v.push(C);v.length&&(m["class"]=v.sort().join(" ")),O&&v.lengtha;++a)if(r=i[a],r.type==CKEDITOR.NODE_ELEMENT&&!o[r.name]){o=!1;break e}o=!0}if(o)e.name=t,e.attributes={},n.push({check:"parent-down",el:e});else{o=e.parent;for(var l,a=o.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||"body"==o.name,s=i.length;s>0;)r=i[--s],a&&(r.type==CKEDITOR.NODE_TEXT||r.type==CKEDITOR.NODE_ELEMENT&&I.$inline[r.name])?(l||(l=new CKEDITOR.htmlParser.element(t),l.insertAfter(e),n.push({check:"parent-down",el:l})),l.add(r,0)):(l=null,r.insertAfter(e),o.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&r.type==CKEDITOR.NODE_ELEMENT&&!I[o.name][r.name]&&n.push({check:"el-up",el:r}));e.remove()}}else"style"==i?e.remove():(e.parent&&n.push({check:"it",el:e.parent}),e.replaceWithChildren())}function E(e,t,n){var i,o;for(i=0;ir;++r){c=O(i[r]),u=c.classes===!0||c.styles===!0||c.attributes===!0,h=c,f=void 0;for(f in v)h[f]=d(h[f]);m=!0;for(f in b)f=b[f],h[f]=CKEDITOR.tools.objectKeys(h[f]),h[f]&&(m=!1);if(h.nothingRequired=m,c.elements===!0||null===c.elements)c.elements=d(c.elements),e[u?"unshift":"push"](c);else{h=c.elements,delete c.elements;for(o in h)s[o]?s[o][u?"unshift":"push"](c):s[o]=[c]}}return t.elements=s,t.generic=e.length?e:null,!0},applyTo:function(e,t,n){var o=[],r=!n&&this._.rules,a=this._.transformations,s=i(this),l=this.editor&&this.editor.config.protectedSource,c=!1;e.forEach(function(e){if(e.type==CKEDITOR.NODE_ELEMENT)t&&"span"==e.name&&~CKEDITOR.tools.objectKeys(e.attributes).join("|").indexOf("data-cke-")||s(e,r,a,o,t)&&(c=!0);else if(e.type==CKEDITOR.NODE_COMMENT&&e.value.match(/^\{cke_protected\}(?!\{C\})/)){var n;e:{var i=decodeURIComponent(e.value.replace(/^\{cke_protected\}/,""));n=[];var u,d,h;if(l)for(d=0;d",l in this._.cachedChecks)return this._.cachedChecks[l];o=a(e).$1,s=o.styles;var u=o.classes;o.name=o.elements,o.classes=u=u?u.split(/\s*,\s*/):[],o.styles=r(s),o.attributes=r(o.attributes),o.children=[],u.length&&(o.attributes["class"]=u.join(" ")),s&&(o.attributes.style=CKEDITOR.tools.writeCssText(o.styles)),s=o}else o=e.getDefinition(),s=o.styles,u=o.attributes||{},s?(s=O(s),u.style=CKEDITOR.tools.writeCssText(s,!0)):s={},s={name:o.element,attributes:u,classes:u["class"]?u["class"].split(/\s+/):[],styles:s,children:[]};var d,u=CKEDITOR.tools.clone(s),h=[];if(t!==!1&&(d=this._.transformations[s.name])){for(o=0;o0?!1:CKEDITOR.tools.objectCompare(s.attributes,u.attributes,!0)?!0:!1,"string"==typeof e&&(this._.cachedChecks[l]=t),t}};var v={styles:1,attributes:1,classes:1},b={styles:"requiredStyles",attributes:"requiredAttributes",classes:"requiredClasses"},K=/^([a-z0-9*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,_={styles:/{([^}]+)}/,attrs:/\[([^\]]+)\]/,classes:/\(([^\)]+)\)/},y=CKEDITOR.filter.transformationsTools={sizeToStyle:function(e){this.lengthToStyle(e,"width"),this.lengthToStyle(e,"height")},sizeToAttribute:function(e){this.lengthToAttribute(e,"width"),this.lengthToAttribute(e,"height")},lengthToStyle:function(e,t,n){if(n=n||t,!(n in e.styles)){var i=e.attributes[t];i&&(/^\d+$/.test(i)&&(i+="px"),e.styles[n]=i)}delete e.attributes[t]},lengthToAttribute:function(e,t,n){if(n=n||t,!(n in e.attributes)){var i=e.styles[t],o=i&&i.match(/^(\d+)(?:\.\d*)?px$/);o?e.attributes[n]=o[1]:i==R&&(e.attributes[n]=R)}delete e.styles[t]},alignmentToStyle:function(e){if(!("float"in e.styles)){var t=e.attributes.align;("left"==t||"right"==t)&&(e.styles["float"]=t)}delete e.attributes.align},alignmentToAttribute:function(e){if(!("align"in e.attributes)){var t=e.styles["float"];("left"==t||"right"==t)&&(e.attributes.align=t)}delete e.styles["float"]},matchesStyle:g,transform:function(e,t){if("string"==typeof t)e.name=t;else{var n,i,o,r,a=t.getDefinition(),s=a.styles,l=a.attributes;e.name=a.element;for(n in l)if("class"==n)for(a=e.classes.join("|"),o=l[n].split(/\s+/);r=o.pop();)-1==a.indexOf(r)&&e.classes.push(r);else e.attributes[n]=l[n];for(i in s)e.styles[i]=s[i]}}}}(),function(){CKEDITOR.focusManager=function(e){return e.focusManager?e.focusManager:(this.hasFocus=!1,this.currentActive=null,this._={editor:e},this)},CKEDITOR.focusManager._={blurDelay:200},CKEDITOR.focusManager.prototype={focus:function(){if(this._.timer&&clearTimeout(this._.timer),!this.hasFocus&&!this._.locked){var e=CKEDITOR.currentInstance;e&&e.focusManager.blur(1),this.hasFocus=!0,(e=this._.editor.container)&&e.addClass("cke_focus"),this._.editor.fire("focus")}},lock:function(){this._.locked=1},unlock:function(){delete this._.locked},blur:function(e){function t(){if(this.hasFocus){this.hasFocus=!1;var e=this._.editor.container;e&&e.removeClass("cke_focus"),this._.editor.fire("blur")}}if(!this._.locked){this._.timer&&clearTimeout(this._.timer);var n=CKEDITOR.focusManager._.blurDelay;e||!n?t.call(this):this._.timer=CKEDITOR.tools.setTimeout(function(){delete this._.timer,t.call(this)},n,this)}},add:function(e,t){var n=e.getCustomData("focusmanager");if(!n||n!=this){n&&n.remove(e);var n="focus",i="blur";t&&(CKEDITOR.env.ie?(n="focusin",i="focusout"):CKEDITOR.event.useCapture=1);var o={blur:function(){e.equals(this.currentActive)&&this.blur()},focus:function(){this.currentActive=e,this.focus()}};e.on(n,o.focus,this),e.on(i,o.blur,this),t&&(CKEDITOR.event.useCapture=0),e.setCustomData("focusmanager",this),e.setCustomData("focusmanager_handlers",o)}},remove:function(e){e.removeCustomData("focusmanager");var t=e.removeCustomData("focusmanager_handlers");e.removeListener("blur",t.blur),e.removeListener("focus",t.focus)}}}(),CKEDITOR.keystrokeHandler=function(e){return e.keystrokeHandler?e.keystrokeHandler:(this.keystrokes={},this.blockedKeystrokes={},this._={editor:e},this)},function(){var e,t=function(t){var t=t.data,n=t.getKeystroke(),i=this.keystrokes[n],o=this._.editor;return e=o.fire("key",{keyCode:n})===!1,e||(i&&(e=o.execCommand(i,{from:"keystrokeHandler"})!==!1),e||(e=!!this.blockedKeystrokes[n])),e&&t.preventDefault(!0),!e},n=function(t){e&&(e=!1,t.data.preventDefault(!0))};CKEDITOR.keystrokeHandler.prototype={attach:function(e){e.on("keydown",t,this),(CKEDITOR.env.opera||CKEDITOR.env.gecko&&CKEDITOR.env.mac)&&e.on("keypress",n,this)}}}(),function(){CKEDITOR.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,"en-au":1,"en-ca":1,"en-gb":1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,"fr-ca":1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,is:1,it:1,ja:1,ka:1,km:1,ko:1,ku:1,lt:1,lv:1,mk:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,"pt-br":1,pt:1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,"sr-latn":1,sr:1,sv:1,th:1,tr:1,ug:1,uk:1,vi:1,"zh-cn":1,zh:1},load:function(e,t,n){e&&CKEDITOR.lang.languages[e]||(e=this.detect(t,e)),this[e]?n(e,this[e]):CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/"+e+".js"),function(){n(e,this[e])},this)},detect:function(e,t){var n=this.languages,t=t||navigator.userLanguage||navigator.language||e,i=t.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),o=i[1],i=i[2];return n[o+"-"+i]?o=o+"-"+i:n[o]||(o=null),CKEDITOR.lang.detect=o?function(){return o}:function(e){return e},o||e}}}(),CKEDITOR.scriptLoader=function(){var e={},t={};return{load:function(n,i,o,r){var a="string"==typeof n;a&&(n=[n]),o||(o=CKEDITOR);var s=n.length,l=[],c=[],u=function(e){i&&(a?i.call(o,e):i.call(o,l,c))};if(0===s)u(!0);else{var d=function(e,t){(t?l:c).push(e),--s<=0&&(r&&CKEDITOR.document.getDocumentElement().removeStyle("cursor"),u(t))},h=function(n,i){e[n]=1;var o=t[n];delete t[n];for(var r=0;r1)){var r=new CKEDITOR.dom.element("script");r.setAttributes({type:"text/javascript",src:n}),i&&(CKEDITOR.env.ie?r.$.onreadystatechange=function(){("loaded"==r.$.readyState||"complete"==r.$.readyState)&&(r.$.onreadystatechange=null,h(n,!0))}:(r.$.onload=function(){setTimeout(function(){h(n,!0)},0)},r.$.onerror=function(){h(n,!1)})),r.appendTo(CKEDITOR.document.getHead())}}};r&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var m=0;s>m;m++)f(n[m])}},queue:function(){function e(){var e;(e=t[0])&&this.load(e.scriptUrl,e.callback,CKEDITOR,0)}var t=[];return function(n,i){var o=this;t.push({scriptUrl:n,callback:function(){i&&i.apply(this,arguments),t.shift(),e.call(o)}}),1==t.length&&e.call(this)}}()}}(),CKEDITOR.resourceManager=function(e,t){this.basePath=e,this.fileName=t,this.registered={},this.loaded={},this.externals={},this._={waitingList:{}}},CKEDITOR.resourceManager.prototype={add:function(e,t){if(this.registered[e])throw'[CKEDITOR.resourceManager.add] The resource name "'+e+'" is already registered.';var n=this.registered[e]=t||{};return n.name=e,n.path=this.getPath(e),CKEDITOR.fire(e+CKEDITOR.tools.capitalize(this.fileName)+"Ready",n),this.get(e)},get:function(e){return this.registered[e]||null},getPath:function(e){var t=this.externals[e];return CKEDITOR.getUrl(t&&t.dir||this.basePath+e+"/")},getFilePath:function(e){var t=this.externals[e];return CKEDITOR.getUrl(this.getPath(e)+(t&&"string"==typeof t.file?t.file:this.fileName+".js"))},addExternal:function(e,t,n){for(var e=e.split(","),i=0;i=0?d=e.langCode:(d=e.langCode.replace(/-.*/,""),d=d!=e.langCode&&CKEDITOR.tools.indexOf(u,d)>=0?d:CKEDITOR.tools.indexOf(u,"en")>=0?"en":u[0]),c.langEntries&&c.langEntries[d]?(e.lang[s]=c.langEntries[d],d=null):r.push(CKEDITOR.getUrl(c.path+"lang/"+d+".js"))),o.push(d),i.push(c)}CKEDITOR.scriptLoader.load(r,function(){for(var n=["beforeInit","init","afterInit"],r=0;r]+)>)|(?:!--([\\S|\\s]*?)-->)|(?:([^\\s>]+)\\s*((?:(?:\"[^\"]*\")|(?:'[^']*')|[^\"'>])*)\\/?>))","g")}},function(){var e=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,t={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};CKEDITOR.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(n){for(var i,o,r,a=0;i=this._.htmlPartsRegex.exec(n);)if(o=i.index,o>a&&(a=n.substring(a,o),r?r.push(a):this.onText(a)),a=this._.htmlPartsRegex.lastIndex,!(o=i[1])||(o=o.toLowerCase(),r&&CKEDITOR.dtd.$cdata[o]&&(this.onCDATA(r.join("")),r=null),r))if(r)r.push(i[0]);else if(o=i[3]){if(o=o.toLowerCase(),!/="/.test(o)){var s,l={};i=i[4];var c=!(!i||"/"!=i.charAt(i.length-1));if(i)for(;s=e.exec(i);){var u=s[1].toLowerCase();s=s[2]||s[3]||s[4]||"",l[u]=!s&&t[u]?u:s}this.onTagOpen(o,l,c),!r&&CKEDITOR.dtd.$cdata[o]&&(r=[])}}else(o=i[2])&&this.onComment(o);else this.onTagClose(o);n.length>a&&this.onText(n.substring(a,n.length))}}}(),CKEDITOR.htmlParser.basicWriter=CKEDITOR.tools.createClass({$:function(){this._={output:[]}},proto:{openTag:function(e){this._.output.push("<",e)},openTagClose:function(e,t){this._.output.push(t?" />":">")},attribute:function(e,t){"string"==typeof t&&(t=CKEDITOR.tools.htmlEncodeAttr(t)),this._.output.push(" ",e,'="',t,'"')},closeTag:function(e){this._.output.push("")},text:function(e){this._.output.push(e)},comment:function(e){this._.output.push("")},write:function(e){this._.output.push(e)},reset:function(){this._.output=[],this._.indent=!1},getHtml:function(e){var t=this._.output.join("");return e&&this.reset(),t}}}),function(){CKEDITOR.htmlParser.node=function(){},CKEDITOR.htmlParser.node.prototype={remove:function(){var e=this.parent.children,t=CKEDITOR.tools.indexOf(e,this),n=this.previous,i=this.next;n&&(n.next=i),i&&(i.previous=n),e.splice(t,1),this.parent=null},replaceWith:function(e){var t=this.parent.children,n=CKEDITOR.tools.indexOf(t,this),i=e.previous=this.previous,o=e.next=this.next;i&&(i.next=e),o&&(o.previous=e),t[n]=e,e.parent=this.parent,this.parent=null},insertAfter:function(e){var t=e.parent.children,n=CKEDITOR.tools.indexOf(t,e),i=e.next;t.splice(n+1,0,this),this.next=e.next,this.previous=e,e.next=this,i&&(i.previous=this),this.parent=e.parent},insertBefore:function(e){var t=e.parent.children,n=CKEDITOR.tools.indexOf(t,e);t.splice(n,0,this),this.next=e,(this.previous=e.previous)&&(e.previous.next=this),e.previous=this,this.parent=e.parent}}}(),CKEDITOR.htmlParser.comment=function(e){this.value=e,this._={isBlockLike:!1}},CKEDITOR.htmlParser.comment.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_COMMENT,filter:function(e){var t=this.value;return(t=e.onComment(t,this))?"string"!=typeof t?(this.replaceWith(t),!1):(this.value=t,!0):(this.remove(),!1)},writeHtml:function(e,t){t&&this.filter(t),e.comment(this.value)}}),function(){CKEDITOR.htmlParser.text=function(e){this.value=e,this._={isBlockLike:!1}},CKEDITOR.htmlParser.text.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(e){return(this.value=e.onText(this.value,this))?void 0:(this.remove(),!1)},writeHtml:function(e,t){t&&this.filter(t),e.text(this.value)}})}(),function(){CKEDITOR.htmlParser.cdata=function(e){this.value=e},CKEDITOR.htmlParser.cdata.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(){},writeHtml:function(e){e.write(this.value)}})}(),CKEDITOR.htmlParser.fragment=function(){this.children=[],this.parent=null,this._={isBlockLike:!0,hasInlineStarted:!1}},function(){function e(e){return"a"==e.name&&e.attributes.href||CKEDITOR.dtd.$removeEmpty[e.name]}var t=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),n={ol:1,ul:1},i=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1});CKEDITOR.htmlParser.fragment.fromHtml=function(o,r,a){function s(e){var t;if(E.length>0)for(var n=0;n=0;t--)if(e==E[t].name)return void E.splice(t,1);for(var n=[],i=[],o=T;o!=m&&o.name!=e;)o._.isBlockLike||i.unshift(o),n.push(o),o=o.returnPoint||o.parent;if(o!=m){for(t=0;t0?this.children[t-1]:null;if(n){if(e._.isBlockLike&&n.type==CKEDITOR.NODE_TEXT&&(n.value=CKEDITOR.tools.rtrim(n.value),0===n.value.length))return this.children.pop(),void this.add(e);n.next=e}e.previous=n,e.parent=this,this.children.splice(t,0,e),this._.hasInlineStarted||(this._.hasInlineStarted=e.type==CKEDITOR.NODE_TEXT||e.type==CKEDITOR.NODE_ELEMENT&&!e._.isBlockLike)},filter:function(e){e.onRoot(this),this.filterChildren(e)},filterChildren:function(e,t){if(this.childrenFilteredBy!=e.id){t&&!this.parent&&e.onRoot(this),this.childrenFilteredBy=e.id;for(var n=0;nt;t++)n[t].writeHtml(e)},forEach:function(e,t,n){!n&&(!t||this.type==t)&&e(this);for(var i,n=this.children,o=0,r=n.length;r>o;o++)i=n[o],i.type==CKEDITOR.NODE_ELEMENT?i.forEach(e,t):(!t||i.type==t)&&e(i)}}}(),function(){function e(e,t){for(var n=0;e&&ni&&e[i].pri<=n;i++);for(o=r-1;o>=0;o--)(r=t[o])&&(r.pri=n,e.splice(i,0,r))}}function n(e,t,n){if(t)for(var o in t){var r=e[o];e[o]=i(r,t[o],n),r||e.$length++}}function i(e,n,i){return n?(n.pri=i,e?(e.splice?t(e,n,i):(e=e.pri>i?[n,e]:[e,n],e.filter=o),e):n.filter=n):void 0}function o(e){for(var t=e.type||e instanceof CKEDITOR.htmlParser.fragment,n=0;ni;i++)if(t=n[i]){if(t=t.filter(e,this),t===!1)return null;if(t&&t!=e)return this.onNode(t);if(e.parent&&!e.name)break}return e},onNode:function(e){var t=e.type;return t==CKEDITOR.NODE_ELEMENT?this.onElement(e):t==CKEDITOR.NODE_TEXT?new CKEDITOR.htmlParser.text(this.onText(e.value)):t==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(e.value)):null},onAttribute:function(e,t,n){if(t=this._.attributes[t]){if(e=t.filter(n,e,this),e===!1)return!1;if("undefined"!=typeof e)return e}return n}}})}(),function(){function e(e,t){function c(e){return e||CKEDITOR.env.ie?new CKEDITOR.htmlParser.text(" "):new CKEDITOR.htmlParser.element("br",{"data-cke-bogus":1})}function u(e,t){return function(o){if(o.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var a,s,u=[],h=n(o);if(h)for(d(h,1)&&u.push(h);h;){if(r(h)&&(a=i(h))&&d(a))if((s=i(a))&&!r(s))u.push(a);else{var f=a,E=c(m),g=f.parent.children,T=CKEDITOR.tools.indexOf(g,f);g.splice(T+1,0,E),g=f.next,f.next=E,E.previous=f,E.parent=f.parent,E.next=g,l(a)}h=h.previous}for(h=0;h7||o.name in CKEDITOR.dtd.tr||o.name in CKEDITOR.dtd.$listItem)?u=!1:(u=n(o),u=!u||"form"==o.name&&"input"==u.name)),u&&o.add(c(e))}}}function d(e,t){if(!(m&&CKEDITOR.env.ie||e.type!=CKEDITOR.NODE_ELEMENT||"br"!=e.name||e.attributes["data-cke-eol"]))return!0;var n;if(e.type==CKEDITOR.NODE_TEXT&&(n=e.value.match(C))){if(n.index&&(a(e,new CKEDITOR.htmlParser.text(e.value.substring(0,n.index))),e.value=n[0]),CKEDITOR.env.ie&&m&&(!t||e.parent.name in E))return!0;if(!m&&((n=e.previous)&&"br"==n.name||!n||r(n)))return!0}return!1}var h,f={elements:{}},m="html"==t,E=CKEDITOR.tools.extend({},R);for(h in E)"#"in O[h]||delete E[h];for(h in E)f.elements[h]=u(m,e.config.fillEmptyBlocks!==!1);return f.root=u(m),f.elements.br=function(e){return function(t){if(t.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var n=t.attributes;if("data-cke-bogus"in n||"data-cke-eol"in n)delete n["data-cke-bogus"];else{for(n=t.next;n&&o(n);)n=n.next;var l=i(t);!n&&r(t.parent)?s(t.parent,c(e)):r(n)&&l&&!r(l)&&a(n,c(e))}}}}(m),f}function t(e){return e.enterMode!=CKEDITOR.ENTER_BR&&e.autoParagraph!==!1?e.enterMode==CKEDITOR.ENTER_DIV?"div":"p":!1}function n(e){for(e=e.children[e.children.length-1];e&&o(e);)e=e.previous;return e}function i(e){for(e=e.previous;e&&o(e);)e=e.previous;return e}function o(e){return e.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(e.value)||e.type==CKEDITOR.NODE_ELEMENT&&e.attributes["data-cke-bookmark"]}function r(e){return e&&(e.type==CKEDITOR.NODE_ELEMENT&&e.name in R||e.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)}function a(e,t){var n=e.parent.children,i=CKEDITOR.tools.indexOf(n,e);n.splice(i,0,t),n=e.previous,e.previous=t,t.next=e,t.parent=e.parent,n&&(t.previous=n,n.next=t)}function s(e,t){var n=e.children[e.children.length-1];e.children.push(t),t.parent=e,n&&(n.next=t,t.previous=n)}function l(e){var t=e.parent.children,n=CKEDITOR.tools.indexOf(t,e),i=e.previous,e=e.next;i&&(i.next=e),e&&(e.previous=i),t.splice(n,1)}function c(e){var t=e.parent;return t?CKEDITOR.tools.indexOf(t.children,e):-1}function u(e){e=e.attributes,"false"!=e.contenteditable&&(e["data-cke-editable"]=e.contenteditable?"true":1),e.contenteditable="false"}function d(e){switch(e=e.attributes,e["data-cke-editable"]){case"true":e.contenteditable="true";break;case"1":delete e.contenteditable}}function h(e){return e.replace(_,function(e,t,n){return"<"+t+n.replace(y,function(e,t){return/^on/.test(t)||-1!=n.indexOf("data-cke-saved-"+t)?e:(e=e.slice(1)," data-cke-saved-"+e+" data-cke-"+CKEDITOR.rnd+"-"+e)})+">"})}function f(e,t){return e.replace(t,function(e,t,n){return 0===e.indexOf("/g,">")+""),""+encodeURIComponent(e)+""})}function m(e){return e.replace(w,function(e,t){return decodeURIComponent(t)})}function E(e){return e.replace(/<\!--(?!{cke_protected})[\s\S]+?--\>/g,function(e){return""})}function g(e){return e.replace(/<\!--\{cke_protected\}\{C\}([\s\S]+?)--\>/g,function(e,t){return decodeURIComponent(t)})}function T(e,t){var n=t._.dataStore;return e.replace(/<\!--\{cke_protected\}([\s\S]+?)--\>/g,function(e,t){return decodeURIComponent(t)}).replace(/\{cke_protected_(\d+)\}/g,function(e,t){return n&&n[t]||""})}function p(e,t){for(var n=[],i=t.config.protectedSource,o=t._.dataStore||(t._.dataStore={id:1}),r=/<\!--\{cke_temp(comment)?\}(\d*?)--\>/g,i=[//gi,//gi].concat(i),e=e.replace(/<\!--[\s\S]*?--\>/g,function(e){return""}),a=0;a"});return e=e.replace(r,function(e,t,i){return""}),e.replace(/(['"]).*?\1/g,function(e){return e.replace(/<\!--\{cke_protected\}([\s\S]+?)--\>/g,function(e,t){return o[o.id]=decodeURIComponent(t),"{cke_protected_"+o.id++ +"}"})})}CKEDITOR.htmlDataProcessor=function(n){var i,o,r=this;this.editor=n,this.dataFilter=i=new CKEDITOR.htmlParser.filter,this.htmlFilter=o=new CKEDITOR.htmlParser.filter,this.writer=new CKEDITOR.htmlParser.basicWriter,i.addRules(v),i.addRules(e(n,"data")),o.addRules(b),o.addRules(e(n,"html")),n.on("toHtml",function(e){var i,e=e.data,o=e.dataValue,o=p(o,n),o=f(o,N),o=h(o),o=f(o,k),o=o.replace(S,"$1cke:$2"),o=o.replace(A,""),o=CKEDITOR.env.opera?o:o.replace(/(]*>)(\r\n|\n)/g,"$1$2$2"),r=e.context||n.editable().getName();CKEDITOR.env.ie&&CKEDITOR.env.version<9&&"pre"==r&&(r="div",o="
"+o+"
",i=1),r=n.document.createElement(r),r.setHtml("a"+o),o=r.getHtml().substr(1),o=o.replace(RegExp(" data-cke-"+CKEDITOR.rnd+"-","ig")," "),i&&(o=o.replace(/^
|<\/pre>$/gi,"")),o=o.replace(x,"$1$2"),o=m(o),o=g(o),e.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(o,e.context,e.fixForBody===!1?!1:t(n.config))},null,null,5),n.on("toHtml",function(e){e.data.dataValue.filterChildren(r.dataFilter,!0)},null,null,10),n.on("toHtml",function(e){var e=e.data,t=e.dataValue,n=new CKEDITOR.htmlParser.basicWriter;t.writeChildrenHtml(n),t=n.getHtml(!0),e.dataValue=E(t)},null,null,15),n.on("toDataFormat",function(e){e.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(e.data.dataValue,n.editable().getName(),t(n.config))},null,null,5),n.on("toDataFormat",function(e){e.data.dataValue.filterChildren(r.htmlFilter,!0)},null,null,10),n.on("toDataFormat",function(e){var t=e.data.dataValue,i=r.writer;i.reset(),t.writeChildrenHtml(i),t=i.getHtml(!0),t=g(t),t=T(t,n),e.data.dataValue=t},null,null,15)},CKEDITOR.htmlDataProcessor.prototype={toHtml:function(e,t,n,i){var o=this.editor;return!t&&null!==t&&(t=o.editable().getName()),o.fire("toHtml",{dataValue:e,context:t,fixForBody:n,dontFilter:!!i}).dataValue},toDataFormat:function(e){return this.editor.fire("toDataFormat",{dataValue:e}).dataValue}};var C=/(?: |\xa0)$/,I="{cke_protected}",O=CKEDITOR.dtd,D=["caption","colgroup","col","thead","tfoot","tbody"],R=CKEDITOR.tools.extend({},O.$blockLimit,O.$block),v={elements:{},attributeNames:[[/^on/,"data-cke-pa-on"]]},b={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(e){var t=e.attributes;if(t){if(t["data-cke-temp"])return!1;for(var n,i=["name","href","src"],o=0;o-1&&i>-1&&n!=i||(n=c(e),i=c(t)),n>i?1:-1})},embed:function(e){var t=e.parent;if(t&&"object"==t.name){var n=t.attributes.width,t=t.attributes.height;n&&(e.attributes.width=n),t&&(e.attributes.height=t)}},param:function(e){return e.children=[],e.isEmpty=!0,e},a:function(e){return e.children.length||e.attributes.name||e.attributes["data-cke-saved-name"]?void 0:!1},span:function(e){"Apple-style-span"==e.attributes["class"]&&delete e.name},html:function(e){delete e.attributes.contenteditable,delete e.attributes["class"]},body:function(e){delete e.attributes.spellcheck,delete e.attributes.contenteditable},style:function(e){var t=e.children[0];t&&t.value&&(t.value=CKEDITOR.tools.trim(t.value)),e.attributes.type||(e.attributes.type="text/css")},title:function(e){var t=e.children[0];!t&&s(e,t=new CKEDITOR.htmlParser.text),t.value=e.attributes["data-cke-title"]||""}},attributes:{"class":function(e){return CKEDITOR.tools.ltrim(e.replace(/(?:^|\s+)cke_[^\s]*/g,""))||!1}}};CKEDITOR.env.ie&&(b.attributes.style=function(e){return e.replace(/(^|;)([^\:]+)/g,function(e){return e.toLowerCase()})});for(var K in{input:1,textarea:1})v.elements[K]=u,b.elements[K]=d;var _=/<(a|area|img|input|source)\b([^>]*)>/gi,y=/\s(on\w+|href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,k=/(?:])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,N=/(])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,w=/([^<]*)<\/cke:encoded>/gi,S=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,x=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,A=/]*?)\/?>(?!\s*<\/cke:\1)/gi}(),CKEDITOR.htmlParser.element=function(e,t){this.name=e,this.attributes=t||{},this.children=[];var n=e||"",i=n.match(/^cke:(.*)/);i&&(n=i[1]),n=!!(CKEDITOR.dtd.$nonBodyContent[n]||CKEDITOR.dtd.$block[n]||CKEDITOR.dtd.$listItem[n]||CKEDITOR.dtd.$tableContent[n]||CKEDITOR.dtd.$nonEditable[n]||"br"==n),this.isEmpty=!!CKEDITOR.dtd.$empty[e],this.isUnknown=!CKEDITOR.dtd[e],this._={isBlockLike:n,hasInlineStarted:this.isEmpty||!n}},CKEDITOR.htmlParser.cssStyle=function(e){var t={};return((e instanceof CKEDITOR.htmlParser.element?e.attributes.style:e)||"").replace(/"/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(e,n,i){"font-family"==n&&(i=i.replace(/["']/g,"")),t[n.toLowerCase()]=i}),{rules:t,populate:function(e){var t=this.toString();t&&(e instanceof CKEDITOR.dom.element?e.setAttribute("style",t):e instanceof CKEDITOR.htmlParser.element?e.attributes.style=t:e.style=t)},toString:function(){var e,n=[];for(e in t)t[e]&&n.push(e,":",t[e],";");return n.join("")}}},function(){var e=function(e,t){return e=e[0],t=t[0],t>e?-1:e>t?1:0},t=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:t.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)
},filter:function(e){var t,n,i=this;for(i.parent||e.onRoot(i);;){if(t=i.name,!(n=e.onElementName(t)))return this.remove(),!1;if(i.name=n,!(i=e.onElement(i)))return this.remove(),!1;if(i!==this)return this.replaceWith(i),!1;if(i.name==t)break;if(i.type!=CKEDITOR.NODE_ELEMENT)return this.replaceWith(i),!1;if(!i.name)return this.replaceWithChildren(),!1}t=i.attributes;var o,r;for(o in t){for(r=o,n=t[o];;){if(!(r=e.onAttributeName(o))){delete t[o];break}if(r==o)break;delete t[o],o=r}r&&((n=e.onAttribute(i,r,n))===!1?delete t[r]:t[r]=n)}return i.isEmpty||this.filterChildren(e),!0},filterChildren:t.filterChildren,writeHtml:function(t,n){n&&this.filter(n);var i,o,r=this.name,a=[],s=this.attributes;t.openTag(r,s);for(i in s)a.push([i,s[i]]);for(t.sortAttributes&&a.sort(e),i=0,o=a.length;o>i;i++)s=a[i],t.attribute(s[0],s[1]);t.openTagClose(r,this.isEmpty),this.writeChildrenHtml(t),this.isEmpty||t.closeTag(r)},writeChildrenHtml:t.writeChildrenHtml,replaceWithChildren:function(){for(var e=this.children,t=e.length;t;)e[--t].insertAfter(this);this.remove()},forEach:t.forEach})}(),function(){var e={};CKEDITOR.template=function(t){if(e[t])this.output=e[t];else{var n=t.replace(/'/g,"\\'").replace(/{([^}]+)}/g,function(e,t){return"',data['"+t+"']==undefined?'{"+t+"}':data['"+t+"'],'"});this.output=e[t]=Function("data","buffer","return buffer?buffer.push('"+n+"'):['"+n+"'].join('');")}}}(),delete CKEDITOR.loadFullCore,CKEDITOR.instances={},CKEDITOR.document=new CKEDITOR.dom.document(document),CKEDITOR.add=function(e){CKEDITOR.instances[e.name]=e,e.on("focus",function(){CKEDITOR.currentInstance!=e&&(CKEDITOR.currentInstance=e,CKEDITOR.fire("currentInstance"))}),e.on("blur",function(){CKEDITOR.currentInstance==e&&(CKEDITOR.currentInstance=null,CKEDITOR.fire("currentInstance"))}),CKEDITOR.fire("instance",null,e)},CKEDITOR.remove=function(e){delete CKEDITOR.instances[e.name]},function(){var e={};CKEDITOR.addTemplate=function(t,n){var i=e[t];return i?i:(i={name:t,source:n},CKEDITOR.fire("template",i),e[t]=new CKEDITOR.template(i.source))},CKEDITOR.getTemplate=function(t){return e[t]}}(),function(){var e=[];CKEDITOR.addCss=function(t){e.push(t)},CKEDITOR.getCss=function(){return e.join("\n")}}(),CKEDITOR.on("instanceDestroyed",function(){CKEDITOR.tools.isEmpty(this.instances)&&CKEDITOR.fire("reset")}),CKEDITOR.TRISTATE_ON=1,CKEDITOR.TRISTATE_OFF=2,CKEDITOR.TRISTATE_DISABLED=0,function(){CKEDITOR.inline=function(e,t){if(!CKEDITOR.env.isCompatible)return null;if(e=CKEDITOR.dom.element.get(e),e.getEditor())throw'The editor instance "'+e.getEditor().name+'" is already attached to the provided element.';var n=new CKEDITOR.editor(t,e,CKEDITOR.ELEMENT_MODE_INLINE),i=e.is("textarea")?e:null;return i?(n.setData(i.getValue(),null,!0),e=CKEDITOR.dom.element.createFromHtml('
'+i.getValue()+"
",CKEDITOR.document),e.insertAfter(i),i.hide(),i.$.form&&n._attachToForm()):n.setData(e.getHtml(),null,!0),n.on("loaded",function(){n.fire("uiReady"),n.editable(e),n.container=e,n.setData(n.getData(1)),n.resetDirty(),n.fire("contentDom"),n.mode="wysiwyg",n.fire("mode"),n.status="ready",n.fireOnce("instanceReady"),CKEDITOR.fire("instanceReady",null,n)},null,null,1e4),n.on("destroy",function(){i&&(n.container.clearCustomData(),n.container.remove(),i.show()),n.element.clearCustomData(),delete n.element}),n},CKEDITOR.inlineAll=function(){var e,t,n;for(n in CKEDITOR.dtd.$editable)for(var i=CKEDITOR.document.getElementsByTag(n),o=0,r=i.count();r>o;o++)e=i.getItem(o),"true"==e.getAttribute("contenteditable")&&(t={element:e,config:{}},CKEDITOR.fire("inline",t)!==!1&&CKEDITOR.inline(e,t.config))},CKEDITOR.domReady(function(){!CKEDITOR.disableAutoInline&&CKEDITOR.inlineAll()})}(),CKEDITOR.replaceClass="ckeditor",function(){function e(e,i,o,r){if(!CKEDITOR.env.isCompatible)return null;if(e=CKEDITOR.dom.element.get(e),e.getEditor())throw'The editor instance "'+e.getEditor().name+'" is already attached to the provided element.';var a=new CKEDITOR.editor(i,e,r);return r==CKEDITOR.ELEMENT_MODE_REPLACE&&(e.setStyle("visibility","hidden"),a._.required=e.hasAttribute("required"),e.removeAttribute("required")),o&&a.setData(o,null,!0),a.on("loaded",function(){n(a),r==CKEDITOR.ELEMENT_MODE_REPLACE&&a.config.autoUpdateElement&&e.$.form&&a._attachToForm(),a.setMode(a.config.startupMode,function(){a.resetDirty(),a.status="ready",a.fireOnce("instanceReady"),CKEDITOR.fire("instanceReady",null,a)})}),a.on("destroy",t),a}function t(){var e=this.container,t=this.element;e&&(e.clearCustomData(),e.remove()),t&&(t.clearCustomData(),this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&(t.show(),this._.required&&t.setAttribute("required","required")),delete this.element)}function n(e){var t=e.name,n=e.element,o=e.elementMode,r=e.fire("uiSpace",{space:"top",html:""}).html,a=e.fire("uiSpace",{space:"bottom",html:""}).html;i||(i=CKEDITOR.addTemplate("maincontainer",'<{outerEl} id="cke_{name}" class="{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} '+CKEDITOR.env.cssClass+'" dir="{langDir}" lang="{langCode}" role="application" aria-labelledby="cke_{name}_arialbl">{voiceLabel}<{outerEl} class="cke_inner cke_reset" role="presentation">{topHtml}<{outerEl} id="{contentId}" class="cke_contents cke_reset" role="presentation">{bottomHtml}')),t=CKEDITOR.dom.element.createFromHtml(i.output({id:e.id,name:t,langDir:e.lang.dir,langCode:e.langCode,voiceLabel:[e.lang.editor,e.name].join(", "),topHtml:r?''+r+"":"",contentId:e.ui.spaceId("contents"),bottomHtml:a?''+a+"":"",outerEl:CKEDITOR.env.ie?"span":"div"})),o==CKEDITOR.ELEMENT_MODE_REPLACE?(n.hide(),t.insertAfter(n)):n.append(t),e.container=t,r&&e.ui.space("top").unselectable(),a&&e.ui.space("bottom").unselectable(),n=e.config.width,o=e.config.height,n&&t.setStyle("width",CKEDITOR.tools.cssLength(n)),o&&e.ui.space("contents").setStyle("height",CKEDITOR.tools.cssLength(o)),t.disableContextMenu(),CKEDITOR.env.webkit&&t.on("focus",function(){e.focus()}),e.fireOnce("uiReady")}CKEDITOR.replace=function(t,n){return e(t,n,null,CKEDITOR.ELEMENT_MODE_REPLACE)},CKEDITOR.appendTo=function(t,n,i){return e(t,n,i,CKEDITOR.ELEMENT_MODE_APPENDTO)},CKEDITOR.replaceAll=function(){for(var e=document.getElementsByTagName("textarea"),t=0;t",s="",e=a+e.replace(o,function(){return s+a})+s}e=e.replace(/\n/g,"
"),t||(e=e.replace(RegExp("
(?=)"),function(e){return i.repeat(e,2)})),e=e.replace(/^ | $/g," "),e=e.replace(/(>|\s) /g,function(e,t){return t+" "}).replace(/ (?=<)/g," "),u(this,"text",e)},insertElement:function(e){r(this);for(var t,i,o,s=this.editor,l=s.config.enterMode,c=s.getSelection(),u=c.getRanges(),d=e.getName(),h=CKEDITOR.dtd.$block[d],f=u.length-1;f>=0;f--)if(t=u[f],!t.checkReadOnly()){t.deleteContents(1),i=!f&&e||e.clone(1);var m,E;if(h)for(;(m=t.getCommonAncestor(0,1))&&(E=CKEDITOR.dtd[m.getName()])&&(!E||!E[d]);)m.getName()in CKEDITOR.dtd.span?t.splitElement(m):t.checkStartOfBlock()&&t.checkEndOfBlock()?(t.setStartBefore(m),t.collapse(!0),m.remove()):t.splitBlock(l==CKEDITOR.ENTER_DIV?"div":"p",s.editable());t.insertNode(i),o||(o=i)}o&&(t.moveToPosition(o,CKEDITOR.POSITION_AFTER_END),h&&((e=o.getNext(n))&&e.type==CKEDITOR.NODE_ELEMENT&&e.is(CKEDITOR.dtd.$block)?e.getDtd()["#"]?t.moveToElementEditStart(e):t.moveToElementEditEnd(o):e||l==CKEDITOR.ENTER_BR||(e=t.fixBlock(!0,l==CKEDITOR.ENTER_DIV?"div":"p"),t.moveToElementEditStart(e)))),c.selectRanges([t]),a(this,CKEDITOR.env.opera)},setData:function(e,t){!t&&this.editor.dataProcessor&&(e=this.editor.dataProcessor.toHtml(e)),this.setHtml(e),this.editor.fire("dataReady")},getData:function(e){var t=this.getHtml();return!e&&this.editor.dataProcessor&&(t=this.editor.dataProcessor.toDataFormat(t)),t},setReadOnly:function(e){this.setAttribute("contenteditable",!e)},detach:function(){this.removeClass("cke_editable");var e=this.editor;this._.detach(),delete e.document,delete e.window},isInline:function(){return this.getDocument().equals(CKEDITOR.document)},setup:function(){var e=this.editor;if(this.attachListener(e,"beforeGetData",function(){var t=this.getData();this.is("textarea")||e.config.ignoreEmptyParagraph!==!1&&(t=t.replace(s,function(e,t){return t})),e.setData(t,null,1)},this),this.attachListener(e,"getSnapshot",function(e){e.data=this.getData(1)},this),this.attachListener(e,"afterSetData",function(){this.setData(e.getData(1))},this),this.attachListener(e,"loadSnapshot",function(e){this.setData(e.data,1)},this),this.attachListener(e,"beforeFocus",function(){var t=e.getSelection();(t=t&&t.getNative())&&"Control"==t.type||this.focus()},this),this.attachListener(e,"insertHtml",function(e){this.insertHtml(e.data.dataValue,e.data.mode)},this),this.attachListener(e,"insertElement",function(e){this.insertElement(e.data)},this),this.attachListener(e,"insertText",function(e){this.insertText(e.data)},this),this.setReadOnly(e.readOnly),this.attachClass("cke_editable"),this.attachClass(e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"cke_editable_inline":e.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE||e.elementMode==CKEDITOR.ELEMENT_MODE_APPENDTO?"cke_editable_themed":""),this.attachClass("cke_contents_"+e.config.contentsLangDirection),e.keystrokeHandler.blockedKeystrokes[8]=+e.readOnly,e.keystrokeHandler.attach(this),this.on("blur",function(e){CKEDITOR.env.opera&&CKEDITOR.document.getActive().equals(this.isInline()?this:this.getWindow().getFrame())?e.cancel():this.hasFocus=!1},null,null,-1),this.on("focus",function(){this.hasFocus=!0},null,null,-1),e.focusManager.add(this),this.equals(CKEDITOR.document.getActive())&&(this.hasFocus=!0,e.once("contentDom",function(){e.focusManager.focus()})),this.isInline()&&this.changeAttr("tabindex",e.tabIndex),!this.is("textarea")){e.document=this.getDocument(),e.window=this.getWindow();var n=e.document;this.changeAttr("spellcheck",!e.config.disableNativeSpellChecker);var i=e.config.contentsLangDirection;this.getDirection(1)!=i&&this.changeAttr("dir",i);var r=CKEDITOR.getCss();r&&(i=n.getHead(),i.getCustomData("stylesheet")||(r=n.appendStyleText(r),r=new CKEDITOR.dom.element(r.ownerNode||r.owningElement),i.setCustomData("stylesheet",r),r.data("cke-temp",1))),i=n.getCustomData("stylesheet_ref")||0,n.setCustomData("stylesheet_ref",i+1),this.setCustomData("cke_includeReadonly",!e.config.disableReadonlyStyling),this.attachListener(this,"click",function(e){var e=e.data,t=e.getTarget();t.is("a")&&2!=e.$.button&&t.isReadOnly()&&e.preventDefault()}),this.attachListener(e,"key",function(t){if(e.readOnly)return!0;var n,i=t.data.keyCode;if(i in{8:1,46:1}){var r,a,s,c=e.getSelection(),t=c.getRanges()[0],u=t.startPath(),i=8==i;(c=o(c))?(e.fire("saveSnapshot"),t.moveToPosition(c,CKEDITOR.POSITION_BEFORE_START),c.remove(),t.select(),e.fire("saveSnapshot"),n=1):t.collapsed&&((r=u.block)&&t[i?"checkStartOfBlock":"checkEndOfBlock"]()&&(s=r[i?"getPrevious":"getNext"](l))&&s.is("table")?(e.fire("saveSnapshot"),t[i?"checkEndOfBlock":"checkStartOfBlock"]()&&r.remove(),t["moveToElementEdit"+(i?"End":"Start")](s),t.select(),e.fire("saveSnapshot"),n=1):u.blockLimit&&u.blockLimit.is("td")&&(a=u.blockLimit.getAscendant("table"))&&t.checkBoundaryOfElement(a,i?CKEDITOR.START:CKEDITOR.END)&&(s=a[i?"getPrevious":"getNext"](l))?(e.fire("saveSnapshot"),t["moveToElementEdit"+(i?"End":"Start")](s),t.checkStartOfBlock()&&t.checkEndOfBlock()?s.remove():t.select(),e.fire("saveSnapshot"),n=1):(a=u.contains(["td","th","caption"]))&&t.checkBoundaryOfElement(a,i?CKEDITOR.START:CKEDITOR.END)&&(n=1))}return!n}),CKEDITOR.env.ie&&this.attachListener(this,"click",t),!CKEDITOR.env.ie&&!CKEDITOR.env.opera&&this.attachListener(this,"mousedown",function(t){var n=t.data.getTarget();n.is("img","hr","input","textarea","select")&&(e.getSelection().selectElement(n),n.is("input","textarea","select")&&t.data.preventDefault())}),CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(t){if(2==t.data.$.button&&(t=t.data.getTarget(),!t.getOuterHtml().replace(s,""))){var n=e.createRange();n.moveToElementEditStart(t),n.select(!0)}}),CKEDITOR.env.webkit&&(this.attachListener(this,"click",function(e){e.data.getTarget().is("input","select")&&e.data.preventDefault()}),this.attachListener(this,"mouseup",function(e){e.data.getTarget().is("input","textarea")&&e.data.preventDefault()}))}}},_:{detach:function(){this.editor.setData(this.editor.getData(),0,1),this.clearListeners(),this.restoreAttrs();var e;if(e=this.removeCustomData("classes"))for(;e.length;)this.removeClass(e.pop());e=this.getDocument();var t=e.getHead();if(t.getCustomData("stylesheet")){var n=e.getCustomData("stylesheet_ref");--n?e.setCustomData("stylesheet_ref",n):(e.removeCustomData("stylesheet_ref"),t.removeCustomData("stylesheet").remove())}delete this.editor}}}),CKEDITOR.editor.prototype.editable=function(e){var t=this._.editable;return t&&e?0:(arguments.length&&(t=this._.editable=e?e instanceof CKEDITOR.editable?e:new CKEDITOR.editable(this,e):(t&&t.detach(),null)),t)};var s=/(^|]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,l=CKEDITOR.dom.walker.whitespaces(!0),c=CKEDITOR.dom.walker.bookmark(!1,!0);CKEDITOR.on("instanceLoaded",function(t){var n=t.editor;n.on("insertElement",function(e){e=e.data,e.type==CKEDITOR.NODE_ELEMENT&&(e.is("input")||e.is("textarea"))&&("false"!=e.getAttribute("contentEditable")&&e.data("cke-editable",e.hasAttribute("contenteditable")?"true":"1"),e.setAttribute("contentEditable",!1))}),n.on("selectionChange",function(t){if(!n.readOnly){var i=n.getSelection();i&&!i.isLocked&&(i=n.checkDirty(),n.fire("lockSnapshot"),e(t),n.fire("unlockSnapshot"),!i&&n.resetDirty())}})}),CKEDITOR.on("instanceCreated",function(e){var t=e.editor;t.on("mode",function(){var e=t.editable();if(e&&e.isInline()){var n=t.title;if(e.changeAttr("role","textbox"),e.changeAttr("aria-label",n),n&&e.changeAttr("title",n),n=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents")){var i=CKEDITOR.tools.getNextId(),o=CKEDITOR.dom.element.createFromHtml(''+this.lang.common.editorHelp+"");n.append(o),e.changeAttr("aria-describedby",i)}}})}),CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");var u=function(){function e(e){return e.type==CKEDITOR.NODE_ELEMENT}function t(n,i){var o,r,a,s,c=[],u=i.range.startContainer;o=i.range.startPath();for(var u=l[u.getName()],d=0,h=n.getChildren(),f=h.count(),m=-1,E=-1,g=0,T=o.contains(l.$list);f>d;++d)o=h.getItem(d),e(o)?(a=o.getName(),T&&a in CKEDITOR.dtd.$list?c=c.concat(t(o,i)):(s=!!u[a],"br"!=a||!o.data("cke-eol")||d&&d!=f-1||(g=(r=d?c[d-1].node:h.getItem(d+1))&&(!e(r)||!r.is("br")),r=r&&e(r)&&l.$block[r.getName()]),-1==m&&!s&&(m=d),s||(E=d),c.push({isElement:1,isLineBreak:g,isBlock:o.isBlockBoundary(),hasBlockSibling:r,node:o,name:a,allowed:s}),r=g=0)):c.push({isElement:0,node:o,allowed:1});return m>-1&&(c[m].firstNotAllowed=1),E>-1&&(c[E].lastNotAllowed=1),c}function i(t,n){var o,r=[],a=t.getChildren(),s=a.count(),c=0,u=l[n],d=!t.is(l.$inline)||t.is("br");for(d&&r.push(" ");s>c;c++)o=a.getItem(c),e(o)&&!o.is(u)?r=r.concat(i(o,n)):r.push(o);return d&&r.push(" "),r}function o(t){return t&&e(t)&&(t.is(l.$removeEmpty)||t.is("a")&&!t.isBlockBoundary())}function r(t,n,i,o){var a,s,l=t.clone();l.setEndAt(n,CKEDITOR.POSITION_BEFORE_END),(a=new CKEDITOR.dom.walker(l).next())&&e(a)&&c[a.getName()]&&(s=a.getPrevious())&&e(s)&&!s.getParent().equals(t.startContainer)&&i.contains(s)&&o.contains(a)&&a.isIdentical(s)&&(a.moveChildren(s),a.remove(),r(t,n,i,o))}function s(t,n){function i(t,n){return n.isBlock&&n.isElement&&!n.node.is("br")&&e(t)&&t.is("br")?(t.remove(),1):void 0}var o=n.endContainer.getChild(n.endOffset),r=n.endContainer.getChild(n.endOffset-1);o&&i(o,t[t.length-1]),r&&i(r,t[0])&&(n.setEnd(n.endContainer,n.endOffset-1),n.collapse())}var l=CKEDITOR.dtd,c={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,li:1,pre:1,dl:1,blockquote:1},u={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},d=CKEDITOR.tools.extend({},l.$inline);return delete d.br,function(c,h,f){var m=c.editor;c.getDocument();var E=m.getSelection().getRanges()[0],g=!1;if("unfiltered_html"==h&&(h="html",g=!0),!E.checkReadOnly()){var T,p,C,I,O=new CKEDITOR.dom.elementPath(E.startContainer,E.root).blockLimit||E.root,h={type:h,dontFilter:g,editable:c,editor:m,range:E,blockLimit:O,mergeCandidates:[],zombies:[]},m=h.range,g=h.mergeCandidates;if("text"==h.type&&m.shrink(CKEDITOR.SHRINK_ELEMENT,!0,!1)&&(T=CKEDITOR.dom.element.createFromHtml(" ",m.document),m.insertNode(T),m.setStartAfter(T)),p=new CKEDITOR.dom.elementPath(m.startContainer),h.endPath=C=new CKEDITOR.dom.elementPath(m.endContainer),!m.collapsed){var O=C.block||C.blockLimit,D=m.getCommonAncestor();O&&!O.equals(D)&&!O.contains(D)&&m.checkEndOfBlock()&&h.zombies.push(O),m.deleteContents()}for(;(I=e(m.startContainer)&&m.startContainer.getChild(m.startOffset-1))&&e(I)&&I.isBlockBoundary()&&p.contains(I);)m.moveToPosition(I,CKEDITOR.POSITION_BEFORE_END);for(r(m,h.blockLimit,p,C),T&&(m.setEndBefore(T),m.collapse(),T.remove()),T=m.startPath(),(O=T.contains(o,!1,1))&&(m.splitElement(O),h.inlineStylesRoot=O,h.inlineStylesPeak=T.lastElement),T=m.createBookmark(),(O=T.startNode.getPrevious(n))&&e(O)&&o(O)&&g.push(O),(O=T.startNode.getNext(n))&&e(O)&&o(O)&&g.push(O),O=T.startNode;(O=O.getParent())&&o(O);)g.push(O);if(m.moveToBookmark(T),T=f){if(T=h.range,"text"==h.type&&h.inlineStylesRoot){for(I=h.inlineStylesPeak,m=I.getDocument().createText("{cke-peak}"),g=h.inlineStylesRoot.getParent();!I.equals(g);)m=m.appendTo(I.clone()),I=I.getParent();f=m.getOuterHtml().split("{cke-peak}").join(f)}if(I=h.blockLimit.getName(),/^\s+|\s+$/.test(f)&&"span"in CKEDITOR.dtd[I])var R=' ',f=R+f+R;if(f=h.editor.dataProcessor.toHtml(f,null,!1,h.dontFilter),I=T.document.createElement("body"),I.setHtml(f),R&&(I.getFirst().remove(),I.getLast().remove()),(R=T.startPath().block)&&(1!=R.getChildCount()||!R.getBogus()))e:{var v;if(1==I.getChildCount()&&e(v=I.getFirst())&&v.is(u)){for(R=v.getElementsByTag("*"),T=0,g=R.count();g>T;T++)if(m=R.getItem(T),!m.is(d))break e;v.moveChildren(v.getParent(1)),v.remove()}}h.dataWrapper=I,T=f}if(T){v=h.range;var b,R=v.document,f=h.blockLimit;T=0;var K;I=[];var _,y,k,N,g=m=0;p=v.startContainer;var w,O=h.endPath.elements[0];for(C=O.getPosition(p),D=!(!O.getCommonAncestor(p)||C==CKEDITOR.POSITION_IDENTICAL||C&CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED),p=t(h.dataWrapper,h),s(p,v);T0;else{if(b=v.startPath(),!C.isBlock&&(y=h.editor.config.enterMode!=CKEDITOR.ENTER_BR&&h.editor.config.autoParagraph!==!1?h.editor.config.enterMode==CKEDITOR.ENTER_DIV?"div":"p":!1)&&!b.block&&b.blockLimit&&b.blockLimit.equals(v.root)&&(y=R.createElement(y),!CKEDITOR.env.ie&&y.appendBogus(),v.insertNode(y),!CKEDITOR.env.ie&&(K=y.getBogus())&&K.remove(),v.moveToPosition(y,CKEDITOR.POSITION_BEFORE_END)),(b=v.startPath().block)&&!b.equals(_)&&((K=b.getBogus())&&(K.remove(),I.push(b)),_=b),C.firstNotAllowed&&(m=1),m&&C.isElement){for(b=v.startContainer,k=null;b&&!l[b.getName()][C.name];){if(b.equals(f)){b=null;break}k=b,b=b.getParent()}if(b)k&&(N=v.splitElement(k),h.zombies.push(N),h.zombies.push(k));else{k=f.getName(),w=!T,b=T==p.length-1,k=i(C.node,k);for(var S=[],x=k.length,A=0,L=void 0,P=0,B=-1;x>A;A++)L=k[A]," "==L?(P||w&&!A||(S.push(new CKEDITOR.dom.text(" ")),B=S.length),P=1):(S.push(L),P=0);b&&B==S.length&&S.pop(),w=S}}if(w){for(;b=w.pop();)v.insertNode(b);w=0}else v.insertNode(C.node);C.lastNotAllowed&&T1&&r&&r.intersectsNode(n.$)){i=[o.anchorOffset,o.focusOffset],r=o.focusNode==n.$&&o.focusOffset>0,o.anchorNode==n.$&&o.anchorOffset>0&&i[0]--,r&&i[1]--;var s;r=o,r.isCollapsed||(s=r.getRangeAt(0),s.setStart(r.anchorNode,r.anchorOffset),s.setEnd(r.focusNode,r.focusOffset),s=s.collapsed),s&&i.unshift(i.pop())}}n.setText(a(n.getText())),i&&(n=o.getRangeAt(0),n.setStart(n.startContainer,i[0]),n.setEnd(n.startContainer,i[1]),o.removeAllRanges(),o.addRange(n))}}function a(e){return e.replace(/\u200B( )?/g,function(e){return e[1]?" ":""})}function s(e,t,n){var i=e.on("focus",function(e){e.cancel()},null,null,-100);if(CKEDITOR.env.ie)var o=e.getDocument().on("selectionchange",function(e){e.cancel()},null,null,-100);else{var r=new CKEDITOR.dom.range(e);r.moveToElementEditStart(e);var a=e.getDocument().$.createRange();a.setStart(r.startContainer.$,r.startOffset),a.collapse(1),t.removeAllRanges(),t.addRange(a)}n&&e.focus(),i.removeListener(),o&&o.removeListener()}var l,c,u=CKEDITOR.dom.walker.invisible(1);CKEDITOR.on("instanceCreated",function(n){function i(){var e=o.getSelection();e&&e.removeAllRanges()}var o=n.editor;o.define("selectionChange",{errorProof:1}),o.on("contentDom",function(){var n,i=o.document,a=CKEDITOR.document,s=o.editable(),l=i.getBody(),c=i.getDocumentElement(),u=s.isInline();if(CKEDITOR.env.gecko&&s.attachListener(s,"focus",function(e){e.removeListener(),0!==n&&(e=o.getSelection().getNative(),e.isCollapsed&&e.anchorNode==s.$&&(e=o.createRange(),e.moveToElementEditStart(s),e.select()))},null,null,-2),s.attachListener(s,"focus",function(){o.unlockSelection(n),n=0},null,null,-1),s.attachListener(s,"mousedown",function(){n=0}),CKEDITOR.env.ie||CKEDITOR.env.opera||u){var h,f=function(){h=o.getSelection(1),h.lock()};d?s.attachListener(s,"beforedeactivate",f,null,null,-1):s.attachListener(o,"selectionCheck",f,null,null,-1),s.attachListener(s,"blur",function(){o.lockSelection(h),n=1},null,null,-1)}if(CKEDITOR.env.ie&&!u){var m;if(s.attachListener(s,"mousedown",function(e){2==e.data.$.button&&"None"==o.document.$.selection.type&&(m=o.window.getScrollPosition())}),s.attachListener(s,"mouseup",function(e){2==e.data.$.button&&m&&(o.document.$.documentElement.scrollLeft=m.x,o.document.$.documentElement.scrollTop=m.y),m=null}),"BackCompat"!=i.$.compatMode&&((CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&c.on("mousedown",function(e){function t(e){if(e=e.data.$,i){var t=l.$.createTextRange();try{t.moveToPoint(e.x,e.y)}catch(n){}i.setEndPoint(r.compareEndPoints("StartToStart",t)<0?"EndToEnd":"StartToStart",t),i.select()}}function n(){c.removeListener("mousemove",t),a.removeListener("mouseup",n),c.removeListener("mouseup",n),i.select()}if(e=e.data,e.getTarget().is("html")&&e.$.y7)){c.on("mousedown",function(e){e.data.getTarget().is("html")&&(a.on("mouseup",E),c.on("mouseup",E))});var E=function(){a.removeListener("mouseup",E),c.removeListener("mouseup",E);var e=CKEDITOR.document.$.selection,t=e.createRange();"None"!=e.type&&t.parentElement().ownerDocument==i.$&&t.select()}}}if(s.attachListener(s,"selectionchange",e,o),s.attachListener(s,"keyup",t,o),s.attachListener(s,"focus",function(){o.forceNextSelectionCheck(),o.selectionChange(1)}),u?CKEDITOR.env.webkit||CKEDITOR.env.gecko:CKEDITOR.env.opera){var g;s.attachListener(s,"mousedown",function(){g=1}),s.attachListener(i.getDocumentElement(),"mouseup",function(){g&&t.call(o),g=0})}else s.attachListener(CKEDITOR.env.ie?s:i.getDocumentElement(),"mouseup",t,o);CKEDITOR.env.webkit&&s.attachListener(i,"keydown",function(e){switch(e.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:r(s)}},null,null,-1)}),o.on("contentDomUnload",o.forceNextSelectionCheck,o),o.on("dataReady",function(){o.selectionChange(1)}),CKEDITOR.env.ie9Compat&&o.on("beforeDestroy",i,null,null,9),CKEDITOR.env.webkit&&o.on("setData",i),o.on("contentDomUnload",function(){o.unlockSelection()})}),CKEDITOR.on("instanceReady",function(e){var t=e.editor;if(CKEDITOR.env.webkit){t.on("selectionChange",function(){var e=t.editable(),n=o(e);n&&(n.getCustomData("ready")?r(e):n.setCustomData("ready",1))},null,null,-1),t.on("beforeSetMode",function(){r(t.editable())},null,null,-1);var n,i,e=function(){var e=t.editable();if(e&&(e=o(e))){var r=t.document.$.defaultView.getSelection();"Caret"==r.type&&r.anchorNode==e.$&&(i=1),n=e.getText(),e.setText(a(n))}},s=function(){var e=t.editable();e&&(e=o(e))&&(e.setText(n),i&&(t.document.$.defaultView.getSelection().setPosition(e.$,e.getLength()),i=0))};t.on("beforeUndoImage",e),t.on("afterUndoImage",s),t.on("beforeGetData",e,null,null,0),t.on("getData",s) }}),CKEDITOR.editor.prototype.selectionChange=function(n){(n?e:t).call(this)},CKEDITOR.editor.prototype.getSelection=function(e){return this._.savedSelection&&!e?this._.savedSelection:(e=this.editable())?new CKEDITOR.dom.selection(e):null},CKEDITOR.editor.prototype.lockSelection=function(e){return e=e||this.getSelection(1),e.getType()!=CKEDITOR.SELECTION_NONE?(!e.isLocked&&e.lock(),this._.savedSelection=e,!0):!1},CKEDITOR.editor.prototype.unlockSelection=function(e){var t=this._.savedSelection;return t?(t.unlock(e),delete this._.savedSelection,!0):!1},CKEDITOR.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath},CKEDITOR.dom.document.prototype.getSelection=function(){return new CKEDITOR.dom.selection(this)},CKEDITOR.dom.range.prototype.select=function(){var e=this.root instanceof CKEDITOR.editable?this.root.editor.getSelection():new CKEDITOR.dom.selection(this.root);return e.selectRanges([this]),e},CKEDITOR.SELECTION_NONE=1,CKEDITOR.SELECTION_TEXT=2,CKEDITOR.SELECTION_ELEMENT=3;var d="function"!=typeof window.getSelection;CKEDITOR.dom.selection=function(e){var t=e instanceof CKEDITOR.dom.element;if(this.document=e instanceof CKEDITOR.dom.document?e:e.getDocument(),this.root=e=t?e:this.document.getBody(),this.isLocked=0,this._={cache:{}},t=d?this.document.$.selection:this.document.getWindow().$.getSelection(),CKEDITOR.env.webkit)("None"==t.type&&this.document.getActive().equals(e)||"Caret"==t.type&&t.anchorNode.nodeType==CKEDITOR.NODE_DOCUMENT)&&s(e,t);else if(CKEDITOR.env.gecko)t&&this.document.getActive().equals(e)&&t.anchorNode&&t.anchorNode.nodeType==CKEDITOR.NODE_DOCUMENT&&s(e,t,!0);else if(CKEDITOR.env.ie){var n;try{n=this.document.getActive()}catch(i){}d?"None"==t.type&&n&&n.equals(this.document.getDocumentElement())&&s(e,null,!0):((t=t&&t.anchorNode)&&(t=new CKEDITOR.dom.node(t)),n&&n.equals(this.document.getDocumentElement())&&t&&(e.equals(t)||e.contains(t))&&s(e,null,!0))}n=this.getNative();var o,r;if(n)if(n.getRangeAt)o=(r=n.rangeCount&&n.getRangeAt(0))&&new CKEDITOR.dom.node(r.commonAncestorContainer);else{try{r=n.createRange()}catch(a){}o=r&&CKEDITOR.dom.element.get(r.item&&r.item(0)||r.parentElement())}return o&&(e.equals(o)||e.contains(o))||(this._.cache.type=CKEDITOR.SELECTION_NONE,this._.cache.startElement=null,this._.cache.selectedElement=null,this._.cache.selectedText="",this._.cache.ranges=new CKEDITOR.dom.rangeList),this};var h={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.dom.selection.prototype={getNative:function(){return void 0!==this._.cache.nativeSel?this._.cache.nativeSel:this._.cache.nativeSel=d?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:d?function(){var e=this._.cache;if(e.type)return e.type;var t=CKEDITOR.SELECTION_NONE;try{var n=this.getNative(),i=n.type;"Text"==i&&(t=CKEDITOR.SELECTION_TEXT),"Control"==i&&(t=CKEDITOR.SELECTION_ELEMENT),n.createRange().parentElement()&&(t=CKEDITOR.SELECTION_TEXT)}catch(o){}return e.type=t}:function(){var e=this._.cache;if(e.type)return e.type;var t=CKEDITOR.SELECTION_TEXT,n=this.getNative();if(n&&n.rangeCount){if(1==n.rangeCount){var n=n.getRangeAt(0),i=n.startContainer;i==n.endContainer&&1==i.nodeType&&n.endOffset-n.startOffset==1&&h[i.childNodes[n.startOffset].nodeName.toLowerCase()]&&(t=CKEDITOR.SELECTION_ELEMENT)}}else t=CKEDITOR.SELECTION_NONE;return e.type=t},getRanges:function(){var e=d?function(){function e(e){return new CKEDITOR.dom.node(e).getIndex()}var t=function(t,n){t=t.duplicate(),t.collapse(n);var i=t.parentElement(),o=i.ownerDocument;if(!i.hasChildNodes())return{container:i,offset:0};for(var r,a,s,l,c=i.children,u=t.duplicate(),d=0,h=c.length-1,f=-1;h>=d;)if(f=Math.floor((d+h)/2),r=c[f],u.moveToElementText(r),s=u.compareEndPoints("StartToStart",t),s>0)h=f-1;else{if(!(0>s))return CKEDITOR.env.ie9Compat&&"BR"==r.tagName?(c=o.defaultView.getSelection(),{container:c[n?"anchorNode":"focusNode"],offset:c[n?"anchorOffset":"focusOffset"]}):{container:i,offset:e(r)};d=f+1}if(-1==f||f==c.length-1&&0>s){if(u.moveToElementText(i),u.setEndPoint("StartToStart",t),o=u.text.replace(/(\r\n|\r)/g,"\n").length,c=i.childNodes,!o)return r=c[c.length-1],r.nodeType!=CKEDITOR.NODE_TEXT?{container:i,offset:c.length}:{container:r,offset:r.nodeValue.length};for(i=c.length;o>0&&i>0;)a=c[--i],a.nodeType==CKEDITOR.NODE_TEXT&&(l=a,o-=a.nodeValue.length);return{container:l,offset:-o}}if(u.collapse(s>0?!0:!1),u.setEndPoint(s>0?"StartToStart":"EndToStart",t),o=u.text.replace(/(\r\n|\r)/g,"\n").length,!o)return{container:i,offset:e(r)+(s>0?0:1)};for(;o>0;)try{a=r[s>0?"previousSibling":"nextSibling"],a.nodeType==CKEDITOR.NODE_TEXT&&(o-=a.nodeValue.length,l=a),r=a}catch(m){return{container:i,offset:e(r)}}return{container:l,offset:s>0?-o:l.nodeValue.length+o}};return function(){var e=this.getNative(),n=e&&e.createRange(),i=this.getType();if(!e)return[];if(i==CKEDITOR.SELECTION_TEXT)return e=new CKEDITOR.dom.range(this.root),i=t(n,!0),e.setStart(new CKEDITOR.dom.node(i.container),i.offset),i=t(n),e.setEnd(new CKEDITOR.dom.node(i.container),i.offset),e.endContainer.getPosition(e.startContainer)&CKEDITOR.POSITION_PRECEDING&&e.endOffset<=e.startContainer.getIndex()&&e.collapse(),[e];if(i==CKEDITOR.SELECTION_ELEMENT){for(var i=[],o=0;o=t.getLength()?c.setStartAfter(t):c.setStartBefore(t)),a&&a.type==CKEDITOR.NODE_TEXT&&(l?c.setEndAfter(a):c.setEndBefore(a)),t=new CKEDITOR.dom.walker(c),t.evaluator=function(e){if(e.type==CKEDITOR.NODE_ELEMENT&&e.isReadOnly()){var t=r.clone();return r.setEndBefore(e),r.collapsed&&i.splice(o--,1),e.getPosition(c.endContainer)&CKEDITOR.POSITION_CONTAINS||(t.setStartAfter(e),t.collapsed||i.splice(o+1,0,t)),!0}return!1},t.next()}}return n.ranges}}(),getStartElement:function(){var e=this._.cache;if(void 0!==e.startElement)return e.startElement;var t;switch(this.getType()){case CKEDITOR.SELECTION_ELEMENT:return this.getSelectedElement();case CKEDITOR.SELECTION_TEXT:var n=this.getRanges()[0];if(n){if(n.collapsed)t=n.startContainer,t.type!=CKEDITOR.NODE_ELEMENT&&(t=t.getParent());else{for(n.optimize();t=n.startContainer,n.startOffset==(t.getChildCount?t.getChildCount():t.getLength())&&!t.isBlockBoundary();)n.setStartAfter(t);if(t=n.startContainer,t.type!=CKEDITOR.NODE_ELEMENT)return t.getParent();if(t=t.getChild(n.startOffset),t&&t.type==CKEDITOR.NODE_ELEMENT)for(n=t.getFirst();n&&n.type==CKEDITOR.NODE_ELEMENT;)t=n,n=n.getFirst();else t=n.startContainer}t=t.$}}return e.startElement=t?new CKEDITOR.dom.element(t):null},getSelectedElement:function(){var e=this._.cache;if(void 0!==e.selectedElement)return e.selectedElement;var t=this,n=CKEDITOR.tools.tryThese(function(){return t.getNative().createRange().item(0)},function(){for(var e,n,i=t.getRanges()[0],o=2;!(!o||(e=i.getEnclosedNode())&&e.type==CKEDITOR.NODE_ELEMENT&&h[e.getName()]&&(n=e));o--)i.shrink(CKEDITOR.SHRINK_ELEMENT);return n.$});return e.selectedElement=n?new CKEDITOR.dom.element(n):null},getSelectedText:function(){var e=this._.cache;if(void 0!==e.selectedText)return e.selectedText;var t=this.getNative(),t=d?"Control"==t.type?"":t.createRange().text:t.toString();return e.selectedText=t},lock:function(){this.getRanges(),this.getStartElement(),this.getSelectedElement(),this.getSelectedText(),this._.cache.nativeSel=null,this.isLocked=1},unlock:function(e){if(this.isLocked){if(e)var t=this.getSelectedElement(),n=!t&&this.getRanges();this.isLocked=0,this.reset(),e&&(e=t||n[0]&&n[0].getCommonAncestor())&&e.getAscendant("body",1)&&(t?this.selectElement(t):this.selectRanges(n))}},reset:function(){this._.cache={}},selectElement:function(e){var t=new CKEDITOR.dom.range(this.root);t.setStartBefore(e),t.setEndAfter(e),this.selectRanges([t])},selectRanges:function(e){if(e.length)if(this.isLocked){var t=CKEDITOR.document.getActive();this.unlock(),this.selectRanges(e),this.lock(),!t.equals(this.root)&&t.focus()}else{if(d){var n=CKEDITOR.dom.walker.whitespaces(!0),o=/\ufeff|\u00a0/,a={table:1,tbody:1,tr:1};e.length>1&&(t=e[e.length-1],e[0].setEnd(t.endContainer,t.endOffset));var s,l,c,t=e[0],e=t.collapsed,u=t.getEnclosedNode();if(u&&u.type==CKEDITOR.NODE_ELEMENT&&u.getName()in h&&(!u.is("a")||!u.getText()))try{return c=u.$.createControlRange(),c.addElement(u.$),void c.select()}catch(f){}(t.startContainer.type==CKEDITOR.NODE_ELEMENT&&t.startContainer.getName()in a||t.endContainer.type==CKEDITOR.NODE_ELEMENT&&t.endContainer.getName()in a)&&t.shrink(CKEDITOR.NODE_ELEMENT,!0),c=t.createBookmark();var m,a=c.startNode;e||(m=c.endNode),c=t.document.$.body.createTextRange(),c.moveToElementText(a.$),c.moveStart("character",1),m?(o=t.document.$.body.createTextRange(),o.moveToElementText(m.$),c.setEndPoint("EndToEnd",o),c.moveEnd("character",-1)):(s=a.getNext(n),l=a.hasAscendant("pre"),s=!(s&&s.getText&&s.getText().match(o))&&(l||!a.hasPrevious()||a.getPrevious().is&&a.getPrevious().is("br")),l=t.document.createElement("span"),l.setHtml(""),l.insertBefore(a),s&&t.document.createText("").insertBefore(a)),t.setStartBefore(a),a.remove(),e?(s?(c.moveStart("character",-1),c.select(),t.document.$.selection.clear()):c.select(),t.moveToPosition(l,CKEDITOR.POSITION_BEFORE_START),l.remove()):(t.setEndBefore(m),m.remove(),c.select())}else{if(m=this.getNative(),!m)return;for(CKEDITOR.env.opera&&(t=this.document.$.createRange(),t.selectNodeContents(this.root.$),m.addRange(t)),this.removeAllRanges(),o=0;o=0))throw E;t.collapse(1),c.setEnd(t.endContainer.$,t.endOffset)}m.addRange(c)}}this.reset(),this.root.fire("selectionchange")}},createBookmarks:function(e){return this.getRanges().createBookmarks(e)},createBookmarks2:function(e){return this.getRanges().createBookmarks2(e)},selectBookmarks:function(e){for(var t=[],n=0;n]*>)[ \t\r\n]*/gi,"$1"),r=r.replace(/([ \t\n\r]+| )/g," "),r=r.replace(/]*>/gi,"\n"),CKEDITOR.env.ie){var a=e.getDocument().createElement("div");a.append(o),o.$.outerHTML="
"+r+"
",o.copyAttributes(a.getFirst()),o=a.getFirst().remove()}else o.setHtml(r);t=o}else r?t=u(n?[e.getHtml()]:l(e),t):e.moveChildren(t);if(t.replace(e),i){var s,n=t;(s=n.getPrevious(K))&&s.is&&s.is("pre")&&(i=c(s.getHtml(),/\n$/,"")+"\n\n"+c(n.getHtml(),/^\n/,""),CKEDITOR.env.ie?n.$.outerHTML="
"+i+"
":n.setHtml(i),s.remove())}else n&&m(t)}function l(e){e.getName();var t=[];return c(e.getOuterHtml(),/(\S\s*)\n(?:\s|(]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(e,t,n){return t+"
"+n+"
"}).replace(/([\s\S]*?)<\/pre>/gi,function(e,n){t.push(n)}),t}function c(e,t,n){var i="",o="",e=e.replace(/(^]+data-cke-bookmark.*?\/span>)|(]+data-cke-bookmark.*?\/span>$)/gi,function(e,t,n){return t&&(i=t),n&&(o=n),""});return i+e.replace(t,n)+o}function u(e,t){var n;e.length>1&&(n=new CKEDITOR.dom.documentFragment(t.getDocument()));for(var i=0;i"),o=o.replace(/[ \t]{2,}/g,function(e){return CKEDITOR.tools.repeat(" ",e.length-1)+" "});if(n){var r=t.clone();r.setHtml(o),n.append(r)}else t.setHtml(o)}return n||t}function d(e){var t,n=this._.definition,i=n.attributes,n=n.styles,o=p(this)[e.getName()],r=CKEDITOR.tools.isEmpty(i)&&CKEDITOR.tools.isEmpty(n);for(t in i)("class"!=t&&!this._.definition.fullMatch||e.getAttribute(t)==C(t,i[t]))&&(r=e.hasAttribute(t),e.removeAttribute(t));for(var a in n)this._.definition.fullMatch&&e.getStyle(a)!=C(a,n[a],!0)||(r=r||!!e.getStyle(a),e.removeStyle(a));f(e,o,O[e.getName()]),r&&(this._.definition.alwaysRemoveElement?m(e,1):!CKEDITOR.dtd.$block[e.getName()]||this._.enterMode==CKEDITOR.ENTER_BR&&!e.hasAttributes()?m(e):e.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function h(e){for(var t=p(this),n=e.getElementsByTag(this.element),i=n.count();--i>=0;)d.call(this,n.getItem(i));for(var o in t)if(o!=this.element)for(n=e.getElementsByTag(o),i=n.count()-1;i>=0;i--){var r=n.getItem(i);f(r,t[o])}}function f(e,t,n){if(t=t&&t.attributes)for(var i=0;i",e||t.name,""),n.join("")},getDefinition:function(){return this._.definition}},CKEDITOR.style.getStyleText=function(e){var t=e._ST;if(t)return t;var t=e.styles,n=e.attributes&&e.attributes.style||"",i="";n.length&&(n=n.replace(R,";"));for(var o in t){var r=t[o],a=(o+":"+r).replace(R,";");"inherit"==r?i+=a:n+=a}return n.length&&(n=CKEDITOR.tools.normalizeCssText(n,!0)),e._ST=n+i}}(),CKEDITOR.styleCommand=function(e,t){this.requiredContent=this.allowedContent=this.style=e,CKEDITOR.tools.extend(this,t,!0)},CKEDITOR.styleCommand.prototype.exec=function(e){e.focus(),this.state==CKEDITOR.TRISTATE_OFF?e.applyStyle(this.style):this.state==CKEDITOR.TRISTATE_ON&&e.removeStyle(this.style)},CKEDITOR.stylesSet=new CKEDITOR.resourceManager("","stylesSet"),CKEDITOR.addStylesSet=CKEDITOR.tools.bind(CKEDITOR.stylesSet.add,CKEDITOR.stylesSet),CKEDITOR.loadStylesSet=function(e,t,n){CKEDITOR.stylesSet.addExternal(e,t,""),CKEDITOR.stylesSet.load(e,n)},CKEDITOR.editor.prototype.getStylesSet=function(e){if(this._.stylesDefinitions)e(this._.stylesDefinitions);else{var t=this,n=t.config.stylesCombo_stylesSet||t.config.stylesSet;if(n===!1)e(null);else if(n instanceof Array)t._.stylesDefinitions=n,e(n);else{n||(n="default");var n=n.split(":"),i=n[0];CKEDITOR.stylesSet.addExternal(i,n[1]?n.slice(1).join(":"):CKEDITOR.getUrl("styles.js"),""),CKEDITOR.stylesSet.load(i,function(n){t._.stylesDefinitions=n[i],e(t._.stylesDefinitions)})}}},CKEDITOR.dom.comment=function(e,t){"string"==typeof e&&(e=(t?t.$:document).createComment(e)),CKEDITOR.dom.domObject.call(this,e)},CKEDITOR.dom.comment.prototype=new CKEDITOR.dom.node,CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype,{type:CKEDITOR.NODE_COMMENT,getOuterHtml:function(){return""}}),function(){var e,t={};for(e in CKEDITOR.dtd.$blockLimit)e in CKEDITOR.dtd.$list||(t[e]=1);var n={};for(e in CKEDITOR.dtd.$block)e in CKEDITOR.dtd.$blockLimit||e in CKEDITOR.dtd.$empty||(n[e]=1);CKEDITOR.dom.elementPath=function(e,i){var o=null,r=null,a=[],i=i||e.getDocument().getBody(),s=e;do if(s.type==CKEDITOR.NODE_ELEMENT){if(a.push(s),!this.lastElement&&(this.lastElement=s,s.is(CKEDITOR.dtd.$object)))continue;var l=s.getName();if(!r&&(!o&&n[l]&&(o=s),t[l])){var c;if(c=!o){if(l="div"==l){e:{l=s.getChildren(),c=0;for(var u=l.count();u>c;c++){var d=l.getItem(c);if(d.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$block[d.getName()]){l=!0;break e}}l=!1}l=!l&&!s.equals(i)}c=l}c?o=s:r=s}if(s.equals(i))break}while(s=s.getParent());this.block=o,this.blockLimit=r,this.root=i,this.elements=a}}(),CKEDITOR.dom.elementPath.prototype={compare:function(e){var t=this.elements,e=e&&e.elements;if(!e||t.length!=e.length)return!1;for(var n=0;n-1}:"function"==typeof e?i=e:"object"==typeof e&&(i=function(t){return t.getName()in e});var o=this.elements,r=o.length;for(t&&r--,n&&(o=Array.prototype.slice.call(o,0),o.reverse()),t=0;r>t;t++)if(i(o[t]))return o[t];return null},isContextFor:function(e){var t;return e in CKEDITOR.dtd.$block?(t=this.contains(CKEDITOR.dtd.$intermediate)||this.root.equals(this.block)&&this.block||this.blockLimit,!!t.getDtd()[e]):!0},direction:function(){return(this.block||this.blockLimit||this.root).getDirection(1)}},CKEDITOR.dom.text=function(e,t){"string"==typeof e&&(e=(t?t.$:document).createTextNode(e)),this.$=e},CKEDITOR.dom.text.prototype=new CKEDITOR.dom.node,CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype,{type:CKEDITOR.NODE_TEXT,getLength:function(){return this.$.nodeValue.length},getText:function(){return this.$.nodeValue},setText:function(e){this.$.nodeValue=e},split:function(e){var t=this.$.parentNode,n=t.childNodes.length,i=this.getLength(),o=this.getDocument(),r=new CKEDITOR.dom.text(this.$.splitText(e),o);return t.childNodes.length==n&&(e>=i?(r=o.createText(""),r.insertAfter(this)):(e=o.createText(""),e.insertAfter(r),e.remove())),r},substring:function(e,t){return"number"!=typeof t?this.$.nodeValue.substr(e):this.$.nodeValue.substring(e,t)}}),function(){function e(e,t,n){var i=e.serializable,o=t[n?"endContainer":"startContainer"],r=n?"endOffset":"startOffset",a=i?t.document.getById(e.startNode):e.startNode,e=i?t.document.getById(e.endNode):e.endNode;return o.equals(a.getPrevious())?(t.startOffset=t.startOffset-o.getLength()-e.getPrevious().getLength(),o=e.getNext()):o.equals(e.getPrevious())&&(t.startOffset=t.startOffset-o.getLength(),o=e.getNext()),o.equals(a.getParent())&&t[r]++,o.equals(e.getParent())&&t[r]++,t[n?"endContainer":"startContainer"]=o,t}CKEDITOR.dom.rangeList=function(e){return e instanceof CKEDITOR.dom.rangeList?e:(e?e instanceof CKEDITOR.dom.range&&(e=[e]):e=[],CKEDITOR.tools.extend(e,t))};var t={createIterator:function(){var e,t=this,n=CKEDITOR.dom.walker.bookmark(),i=[];return{getNextRange:function(o){e=void 0==e?0:e+1;var r=t[e];if(r&&t.length>1){if(!e)for(var a=t.length-1;a>=0;a--)i.unshift(t[a].createBookmark(!0));if(o)for(var s=0;t[e+s+1];){for(var l=r.document,o=0,a=l.getById(i[s].endNode),l=l.getById(i[s+1].startNode);;){if(a=a.getNextSourceNode(!1),l.equals(a))o=1;else if(n(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary())continue;break}if(!o)break;s++}for(r.moveToBookmark(i.shift());s--;)a=t[++e],a.moveToBookmark(i.shift()),r.setEnd(a.endContainer,a.endOffset)}return r}}},createBookmarks:function(t){for(var n,i=[],o=0;ot?-1:1}),r=0;r
',CKEDITOR.document);e.appendTo(CKEDITOR.document.getHead());try{CKEDITOR.env.hc=e.getComputedStyle("border-top-color")==e.getComputedStyle("border-right-color")}catch(t){CKEDITOR.env.hc=!1}e.remove()}if(CKEDITOR.env.hc&&(CKEDITOR.env.cssClass=CKEDITOR.env.cssClass+" cke_hc"),CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}"),CKEDITOR.status="loaded",CKEDITOR.fireOnce("loaded"),e=CKEDITOR._.pending){delete CKEDITOR._.pending;for(var n=0;ni;i++){var o,r=n,a=i;o=parseInt(n[i],16),o=("0"+(0>t?0|o*(1+t):0|o+(255-o)*t).toString(16)).slice(-2),r[a]=o}return"#"+n.join("")}}(),t=function(){var e=new CKEDITOR.template("background:#{to};background-image:-webkit-gradient(linear,lefttop,leftbottom,from({from}),to({to}));background-image:-moz-linear-gradient(top,{from},{to});background-image:-webkit-linear-gradient(top,{from},{to});background-image:-o-linear-gradient(top,{from},{to});background-image:-ms-linear-gradient(top,{from},{to});background-image:linear-gradient(top,{from},{to});filter:progid:DXImageTransform.Microsoft.gradient(gradientType=0,startColorstr='{from}',endColorstr='{to}');");return function(t,n){return e.output({from:t,to:n})}}(),n={editor:new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ {defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_bottom [{defaultGradient}border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [{defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [{defaultGradient}outline-color:{defaultBorder};border-top-color:{defaultBorder};] {id} .cke_dialog_tab [{lightGradient}border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [{mediumGradient}] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} .cke_toolgroup [{lightGradient}border-color:{defaultBorder};] {id} a.cke_button_off:hover, {id} a.cke_button_off:focus, {id} a.cke_button_off:active [{mediumGradient}] {id} .cke_button_on [{ckeButtonOn}] {id} .cke_toolbar_separator [background-color: {ckeToolbarSeparator};] {id} .cke_combo_button [border-color:{defaultBorder};{lightGradient}] {id} a.cke_combo_button:hover, {id} a.cke_combo_button:focus, {id} .cke_combo_on a.cke_combo_button [border-color:{defaultBorder};{mediumGradient}] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover, {id} a.cke_path_item:focus, {id} a.cke_path_item:active [background-color:{elementsPathBg};] {id}.cke_panel [border-color:{defaultBorder};] "),panel:new CKEDITOR.template(".cke_panel_grouptitle [{lightGradient}border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:focus.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:focus.cke_colorauto, a:focus.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")};return function(i,o){var r=i.uiColor,r={id:"."+i.id,defaultBorder:e(r,-.1),defaultGradient:t(e(r,.9),r),lightGradient:t(e(r,1),e(r,.7)),mediumGradient:t(e(r,.8),e(r,.5)),ckeButtonOn:t(e(r,.6),e(r,.7)),ckeResizer:e(r,-.4),ckeToolbarSeparator:e(r,.5),ckeColorauto:e(r,.8),dialogBody:e(r,.7),dialogTabSelected:t("#FFFFFF","#FFFFFF"),dialogTabSelectedBorder:"#FFF",elementsPathColor:e(r,-.6),elementsPathBg:r,menubuttonIcon:e(r,.5),menubuttonIconHover:e(r,.3)};return n[o].output(r).replace(/\[/g,"{").replace(/\]/g,"}")}}(),CKEDITOR.plugins.add("dialogui",{onLoad:function(){var e=function(e){this._||(this._={}),this._["default"]=this._.initValue=e["default"]||"",this._.required=e.required||!1;for(var t=[this._],n=1;narguments.length)){var r=e.call(this,n);r.labelId=CKEDITOR.tools.getNextId()+"_label",this._.children=[],CKEDITOR.ui.dialog.uiElement.call(this,t,n,i,"div",null,{role:"presentation"},function(){var e=[],i=n.required?" cke_required":"";return"horizontal"!=n.labelLayout?e.push('",'"):(i={type:"hbox",widths:n.widths,padding:0,children:[{type:"html",html:'