From a76e187c3a6e6fb3acf69b1bbf473b784ef08cf5 Mon Sep 17 00:00:00 2001
From: kuaifan \s*<\/p>)+|( \s*<\/p>)+$/gi,"")).replace(/^( \s*([\uD800-\uDBFF][\uDC00-\uDFFF]){1,3}\s*<\/p>\s*$/.test(r.text))&&i.push("transparent"),i},contentClass:function(){var t=this.msgData,e=t.type,n=t.msg,r=[];return"text"===e&&(/^ \s*([\uD800-\uDBFF][\uDC00-\uDFFF]){3}\s*<\/p>\s*$/.test(n.text)?r.push("three-emoji"):/^\s* \s*([\uD800-\uDBFF][\uDC00-\uDFFF]){2}\s*<\/p>\s*$/.test(n.text)?r.push("two-emoji"):/^\s* \s*[\uD800-\uDBFF][\uDC00-\uDFFF]\s*<\/p>\s*$/.test(n.text)&&r.push("an-emoji")),r}}),watch:{operateAction:function(t){var e=this;this.operateEnter=!1,t&&setTimeout((function(t){return e.operateEnter=!0}),500)}},methods:{handleLongpress:function(t,e){this.$emit("on-longpress",{event:t,el:e,msgData:this.msgData})},openTodo:function(){var t=this;this.todoLoad>0||(this.todoShow?this.todoShow=!1:(this.todoLoad++,this.$store.dispatch("call",{url:"dialog/msg/todolist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.todoList=n})).catch((function(){t.todoList=[]})).finally((function(e){setTimeout((function(){t.todoLoad--,t.todoShow=!0}),100)}))))},openReadPercentage:function(){var t=this;this.percentageLoad>0||(this.percentageShow?this.percentageShow=!1:(this.percentageLoad++,this.$store.dispatch("call",{url:"dialog/msg/readlist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.percentageList=n})).catch((function(){t.percentageList=[]})).finally((function(e){setTimeout((function(){t.percentageLoad--,t.percentageShow=!0}),100)}))))},recordStyle:function(t){var e=t.duration;return{width:50+Math.min(180,Math.floor(e/150))+"px"}},recordDuration:function(t){var e=Math.floor(t/6e4),n=Math.floor(t/1e3)%60;return e>0?"".concat(e,":").concat(n,"″"):"".concat(Math.max(1,n),"″")},imageStyle:function(t){var e=t.width,n=t.height;if(e&&n){var r=e,o=n;return(e>220||n>220)&&(e>n?(r=220,o=n*(220/e)):(r=e*(220/n),o=220)),{width:r+"px",height:o+"px"}}return{}},playRecord:function(){this.operateVisible||l.Store.set("audioSubscribe",{id:this.msgData.id,src:this.msgData.msg.path})},openMeeting:function(){this.operateVisible||l.Store.set("addMeeting",{type:"join",name:this.msgData.msg.name,meetingid:this.msgData.msg.meetingid,meetingdisabled:!0})},viewReply:function(){this.$emit("on-view-reply",{msg_id:this.msgData.id,reply_id:this.msgData.reply_id})},viewText:function(t){this.$emit("on-view-text",t)},viewFile:function(){this.$emit("on-view-file",this.msgData)},downFile:function(){this.$emit("on-down-file",this.msgData)},replyList:function(){this.$emit("on-reply-list",{msg_id:this.msgData.id})},onError:function(){this.$emit("on-error",this.msgData)},onEmoji:function(t){this.$emit("on-emoji",{msg_id:this.msgData.id,symbol:t})},onShowEmojiUser:function(t){this.$emit("on-show-emoji-user",t)}}};function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function v(t){for(var e=1;e0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,r){for(var o,i,a=[],s=e;ss&&(n=s-u),i=n;i>=0;i--){for(var f=!0,d=0;do&&(r=o):r=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;ao)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return _(this,t,e,n);case"ascii":return w(this,t,e,n);case"latin1":case"binary":return k(this,t,e,n);case"base64":return C(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function A(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o>1,c=-7,f=n?o-1:0,d=n?-1:1,h=t[e+f];for(f+=d,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+t[e+f],f+=d,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=r;c>0;a=256*a+t[e+f],f+=d,c-=8);if(0===i)i=1-l;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=l}return(h?-1:1)*a*Math.pow(2,i-r)},e.write=function(t,e,n,r,o,i){var a,s,u,l=8*i-o-1,c=(1<0?" ":"")+e+": "+o+";")};return e&&r?(i("*"),i(e)):dt(t,(function(t,r){!t||o&&!function(t,e){var n=o["*"];return!(n&&n[t]||(n=o[e])&&n[t])}(r,e)||(n+=(n.length>0?" ":"")+r+": "+t+";")})),n}}},Pi={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},ji=function(t){return t instanceof Event||_(t.initEvent)},Ri=function(t,e,n,r){var o,i=function(t,e){var n=null!=e?e:{};for(var r in t)_t(Pi,r)||(n[r]=t[r]);return b(n.composedPath)&&(n.composedPath=function(){return t.composedPath()}),n}(e,r);return i.type=t,y(i.target)&&(i.target=null!==(o=i.srcElement)&&void 0!==o?o:n),function(t){return y(t.preventDefault)||ji(t)}(e)&&(i.preventDefault=function(){i.defaultPrevented=!0,i.isDefaultPrevented=I,_(e.preventDefault)?e.preventDefault():ji(e)&&(e.returnValue=!1)},i.stopPropagation=function(){i.cancelBubble=!0,i.isPropagationStopped=I,_(e.stopPropagation)?e.stopPropagation():ji(e)&&(e.cancelBubble=!0)},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=I,i.stopPropagation()},function(t){return t.isDefaultPrevented===I||t.isDefaultPrevented===L}(i)||(i.isDefaultPrevented=!0===i.defaultPrevented?I:L,i.isPropagationStopped=!0===i.cancelBubble?I:L,i.isImmediatePropagationStopped=L)),i},Mi=/^(?:mouse|contextmenu)|click/,$i=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},Bi=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},qi=function(t,e){var n=Ri(t.type,t,document,e);if(function(t){return b(t)&&Mi.test(t.type)}(t)&&v(t.pageX)&&!v(t.clientX)){var r=n.target.ownerDocument||document,o=r.documentElement,i=r.body,a=n;a.pageX=t.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),a.pageY=t.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0)}return v(n.metaKey)&&(n.metaKey=!1),n},Fi=function(t,e,n){var r=t.document,o={type:"ready"};if(n.domLoaded)e(o);else{var i=function(){Bi(t,"DOMContentLoaded",i),Bi(t,"load",i),n.domLoaded||(n.domLoaded=!0,e(o)),t=null};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():$i(t,"DOMContentLoaded",i),n.domLoaded||$i(t,"load",i)}},Ui=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}return t.prototype.bind=function(t,e,n,r){var o,i,a,s,u,l,c,f=this,d=window,h=function(t){f.executeHandlers(qi(t||d.event),o)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[f.expando]?o=t[f.expando]:(o=f.count++,t[f.expando]=o,f.events[o]={}),r=r||t;var p=e.split(" ");for(a=p.length;a--;)l=h,u=c=!1,"DOMContentLoaded"===(s=p[a])&&(s="ready"),f.domLoaded&&"ready"===s&&"complete"===t.readyState?n.call(r,qi({type:s})):(f.hasMouseEnterLeave||(u=f.mouseEnterLeave[s])&&(l=function(t){var e=t.currentTarget,n=t.relatedTarget;if(n&&e.contains)n=e.contains(n);else for(;n&&n!==e;)n=n.parentNode;n||((t=qi(t||d.event)).type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,f.executeHandlers(t,o))}),f.hasFocusIn||"focusin"!==s&&"focusout"!==s||(c=!0,u="focusin"===s?"focus":"blur",l=function(t){(t=qi(t||d.event)).type="focus"===t.type?"focusin":"focusout",f.executeHandlers(t,o)}),(i=f.events[o][s])?"ready"===s&&f.domLoaded?n(qi({type:s})):i.push({func:n,scope:r}):(f.events[o][s]=i=[{func:n,scope:r}],i.fakeName=u,i.capture=c,i.nativeHandler=l,"ready"===s?Fi(t,l,f):$i(t,u||s,l,c)));return t=i=null,n}},t.prototype.unbind=function(t,e,n){var r,o,i,a,s;if(!t||3===t.nodeType||8===t.nodeType)return this;var u=t[this.expando];if(u){if(s=this.events[u],e){var l=e.split(" ");for(o=l.length;o--;)if(r=s[a=l[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var c=r.nativeHandler,f=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=c,r.fakeName=f,r.capture=d,s[a]=r}n&&0!==r.length||(delete s[a],Bi(t,r.fakeName||a,r.nativeHandler,r.capture))}}else dt(s,(function(e,n){Bi(t,e.fakeName||n,e.nativeHandler,e.capture)})),s={};for(a in s)if(_t(s,a))return this;delete this.events[u];try{delete t[this.expando]}catch(e){t[this.expando]=null}}return this},t.prototype.fire=function(t,e,n){var r;if(!t||3===t.nodeType||8===t.nodeType)return this;var o=qi({type:e,target:t},n);do{(r=t[this.expando])&&this.executeHandlers(o,r),t=t.parentNode||t.ownerDocument||t.defaultView||t.parentWindow}while(t&&!o.isPropagationStopped());return this},t.prototype.clean=function(t){var e,n;if(!t||3===t.nodeType||8===t.nodeType)return this;if(t[this.expando]&&this.unbind(t),t.getElementsByTagName||(t=t.document),t&&t.getElementsByTagName)for(this.unbind(t),e=(n=t.getElementsByTagName("*")).length;e--;)(t=n[e])[this.expando]&&this.unbind(t);return this},t.prototype.destroy=function(){this.events={}},t.prototype.cancel=function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),!1},t.prototype.executeHandlers=function(t,e){var n=this.events[e],r=n&&n[t.type];if(r)for(var o=0,i=r.length;o+~]|"+aa+")"+aa+"*"),ha=new RegExp("="+aa+"*([^\\]'\"]*?)"+aa+"*\\]","g"),pa=new RegExp(la),ma=new RegExp("^"+sa+"$"),ga={ID:new RegExp("^#("+sa+")"),CLASS:new RegExp("^\\.("+sa+")"),TAG:new RegExp("^("+sa+"|[*])"),ATTR:new RegExp("^"+ua),PSEUDO:new RegExp("^"+la),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+aa+"*(even|odd|(([+-]|)(\\d*)n|)"+aa+"*(?:([+-]|)"+aa+"*(\\d+)|))"+aa+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+aa+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+aa+"*((?:-\\d)?\\d*)"+aa+"*\\)|)(?=[^-]|$)","i")},va=/^(?:input|select|textarea|button)$/i,ya=/^h\d$/i,ba=/^[^{]+\{\s*\[native \w/,_a=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,wa=/[+~]/,ka=/'|\\/g,Ca=new RegExp("\\\\([\\da-f]{1,6}"+aa+"?|("+aa+")|.)","ig"),xa=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{ra.apply(ta=oa.call(Hi.childNodes),Hi.childNodes),ta[Hi.childNodes.length].nodeType}catch(t){ra={apply:ta.length?function(t,e){na.apply(t,oa.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var Sa=function(t,e,n,r){var o,i,a,s,u,l,c,f,d,h;if((e?e.ownerDocument||e:Hi)!==Ur&&Fr(e),n=n||[],!t||"string"!=typeof t)return n;if(1!==(s=(e=e||Ur).nodeType)&&9!==s)return[];if(Hr&&!r){if(o=_a.exec(t))if(a=o[1]){if(9===s){if(!(i=e.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(a))&&Wr(e,i)&&i.id===a)return n.push(i),n}else{if(o[2])return ra.apply(n,e.getElementsByTagName(t)),n;if((a=o[3])&&Nr.getElementsByClassName)return ra.apply(n,e.getElementsByClassName(a)),n}if(Nr.qsa&&(!Vr||!Vr.test(t))){if(f=c=zi,d=e,h=9===s&&t,1===s&&"object"!==e.nodeName.toLowerCase()){for(l=jr(t),(c=e.getAttribute("id"))?f=c.replace(ka,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",u=l.length;u--;)l[u]=f+La(l[u]);d=wa.test(t)&&Da(e.parentNode)||e,h=l.join(",")}if(h)try{return ra.apply(n,d.querySelectorAll(h)),n}catch(t){}finally{c||e.removeAttribute("id")}}}return Mr(t.replace(ca,"$1"),e,n,r)};function Ea(){var t=[];return function e(n,r){return t.push(n+" ")>Lr.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function Oa(t){return t[zi]=!0,t}function Aa(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||Qi)-(~t.sourceIndex||Qi);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function Ta(t){return Oa((function(e){return e=+e,Oa((function(n,r){for(var o,i=t([],n.length,e),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))}))}))}function Da(t){return t&&typeof t.getElementsByTagName!==Xi&&t}function Na(){}function La(t){for(var e=0,n=t.length,r="";e
"+e,n.removeChild(n.firstChild)}catch(t){fs("").html("
"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)},L=function(e,n,r,o,i){return T(e,(function(e){var a="string"==typeof n?t.createElement(n):n;return D(a,r),o&&("string"!=typeof o&&o.nodeType?a.appendChild(o):"string"==typeof o&&N(a,o)),i?a:e.appendChild(a)}))},I=function(e,n,r){return L(t.createElement(e),e,n,r,!0)},P=bi.encodeAllRaw,j=function(t,e){var n=m(t);return e?n.each((function(){for(var t;t=this.firstChild;)3===t.nodeType&&0===t.data.length?this.removeChild(t):this.parentNode.insertBefore(t,this)})).remove():n.remove(),n.length>1?n.toArray():n[0]},R=function(t,e,n){m(t).toggleClass(e,n).each((function(){""===this.className&&fs(this).attr("class",null)}))},M=function(t,e,n){return T(e,(function(e){return Ae.is(e,"array")&&(t=t.cloneNode(!0)),n&&ds(hs(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))},$=function(t){if(Nn(t)){var e="a"===t.nodeName.toLowerCase()&&!g(t,"href")&&g(t,"id");if(g(t,"name")||g(t,"data-mce-bookmark")||e)return!0}return!1},B=function(){return t.createRange()},q=function(n,o,i,a){if(Ae.isArray(n)){for(var u=n.length,l=[];u--;)l[u]=q(n[u],o,i,a);return l}return!e.collect||n!==t&&n!==r||s.push([n,o,i,a]),c.bind(n,o,i,a||z)},F=function(e,n,o){if(Ae.isArray(e)){for(var i=e.length,a=[];i--;)a[i]=F(e[i],n,o);return a}if(s.length>0&&(e===t||e===r))for(i=s.length;i--;){var u=s[i];e!==u[0]||n&&n!==u[1]||o&&o!==u[2]||c.unbind(u[0],u[1],u[2])}return c.unbind(e,n,o)},U=function(t){if(t&&Nn(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null},z={doc:t,settings:e,win:r,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:a,boundEvents:s,styles:l,schema:u,events:c,isBlock:function(t){if("string"==typeof t)return!!f[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!f[t.nodeName])}return!1},$:h,$$:m,root:null,clone:function(e,n){if(!ps||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return ds(v(e),(function(t){b(r,t.nodeName,g(e,t.nodeName))})),r},getRoot:_,getViewPort:function(t){var e=An(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},getRect:function(t){t=p(t);var e=w(t),n=x(t);return{x:e.x,y:e.y,w:n.w,h:n.h}},getSize:x,getParent:function(t,e,n){var r=O(t,e,n,!1);return r&&r.length>0?r[0]:null},getParents:O,get:p,getNext:function(t,e){return A(t,e,"nextSibling")},getPrev:function(t,e){return A(t,e,"previousSibling")},select:function(n,r){return Sa(n,p(r)||e.root_element||t,[])},is:E,add:L,create:I,createHTML:function(t,e,n){var r,o="";for(r in o+="<"+t,e)wt(e,r)&&(o+=" "+r+'="'+P(e[r])+'"');return void 0!==n?o+">"+n+""+t+">":o+" />"},createFragment:function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();for(o.appendChild(r),e&&(r.innerHTML=e);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:j,setStyle:function(t,n,r){var o=d(n)?m(t).css(n,r):m(t).css(n);e.update_styles&&gs(l,o)},getStyle:C,setStyles:function(t,n){var r=m(t).css(n);e.update_styles&&gs(l,r)},removeAllAttribs:function(t){return T(t,(function(t){var e,n=t.attributes;for(e=n.length-1;e>=0;e--)t.removeAttributeNode(n.item(e))}))},setAttrib:b,setAttribs:D,getAttrib:g,getPos:w,parseStyle:function(t){return l.parse(t)},serializeStyle:function(t,e){return l.serialize(t,e)},addStyle:function(e){var r,o;if(z!==ys.DOM&&t===document){if(n[e])return;n[e]=!0}(o=t.getElementById("mceDefaultStyles"))||((o=t.createElement("style")).id="mceDefaultStyles",o.type="text/css",(r=t.getElementsByTagName("head")[0]).firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=e:o.appendChild(t.createTextNode(e))},loadCSS:function(t){t||(t=""),V(t.split(","),(function(t){o[t]=!0,a.load(t,k)}))},addClass:function(t,e){m(t).addClass(e)},removeClass:function(t,e){R(t,e,!1)},hasClass:function(t,e){return m(t).hasClass(e)},toggleClass:R,show:function(t){m(t).show()},hide:function(t){m(t).hide()},isHidden:function(t){return"none"===m(t).css("display")},uniqueId:function(t){return(t||"mce_")+i++},setHTML:N,getOuterHTML:function(t){var e="string"==typeof t?p(t):t;return Nn(e)?e.outerHTML:fs("").append(fs(e).clone()).html()},setOuterHTML:function(t,e){m(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}j(fs(this).html(e),!0)}))},decode:bi.decode,encode:P,insertAfter:function(t,e){var n=p(e);return T(t,(function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t}))},replace:M,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=I(e),ds(v(t),(function(e){b(n,e.nodeName,g(t,e.nodeName))})),M(n,t,!0)),n||t},findCommonAncestor:function(t,e){for(var n,r=t;r;){for(n=e;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&t.ownerDocument?t.ownerDocument.documentElement:r},toHex:function(t){return l.toHex(Ae.trim(t))},run:T,getAttribs:v,isEmpty:function(t,e){var n,r,o=0;if($(t))return!1;if(t=t.firstChild){var i=new so(t,t.parentNode),a=u?u.getWhiteSpaceElements():{};e=e||(u?u.getNonEmptyElements():null);do{if(n=t.nodeType,Nn(t)){var s=t.getAttribute("data-mce-bogus");if(s){t=i.next("all"===s);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"===r){o++,t=i.next();continue}return!1}if($(t))return!1}if(8===n)return!1;if(3===n&&!Zo(t.nodeValue))return!1;if(3===n&&t.parentNode&&a[t.parentNode.nodeName]&&Zo(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},createRng:B,nodeIndex:vs,split:function(t,e,n){var r,o,i,a=B();if(t&&e)return a.setStart(t.parentNode,vs(t)),a.setEnd(e.parentNode,vs(e)),r=a.extractContents(),(a=B()).setStart(e.parentNode,vs(e)+1),a.setEnd(t.parentNode,vs(t)+1),o=a.extractContents(),(i=t.parentNode).insertBefore(ii(z,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore(ii(z,o),t),j(t),n||e},bind:q,unbind:F,fire:function(t,e,n){return c.fire(t,e,n)},getContentEditable:U,getContentEditableParent:function(t){for(var e=_(),n=null;t&&t!==e&&null===(n=U(t));t=t.parentNode);return n},destroy:function(){if(s.length>0)for(var t=s.length;t--;){var e=s[t];c.unbind(e[0],e[1],e[2])}dt(o,(function(t,e){a.unload(e),delete o[e]})),Sa.setDocument&&Sa.setDocument()},isChildOf:function(t,e){if(ps){for(;t;){if(e===t)return!0;t=t.parentNode}return!1}return t===e||e.contains(t)},dumpRng:function(t){return"startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset}},H=function(t,e,n){var r=e.keep_values,o={set:function(t,r,o){e.url_converter&&null!==r&&(r=e.url_converter.call(e.url_converter_scope||n(),r,o,t[0])),t.attr("data-mce-"+o,r).attr(o,r)},get:function(t,e){return t.attr("data-mce-"+e)||t.attr(e)}},i={style:{set:function(e,n){null===n||"object"!=typeof n?(r&&e.attr("data-mce-style",n),null!==n&&"string"==typeof n?(e.removeAttr("style"),e.css(t.parse(n))):e.attr("style",n)):e.css(n)},get:function(e){var n=e.attr("data-mce-style")||e.attr("style");return t.serialize(t.parse(n),e[0].nodeName)}}};return r&&(i.href=i.src=o),i}(l,e,S(z));return z};ys.DOM=ys(document),ys.nodeIndex=vs;var bs=ys.DOM,_s=Ae.each,ws=Ae.grep,ks=function(){function t(t){void 0===t&&(t={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=t}return t.prototype._setReferrerPolicy=function(t){this.settings.referrerPolicy=t},t.prototype.loadScript=function(t,e,n){var r,o=bs,i=function(){o.remove(a),r&&(r.onerror=r.onload=r=null)},a=o.uniqueId();(r=document.createElement("script")).id=a,r.type="text/javascript",r.src=Ae._addCacheSuffix(t),this.settings.referrerPolicy&&o.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=function(){i(),e()},r.onerror=function(){i(),_(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)},t.prototype.isDone=function(t){return 2===this.states[t]},t.prototype.markDone=function(t){this.states[t]=2},t.prototype.add=function(t,e,n,r){var o=this.states[t];this.queue.push(t),void 0===o&&(this.states[t]=0),e&&(this.scriptLoadedCallbacks[t]||(this.scriptLoadedCallbacks[t]=[]),this.scriptLoadedCallbacks[t].push({success:e,failure:r,scope:n||this}))},t.prototype.load=function(t,e,n,r){return this.add(t,e,n,r)},t.prototype.remove=function(t){delete this.states[t],delete this.scriptLoadedCallbacks[t]},t.prototype.loadQueue=function(t,e,n){this.loadScripts(this.queue,t,e,n)},t.prototype.loadScripts=function(t,e,n,r){var o=this,i=[],a=function(t,e){_s(o.scriptLoadedCallbacks[e],(function(e){_(e[t])&&e[t].call(e.scope)})),o.scriptLoadedCallbacks[e]=void 0};o.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});var s=function(){var e=ws(t);if(t.length=0,_s(e,(function(t){2!==o.states[t]?3!==o.states[t]?1!==o.states[t]&&(o.states[t]=1,o.loading++,o.loadScript(t,(function(){o.states[t]=2,o.loading--,a("success",t),s()}),(function(){o.states[t]=3,o.loading--,i.push(t),a("failure",t),s()}))):a("failure",t):a("success",t)})),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,_s(n,(function(t){0===i.length?_(t.success)&&t.success.call(t.scope):_(t.failure)&&t.failure.call(t.scope,i)}))}};s()},t.ScriptLoader=new t,t}(),Cs=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},xs={},Ss=Cs("en"),Es=function(){return bt(xs,Ss.get())},Os={getData:function(){return ht(xs,(function(t){return Dt({},t)}))},setCode:function(t){t&&Ss.set(t)},getCode:function(){return Ss.get()},add:function(t,e){var n=xs[t];n||(xs[t]=n={}),dt(e,(function(t,e){n[e.toLowerCase()]=t}))},translate:function(t){var e,n=Es().getOr({}),r=function(t){return _(t)?Object.prototype.toString.call(t):o(t)?"":""+t},o=function(t){return""===t||null==t},i=function(t){var e=r(t);return bt(n,e.toLowerCase()).map(r).getOr(e)},a=function(t){return t.replace(/{context:\w+}$/,"")};if(o(t))return"";if(h(e=t)&&_t(e,"raw"))return r(t.raw);if(function(t){return p(t)&&t.length>1}(t)){var s=t.slice(1);return a(i(t[0]).replace(/\{([0-9]+)\}/g,(function(t,e){return _t(s,e)?r(s[e]):t})))}return a(i(t))},isRtl:function(){return Es().bind((function(t){return bt(t,"_dir")})).exists((function(t){return"rtl"===t}))},hasCode:function(t){return _t(xs,t)}},As=function(){var t=[],e={},n={},r=[],o=function(t,e){var n=Y(r,(function(n){return n.name===t&&n.state===e}));V(n,(function(t){return t.callback()}))},i=function(t){var e;return n[t]&&(e=n[t].dependencies),e||[]},a=function(t,e){return"object"==typeof e?e:"string"==typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}},s=function(t,r,u,l,c){if(!e[t]){var f="string"==typeof r?r:r.prefix+r.resource+r.suffix;0!==f.indexOf("/")&&-1===f.indexOf("://")&&(f=As.baseURL+"/"+f),e[t]=f.substring(0,f.lastIndexOf("/"));var d=function(){o(t,"loaded"),function(t,e,n,r){var o=i(t);V(o,(function(t){var n=a(e,t);s(n.resource,n,void 0,void 0)})),n&&(r?n.call(r):n.call(ks))}(t,r,u,l)};n[t]?d():ks.ScriptLoader.add(f,d,l,c)}},u=function(t,o,i){void 0===i&&(i="added"),_t(n,t)&&"added"===i||_t(e,t)&&"loaded"===i?o():r.push({name:t,state:i,callback:o})};return{items:t,urls:e,lookup:n,_listeners:r,get:function(t){if(n[t])return n[t].instance},dependencies:i,requireLangPack:function(t,n){!1!==As.languageLoad&&u(t,(function(){var r=Os.getCode();!r||n&&-1===(","+(n||"")+",").indexOf(","+r+",")||ks.ScriptLoader.add(e[t]+"/langs/"+r+".js")}),"loaded")},add:function(e,r,i){var a=r;return t.push(a),n[e]={instance:a,dependencies:i},o(e,"added"),a},remove:function(t){delete e[t],delete n[t]},createUrl:a,addComponents:function(t,n){var r=e[t];V(n,(function(t){ks.ScriptLoader.add(r+"/"+t)}))},load:s,waitFor:u}};As.languageLoad=!0,As.baseURL="",As.PluginManager=As(),As.ThemeManager=As();var Ts=function(){var t=function(t){var e=Cs(M.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(M.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(M.some(t))}}}(k);return Dt(Dt({},t),{on:function(e){return t.get().each(e)}})},Ds=function(t,e){var n=null;return{cancel:function(){m(n)||(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o
|)<\\/"+n+">[\r\n]*|
[\r\n]*)$");return e.replace(r,"")}(t,t.serializer.serialize(r,a)),U(["text","tree"],a.format)||bo(De.fromDom(r))?a.content=o:a.content=Ae.trim(o),a.no_events?a.content:t.fire("GetContent",a).content},Jh=Ae.each,tp=function(t){return{compare:function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return Jh(t.getAttribs(e),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=t.getAttrib(e,o))})),n},o=function(t,e){var n,r;for(r in t)if(_t(t,r)){if(void 0===(n=e[r]))return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(_t(e,r))return!1;return!0};return!!o(r(e),r(n))&&(!!o(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style")))&&(!Qc(e)&&!Qc(n)))}}},ep=Ae.makeMap,np=function(t){var e=[],n=(t=t||{}).indent,r=ep(t.indent_before||""),o=ep(t.indent_after||""),i=bi.getEncodeFunc(t.entity_encoding||"raw",t.entities),a="html"===t.element_format;return{start:function(t,s,u){var l,c,f,d;if(n&&r[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n"),e.push("<",t),s)for(l=0,c=s.length;l
');return gn(t),pn(t,e),M.some(Nu.before(e.dom))}return M.none()},vm=function(t,e,n){var r,o,i,a,s=Ye(t).filter(Fe),u=Ze(t).filter(Fe);return vn(t),(r=s,o=u,i=e,a=function(t,e,r){var o=t.dom,i=e.dom,a=o.data.length;return sm(o,i,n),r.container()===i?Nu(o,a):r},r.isSome()&&o.isSome()&&i.isSome()?M.some(a(r.getOrDie(),o.getOrDie(),i.getOrDie())):M.none()).orThunk((function(){return n&&(s.each((function(t){return am(t.dom,t.dom.length)})),u.each((function(t){return im(t.dom,0)}))),e}))},ym=function(t,e,n,r){void 0===r&&(r=!0);var o,i=hm(e,t.getBody(),n.dom),a=Yr(n,A(mm,t),(o=t.getBody(),function(t){return t.dom===o})),s=vm(n,i,function(t,e){return _t(t.schema.getTextInlineElements(),Me(e))}(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):a.bind(gm).fold((function(){r&&pm(t,e,s)}),(function(n){r&&pm(t,e,M.some(n))}))},bm=function(t){return qs(t,"td,th")},_m=function(t,e){return{start:t,end:e}},wm=Sr([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),km=function(t,e){return Jr(De.fromDom(t),"td,th",e)},Cm=function(t){return!Pe(t.start,t.end)},xm=function(t,e){return qf(t.start,e).bind((function(n){return qf(t.end,e).bind((function(t){return e=Pe(n,t),r=n,e?M.some(r):M.none();var e,r}))}))},Sm=function(t){return function(e){return xm(e,t).map((function(t){return function(t,e,n){return{rng:t,table:e,cells:n}}(e,t,bm(t))}))}},Em=function(t,e,n,r){if(n.collapsed||!t.forall(Cm))return M.none();if(e.isSameTable){var o=t.bind(Sm(r));return M.some({start:o,end:o})}var i=km(n.startContainer,r),a=km(n.endContainer,r),s=i.bind(function(t){return function(e){return qf(e,t).bind((function(t){return st(bm(t)).map((function(t){return _m(e,t)}))}))}}(r)).bind(Sm(r)),u=a.bind(function(t){return function(e){return qf(e,t).bind((function(t){return at(bm(t)).map((function(t){return _m(t,e)}))}))}}(r)).bind(Sm(r));return M.some({start:s,end:u})},Om=function(t,e){return J(t,(function(t){return Pe(t,e)}))},Am=function(t){return Gn(Om(t.cells,t.rng.start),Om(t.cells,t.rng.end),(function(e,n){return t.cells.slice(e,n+1)}))},Tm=function(t,e,n){return t.exists((function(t){return function(t,e){return!Cm(t)&&xm(t,e).exists((function(t){var e=t.dom.rows;return 1===e.length&&1===e[0].cells.length}))}(t,n)&&zf(t.start,e)}))},Dm=function(t,e){var n=e.startTable,r=e.endTable,o=t.cloneRange();return n.each((function(t){return o.setStartAfter(t.dom)})),r.each((function(t){return o.setEndBefore(t.dom)})),o},Nm=function(t,e){var n=function(t){return function(e){return Pe(t,e)}}(t),r=function(t,e){var n=km(t.startContainer,e),r=km(t.endContainer,e);return Gn(n,r,_m)}(e,n),o=function(t,e){var n=function(t){return qf(De.fromDom(t),e)},r=n(t.startContainer),o=n(t.endContainer),i=r.isSome(),a=o.isSome(),s=Gn(r,o,Pe).getOr(!1);return{startTable:r,endTable:o,isStartInTable:i,isEndInTable:a,isSameTable:s,isMultiTable:!s&&i&&a}}(e,n);return Tm(r,e,n)?r.map((function(t){return wm.singleCellTable(e,t.start)})):o.isMultiTable?function(t,e,n,r){return Em(t,e,n,r).bind((function(t){var r=t.start,o=t.end,i=r.bind(Am).getOr([]),a=o.bind(Am).getOr([]);if(i.length>0&&a.length>0){var s=Dm(n,e);return M.some(wm.multiTable(i,a,s))}return M.none()}))}(r,o,e,n):function(t,e,n,r){return Em(t,e,n,r).bind((function(t){var e=t.start,n=t.end;return e.or(n)})).bind((function(t){var r=e.isSameTable,o=Am(t).getOr([]);if(r&&t.cells.length===o.length)return M.some(wm.fullTable(t.table));if(o.length>0){if(r)return M.some(wm.partialTable(o,M.none()));var i=Dm(n,e);return M.some(wm.partialTable(o,M.some(Dt(Dt({},e),{rng:i}))))}return M.none()}))}(r,o,e,n)},Lm=function(t){var e;return(8===$e(e=t)||"#comment"===Me(e)?Ye(t):en(t)).bind(Lm).orThunk((function(){return M.some(t)}))},Im=function(t){return V(t,(function(t){rr(t,"contenteditable"),Sp(t)}))},Pm=function(t,e,n,r){var o=n.cloneRange();r?(o.setStart(n.startContainer,n.startOffset),o.setEndAfter(e.dom.lastChild)):(o.setStartBefore(e.dom.firstChild),o.setEnd(n.endContainer,n.endOffset)),$m(t,o,e,!1)},jm=function(t){var e=Bf(t),n=De.fromDom(t.selection.getNode());Wn(n.dom)&&ei(n)?t.selection.setCursorLocation(n.dom,0):t.selection.collapse(!0),e.length>1&&z(e,(function(t){return Pe(t,n)}))&&Jn(n,"data-mce-selected","1")},Rm=function(t,e,n){var r=t.selection.getRng(),o=n.bind((function(n){var o=n.rng,i=n.isStartInTable,a=function(t,e){return M.from(t.dom.getParent(e,t.dom.isBlock)).map(De.fromDom)}(t,i?o.endContainer:o.startContainer);o.deleteContents(),function(t,e,n){n.each((function(n){e?vn(n):(Sp(n),t.selection.setCursorLocation(n.dom,0))}))}(t,i,a.filter(ei));var s=i?e[0]:e[e.length-1];return Pm(t,s,r,i),ei(s)?M.none():M.some(i?e.slice(1):e.slice(0,-1))})).getOr(e);return Im(o),jm(t),!0},Mm=function(t,e,n,r){var o=t.selection.getRng(),i=e[0],a=n[n.length-1];Pm(t,i,o,!0),Pm(t,a,o,!1);var s=ei(i)?e:e.slice(1),u=ei(a)?n:n.slice(0,-1);return Im(s.concat(u)),r.deleteContents(),jm(t),!0},$m=function(t,e,n,r){void 0===r&&(r=!0),e.deleteContents();var o,i=Lm(n).getOr(n),a=De.fromDom(t.dom.getParent(i.dom,t.dom.isBlock));if(ei(a)&&(Sp(a),r&&t.selection.setCursorLocation(a.dom,0)),!Pe(n,a)){var s=Zn(We(a),n)?[]:We(o=a).map(Qe).map((function(t){return Y(t,(function(t){return!Pe(o,t)}))})).getOr([]);V(s.concat(Qe(n)),(function(t){Pe(t,a)||Re(t,a)||!ei(t)||vn(t)}))}return!0},Bm=function(t,e){return ym(t,!1,e),!0},qm=function(t,e,n,r){return Um(e,r).fold((function(){return function(t,e,n){return Nm(e,n).map((function(e){return e.fold(A($m,t),A(Bm,t),A(Rm,t),A(Mm,t))}))}(t,e,n)}),(function(e){return function(t,e){return zm(t,e)}(t,e)})).getOr(!1)},Fm=function(t,e){return Q(Tp(e,t),yo)},Um=function(t,e){return Q(Tp(e,t),(n="caption",function(t){return qe(t)&&Me(t)===n}));var n},zm=function(t,e){return Sp(e),t.selection.setCursorLocation(e.dom,0),M.some(!0)},Hm=function(t,e,n,r,o){return Lc(n,t.getBody(),o).bind((function(i){return function(t,e,n,r){return Mc(t.dom).bind((function(o){return $c(t.dom).map((function(t){return e?n.isEqual(o)&&r.isEqual(t):n.isEqual(t)&&r.isEqual(o)}))})).getOr(!0)}(r,n,o,i)?function(t,e){return zm(t,e)}(t,r):function(t,e,n){return Um(t,De.fromDom(n.getNode())).map((function(t){return!1===Pe(t,e)}))}(e,r,i)})).or(M.some(!0))},Vm=function(t,e,n,r){var o=Nu.fromRangeStart(t.selection.getRng());return Fm(n,r).bind((function(r){return ei(r)?zm(t,r):function(t,e,n,r,o){return Lc(n,t.getBody(),o).bind((function(t){return Fm(e,De.fromDom(t.getNode())).map((function(t){return!1===Pe(t,r)}))}))}(t,n,e,r,o)})).getOr(!1)},Km=function(t,e){return t?_p(e):wp(e)},Wm=function(t,e,n){var r=De.fromDom(t.getBody());return Um(r,n).fold((function(){return Vm(t,e,r,n)||function(t,e){var n=Nu.fromRangeStart(t.selection.getRng());return Km(e,n)||Nc(e,t.getBody(),n).exists((function(t){return Km(e,t)}))}(t,e)}),(function(n){return function(t,e,n,r){var o=Nu.fromRangeStart(t.selection.getRng());return ei(r)?zm(t,r):Hm(t,n,e,r,o)}(t,e,r,n).getOr(!1)}))},Ym=function(t,e){var n=De.fromDom(t.selection.getStart(!0)),r=Bf(t);return t.selection.isCollapsed()&&0===r.length?Wm(t,e,n):function(t,e,n){var r=De.fromDom(t.getBody()),o=t.selection.getRng();return 0!==n.length?Rm(t,n,M.none()):qm(t,r,o,e)}(t,n,r)},Zm=function(t){var e=Nu.fromRangeStart(t),n=Nu.fromRangeEnd(t),r=t.commonAncestorContainer;return Nc(!1,r,n).map((function(o){return!nc(e,n,r)&&nc(e,o,r)?function(t,e,n,r){var o=document.createRange();return o.setStart(t,e),o.setEnd(n,r),o}(e.container(),e.offset(),o.container(),o.offset()):t})).getOr(t)},Gm=function(t){return t.collapsed?t:Zm(t)},Xm=function(t,e){return t.getBlockElements()[e.name]&&function(t){return t.firstChild&&t.firstChild===t.lastChild}(e)&&function(t){return"br"===t.name||t.value===_o}(e.firstChild)},Qm=function(t,e){var n=e.firstChild,r=e.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(t,e){var n=t.getNonEmptyElements();return e&&(e.isEmpty(n)||Xm(t,e))}(t,r)&&(r=r.prev),!(!n||n!==r)&&("ul"===n.name||"ol"===n.name)},Jm=function(t){return t&&t.firstChild&&t.firstChild===t.lastChild&&function(t){return t.data===_o||zn(t)}(t.firstChild)},tg=function(t){return t.length>0&&(!(e=t[t.length-1]).firstChild||Jm(e))?t.slice(0,-1):t;var e},eg=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},ng=function(t,e){var n=Nu.after(t),r=Ec(e).prev(n);return r?r.toRange():null},rg=function(t,e,n){var r=t.parentNode;return Ae.each(e,(function(e){r.insertBefore(e,t)})),function(t,e){var n=Nu.before(t),r=Ec(e).next(n);return r?r.toRange():null}(t,n)},og=function(t,e,n,r){var o,i=function(t,e,n){var r=e.serialize(n);return function(t){var e=t.firstChild,n=t.lastChild;return e&&"META"===e.nodeName&&e.parentNode.removeChild(e),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),t}(t.createFragment(r))}(e,t,r),a=eg(e,n.startContainer),s=tg((o=i.firstChild,Y(o.childNodes,(function(t){return"LI"===t.nodeName})))),u=e.getRoot(),l=function(t){var r=Nu.fromRangeStart(n),o=Ec(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||eg(e,i.getNode())!==a};return l(1)?rg(a,s,u):l(2)?function(t,e,n,r){return r.insertAfter(e.reverse(),t),ng(e[0],n)}(a,s,u,e):function(t,e,n,r){var o=function(t,e){var n=e.cloneRange(),r=e.cloneRange();return n.setStartBefore(t),r.setEndAfter(t),[n.cloneContents(),r.cloneContents()]}(t,r),i=t.parentNode;return i.insertBefore(o[0],t),Ae.each(e,(function(e){i.insertBefore(e,t)})),i.insertBefore(o[1],t),i.removeChild(t),ng(e[e.length-1],n)}(a,s,u,n)},ig=Wn,ag=function(t){var e=t.dom,n=Gm(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,ig);!function(t,e,n){return null!==n&&n===t.getParent(e.endContainer,ig)&&zf(De.fromDom(n),e)}(e,n,r)?t.getDoc().execCommand("Delete",!1,null):$m(t,n,De.fromDom(r))},sg=function(t,e,n){var r,o,i,a=t.selection,s=t.dom;/^ | $/.test(e)&&(e=function(t,e,n){var r=De.fromDom(t.getRoot());return n=Gp(r,Nu.fromRangeStart(e))?n.replace(/^ /," "):n.replace(/^ /," "),Xp(r,Nu.fromRangeEnd(e))?n.replace(/( | )(
)?$/," "):n.replace(/ (
)?$/," ")}(s,a.getRng(),e));var u=t.parser,l=n.merge,c=rp({validate:wl(t)},t.schema),f='',d=t.fire("BeforeSetContent",{content:e,format:"html",selection:!0,paste:n.paste});if(d.isDefaultPrevented())t.fire("SetContent",{content:d.content,format:"html",selection:!0,paste:n.paste});else{-1===(e=d.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,f);var h=(o=a.getRng()).startContainer||(o.parentElement?o.parentElement():null),p=t.getBody();h===p&&a.isCollapsed()&&s.isBlock(p.firstChild)&&function(t,e){return e&&!t.schema.getShortEndedElements()[e.nodeName]}(t,p.firstChild)&&s.isEmpty(p.firstChild)&&((o=s.createRng()).setStart(p.firstChild,0),o.setEnd(p.firstChild,0),a.setRng(o)),a.isCollapsed()||ag(t);var m,g={context:(r=a.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},v=u.parse(e,g);if(!0===n.paste&&Qm(t.schema,v)&&function(t,e){return!!eg(t,e)}(s,r))return o=og(c,s,a.getRng(),v),a.setRng(o),void t.fire("SetContent",d);if(function(t){for(var e=t;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(v),"mce_marker"===(i=v.lastChild).attr("id")){var y=i;for(i=i.prev;i;i=i.walk(!0))if(3===i.type||!s.isBlock(i.name)){t.schema.isValidChild(i.parent.name,"span")&&i.parent.insert(y,i,"br"===i.name);break}}if(t._selectionOverrides.showBlockCaretContainer(r),g.invalid){t.selection.setContent(f),r=a.getNode();var _=t.getBody();for(9===r.nodeType?r=i=_:i=r;i!==_;)r=i,i=i.parentNode;e=r===_?_.innerHTML:s.getOuterHTML(r),e=c.serialize(u.parse(e.replace(//i,(function(){return c.serialize(v)})))),r===_?s.setHTML(_,e):s.setOuterHTML(r,e)}else!function(t,e,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(t.dom.createFragment(e),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?t.dom.setHTML(n,e):t.selection.setContent(e)}}(t,e=c.serialize(v),r);!function(t,e){var n=t.schema.getTextInlineElements(),r=t.dom;if(e){var o=t.getBody(),i=tp(r);Ae.each(r.select("*[data-mce-fragment]"),(function(t){if(b(n[t.nodeName.toLowerCase()])&&sp(r,t))for(var e=t.parentNode;b(e)&&e!==o&&!up(r,t,e);e=e.parentNode)if(i.compare(e,t)){r.remove(t,!0);break}}))}}(t,l),function(t,e){var n,r=t.dom,o=t.selection;if(e){o.scrollIntoView(e);var i=nd(t.getBody(),e);if("false"===r.getContentEditable(i))return r.remove(e),void o.select(i);var a=r.createRng(),s=e.previousSibling;if(Bn(s)){if(a.setStart(s,s.nodeValue.length),!Ce.ie){var u=e.nextSibling;Bn(u)&&(s.appendData(u.data),u.parentNode.removeChild(u))}}else a.setStartBefore(e),a.setEndBefore(e);var l=r.getParent(e,r.isBlock);r.remove(e),l&&r.isEmpty(l)&&(t.$(l).empty(),a.setStart(l,0),a.setEnd(l,0),ig(l)||function(t){return!!t.getAttribute("data-mce-fragment")}(l)||!(n=function(e){var n=Nu.fromRangeStart(e);if(n=Ec(t.getBody()).next(n))return n.toRange()}(a))?r.add(l,r.create("br",{"data-mce-bogus":"1"})):(a=n,r.remove(l))),o.setRng(a)}}(t,s.get("mce_marker")),m=t.getBody(),Ae.each(m.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")})),function(t,e){M.from(t.getParent(e,"td,th")).map(De.fromDom).each(Ep)}(s,a.getStart()),t.fire("SetContent",d),t.addVisual()}},ug=function(t,e){e(t),t.firstChild&&ug(t.firstChild,e),t.next&&ug(t.next,e)},lg=function(t,e,n){var r=function(t,e,n){var r={},o={},i=[];for(var a in n.firstChild&&ug(n.firstChild,(function(n){V(t,(function(t){t.name===n.name&&(r[t.name]?r[t.name].nodes.push(n):r[t.name]={filter:t,nodes:[n]})})),V(e,(function(t){"string"==typeof n.attr(t.name)&&(o[t.name]?o[t.name].nodes.push(n):o[t.name]={filter:t,nodes:[n]})}))})),r)_t(r,a)&&i.push(r[a]);for(var s in o)_t(o,s)&&i.push(o[s]);return i}(t,e,n);V(r,(function(t){V(t.filter.callbacks,(function(e){e(t.nodes,t.filter.name,{})}))}))},cg=function(t){return t instanceof jh},fg=function(t,e,n){t.dom.setHTML(t.getBody(),e),!0!==n&&function(t){kh(t)&&Mc(t.getBody()).each((function(e){var n=e.getNode(),r=Rn(n)?Mc(n).getOr(e):e;t.selection.setRng(r.toRange())}))}(t)},dg=function(t,e,n){var r=function(t,e){return Dt(Dt({format:"html"},t),{set:!0,content:cg(e)?"":e})}(n,e),o=n.no_events?r:t.fire("BeforeSetContent",r);return cg(e)||(e=o.content),M.from(t.getBody()).fold(S(e),(function(n){return cg(e)?function(t,e,n,r){lg(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=rp({validate:t.validate},t.schema).serialize(n);return r.content=bo(De.fromDom(e))?o:Ae.trim(o),fg(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r),n}(t,n,e,o):function(t,e,n,r){if(0===n.length||/^\s+$/.test(n)){var o='
';"TABLE"===e.nodeName?n=" ":/^(UL|OL)$/.test(e.nodeName)&&(n=""+o+"
'),fg(t,n,r.no_selection),t.fire("SetContent",r)}else"raw"!==r.format&&(n=rp({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=bo(De.fromDom(e))?n:Ae.trim(n),fg(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r);return r.content}(t,n,e,o)}))},hg=function(t,e){return function(t,e){var n=t.dom;return n.parentNode?Gr(De.fromDom(n.parentNode),(function(n){return!Pe(t,n)&&e(n)})):M.none()}(t,e).isSome()},pg=function(t){return _(t)?t:L},mg=function(t,e,n){var r=e(t),o=pg(n);return r.orThunk((function(){return o(t)?M.none():function(t,e,n){for(var r=t.dom,o=pg(n);r.parentNode;){r=r.parentNode;var i=De.fromDom(r),a=e(i);if(a.isSome())return a;if(o(i))break}return M.none()}(t,e,o)}))},gg=cf,vg=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o
").append(n.childNodes)})))}));var qg=Ae.each,Fg=function(t){return Nn(t)&&!Qc(t)&&!qc(t)&&!jn(t)},Ug=function(t,e){for(var n=t;n;n=n[e]){if(Bn(n)&&zt(n.data))return t;if(Nn(n)&&!Qc(n))return n}return t},zg=function(t,e,n){var r=tp(t);if(e&&n&&(e=Ug(e,"previousSibling"),n=Ug(n,"nextSibling"),r.compare(e,n))){for(var o=e.nextSibling;o&&o!==n;){var i=o;o=o.nextSibling,e.appendChild(i)}return t.remove(n),Ae.each(Ae.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n},Hg=function(t,e,n,r){if(r&&!1!==e.merge_siblings){var o=zg(t,of(r),r);zg(t,o,of(o,!0))}},Vg=function(t,e,n){qg(t.childNodes,(function(t){Fg(t)&&(e(t)&&n(t),t.hasChildNodes()&&Vg(t,e,n))}))},Kg=function(t,e){return function(n){return!(!n||!df(t,n,e))}},Wg=function(t,e,n){return function(r){t.setStyle(r,e,n),""===r.getAttribute("style")&&r.removeAttribute("style"),function(t,e){"SPAN"===e.nodeName&&0===t.getAttribs(e).length&&t.remove(e,!0)}(t,r)}},Yg=Sr([{keep:[]},{rename:["name"]},{removed:[]}]),Zg=/^(src|href|style)$/,Gg=Ae.each,Xg=cf,Qg=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},Jg=function(t,e,n){var r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"];if(Nn(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return Bn(r)&&n&&o>=r.nodeValue.length&&(r=new so(r,t.getBody()).next()||r),Bn(r)&&!n&&0===o&&(r=new so(r,t.getBody()).prev()||r),r},tv=function(t,e){var n=e?"firstChild":"lastChild";if(function(t){return/^(TR|TH|TD)$/.test(t.nodeName)}(t)&&t[n]){var r=t[n];return"TR"===t.nodeName&&r[n]||r}return t},ev=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},nv=function(t,e,n,r,o){var i=De.fromDom(e),a=De.fromDom(t.create(r,o)),s=n?Xe(i):Ge(i);return mn(a,s),n?(fn(i,a),hn(a,i)):(dn(i,a),pn(a,i)),a.dom},rv=function(t,e,n,r){var o=of(e,n,r);return y(o)||"BR"===o.nodeName||t.isBlock(o)},ov=function(t,e,n){var r,o=e.parentNode,i=t.dom,a=ol(t);gf(n)&&(a?o===i.getRoot()&&(n.list_block&&Xg(e,n.list_block)||V(ut(e.childNodes),(function(e){sf(t,a,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=ev(i,e,a),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=null}))):i.isBlock(e)&&!i.isBlock(o)&&(rv(i,e,!1)||rv(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),rv(i,e,!0)||rv(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),function(t){return vf(t)&&yf(t)&&Zn(bt(t,"mixed"),!0)}(n)&&!Xg(n.inline,e)||i.remove(e,!0)},iv=function(t,e,n,r,o){var i,a=t.dom;if(!function(t,e,n){return!(!yf(n)||!Xg(e,n.inline))||!(!gf(n)||!Xg(e,n.block))||(vf(n)?Nn(e)&&t.is(e,n.selector):void 0)}(a,r,e)&&!function(t,e){return e.links&&"A"===t.nodeName}(r,e))return Yg.keep();var s=r;if(yf(e)&&"all"===e.remove&&p(e.preserve_attributes)){var u=Y(a.getAttribs(s),(function(t){return U(e.preserve_attributes,t.name.toLowerCase())}));if(a.removeAllAttribs(s),V(u,(function(t){return a.setAttrib(s,t.name,t.value)})),u.length>0)return Yg.rename("span")}if("all"!==e.remove){Gg(e.styles,(function(t,r){t=ff(a,lf(t,n),r+""),w(r)&&(r=t,o=null),(e.remove_similar||!o||Xg(df(a,o,r),t))&&a.setStyle(s,r,""),i=!0})),i&&""===a.getAttrib(s,"style")&&(s.removeAttribute("style"),s.removeAttribute("data-mce-style")),Gg(e.attributes,(function(t,r){var i;if(t=lf(t,n),w(r)&&(r=t,o=null),e.remove_similar||!o||Xg(a.getAttrib(o,r),t)){if("class"===r&&(t=a.getAttrib(s,r))&&(i="",V(t.split(/\s+/),(function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)})),i))return void a.setAttrib(s,r,i);if(Zg.test(r)&&s.removeAttribute("data-mce-"+r),"style"===r&&Ln(["li"])(s)&&"none"===a.getStyle(s,"list-style-type"))return s.removeAttribute(r),void a.setStyle(s,"list-style-type","none");"class"===r&&s.removeAttribute("className"),s.removeAttribute(r)}})),Gg(e.classes,(function(t){t=lf(t,n),o&&!a.hasClass(o,t)||a.removeClass(s,t)}));for(var l=a.getAttribs(s),c=0;c
'),e}(t);1===e?t.$(i).after(a):t.$(i).before(a),t.selection.select(a,!0),t.selection.collapse()}}},Yk=function(t,e){var n=e?Lu.Forwards:Lu.Backwards,r=t.selection.getRng();return function(t,e,n){return ik(e,t,n,kp,Cp,Kk)}(n,t,r).orThunk((function(){return Wk(t,n,r),M.none()}))},Zk=function(t,e){var n=e?1:-1,r=t.selection.getRng();return function(t,e,n){return ak(e,t,n,(function(t){return kp(t)||_p(t)}),(function(t){return Cp(t)||wp(t)}),Kk)}(n,t,r).orThunk((function(){return Wk(t,n,r),M.none()}))},Gk=function(t,e){return Yk(t,e).exists((function(e){return rk(t,e),!0}))},Xk=function(t,e){return Zk(t,e).exists((function(e){return rk(t,e),!0}))},Qk=function(t,e){return uk(t,e,e?Cp:kp)},Jk=function(t){return U(["figcaption"],Me(t))},tC=function(t){var e=document.createRange();return e.setStartBefore(t.dom),e.setEndBefore(t.dom),e},eC=function(t,e,n){n?pn(t,e):hn(t,e)},nC=function(t,e,n,r){return""===e?function(t,e){var n=De.fromTag("br");return eC(t,n,e),tC(n)}(t,r):function(t,e,n,r){var o=De.fromTag(n),i=De.fromTag("br");return tr(o,r),pn(o,i),eC(t,o,e),tC(i)}(t,r,e,n)},rC=function(t,e,n){return e?function(t,e){return Rw(t,e).breakAt.isNone()}(t.dom,n):function(t,e){return jw(t,e).breakAt.isNone()}(t.dom,n)},oC=function(t,e){var n=De.fromDom(t.getBody()),r=Nu.fromRangeStart(t.selection.getRng()),o=ol(t),i=il(t);return function(t,e){var n=A(Pe,e);return Zr(De.fromDom(t.container()),co,n).filter(Jk)}(r,n).exists((function(){if(rC(n,e,r)){var a=nC(n,o,i,e);return t.selection.setRng(a),!0}return!1}))},iC=function(t,e){return!!t.selection.isCollapsed()&&oC(t,e)},aC=function(t,e){return tt(function(t){return H(t,(function(t){return Dt({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:k},t)}))}(t),(function(t){return function(t,e){return e.keyCode===t.keyCode&&e.shiftKey===t.shiftKey&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey}(t,e)?[t]:[]}))},sC=function(t){for(var e=[],n=1;n
'},$C=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},BC=function(t,e){return e&&t.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==t.getContentEditable(e)},qC=function(t,e,n){return!1===Bn(e)?n:t?1===n&&e.data.charAt(n-1)===wo?0:n:n===e.data.length-1&&e.data.charAt(n)===wo?e.data.length:n},FC=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},UC=function(t,e){var n=ol(t);n&&n.toLowerCase()===e.tagName.toLowerCase()&&function(t,e,n){var r=t.dom;M.from(n.style).map(r.parseStyle).each((function(t){var n=ur(De.fromDom(e)),o=Dt(Dt({},n),t);r.setStyles(e,o)}));var o=M.from(n.class).map((function(t){return t.split(/\s+/)})),i=M.from(e.className).map((function(t){return Y(t.split(/\s+/),(function(t){return""!==t}))}));Gn(o,i,(function(t,n){var o=Y(n,(function(e){return!U(t,e)})),i=Nt(Nt([],t,!0),o,!0);r.setAttrib(e,"class",i.join(" "))}));var a=["style","class"],s=vt(n,(function(t,e){return!U(a,e)}));r.setAttribs(e,s)}(t,e,il(t))},zC=function(t,e){var n,r,o,i,a,s,u,l,c,f,d=t.dom,h=t.schema,p=h.getNonEmptyElements(),m=t.selection.getRng(),g=function(e){var n,o,a,s=r,u=h.getTextInlineElements();if(a=n=e||"TABLE"===l||"HR"===l?d.create(e||c):i.cloneNode(!1),!1===function(t){return t.getParam("keep_styles",!0)}(t))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(u[s.nodeName]){if(qc(s)||Qc(s))continue;o=s.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(a=o,n.appendChild(o))}}while((s=s.parentNode)&&s!==w);return UC(t,n),MC(a),n},v=function(t){var e,n,a=qC(t,r,o);if(Bn(r)&&(t?a>0:a
'},uS=function(t,e){var n,r,o,i,a=t.translate("Rich Text Area"),s=(n=t.id,r=a,e.height,o=function(t){return t.getParam("iframe_attrs",{})}(t),i=De.fromTag("iframe"),tr(i,o),tr(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),Rs(i,"tox-edit-area__iframe"),i).dom;s.onload=function(){s.onload=null,t.fire("load")};var u=function(t,e){if(document.domain!==window.location.hostname&&Ce.browser.isIE()){var n=Mb("mce");t[n]=function(){iS(t)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return aS.setAttrib(e,"src",r),!0}return!1}(t,s);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=s,t.iframeHTML=sS(t),aS.add(e.iframeContainer,s),u},lS=ys.DOM,cS=function(t,e,n){var r=Cb.get(n),o=Cb.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=Ae.trim(n),r&&-1===Ae.inArray(e,n)){if(Ae.each(Cb.dependencies(n),(function(n){cS(t,e,n)})),t.plugins[n])return;try{var i=new r(t,o,t.$);t.plugins[n]=i,i.init&&(i.init(t,o),e.push(n))}catch(e){!function(t,e,n){var r=Os.translate(["Failed to initialize plugin: {0}",e]);od(t,"PluginLoadError",{message:r}),Nb(r,n),Ob(t,r)}(t,n,e)}}},fS=function(t){return t.replace(/^\-/,"")},dS=function(t){return{editorContainer:t,iframeContainer:t,api:{}}},hS=function(t){var e=t.getElement();return t.inline?dS(null):function(t){var e=lS.create("div");return lS.insertAfter(e,t),dS(e)}(e)},pS=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,d(_l(t))?function(t){return t.theme.renderUI()}(t):_(_l(t))?function(t){var e=t.getElement(),n=_l(t)(t,e);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:e.offsetHeight,n}(t):hS(t)},mS=function(t){t.fire("ScriptsLoaded"),function(t){var e=Ae.trim(ul(t)),n=t.ui.registry.getAll().icons,r=Dt(Dt({},hb.get("default").icons),hb.get(e).icons);dt(r,(function(e,r){_t(n,r)||t.ui.registry.addIcon(r,e)}))}(t),function(t){var e=_l(t);if(d(e)){t.settings.theme=fS(e);var n=xb.get(e);t.theme=new n(t,xb.urls[e]),t.theme.init&&t.theme.init(t,xb.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}}(t),function(t){var e=[];Ae.each(xl(t).split(/[ ,]/),(function(n){cS(t,e,fS(n))}))}(t);var e=pS(t);!function(t,e){var n={show:M.from(e.show).getOr(k),hide:M.from(e.hide).getOr(k),disable:M.from(e.disable).getOr(k),isDisabled:M.from(e.isDisabled).getOr(L),enable:function(){t.mode.isReadOnly()||M.from(e.enable).map(N)}};t.ui=Dt(Dt({},t.ui),n)}(t,M.from(e.api).getOr({}));var n={editorContainer:e.editorContainer,iframeContainer:e.iframeContainer};return t.editorContainer=n.editorContainer?n.editorContainer:null,Pb(t),t.inline?iS(t):function(t,e){var n=uS(t,e);e.editorContainer&&(aS.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=aS.isHidden(e.editorContainer)),t.getElement().style.display="none",aS.setAttrib(t.id,"aria-hidden","true"),n||iS(t)}(t,n)},gS=ys.DOM,vS=function(t){return"-"===t.charAt(0)},yS=function(t,e){var n=ml(e),r=function(t){return t.getParam("language_url","","string")}(e);if(!1===Os.hasCode(n)&&"en"!==n){var o=""!==r?r:e.editorManager.baseURL+"/langs/"+n+".js";t.add(o,k,void 0,(function(){!function(t,e,n){Ab(t,"LanguageLoadError",Tb("language",e,n))}(e,o,n)}))}},bS=function(t,e,n){return M.from(e).filter((function(t){return t.length>0&&!hb.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:M.some(e)}}))},_S=function(t,e,n){var r=bS(e,"default",n),o=function(t){return M.from(function(t){return t.getParam("icons_url","","string")}(t)).filter((function(t){return t.length>0})).map((function(t){return{url:t,name:M.none()}}))}(e).orThunk((function(){return bS(e,ul(e),"")}));V(function(t){for(var e=[],n=function(t){e.push(t)},r=0;r
")},mceToggleVisualAid:function(){t.hasVisual=!t.hasVisual,t.addVisual()},mceReplaceContent:function(e,n,r){t.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,t.selection.getContent({format:"text"})))},mceInsertLink:function(e,n,r){"string"==typeof r&&(r={href:r});var o=t.dom.getParent(t.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||t.formatter.remove("link"),r.href&&t.formatter.apply("link",r,o)},selectAll:function(){var e=t.dom.getParent(t.selection.getStart(),Vn);if(e){var n=t.dom.createRng();n.selectNodeContents(e),t.selection.setRng(n)}},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return QC(t,r),!0}});var n=function(e){return function(){var n=t.selection,r=n.isCollapsed()?[t.dom.getParent(n.getNode(),t.dom.isBlock)]:n.getSelectedBlocks(),o=RS(r,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==MS(o,!0)}};e.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){return e.isFormatMatch(t)},mceBlockQuote:function(){return e.isFormatMatch("blockquote")},Outdent:function(){return Nk(t)},"InsertUnorderedList,InsertOrderedList":function(e){var n=t.dom.getParent(t.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===e&&"UL"===n.tagName||"insertorderedlist"===e&&"OL"===n.tagName)}},"state"),e.addCommands({Undo:function(){t.undoManager.undo()},Redo:function(){t.undoManager.redo()}}),e.addQueryValueHandler("FontName",(function(){return function(t){return NS(t,(function(e){return AS(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("FontSize",(function(){return function(t){return NS(t,(function(e){return OS(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("LineHeight",(function(){return function(t){return NS(t,(function(e){var n=De.fromDom(t.getBody()),r=mg(e,(function(t){return sr(t,"line-height")}),A(Pe,n));return r.getOrThunk((function(){var t=parseFloat(ir(e,"line-height")),n=parseFloat(ir(e,"font-size"));return String(t/n)}))})).getOr("")}(t)}),this)},t}(),BS="data-mce-contenteditable",qS=function(t,e,n){var r,o;$s(t,e)&&!1===n?(o=e,Is(r=t)?r.dom.classList.remove(o):js(r,o),Ms(r)):n&&Rs(t,e)},FS=function(t,e,n){try{t.getDoc().execCommand(e,!1,String(n))}catch(t){}},US=function(t,e){t.dom.contentEditable=e?"true":"false"},zS=function(t,e){var n=De.fromDom(t.getBody());qS(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),function(t){M.from(t.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")}))}(t),t.readonly=!0,US(n,!1),V(qs(n,'*[contenteditable="true"]'),(function(t){Jn(t,BS,"true"),US(t,!1)}))):(t.readonly=!1,US(n,!0),function(t){V(qs(t,"*["+BS+'="true"]'),(function(t){rr(t,BS),US(t,!0)}))}(n),FS(t,"StyleWithCSS",!1),FS(t,"enableInlineTableEditing",!1),FS(t,"enableObjectResizing",!1),Ch(t)&&t.focus(),function(t){t.selection.setRng(t.selection.getRng())}(t),t.nodeChanged())},HS=function(t){return t.readonly},VS=function(t){t.parser.addAttributeFilter("contenteditable",(function(e){HS(t)&&V(e,(function(t){t.attr(BS,t.attr("contenteditable")),t.attr("contenteditable","false")}))})),t.serializer.addAttributeFilter(BS,(function(e){HS(t)&&V(e,(function(t){t.attr("contenteditable",t.attr(BS))}))})),t.serializer.addTempAttr(BS)},KS=function(t,e){if(function(t){return"click"===t.type}(e)&&!sd.metaKeyPressed(e)){var n=De.fromDom(e.target);(function(t,e){return Jr(e,"a",(function(e){return Pe(e,De.fromDom(t.getBody()))})).bind((function(t){return nr(t,"href")}))})(t,n).each((function(n){if(e.preventDefault(),/^#/.test(n)){var r=t.dom.select(n+',[name="'+(($t(o=n,i="#")?function(t,e){return t.substring(e)}(o,i.length):o)+'"]'));r.length&&t.selection.scrollIntoView(r[0],!0)}else window.open(n,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes");var o,i}))}},WS=Ae.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),YS=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||L}return t.isNative=function(t){return!!WS[t.toLowerCase()]},t.prototype.fire=function(t,e){var n=t.toLowerCase(),r=Ri(n,e||{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,a=o.length;i"),lE);return o[o.length-1]=Ae.extend(o[o.length-1],{func:n,scope:r||this.editor}),Ae.extend(o[0],{desc:this.editor.translate(e),subpatterns:o.slice(1)})},t.prototype.hasModifier=function(t){return t.altKey||t.ctrlKey||t.metaKey},t.prototype.isFunctionKey=function(t){return"keydown"===t.type&&t.keyCode>=112&&t.keyCode<=123},t.prototype.matchShortcut=function(t,e){return!!e&&(e.ctrl===t.ctrlKey&&e.meta===t.metaKey&&(e.alt===t.altKey&&e.shift===t.shiftKey&&(!!(t.keyCode===e.keyCode||t.charCode&&t.charCode===e.charCode)&&(t.preventDefault(),!0))))},t.prototype.executeShortcutAction=function(t){return t.func?t.func.call(t.scope):null},t}(),fE=function(){var t=function(){var t={},e={},n={},r={},o={},i={},a={},s=function(t,e){return function(n,r){return t[n.toLowerCase()]=Dt(Dt({},r),{type:e})}};return{addButton:s(t,"button"),addGroupToolbarButton:s(t,"grouptoolbarbutton"),addToggleButton:s(t,"togglebutton"),addMenuButton:s(t,"menubutton"),addSplitButton:s(t,"splitbutton"),addMenuItem:s(e,"menuitem"),addNestedMenuItem:s(e,"nestedmenuitem"),addToggleMenuItem:s(e,"togglemenuitem"),addAutocompleter:s(n,"autocompleter"),addContextMenu:s(o,"contextmenu"),addContextToolbar:s(i,"contexttoolbar"),addContextForm:s(i,"contextform"),addSidebar:s(a,"sidebar"),addIcon:function(t,e){return r[t.toLowerCase()]=e},getAll:function(){return{buttons:t,menuItems:e,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:a}}}}();return{addAutocompleter:t.addAutocompleter,addButton:t.addButton,addContextForm:t.addContextForm,addContextMenu:t.addContextMenu,addContextToolbar:t.addContextToolbar,addIcon:t.addIcon,addMenuButton:t.addMenuButton,addMenuItem:t.addMenuItem,addNestedMenuItem:t.addNestedMenuItem,addSidebar:t.addSidebar,addSplitButton:t.addSplitButton,addToggleButton:t.addToggleButton,addGroupToolbarButton:t.addGroupToolbarButton,addToggleMenuItem:t.addToggleMenuItem,getAll:t.getAll}},dE=ys.DOM,hE=Ae.extend,pE=Ae.each,mE=Ae.resolve,gE=Ce.ie,vE=function(){function t(t,e,n){var r=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,hE(this,eE),this.settings=cb(this,t,this.documentBaseUrl,n.defaultSettings,e),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(ks.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),ys.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),As.languageLoad=this.settings.language_load,As.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new zh(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new cE(this),this.editorCommands=new $S(this),this.settings.cache_suffix&&(Ce.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:fE(),styleSheetLoader:void 0,show:k,hide:k,enable:k,disable:k,isDisabled:L};var o=oE(this);this.mode=o,this.setMode=o.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=fs.overrideDefaults((function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}}))}return t.prototype.render=function(){kS(this)},t.prototype.focus=function(t){this.execCommand("mceFocus",!1,t)},t.prototype.hasFocus=function(){return kh(this)},t.prototype.execCallback=function(t){for(var e=[],n=1;n')},editorImage:function(t){for(var e=0;e
<\/p>)+|(
<\/p>)+$/gi,""),t.updateEmojiQuick(n),t._content=n,t.$emit("input",t._content),t.$nextTick((function(e){var n=t.quill.getSelection();if(n){var r=t.quill.getText(n.index);/^\n\n$/.test(r)&&t.quill.deleteText(n.index,1)}}))})),this.quill.clipboard.addMatcher(Node.ELEMENT_NODE,(function(t,e){return e.ops=e.ops.map((function(e){var n={attributes:{},insert:e.insert};try{"object"===F(n.insert.mention)&&t.innerHTML&&(n.insert=t.innerHTML.replace(/<[^>]+>/g,""))}catch(t){}return e.attributes&&["bold","strike","italic","underline","list","blockquote","link"].some((function(t){e.attributes[t]&&(n.attributes[t]=e.attributes[t])})),n})),e})),this.$emit("on-ready",this.quill),this.disabledRecord||$A.loadScriptS(["js/recorder/recorder.mp3.min.js","js/recorder/lib.fft.js","js/recorder/frequency.histogram.view.js"],(function(e){null===e&&"function"==typeof window.Recorder&&(t.recordRec=window.Recorder({type:"mp3",bitRate:32,sampleRate:16e3,onProcess:function(e,n,r,o,i,a){t.recordWave.input(e[e.length-1],n,o),t.recordDuration=r,r>=18e4&&t.stopRecord(!1)}}),window.Recorder.Support()&&(t.recordReady=!0,t.$nextTick((function(e){t.recordWave=window.Recorder.FrequencyHistogramView({elem:t.$refs.recwave,lineCount:90,position:0,minHeight:1,stripeEnable:!1})}))))}))},updateEmojiQuick:function(t){var e=this;this.isFocus&&t?(this.emojiQuickTimer&&clearTimeout(this.emojiQuickTimer),this.emojiQuickTimer=setTimeout((function(n){if((t=(t=t.replace(/ /g," ")).replace(/<[^>]+>/g,""))&&-1===t.indexOf(" ")&&t.length>=1&&t.length<=4&&$A.isArray(window.emoticonData)){e.emojiQuickItems=[];var r=$A.apiUrl("../images/emoticon");if(window.emoticonData.some((function(n){var o=n.list.find((function(e){return $A.strExists(e.name+(e.key?" ".concat(e.key):""),t)}));if(o&&(e.emojiQuickItems.push(Object.assign(o,{type:"emoticon",asset:"images/emoticon/".concat(n.path,"/").concat(o.path),src:"".concat(r,"/").concat(n.path,"/").concat(o.path)})),e.emojiQuickItems.length>=3))return!0})),e.emojiQuickItems.length>0)return void e.$nextTick((function(t){e.emojiQuickShow=!0,e.$refs.emojiQuickRef.updatePopper()}))}e.emojiQuickShow=!1}),100)):this.emojiQuickShow=!1},setText:function(t){this.quill&&this.quill.setText(t)},setContent:function(t){this.quill&&this.quill.setContents(this.quill.clipboard.convert(t))},getInputCache:function(){var t=this,e=this.dialogInputCache.find((function(e){return e.key==t.cacheKey}));return e?e.cache:""},onClickEditor:function(){this.updateEmojiQuick(this.value)},focus:function(){var t=this;this.$nextTick((function(){t.quill&&(t.quill.setSelection(t.quill.getLength()),t.quill.focus())}))},blur:function(){var t=this;this.$nextTick((function(){t.quill&&t.quill.blur()}))},clickSend:function(t,e){if(!this.loading)switch(t){case"down":if(this.touchLimitX=!1,this.touchLimitY=!1,this.touchStart="touchstart"===e.type?e.touches[0]:e,this.startRecord())return;break;case"move":var n="touchmove"===e.type?e.touches[0]:e;this.touchLimitX=(this.touchStart.clientX-n.clientX)/window.innerWidth>.1,this.touchLimitY=(this.touchStart.clientY-n.clientY)/window.innerHeight>.1;break;case"up":if(this.stopRecord(this.touchLimitY))return;if(this.touchLimitY||this.touchLimitX)return;this.onSend()}},onSend:function(){this.rangeIndex=0,this.$emit("on-send")},startRecord:function(){var t=this;return"recorder"===this.sendClass&&(q.Store.set("audioSubscribe",!0),this.recordDuration=0,this.recordState="ready",this.$nextTick((function(e){t.recordRec.open((function(e){"ready"===t.recordState?(t.recordState="ing",t.recordBlob=null,setTimeout((function(e){t.recordRec.start()}),300)):t.recordRec.close()}),(function(e){t.recordState="stop",$A.messageError(e||"打开录音失败")}))})),!0)},stopRecord:function(t){var e=this;switch(this.recordState){case"ing":return this.recordState="stop",this.recordRec.stop((function(n,r){e.recordRec.close(),!0!==t&&(r<600?$A.messageWarning("说话时间太短"):(e.recordBlob=n,e.uploadRecord(r)))}),(function(t){e.recordRec.close(),$A.messageError(t||"录音失败")})),!0;case"ready":return this.recordState="stop",!0;default:return this.recordState="stop",!1}},hidePopover:function(){this.showMore=!1,this.showEmoji=!1,this.emojiQuickShow=!1},onClickCover:function(){var t=this;this.hidePopover(),this.$nextTick((function(e){var n;null===(n=t.quill)||void 0===n||n.focus()}))},uploadRecord:function(t){var e=this;if(null!==this.recordBlob){var n=new FileReader;n.onloadend=function(){e.$emit("on-record",{type:e.recordBlob.type,base64:n.result,duration:t})},n.readAsDataURL(this.recordBlob)}},onEmojiQuick:function(t){"online"===t.type?(this.$emit("input",""),this.$emit("on-send",''))):(this.$emit("input",""),this.$emit("on-send",'
'))),this.emojiQuickShow=!1,this.focus()},onSelectEmoji:function(t){this.quill&&("emoji"===t.type?(this.quill.insertText(this.rangeIndex,t.text),this.rangeIndex+=t.text.length,this.windowLarge&&(this.showEmoji=!1)):"emoticon"===t.type&&(this.$emit("on-send",'
')),"emosearch"===t.asset&&this.$emit("input",""),this.windowLarge&&(this.showEmoji=!1)))},onCancelReply:function(){this.$emit("on-cancel-reply")},onToolbar:function(t){switch(this.hidePopover(),t){case"user":this.openMenu("@");break;case"task":this.openMenu("#");break;case"meeting":q.Store.set("addMeeting",{type:"create",dialog_id:this.dialogId,userids:[this.userId]});break;case"call":case"image":case"file":this.$emit("on-more",t)}},onMoreVisibleChange:function(t){this.showMore=t},openMenu:function(t){if(this.quill)if(0===this.value.length||this.value.endsWith("
]*?>$/.test(n.text)?r.push("an-emoticon"):/^\s*
').append(o),l.setStartAfter(u[0].firstChild.firstChild),l.setEndAfter(o)):(u.empty().append(_o).append(o).append(_o),l.setStart(u[0].firstChild,1),l.setEnd(u[0].lastChild,0)),u.css({top:r.getPos(e,t.getBody()).y}),u[0].focus();var c=n.getSel();return c.removeAllRanges(),c.addRange(l),l}(o,a.targetClone,i),c=De.fromDom(o);return V(qs(De.fromDom(t.getBody()),"*[data-mce-selected]"),(function(t){Pe(c,t)||rr(t,u)})),r.getAttrib(o,u)||o.setAttribute(u,"1"),e=o,w(),l},b=function(t,e){if(!t)return null;if(t.collapsed){if(!m(t)){var n=e?1:-1,o=fc(n,i,t),a=o.getNode(!e);if(zl(a))return h(n,a,!!e&&!o.isAtEnd(),!1);var s=o.getNode(e);if(zl(s))return h(n,s,!e&&!o.isAtEnd(),!1)}return null}var u=t.startContainer,c=t.startOffset,f=t.endOffset;if(3===u.nodeType&&0===c&&Hx(u.parentNode)&&(u=u.parentNode,c=r.nodeIndex(u),u=u.parentNode),1!==u.nodeType)return null;if(f===c+1&&u===t.endContainer){var d=u.childNodes[c];if(l(d))return v(d)}return null},_=function(){e&&e.removeAttribute(u),Qr(De.fromDom(t.getBody()),"#"+s).each(vn),e=null},w=function(){a.hide()};return Ce.ceFalse&&!ty(t)&&function(){t.on("mouseup",(function(e){var n=d();n.collapsed&&_b(t,e.clientX,e.clientY)&&I_(t,n,!1).each(f)})),t.on("click",(function(e){var o=Vx(t,e.target);o&&(Hx(o)&&(e.preventDefault(),t.focus()),zx(o)&&r.isChildOf(o,n.getNode())&&_())})),t.on("blur NewBlock",_),t.on("ResizeWindow FullscreenStateChanged",a.reposition);var u=function(e,n){var i,a,s=r.getParent(e,o),u=r.getParent(n,o);return!y(s)&&(!(e===u||!r.isChildOf(s,u)||!1!==Hx(Vx(t,s)))||!r.isChildOf(u,s)&&(i=s,a=u,!(r.getParent(i,o)===r.getParent(a,o)))&&function(t){var e=t.firstChild;if(y(e))return!1;var n=Nu.before(e);if(zn(n.getNode())&&1===t.childNodes.length)return!c(n);var r=Ec(t).next(n);return r&&!c(r)}(s))};t.on("tap",(function(e){var n=e.target,r=Vx(t,n);Hx(r)?(e.preventDefault(),L_(t,r).each(b)):l(n)&&L_(t,n).each(b)}),!0),t.on("mousedown",(function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==_b(t,e.clientX,e.clientY)){var a=Vx(t,o);if(a)Hx(a)?(e.preventDefault(),L_(t,a).each(b)):(_(),zx(a)&&e.shiftKey||rd(e.clientX,e.clientY,n.getRng())||(w(),n.placeCaretAt(e.clientX,e.clientY)));else if(l(o))L_(t,o).each(b);else if(!1===zl(o)){_(),w();var s=nk(i,e.clientX,e.clientY);if(s&&!u(o,s.node)){e.preventDefault();var c=h(1,s.node,s.before,!1);f(c),t.getBody().focus()}}}})),t.on("keypress",(function(t){sd.modifierPressed(t)||Hx(n.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(t){t.range=g(t.range);var e=b(t.range,t.forward);e&&(t.range=e)})),t.on("AfterSetSelectionRange",(function(t){var e,n=t.range,o=n.startContainer.parentNode;m(n)||"mcepastebin"===o.id||w(),e=o,r.hasClass(e,"mce-offscreen-selection")||_()})),t.on("copy",(function(t){var e,n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!Ce.ie){var o=(e=r.get(s))?e.getElementsByTagName("*")[0]:e;o&&(t.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText))}})),Ux(t),function(t){var e=Ds((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=P_(t,e,!1);t.selection.setRng(n)}}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))}(t),function(t){t.on("init",(function(){t.on("focusin",(function(e){var n=e.target;if(Yn(n)){var r=nd(t.getBody(),n),o=Kn(r)?r:n;t.selection.getNode()!==o&&L_(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))}(t)}(),{showCaret:h,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(jo(t),f(d()),n.scrollIntoView(t))},hideFakeCaret:w,destroy:function(){a.destroy(),e=null}}},Wx=function(t){var e,n,r=Ae.each,o=sd.BACKSPACE,i=sd.DELETE,a=t.dom,s=t.selection,u=t.parser,l=Ce.gecko,c=Ce.ie,f=Ce.webkit,d="data:text/mce-internal,",h=c?"Text":"URL",p=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},m=function(t){return t.isDefaultPrevented()},g=function(){var e=function(t){var e=a.create("body"),n=t.cloneContents();return e.appendChild(n),s.serializer.serialize(e,{format:"html"})};t.on("keydown",(function(n){var r,s,u=n.keyCode;if(!m(n)&&(u===i||u===o)){if(r=t.selection.isCollapsed(),s=t.getBody(),r&&!a.isEmpty(s))return;if(!r&&!function(n){var r=e(n),o=a.createRng();return o.selectNode(t.getBody()),r===e(o)}(t.selection.getRng()))return;n.preventDefault(),t.setContent(""),s.firstChild&&a.isBlock(s.firstChild)?t.selection.setCursorLocation(s.firstChild,0):t.selection.setCursorLocation(s,0),t.nodeChanged()}}))},v=function(){t.shortcuts.add("meta+a",null,"SelectAll")},y=function(){t.inline||a.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=s.getRng(),t.getBody().focus(),"mousedown"===e.type){if(Ao(n.startContainer))return;s.placeCaretAt(e.clientX,e.clientY)}else s.setRng(n)}))},b=function(){Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!m(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),oo.setEditorTimeout(t,(function(){n.focus()}))}}))},_=function(){t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==a.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&a.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),s.select(n))}))},w=function(){t.on("keydown",(function(t){if(!m(t)&&t.keyCode===o&&s.isCollapsed()&&0===s.getRng().startOffset){var e=s.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},C=function(){(function(t){return t.getParam("readonly")})(t)||t.on("BeforeExecCommand mousedown",(function(){p("StyleWithCSS",!1),p("enableInlineTableEditing",!1),yl(t)||p("enableObjectResizing",!1)}))},x=function(){t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||r(a.select("a"),(function(t){var e=t.parentNode,n=a.getRoot();if(e.lastChild===t){for(;e&&!a.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}a.add(e,"br",{"data-mce-bogus":1})}}))}))},S=function(){t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},E=function(){t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()}))},O=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(Ce.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))},A=function(){Ce.mac&&t.on("keydown",(function(e){!sd.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}))},T=function(){t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},D=function(){t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))}))},N=function(){t.on("dragstart",(function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&s.select(e.target),(n=t.selection.getContent()).length>0&&(r=d+escape(t.id)+","+escape(n),e.dataTransfer.setData(h,r)))}(e)})),t.on("drop",(function(e){if(!m(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(h))&&e.indexOf(d)>=0?(e=e.substr(d.length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=fd(e.x,e.y,t.getDoc());s.setRng(r),o=n.html,i=!0,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):t.execCommand("mceInsertContent",!1,o)}}var o,i}))},L=k;return ty(t)?(f&&(y(),_(),D(),v(),Ce.iOS&&(E(),O(),T())),l&&(b(),C(),S(),A())):(t.on("keydown",(function(e){var n,r;if(!m(e)&&e.keyCode===sd.BACKSPACE){var o=(n=s.getRng()).startContainer,i=n.startOffset,u=a.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==u;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=a.createRng()).setStart(o,0),n.setEnd(o,0),s.setRng(n))}}})),g(),Ce.windowsPhone||t.on("keyup focusin mouseup",(function(t){sd.modifierPressed(t)||s.normalize()}),!0),f&&(y(),_(),ol(t)&&t.on("init",(function(){p("DefaultParagraphSeparator",ol(t))})),D(),w(),u.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),Ce.iOS?(E(),O(),T()):v()),Ce.ie>=11&&(O(),w()),Ce.ie&&(v(),p("AutoUrlDetect",!1),N()),l&&(t.on("keydown",(function(e){if(!m(e)&&e.keyCode===o){if(!t.getBody().getElementsByTagName("hr").length)return;if(s.isCollapsed()&&0===s.getRng().startOffset){var n=s.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return a.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(a.remove(r),e.preventDefault())}}})),b(),e=function(){var e=a.getAttribs(s.getStart().cloneNode(!1));return function(){var n=s.getStart();n!==t.getBody()&&(a.setAttrib(n,"style",null),r(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}},n=function(){return!s.isCollapsed()&&a.getParent(s.getStart(),a.isBlock)!==a.getParent(s.getEnd(),a.isBlock)},t.on("keypress",(function(r){var o;if(!m(r)&&(8===r.keyCode||46===r.keyCode)&&n())return o=e(),t.getDoc().execCommand("delete",!1,null),o(),r.preventDefault(),!1})),a.bind(t.getDoc(),"cut",(function(r){var o;!m(r)&&n()&&(o=e(),oo.setEditorTimeout(t,(function(){o()})))})),C(),x(),S(),A(),w())),{refreshContentEditable:L,isHidden:function(){if(!l||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}},Yx=ys.DOM,Zx=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},Gx=function(t){return vt(t,(function(t){return!1===v(t)}))},Xx=function(t){var e=t.settings;return Gx({block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements,padd_empty_block_inline_children:e.format_empty_lines})},Qx=function(t){var e=t.settings,n=t.editorUpload.blobCache;return Gx({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:Zx(t),validate:!0,blob_cache:n,document:t.getDoc(),images_dataimg_filter:e.images_dataimg_filter})},Jx=function(t){var e=t.dom.getRoot();t.inline||Vf(t)&&t.selection.getStart(!0)!==e||Mc(e).each((function(e){var n=e.getNode(),r=Rn(n)?Mc(n).getOr(e):e;Ce.browser.isIE()?function(t,e){var n=De.fromDom(t.getBody()),r=(ih(t)?M.from(e):M.none()).map(ah).filter(oh(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))},tS=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),Jx(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&oo.setEditorTimeout(t,(function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()}),100)}(t)},eS=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader},nS=function(t){var e=eS(t),n=vl(t),r=t.contentCSS,o=function(){e.unloadAll(r),t.inline||t.ui.styleSheetLoader.unloadAll(n)},i=function(){t.removed?o():t.on("remove",o)};if(t.contentStyles.length>0){var a="";Ae.each(t.contentStyles,(function(t){a+=t+"\r\n"})),t.dom.addStyle(a)}var s=to.all(function(t,e,n){var r=[new to((function(n,r){return eS(t).loadAll(e,n,r)}))];return t.inline?r:r.concat([new to((function(e,r){return t.ui.styleSheetLoader.loadAll(n,e,r)}))])}(t,r,n)).then(i).catch(i);return t.settings.content_style&&function(t,e){var n=De.fromDom(t.getBody()),r=un(sn(n)),o=De.fromTag("style");Jn(o,"type","text/css"),pn(o,De.fromText(e)),pn(r,o),t.on("remove",(function(){vn(o)}))}(t,t.settings.content_style),s},rS=function(t){var e=t.settings,n=t.getDoc(),r=t.getBody();!function(t){t.fire("PreInit")}(t),e.browser_spellcheck||e.gecko_spellcheck||(n.body.spellcheck=!1,Yx.setAttrib(r,"spellcheck","false")),t.quirks=Wx(t),function(t){t.fire("PostRender")}(t);var o=function(t){return t.getParam("directionality",Os.isRtl()?"rtl":void 0)}(t);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",(function(t){Ae.each(e.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type}))},oS=function(t){!0!==t.removed&&(!function(t){ty(t)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"})}(t),tS(t))},iS=function(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(Yx.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i=t.getBody();i.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===Yx.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=Fb(t),t.schema=Ni(Xx(t)),t.dom=ys(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:hl(t),referrerPolicy:pl(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=Ny(Qx(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){for(var r,o,i=e.length,a=t.dom,s="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(s)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=a.serializeStyle(a.parseStyle(o),r.name)).length||(o=null),r.attr(s,o),r.attr(n,o)):"tabindex"===n?(r.attr(s,o),r.attr(n,null)):r.attr(s,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){for(var n=e.length;n--;){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){for(var n=e.length,r=t.schema.getNonEmptyElements();n--;){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new jh("br",1)).shortEnded=!0)}})),e}(t),t.serializer=Ry(function(t){var e=t.settings;return Dt(Dt(Dt({},Qx(t)),Xx(t)),Gx({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before}))}(t),t),t.selection=hy(t.dom,t.getWin(),t.serializer,t),t.annotator=td(t),t.formatter=Yb(t),t.undoManager=Gb(t),t._nodeChangeDispatcher=new Ax(t),t._selectionOverrides=Kx(t),Bk(t),Tx(t),ty(t)||Nx(t);var a=function(t){return ty(t)?Cs(null):Ox(t)}(t);Mk(t,a),function(t){ol(t)&&t.on("NodeChange",A(zk,t))}(t),e_(t);var s=ey(t);rS(t),s.fold((function(){nS(t).then((function(){return oS(t)}))}),(function(e){t.setProgressState(!0),nS(t).then((function(){e().then((function(e){t.setProgressState(!1),oS(t)}),(function(e){t.notificationManager.open({type:"error",text:String(e)}),oS(t)}))}))}))},aS=ys.DOM,sS=function(t){var e=function(t){return t.getParam("doctype","")}(t)+"";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+='
\s*<\/p>)+|(
\s*<\/p>)+$/gi,"")).replace(/^(
<\/p>)+|(
<\/p>)+$/gi,""),t.updateEmojiQuick(n),t._content=n,t.$emit("input",t._content),t.$nextTick((function(e){var n=t.quill.getSelection();if(n){var r=t.quill.getText(n.index);/^\n\n$/.test(r)&&t.quill.deleteText(n.index,1)}}))})),this.quill.clipboard.addMatcher(Node.ELEMENT_NODE,(function(t,e){return e.ops=e.ops.map((function(e){var n={attributes:{},insert:e.insert};try{"object"===F(n.insert.mention)&&t.innerHTML&&(n.insert=t.innerHTML.replace(/<[^>]+>/g,""))}catch(t){}return e.attributes&&["bold","strike","italic","underline","list","blockquote","link"].some((function(t){e.attributes[t]&&(n.attributes[t]=e.attributes[t])})),n})),e})),this.$emit("on-ready",this.quill),this.disabledRecord||$A.loadScriptS(["js/recorder/recorder.mp3.min.js","js/recorder/lib.fft.js","js/recorder/frequency.histogram.view.js"],(function(e){null===e&&"function"==typeof window.Recorder&&(t.recordRec=window.Recorder({type:"mp3",bitRate:32,sampleRate:16e3,onProcess:function(e,n,r,o,i,a){t.recordWave.input(e[e.length-1],n,o),t.recordDuration=r,r>=18e4&&t.stopRecord(!1)}}),window.Recorder.Support()&&(t.recordReady=!0,t.$nextTick((function(e){t.recordWave=window.Recorder.FrequencyHistogramView({elem:t.$refs.recwave,lineCount:90,position:0,minHeight:1,stripeEnable:!1})}))))}))},updateEmojiQuick:function(t){var e=this;this.isFocus&&t?(this.emojiQuickTimer&&clearTimeout(this.emojiQuickTimer),this.emojiQuickTimer=setTimeout((function(n){if((t=(t=t.replace(/ /g," ")).replace(/<[^>]+>/g,""))&&-1===t.indexOf(" ")&&t.length>=1&&t.length<=4&&$A.isArray(window.emoticonData)){e.emojiQuickItems=[];var r=$A.apiUrl("../images/emoticon");if(window.emoticonData.some((function(n){var o=n.list.find((function(e){return $A.strExists(e.name+(e.key?" ".concat(e.key):""),t)}));if(o&&(e.emojiQuickItems.push(Object.assign(o,{type:"emoticon",asset:"images/emoticon/".concat(n.path,"/").concat(o.path),src:"".concat(r,"/").concat(n.path,"/").concat(o.path)})),e.emojiQuickItems.length>=3))return!0})),e.emojiQuickItems.length>0)return void e.$nextTick((function(t){e.emojiQuickShow=!0,e.$refs.emojiQuickRef.updatePopper()}))}e.emojiQuickShow=!1}),100)):this.emojiQuickShow=!1},setText:function(t){this.quill&&this.quill.setText(t)},setContent:function(t){this.quill&&this.quill.setContents(this.quill.clipboard.convert(t))},getInputCache:function(){var t=this,e=this.dialogInputCache.find((function(e){return e.key==t.cacheKey}));return e?e.cache:""},onClickEditor:function(){this.updateEmojiQuick(this.value)},focus:function(){var t=this;this.$nextTick((function(){t.quill&&(t.quill.setSelection(t.quill.getLength()),t.quill.focus())}))},blur:function(){var t=this;this.$nextTick((function(){t.quill&&t.quill.blur()}))},clickSend:function(t,e){if(!this.loading)switch(t){case"down":if(this.touchLimitX=!1,this.touchLimitY=!1,this.touchStart="touchstart"===e.type?e.touches[0]:e,this.startRecord())return;break;case"move":var n="touchmove"===e.type?e.touches[0]:e;this.touchLimitX=(this.touchStart.clientX-n.clientX)/window.innerWidth>.1,this.touchLimitY=(this.touchStart.clientY-n.clientY)/window.innerHeight>.1;break;case"up":if(this.stopRecord(this.touchLimitY))return;if(this.touchLimitY||this.touchLimitX)return;this.onSend()}},onSend:function(){this.rangeIndex=0,this.$emit("on-send")},startRecord:function(){var t=this;return"recorder"===this.sendClass&&(q.Store.set("audioSubscribe",!0),this.recordDuration=0,this.recordState="ready",this.$nextTick((function(e){t.recordRec.open((function(e){"ready"===t.recordState?(t.recordState="ing",t.recordBlob=null,setTimeout((function(e){t.recordRec.start()}),300)):t.recordRec.close()}),(function(e){t.recordState="stop",$A.messageError(e||"打开录音失败")}))})),!0)},stopRecord:function(t){var e=this;switch(this.recordState){case"ing":return this.recordState="stop",this.recordRec.stop((function(n,r){e.recordRec.close(),!0!==t&&(r<600?$A.messageWarning("说话时间太短"):(e.recordBlob=n,e.uploadRecord(r)))}),(function(t){e.recordRec.close(),$A.messageError(t||"录音失败")})),!0;case"ready":return this.recordState="stop",!0;default:return this.recordState="stop",!1}},hidePopover:function(){this.showMore=!1,this.showEmoji=!1,this.emojiQuickShow=!1},onClickCover:function(){var t=this;this.hidePopover(),this.$nextTick((function(e){var n;null===(n=t.quill)||void 0===n||n.focus()}))},uploadRecord:function(t){var e=this;if(null!==this.recordBlob){var n=new FileReader;n.onloadend=function(){e.$emit("on-record",{type:e.recordBlob.type,base64:n.result,duration:t})},n.readAsDataURL(this.recordBlob)}},onEmojiQuick:function(t){"online"===t.type?(this.$emit("input",""),this.$emit("on-send",''))):(this.$emit("input",""),this.$emit("on-send",'
'))),this.emojiQuickShow=!1,this.focus()},onSelectEmoji:function(t){this.quill&&("emoji"===t.type?(this.quill.insertText(this.rangeIndex,t.text),this.rangeIndex+=t.text.length,this.windowLarge&&(this.showEmoji=!1)):"emoticon"===t.type&&(this.$emit("on-send",'
')),"emosearch"===t.asset&&this.$emit("input",""),this.windowLarge&&(this.showEmoji=!1)))},onCancelReply:function(){this.$emit("on-cancel-reply")},onToolbar:function(t){switch(this.hidePopover(),t){case"user":this.openMenu("@");break;case"task":this.openMenu("#");break;case"meeting":q.Store.set("addMeeting",{type:"create",dialog_id:this.dialogId,userids:[this.userId]});break;case"call":case"image":case"file":this.$emit("on-more",t)}},onMoreVisibleChange:function(t){this.showMore=t},openMenu:function(t){if(this.quill)if(0===this.value.length||this.value.endsWith("
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){1,3}\s*<\/p>\s*$/.test(r.text))&&i.push("transparent"),i},contentClass:function(){var t=this.msgData,e=t.type,n=t.msg,r=[];return"text"===e&&(/^]*?>$/.test(n.text)?r.push("an-emoticon"):/^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){3}\s*<\/p>\s*$/.test(n.text)?r.push("three-emoji"):/^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){2}\s*<\/p>\s*$/.test(n.text)?r.push("two-emoji"):/^\s*
\s*[\uD800-\uDBFF][\uDC00-\uDFFF]\s*<\/p>\s*$/.test(n.text)&&r.push("an-emoji")),r}}),watch:{operateAction:function(t){var e=this;this.operateEnter=!1,t&&setTimeout((function(t){return e.operateEnter=!0}),500)}},methods:{handleLongpress:function(t,e){this.$emit("on-longpress",{event:t,el:e,msgData:this.msgData})},openTodo:function(){var t=this;this.todoLoad>0||(this.todoShow?this.todoShow=!1:(this.todoLoad++,this.$store.dispatch("call",{url:"dialog/msg/todolist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.todoList=n})).catch((function(){t.todoList=[]})).finally((function(e){setTimeout((function(){t.todoLoad--,t.todoShow=!0}),100)}))))},openReadPercentage:function(){var t=this;this.percentageLoad>0||(this.percentageShow?this.percentageShow=!1:(this.percentageLoad++,this.$store.dispatch("call",{url:"dialog/msg/readlist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.percentageList=n})).catch((function(){t.percentageList=[]})).finally((function(e){setTimeout((function(){t.percentageLoad--,t.percentageShow=!0}),100)}))))},recordStyle:function(t){var e=t.duration;return{width:50+Math.min(180,Math.floor(e/150))+"px"}},recordDuration:function(t){var e=Math.floor(t/6e4),n=Math.floor(t/1e3)%60;return e>0?"".concat(e,":").concat(n,"″"):"".concat(Math.max(1,n),"″")},imageStyle:function(t){var e=t.width,n=t.height;if(e&&n){var r=e,o=n;return(e>220||n>220)&&(e>n?(r=220,o=n*(220/e)):(r=e*(220/n),o=220)),{width:r+"px",height:o+"px"}}return{}},playRecord:function(){this.operateVisible||l.Store.set("audioSubscribe",{id:this.msgData.id,src:this.msgData.msg.path})},openMeeting:function(){this.operateVisible||l.Store.set("addMeeting",{type:"join",name:this.msgData.msg.name,meetingid:this.msgData.msg.meetingid,meetingdisabled:!0})},viewReply:function(){this.$emit("on-view-reply",{msg_id:this.msgData.id,reply_id:this.msgData.reply_id})},viewText:function(t){this.$emit("on-view-text",t)},viewFile:function(){this.$emit("on-view-file",this.msgData)},downFile:function(){this.$emit("on-down-file",this.msgData)},replyList:function(){this.$emit("on-reply-list",{msg_id:this.msgData.id})},onError:function(){this.$emit("on-error",this.msgData)},onEmoji:function(t){this.$emit("on-emoji",{msg_id:this.msgData.id,symbol:t})},onShowEmojiUser:function(t){this.$emit("on-show-emoji-user",t)}}};function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function v(t){for(var e=1;e
\s*<\/p>)+|(
\s*<\/p>)+$/gi,"")).replace(/^(
<\/p>)+|(
<\/p>)+$/gi,""),t.updateEmojiQuick(n),t._content=n,t.$emit("input",t._content),t.$nextTick((function(e){var n=t.quill.getSelection();if(n){var o=t.quill.getText(n.index);/^\n\n$/.test(o)&&t.quill.deleteText(n.index,1)}}))})),this.quill.clipboard.addMatcher(Node.ELEMENT_NODE,(function(t,e){return e.ops=e.ops.map((function(e){var n={attributes:{},insert:e.insert};try{"object"===F(n.insert.mention)&&t.innerHTML&&(n.insert=t.innerHTML.replace(/<[^>]+>/g,""))}catch(t){}return e.attributes&&["bold","strike","italic","underline","list","blockquote","link"].some((function(t){e.attributes[t]&&(n.attributes[t]=e.attributes[t])})),n})),e})),this.$emit("on-ready",this.quill),this.disabledRecord||$A.loadScriptS(["js/recorder/recorder.mp3.min.js","js/recorder/lib.fft.js","js/recorder/frequency.histogram.view.js"],(function(e){null===e&&"function"==typeof window.Recorder&&(t.recordRec=window.Recorder({type:"mp3",bitRate:32,sampleRate:16e3,onProcess:function(e,n,o,i,r,a){t.recordWave.input(e[e.length-1],n,i),t.recordDuration=o,o>=18e4&&t.stopRecord(!1)}}),window.Recorder.Support()&&(t.recordReady=!0,t.$nextTick((function(e){t.recordWave=window.Recorder.FrequencyHistogramView({elem:t.$refs.recwave,lineCount:90,position:0,minHeight:1,stripeEnable:!1})}))))}))},updateEmojiQuick:function(t){var e=this;this.isFocus&&t?(this.emojiQuickTimer&&clearTimeout(this.emojiQuickTimer),this.emojiQuickTimer=setTimeout((function(n){if((t=(t=t.replace(/ /g," ")).replace(/<[^>]+>/g,""))&&-1===t.indexOf(" ")&&t.length>=1&&t.length<=4&&$A.isArray(window.emoticonData)){e.emojiQuickItems=[];var o=$A.apiUrl("../images/emoticon");if(window.emoticonData.some((function(n){var i=n.list.find((function(e){return $A.strExists(e.name+(e.key?" ".concat(e.key):""),t)}));if(i&&(e.emojiQuickItems.push(Object.assign(i,{type:"emoticon",asset:"images/emoticon/".concat(n.path,"/").concat(i.path),src:"".concat(o,"/").concat(n.path,"/").concat(i.path)})),e.emojiQuickItems.length>=3))return!0})),e.emojiQuickItems.length>0)return void e.$nextTick((function(t){e.emojiQuickShow=!0,e.$refs.emojiQuickRef.updatePopper()}))}e.emojiQuickShow=!1}),100)):this.emojiQuickShow=!1},setText:function(t){this.quill&&this.quill.setText(t)},setContent:function(t){this.quill&&this.quill.setContents(this.quill.clipboard.convert(t))},getInputCache:function(){var t=this,e=this.dialogInputCache.find((function(e){return e.key==t.cacheKey}));return e?e.cache:""},onClickEditor:function(){this.updateEmojiQuick(this.value)},focus:function(){var t=this;this.$nextTick((function(){t.quill&&(t.quill.setSelection(t.quill.getLength()),t.quill.focus())}))},blur:function(){var t=this;this.$nextTick((function(){t.quill&&t.quill.blur()}))},clickSend:function(t,e){if(!this.loading)switch(t){case"down":if(this.touchLimitX=!1,this.touchLimitY=!1,this.touchStart="touchstart"===e.type?e.touches[0]:e,this.startRecord())return;break;case"move":var n="touchmove"===e.type?e.touches[0]:e;this.touchLimitX=(this.touchStart.clientX-n.clientX)/window.innerWidth>.1,this.touchLimitY=(this.touchStart.clientY-n.clientY)/window.innerHeight>.1;break;case"up":if(this.stopRecord(this.touchLimitY))return;if(this.touchLimitY||this.touchLimitX)return;this.onSend()}},onSend:function(){this.rangeIndex=0,this.$emit("on-send")},startRecord:function(){var t=this;return"recorder"===this.sendClass&&(B.Store.set("audioSubscribe",!0),this.recordDuration=0,this.recordState="ready",this.$nextTick((function(e){t.recordRec.open((function(e){"ready"===t.recordState?(t.recordState="ing",t.recordBlob=null,setTimeout((function(e){t.recordRec.start()}),300)):t.recordRec.close()}),(function(e){t.recordState="stop",$A.messageError(e||"打开录音失败")}))})),!0)},stopRecord:function(t){var e=this;switch(this.recordState){case"ing":return this.recordState="stop",this.recordRec.stop((function(n,o){e.recordRec.close(),!0!==t&&(o<600?$A.messageWarning("说话时间太短"):(e.recordBlob=n,e.uploadRecord(o)))}),(function(t){e.recordRec.close(),$A.messageError(t||"录音失败")})),!0;case"ready":return this.recordState="stop",!0;default:return this.recordState="stop",!1}},hidePopover:function(){this.showMore=!1,this.showEmoji=!1,this.emojiQuickShow=!1},onClickCover:function(){var t=this;this.hidePopover(),this.$nextTick((function(e){var n;null===(n=t.quill)||void 0===n||n.focus()}))},uploadRecord:function(t){var e=this;if(null!==this.recordBlob){var n=new FileReader;n.onloadend=function(){e.$emit("on-record",{type:e.recordBlob.type,base64:n.result,duration:t})},n.readAsDataURL(this.recordBlob)}},onEmojiQuick:function(t){"online"===t.type?(this.$emit("input",""),this.$emit("on-send",''))):(this.$emit("input",""),this.$emit("on-send",'
'))),this.emojiQuickShow=!1,this.focus()},onSelectEmoji:function(t){this.quill&&("emoji"===t.type?(this.quill.insertText(this.rangeIndex,t.text),this.rangeIndex+=t.text.length,this.windowLarge&&(this.showEmoji=!1)):"emoticon"===t.type&&(this.$emit("on-send",'
')),"emosearch"===t.asset&&this.$emit("input",""),this.windowLarge&&(this.showEmoji=!1)))},onCancelReply:function(){this.$emit("on-cancel-reply")},onToolbar:function(t){switch(this.hidePopover(),t){case"user":this.openMenu("@");break;case"task":this.openMenu("#");break;case"meeting":B.Store.set("addMeeting",{type:"create",dialog_id:this.dialogId,userids:[this.userId]});break;case"call":case"image":case"file":this.$emit("on-more",t)}},onMoreVisibleChange:function(t){this.showMore=t},openMenu:function(t){if(this.quill)if(0===this.value.length||this.value.endsWith("
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){1,3}\s*<\/p>\s*$/.test(o.text))&&r.push("transparent"),r},contentClass:function(){var t=this.msgData,e=t.type,n=t.msg,o=[];return"text"===e&&(/^]*?>$/.test(n.text)?o.push("an-emoticon"):/^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){3}\s*<\/p>\s*$/.test(n.text)?o.push("three-emoji"):/^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){2}\s*<\/p>\s*$/.test(n.text)?o.push("two-emoji"):/^\s*
\s*[\uD800-\uDBFF][\uDC00-\uDFFF]\s*<\/p>\s*$/.test(n.text)&&o.push("an-emoji")),o}}),watch:{operateAction:function(t){var e=this;this.operateEnter=!1,t&&setTimeout((function(t){return e.operateEnter=!0}),500)}},methods:{handleLongpress:function(t,e){this.$emit("on-longpress",{event:t,el:e,msgData:this.msgData})},openTodo:function(){var t=this;this.todoLoad>0||(this.todoShow?this.todoShow=!1:(this.todoLoad++,this.$store.dispatch("call",{url:"dialog/msg/todolist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.todoList=n})).catch((function(){t.todoList=[]})).finally((function(e){setTimeout((function(){t.todoLoad--,t.todoShow=!0}),100)}))))},openReadPercentage:function(){var t=this;this.percentageLoad>0||(this.percentageShow?this.percentageShow=!1:(this.percentageLoad++,this.$store.dispatch("call",{url:"dialog/msg/readlist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.percentageList=n})).catch((function(){t.percentageList=[]})).finally((function(e){setTimeout((function(){t.percentageLoad--,t.percentageShow=!0}),100)}))))},recordStyle:function(t){var e=t.duration;return{width:50+Math.min(180,Math.floor(e/150))+"px"}},recordDuration:function(t){var e=Math.floor(t/6e4),n=Math.floor(t/1e3)%60;return e>0?"".concat(e,":").concat(n,"″"):"".concat(Math.max(1,n),"″")},imageStyle:function(t){var e=t.width,n=t.height;if(e&&n){var o=e,i=n;return(e>220||n>220)&&(e>n?(o=220,i=n*(220/e)):(o=e*(220/n),i=220)),{width:o+"px",height:i+"px"}}return{}},playRecord:function(){this.operateVisible||c.Store.set("audioSubscribe",{id:this.msgData.id,src:this.msgData.msg.path})},openMeeting:function(){this.operateVisible||c.Store.set("addMeeting",{type:"join",name:this.msgData.msg.name,meetingid:this.msgData.msg.meetingid,meetingdisabled:!0})},viewReply:function(){this.$emit("on-view-reply",{msg_id:this.msgData.id,reply_id:this.msgData.reply_id})},viewText:function(t){this.$emit("on-view-text",t)},viewFile:function(){this.$emit("on-view-file",this.msgData)},downFile:function(){this.$emit("on-down-file",this.msgData)},replyList:function(){this.$emit("on-reply-list",{msg_id:this.msgData.id})},onError:function(){this.$emit("on-error",this.msgData)},onEmoji:function(t){this.$emit("on-emoji",{msg_id:this.msgData.id,symbol:t})},onShowEmojiUser:function(t){this.$emit("on-show-emoji-user",t)}}};function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function g(t){for(var e=1;e
n&&h
".concat(this.$L("总数量"),": ").concat(t.task_num,"
"),e+="".concat(this.$L("已完成"),": ").concat(t.task_complete,"
"),e+=''.concat(this.$L("我的任务"),"
"),e+="".concat(this.$L("总数量"),": ").concat(t.task_my_num,"
"),e+="".concat(this.$L("已完成"),": ").concat(t.task_my_complete,"
"),$A.modalInfo({language:!1,title:"".concat(t.name," ").concat(this.$L("项目进度")),content:e})}},handleLongpress:function(t,e){var n=this,o=$A.getAttr(e,"data-id"),i=this.projectLists.find((function(t){return t.id==o}));i&&(this.operateVisible=!1,this.operateItem=$A.isJson(i)?i:{},this.$nextTick((function(){var o=e.getBoundingClientRect(),i=n.$el.getBoundingClientRect();n.operateStyles={left:"".concat(t.clientX-i.left,"px"),top:"".concat(o.top+n.windowScrollY,"px"),height:o.height+"px"},n.operateVisible=!0})))},handleTopClick:function(){var t=this;this.$store.dispatch("call",{url:"project/top",data:{project_id:this.operateItem.id}}).then((function(e){var n=e.data;t.$store.dispatch("saveProject",n)})).catch((function(t){var e=t.msg;$A.modalError(e)}))}}};function dt(t){return dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dt(t)}function ft(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function ht(t){for(var e=1;e