!function(){function e(e){return e.replace(/\\'/g,"'")}function t(e){return e.replace(/'/g,"\\$&")}function a(e){for(var t,a=e.length,n=[],r=0;a>r;r++)t=e.charCodeAt(r),n.push(t);return"String.fromCharCode("+n.join(",")+")"}function n(e,a){var n,r,i,o=e.plugins.link,s=o.compiledProtectionFunction.name,l=o.compiledProtectionFunction.params;i=[s,"("];for(var c=0;c<l.length;c++)n=l[c].toLowerCase(),r=a[n],c>0&&i.push(","),i.push("'",r?t(encodeURIComponent(a[n])):"","'");return i.push(")"),i.join("")}function r(e){var t,a=e.config.emailProtection||"";return a&&"encode"!=a&&(t={},a.replace(/^([^(]+)\(([^)]+)\)$/,function(e,a,n){t.name=a,t.params=[],n.replace(/[^,\s]+/g,function(e){t.params.push(e)})})),t}CKEDITOR.plugins.add("SimpleLink",{onLoad:function(){function e(e){return n.replace(/%1/g,"rtl"==e?"right":"left").replace(/%2/g,"cke_contents_"+e)}var t=CKEDITOR.getUrl(this.path+"images"+(CKEDITOR.env.hidpi?"/hidpi":"")+"/anchor.png"),a="background:url("+t+") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",n=".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{"+a+"padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{"+a+"width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";CKEDITOR.addCss(e("ltr")+e("rtl"))},init:function(e){var t="a[!href]",a="a[href]";e.addCommand("simplelink",new CKEDITOR.dialogCommand("simplelinkDialog",{allowedContent:t,requiredContent:a})),e.ui.addButton("link",{label:"Add a link",icons:"link",command:"simplelink"}),e.setKeystroke(CKEDITOR.CTRL+76,"simplelink"),CKEDITOR.dialog.add("simplelinkDialog",function(e){return{allowedContent:"a[href,target]",title:"Web Address",minWidth:300,minHeight:100,resizable:CKEDITOR.DIALOG_RESIZE_NONE,contents:[{id:"SimpleLink",label:"SimpleLink",elements:[{type:"text",label:"URL",id:"edp-URL",validate:CKEDITOR.dialog.validate.notEmpty("url cannot be empty."),setup:function(e){var t=e.getAttribute("href"),a=/^(http|https):\/\//;t&&(a.test(t)||(t="http://"+t),this.setValue(t))},commit:function(e){var t=this.getValue(),a=/^(http|https):\/\//;t&&(a.test(t)||(t="http://"+t),e.setAttribute("href",t),e.getText()||e.setText(this.getValue()))}},{type:"text",label:"Text to display",id:"edp-text-display",setup:function(e){this.setValue(e.getText())},commit:function(e){var t=this.getValue();""!==t&&null!==t&&e.setText(t)}}]}],onShow:function(){var t,a=e.getSelection(),n=a.getStartElement();n&&(t=n.getAscendant("a",!0)),t&&"a"==t.getName()?this.insertMode=!1:(t=e.document.createElement("a"),t.setAttribute("target","_blank"),a&&t.setText(a.getSelectedText()),this.insertMode=!0),this.element=t,this.setupContent(this.element)},onLoad:function(){var e=this.parts.footer.$;e.querySelector("a.apply-bt>span").innerHTML="Add Link"},onOk:function(){this.element;this.commitContent(this.element),this.insertMode&&e.insertElement(this.element)}}}),this.compiledProtectionFunction=r(e)},afterInit:function(e){e.dataProcessor.dataFilter.addRules({elements:{a:function(t){return t.attributes.name?t.children.length?null:e.createFakeParserElement(t,"cke_anchor","anchor"):null}}});var t=e._.elementsPath&&e._.elementsPath.filters;t&&t.push(function(t,a){return"a"!=a||!CKEDITOR.plugins.link.tryRestoreFakeAnchor(e,t)&&(!t.getAttribute("name")||t.getAttribute("href")&&t.getChildCount())?void 0:"anchor"})}});var i=/^javascript:/,o=/^mailto:([^?]+)(?:\?(.+))?$/,s=/subject=([^;?:@&=$,\/]*)/,l=/body=([^;?:@&=$,\/]*)/,c=/^#(.*)$/,d=/^((?:http|https|ftp|news):\/\/)?(.*)$/,m=/^(_(?:self|top|parent|blank))$/,u=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,p=/^javascript:([^(]+)\(([^)]+)\)$/,h=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,g=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,f={id:"advId",dir:"advLangDir",accessKey:"advAccessKey",name:"advName",lang:"advLangCode",tabindex:"advTabIndex",title:"advTitle",type:"advContentType","class":"advCSSClasses",charset:"advCharset",style:"advStyles",rel:"advRel"};CKEDITOR.plugins.simplelink={getSelectedLink:function(e){var t=e.getSelection(),a=t.getSelectedElement();if(a&&a.is("a"))return a;var n=t.getRanges()[0];return n?(n.shrink(CKEDITOR.SHRINK_TEXT),e.elementPath(n.getCommonAncestor()).contains("a",1)):null},getEditorAnchors:function(e){for(var t,a=e.editable(),n=a.isInline()&&!e.plugins.divarea?e.document:a,r=n.getElementsByTag("a"),i=n.getElementsByTag("img"),o=[],s=0;t=r.getItem(s++);)(t.data("cke-saved-name")||t.hasAttribute("name"))&&o.push({name:t.data("cke-saved-name")||t.getAttribute("name"),id:t.getAttribute("id")});for(s=0;t=i.getItem(s++);)(t=this.tryRestoreFakeAnchor(e,t))&&o.push({name:t.getAttribute("name"),id:t.getAttribute("id")});return o},fakeAnchor:!0,tryRestoreFakeAnchor:function(e,t){if(t&&t.data("cke-real-element-type")&&"anchor"==t.data("cke-real-element-type")){var a=e.restoreRealElement(t);if(a.data("cke-saved-name"))return a}},parseLinkAttributes:function(t,a){var n,r,v,k,b=a&&(a.data("cke-saved-href")||a.getAttribute("href"))||"",C=t.plugins.link.compiledProtectionFunction,y=t.config.emailProtection,R={};if((n=b.match(i))&&("encode"==y?b=b.replace(u,function(t,a,n){return"mailto:"+String.fromCharCode.apply(String,a.split(","))+(n&&e(n))}):y&&b.replace(p,function(t,a,n){if(a==C.name){R.type="email";for(var r,i,o=R.email={},s=/[^,\s]+/g,l=/(^')|('$)/g,c=n.match(s),d=c.length,m=0;d>m;m++)i=decodeURIComponent(e(c[m].replace(l,""))),r=C.params[m].toLowerCase(),o[r]=i;o.address=[o.name,o.domain].join("@")}})),!R.type)if(v=b.match(c))R.type="anchor",R.anchor={},R.anchor.name=R.anchor.id=v[1];else if(r=b.match(o)){var T=b.match(s),E=b.match(l);R.type="email";var I=R.email={};I.address=r[1],T&&(I.subject=decodeURIComponent(T[1])),E&&(I.body=decodeURIComponent(E[1]))}else b&&(k=b.match(d))&&(R.type="url",R.url={},R.url.protocol=k[1],R.url.url=k[2]);if(a){var A=a.getAttribute("target");if(A)R.target={type:A.match(m)?A:"frame",name:A};else{var x=a.data("cke-pa-onclick")||a.getAttribute("onclick"),K=x&&x.match(h);if(K){R.target={type:"popup",name:K[1]};for(var S;S=g.exec(K[2]);)"yes"!=S[2]&&"1"!=S[2]||S[1]in{height:1,width:1,top:1,left:1}?isFinite(S[2])&&(R.target[S[1]]=S[2]):R.target[S[1]]=!0}}var D={};for(var O in f){var L=a.getAttribute(O);L&&(D[f[O]]=L)}var j=a.data("cke-saved-name")||D.advName;j&&(D.advName=j),CKEDITOR.tools.isEmpty(D)||(R.advanced=D)}return R},getLinkAttributes:function(e,r){var i=e.config.emailProtection||"",o={};switch(r.type){case"url":var s=r.url&&void 0!==r.url.protocol?r.url.protocol:"http://",l=r.url&&CKEDITOR.tools.trim(r.url.url)||"";o["data-cke-saved-href"]=0===l.indexOf("/")?l:s+l;break;case"anchor":var c=r.anchor&&r.anchor.name,d=r.anchor&&r.anchor.id;o["data-cke-saved-href"]="#"+(c||d||"");break;case"email":var m,u=r.email,p=u.address;switch(i){case"":case"encode":var h=encodeURIComponent(u.subject||""),g=encodeURIComponent(u.body||""),v=[];h&&v.push("subject="+h),g&&v.push("body="+g),v=v.length?"?"+v.join("&"):"","encode"==i?(m=["javascript:void(location.href='mailto:'+",a(p)],v&&m.push("+'",t(v),"'"),m.push(")")):m=["mailto:",p,v];break;default:var k=p.split("@",2);u.name=k[0],u.domain=k[1],m=["javascript:",n(e,u)]}o["data-cke-saved-href"]=m.join("")}if(r.target)if("popup"==r.target.type){for(var b=["window.open(this.href, '",r.target.name||"","', '"],C=["resizable","status","location","toolbar","menubar","fullscreen","scrollbars","dependent"],y=C.length,R=function(e){r.target[e]&&C.push(e+"="+r.target[e])},T=0;y>T;T++)C[T]=C[T]+(r.target[C[T]]?"=yes":"=no");R("width"),R("left"),R("height"),R("top"),b.push(C.join(","),"'); return false;"),o["data-cke-pa-onclick"]=b.join("")}else"notSet"!=r.target.type&&r.target.name&&(o.target=r.target.name);if(r.advanced){for(var E in f){var I=r.advanced[f[E]];I&&(o[E]=I)}o.name&&(o["data-cke-saved-name"]=o.name)}o["data-cke-saved-href"]&&(o.href=o["data-cke-saved-href"]);var A={target:1,onclick:1,"data-cke-pa-onclick":1,"data-cke-saved-name":1};r.advanced&&CKEDITOR.tools.extend(A,f);for(var x in o)delete A[x];return{set:o,removed:CKEDITOR.tools.objectKeys(A)}}}}();