!function(){var e=function(e){var a=jQuery,l={"zh-cn":{toolbar:{table:"表格"},dialog:{table:{title:"添加表格",cellsLabel:"单元格数",alignLabel:"对齐方式",rows:"行数",cols:"列数",aligns:["默认","左对齐","居中对齐","右对齐"]}}},"zh-tw":{toolbar:{table:"添加表格"},dialog:{table:{title:"添加表格",cellsLabel:"單元格數",alignLabel:"對齊方式",rows:"行數",cols:"列數",aligns:["默認","左對齊","居中對齊","右對齊"]}}},en:{toolbar:{table:"Tables"},dialog:{table:{title:"Tables",cellsLabel:"Cells",alignLabel:"Align",rows:"Rows",cols:"Cols",aligns:["Default","Left align","Center align","Right align"]}}}};e.fn.tableDialog=function(){var e,t=this.cm,i=this.editor,n=this.settings,o=(n.path,this.classPrefix),s=o+"table-dialog";a.extend(!0,this.lang,l[this.lang.name]),this.setToolbar();var r=this.lang,d=r.dialog.table,c=['<div class="editormd-form" style="padding: 13px 0;">',"<label>"+d.cellsLabel+"</label>",d.rows+' <input type="number" value="3" class="number-input" style="width:40px;" max="100" min="2" data-rows />&nbsp;&nbsp;',d.cols+' <input type="number" value="2" class="number-input" style="width:40px;" max="100" min="1" data-cols /><br/>',"<label>"+d.alignLabel+"</label>",'<div class="fa-btns"></div>',"</div>"].join("\n");i.find("."+s).length>0?(e=i.find("."+s),this.dialogShowMask(e),this.dialogLockScreen(),e.show()):e=this.createDialog({name:s,title:d.title,width:360,height:226,mask:n.dialogShowMask,drag:n.dialogDraggable,content:c,lockScreen:n.dialogLockScreen,maskStyle:{opacity:n.dialogMaskOpacity,backgroundColor:n.dialogMaskBgColor},buttons:{enter:[r.buttons.enter,function(){var e=parseInt(this.find("[data-rows]").val()),a=parseInt(this.find("[data-cols]").val()),l=this.find('[name="table-align"]:checked').val(),i="",n="------------",o={_default:n,left:":"+n,center:":"+n+":",right:n+":"};if(e>1&&a>0)for(var s=0,r=e;s<r;s++){for(var d=[],c=[],g=0,b=a;g<b;g++)1===s&&c.push(o[l]),d.push(" ");1===s&&(i+="| "+c.join(" | ")+" |\n"),i+="| "+d.join(1===a?"":" | ")+" |\n"}return t.replaceSelection(i),this.hide().lockScreen(!1).hideMask(),!1}],cancel:[r.buttons.cancel,function(){return this.hide().lockScreen(!1).hideMask(),!1}]}});var g=e.find(".fa-btns");if(""===g.html())for(var b=["align-justify","align-left","align-center","align-right"],f=d.aligns,h=["_default","left","center","right"],u=0,p=b.length;u<p;u++){var m=0===u?' checked="checked"':"",v='<a href="javascript:;"><label for="editormd-table-dialog-radio'+u+'" title="'+f[u]+'">';v+='<input type="radio" name="table-align" id="editormd-table-dialog-radio'+u+'" value="'+h[u]+'"'+m+" />&nbsp;",v+='<i class="fa fa-'+b[u]+'"></i>',v+="</label></a>",g.append(v)}}};"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?module.exports=e:"function"==typeof define?define.amd?define(["editormd"],function(a){e(a)}):define(function(a){var l=a("./../../editormd");e(l)}):e(window.editormd)}();