!function(e, t) { "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : e.wangEditor = t() }(this, function() { "use strict"; function e(e) { var t = void 0; return t = document.createElement("div"), t.innerHTML = e, t.children } function t(e) { return !!e && (e instanceof HTMLCollection || e instanceof NodeList) } function n(e) { var n = document.querySelectorAll(e); return t(n) ? n : [n] } function i(o) { if (o) { if (o instanceof i) return o; this.selector = o; var A = o.nodeType , r = []; 9 === A ? r = [o] : 1 === A ? r = [o] : t(o) || o instanceof Array ? r = o : "string" == typeof o && (o = o.replace("/\n/mg", "").trim(), r = 0 === o.indexOf("<") ? e(o) : n(o)); var c = r.length; if (!c) return this; var a = void 0; for (a = 0; a < c; a++) this[a] = r[a]; this.length = c } } function o(e) { return new i(e) } function A(e, t) { var n = void 0; for (n in e) if (e.hasOwnProperty(n) && !1 === t.call(e, n, e[n])) break } function r(e, t) { var n = void 0 , i = void 0 , o = e.length || 0; for (n = 0; n < o && (i = e[n], !1 !== t.call(e, i, n)); n++) ; } function c(e) { return e + Math.random().toString().slice(2) } function a(e) { return null == e ? "" : e.replace(//gm, ">").replace(/"/gm, """) } function s(e) { return "function" == typeof e } function l(e) { this.editor = e, this.$elem = o('
'), this.type = "click", this._active = !1 } function d(e, t) { var n = this , i = e.editor; this.menu = e, this.opt = t; var A = o('') , r = t.$title , c = void 0; r && (c = r.html(), c = O(i, c), r.html(c), r.addClass("w-e-dp-title"), A.append(r)); var a = t.list || [] , s = t.type || "list" , l = t.onClick || $ , d = o('设置标题
"), type: "list", list: [{ $elem: o("正文
"), value: "" }], onClick: function(e) { t._command(e) } }) } function h(e) { var t = this; this.editor = e, this.$elem = o('
'), this.type = "droplist", this._active = !1, this.droplist = new d(this,{ width: 160, $title: o("字号
"), type: "list", list: [{ $elem: o('x-small'), value: "1" }, { $elem: o('small'), value: "2" }, { $elem: o("normal"), value: "3" }, { $elem: o('large'), value: "4" }, { $elem: o('x-large'), value: "5" }, { $elem: o('xx-large'), value: "6" }], onClick: function(e) { t._command(e) } }) } function p(e) { var t = this; this.editor = e, this.$elem = o(' '), this.type = "droplist", this._active = !1; var n = e.config , i = n.fontNames || []; this.droplist = new d(this,{ width: 100, $title: o("字体
"), type: "list", list: i.map(function(e) { return { $elem: o('' + e + ""), value: e } }), onClick: function(e) { t._command(e) } }) } function f(e, t) { this.menu = e, this.opt = t } function m(e) { this.editor = e, this.$elem = o(' '), this.type = "panel", this._active = !1 } function g(e) { this.editor = e, this.$elem = o(' '), this.type = "click", this._active = !1 } function w(e) { this.editor = e, this.$elem = o(' '), this.type = "click", this._active = !1 } function v(e) { this.editor = e, this.$elem = o(' '), this.type = "click", this._active = !1 } function E(e) { this.editor = e, this.$elem = o(' '), this.type = "click", this._active = !1 } function b(e) { this.editor = e, this.$elem = o(' '), this.type = "click", this._active = !1 } function B(e) { var t = this; this.editor = e, this.$elem = o(' '), this.type = "droplist", this._active = !1, this.droplist = new d(this,{ width: 120, $title: o("设置列表
"), type: "list", list: [{ $elem: o(' 有序列表'), value: "insertOrderedList" }, { $elem: o(' 无序列表'), value: "insertUnorderedList" }], onClick: function(e) { t._command(e) } }) } function y(e) { var t = this; this.editor = e, this.$elem = o(' '), this.type = "droplist", this._active = !1, this.droplist = new d(this,{ width: 100, $title: o("对齐方式
"), type: "list", list: [{ $elem: o(' 靠左'), value: "justifyLeft" }, { $elem: o(' 居中'), value: "justifyCenter" }, { $elem: o(' 靠右'), value: "justifyRight" }], onClick: function(e) { t._command(e) } }) } function C(e) { var t = this; this.editor = e, this.$elem = o(' '), this.type = "droplist"; var n = e.config , i = n.colors || []; this._active = !1, this.droplist = new d(this,{ width: 120, $title: o("文字颜色
"), type: "inline-block", list: i.map(function(e) { return { $elem: o(''), value: e } }), onClick: function(e) { t._command(e) } }) } function x(e) { var t = this; this.editor = e, this.$elem = o(' '), this.type = "droplist"; var n = e.config , i = n.colors || []; this._active = !1, this.droplist = new d(this,{ width: 120, $title: o("背景色
"), type: "inline-block", list: i.map(function(e) { return { $elem: o(''), value: e } }), onClick: function(e) { t._command(e) } }) } function I(e) { this.editor = e, this.$elem = o(' '), this.type = "click", this._active = !1 } function Q(e) { this.editor = e, this.$elem = o(' '), this.type = "panel", this._active = !1 } function M(e) { this.editor = e, this.$elem = o(' '), this.type = "panel", this._active = !1 } function S(e) { this.editor = e, this.$elem = o(' '), this.type = "panel", this._active = !1 } function k(e) { this.editor = e, this.$elem = o(' '), this.type = "panel", this._active = !1 } function D(e) { this.editor = e; var t = c("w-e-img"); this.$elem = o(' '), e.imgMenuId = t, this.type = "panel", this._active = !1 } function _(e) { this.editor = e, this.menus = {} } function N(e) { var t = e.clipboardData || e.originalEvent && e.originalEvent.clipboardData , n = void 0; return n = null == t ? window.clipboardData && window.clipboardData.getData("text") : t.getData("text/plain"), a(n) } function F(e, t, n) { var i = e.clipboardData || e.originalEvent && e.originalEvent.clipboardData , o = void 0 , A = void 0; if (null == i ? o = window.clipboardData && window.clipboardData.getData("text") : (o = i.getData("text/plain"), A = i.getData("text/html")), !A && o && (A = "" + a(o) + "
"), A) { var r = A.split("