From 5bbbbb0b02503385f2c854aa7ac8737927c83741 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){e.operateEnter=!0}),500)}},methods:{handleLongpress:function(t,e){this.$emit("on-longpress",{event:t,el:e,msgData:this.msgData})},openReadPercentage:function(){var t=this;this.popperLoad>0||(this.popperShow?this.popperShow=!1:(this.popperLoad++,this.$store.dispatch("call",{url:"dialog/msg/readlist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.allList=n})).catch((function(){t.allList=[]})).finally((function(e){setTimeout((function(){t.popperLoad--,t.popperShow=!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||s.Store.set("audioSubscribe",{id:this.msgData.id,src:this.msgData.msg.path})},openMeeting:function(){this.operateVisible||s.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})},onEmoji:function(t){this.$emit("on-emoji",{msg_id:this.msgData.id,symbol:t})}}};function f(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 h(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 u(t,e,r){for(var o,i,a=[],s=e;ss&&(n=s-l),i=n;i>=0;i--){for(var d=!0,f=0;fo)&&(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}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function T(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o>1,c=-7,d=n?o-1:0,f=n?-1:1,h=t[e+d];for(d+=f,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+t[e+d],d+=f,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=r;c>0;a=256*a+t[e+d],d+=f,c-=8);if(0===i)i=1-u;else{if(i===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=u}return(h?-1:1)*a*Math.pow(2,i-r)},e.write=function(t,e,n,r,o,i){var a,s,l,u=8*i-o-1,c=(1<>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+d>=1?f/l:f*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=c?(s=0,a=c):a+d>=1?(s=(e*l-1)*Math.pow(2,o),a+=d):(s=e*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;t[n+h]=255&s,h+=p,s/=256,o-=8);for(a=a<0?" ":"")+e+": "+o+";")};return e&&r?(i("*"),i(e)):ft(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}}},Ni={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},Ii=function(t){return t instanceof Event||_(t.initEvent)},Pi=function(t,e,n,r){var o,i=function(t,e){var n=null!=e?e:{};for(var r in t)_t(Ni,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)||Ii(t)}(e)&&(i.preventDefault=function(){i.defaultPrevented=!0,i.isDefaultPrevented=I,_(e.preventDefault)?e.preventDefault():Ii(e)&&(e.returnValue=!1)},i.stopPropagation=function(){i.cancelBubble=!0,i.isPropagationStopped=I,_(e.stopPropagation)?e.stopPropagation():Ii(e)&&(e.cancelBubble=!0)},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=I,i.stopPropagation()},function(t){return t.isDefaultPrevented===I||t.isDefaultPrevented===N}(i)||(i.isDefaultPrevented=!0===i.defaultPrevented?I:N,i.isPropagationStopped=!0===i.cancelBubble?I:N,i.isImmediatePropagationStopped=N)),i},$i=/^(?:mouse|contextmenu)|click/,ji=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},Ri=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},Mi=function(t,e){var n=Pi(t.type,t,document,e);if(function(t){return b(t)&&$i.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},Bi=function(t,e,n){var r=t.document,o={type:"ready"};if(n.domLoaded)e(o);else{var i=function(){Ri(t,"DOMContentLoaded",i),Ri(t,"load",i),n.domLoaded||(n.domLoaded=!0,e(o)),t=null};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():ji(t,"DOMContentLoaded",i),n.domLoaded||ji(t,"load",i)}},qi=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,l,u,c,d=this,f=window,h=function(t){d.executeHandlers(Mi(t||f.event),o)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[d.expando]?o=t[d.expando]:(o=d.count++,t[d.expando]=o,d.events[o]={}),r=r||t;var p=e.split(" ");for(a=p.length;a--;)u=h,l=c=!1,"DOMContentLoaded"===(s=p[a])&&(s="ready"),d.domLoaded&&"ready"===s&&"complete"===t.readyState?n.call(r,Mi({type:s})):(d.hasMouseEnterLeave||(l=d.mouseEnterLeave[s])&&(u=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=Mi(t||f.event)).type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,d.executeHandlers(t,o))}),d.hasFocusIn||"focusin"!==s&&"focusout"!==s||(c=!0,l="focusin"===s?"focus":"blur",u=function(t){(t=Mi(t||f.event)).type="focus"===t.type?"focusin":"focusout",d.executeHandlers(t,o)}),(i=d.events[o][s])?"ready"===s&&d.domLoaded?n(Mi({type:s})):i.push({func:n,scope:r}):(d.events[o][s]=i=[{func:n,scope:r}],i.fakeName=l,i.capture=c,i.nativeHandler=u,"ready"===s?Bi(t,u,d):ji(t,l||s,u,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 l=t[this.expando];if(l){if(s=this.events[l],e){var u=e.split(" ");for(o=u.length;o--;)if(r=s[a=u[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var c=r.nativeHandler,d=r.fakeName,f=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=c,r.fakeName=d,r.capture=f,s[a]=r}n&&0!==r.length||(delete s[a],Ri(t,r.fakeName||a,r.nativeHandler,r.capture))}}else ft(s,(function(e,n){Ri(t,e.fakeName||n,e.nativeHandler,e.capture)})),s={};for(a in s)if(_t(s,a))return this;delete this.events[l];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=Mi({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+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),da=new RegExp("=[\\x20\\t\\r\\n\\f]*([^\\]'\"]*?)[\\x20\\t\\r\\n\\f]*\\]","g"),fa=new RegExp(sa),ha=new RegExp("^"+ia+"$"),pa={ID:new RegExp("^#("+ia+")"),CLASS:new RegExp("^\\.("+ia+")"),TAG:new RegExp("^("+ia+"|[*])"),ATTR:new RegExp("^"+aa),PSEUDO:new RegExp("^"+sa),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},ma=/^(?:input|select|textarea|button)$/i,ga=/^h\d$/i,va=/^[^{]+\{\s*\[native \w/,ya=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ba=/[+~]/,_a=/'|\\/g,wa=new RegExp("\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)","ig"),ka=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{ea.apply(Ji=na.call(Ui.childNodes),Ui.childNodes),Ji[Ui.childNodes.length].nodeType}catch(t){ea={apply:Ji.length?function(t,e){ta.apply(t,na.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var Ca=function(t,e,n,r){var o,i,a,s,l,u,c,d,f,h;if((e?e.ownerDocument||e:Ui)!==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=ya.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))&&Kr(e,i)&&i.id===a)return n.push(i),n}else{if(o[2])return ea.apply(n,e.getElementsByTagName(t)),n;if((a=o[3])&&Lr.getElementsByClassName)return ea.apply(n,e.getElementsByClassName(a)),n}if(Lr.qsa&&(!Vr||!Vr.test(t))){if(d=c=Fi,f=e,h=9===s&&t,1===s&&"object"!==e.nodeName.toLowerCase()){for(u=$r(t),(c=e.getAttribute("id"))?d=c.replace(_a,"\\$&"):e.setAttribute("id",d),d="[id='"+d+"'] ",l=u.length;l--;)u[l]=d+Da(u[l]);f=ba.test(t)&&Ta(e.parentNode)||e,h=u.join(",")}if(h)try{return ea.apply(n,f.querySelectorAll(h)),n}catch(t){}finally{c||e.removeAttribute("id")}}}return Rr(t.replace(la,"$1"),e,n,r)};function xa(){var t=[];return function e(n,r){return t.push(n+" ")>Nr.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function Sa(t){return t[Fi]=!0,t}function Oa(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||Gi)-(~t.sourceIndex||Gi);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function Ea(t){return Sa((function(e){return e=+e,Sa((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 Ta(t){return t&&typeof t.getElementsByTagName!==Zi&&t}function Aa(){}function Da(t){for(var e=0,n=t.length,r="";e
"+e,n.removeChild(n.firstChild)}catch(t){us("").html("
"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)},N=function(e,n,r,o,i){return A(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&&L(a,o)),i?a:e.appendChild(a)}))},I=function(e,n,r){return N(t.createElement(e),e,n,r,!0)},P=bi.encodeAllRaw,$=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]},j=function(t,e,n){m(t).toggleClass(e,n).each((function(){""===this.className&&us(this).attr("class",null)}))},R=function(t,e,n){return A(e,(function(e){return Te.is(e,"array")&&(t=t.cloneNode(!0)),n&&cs(ds(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))},M=function(t){if(Ln(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(Te.isArray(n)){for(var l=n.length,u=[];l--;)u[l]=q(n[l],o,i,a);return u}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(Te.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 l=s[i];e!==l[0]||n&&n!==l[1]||o&&o!==l[2]||c.unbind(l[0],l[1],l[2])}return c.unbind(e,n,o)},U=function(t){if(t&&Ln(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:u,schema:l,events:c,isBlock:function(t){if("string"==typeof t)return!!d[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!d[t.nodeName])}return!1},$:h,$$:m,root:null,clone:function(e,n){if(!fs||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return cs(v(e),(function(t){b(r,t.nodeName,g(e,t.nodeName))})),r},getRoot:_,getViewPort:function(t){var e=Tn(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=E(t,e,n,!1);return r&&r.length>0?r[0]:null},getParents:E,get:p,getNext:function(t,e){return T(t,e,"nextSibling")},getPrev:function(t,e){return T(t,e,"previousSibling")},select:function(n,r){return Ca(n,p(r)||e.root_element||t,[])},is:O,add:N,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:$,setStyle:function(t,n,r){var o=f(n)?m(t).css(n,r):m(t).css(n);e.update_styles&&ps(u,o)},getStyle:C,setStyles:function(t,n){var r=m(t).css(n);e.update_styles&&ps(u,r)},removeAllAttribs:function(t){return A(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 u.parse(t)},serializeStyle:function(t,e){return u.serialize(t,e)},addStyle:function(e){var r,o;if(z!==gs.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){j(t,e,!1)},hasClass:function(t,e){return m(t).hasClass(e)},toggleClass:j,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:L,getOuterHTML:function(t){var e="string"==typeof t?p(t):t;return Ln(e)?e.outerHTML:us("").append(us(e).clone()).html()},setOuterHTML:function(t,e){m(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}$(us(this).html(e),!0)}))},decode:bi.decode,encode:P,insertAfter:function(t,e){var n=p(e);return A(t,(function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t}))},replace:R,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=I(e),cs(v(t),(function(e){b(n,e.nodeName,g(t,e.nodeName))})),R(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 u.toHex(Te.trim(t))},run:A,getAttribs:v,isEmpty:function(t,e){var n,r,o=0;if(M(t))return!1;if(t=t.firstChild){var i=new so(t,t.parentNode),a=l?l.getWhiteSpaceElements():{};e=e||(l?l.getNonEmptyElements():null);do{if(n=t.nodeType,Ln(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(M(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:ms,split:function(t,e,n){var r,o,i,a=B();if(t&&e)return a.setStart(t.parentNode,ms(t)),a.setEnd(e.parentNode,ms(e)),r=a.extractContents(),(a=B()).setStart(e.parentNode,ms(e)+1),a.setEnd(t.parentNode,ms(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),$(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])}ft(o,(function(t,e){a.unload(e),delete o[e]})),Ca.setDocument&&Ca.setDocument()},isChildOf:function(t,e){if(fs){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}(u,e,S(z));return z};gs.DOM=gs(document),gs.nodeIndex=ms;var vs=gs.DOM,ys=Te.each,bs=Te.grep,_s=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=vs,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=Te._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){ys(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=bs(t);if(t.length=0,ys(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,ys(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}(),ws=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},ks={},Cs=ws("en"),xs=function(){return bt(ks,Cs.get())},Ss={getData:function(){return ht(ks,(function(t){return Dt({},t)}))},setCode:function(t){t&&Cs.set(t)},getCode:function(){return Cs.get()},add:function(t,e){var n=ks[t];n||(ks[t]=n={}),ft(e,(function(t,e){n[e.toLowerCase()]=t}))},translate:function(t){var e,n=xs().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 xs().bind((function(t){return bt(t,"_dir")})).exists((function(t){return"rtl"===t}))},hasCode:function(t){return _t(ks,t)}},Os=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,l,u,c){if(!e[t]){var d="string"==typeof r?r:r.prefix+r.resource+r.suffix;0!==d.indexOf("/")&&-1===d.indexOf("://")&&(d=Os.baseURL+"/"+d),e[t]=d.substring(0,d.lastIndexOf("/"));var f=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(_s))}(t,r,l,u)};n[t]?f():_s.ScriptLoader.add(d,f,u,c)}},l=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!==Os.languageLoad&&l(t,(function(){var r=Ss.getCode();!r||n&&-1===(","+(n||"")+",").indexOf(","+r+",")||_s.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){_s.ScriptLoader.add(r+"/"+t)}))},load:s,waitFor:l}};Os.languageLoad=!0,Os.baseURL="",Os.PluginManager=Os(),Os.ThemeManager=Os();var Es=function(){var t=function(t){var e=ws(R.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(R.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(R.some(t))}}}(k);return Dt(Dt({},t),{on:function(e){return t.get().each(e)}})},Ts=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=Te.trim(o),a.no_events?a.content:t.fire("GetContent",a).content},Gh=Te.each,Xh=function(t){return{compare:function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return Gh(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")))&&(!Gc(e)&&!Gc(n)))}}},Jh=Te.makeMap,Qh=function(t){var e=[],n=(t=t||{}).indent,r=Jh(t.indent_before||""),o=Jh(t.indent_after||""),i=bi.getEncodeFunc(t.entity_encoding||"raw",t.entities),a="html"===t.element_format;return{start:function(t,s,l){var u,c,d,f;if(n&&r[t]&&e.length>0&&(f=e[e.length-1]).length>0&&"\n"!==f&&e.push("\n"),e.push("<",t),s)for(u=0,c=s.length;u
');return gn(t),pn(t,e),R.some(Al.before(e.dom))}return R.none()},pm=function(t,e,n){var r,o,i,a,s=Ye(t).filter(Fe),l=Ze(t).filter(Fe);return vn(t),(r=s,o=l,i=e,a=function(t,e,r){var o=t.dom,i=e.dom,a=o.data.length;return om(o,i,n),r.container()===i?Al(o,a):r},r.isSome()&&o.isSome()&&i.isSome()?R.some(a(r.getOrDie(),o.getOrDie(),i.getOrDie())):R.none()).orThunk((function(){return n&&(s.each((function(t){return rm(t.dom,t.dom.length)})),l.each((function(t){return nm(t.dom,0)}))),e}))},mm=function(t,e,n,r){void 0===r&&(r=!0);var o,i=cm(e,t.getBody(),n.dom),a=Yr(n,T(fm,t),(o=t.getBody(),function(t){return t.dom===o})),s=pm(n,i,function(t,e){return _t(t.schema.getTextInlineElements(),Re(e))}(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):a.bind(hm).fold((function(){r&&dm(t,e,s)}),(function(n){r&&dm(t,e,R.some(n))}))},gm=function(t){return Ms(t,"td,th")},vm=function(t,e){return{start:t,end:e}},ym=Sr([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),bm=function(t,e){return Qr(De.fromDom(t),"td,th",e)},_m=function(t){return!Pe(t.start,t.end)},wm=function(t,e){return Rd(t.start,e).bind((function(n){return Rd(t.end,e).bind((function(t){return e=Pe(n,t),r=n,e?R.some(r):R.none();var e,r}))}))},km=function(t){return function(e){return wm(e,t).map((function(t){return function(t,e,n){return{rng:t,table:e,cells:n}}(e,t,gm(t))}))}},Cm=function(t,e,n,r){if(n.collapsed||!t.forall(_m))return R.none();if(e.isSameTable){var o=t.bind(km(r));return R.some({start:o,end:o})}var i=bm(n.startContainer,r),a=bm(n.endContainer,r),s=i.bind(function(t){return function(e){return Rd(e,t).bind((function(t){return st(gm(t)).map((function(t){return vm(e,t)}))}))}}(r)).bind(km(r)),l=a.bind(function(t){return function(e){return Rd(e,t).bind((function(t){return at(gm(t)).map((function(t){return vm(t,e)}))}))}}(r)).bind(km(r));return R.some({start:s,end:l})},xm=function(t,e){return Q(t,(function(t){return Pe(t,e)}))},Sm=function(t){return Gn(xm(t.cells,t.rng.start),xm(t.cells,t.rng.end),(function(e,n){return t.cells.slice(e,n+1)}))},Om=function(t,e,n){return t.exists((function(t){return function(t,e){return!_m(t)&&wm(t,e).exists((function(t){var e=t.dom.rows;return 1===e.length&&1===e[0].cells.length}))}(t,n)&&qd(t.start,e)}))},Em=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},Tm=function(t,e){var n=function(t){return function(e){return Pe(t,e)}}(t),r=function(t,e){var n=bm(t.startContainer,e),r=bm(t.endContainer,e);return Gn(n,r,vm)}(e,n),o=function(t,e){var n=function(t){return Rd(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 Om(r,e,n)?r.map((function(t){return ym.singleCellTable(e,t.start)})):o.isMultiTable?function(t,e,n,r){return Cm(t,e,n,r).bind((function(t){var r=t.start,o=t.end,i=r.bind(Sm).getOr([]),a=o.bind(Sm).getOr([]);if(i.length>0&&a.length>0){var s=Em(n,e);return R.some(ym.multiTable(i,a,s))}return R.none()}))}(r,o,e,n):function(t,e,n,r){return Cm(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=Sm(t).getOr([]);if(r&&t.cells.length===o.length)return R.some(ym.fullTable(t.table));if(o.length>0){if(r)return R.some(ym.partialTable(o,R.none()));var i=Em(n,e);return R.some(ym.partialTable(o,R.some(Dt(Dt({},e),{rng:i}))))}return R.none()}))}(r,o,e,n)},Am=function(t){var e;return(8===Me(e=t)||"#comment"===Re(e)?Ye(t):en(t)).bind(Am).orThunk((function(){return R.some(t)}))},Dm=function(t){return V(t,(function(t){rr(t,"contenteditable"),kp(t)}))},Lm=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)},Nm=function(t){var e=jd(t),n=De.fromDom(t.selection.getNode());Kn(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)}))&&Qn(n,"data-mce-selected","1")},Im=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 R.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):(kp(n),t.selection.setCursorLocation(n.dom,0))}))}(t,i,a.filter(ei));var s=i?e[0]:e[e.length-1];return Lm(t,s,r,i),ei(s)?R.none():R.some(i?e.slice(1):e.slice(0,-1))})).getOr(e);return Dm(o),Nm(t),!0},Pm=function(t,e,n,r){var o=t.selection.getRng(),i=e[0],a=n[n.length-1];Lm(t,i,o,!0),Lm(t,a,o,!1);var s=ei(i)?e:e.slice(1),l=ei(a)?n:n.slice(0,-1);return Dm(s.concat(l)),r.deleteContents(),Nm(t),!0},$m=function(t,e,n,r){void 0===r&&(r=!0),e.deleteContents();var o,i=Am(n).getOr(n),a=De.fromDom(t.dom.getParent(i.dom,t.dom.isBlock));if(ei(a)&&(kp(a),r&&t.selection.setCursorLocation(a.dom,0)),!Pe(n,a)){var s=Zn(Ke(a),n)?[]:Ke(o=a).map(Je).map((function(t){return Y(t,(function(t){return!Pe(o,t)}))})).getOr([]);V(s.concat(Je(n)),(function(t){Pe(t,a)||je(t,a)||!ei(t)||vn(t)}))}return!0},jm=function(t,e){return mm(t,!1,e),!0},Rm=function(t,e,n,r){return Bm(e,r).fold((function(){return function(t,e,n){return Tm(e,n).map((function(e){return e.fold(T($m,t),T(jm,t),T(Im,t),T(Pm,t))}))}(t,e,n)}),(function(e){return function(t,e){return qm(t,e)}(t,e)})).getOr(!1)},Mm=function(t,e){return J(Op(e,t),yo)},Bm=function(t,e){return J(Op(e,t),(n="caption",function(t){return qe(t)&&Re(t)===n}));var n},qm=function(t,e){return kp(e),t.selection.setCursorLocation(e.dom,0),R.some(!0)},Fm=function(t,e,n,r,o){return Dc(n,t.getBody(),o).bind((function(i){return function(t,e,n,r){return $c(t.dom).bind((function(o){return jc(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 qm(t,e)}(t,r):function(t,e,n){return Bm(t,De.fromDom(n.getNode())).map((function(t){return!1===Pe(t,e)}))}(e,r,i)})).or(R.some(!0))},Um=function(t,e,n,r){var o=Al.fromRangeStart(t.selection.getRng());return Mm(n,r).bind((function(r){return ei(r)?qm(t,r):function(t,e,n,r,o){return Dc(n,t.getBody(),o).bind((function(t){return Mm(e,De.fromDom(t.getNode())).map((function(t){return!1===Pe(t,r)}))}))}(t,n,e,r,o)})).getOr(!1)},zm=function(t,e){return t?vp(e):yp(e)},Hm=function(t,e,n){var r=De.fromDom(t.getBody());return Bm(r,n).fold((function(){return Um(t,e,r,n)||function(t,e){var n=Al.fromRangeStart(t.selection.getRng());return zm(e,n)||Ac(e,t.getBody(),n).exists((function(t){return zm(e,t)}))}(t,e)}),(function(n){return function(t,e,n,r){var o=Al.fromRangeStart(t.selection.getRng());return ei(r)?qm(t,r):Fm(t,n,e,r,o)}(t,e,r,n).getOr(!1)}))},Vm=function(t,e){var n=De.fromDom(t.selection.getStart(!0)),r=jd(t);return t.selection.isCollapsed()&&0===r.length?Hm(t,e,n):function(t,e,n){var r=De.fromDom(t.getBody()),o=t.selection.getRng();return 0!==n.length?Im(t,n,R.none()):Rm(t,r,o,e)}(t,n,r)},Wm=function(t){var e=Al.fromRangeStart(t),n=Al.fromRangeEnd(t),r=t.commonAncestorContainer;return Ac(!1,r,n).map((function(o){return!tc(e,n,r)&&tc(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)},Km=function(t){return t.collapsed?t:Wm(t)},Ym=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)},Zm=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)||Ym(t,e))}(t,r)&&(r=r.prev),!(!n||n!==r)&&("ul"===n.name||"ol"===n.name)},Gm=function(t){return t&&t.firstChild&&t.firstChild===t.lastChild&&function(t){return t.data===_o||zn(t)}(t.firstChild)},Xm=function(t){return t.length>0&&(!(e=t[t.length-1]).firstChild||Gm(e))?t.slice(0,-1):t;var e},Jm=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},Qm=function(t,e){var n=Al.after(t),r=xc(e).prev(n);return r?r.toRange():null},tg=function(t,e,n){var r=t.parentNode;return Te.each(e,(function(e){r.insertBefore(e,t)})),function(t,e){var n=Al.before(t),r=xc(e).next(n);return r?r.toRange():null}(t,n)},eg=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=Jm(e,n.startContainer),s=Xm((o=i.firstChild,Y(o.childNodes,(function(t){return"LI"===t.nodeName})))),l=e.getRoot(),u=function(t){var r=Al.fromRangeStart(n),o=xc(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||Jm(e,i.getNode())!==a};return u(1)?tg(a,s,l):u(2)?function(t,e,n,r){return r.insertAfter(e.reverse(),t),Qm(e[0],n)}(a,s,l,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),Te.each(e,(function(e){i.insertBefore(e,t)})),i.insertBefore(o[1],t),i.removeChild(t),Qm(e[e.length-1],n)}(a,s,l,n)},ng=Kn,rg=function(t){var e=t.dom,n=Km(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,ng);!function(t,e,n){return null!==n&&n===t.getParent(e.endContainer,ng)&&qd(De.fromDom(n),e)}(e,n,r)?t.getDoc().execCommand("Delete",!1,null):$m(t,n,De.fromDom(r))},og=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=Kp(r,Al.fromRangeStart(e))?n.replace(/^ /," "):n.replace(/^ /," "),Yp(r,Al.fromRangeEnd(e))?n.replace(/( | )(
)?$/," "):n.replace(/ (
)?$/," ")}(s,a.getRng(),e));var l=t.parser,u=n.merge,c=tp({validate:bu(t)},t.schema),d='',f=t.fire("BeforeSetContent",{content:e,format:"html",selection:!0,paste:n.paste});if(f.isDefaultPrevented())t.fire("SetContent",{content:f.content,format:"html",selection:!0,paste:n.paste});else{-1===(e=f.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,d);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()||rg(t);var m,g={context:(r=a.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},v=l.parse(e,g);if(!0===n.paste&&Zm(t.schema,v)&&function(t,e){return!!Jm(t,e)}(s,r))return o=eg(c,s,a.getRng(),v),a.setRng(o),void t.fire("SetContent",f);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(d),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(l.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=Xh(r);Te.each(r.select("*[data-mce-fragment]"),(function(t){if(b(n[t.nodeName.toLowerCase()])&&op(r,t))for(var e=t.parentNode;b(e)&&e!==o&&!ip(r,t,e);e=e.parentNode)if(i.compare(e,t)){r.remove(t,!0);break}}))}}(t,u),function(t,e){var n,r=t.dom,o=t.selection;if(e){o.scrollIntoView(e);var i=Qd(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 l=e.nextSibling;Bn(l)&&(s.appendData(l.data),l.parentNode.removeChild(l))}}else a.setStartBefore(e),a.setEndBefore(e);var u=r.getParent(e,r.isBlock);r.remove(e),u&&r.isEmpty(u)&&(t.$(u).empty(),a.setStart(u,0),a.setEnd(u,0),ng(u)||function(t){return!!t.getAttribute("data-mce-fragment")}(u)||!(n=function(e){var n=Al.fromRangeStart(e);if(n=xc(t.getBody()).next(n))return n.toRange()}(a))?r.add(u,r.create("br",{"data-mce-bogus":"1"})):(a=n,r.remove(u))),o.setRng(a)}}(t,s.get("mce_marker")),m=t.getBody(),Te.each(m.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")})),function(t,e){R.from(t.getParent(e,"td,th")).map(De.fromDom).each(Cp)}(s,a.getStart()),t.fire("SetContent",f),t.addVisual()}},ig=function(t,e){e(t),t.firstChild&&ig(t.firstChild,e),t.next&&ig(t.next,e)},ag=function(t,e,n){var r=function(t,e,n){var r={},o={},i=[];for(var a in n.firstChild&&ig(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,{})}))}))},sg=function(t){return t instanceof Ih},lg=function(t,e,n){t.dom.setHTML(t.getBody(),e),!0!==n&&function(t){_h(t)&&$c(t.getBody()).each((function(e){var n=e.getNode(),r=jn(n)?$c(n).getOr(e):e;t.selection.setRng(r.toRange())}))}(t)},ug=function(t,e,n){var r=function(t,e){return Dt(Dt({format:"html"},t),{set:!0,content:sg(e)?"":e})}(n,e),o=n.no_events?r:t.fire("BeforeSetContent",r);return sg(e)||(e=o.content),R.from(t.getBody()).fold(S(e),(function(n){return sg(e)?function(t,e,n,r){ag(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=tp({validate:t.validate},t.schema).serialize(n);return r.content=bo(De.fromDom(e))?o:Te.trim(o),lg(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+"
'),lg(t,n,r.no_selection),t.fire("SetContent",r)}else"raw"!==r.format&&(n=tp({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=bo(De.fromDom(e))?n:Te.trim(n),lg(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r);return r.content}(t,n,e,o)}))},cg=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)})):R.none()}(t,e).isSome()},dg=function(t){return _(t)?t:N},fg=function(t,e,n){var r=e(t),o=dg(n);return r.orThunk((function(){return o(t)?R.none():function(t,e,n){for(var r=t.dom,o=dg(n);r.parentNode;){r=r.parentNode;var i=De.fromDom(r),a=e(i);if(a.isSome())return a;if(o(i))break}return R.none()}(t,e,o)}))},hg=sd,pg=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o
").append(n.childNodes)})))}));var Rg=Te.each,Mg=function(t){return Ln(t)&&!Gc(t)&&!Mc(t)&&!$n(t)},Bg=function(t,e){for(var n=t;n;n=n[e]){if(Bn(n)&&zt(n.data))return t;if(Ln(n)&&!Gc(n))return n}return t},qg=function(t,e,n){var r=Xh(t);if(e&&n&&(e=Bg(e,"previousSibling"),n=Bg(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),Te.each(Te.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n},Fg=function(t,e,n,r){if(r&&!1!==e.merge_siblings){var o=qg(t,nd(r),r);qg(t,o,nd(o,!0))}},Ug=function(t,e,n){Rg(t.childNodes,(function(t){Mg(t)&&(e(t)&&n(t),t.hasChildNodes()&&Ug(t,e,n))}))},zg=function(t,e){return function(n){return!(!n||!ud(t,n,e))}},Hg=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)}},Vg=Sr([{keep:[]},{rename:["name"]},{removed:[]}]),Wg=/^(src|href|style)$/,Kg=Te.each,Yg=sd,Zg=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},Gg=function(t,e,n){var r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"];if(Ln(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},Xg=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},Jg=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},Qg=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?(dn(i,a),hn(a,i)):(fn(i,a),pn(a,i)),a.dom},tv=function(t,e,n,r){var o=nd(e,n,r);return y(o)||"BR"===o.nodeName||t.isBlock(o)},ev=function(t,e,n){var r,o=e.parentNode,i=t.dom,a=nu(t);hd(n)&&(a?o===i.getRoot()&&(n.list_block&&Yg(e,n.list_block)||V(lt(e.childNodes),(function(e){od(t,a,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=Jg(i,e,a),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=null}))):i.isBlock(e)&&!i.isBlock(o)&&(tv(i,e,!1)||tv(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),tv(i,e,!0)||tv(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),function(t){return pd(t)&&md(t)&&Zn(bt(t,"mixed"),!0)}(n)&&!Yg(n.inline,e)||i.remove(e,!0)},nv=function(t,e,n,r,o){var i,a=t.dom;if(!function(t,e,n){return!(!md(n)||!Yg(e,n.inline))||!(!hd(n)||!Yg(e,n.block))||(pd(n)?Ln(e)&&t.is(e,n.selector):void 0)}(a,r,e)&&!function(t,e){return e.links&&"A"===t.nodeName}(r,e))return Vg.keep();var s=r;if(md(e)&&"all"===e.remove&&p(e.preserve_attributes)){var l=Y(a.getAttribs(s),(function(t){return U(e.preserve_attributes,t.name.toLowerCase())}));if(a.removeAllAttribs(s),V(l,(function(t){return a.setAttrib(s,t.name,t.value)})),l.length>0)return Vg.rename("span")}if("all"!==e.remove){Kg(e.styles,(function(t,r){t=ld(a,ad(t,n),r+""),w(r)&&(r=t,o=null),(e.remove_similar||!o||Yg(ud(a,o,r),t))&&a.setStyle(s,r,""),i=!0})),i&&""===a.getAttrib(s,"style")&&(s.removeAttribute("style"),s.removeAttribute("data-mce-style")),Kg(e.attributes,(function(t,r){var i;if(t=ad(t,n),w(r)&&(r=t,o=null),e.remove_similar||!o||Yg(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(Wg.test(r)&&s.removeAttribute("data-mce-"+r),"style"===r&&Nn(["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)}})),Kg(e.classes,(function(t){t=ad(t,n),o&&!a.hasClass(o,t)||a.removeClass(s,t)}));for(var u=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()}}},Vk=function(t,e){var n=e?Dl.Forwards:Dl.Backwards,r=t.selection.getRng();return function(t,e,n){return nk(e,t,n,bp,_p,zk)}(n,t,r).orThunk((function(){return Hk(t,n,r),R.none()}))},Wk=function(t,e){var n=e?1:-1,r=t.selection.getRng();return function(t,e,n){return rk(e,t,n,(function(t){return bp(t)||vp(t)}),(function(t){return _p(t)||yp(t)}),zk)}(n,t,r).orThunk((function(){return Hk(t,n,r),R.none()}))},Kk=function(t,e){return Vk(t,e).exists((function(e){return tk(t,e),!0}))},Yk=function(t,e){return Wk(t,e).exists((function(e){return tk(t,e),!0}))},Zk=function(t,e){return ik(t,e,e?_p:bp)},Gk=function(t){return U(["figcaption"],Re(t))},Xk=function(t){var e=document.createRange();return e.setStartBefore(t.dom),e.setEndBefore(t.dom),e},Jk=function(t,e,n){n?pn(t,e):hn(t,e)},Qk=function(t,e,n,r){return""===e?function(t,e){var n=De.fromTag("br");return Jk(t,n,e),Xk(n)}(t,r):function(t,e,n,r){var o=De.fromTag(n),i=De.fromTag("br");return tr(o,r),pn(o,i),Jk(t,o,e),Xk(i)}(t,r,e,n)},tC=function(t,e,n){return e?function(t,e){return Iw(t,e).breakAt.isNone()}(t.dom,n):function(t,e){return Nw(t,e).breakAt.isNone()}(t.dom,n)},eC=function(t,e){var n=De.fromDom(t.getBody()),r=Al.fromRangeStart(t.selection.getRng()),o=nu(t),i=ru(t);return function(t,e){var n=T(Pe,e);return Zr(De.fromDom(t.container()),co,n).filter(Gk)}(r,n).exists((function(){if(tC(n,e,r)){var a=Qk(n,o,i,e);return t.selection.setRng(a),!0}return!1}))},nC=function(t,e){return!!t.selection.isCollapsed()&&eC(t,e)},rC=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]:[]}))},oC=function(t){for(var e=[],n=1;n
'},$C=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},jC=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)},RC=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},MC=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},BC=function(t,e){var n=nu(t);n&&n.toLowerCase()===e.tagName.toLowerCase()&&function(t,e,n){var r=t.dom;R.from(n.style).map(r.parseStyle).each((function(t){var n=lr(De.fromDom(e)),o=Dt(Dt({},n),t);r.setStyles(e,o)}));var o=R.from(n.class).map((function(t){return t.split(/\s+/)})),i=R.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=Lt(Lt([],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,ru(t))},qC=function(t,e){var n,r,o,i,a,s,l,u,c,d,f=t.dom,h=t.schema,p=h.getNonEmptyElements(),m=t.selection.getRng(),g=function(e){var n,o,a,s=r,l=h.getTextInlineElements();if(a=n=e||"TABLE"===u||"HR"===u?f.create(e||c):i.cloneNode(!1),!1===function(t){return t.getParam("keep_styles",!0)}(t))f.setAttrib(n,"style",null),f.setAttrib(n,"class",null);else do{if(l[s.nodeName]){if(Mc(s)||Gc(s))continue;o=s.cloneNode(!1),f.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(a=o,n.appendChild(o))}}while((s=s.parentNode)&&s!==w);return BC(t,n),PC(a),n},v=function(t){var e,n,a=RC(t,r,o);if(Bn(r)&&(t?a>0:a
'},oS=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}),Ps(i,"tox-edit-area__iframe"),i).dom;s.onload=function(){s.onload=null,t.fire("load")};var l=function(t,e){if(document.domain!==window.location.hostname&&Ce.browser.isIE()){var n=Pb("mce");t[n]=function(){eS(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 nS.setAttrib(e,"src",r),!0}return!1}(t,s);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=s,t.iframeHTML=rS(t),nS.add(e.iframeContainer,s),l},iS=gs.DOM,aS=function(t,e,n){var r=_b.get(n),o=_b.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=Te.trim(n),r&&-1===Te.inArray(e,n)){if(Te.each(_b.dependencies(n),(function(n){aS(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=Ss.translate(["Failed to initialize plugin: {0}",e]);ef(t,"PluginLoadError",{message:r}),Tb(r,n),xb(t,r)}(t,n,e)}}},sS=function(t){return t.replace(/^\-/,"")},lS=function(t){return{editorContainer:t,iframeContainer:t,api:{}}},uS=function(t){var e=t.getElement();return t.inline?lS(null):function(t){var e=iS.create("div");return iS.insertAfter(e,t),lS(e)}(e)},cS=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,f(yu(t))?function(t){return t.theme.renderUI()}(t):_(yu(t))?function(t){var e=t.getElement(),n=yu(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):uS(t)},dS=function(t){t.fire("ScriptsLoaded"),function(t){var e=Te.trim(au(t)),n=t.ui.registry.getAll().icons,r=Dt(Dt({},cb.get("default").icons),cb.get(e).icons);ft(r,(function(e,r){_t(n,r)||t.ui.registry.addIcon(r,e)}))}(t),function(t){var e=yu(t);if(f(e)){t.settings.theme=sS(e);var n=wb.get(e);t.theme=new n(t,wb.urls[e]),t.theme.init&&t.theme.init(t,wb.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}}(t),function(t){var e=[];Te.each(ku(t).split(/[ ,]/),(function(n){aS(t,e,sS(n))}))}(t);var e=cS(t);!function(t,e){var n={show:R.from(e.show).getOr(k),hide:R.from(e.hide).getOr(k),disable:R.from(e.disable).getOr(k),isDisabled:R.from(e.isDisabled).getOr(N),enable:function(){t.mode.isReadOnly()||R.from(e.enable).map(L)}};t.ui=Dt(Dt({},t.ui),n)}(t,R.from(e.api).getOr({}));var n={editorContainer:e.editorContainer,iframeContainer:e.iframeContainer};return t.editorContainer=n.editorContainer?n.editorContainer:null,Lb(t),t.inline?eS(t):function(t,e){var n=oS(t,e);e.editorContainer&&(nS.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=nS.isHidden(e.editorContainer)),t.getElement().style.display="none",nS.setAttrib(t.id,"aria-hidden","true"),n||eS(t)}(t,n)},fS=gs.DOM,hS=function(t){return"-"===t.charAt(0)},pS=function(t,e){var n=hu(e),r=function(t){return t.getParam("language_url","","string")}(e);if(!1===Ss.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){Sb(t,"LanguageLoadError",Ob("language",e,n))}(e,o,n)}))}},mS=function(t,e,n){return R.from(e).filter((function(t){return t.length>0&&!cb.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:R.some(e)}}))},gS=function(t,e,n){var r=mS(e,"default",n),o=function(t){return R.from(function(t){return t.getParam("icons_url","","string")}(t)).filter((function(t){return t.length>0})).map((function(t){return{url:t,name:R.none()}}))}(e).orThunk((function(){return mS(e,au(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 ZC(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=NS(r,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==IS(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 Tk(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 ES(t,(function(e){return xS(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("FontSize",(function(){return function(t){return ES(t,(function(e){return CS(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("LineHeight",(function(){return function(t){return ES(t,(function(e){var n=De.fromDom(t.getBody()),r=fg(e,(function(t){return sr(t,"line-height")}),T(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}(),$S="data-mce-contenteditable",jS=function(t,e,n){var r,o;js(t,e)&&!1===n?(o=e,Ls(r=t)?r.dom.classList.remove(o):Is(r,o),$s(r)):n&&Ps(t,e)},RS=function(t,e,n){try{t.getDoc().execCommand(e,!1,String(n))}catch(t){}},MS=function(t,e){t.dom.contentEditable=e?"true":"false"},BS=function(t,e){var n=De.fromDom(t.getBody());jS(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),function(t){R.from(t.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")}))}(t),t.readonly=!0,MS(n,!1),V(Ms(n,'*[contenteditable="true"]'),(function(t){Qn(t,$S,"true"),MS(t,!1)}))):(t.readonly=!1,MS(n,!0),function(t){V(Ms(t,'*[data-mce-contenteditable="true"]'),(function(t){rr(t,$S),MS(t,!0)}))}(n),RS(t,"StyleWithCSS",!1),RS(t,"enableInlineTableEditing",!1),RS(t,"enableObjectResizing",!1),wh(t)&&t.focus(),function(t){t.selection.setRng(t.selection.getRng())}(t),t.nodeChanged())},qS=function(t){return t.readonly},FS=function(t){t.parser.addAttributeFilter("contenteditable",(function(e){qS(t)&&V(e,(function(t){t.attr($S,t.attr("contenteditable")),t.attr("contenteditable","false")}))})),t.serializer.addAttributeFilter($S,(function(e){qS(t)&&V(e,(function(t){t.attr("contenteditable",t.attr($S))}))})),t.serializer.addTempAttr($S)},US=function(t,e){if(function(t){return"click"===t.type}(e)&&!of.metaKeyPressed(e)){var n=De.fromDom(e.target);(function(t,e){return Qr(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="'+((Mt(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}))}},zS=Te.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"," "),HS=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||N}return t.isNative=function(t){return!!zS[t.toLowerCase()]},t.prototype.fire=function(t,e){var n=t.toLowerCase(),r=Pi(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"),iO);return o[o.length-1]=Te.extend(o[o.length-1],{func:n,scope:r||this.editor}),Te.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}(),sO=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}},lO=gs.DOM,uO=Te.extend,cO=Te.each,dO=Te.resolve,fO=Ce.ie,hO=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,uO(this,XS),this.settings=sb(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&&(_s.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),gs.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),Os.languageLoad=this.settings.language_load,Os.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new Fh(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new aO(this),this.editorCommands=new PS(this),this.settings.cache_suffix&&(Ce.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:sO(),styleSheetLoader:void 0,show:k,hide:k,enable:k,disable:k,isDisabled:N};var o=tO(this);this.mode=o,this.setMode=o.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=us.overrideDefaults((function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}}))}return t.prototype.render=function(){yS(this)},t.prototype.focus=function(t){this.execCommand("mceFocus",!1,t)},t.prototype.hasFocus=function(){return _h(this)},t.prototype.execCallback=function(t){for(var e=[],n=1;n')},editorImage:function(t){for(var e=0;e
<\/p>)+|(
<\/p>)+$/gi,""),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(t){var e={attributes:{},insert:t.insert};return t.attributes&&["bold","strike","italic","underline","list","blockquote","link"].some((function(n){t.attributes[n]&&(e.attributes[n]=t.attributes[n])})),e})),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})}))))}))},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.dialogId||"t_".concat(this.taskId),e=this.dialogInputCache.find((function(e){return e.key==t}));return e?e.cache:""},setInputCache:function(t){var e=this,n=this.dialogId||"t_".concat(this.taskId),r=this.dialogInputCache.findIndex((function(t){return t.key==n})),o={key:n,cache:t};r>-1?this.$store.state.dialogInputCache.splice(r,1,o):this.$store.state.dialogInputCache.push(o),this.__setInputCache&&clearTimeout(this.__setInputCache),this.__setInputCache=setTimeout((function(t){$A.setStorage("cacheDialogInput",e.$store.state.dialogInputCache)}),600)},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&&(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.showEmoji=!1,this.showMore=!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)}},onSelectEmoji:function(t){if(this.quill)if("emoji"===t.type){var e=document.createElement("span");e.innerHTML=t.html,this.quill.insertText(this.rangeIndex,e.innerHTML),this.rangeIndex+=e.innerHTML.length,e=null,this.windowLarge&&(this.showEmoji=!1,this.quill.setSelection(this.rangeIndex))}else"emoticon"===t.type&&(this.$emit("on-send",'')),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":R.Store.set("addMeeting",{type:"create",dialog_id:this.dialogId,userids:[this.userId]});break;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),u.setStartAfter(l[0].firstChild.firstChild),u.setEndAfter(o)):(l.empty().append(_o).append(o).append(_o),u.setStart(l[0].firstChild,1),u.setEnd(l[0].lastChild,0)),l.css({top:r.getPos(e,t.getBody()).y}),l[0].focus();var c=n.getSel();return c.removeAllRanges(),c.addRange(u),u}(o,a.targetClone,i),c=De.fromDom(o);return V(Ms(De.fromDom(t.getBody()),"*[data-mce-selected]"),(function(t){Pe(c,t)||rr(t,l)})),r.getAttrib(o,l)||o.setAttribute(l,"1"),e=o,w(),u},b=function(t,e){if(!t)return null;if(t.collapsed){if(!m(t)){var n=e?1:-1,o=uc(n,i,t),a=o.getNode(!e);if(Fu(a))return h(n,a,!!e&&!o.isAtEnd(),!1);var s=o.getNode(e);if(Fu(s))return h(n,s,!e&&!o.isAtEnd(),!1)}return null}var l=t.startContainer,c=t.startOffset,d=t.endOffset;if(3===l.nodeType&&0===c&&Fx(l.parentNode)&&(l=l.parentNode,c=r.nodeIndex(l),l=l.parentNode),1!==l.nodeType)return null;if(d===c+1&&l===t.endContainer){var f=l.childNodes[c];if(u(f))return v(f)}return null},_=function(){e&&e.removeAttribute(l),Jr(De.fromDom(t.getBody()),"#"+s).each(vn),e=null},w=function(){a.hide()};return Ce.ceFalse&&!Xv(t)&&function(){t.on("mouseup",(function(e){var n=f();n.collapsed&&vb(t,e.clientX,e.clientY)&&D_(t,n,!1).each(d)})),t.on("click",(function(e){var o=Ux(t,e.target);o&&(Fx(o)&&(e.preventDefault(),t.focus()),qx(o)&&r.isChildOf(o,n.getNode())&&_())})),t.on("blur NewBlock",_),t.on("ResizeWindow FullscreenStateChanged",a.reposition);var l=function(e,n){var i,a,s=r.getParent(e,o),l=r.getParent(n,o);return!y(s)&&(!(e===l||!r.isChildOf(s,l)||!1!==Fx(Ux(t,s)))||!r.isChildOf(l,s)&&(i=s,a=l,!(r.getParent(i,o)===r.getParent(a,o)))&&function(t){var e=t.firstChild;if(y(e))return!1;var n=Al.before(e);if(zn(n.getNode())&&1===t.childNodes.length)return!c(n);var r=xc(t).next(n);return r&&!c(r)}(s))};t.on("tap",(function(e){var n=e.target,r=Ux(t,n);Fx(r)?(e.preventDefault(),A_(t,r).each(b)):u(n)&&A_(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!==vb(t,e.clientX,e.clientY)){var a=Ux(t,o);if(a)Fx(a)?(e.preventDefault(),A_(t,a).each(b)):(_(),qx(a)&&e.shiftKey||tf(e.clientX,e.clientY,n.getRng())||(w(),n.placeCaretAt(e.clientX,e.clientY)));else if(u(o))A_(t,o).each(b);else if(!1===Fu(o)){_(),w();var s=Qw(i,e.clientX,e.clientY);if(s&&!l(o,s.node)){e.preventDefault();var c=h(1,s.node,s.before,!1);d(c),t.getBody().focus()}}}})),t.on("keypress",(function(t){of.modifierPressed(t)||Fx(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))}})),Bx(t),function(t){var e=Ts((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=L_(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=Qd(t.getBody(),n),o=Wn(r)?r:n;t.selection.getNode()!==o&&A_(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))}(t)}(),{showCaret:h,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&($o(t),d(f()),n.scrollIntoView(t))},hideFakeCaret:w,destroy:function(){a.destroy(),e=null}}},Hx=function(t){var e,n,r=Te.each,o=of.BACKSPACE,i=of.DELETE,a=t.dom,s=t.selection,l=t.parser,u=Ce.gecko,c=Ce.ie,d=Ce.webkit,f="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,l=n.keyCode;if(!m(n)&&(l===i||l===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(To(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),gu(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}")},O=function(){t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()}))},E=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()}})))},T=function(){Ce.mac&&t.on("keydown",(function(e){!of.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}))},A=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()}))}))},L=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=f+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(f)>=0?(e=e.substr(f.length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=uf(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}))},N=k;return Xv(t)?(d&&(y(),_(),D(),v(),Ce.iOS&&(O(),E(),A())),u&&(b(),C(),S(),T())):(t.on("keydown",(function(e){var n,r;if(!m(e)&&e.keyCode===of.BACKSPACE){var o=(n=s.getRng()).startContainer,i=n.startOffset,l=a.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==l;)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){of.modifierPressed(t)||s.normalize()}),!0),d&&(y(),_(),nu(t)&&t.on("init",(function(){p("DefaultParagraphSeparator",nu(t))})),D(),w(),l.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),Ce.iOS?(O(),E(),A()):v()),Ce.ie>=11&&(E(),w()),Ce.ie&&(v(),p("AutoUrlDetect",!1),L()),u&&(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(),T(),w())),{refreshContentEditable:N,isHidden:function(){if(!u||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}},Vx=gs.DOM,Wx=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},Kx=function(t){return vt(t,(function(t){return!1===v(t)}))},Yx=function(t){var e=t.settings,n=t.editorUpload.blobCache;return Kx({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:Wx(t),validate:!0,blob_cache:n,document:t.getDoc(),images_dataimg_filter:e.images_dataimg_filter})},Zx=function(t){var e=t.dom.getRoot();t.inline||Ud(t)&&t.selection.getStart(!0)!==e||$c(e).each((function(e){var n=e.getNode(),r=jn(n)?$c(n).getOr(e):e;Ce.browser.isIE()?function(t,e){var n=De.fromDom(t.getBody()),r=(rh(t)?R.from(e):R.none()).map(oh).filter(nh(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))},Gx=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),Zx(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)},Xx=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader},Jx=function(t){var e=Xx(t),n=mu(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="";Te.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 Xx(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=ln(sn(n)),o=De.fromTag("style");Qn(o,"type","text/css"),pn(o,De.fromText(e)),pn(r,o),t.on("remove",(function(){vn(o)}))}(t,t.settings.content_style),s},Qx=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,Vx.setAttrib(r,"spellcheck","false")),t.quirks=Hx(t),function(t){t.fire("PostRender")}(t);var o=function(t){return t.getParam("directionality",Ss.isRtl()?"rtl":void 0)}(t);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",(function(t){Te.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}))},tS=function(t){!0!==t.removed&&(!function(t){Xv(t)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"})}(t),Gx(t))},eS=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&&(Vx.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"===Vx.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=Mb(t),t.schema=Ai(n),t.dom=gs(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:du(t),referrerPolicy:fu(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=Ty(Yx(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 Ih("br",1)).shortEnded=!0)}})),e}(t),t.serializer=Iy(function(t){var e=t.settings;return Dt(Dt({},Yx(t)),Kx({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,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}))}(t),t),t.selection=cy(t.dom,t.getWin(),t.serializer,t),t.annotator=Xd(t),t.formatter=Vb(t),t.undoManager=Kb(t),t._nodeChangeDispatcher=new Sx(t),t._selectionOverrides=zx(t),jk(t),Ox(t),Xv(t)||Tx(t);var a=function(t){return Xv(t)?ws(null):xx(t)}(t);Pk(t,a),function(t){nu(t)&&t.on("NodeChange",T(qk,t))}(t),Jb(t);var s=Jv(t);Qx(t),s.fold((function(){Jx(t).then((function(){return tS(t)}))}),(function(e){t.setProgressState(!0),Jx(t).then((function(){e().then((function(e){t.setProgressState(!1),tS(t)}),(function(e){t.notificationManager.open({type:"error",text:String(e)}),tS(t)}))}))}))},nS=gs.DOM,rS=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._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(t){var e={attributes:{},insert:t.insert};return t.attributes&&["bold","strike","italic","underline","list","blockquote","link"].some((function(n){t.attributes[n]&&(e.attributes[n]=t.attributes[n])})),e})),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})}))))}))},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.dialogId||"t_".concat(this.taskId),e=this.dialogInputCache.find((function(e){return e.key==t}));return e?e.cache:""},setInputCache:function(t){var e=this,n=this.dialogId||"t_".concat(this.taskId),r=this.dialogInputCache.findIndex((function(t){return t.key==n})),o={key:n,cache:t};r>-1?this.$store.state.dialogInputCache.splice(r,1,o):this.$store.state.dialogInputCache.push(o),this.__setInputCache&&clearTimeout(this.__setInputCache),this.__setInputCache=setTimeout((function(t){$A.setStorage("cacheDialogInput",e.$store.state.dialogInputCache)}),600)},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&&(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.showEmoji=!1,this.showMore=!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)}},onSelectEmoji:function(t){if(this.quill)if("emoji"===t.type){var e=document.createElement("span");e.innerHTML=t.html,this.quill.insertText(this.rangeIndex,e.innerHTML),this.rangeIndex+=e.innerHTML.length,e=null,this.windowLarge&&(this.showEmoji=!1,this.quill.setSelection(this.rangeIndex))}else"emoticon"===t.type&&(this.$emit("on-send",'')),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":R.Store.set("addMeeting",{type:"create",dialog_id:this.dialogId,userids:[this.userId]});break;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||s.Store.set("audioSubscribe",{id:this.msgData.id,src:this.msgData.msg.path})},openMeeting:function(){this.operateVisible||s.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})},onEmoji:function(t){this.$emit("on-emoji",{msg_id:this.msgData.id,symbol:t})}}};function f(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 h(t){for(var e=1;e
\s*<\/p>)+|(
\s*<\/p>)+$/gi,"")).replace(/^(
<\/p>)+|(
<\/p>)+$/gi,""),t._content=n,t.$emit("input",t._content),t.$nextTick((function(e){var n=t.quill.getSelection();if(n){var i=t.quill.getText(n.index);/^\n\n$/.test(i)&&t.quill.deleteText(n.index,1)}}))})),this.quill.clipboard.addMatcher(Node.ELEMENT_NODE,(function(t,e){return e.ops=e.ops.map((function(t){var e={attributes:{},insert:t.insert};return t.attributes&&["bold","strike","italic","underline","list","blockquote","link"].some((function(n){t.attributes[n]&&(e.attributes[n]=t.attributes[n])})),e})),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,i,o,r,s){t.recordWave.input(e[e.length-1],n,o),t.recordDuration=i,i>=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})}))))}))},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.dialogId||"t_".concat(this.taskId),e=this.dialogInputCache.find((function(e){return e.key==t}));return e?e.cache:""},setInputCache:function(t){var e=this,n=this.dialogId||"t_".concat(this.taskId),i=this.dialogInputCache.findIndex((function(t){return t.key==n})),o={key:n,cache:t};i>-1?this.$store.state.dialogInputCache.splice(i,1,o):this.$store.state.dialogInputCache.push(o),this.__setInputCache&&clearTimeout(this.__setInputCache),this.__setInputCache=setTimeout((function(t){$A.setStorage("cacheDialogInput",e.$store.state.dialogInputCache)}),600)},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&&(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,i){e.recordRec.close(),!0!==t&&(i<600?$A.messageWarning("说话时间太短"):(e.recordBlob=n,e.uploadRecord(i)))}),(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.showEmoji=!1,this.showMore=!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)}},onSelectEmoji:function(t){if(this.quill)if("emoji"===t.type){var e=document.createElement("span");e.innerHTML=t.html,this.quill.insertText(this.rangeIndex,e.innerHTML),this.rangeIndex+=e.innerHTML.length,e=null,this.windowLarge&&(this.showEmoji=!1,this.quill.setSelection(this.rangeIndex))}else"emoticon"===t.type&&(this.$emit("on-send",'')),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"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(i.text))&&r.push("transparent"),r},contentClass:function(){var t=this.msgData,e=t.type,n=t.msg,i=[];return"text"===e&&(/^]*?>$/.test(n.text)?i.push("an-emoticon"):/^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){3}\s*<\/p>\s*$/.test(n.text)?i.push("three-emoji"):/^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){2}\s*<\/p>\s*$/.test(n.text)?i.push("two-emoji"):/^\s*
\s*[\uD800-\uDBFF][\uDC00-\uDFFF]\s*<\/p>\s*$/.test(n.text)&&i.push("an-emoji")),i}}),watch:{operateAction:function(t){var e=this;this.operateEnter=!1,t&&setTimeout((function(t){e.operateEnter=!0}),500)}},methods:{handleLongpress:function(t,e){this.$emit("on-longpress",{event:t,el:e,msgData:this.msgData})},openReadPercentage:function(){var t=this;this.popperLoad>0||(this.popperShow?this.popperShow=!1:(this.popperLoad++,this.$store.dispatch("call",{url:"dialog/msg/readlist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.allList=n})).catch((function(){t.allList=[]})).finally((function(e){setTimeout((function(){t.popperLoad--,t.popperShow=!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 i=e,o=n;return(e>220||n>220)&&(e>n?(i=220,o=n*(220/e)):(i=e*(220/n),o=220)),{width:i+"px",height:o+"px"}}return{}},playRecord:function(){this.operateVisible||a.Store.set("audioSubscribe",{id:this.msgData.id,src:this.msgData.msg.path})},openMeeting:function(){this.operateVisible||a.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})},onEmoji:function(t){this.$emit("on-emoji",{msg_id:this.msgData.id,symbol:t})}}};function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function h(t){for(var e=1;e