!function(){var e=function(e){var t=jQuery,i="html-entities-dialog",o=[],n=[];e.fn.htmlEntitiesDialog=function(){var a,l=this,d=this.cm,s=l.lang,r=l.settings,c=r.pluginPath+i+"/",h=this.editor,g=(d.getCursor(),d.getSelection(),l.classPrefix),f=g+"dialog-"+i,u=s.dialog.htmlEntities,m=['<div class="'+g+'html-entities-box" style="width: 760px;height: 334px;margin-bottom: 8px;overflow: hidden;overflow-y: auto;">','<div class="'+g+'grid-table">',"</div>","</div>"].join("\r\n");d.focus(),h.find("."+f).length>0?(a=h.find("."+f),o=[],a.find("a").removeClass("selected"),this.dialogShowMask(a),this.dialogLockScreen(),a.show()):a=this.createDialog({name:f,title:u.title,width:800,height:475,mask:r.dialogShowMask,drag:r.dialogDraggable,content:m,lockScreen:r.dialogLockScreen,maskStyle:{opacity:r.dialogMaskOpacity,backgroundColor:r.dialogMaskBgColor},buttons:{enter:[s.buttons.enter,function(){return d.replaceSelection(o.join(" ")),this.hide().lockScreen(!1).hideMask(),!1}],cancel:[s.buttons.cancel,function(){return this.hide().lockScreen(!1).hideMask(),!1}]}});var v=a.find("."+g+"grid-table"),p=function(){if(!(n.length<1)){var i=Math.ceil(n.length/20);v.html("");for(var l=0;l<i;l++){for(var d='<div class="'+g+'grid-table-row">',s=0;s<20;s++){var r=n[20*l+s];if(void 0!==r){var c=r.name.replace("&amp;","&");d+='<a href="javascript:;" value="'+r.name+'" title="'+c+'" class="'+g+'html-entity-btn">'+c+"</a>"}}d+="</div>",v.append(d)}a.find("."+g+"html-entity-btn").bind(e.mouseOrTouch("click","touchend"),function(){t(this).toggleClass("selected"),t(this).hasClass("selected")&&o.push(t(this).attr("value"))})}};n.length<1?("function"==typeof a.loading&&a.loading(!0),t.getJSON(c+i.replace("-dialog","")+".json",function(e){"function"==typeof a.loading&&a.loading(!1),n=e,p()})):p()}};"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?module.exports=e:"function"==typeof define?define.amd?define(["editormd"],function(t){e(t)}):define(function(t){var i=t("./../../editormd");e(i)}):e(window.editormd)}();