'),this.$placeholder.on("click",function(){t.context.invoke("focus")}).html(this.options.placeholder).prependTo(this.$editingArea),this.update()},t.prototype.destroy=function(){this.$placeholder.remove()},t.prototype.update=function(){var t=!this.context.invoke("codeview.isActivated")&&this.context.invoke("editor.isEmpty");this.$placeholder.toggle(t)},t}(),te=function(){function t(t){this.ui=C.summernote.ui,this.context=t,this.$toolbar=t.layoutInfo.toolbar,this.options=t.options,this.lang=this.options.langInfo,this.invertedKeyMap=A.invertObject(this.options.keyMap[R.isMac?"mac":"pc"])}return t.prototype.representShortcut=function(t){var e=this.invertedKeyMap[t];return this.options.shortcuts&&e?(R.isMac&&(e=e.replace("CMD","⌘").replace("SHIFT","⇧"))," ("+(e=e.replace("BACKSLASH","\\").replace("SLASH","/").replace("LEFTBRACKET","[").replace("RIGHTBRACKET","]"))+")"):""},t.prototype.button=function(t){return!this.options.tooltip&&t.tooltip&&delete t.tooltip,t.container=this.options.container,this.ui.button(t)},t.prototype.initialize=function(){this.addToolbarButtons(),this.addImagePopoverButtons(),this.addLinkPopoverButtons(),this.addTablePopoverButtons(),this.fontInstalledMap={}},t.prototype.destroy=function(){delete this.fontInstalledMap},t.prototype.isFontInstalled=function(t){return this.fontInstalledMap.hasOwnProperty(t)||(this.fontInstalledMap[t]=R.isFontInstalled(t)||B.contains(this.options.fontNamesIgnoreCheck,t)),this.fontInstalledMap[t]},t.prototype.isFontDeservedToAdd=function(t){return""!==(t=t.toLowerCase())&&this.isFontInstalled(t)&&-1===["sans-serif","serif","monospace","cursive","fantasy"].indexOf(t)},t.prototype.colorPalette=function(h,t,o,n){var p=this;return this.ui.buttonGroup({className:"note-color "+h,children:[this.button({className:"note-current-color-button",contents:this.ui.icon(this.options.icons.font+" note-recent-color"),tooltip:t,click:function(t){var e=C(t.currentTarget);o&&n?p.context.invoke("editor.color",{backColor:e.attr("data-backColor"),foreColor:e.attr("data-foreColor")}):o?p.context.invoke("editor.color",{backColor:e.attr("data-backColor")}):n&&p.context.invoke("editor.color",{foreColor:e.attr("data-foreColor")})},callback:function(t){var e=t.find(".note-recent-color");o&&(e.css("background-color",p.options.colorButton.backColor),t.attr("data-backColor",p.options.colorButton.backColor)),n?(e.css("color",p.options.colorButton.foreColor),t.attr("data-foreColor",p.options.colorButton.foreColor)):e.css("color","transparent")}}),this.button({className:"dropdown-toggle",contents:this.ui.dropdownButtonContents("",this.options),tooltip:this.lang.color.more,data:{toggle:"dropdown"}}),this.ui.dropdown({items:(o?['
','
'+this.lang.color.background+"
","
",' ","
",'
',"
",' ",' ',"
",'
',"
"].join(""):"")+(n?['
','
'+this.lang.color.foreground+"
","
",' ","
",'
',"
",'
",'
','
',"
"].join(""):""),callback:function(o){o.find(".note-holder").each(function(t,e){var o=C(e);o.append(p.ui.palette({colors:p.options.colors,colorsName:p.options.colorsName,eventName:o.data("event"),container:p.options.container,tooltip:p.options.tooltip}).render())});var n=[["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF"]];o.find(".note-holder-custom").each(function(t,e){var o=C(e);o.append(p.ui.palette({colors:n,colorsName:n,eventName:o.data("event"),container:p.options.container,tooltip:p.options.tooltip}).render())}),o.find("input[type=color]").each(function(t,e){C(e).change(function(){var t=o.find("#"+C(this).data("event")).find(".note-color-btn").first(),e=this.value.toUpperCase();t.css("background-color",e).attr("aria-label",e).attr("data-value",e).attr("data-original-title",e),t.click()})})},click:function(t){t.stopPropagation();var e=C("."+h),o=C(t.target),n=o.data("event"),i=o.attr("data-value");if("openPalette"===n){var r=e.find("#"+i),s=C(e.find("#"+r.data("event")).find(".note-color-row")[0]),a=s.find(".note-color-btn").last().detach(),l=r.val();a.css("background-color",l).attr("aria-label",l).attr("data-value",l).attr("data-original-title",l),s.prepend(a),r.click()}else if(B.contains(["backColor","foreColor"],n)){var c="backColor"===n?"background-color":"color",d=o.closest(".note-color").find(".note-recent-color"),u=o.closest(".note-color").find(".note-current-color-button");d.css(c,i),u.attr("data-"+n,i),p.context.invoke("editor."+n,i)}}})]}).render()},t.prototype.addToolbarButtons=function(){var n=this;this.context.memo("button.style",function(){return n.ui.buttonGroup([n.button({className:"dropdown-toggle",contents:n.ui.dropdownButtonContents(n.ui.icon(n.options.icons.magic),n.options),tooltip:n.lang.style.style,data:{toggle:"dropdown"}}),n.ui.dropdown({className:"dropdown-style",items:n.options.styleTags,title:n.lang.style.style,template:function(t){"string"==typeof t&&(t={tag:t,title:n.lang.style.hasOwnProperty(t)?n.lang.style[t]:t});var e=t.tag,o=t.title;return"<"+e+(t.style?' style="'+t.style+'" ':"")+(t.className?' class="'+t.className+'"':"")+">"+o+""+e+">"},click:n.context.createInvokeHandler("editor.formatBlock")})]).render()});for(var t=function(t,e){var o=i.options.styleTags[t];i.context.memo("button.style."+o,function(){return n.button({className:"note-btn-style-"+o,contents:'
'+o.toUpperCase()+"
",tooltip:n.lang.style[o],click:n.context.createInvokeHandler("editor.formatBlock")}).render()})},i=this,e=0,o=this.options.styleTags.length;e
',n.options),tooltip:n.lang.font.name,data:{toggle:"dropdown"}}),n.ui.dropdownCheck({className:"dropdown-fontname",checkClassName:n.options.icons.menuCheck,items:n.options.fontNames.filter(n.isFontInstalled.bind(n)),title:n.lang.font.name,template:function(t){return"
"+t+""},click:n.context.createInvokeHandlerAndUpdateState("editor.fontName")})]).render()}),this.context.memo("button.fontsize",function(){return n.ui.buttonGroup([n.button({className:"dropdown-toggle",contents:n.ui.dropdownButtonContents('
',n.options),tooltip:n.lang.font.size,data:{toggle:"dropdown"}}),n.ui.dropdownCheck({className:"dropdown-fontsize",checkClassName:n.options.icons.menuCheck,items:n.options.fontSizes,title:n.lang.font.size,click:n.context.createInvokeHandlerAndUpdateState("editor.fontSize")})]).render()}),this.context.memo("button.color",function(){return n.colorPalette("note-color-all",n.lang.color.recent,!0,!0)}),this.context.memo("button.forecolor",function(){return n.colorPalette("note-color-fore",n.lang.color.foreground,!1,!0)}),this.context.memo("button.backcolor",function(){return n.colorPalette("note-color-back",n.lang.color.background,!0,!1)}),this.context.memo("button.ul",function(){return n.button({contents:n.ui.icon(n.options.icons.unorderedlist),tooltip:n.lang.lists.unordered+n.representShortcut("insertUnorderedList"),click:n.context.createInvokeHandler("editor.insertUnorderedList")}).render()}),this.context.memo("button.ol",function(){return n.button({contents:n.ui.icon(n.options.icons.orderedlist),tooltip:n.lang.lists.ordered+n.representShortcut("insertOrderedList"),click:n.context.createInvokeHandler("editor.insertOrderedList")}).render()});var r=this.button({contents:this.ui.icon(this.options.icons.alignLeft),tooltip:this.lang.paragraph.left+this.representShortcut("justifyLeft"),click:this.context.createInvokeHandler("editor.justifyLeft")}),s=this.button({contents:this.ui.icon(this.options.icons.alignCenter),tooltip:this.lang.paragraph.center+this.representShortcut("justifyCenter"),click:this.context.createInvokeHandler("editor.justifyCenter")}),a=this.button({contents:this.ui.icon(this.options.icons.alignRight),tooltip:this.lang.paragraph.right+this.representShortcut("justifyRight"),click:this.context.createInvokeHandler("editor.justifyRight")}),l=this.button({contents:this.ui.icon(this.options.icons.alignJustify),tooltip:this.lang.paragraph.justify+this.representShortcut("justifyFull"),click:this.context.createInvokeHandler("editor.justifyFull")}),c=this.button({contents:this.ui.icon(this.options.icons.outdent),tooltip:this.lang.paragraph.outdent+this.representShortcut("outdent"),click:this.context.createInvokeHandler("editor.outdent")}),d=this.button({contents:this.ui.icon(this.options.icons.indent),tooltip:this.lang.paragraph.indent+this.representShortcut("indent"),click:this.context.createInvokeHandler("editor.indent")});this.context.memo("button.justifyLeft",A.invoke(r,"render")),this.context.memo("button.justifyCenter",A.invoke(s,"render")),this.context.memo("button.justifyRight",A.invoke(a,"render")),this.context.memo("button.justifyFull",A.invoke(l,"render")),this.context.memo("button.outdent",A.invoke(c,"render")),this.context.memo("button.indent",A.invoke(d,"render")),this.context.memo("button.paragraph",function(){return n.ui.buttonGroup([n.button({className:"dropdown-toggle",contents:n.ui.dropdownButtonContents(n.ui.icon(n.options.icons.alignLeft),n.options),tooltip:n.lang.paragraph.paragraph,data:{toggle:"dropdown"}}),n.ui.dropdown([n.ui.buttonGroup({className:"note-align",children:[r,s,a,l]}),n.ui.buttonGroup({className:"note-list",children:[c,d]})])]).render()}),this.context.memo("button.height",function(){return n.ui.buttonGroup([n.button({className:"dropdown-toggle",contents:n.ui.dropdownButtonContents(n.ui.icon(n.options.icons.textHeight),n.options),tooltip:n.lang.font.height,data:{toggle:"dropdown"}}),n.ui.dropdownCheck({items:n.options.lineHeights,checkClassName:n.options.icons.menuCheck,className:"dropdown-line-height",title:n.lang.font.height,click:n.context.createInvokeHandler("editor.lineHeight")})]).render()}),this.context.memo("button.table",function(){return n.ui.buttonGroup([n.button({className:"dropdown-toggle",contents:n.ui.dropdownButtonContents(n.ui.icon(n.options.icons.table),n.options),tooltip:n.lang.table.table,data:{toggle:"dropdown"}}),n.ui.dropdown({title:n.lang.table.table,className:"note-table",items:['
",'
1 x 1
'].join("")})],{callback:function(t){t.find(".note-dimension-picker-mousecatcher").css({width:n.options.insertTableMaxSize.col+"em",height:n.options.insertTableMaxSize.row+"em"}).mousedown(n.context.createInvokeHandler("editor.insertTable")).on("mousemove",n.tableMoveHandler.bind(n))}}).render()}),this.context.memo("button.link",function(){return n.button({contents:n.ui.icon(n.options.icons.link),tooltip:n.lang.link.link+n.representShortcut("linkDialog.show"),click:n.context.createInvokeHandler("linkDialog.show")}).render()}),this.context.memo("button.picture",function(){return n.button({contents:n.ui.icon(n.options.icons.picture),tooltip:n.lang.image.image,click:n.context.createInvokeHandler("imageDialog.show")}).render()}),this.context.memo("button.video",function(){return n.button({contents:n.ui.icon(n.options.icons.video),tooltip:n.lang.video.video,click:n.context.createInvokeHandler("videoDialog.show")}).render()}),this.context.memo("button.hr",function(){return n.button({contents:n.ui.icon(n.options.icons.minus),tooltip:n.lang.hr.insert+n.representShortcut("insertHorizontalRule"),click:n.context.createInvokeHandler("editor.insertHorizontalRule")}).render()}),this.context.memo("button.fullscreen",function(){return n.button({className:"btn-fullscreen",contents:n.ui.icon(n.options.icons.arrowsAlt),tooltip:n.lang.options.fullscreen,click:n.context.createInvokeHandler("fullscreen.toggle")}).render()}),this.context.memo("button.codeview",function(){return n.button({className:"btn-codeview",contents:n.ui.icon(n.options.icons.code),tooltip:n.lang.options.codeview,click:n.context.createInvokeHandler("codeview.toggle")}).render()}),this.context.memo("button.redo",function(){return n.button({contents:n.ui.icon(n.options.icons.redo),tooltip:n.lang.history.redo+n.representShortcut("redo"),click:n.context.createInvokeHandler("editor.redo")}).render()}),this.context.memo("button.undo",function(){return n.button({contents:n.ui.icon(n.options.icons.undo),tooltip:n.lang.history.undo+n.representShortcut("undo"),click:n.context.createInvokeHandler("editor.undo")}).render()}),this.context.memo("button.help",function(){return n.button({contents:n.ui.icon(n.options.icons.question),tooltip:n.lang.options.help,click:n.context.createInvokeHandler("helpDialog.show")}).render()})},t.prototype.addImagePopoverButtons=function(){var t=this;this.context.memo("button.resizeFull",function(){return t.button({contents:'
100%',tooltip:t.lang.image.resizeFull,click:t.context.createInvokeHandler("editor.resize","1")}).render()}),this.context.memo("button.resizeHalf",function(){return t.button({contents:'
50%',tooltip:t.lang.image.resizeHalf,click:t.context.createInvokeHandler("editor.resize","0.5")}).render()}),this.context.memo("button.resizeQuarter",function(){return t.button({contents:'
25%',tooltip:t.lang.image.resizeQuarter,click:t.context.createInvokeHandler("editor.resize","0.25")}).render()}),this.context.memo("button.resizeNone",function(){return t.button({contents:t.ui.icon(t.options.icons.rollback),tooltip:t.lang.image.resizeNone,click:t.context.createInvokeHandler("editor.resize","0")}).render()}),this.context.memo("button.floatLeft",function(){return t.button({contents:t.ui.icon(t.options.icons.floatLeft),tooltip:t.lang.image.floatLeft,click:t.context.createInvokeHandler("editor.floatMe","left")}).render()}),this.context.memo("button.floatRight",function(){return t.button({contents:t.ui.icon(t.options.icons.floatRight),tooltip:t.lang.image.floatRight,click:t.context.createInvokeHandler("editor.floatMe","right")}).render()}),this.context.memo("button.floatNone",function(){return t.button({contents:t.ui.icon(t.options.icons.rollback),tooltip:t.lang.image.floatNone,click:t.context.createInvokeHandler("editor.floatMe","none")}).render()}),this.context.memo("button.removeMedia",function(){return t.button({contents:t.ui.icon(t.options.icons.trash),tooltip:t.lang.image.remove,click:t.context.createInvokeHandler("editor.removeMedia")}).render()})},t.prototype.addLinkPopoverButtons=function(){var t=this;this.context.memo("button.linkDialogShow",function(){return t.button({contents:t.ui.icon(t.options.icons.link),tooltip:t.lang.link.edit,click:t.context.createInvokeHandler("linkDialog.show")}).render()}),this.context.memo("button.unlink",function(){return t.button({contents:t.ui.icon(t.options.icons.unlink),tooltip:t.lang.link.unlink,click:t.context.createInvokeHandler("editor.unlink")}).render()})},t.prototype.addTablePopoverButtons=function(){var t=this;this.context.memo("button.addRowUp",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowAbove),tooltip:t.lang.table.addRowAbove,click:t.context.createInvokeHandler("editor.addRow","top")}).render()}),this.context.memo("button.addRowDown",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowBelow),tooltip:t.lang.table.addRowBelow,click:t.context.createInvokeHandler("editor.addRow","bottom")}).render()}),this.context.memo("button.addColLeft",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colBefore),tooltip:t.lang.table.addColLeft,click:t.context.createInvokeHandler("editor.addCol","left")}).render()}),this.context.memo("button.addColRight",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colAfter),tooltip:t.lang.table.addColRight,click:t.context.createInvokeHandler("editor.addCol","right")}).render()}),this.context.memo("button.deleteRow",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowRemove),tooltip:t.lang.table.delRow,click:t.context.createInvokeHandler("editor.deleteRow")}).render()}),this.context.memo("button.deleteCol",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colRemove),tooltip:t.lang.table.delCol,click:t.context.createInvokeHandler("editor.deleteCol")}).render()}),this.context.memo("button.deleteTable",function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.trash),tooltip:t.lang.table.delTable,click:t.context.createInvokeHandler("editor.deleteTable")}).render()})},t.prototype.build=function(t,e){for(var o=0,n=e.length;o
','",'',"",'
','",'',"
",this.options.disableLinkTarget?"":C("
").append(this.ui.checkbox({className:"sn-checkbox-open-in-new-window",text:this.lang.link.openInNewWindow,checked:!0}).render()).html()].join(""),o='
';this.$dialog=this.ui.dialog({className:"link-dialog",title:this.lang.link.insert,fade:this.options.dialogsFade,body:e,footer:o}).render().appendTo(t)},t.prototype.destroy=function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()},t.prototype.bindEnterKey=function(t,e){t.on("keypress",function(t){t.keyCode===Pt.code.ENTER&&(t.preventDefault(),e.trigger("click"))})},t.prototype.toggleLinkBtn=function(t,e,o){this.ui.toggleBtn(t,e.val()&&o.val())},t.prototype.showLinkDialog=function(s){var a=this;return C.Deferred(function(e){var o=a.$dialog.find(".note-link-text"),n=a.$dialog.find(".note-link-url"),i=a.$dialog.find(".note-link-btn"),r=a.$dialog.find(".sn-checkbox-open-in-new-window input[type=checkbox]");a.ui.onDialogShown(a.$dialog,function(){a.context.triggerEvent("dialog.shown"),!s.url&&A.isValidUrl(s.text)&&(s.url=s.text),o.on("input paste propertychange",function(){s.text=o.val(),a.toggleLinkBtn(i,o,n)}).val(s.text),n.on("input paste propertychange",function(){s.text||o.val(n.val()),a.toggleLinkBtn(i,o,n)}).val(s.url),R.isSupportTouch||n.trigger("focus"),a.toggleLinkBtn(i,o,n),a.bindEnterKey(n,i),a.bindEnterKey(o,i);var t=void 0!==s.isNewWindow?s.isNewWindow:a.context.options.linkTargetBlank;r.prop("checked",t),i.one("click",function(t){t.preventDefault(),e.resolve({range:s.range,url:n.val(),text:o.val(),isNewWindow:r.is(":checked")}),a.ui.hideDialog(a.$dialog)})}),a.ui.onDialogHidden(a.$dialog,function(){o.off(),n.off(),i.off(),"pending"===e.state()&&e.reject()}),a.ui.showDialog(a.$dialog)}).promise()},t.prototype.show=function(){var e=this,t=this.context.invoke("editor.getLinkInfo");this.context.invoke("editor.saveRange"),this.showLinkDialog(t).then(function(t){e.context.invoke("editor.restoreRange"),e.context.invoke("editor.createLink",t)}).fail(function(){e.context.invoke("editor.restoreRange")})},t}(),ne=function(){function t(t){var e=this;this.context=t,this.ui=C.summernote.ui,this.options=t.options,this.events={"summernote.keyup summernote.mouseup summernote.change summernote.scroll":function(){e.update()},"summernote.disable summernote.dialog.shown":function(){e.hide()}}}return t.prototype.shouldInitialize=function(){return!B.isEmpty(this.options.popover.link)},t.prototype.initialize=function(){this.$popover=this.ui.popover({className:"note-link-popover",callback:function(t){t.find(".popover-content,.note-popover-content").prepend('
')}}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.link)},t.prototype.destroy=function(){this.$popover.remove()},t.prototype.update=function(){if(this.context.invoke("editor.hasFocus")){var t=this.context.invoke("editor.getLastRange");if(t.isCollapsed()&&t.isOnAnchor()){var e=$t.ancestor(t.sc,$t.isAnchor),o=C(e).attr("href");this.$popover.find("a").attr("href",o).html(o);var n=$t.posFromPlaceholder(e);this.$popover.css({display:"block",left:n.left,top:n.top})}else this.hide()}else this.hide()},t.prototype.hide=function(){this.$popover.hide()},t}(),ie=function(){function t(t){this.context=t,this.ui=C.summernote.ui,this.$body=C(document.body),this.$editor=t.layoutInfo.editor,this.options=t.options,this.lang=this.options.langInfo}return t.prototype.initialize=function(){var t=this.options.dialogsInBody?this.$body:this.$editor,e="";if(this.options.maximumImageFileSize){var o=Math.floor(Math.log(this.options.maximumImageFileSize)/Math.log(1024)),n=1*(this.options.maximumImageFileSize/Math.pow(1024,o)).toFixed(2)+" "+" KMGTP"[o]+"B";e="
"+this.lang.image.maximumFileSize+" : "+n+""}var i=['
','",'',e,"
",'
','",'',"
"].join(""),r='
';this.$dialog=this.ui.dialog({title:this.lang.image.insert,fade:this.options.dialogsFade,body:i,footer:r}).render().appendTo(t)},t.prototype.destroy=function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()},t.prototype.bindEnterKey=function(t,e){t.on("keypress",function(t){t.keyCode===Pt.code.ENTER&&(t.preventDefault(),e.trigger("click"))})},t.prototype.show=function(){var e=this;this.context.invoke("editor.saveRange"),this.showImageDialog().then(function(t){e.ui.hideDialog(e.$dialog),e.context.invoke("editor.restoreRange"),"string"==typeof t?e.options.callbacks.onImageLinkInsert?e.context.triggerEvent("image.link.insert",t):e.context.invoke("editor.insertImage",t):e.context.invoke("editor.insertImagesOrCallback",t)}).fail(function(){e.context.invoke("editor.restoreRange")})},t.prototype.showImageDialog=function(){var i=this;return C.Deferred(function(e){var t=i.$dialog.find(".note-image-input"),o=i.$dialog.find(".note-image-url"),n=i.$dialog.find(".note-image-btn");i.ui.onDialogShown(i.$dialog,function(){i.context.triggerEvent("dialog.shown"),t.replaceWith(t.clone().on("change",function(t){e.resolve(t.target.files||t.target.value)}).val("")),o.on("input paste propertychange",function(){i.ui.toggleBtn(n,o.val())}).val(""),R.isSupportTouch||o.trigger("focus"),n.click(function(t){t.preventDefault(),e.resolve(o.val())}),i.bindEnterKey(o,n)}),i.ui.onDialogHidden(i.$dialog,function(){t.off(),o.off(),n.off(),"pending"===e.state()&&e.reject()}),i.ui.showDialog(i.$dialog)})},t}(),re=function(){function t(t){var e=this;this.context=t,this.ui=C.summernote.ui,this.editable=t.layoutInfo.editable[0],this.options=t.options,this.events={"summernote.disable":function(){e.hide()}}}return t.prototype.shouldInitialize=function(){return!B.isEmpty(this.options.popover.image)},t.prototype.initialize=function(){this.$popover=this.ui.popover({className:"note-image-popover"}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.image)},t.prototype.destroy=function(){this.$popover.remove()},t.prototype.update=function(t,e){if($t.isImg(t)){var o=$t.posFromPlaceholder(t),n=$t.posFromPlaceholder(this.editable);this.$popover.css({display:"block",left:this.options.popatmouse?e.pageX-20:o.left,top:this.options.popatmouse?e.pageY:Math.min(o.top,n.top)})}else this.hide()},t.prototype.hide=function(){this.$popover.hide()},t}(),se=function(){function t(t){var o=this;this.context=t,this.ui=C.summernote.ui,this.options=t.options,this.events={"summernote.mousedown":function(t,e){o.update(e.target)},"summernote.keyup summernote.scroll summernote.change":function(){o.update()},"summernote.disable":function(){o.hide()}}}return t.prototype.shouldInitialize=function(){return!B.isEmpty(this.options.popover.table)},t.prototype.initialize=function(){this.$popover=this.ui.popover({className:"note-table-popover"}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.table),R.isFF&&document.execCommand("enableInlineTableEditing",!1,!1)},t.prototype.destroy=function(){this.$popover.remove()},t.prototype.update=function(t){if(this.context.isDisabled())return!1;var e=$t.isCell(t);if(e){var o=$t.posFromPlaceholder(t);this.$popover.css({display:"block",left:o.left,top:o.top})}else this.hide();return e},t.prototype.hide=function(){this.$popover.hide()},t}(),ae=function(){function t(t){this.context=t,this.ui=C.summernote.ui,this.$body=C(document.body),this.$editor=t.layoutInfo.editor,this.options=t.options,this.lang=this.options.langInfo}return t.prototype.initialize=function(){var t=this.options.dialogsInBody?this.$body:this.$editor,e=['
','",'',"
"].join(""),o='
';this.$dialog=this.ui.dialog({title:this.lang.video.insert,fade:this.options.dialogsFade,body:e,footer:o}).render().appendTo(t)},t.prototype.destroy=function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()},t.prototype.bindEnterKey=function(t,e){t.on("keypress",function(t){t.keyCode===Pt.code.ENTER&&(t.preventDefault(),e.trigger("click"))})},t.prototype.createVideoNode=function(t){var e,o=t.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?$/),n=t.match(/(?:www\.|\/\/)instagram\.com\/p\/(.[a-zA-Z0-9_-]*)/),i=t.match(/\/\/vine\.co\/v\/([a-zA-Z0-9]+)/),r=t.match(/\/\/(player\.)?vimeo\.com\/([a-z]*\/)*(\d+)[?]?.*/),s=t.match(/.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/),a=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),l=t.match(/\/\/v\.qq\.com.*?vid=(.+)/),c=t.match(/\/\/v\.qq\.com\/x?\/?(page|cover).*?\/([^\/]+)\.html\??.*/),d=t.match(/^.+.(mp4|m4v)$/),u=t.match(/^.+.(ogg|ogv)$/),h=t.match(/^.+.(webm)$/),p=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/);if(o&&11===o[1].length){var f=o[1],m=0;if(void 0!==o[2]){var g=o[2].match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);if(g)for(var v=[3600,60,1],b=0,y=v.length;b
").attr("frameborder",0).attr("src","//www.youtube.com/embed/"+f+(0").attr("frameborder",0).attr("src","https://instagram.com/p/"+n[1]+"/embed/").attr("width","612").attr("height","710").attr("scrolling","no").attr("allowtransparency","true");else if(i&&i[0].length)e=C("