NEW_CKEDITOR.plugins.add("autolink",{requires:"clipboard,textmatch,link",isSupportedEnvironment:function(){return!NEW_CKEDITOR.env.ie||NEW_CKEDITOR.env.edge},init:function(t){function e(e){e=NEW_CKEDITOR.tools.htmlDecodeAttr(e);var n=new NEW_CKEDITOR.dom.element("a"),a=(a=e.replace(/"/g,"%22")).match(t.config.autolink_urlRegex)?a:"mailto:"+a;return n.setText(e),n.setAttribute("href",a),e=NEW_CKEDITOR.plugins.link.parseLinkAttributes(t,n),e=NEW_CKEDITOR.plugins.link.getLinkAttributes(t,e),NEW_CKEDITOR.tools.isEmpty(e.set)||n.setAttributes(e.set),e.removed.length&&n.removeAttributes(e.removed),n.removeAttribute("data-edi-saved-href"),n.getOuterHtml()}function n(t,e){var n=t.slice(0,e).split(/\s+/);return(n=n[n.length-1])&&a(n)?{start:t.lastIndexOf(n),end:e}:null}function a(e){return e.match(t.config.autolink_urlRegex)||e.match(t.config.autolink_emailRegex)}this.isSupportedEnvironment()&&(t.on("paste",(function(n){if(n.data.dataTransfer.getTransferType(t)!=NEW_CKEDITOR.DATA_TRANSFER_INTERNAL){var i=n.data.dataValue;-1<i.indexOf("<")||!a(i)||(n.data.dataValue=e(i),n.data.type="html")}})),t.on("key",(function(a){if("wysiwyg"===t.mode&&-1!=NEW_CKEDITOR.tools.indexOf(t.config.autolink_commitKeystrokes,a.data.keyCode)&&(i=NEW_CKEDITOR.plugins.textMatch.match(t.getSelection().getRanges()[0],n))&&!(a=t.getSelection()).getRanges()[0].startContainer.getAscendant("a",!0)&&(a.selectRanges([i.range]),t.insertHtml(e(i.text),"text"),!NEW_CKEDITOR.env.webkit)){var i=a.getRanges()[0],r=t.createRange();r.setStartAfter(i.startContainer),a.selectRanges([r])}})))}}),NEW_CKEDITOR.config.autolink_commitKeystrokes=[13,32],NEW_CKEDITOR.config.autolink_urlRegex=/^(https?|ftp):\/\/(-\.)?([^\s\/?\.#]\.?)+(\/[^\s]*)?[^\s\.,]$/i,NEW_CKEDITOR.config.autolink_emailRegex=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;