!function(){function t(t,n,i){if(!t.getCustomData("indent_processed")){var s=this.editor,r=this.isIndent;if(n){if(i=0,(s=t.$.className.match(this.classNameRegex))&&(s=s[1],i=NEW_CKEDITOR.tools.indexOf(n,s)+1),0>(i+=r?1:-1))return;i=Math.min(i,n.length),i=Math.max(i,0),t.$.className=NEW_CKEDITOR.tools.ltrim(t.$.className.replace(this.classNameRegex,"")),0<i&&t.addClass(n[i-1])}else{n=e(t,i),i=parseInt(t.getStyle(n),10);var a=s.config.indentOffset||40;if(isNaN(i)&&(i=0),0>(i+=(r?1:-1)*a))return;i=Math.max(i,0),i=Math.ceil(i/a)*a,t.setStyle(n,i?i+(s.config.indentUnit||"px"):""),""===t.getAttribute("style")&&t.removeAttribute("style")}NEW_CKEDITOR.dom.element.setMarker(this.database,t,"indent_processed",1)}}function e(t,e){return"ltr"==(e||t.getComputedStyle("direction"))?"margin-left":"margin-right"}var n=NEW_CKEDITOR.dtd.$listItem,i=NEW_CKEDITOR.dtd.$list,s=NEW_CKEDITOR.TRISTATE_DISABLED,r=NEW_CKEDITOR.TRISTATE_OFF;NEW_CKEDITOR.plugins.add("indentblock",{requires:"indent",init:function(a){function l(){o.specificDefinition.apply(this,arguments),this.allowedContent={"div h1 h2 h3 h4 h5 h6 ol p pre ul":{propertiesOnly:!0,styles:h?null:"margin-left,margin-right",classes:h||null}},this.contentTransformations=[["div: splitMarginShorthand"],["h1: splitMarginShorthand"],["h2: splitMarginShorthand"],["h3: splitMarginShorthand"],["h4: splitMarginShorthand"],["h5: splitMarginShorthand"],["h6: splitMarginShorthand"],["ol: splitMarginShorthand"],["p: splitMarginShorthand"],["pre: splitMarginShorthand"],["ul: splitMarginShorthand"]],this.enterBr&&(this.allowedContent.div=!0),this.requiredContent=(this.enterBr?"div":"p")+(h?"("+h.join(",")+")":"{margin-left}"),this.jobs={20:{refresh:function(t,i){if(!(a=i.block||i.blockLimit).is(n))var a=(l=a.getAscendant(n))&&i.contains(l)||a;if(a.is(n)&&(a=a.getParent()),this.enterBr||this.getContext(i)){if(h){var l=h,o=(a=a.$.className.match(this.classNameRegex),this.isIndent);return(l=a?!o||a[1]!=l.slice(-1):o)?r:s}return this.isIndent?r:a?NEW_CKEDITOR[0>=(parseInt(a.getStyle(e(a)),10)||0)?"TRISTATE_DISABLED":"TRISTATE_OFF"]:s}return s},exec:function(e){var n,s=(s=e.getSelection())&&s.getRanges()[0];if(n=e.elementPath().contains(i))t.call(this,n,h);else for(s=s.createIterator(),e=e.config.enterMode,s.enforceRealBlocks=!0,s.enlargeBr=e!=NEW_CKEDITOR.ENTER_BR;n=s.getNextParagraph(e==NEW_CKEDITOR.ENTER_P?"p":"div");)n.isReadOnly()||t.call(this,n,h);return!0}}}}var o=NEW_CKEDITOR.plugins.indent,h=a.config.indentClasses;o.registerCommands(a,{indentblock:new l(a,"indentblock",!0),outdentblock:new l(a,"outdentblock")}),NEW_CKEDITOR.tools.extend(l.prototype,o.specificDefinition.prototype,{context:{div:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,p:1,pre:1,table:1},classNameRegex:h?new RegExp("(?:^|\\s+)("+h.join("|")+")(?=$|\\s)"):null})}})}();