CKEDITOR.dialog.add("paste",function(t){function e(e){var n=new CKEDITOR.dom.document(e.document),i=n.getBody(),o=n.getById("cke_actscrpt");o&&o.remove(),i.setAttribute("contenteditable",!0),CKEDITOR.env.ie&&8>CKEDITOR.env.version&&n.getWindow().on("blur",function(){n.$.selection.empty()}),n.on("keydown",function(t){var e;switch((t=t.data).getKeystroke()){case 27:this.hide(),e=1;break;case 9:case CKEDITOR.SHIFT+9:this.changeFocus(1),e=1}e&&t.preventDefault()},this),t.fire("ariaWidget",new CKEDITOR.dom.element(e.frameElement)),n.getWindow().getFrame().removeCustomData("pendingFocus")&&i.focus()}var n=t.lang.clipboard,i=CKEDITOR.env.isCustomDomain();return t.on("pasteDialogCommit",function(e){e.data&&t.fire("paste",{type:"auto",dataValue:e.data})},null,null,1e3),{title:n.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?370:350,minHeight:CKEDITOR.env.quirks?250:245,onShow:function(){this.parts.dialog.$.offsetHeight,this.setupContent(),this.parts.title.setHtml(this.customTitle||n.title),this.customTitle=null},onLoad:function(){(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&"rtl"==t.lang.dir&&this.parts.contents.setStyle("overflow","hidden")},onOk:function(){this.commitContent()},contents:[{id:"general",label:t.lang.common.generalTab,elements:[{type:"html",id:"securityMsg",html:'<div style="white-space:normal;width:340px">'+n.securityMsg+"</div>"},{type:"html",id:"pasteMsg",html:'<div style="white-space:normal;width:340px">'+n.pasteMsg+"</div>"},{type:"html",id:"editing_area",style:"width:100%;height:100%",html:"",focus:function(){var t=this.getInputElement(),e=t.getFrameDocument().getBody();!e||e.isReadOnly()?t.setCustomData("pendingFocus",1):e.focus()},setup:function(){var o=this.getDialog(),a='<html dir="'+t.config.contentsLangDirection+'" lang="'+(t.config.contentsLanguage||t.langCode)+'"><head><style>body{margin:3px;height:95%}</style></head><body><script id="cke_actscrpt" type="text/javascript">window.parent.CKEDITOR.tools.callFunction('+CKEDITOR.tools.addFunction(e,o)+",this);<\/script></body></html>",s=CKEDITOR.dom.element.createFromHtml('<iframe class="cke_pasteframe" frameborder="0"  allowTransparency="true" src="'+(CKEDITOR.env.air?"javascript:void(0)":i?"javascript:void((function(){document.open();document.domain='"+document.domain+"';document.close();})())\"":"")+'" role="region" aria-label="'+n.pasteArea+'" aria-describedby="'+o.getContentElement("general","pasteMsg").domId+'" aria-multiple="true"></iframe>');if(s.on("load",function(n){n.removeListener(),(n=s.getFrameDocument()).write(a),t.focusManager.add(n.getBody()),CKEDITOR.env.air&&e.call(this,n.getWindow().$)},o),s.setCustomData("dialog",o),(o=this.getElement()).setHtml(""),o.append(s),CKEDITOR.env.ie){var l=CKEDITOR.dom.element.createFromHtml('<span tabindex="-1" style="position:absolute" role="presentation"></span>');l.on("focus",function(){s.$.contentWindow.focus()}),o.append(l),this.focus=function(){l.focus(),this.fire("focus")}}this.getInputElement=function(){return s},CKEDITOR.env.ie&&(o.setStyle("display","block"),o.setStyle("height",s.$.offsetHeight+2+"px"))},commit:function(){var t,e=this.getDialog().getParentEditor(),n=this.getInputElement().getFrameDocument().getBody(),i=n.getBogus();i&&i.remove(),t=n.getHtml(),setTimeout(function(){e.fire("pasteDialogCommit",t)},0)}}]}]}});