!function(e,t){"use strict";function n(e,t){for(var n,i=[],r=0;r
"]]):(e=n.filter(e,[[/\n\n/g,"
)$/,s+"$1"],[/\n/g,"
"]]),-1!=e.indexOf("
")&&(e=s+e)),r(e,t)}function o(){var e=i.dom,t=i.getBody(),n=i.dom.getViewPort(i.getWin()),r=i.inline?t.scrollTop:n.y,a=i.inline?t.clientHeight:n.h;s(),u=e.add(i.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"1",style:"position: absolute; top: "+(r+20)+"px;width: 10px; height: "+(a-40)+"px; overflow: hidden; opacity: 0"},g),e.setStyle(u,"left","rtl"==e.getStyle(t,"direction",!0)?65535:-65535),e.bind(u,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),d=i.selection.getRng(),u.focus(),i.selection.select(u,!0)}function s(){u&&(i.dom.unbind(u),i.dom.remove(u),d&&i.selection.setRng(d)),m=!1,u=d=null}function l(){return u?u.innerHTML:g}function c(e){var t={},n=e.clipboardData||i.getDoc().dataTransfer;if(n&&n.types){t["text/plain"]=n.getData("Text");for(var r=0;r
$/])}function s(e){if(!n.isWordContent(e))return e;var a=[];t.each(r.schema.getBlockElements(),function(e,t){a.push(t)});var o=new RegExp("(?:
[\\s\\r\\n]+|
)*(<\\/?("+a.join("|")+")[^>]*>)(?:
[\\s\\r\\n]+|
)*","g");return e=i.filter(e,[[o,"$1"]]),e=i.filter(e,[[/
/g,"
"],[/
/g," "],[/
/g,"
"]])}function l(e){return(r.settings.paste_remove_styles||r.settings.paste_remove_styles_if_webkit!==!1)&&(e=e.replace(/ style=\"[^\"]+\"/g,"")),e}e.webkit&&(a(l),a(o)),e.ie&&a(s)}}),i(y,[P,d,m,b],function(e,t,n,i){var r;e.add("paste",function(e){function a(){"text"==s.pasteFormat?(this.active(!1),s.pasteFormat="html"):(s.pasteFormat="text",this.active(!0),r||(e.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),r=!0))}var o=this,s,l=e.settings;o.clipboard=s=new t(e),o.quirks=new i(e),o.wordFilter=new n(e),e.settings.paste_as_text&&(o.clipboard.pasteFormat="text"),l.paste_preprocess&&e.on("PastePreProcess",function(e){l.paste_preprocess.call(o,o,e)}),l.paste_postprocess&&e.on("PastePostProcess",function(e){l.paste_postprocess.call(o,o,e)}),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&o.clipboard.pasteHtml(t.content),t.text&&o.clipboard.pasteText(t.text)}),e.paste_block_drop&&e.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),e.settings.paste_data_images||e.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&t.files.length>0&&e.preventDefault()}),e.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:a,active:"text"==o.clipboard.pasteFormat}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:s.pasteFormat,onclick:a})})}),o([l,d,m,b,y])}(this);